gitlab.com/danp128/sqlite@v1.0.0/internal/bin/bin_linux_386.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_STDC_PREDEF_H                        = 1
   445  	X__ATOMIC_ACQUIRE                      = 2
   446  	X__ATOMIC_ACQ_REL                      = 4
   447  	X__ATOMIC_CONSUME                      = 1
   448  	X__ATOMIC_HLE_ACQUIRE                  = 65536
   449  	X__ATOMIC_HLE_RELEASE                  = 131072
   450  	X__ATOMIC_RELAXED                      = 0
   451  	X__ATOMIC_RELEASE                      = 3
   452  	X__ATOMIC_SEQ_CST                      = 5
   453  	X__BIGGEST_ALIGNMENT__                 = 16
   454  	X__BYTE_ORDER__                        = 1234
   455  	X__CHAR_BIT__                          = 8
   456  	X__DBL_DECIMAL_DIG__                   = 17
   457  	X__DBL_DIG__                           = 15
   458  	X__DBL_HAS_DENORM__                    = 1
   459  	X__DBL_HAS_INFINITY__                  = 1
   460  	X__DBL_HAS_QUIET_NAN__                 = 1
   461  	X__DBL_MANT_DIG__                      = 53
   462  	X__DBL_MAX_10_EXP__                    = 308
   463  	X__DBL_MAX_EXP__                       = 1024
   464  	X__DBL_MIN_10_EXP__                    = -307
   465  	X__DBL_MIN_EXP__                       = -1021
   466  	X__DEC128_MANT_DIG__                   = 34
   467  	X__DEC128_MAX_EXP__                    = 6145
   468  	X__DEC128_MIN_EXP__                    = -6142
   469  	X__DEC32_MANT_DIG__                    = 7
   470  	X__DEC32_MAX_EXP__                     = 97
   471  	X__DEC32_MIN_EXP__                     = -94
   472  	X__DEC64_MANT_DIG__                    = 16
   473  	X__DEC64_MAX_EXP__                     = 385
   474  	X__DEC64_MIN_EXP__                     = -382
   475  	X__DECIMAL_BID_FORMAT__                = 1
   476  	X__DECIMAL_DIG__                       = 21
   477  	X__DEC_EVAL_METHOD__                   = 2
   478  	X__FINITE_MATH_ONLY__                  = 0
   479  	X__FLOAT_WORD_ORDER__                  = 1234
   480  	X__FLT_DECIMAL_DIG__                   = 9
   481  	X__FLT_DENORM_MIN__                    = 1e-45
   482  	X__FLT_DIG__                           = 6
   483  	X__FLT_EPSILON__                       = 1.1920929e-07
   484  	X__FLT_EVAL_METHOD__                   = 2
   485  	X__FLT_HAS_DENORM__                    = 1
   486  	X__FLT_HAS_INFINITY__                  = 1
   487  	X__FLT_HAS_QUIET_NAN__                 = 1
   488  	X__FLT_MANT_DIG__                      = 24
   489  	X__FLT_MAX_10_EXP__                    = 38
   490  	X__FLT_MAX_EXP__                       = 128
   491  	X__FLT_MAX__                           = 3.4028235e+38
   492  	X__FLT_MIN_10_EXP__                    = -37
   493  	X__FLT_MIN_EXP__                       = -125
   494  	X__FLT_MIN__                           = 1.1754944e-38
   495  	X__FLT_RADIX__                         = 2
   496  	X__FUNCTION__                          = 0
   497  	X__GXX_ABI_VERSION                     = 1010
   498  	X__INT16_MAX__                         = 32767
   499  	X__INT32_MAX__                         = 2147483647
   500  	X__INT32_TYPE__                        = 0
   501  	X__INT64_MAX__                         = 9223372036854775807
   502  	X__INT8_MAX__                          = 127
   503  	X__INTMAX_MAX__                        = 9223372036854775807
   504  	X__INTPTR_MAX__                        = 2147483647
   505  	X__INTPTR_TYPE__                       = 0
   506  	X__INT_FAST16_MAX__                    = 2147483647
   507  	X__INT_FAST16_TYPE__                   = 0
   508  	X__INT_FAST32_MAX__                    = 2147483647
   509  	X__INT_FAST32_TYPE__                   = 0
   510  	X__INT_FAST64_MAX__                    = 9223372036854775807
   511  	X__INT_FAST8_MAX__                     = 127
   512  	X__INT_LEAST16_MAX__                   = 32767
   513  	X__INT_LEAST32_MAX__                   = 2147483647
   514  	X__INT_LEAST32_TYPE__                  = 0
   515  	X__INT_LEAST64_MAX__                   = 9223372036854775807
   516  	X__INT_LEAST8_MAX__                    = 127
   517  	X__INT_MAX__                           = 2147483647
   518  	X__LDBL_DENORM_MIN__                   = 0
   519  	X__LDBL_DIG__                          = 18
   520  	X__LDBL_EPSILON__                      = 1.0842021724855044e-19
   521  	X__LDBL_HAS_DENORM__                   = 1
   522  	X__LDBL_HAS_INFINITY__                 = 1
   523  	X__LDBL_HAS_QUIET_NAN__                = 1
   524  	X__LDBL_MANT_DIG__                     = 64
   525  	X__LDBL_MAX_10_EXP__                   = 4932
   526  	X__LDBL_MAX_EXP__                      = 16384
   527  	X__LDBL_MAX__                          = 0
   528  	X__LDBL_MIN_10_EXP__                   = -4931
   529  	X__LDBL_MIN_EXP__                      = -16381
   530  	X__LDBL_MIN__                          = 0
   531  	X__LONG_LONG_MAX__                     = 9223372036854775807
   532  	X__LONG_MAX__                          = 2147483647
   533  	X__NO_INLINE__                         = 1
   534  	X__ORDER_BIG_ENDIAN__                  = 4321
   535  	X__ORDER_LITTLE_ENDIAN__               = 1234
   536  	X__ORDER_PDP_ENDIAN__                  = 3412
   537  	X__PRAGMA_REDEFINE_EXTNAME             = 1
   538  	X__PTRDIFF_MAX__                       = 2147483647
   539  	X__PTRDIFF_TYPE__                      = 0
   540  	X__SCHAR_MAX__                         = 127
   541  	X__SEG_FS                              = 1
   542  	X__SEG_GS                              = 1
   543  	X__SHRT_MAX__                          = 32767
   544  	X__SIG_ATOMIC_MAX__                    = 2147483647
   545  	X__SIG_ATOMIC_MIN__                    = -2147483648
   546  	X__SIG_ATOMIC_TYPE__                   = 0
   547  	X__SIZEOF_DOUBLE__                     = 8
   548  	X__SIZEOF_FLOAT128__                   = 16
   549  	X__SIZEOF_FLOAT80__                    = 12
   550  	X__SIZEOF_FLOAT__                      = 4
   551  	X__SIZEOF_INT__                        = 4
   552  	X__SIZEOF_LONG_DOUBLE__                = 12
   553  	X__SIZEOF_LONG_LONG__                  = 8
   554  	X__SIZEOF_LONG__                       = 4
   555  	X__SIZEOF_POINTER__                    = 4
   556  	X__SIZEOF_PTRDIFF_T__                  = 4
   557  	X__SIZEOF_SHORT__                      = 2
   558  	X__SIZEOF_SIZE_T__                     = 4
   559  	X__SIZEOF_WCHAR_T__                    = 4
   560  	X__SIZEOF_WINT_T__                     = 4
   561  	X__SIZE_MAX__                          = 4294967295
   562  	X__SSP_STRONG__                        = 3
   563  	X__STDC_HOSTED__                       = 1
   564  	X__STDC_IEC_559_COMPLEX__              = 1
   565  	X__STDC_IEC_559__                      = 1
   566  	X__STDC_ISO_10646__                    = 201505
   567  	X__STDC_NO_THREADS__                   = 1
   568  	X__STDC_VERSION__                      = 199901
   569  	X__STDC__                              = 1
   570  	X__STRICT_ANSI__                       = 1
   571  	X__UINT16_MAX__                        = 65535
   572  	X__UINT32_MAX__                        = 4294967295
   573  	X__UINT64_MAX__                        = 18446744073709551615
   574  	X__UINT8_MAX__                         = 255
   575  	X__UINTMAX_MAX__                       = 18446744073709551615
   576  	X__UINTPTR_MAX__                       = 4294967295
   577  	X__UINT_FAST16_MAX__                   = 4294967295
   578  	X__UINT_FAST32_MAX__                   = 4294967295
   579  	X__UINT_FAST64_MAX__                   = 18446744073709551615
   580  	X__UINT_FAST8_MAX__                    = 255
   581  	X__UINT_LEAST16_MAX__                  = 65535
   582  	X__UINT_LEAST32_MAX__                  = 4294967295
   583  	X__UINT_LEAST64_MAX__                  = 18446744073709551615
   584  	X__UINT_LEAST8_MAX__                   = 255
   585  	X__VERSION__                           = "6.2.0 20161005"
   586  	X__WCHAR_MAX__                         = 2147483647
   587  	X__WCHAR_MIN__                         = -2147483648
   588  	X__WINT_MAX__                          = 4294967295
   589  	X__WINT_MIN__                          = 0
   590  	X__code_model_32__                     = 1
   591  	X__complex__                           = 0
   592  	X__const                               = 0
   593  	X__i386                                = 1
   594  	X__i386__                              = 1
   595  	X__i686                                = 1
   596  	X__i686__                              = 1
   597  	X__inline                              = 0
   598  	X__linux                               = 1
   599  	X__linux__                             = 1
   600  	X__pentiumpro                          = 1
   601  	X__pentiumpro__                        = 1
   602  	X__restrict                            = 0
   603  	X__unix                                = 1
   604  	X__unix__                              = 1
   605  	X__volatile                            = 0
   606  )
   607  
   608  func X_start(tls *crt.TLS, _argc int32, _argv **int8) {
   609  	crt.X__register_stdfiles(tls, Xstdin, Xstdout, Xstderr)
   610  	crt.X__builtin_exit(tls, Xmain(tls, _argc, _argv))
   611  }
   612  
   613  var Xstdin unsafe.Pointer
   614  
   615  func init() {
   616  	Xstdin = unsafe.Pointer(&X__stdfiles)
   617  }
   618  
   619  var X__stdfiles [3]unsafe.Pointer
   620  
   621  var Xstdout unsafe.Pointer
   622  
   623  func init() {
   624  	Xstdout = unsafe.Pointer(uintptr(unsafe.Pointer(&X__stdfiles)) + 4)
   625  }
   626  
   627  var Xstderr unsafe.Pointer
   628  
   629  func init() {
   630  	Xstderr = unsafe.Pointer(uintptr(unsafe.Pointer(&X__stdfiles)) + 8)
   631  }
   632  
   633  func Xmain(tls *crt.TLS, _argc int32, _argv **int8) (r0 int32) {
   634  	return int32(0)
   635  }
   636  
   637  func Xsqlite3PendingByte() int32 { return _sqlite3PendingByte }
   638  
   639  // C comment
   640  //  /*
   641  //  ** CAPI3REF: Run-Time Library Version Numbers
   642  //  ** KEYWORDS: sqlite3_version sqlite3_sourceid
   643  //  **
   644  //  ** These interfaces provide the same information as the [SQLITE_VERSION],
   645  //  ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
   646  //  ** but are associated with the library instead of the header file.  ^(Cautious
   647  //  ** programmers might include assert() statements in their application to
   648  //  ** verify that values returned by these interfaces match the macros in
   649  //  ** the header, and thus ensure that the application is
   650  //  ** compiled with matching library and header files.
   651  //  **
   652  //  ** <blockquote><pre>
   653  //  ** assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
   654  //  ** assert( strcmp(sqlite3_sourceid(),SQLITE_SOURCE_ID)==0 );
   655  //  ** assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 );
   656  //  ** </pre></blockquote>)^
   657  //  **
   658  //  ** ^The sqlite3_version[] string constant contains the text of [SQLITE_VERSION]
   659  //  ** macro.  ^The sqlite3_libversion() function returns a pointer to the
   660  //  ** to the sqlite3_version[] string constant.  The sqlite3_libversion()
   661  //  ** function is provided for use in DLLs since DLL users usually do not have
   662  //  ** direct access to string constants within the DLL.  ^The
   663  //  ** sqlite3_libversion_number() function returns an integer equal to
   664  //  ** [SQLITE_VERSION_NUMBER].  ^The sqlite3_sourceid() function returns
   665  //  ** a pointer to a string constant whose value is the same as the
   666  //  ** [SQLITE_SOURCE_ID] C preprocessor macro.
   667  //  **
   668  //  ** See also: [sqlite_version()] and [sqlite_source_id()].
   669  //  */
   670  var Xsqlite3_version [7]int8
   671  
   672  func init() {
   673  	crt.Xstrncpy(nil, &Xsqlite3_version[0], str(0), 7)
   674  }
   675  
   676  // C comment
   677  //  /* IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns
   678  //  ** a pointer to the to the sqlite3_version[] string constant.
   679  //  */
   680  func Xsqlite3_libversion(tls *crt.TLS) (r0 *int8) {
   681  	return (*int8)(unsafe.Pointer(&Xsqlite3_version))
   682  }
   683  
   684  // C comment
   685  //  /* IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a
   686  //  ** pointer to a string constant whose value is the same as the
   687  //  ** SQLITE_SOURCE_ID C preprocessor macro.
   688  //  */
   689  func Xsqlite3_sourceid(tls *crt.TLS) (r0 *int8) {
   690  	return str(7)
   691  }
   692  
   693  // C comment
   694  //  /* IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function
   695  //  ** returns an integer equal to SQLITE_VERSION_NUMBER.
   696  //  */
   697  func Xsqlite3_libversion_number(tls *crt.TLS) (r0 int32) {
   698  	return int32(3019003)
   699  }
   700  
   701  // C comment
   702  //  /*
   703  //  ** Given the name of a compile-time option, return true if that option
   704  //  ** was used and false if not.
   705  //  **
   706  //  ** The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix
   707  //  ** is not required for a match.
   708  //  */
   709  func Xsqlite3_compileoption_used(tls *crt.TLS, _zOptName *int8) (r0 int32) {
   710  	var _i, _n int32
   711  	if _zOptName == nil {
   712  		_sqlite3MisuseError(tls, int32(17883))
   713  		return int32(0)
   714  	}
   715  	if Xsqlite3_strnicmp(tls, _zOptName, str(92), int32(7)) == int32(0) {
   716  		*(*uintptr)(unsafe.Pointer(&_zOptName)) += uintptr(int32(7))
   717  	}
   718  	_n = _sqlite3Strlen30(tls, _zOptName)
   719  	_i = int32(0)
   720  _2:
   721  	if _i >= int32(6) {
   722  		goto _5
   723  	}
   724  	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)) {
   725  		return int32(1)
   726  	}
   727  	_i += 1
   728  	goto _2
   729  _5:
   730  	return int32(0)
   731  }
   732  
   733  func _sqlite3MisuseError(tls *crt.TLS, _lineno int32) (r0 int32) {
   734  	return _reportError(tls, int32(21), _lineno, str(100))
   735  }
   736  
   737  // C comment
   738  //  /*
   739  //  ** The following routines are substitutes for constants SQLITE_CORRUPT,
   740  //  ** SQLITE_MISUSE, SQLITE_CANTOPEN, SQLITE_NOMEM and possibly other error
   741  //  ** constants.  They serve two purposes:
   742  //  **
   743  //  **   1.  Serve as a convenient place to set a breakpoint in a debugger
   744  //  **       to detect when version error conditions occurs.
   745  //  **
   746  //  **   2.  Invoke sqlite3_log() to provide the source code location where
   747  //  **       a low-level error is first detected.
   748  //  */
   749  func _reportError(tls *crt.TLS, _iErr int32, _lineno int32, _zType *int8) (r0 int32) {
   750  	Xsqlite3_log(tls, _iErr, str(107), unsafe.Pointer(_zType), _lineno, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(int32(20))+uintptr(unsafe.Pointer(Xsqlite3_sourceid(tls)))))))
   751  	return _iErr
   752  }
   753  
   754  // C comment
   755  //  /*
   756  //  ** Format and write a message to the log if logging is enabled.
   757  //  */
   758  func Xsqlite3_log(tls *crt.TLS, _iErrCode int32, _zFormat *int8, args ...interface{}) {
   759  	var _ap []interface{}
   760  	if _sqlite3Config.XxLog != nil {
   761  		_ap = args
   762  		_renderLogMsg(tls, _iErrCode, _zFormat, _ap)
   763  		_ap = nil
   764  	}
   765  }
   766  
   767  // C comment
   768  //  /*
   769  //  ** The following singleton contains the global configuration for
   770  //  ** the SQLite library.
   771  //  */
   772  var _sqlite3Config TSqlite3Config
   773  
   774  func init() {
   775  	_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)}
   776  }
   777  
   778  // C comment
   779  //  /*
   780  //  ** This is the routine that actually formats the sqlite3_log() message.
   781  //  ** We house it in a separate routine from sqlite3_log() to avoid using
   782  //  ** stack space on small-stack systems when logging is disabled.
   783  //  **
   784  //  ** sqlite3_log() must render into a static buffer.  It cannot dynamically
   785  //  ** allocate memory because it might be called while the memory allocator
   786  //  ** mutex is held.
   787  //  **
   788  //  ** sqlite3VXPrintf() might ask for *temporary* memory allocations for
   789  //  ** certain format characters (%q) or for very large precisions or widths.
   790  //  ** Care must be taken that any sqlite3_log() calls that occur while the
   791  //  ** memory mutex is held do not use these mechanisms.
   792  //  */
   793  func _renderLogMsg(tls *crt.TLS, _iErrCode int32, _zFormat *int8, _ap []interface{}) {
   794  	var _acc XStrAccum
   795  	var _zMsg [210]int8
   796  	_sqlite3StrAccumInit(tls, &_acc, nil, (*int8)(unsafe.Pointer(&_zMsg)), int32(210), int32(0))
   797  	_sqlite3VXPrintf(tls, &_acc, _zFormat, _ap)
   798  	_sqlite3Config.XxLog(tls, _sqlite3Config.XpLogArg, _iErrCode, _sqlite3StrAccumFinish(tls, &_acc))
   799  	_ = _zMsg
   800  }
   801  
   802  // C comment
   803  //  /*
   804  //  ** Initialize a string accumulator.
   805  //  **
   806  //  ** p:     The accumulator to be initialized.
   807  //  ** db:    Pointer to a database connection.  May be NULL.  Lookaside
   808  //  **        memory is used if not NULL. db->mallocFailed is set appropriately
   809  //  **        when not NULL.
   810  //  ** zBase: An initial buffer.  May be NULL in which case the initial buffer
   811  //  **        is malloced.
   812  //  ** n:     Size of zBase in bytes.  If total space requirements never exceed
   813  //  **        n then no memory allocations ever occur.
   814  //  ** mx:    Maximum number of bytes to accumulate.  If mx==0 then no memory
   815  //  **        allocations will ever occur.
   816  //  */
   817  func _sqlite3StrAccumInit(tls *crt.TLS, _p *XStrAccum, _db *Xsqlite3, _zBase *int8, _n int32, _mx int32) {
   818  	_p.XzText = store1(&_p.XzBase, _zBase)
   819  	*(**Xsqlite3)(unsafe.Pointer(&_p.Xdb)) = _db
   820  	_p.XnChar = 0
   821  	_p.XnAlloc = uint32(_n)
   822  	_p.XmxAlloc = uint32(_mx)
   823  	_p.XaccError = 0
   824  	_p.XprintfFlags = 0
   825  }
   826  
   827  // C comment
   828  //  /*
   829  //  ** Render a string given by "fmt" into the StrAccum object.
   830  //  */
   831  func _sqlite3VXPrintf(tls *crt.TLS, _pAccum *XStrAccum, _fmt *int8, _ap []interface{}) {
   832  	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
   833  	var _29_v int64
   834  	var _prefix, _57_x, _110_ch, _110_q int8
   835  	var _13_wx, _20_px uint32
   836  	var _longvalue, _47_n uint64
   837  	var _bufpt, _zOut, _zExtra, _51_cset, _57_pre, _110_escarg *int8
   838  	var _realvalue, _rounder, _64_scale float64
   839  	var _flag_leftjustify, _flag_prefix, _flag_alternateform, _flag_altform2, _flag_zeropad, _flag_long, _done, _cThousand, _xtype, _bArgList, _flag_dp, _flag_rtz, _51_base uint8
   840  	var _pArgList *XPrintfArguments
   841  	var _infop *Xet_info
   842  	var _buf [70]int8
   843  	var _118_pToken *XToken
   844  	var _120_pSrc *XSrcList
   845  	var _120_pItem *TSrcList_item
   846  	_xtype = uint8(17)
   847  	_zExtra = nil
   848  	_pArgList = nil
   849  	_bufpt = nil
   850  	if (int32(_pAccum.XprintfFlags) & int32(2)) != int32(0) {
   851  		_pArgList = (*XPrintfArguments)(crt.VAPointer(&_ap))
   852  		_bArgList = uint8(1)
   853  		goto _1
   854  	}
   855  	_bArgList = 0
   856  _1:
   857  	if store2(&_c, int32(*_fmt)) == int32(0) {
   858  		goto _5
   859  	}
   860  	if _c == int32(37) {
   861  		goto _6
   862  	}
   863  	_bufpt = _fmt
   864  _7:
   865  	*(*uintptr)(unsafe.Pointer(&_fmt)) += uintptr(1)
   866  	if ((*_fmt) != 0) && (int32(*_fmt) != int32(37)) {
   867  		goto _7
   868  	}
   869  	_sqlite3StrAccumAppend(tls, _pAccum, _bufpt, int32(uintptr(unsafe.Pointer(_fmt))-uintptr(unsafe.Pointer(_bufpt))))
   870  	if int32(*_fmt) == int32(0) {
   871  		goto _5
   872  	}
   873  _6:
   874  	if store2(&_c, int32(*preInc1(&_fmt, 1))) == int32(0) {
   875  		_sqlite3StrAccumAppend(tls, _pAccum, str(132), int32(1))
   876  		goto _5
   877  	}
   878  	_flag_leftjustify = store3(&_flag_prefix, store3(&_cThousand, store3(&_flag_alternateform, store3(&_flag_altform2, store3(&_flag_zeropad, 0)))))
   879  	_done = 0
   880  _11:
   881  	switch _c {
   882  	case int32(32):
   883  		goto _15
   884  	case int32(33):
   885  		goto _17
   886  	case int32(35):
   887  		goto _16
   888  	case int32(43):
   889  		goto _14
   890  	case int32(44):
   891  		goto _19
   892  	case int32(45):
   893  		goto _13
   894  	case int32(48):
   895  		goto _18
   896  	default:
   897  		goto _20
   898  	}
   899  
   900  _13:
   901  	_flag_leftjustify = uint8(1)
   902  	goto _21
   903  _14:
   904  	_flag_prefix = uint8(43)
   905  	goto _21
   906  _15:
   907  	_flag_prefix = uint8(32)
   908  	goto _21
   909  _16:
   910  	_flag_alternateform = uint8(1)
   911  	goto _21
   912  _17:
   913  	_flag_altform2 = uint8(1)
   914  	goto _21
   915  _18:
   916  	_flag_zeropad = uint8(1)
   917  	goto _21
   918  _19:
   919  	_cThousand = uint8(44)
   920  	goto _21
   921  _20:
   922  	_done = uint8(1)
   923  	goto _21
   924  _21:
   925  	if (_done == 0) && (store2(&_c, int32(*preInc1(&_fmt, 1))) != int32(0)) {
   926  		goto _11
   927  	}
   928  	if _c != int32(42) {
   929  		goto _23
   930  	}
   931  	if _bArgList != 0 {
   932  		_width = int32(_getIntArg(tls, _pArgList))
   933  		goto _25
   934  	}
   935  	_width = crt.VAInt32(&_ap)
   936  _25:
   937  	if _width < int32(0) {
   938  		_flag_leftjustify = uint8(1)
   939  		_width = func() int32 {
   940  			if _width >= int32(-2147483647) {
   941  				return (-_width)
   942  			}
   943  			return int32(0)
   944  		}()
   945  	}
   946  	_c = int32(*preInc1(&_fmt, 1))
   947  	goto _29
   948  _23:
   949  	_13_wx = 0
   950  _30:
   951  	if (_c >= int32(48)) && (_c <= int32(57)) {
   952  		_13_wx = ((_13_wx * uint32(10)) + uint32(_c)) - uint32(48)
   953  		_c = int32(*preInc1(&_fmt, 1))
   954  		goto _30
   955  	}
   956  	_width = int32(_13_wx & uint32(2147483647))
   957  _29:
   958  	func() {
   959  		if _width < int32(0) {
   960  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25327), unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000), unsafe.Pointer(str(228)))
   961  			crt.X__builtin_abort(tls)
   962  		}
   963  	}()
   964  	if _c != int32(46) {
   965  		goto _35
   966  	}
   967  	_c = int32(*preInc1(&_fmt, 1))
   968  	if _c != int32(42) {
   969  		goto _36
   970  	}
   971  	if _bArgList != 0 {
   972  		_precision = int32(_getIntArg(tls, _pArgList))
   973  		goto _38
   974  	}
   975  	_precision = crt.VAInt32(&_ap)
   976  _38:
   977  	_c = int32(*preInc1(&_fmt, 1))
   978  	if _precision < int32(0) {
   979  		_precision = func() int32 {
   980  			if _precision >= int32(-2147483647) {
   981  				return (-_precision)
   982  			}
   983  			return int32(-1)
   984  		}()
   985  	}
   986  	goto _42
   987  _36:
   988  	_20_px = 0
   989  _43:
   990  	if (_c >= int32(48)) && (_c <= int32(57)) {
   991  		_20_px = ((_20_px * uint32(10)) + uint32(_c)) - uint32(48)
   992  		_c = int32(*preInc1(&_fmt, 1))
   993  		goto _43
   994  	}
   995  	_precision = int32(_20_px & uint32(2147483647))
   996  _42:
   997  	goto _46
   998  _35:
   999  	_precision = int32(-1)
  1000  _46:
  1001  	func() {
  1002  		if _precision < int32(-1) {
  1003  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25359), unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000), unsafe.Pointer(str(237)))
  1004  			crt.X__builtin_abort(tls)
  1005  		}
  1006  	}()
  1007  	if _c != int32(108) {
  1008  		goto _49
  1009  	}
  1010  	_flag_long = uint8(1)
  1011  	_c = int32(*preInc1(&_fmt, 1))
  1012  	if _c == int32(108) {
  1013  		_flag_long = uint8(2)
  1014  		_c = int32(*preInc1(&_fmt, 1))
  1015  	}
  1016  	goto _51
  1017  _49:
  1018  	_flag_long = 0
  1019  _51:
  1020  	_infop = elem4((*Xet_info)(unsafe.Pointer(&_fmtinfo)), 0)
  1021  	_xtype = uint8(17)
  1022  	_idx = int32(0)
  1023  _52:
  1024  	if _idx >= int32(23) {
  1025  		goto _55
  1026  	}
  1027  	if _c == int32(elem4((*Xet_info)(unsafe.Pointer(&_fmtinfo)), uintptr(_idx)).Xfmttype) {
  1028  		_infop = elem4((*Xet_info)(unsafe.Pointer(&_fmtinfo)), uintptr(_idx))
  1029  		_xtype = _infop.Xtype
  1030  		goto _55
  1031  	}
  1032  	_idx += 1
  1033  	goto _52
  1034  _55:
  1035  	switch int32(_xtype) {
  1036  	case int32(0):
  1037  		goto _59
  1038  	case int32(1):
  1039  		goto _62
  1040  	case int32(2):
  1041  		goto _62
  1042  	case int32(3):
  1043  		goto _62
  1044  	case int32(4):
  1045  		goto _65
  1046  	case int32(5):
  1047  		goto _68
  1048  	case int32(6):
  1049  		goto _68
  1050  	case int32(7):
  1051  		goto _66
  1052  	case int32(8):
  1053  		goto _67
  1054  	case int32(9):
  1055  		goto _70
  1056  	case int32(10):
  1057  		goto _70
  1058  	case int32(11):
  1059  		goto _73
  1060  	case int32(12):
  1061  		goto _74
  1062  	case int32(13):
  1063  		goto _58
  1064  	case int32(14):
  1065  		goto _70
  1066  	case int32(15):
  1067  		goto _59
  1068  	case int32(16):
  1069  		goto _61
  1070  	default:
  1071  		goto _75
  1072  	}
  1073  
  1074  _58:
  1075  	_flag_long = uint8(1)
  1076  _59:
  1077  	_cThousand = 0
  1078  _61:
  1079  	if (int32(_infop.Xflags) & int32(1)) == 0 {
  1080  		goto _76
  1081  	}
  1082  	if _bArgList != 0 {
  1083  		_29_v = _getIntArg(tls, _pArgList)
  1084  		goto _82
  1085  	}
  1086  	if _flag_long == 0 {
  1087  		goto _79
  1088  	}
  1089  	if int32(_flag_long) == int32(2) {
  1090  		_29_v = crt.VAInt64(&_ap)
  1091  		goto _81
  1092  	}
  1093  	_29_v = int64(crt.VAInt32(&_ap))
  1094  _81:
  1095  	goto _82
  1096  _79:
  1097  	_29_v = int64(crt.VAInt32(&_ap))
  1098  _82:
  1099  	if _29_v >= (0) {
  1100  		goto _83
  1101  	}
  1102  	if _29_v == int64(-9223372036854775808) {
  1103  		_longvalue = uint64(9223372036854775808)
  1104  		goto _85
  1105  	}
  1106  	_longvalue = uint64(-_29_v)
  1107  _85:
  1108  	_prefix = int8(45)
  1109  	goto _86
  1110  _83:
  1111  	_longvalue = uint64(_29_v)
  1112  	_prefix = int8(_flag_prefix)
  1113  _86:
  1114  	goto _87
  1115  _76:
  1116  	if _bArgList != 0 {
  1117  		_longvalue = uint64(_getIntArg(tls, _pArgList))
  1118  		goto _93
  1119  	}
  1120  	if _flag_long == 0 {
  1121  		goto _90
  1122  	}
  1123  	if int32(_flag_long) == int32(2) {
  1124  		_longvalue = crt.VAUint64(&_ap)
  1125  		goto _92
  1126  	}
  1127  	_longvalue = uint64(crt.VAUint32(&_ap))
  1128  _92:
  1129  	goto _93
  1130  _90:
  1131  	_longvalue = uint64(crt.VAUint32(&_ap))
  1132  _93:
  1133  	_prefix = 0
  1134  _87:
  1135  	if _longvalue == (0) {
  1136  		_flag_alternateform = 0
  1137  	}
  1138  	if (_flag_zeropad != 0) && (_precision < (_width - bool2int(int32(_prefix) != int32(0)))) {
  1139  		_precision = _width - bool2int(int32(_prefix) != int32(0))
  1140  	}
  1141  	if _precision < int32(37) {
  1142  		_nOut = int32(70)
  1143  		_zOut = (*int8)(unsafe.Pointer(&_buf))
  1144  		goto _98
  1145  	}
  1146  	_47_n = (uint64(_precision) + uint64(10)) + uint64(_precision/int32(3))
  1147  	_zOut = store1(&_zExtra, (*int8)(_sqlite3Malloc(tls, _47_n)))
  1148  	if _zOut == nil {
  1149  		_setStrAccumError(tls, _pAccum, uint8(1))
  1150  		return
  1151  	}
  1152  	_nOut = int32(_47_n)
  1153  _98:
  1154  	_bufpt = elem1(_zOut, uintptr(_nOut-int32(1)))
  1155  	if int32(_xtype) != int32(15) {
  1156  		goto _100
  1157  	}
  1158  	_49_x = int32(_longvalue % uint64(10))
  1159  	if (_49_x >= int32(4)) || (((_longvalue / uint64(10)) % uint64(10)) == uint64(1)) {
  1160  		_49_x = int32(0)
  1161  	}
  1162  	*preInc1(&_bufpt, -1) = *elem1((*int8)(unsafe.Pointer(&_sqlite3VXPrintfØ00zOrdØ001)), uintptr((_49_x*int32(2))+int32(1)))
  1163  	*preInc1(&_bufpt, -1) = *elem1((*int8)(unsafe.Pointer(&_sqlite3VXPrintfØ00zOrdØ001)), uintptr(_49_x*int32(2)))
  1164  _100:
  1165  	_51_cset = elem1((*int8)(unsafe.Pointer(&_aDigits)), uintptr(_infop.Xcharset))
  1166  	_51_base = _infop.Xbase
  1167  _103:
  1168  	*preInc1(&_bufpt, -1) = *elem1(_51_cset, uintptr(_longvalue%uint64(_51_base)))
  1169  	_longvalue = _longvalue / uint64(_51_base)
  1170  	if _longvalue > (0) {
  1171  		goto _103
  1172  	}
  1173  	_length = int32(uintptr(unsafe.Pointer(elem1(_zOut, uintptr(_nOut-int32(1))))) - uintptr(unsafe.Pointer(_bufpt)))
  1174  _104:
  1175  	if _precision > _length {
  1176  		*preInc1(&_bufpt, -1) = int8(48)
  1177  		_length += 1
  1178  		goto _104
  1179  	}
  1180  	if _cThousand == 0 {
  1181  		goto _106
  1182  	}
  1183  	_54_nn = (_length - int32(1)) / int32(3)
  1184  	_54_ix = ((_length - int32(1)) % int32(3)) + int32(1)
  1185  	*(*uintptr)(unsafe.Pointer(&_bufpt)) -= uintptr(_54_nn)
  1186  	_idx = int32(0)
  1187  _107:
  1188  	if _54_nn <= int32(0) {
  1189  		goto _110
  1190  	}
  1191  	*elem1(_bufpt, uintptr(_idx)) = *elem1(_bufpt, uintptr(_idx+_54_nn))
  1192  	_54_ix -= 1
  1193  	if _54_ix == int32(0) {
  1194  		*elem1(_bufpt, uintptr(preInc2(&_idx, 1))) = int8(_cThousand)
  1195  		_54_nn -= 1
  1196  		_54_ix = int32(3)
  1197  	}
  1198  	_idx += 1
  1199  	goto _107
  1200  _110:
  1201  _106:
  1202  	if _prefix != 0 {
  1203  		*preInc1(&_bufpt, -1) = _prefix
  1204  	}
  1205  	if _flag_alternateform == 0 || _infop.Xprefix == 0 {
  1206  		goto _114
  1207  	}
  1208  	_57_pre = elem1((*int8)(unsafe.Pointer(&_aPrefix)), uintptr(_infop.Xprefix))
  1209  _115:
  1210  	if int32(store5(&_57_x, *_57_pre)) == int32(0) {
  1211  		goto _118
  1212  	}
  1213  	*preInc1(&_bufpt, -1) = _57_x
  1214  	*(*uintptr)(unsafe.Pointer(&_57_pre)) += uintptr(1)
  1215  	goto _115
  1216  _118:
  1217  _114:
  1218  	_length = int32(uintptr(unsafe.Pointer(elem1(_zOut, uintptr(_nOut-int32(1))))) - uintptr(unsafe.Pointer(_bufpt)))
  1219  	goto _119
  1220  _62:
  1221  	if _bArgList != 0 {
  1222  		_realvalue = _getDoubleArg(tls, _pArgList)
  1223  		goto _121
  1224  	}
  1225  	_realvalue = crt.VAOther(&_ap).(float64)
  1226  _121:
  1227  	if _precision < int32(0) {
  1228  		_precision = int32(6)
  1229  	}
  1230  	if _realvalue < float64(0) {
  1231  		_realvalue = -_realvalue
  1232  		_prefix = int8(45)
  1233  		goto _124
  1234  	}
  1235  	_prefix = int8(_flag_prefix)
  1236  _124:
  1237  	if (int32(_xtype) == int32(3)) && (_precision > int32(0)) {
  1238  		_precision -= 1
  1239  	}
  1240  	*func() *float64 { _idx = _precision & int32(4095); return &_rounder }() = 0.5
  1241  _127:
  1242  	if _idx <= int32(0) {
  1243  		goto _130
  1244  	}
  1245  	*func() *float64 { _idx -= 1; return &_rounder }() *= 0.1
  1246  	goto _127
  1247  _130:
  1248  	if int32(_xtype) == int32(1) {
  1249  		_realvalue += _rounder
  1250  	}
  1251  	_exp = int32(0)
  1252  	if _sqlite3IsNaN(tls, _realvalue) != 0 {
  1253  		_bufpt = str(253)
  1254  		_length = int32(3)
  1255  		goto _119
  1256  	}
  1257  	if _realvalue <= float64(0) {
  1258  		goto _133
  1259  	}
  1260  	_64_scale = float64(1)
  1261  _134:
  1262  	if (_realvalue >= (float64(1e+100) * _64_scale)) && (_exp <= int32(350)) {
  1263  		_64_scale *= float64(1e+100)
  1264  		_exp += int32(100)
  1265  		goto _134
  1266  	}
  1267  _135:
  1268  	if (_realvalue >= (float64(1e+10) * _64_scale)) && (_exp <= int32(350)) {
  1269  		_64_scale *= float64(1e+10)
  1270  		_exp += int32(10)
  1271  		goto _135
  1272  	}
  1273  _138:
  1274  	if (_realvalue >= (float64(10) * _64_scale)) && (_exp <= int32(350)) {
  1275  		_64_scale *= float64(10)
  1276  		_exp += 1
  1277  		goto _138
  1278  	}
  1279  	_realvalue /= _64_scale
  1280  _143:
  1281  	if _realvalue < float64(1e-08) {
  1282  		_realvalue *= float64(1e+08)
  1283  		_exp -= int32(8)
  1284  		goto _143
  1285  	}
  1286  _144:
  1287  	if _realvalue < float64(1) {
  1288  		_realvalue *= float64(10)
  1289  		_exp -= 1
  1290  		goto _144
  1291  	}
  1292  	if _exp > int32(350) {
  1293  		_bufpt = (*int8)(unsafe.Pointer(&_buf))
  1294  		*elem1((*int8)(unsafe.Pointer(&_buf)), 0) = _prefix
  1295  		crt.Xmemcpy(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_buf))+uintptr(bool2int(int32(_prefix) != int32(0)))))), unsafe.Pointer(str(257)), uint32(4))
  1296  		_length = int32(3) + bool2int(int32(_prefix) != int32(0))
  1297  		goto _119
  1298  	}
  1299  _133:
  1300  	_bufpt = (*int8)(unsafe.Pointer(&_buf))
  1301  	if int32(_xtype) == int32(1) {
  1302  		goto _148
  1303  	}
  1304  	_realvalue += _rounder
  1305  	if _realvalue >= float64(10) {
  1306  		_realvalue *= 0.1
  1307  		_exp += 1
  1308  	}
  1309  _148:
  1310  	if int32(_xtype) != int32(3) {
  1311  		goto _150
  1312  	}
  1313  	_flag_rtz = uint8(bool2int(_flag_alternateform == 0))
  1314  	if (_exp < int32(-4)) || (_exp > _precision) {
  1315  		_xtype = uint8(2)
  1316  		goto _153
  1317  	}
  1318  	_precision = _precision - _exp
  1319  	_xtype = uint8(1)
  1320  _153:
  1321  	goto _154
  1322  _150:
  1323  	_flag_rtz = _flag_altform2
  1324  _154:
  1325  	if int32(_xtype) == int32(2) {
  1326  		_e2 = int32(0)
  1327  		goto _156
  1328  	}
  1329  	_e2 = _exp
  1330  _156:
  1331  	if ((int64(func() int32 {
  1332  		if _e2 > int32(0) {
  1333  			return _e2
  1334  		}
  1335  		return int32(0)
  1336  	}()) + int64(_precision)) + int64(_width)) <= int64(55) {
  1337  		goto _159
  1338  	}
  1339  	_bufpt = store1(&_zExtra, (*int8)(_sqlite3Malloc(tls, uint64(((int64(func() int32 {
  1340  		if _e2 > int32(0) {
  1341  			return _e2
  1342  		}
  1343  		return int32(0)
  1344  	}())+int64(_precision))+int64(_width))+int64(15)))))
  1345  	if _bufpt == nil {
  1346  		_setStrAccumError(tls, _pAccum, uint8(1))
  1347  		return
  1348  	}
  1349  _159:
  1350  	_zOut = _bufpt
  1351  	_nsd = int32(16) + (int32(_flag_altform2) * int32(10))
  1352  	_flag_dp = uint8((func() int32 {
  1353  		if _precision > int32(0) {
  1354  			return int32(1)
  1355  		}
  1356  		return int32(0)
  1357  	}() | int32(_flag_alternateform)) | int32(_flag_altform2))
  1358  	if _prefix != 0 {
  1359  		*postInc1(&_bufpt, 1) = _prefix
  1360  	}
  1361  	if _e2 < int32(0) {
  1362  		*postInc1(&_bufpt, 1) = int8(48)
  1363  		goto _167
  1364  	}
  1365  _168:
  1366  	if _e2 < int32(0) {
  1367  		goto _171
  1368  	}
  1369  	*postInc1(&_bufpt, 1) = _et_getdigit(tls, &_realvalue, &_nsd)
  1370  	_e2 -= 1
  1371  	goto _168
  1372  _171:
  1373  _167:
  1374  	if _flag_dp != 0 {
  1375  		*postInc1(&_bufpt, 1) = int8(46)
  1376  	}
  1377  	_e2 += 1
  1378  _173:
  1379  	if _e2 >= int32(0) {
  1380  		goto _176
  1381  	}
  1382  	func() {
  1383  		if _precision <= int32(0) {
  1384  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25616), unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000), unsafe.Pointer(str(261)))
  1385  			crt.X__builtin_abort(tls)
  1386  		}
  1387  	}()
  1388  	*postInc1(&_bufpt, 1) = int8(48)
  1389  	*func() *int32 { _precision -= 1; return &_e2 }() += 1
  1390  	goto _173
  1391  _176:
  1392  	if postInc2(&_precision, -1) > int32(0) {
  1393  		*postInc1(&_bufpt, 1) = _et_getdigit(tls, &_realvalue, &_nsd)
  1394  		goto _176
  1395  	}
  1396  	if _flag_rtz == 0 || _flag_dp == 0 {
  1397  		goto _182
  1398  	}
  1399  _183:
  1400  	if int32(*elem1(_bufpt, uintptr(4294967295))) == int32(48) {
  1401  		*preInc1(&_bufpt, -1) = 0
  1402  		goto _183
  1403  	}
  1404  	func() {
  1405  		if crt.P2U(unsafe.Pointer(_bufpt)) <= crt.P2U(unsafe.Pointer(_zOut)) {
  1406  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25626), unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000), unsafe.Pointer(str(273)))
  1407  			crt.X__builtin_abort(tls)
  1408  		}
  1409  	}()
  1410  	if int32(*elem1(_bufpt, uintptr(4294967295))) != int32(46) {
  1411  		goto _187
  1412  	}
  1413  	if _flag_altform2 != 0 {
  1414  		*postInc1(&_bufpt, 1) = int8(48)
  1415  		goto _189
  1416  	}
  1417  	*preInc1(&_bufpt, -1) = 0
  1418  _189:
  1419  _187:
  1420  _182:
  1421  	if int32(_xtype) != int32(2) {
  1422  		goto _190
  1423  	}
  1424  	*postInc1(&_bufpt, 1) = *elem1((*int8)(unsafe.Pointer(&_aDigits)), uintptr(_infop.Xcharset))
  1425  	if _exp < int32(0) {
  1426  		*postInc1(&_bufpt, 1) = int8(45)
  1427  		_exp = -_exp
  1428  		goto _192
  1429  	}
  1430  	*postInc1(&_bufpt, 1) = int8(43)
  1431  _192:
  1432  	if _exp >= int32(100) {
  1433  		*postInc1(&_bufpt, 1) = int8((_exp / int32(100)) + int32(48))
  1434  		_exp %= int32(100)
  1435  	}
  1436  	*postInc1(&_bufpt, 1) = int8((_exp / int32(10)) + int32(48))
  1437  	*postInc1(&_bufpt, 1) = int8((_exp % int32(10)) + int32(48))
  1438  _190:
  1439  	*_bufpt = 0
  1440  	_length = int32(uintptr(unsafe.Pointer(_bufpt)) - uintptr(unsafe.Pointer(_zOut)))
  1441  	_bufpt = _zOut
  1442  	if _flag_zeropad == 0 || _flag_leftjustify != 0 || _length >= _width {
  1443  		goto _196
  1444  	}
  1445  	_96_nPad = _width - _length
  1446  	_96_i = _width
  1447  _197:
  1448  	if _96_i < _96_nPad {
  1449  		goto _200
  1450  	}
  1451  	*elem1(_bufpt, uintptr(_96_i)) = *elem1(_bufpt, uintptr(_96_i-_96_nPad))
  1452  	_96_i -= 1
  1453  	goto _197
  1454  _200:
  1455  	_96_i = bool2int(int32(_prefix) != int32(0))
  1456  _201:
  1457  	if postInc2(&_96_nPad, -1) != 0 {
  1458  		*elem1(_bufpt, uintptr(postInc2(&_96_i, 1))) = int8(48)
  1459  		goto _201
  1460  	}
  1461  	_length = _width
  1462  _196:
  1463  	goto _119
  1464  _65:
  1465  	if _bArgList == 0 {
  1466  		*(*int32)(crt.VAPointer(&_ap)) = int32(_pAccum.XnChar)
  1467  	}
  1468  	_length = store2(&_width, int32(0))
  1469  	goto _119
  1470  _66:
  1471  	*elem1((*int8)(unsafe.Pointer(&_buf)), 0) = int8(37)
  1472  	_bufpt = (*int8)(unsafe.Pointer(&_buf))
  1473  	_length = int32(1)
  1474  	goto _119
  1475  _67:
  1476  	if _bArgList != 0 {
  1477  		_bufpt = _getTextArg(tls, _pArgList)
  1478  		_c = func() int32 {
  1479  			if _bufpt != nil {
  1480  				return int32(*elem1(_bufpt, 0))
  1481  			}
  1482  			return int32(0)
  1483  		}()
  1484  		goto _207
  1485  	}
  1486  	_c = crt.VAInt32(&_ap)
  1487  _207:
  1488  	if _precision <= int32(1) {
  1489  		goto _208
  1490  	}
  1491  	_width -= _precision - int32(1)
  1492  	if (_width > int32(1)) && (_flag_leftjustify == 0) {
  1493  		_sqlite3AppendChar(tls, _pAccum, _width-int32(1), int8(32))
  1494  		_width = int32(0)
  1495  	}
  1496  	_sqlite3AppendChar(tls, _pAccum, _precision-int32(1), int8(_c))
  1497  _208:
  1498  	_length = int32(1)
  1499  	*elem1((*int8)(unsafe.Pointer(&_buf)), 0) = int8(_c)
  1500  	_bufpt = (*int8)(unsafe.Pointer(&_buf))
  1501  	goto _119
  1502  _68:
  1503  	if _bArgList != 0 {
  1504  		_bufpt = _getTextArg(tls, _pArgList)
  1505  		_xtype = uint8(5)
  1506  		goto _212
  1507  	}
  1508  	_bufpt = (*int8)(crt.VAPointer(&_ap))
  1509  _212:
  1510  	if _bufpt == nil {
  1511  		_bufpt = str(284)
  1512  		goto _215
  1513  	}
  1514  	if int32(_xtype) == int32(6) {
  1515  		_zExtra = _bufpt
  1516  	}
  1517  _215:
  1518  	if _precision < int32(0) {
  1519  		goto _216
  1520  	}
  1521  	_length = int32(0)
  1522  _217:
  1523  	if _length >= _precision || (*elem1(_bufpt, uintptr(_length))) == 0 {
  1524  		goto _221
  1525  	}
  1526  	_length += 1
  1527  	goto _217
  1528  _221:
  1529  	goto _222
  1530  _216:
  1531  	_length = _sqlite3Strlen30(tls, _bufpt)
  1532  _222:
  1533  	goto _119
  1534  _70:
  1535  	_110_q = int8(func() int32 {
  1536  		if int32(_xtype) == int32(14) {
  1537  			return int32(34)
  1538  		}
  1539  		return int32(39)
  1540  	}())
  1541  	if _bArgList != 0 {
  1542  		_110_escarg = _getTextArg(tls, _pArgList)
  1543  		goto _226
  1544  	}
  1545  	_110_escarg = (*int8)(crt.VAPointer(&_ap))
  1546  _226:
  1547  	_110_isnull = bool2int(_110_escarg == nil)
  1548  	if _110_isnull != 0 {
  1549  		_110_escarg = func() *int8 {
  1550  			if int32(_xtype) == int32(10) {
  1551  				return str(285)
  1552  			}
  1553  			return str(290)
  1554  		}()
  1555  	}
  1556  	_110_k = _precision
  1557  	_110_i = store2(&_110_n, int32(0))
  1558  _230:
  1559  	if _110_k == int32(0) || int32(store5(&_110_ch, *elem1(_110_escarg, uintptr(_110_i)))) == int32(0) {
  1560  		goto _234
  1561  	}
  1562  	if int32(_110_ch) == int32(_110_q) {
  1563  		_110_n += 1
  1564  	}
  1565  	*func() *int32 { _110_i += 1; return &_110_k }() -= 1
  1566  	goto _230
  1567  _234:
  1568  	_110_needQuote = bool2int((_110_isnull == 0) && (int32(_xtype) == int32(10)))
  1569  	_110_n += _110_i + int32(3)
  1570  	if _110_n <= int32(70) {
  1571  		goto _237
  1572  	}
  1573  	_bufpt = store1(&_zExtra, (*int8)(_sqlite3Malloc(tls, uint64(_110_n))))
  1574  	if _bufpt == nil {
  1575  		_setStrAccumError(tls, _pAccum, uint8(1))
  1576  		return
  1577  	}
  1578  	goto _239
  1579  _237:
  1580  	_bufpt = (*int8)(unsafe.Pointer(&_buf))
  1581  _239:
  1582  	_110_j = int32(0)
  1583  	if _110_needQuote != 0 {
  1584  		*elem1(_bufpt, uintptr(postInc2(&_110_j, 1))) = _110_q
  1585  	}
  1586  	_110_k = _110_i
  1587  	_110_i = int32(0)
  1588  _241:
  1589  	if _110_i >= _110_k {
  1590  		goto _244
  1591  	}
  1592  	*elem1(_bufpt, uintptr(postInc2(&_110_j, 1))) = store5(&_110_ch, *elem1(_110_escarg, uintptr(_110_i)))
  1593  	if int32(_110_ch) == int32(_110_q) {
  1594  		*elem1(_bufpt, uintptr(postInc2(&_110_j, 1))) = _110_ch
  1595  	}
  1596  	_110_i += 1
  1597  	goto _241
  1598  _244:
  1599  	if _110_needQuote != 0 {
  1600  		*elem1(_bufpt, uintptr(postInc2(&_110_j, 1))) = _110_q
  1601  	}
  1602  	*elem1(_bufpt, uintptr(_110_j)) = 0
  1603  	_length = _110_j
  1604  	goto _119
  1605  _73:
  1606  	if (int32(_pAccum.XprintfFlags) & int32(1)) == int32(0) {
  1607  		return
  1608  	}
  1609  	_118_pToken = (*XToken)(crt.VAPointer(&_ap))
  1610  	func() {
  1611  		if int32(_bArgList) != int32(0) {
  1612  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25771), unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000), unsafe.Pointer(str(297)))
  1613  			crt.X__builtin_abort(tls)
  1614  		}
  1615  	}()
  1616  	if (_118_pToken != nil) && (_118_pToken.Xn != 0) {
  1617  		_sqlite3StrAccumAppend(tls, _pAccum, _118_pToken.Xz, int32(_118_pToken.Xn))
  1618  	}
  1619  	_length = store2(&_width, int32(0))
  1620  	goto _119
  1621  _74:
  1622  	if (int32(_pAccum.XprintfFlags) & int32(1)) == int32(0) {
  1623  		return
  1624  	}
  1625  	_120_pSrc = (*XSrcList)(crt.VAPointer(&_ap))
  1626  	_120_k = crt.VAInt32(&_ap)
  1627  	_120_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&_120_pSrc.Xa)), uintptr(_120_k))
  1628  	func() {
  1629  		if int32(_bArgList) != int32(0) {
  1630  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25786), unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000), unsafe.Pointer(str(297)))
  1631  			crt.X__builtin_abort(tls)
  1632  		}
  1633  	}()
  1634  	func() {
  1635  		if _120_k < int32(0) || _120_k >= _120_pSrc.XnSrc {
  1636  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25787), unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000), unsafe.Pointer(str(309)))
  1637  			crt.X__builtin_abort(tls)
  1638  		}
  1639  	}()
  1640  	if _120_pItem.XzDatabase != nil {
  1641  		_sqlite3StrAccumAppendAll(tls, _pAccum, _120_pItem.XzDatabase)
  1642  		_sqlite3StrAccumAppend(tls, _pAccum, str(330), int32(1))
  1643  	}
  1644  	_sqlite3StrAccumAppendAll(tls, _pAccum, _120_pItem.XzName)
  1645  	_length = store2(&_width, int32(0))
  1646  	goto _119
  1647  _75:
  1648  	func() {
  1649  		if int32(_xtype) != int32(17) {
  1650  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25797), unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000), unsafe.Pointer(str(332)))
  1651  			crt.X__builtin_abort(tls)
  1652  		}
  1653  	}()
  1654  	return
  1655  _119:
  1656  	_width -= _length
  1657  	if _width <= int32(0) {
  1658  		goto _261
  1659  	}
  1660  	if _flag_leftjustify == 0 {
  1661  		_sqlite3AppendChar(tls, _pAccum, _width, int8(32))
  1662  	}
  1663  	_sqlite3StrAccumAppend(tls, _pAccum, _bufpt, _length)
  1664  	if _flag_leftjustify != 0 {
  1665  		_sqlite3AppendChar(tls, _pAccum, _width, int8(32))
  1666  	}
  1667  	goto _264
  1668  _261:
  1669  	_sqlite3StrAccumAppend(tls, _pAccum, _bufpt, _length)
  1670  _264:
  1671  	if _zExtra != nil {
  1672  		_sqlite3DbFree(tls, (*Xsqlite3)(_pAccum.Xdb), unsafe.Pointer(_zExtra))
  1673  		_zExtra = nil
  1674  	}
  1675  	*(*uintptr)(unsafe.Pointer(&_fmt)) += uintptr(1)
  1676  	goto _1
  1677  _5:
  1678  	_ = _buf
  1679  }
  1680  
  1681  // C comment
  1682  //  /*
  1683  //  ** Append N bytes of text from z to the StrAccum object.  Increase the
  1684  //  ** size of the memory allocation for StrAccum if necessary.
  1685  //  */
  1686  func _sqlite3StrAccumAppend(tls *crt.TLS, _p *XStrAccum, _z *int8, _N int32) {
  1687  	func() {
  1688  		if _z == nil && _N != int32(0) {
  1689  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25912), unsafe.Pointer(&_sqlite3StrAccumAppendØ00__func__Ø000), unsafe.Pointer(str(349)))
  1690  			crt.X__builtin_abort(tls)
  1691  		}
  1692  	}()
  1693  	func() {
  1694  		if _p.XzText == nil && _p.XnChar != (0) && _p.XaccError == 0 {
  1695  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25913), unsafe.Pointer(&_sqlite3StrAccumAppendØ00__func__Ø000), unsafe.Pointer(str(362)))
  1696  			crt.X__builtin_abort(tls)
  1697  		}
  1698  	}()
  1699  	func() {
  1700  		if _N < int32(0) {
  1701  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25914), unsafe.Pointer(&_sqlite3StrAccumAppendØ00__func__Ø000), unsafe.Pointer(str(404)))
  1702  			crt.X__builtin_abort(tls)
  1703  		}
  1704  	}()
  1705  	func() {
  1706  		if int32(_p.XaccError) != int32(0) && _p.XnAlloc != (0) {
  1707  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25915), unsafe.Pointer(&_sqlite3StrAccumAppendØ00__func__Ø000), unsafe.Pointer(str(409)))
  1708  			crt.X__builtin_abort(tls)
  1709  		}
  1710  	}()
  1711  	if (_p.XnChar + uint32(_N)) >= _p.XnAlloc {
  1712  		_enlargeAndAppend(tls, _p, _z, _N)
  1713  		goto _14
  1714  	}
  1715  	if _N != 0 {
  1716  		func() {
  1717  			if _p.XzText == nil {
  1718  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25919), unsafe.Pointer(&_sqlite3StrAccumAppendØ00__func__Ø000), unsafe.Pointer(str(440)))
  1719  				crt.X__builtin_abort(tls)
  1720  			}
  1721  		}()
  1722  		_p.XnChar += uint32(_N)
  1723  		crt.Xmemcpy(tls, unsafe.Pointer(elem1(_p.XzText, uintptr(_p.XnChar-uint32(_N)))), unsafe.Pointer(_z), uint32(_N))
  1724  	}
  1725  _14:
  1726  }
  1727  
  1728  var _sqlite3StrAccumAppendØ00__func__Ø000 [22]int8
  1729  
  1730  func init() {
  1731  	crt.Xstrncpy(nil, &_sqlite3StrAccumAppendØ00__func__Ø000[0], str(449), 22)
  1732  }
  1733  
  1734  // C comment
  1735  //  /*
  1736  //  ** The StrAccum "p" is not large enough to accept N new bytes of z[].
  1737  //  ** So enlarge if first, then do the append.
  1738  //  **
  1739  //  ** This is a helper routine to sqlite3StrAccumAppend() that does special-case
  1740  //  ** work (enlarging the buffer) using tail recursion, so that the
  1741  //  ** sqlite3StrAccumAppend() routine can use fast calling semantics.
  1742  //  */
  1743  func _enlargeAndAppend(tls *crt.TLS, _p *XStrAccum, _z *int8, _N int32) {
  1744  	_N = _sqlite3StrAccumEnlarge(tls, _p, _N)
  1745  	if _N > int32(0) {
  1746  		crt.Xmemcpy(tls, unsafe.Pointer(elem1(_p.XzText, uintptr(_p.XnChar))), unsafe.Pointer(_z), uint32(_N))
  1747  		_p.XnChar += uint32(_N)
  1748  	}
  1749  	func() {
  1750  		if ((_p.XzText == nil) || (_p.XzText == _p.XzBase)) != ((int32(_p.XprintfFlags) & int32(4)) == int32(0)) {
  1751  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25904), unsafe.Pointer(&_enlargeAndAppendØ00__func__Ø000), unsafe.Pointer(str(471)))
  1752  			crt.X__builtin_abort(tls)
  1753  		}
  1754  	}()
  1755  }
  1756  
  1757  // C comment
  1758  //  /*
  1759  //  ** Enlarge the memory allocation on a StrAccum object so that it is
  1760  //  ** able to accept at least N more bytes of text.
  1761  //  **
  1762  //  ** Return the number of bytes of text that StrAccum is able to accept
  1763  //  ** after the attempted enlargement.  The value returned might be zero.
  1764  //  */
  1765  func _sqlite3StrAccumEnlarge(tls *crt.TLS, _p *XStrAccum, _N int32) (r0 int32) {
  1766  	var _3_szNew int64
  1767  	var _zNew, _3_zOld *int8
  1768  	func() {
  1769  		if (int64(_p.XnChar) + int64(_N)) < int64(_p.XnAlloc) {
  1770  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25831), unsafe.Pointer(&_sqlite3StrAccumEnlargeØ00__func__Ø000), unsafe.Pointer(str(523)))
  1771  			crt.X__builtin_abort(tls)
  1772  		}
  1773  	}()
  1774  	if _p.XaccError != 0 {
  1775  		return int32(0)
  1776  	}
  1777  	if _p.XmxAlloc == (0) {
  1778  		_N = int32((_p.XnAlloc - _p.XnChar) - uint32(1))
  1779  		_setStrAccumError(tls, _p, uint8(2))
  1780  		return _N
  1781  	}
  1782  	_3_zOld = func() *int8 {
  1783  		if (int32(_p.XprintfFlags) & int32(4)) != int32(0) {
  1784  			return _p.XzText
  1785  		}
  1786  		return nil
  1787  	}()
  1788  	_3_szNew = int64(_p.XnChar)
  1789  	func() {
  1790  		if ((_p.XzText == nil) || (_p.XzText == _p.XzBase)) != ((int32(_p.XprintfFlags) & int32(4)) == int32(0)) {
  1791  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25844), unsafe.Pointer(&_sqlite3StrAccumEnlargeØ00__func__Ø000), unsafe.Pointer(str(471)))
  1792  			crt.X__builtin_abort(tls)
  1793  		}
  1794  	}()
  1795  	_3_szNew += int64(_N + int32(1))
  1796  	if (_3_szNew + int64(_p.XnChar)) <= int64(_p.XmxAlloc) {
  1797  		_3_szNew += int64(_p.XnChar)
  1798  	}
  1799  	if _3_szNew > int64(_p.XmxAlloc) {
  1800  		_sqlite3StrAccumReset(tls, _p)
  1801  		_setStrAccumError(tls, _p, uint8(2))
  1802  		return int32(0)
  1803  	}
  1804  	_p.XnAlloc = uint32(int32(_3_szNew))
  1805  	if _p.Xdb != nil {
  1806  		_zNew = (*int8)(_sqlite3DbRealloc(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(_3_zOld), uint64(_p.XnAlloc)))
  1807  		goto _14
  1808  	}
  1809  	_zNew = (*int8)(Xsqlite3_realloc64(tls, unsafe.Pointer(_3_zOld), uint64(_p.XnAlloc)))
  1810  _14:
  1811  	if _zNew == nil {
  1812  		goto _15
  1813  	}
  1814  	func() {
  1815  		if _p.XzText == nil && _p.XnChar != (0) {
  1816  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25864), unsafe.Pointer(&_sqlite3StrAccumEnlargeØ00__func__Ø000), unsafe.Pointer(str(552)))
  1817  			crt.X__builtin_abort(tls)
  1818  		}
  1819  	}()
  1820  	if ((int32(_p.XprintfFlags) & int32(4)) == int32(0)) && (_p.XnChar > (0)) {
  1821  		crt.Xmemcpy(tls, unsafe.Pointer(_zNew), unsafe.Pointer(_p.XzText), _p.XnChar)
  1822  	}
  1823  	_p.XzText = _zNew
  1824  	_p.XnAlloc = uint32(_sqlite3DbMallocSize(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(_zNew)))
  1825  	{
  1826  		p := &_p.XprintfFlags
  1827  		*p = uint8(int32(*p) | int32(4))
  1828  	}
  1829  	goto _21
  1830  _15:
  1831  	_sqlite3StrAccumReset(tls, _p)
  1832  	_setStrAccumError(tls, _p, uint8(1))
  1833  	return int32(0)
  1834  
  1835  _21:
  1836  	return _N
  1837  }
  1838  
  1839  var _sqlite3StrAccumEnlargeØ00__func__Ø000 [23]int8
  1840  
  1841  func init() {
  1842  	crt.Xstrncpy(nil, &_sqlite3StrAccumEnlargeØ00__func__Ø000[0], str(579), 23)
  1843  }
  1844  
  1845  // C comment
  1846  //  /*
  1847  //  ** Set the StrAccum object to an error mode.
  1848  //  */
  1849  func _setStrAccumError(tls *crt.TLS, _p *XStrAccum, _eError uint8) {
  1850  	func() {
  1851  		if int32(_eError) != int32(1) && int32(_eError) != int32(2) {
  1852  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25196), unsafe.Pointer(&_setStrAccumErrorØ00__func__Ø000), unsafe.Pointer(str(602)))
  1853  			crt.X__builtin_abort(tls)
  1854  		}
  1855  	}()
  1856  	_p.XaccError = _eError
  1857  	_p.XnAlloc = 0
  1858  }
  1859  
  1860  var _setStrAccumErrorØ00__func__Ø000 [17]int8
  1861  
  1862  func init() {
  1863  	crt.Xstrncpy(nil, &_setStrAccumErrorØ00__func__Ø000[0], str(652), 17)
  1864  }
  1865  
  1866  // C comment
  1867  //  /*
  1868  //  ** Reset an StrAccum string.  Reclaim all malloced memory.
  1869  //  */
  1870  func _sqlite3StrAccumReset(tls *crt.TLS, _p *XStrAccum) {
  1871  	func() {
  1872  		if ((_p.XzText == nil) || (_p.XzText == _p.XzBase)) != ((int32(_p.XprintfFlags) & int32(4)) == int32(0)) {
  1873  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25964), unsafe.Pointer(&_sqlite3StrAccumResetØ00__func__Ø000), unsafe.Pointer(str(471)))
  1874  			crt.X__builtin_abort(tls)
  1875  		}
  1876  	}()
  1877  	if (int32(_p.XprintfFlags) & int32(4)) != int32(0) {
  1878  		_sqlite3DbFree(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(_p.XzText))
  1879  		{
  1880  			p := &_p.XprintfFlags
  1881  			*p = uint8(int32(*p) & int32(-5))
  1882  		}
  1883  	}
  1884  	_p.XzText = nil
  1885  }
  1886  
  1887  var _sqlite3StrAccumResetØ00__func__Ø000 [21]int8
  1888  
  1889  func init() {
  1890  	crt.Xstrncpy(nil, &_sqlite3StrAccumResetØ00__func__Ø000[0], str(669), 21)
  1891  }
  1892  
  1893  func _sqlite3DbFree(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer) {
  1894  	func() {
  1895  		if _db != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
  1896  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24721), unsafe.Pointer(&_sqlite3DbFreeØ00__func__Ø000), unsafe.Pointer(str(690)))
  1897  			crt.X__builtin_abort(tls)
  1898  		}
  1899  	}()
  1900  	if _p != nil {
  1901  		_sqlite3DbFreeNN(tls, _db, _p)
  1902  	}
  1903  }
  1904  
  1905  // C comment
  1906  //  /*
  1907  //  ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
  1908  //  ** intended for use inside assert() statements.
  1909  //  */
  1910  func Xsqlite3_mutex_held(tls *crt.TLS, _p *Xsqlite3_mutex) (r0 int32) {
  1911  	func() {
  1912  		if _p != nil && (_sqlite3Config.Xmutex.XxMutexHeld) == nil {
  1913  			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)))
  1914  			crt.X__builtin_abort(tls)
  1915  		}
  1916  	}()
  1917  	return bool2int((_p == nil) || func() func(*crt.TLS, *Xsqlite3_mutex) int32 {
  1918  		v := _sqlite3Config.Xmutex.XxMutexHeld
  1919  		return *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&v))
  1920  	}()(tls, _p) != 0)
  1921  }
  1922  
  1923  var _sqlite3_mutex_heldØ00__func__Ø000 [19]int8
  1924  
  1925  func init() {
  1926  	crt.Xstrncpy(nil, &_sqlite3_mutex_heldØ00__func__Ø000[0], str(774), 19)
  1927  }
  1928  
  1929  var _sqlite3DbFreeØ00__func__Ø000 [14]int8
  1930  
  1931  func init() {
  1932  	crt.Xstrncpy(nil, &_sqlite3DbFreeØ00__func__Ø000[0], str(793), 14)
  1933  }
  1934  
  1935  // C comment
  1936  //  /*
  1937  //  ** Free memory that might be associated with a particular database
  1938  //  ** connection.  Calling sqlite3DbFree(D,X) for X==0 is a harmless no-op.
  1939  //  ** The sqlite3DbFreeNN(D,X) version requires that X be non-NULL.
  1940  //  */
  1941  func _sqlite3DbFreeNN(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer) {
  1942  	var _3_pBuf *XScratchFreeslot
  1943  	func() {
  1944  		if _db != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
  1945  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24695), unsafe.Pointer(&_sqlite3DbFreeNNØ00__func__Ø000), unsafe.Pointer(str(690)))
  1946  			crt.X__builtin_abort(tls)
  1947  		}
  1948  	}()
  1949  	func() {
  1950  		if _p == nil {
  1951  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24696), unsafe.Pointer(&_sqlite3DbFreeNNØ00__func__Ø000), unsafe.Pointer(str(807)))
  1952  			crt.X__builtin_abort(tls)
  1953  		}
  1954  	}()
  1955  	if _db == nil {
  1956  		goto _5
  1957  	}
  1958  	if _db.XpnBytesFreed != nil {
  1959  		_measureAllocationSize(tls, _db, _p)
  1960  		return
  1961  	}
  1962  	if _isLookaside(tls, _db, _p) != 0 {
  1963  		_3_pBuf = (*XScratchFreeslot)(_p)
  1964  		crt.Xmemset(tls, _p, int32(170), uint32(_db.Xlookaside.Xsz))
  1965  		*(**XScratchFreeslot)(unsafe.Pointer(&_3_pBuf.XpNext)) = (*XScratchFreeslot)(_db.Xlookaside.XpFree)
  1966  		*(**XScratchFreeslot)(unsafe.Pointer(&(_db.Xlookaside.XpFree))) = _3_pBuf
  1967  		_db.Xlookaside.XnOut -= 1
  1968  		return
  1969  	}
  1970  _5:
  1971  
  1972  	func() {
  1973  		if _db == nil && int32(1) == 0 {
  1974  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24716), unsafe.Pointer(&_sqlite3DbFreeNNØ00__func__Ø000), unsafe.Pointer(str(812)))
  1975  			crt.X__builtin_abort(tls)
  1976  		}
  1977  	}()
  1978  	Xsqlite3_free(tls, _p)
  1979  }
  1980  
  1981  var _sqlite3DbFreeNNØ00__func__Ø000 [16]int8
  1982  
  1983  func init() {
  1984  	crt.Xstrncpy(nil, &_sqlite3DbFreeNNØ00__func__Ø000[0], str(865), 16)
  1985  }
  1986  
  1987  // C comment
  1988  //  /*
  1989  //  ** Add the size of memory allocation "p" to the count in
  1990  //  ** *db->pnBytesFreed.
  1991  //  */
  1992  func _measureAllocationSize(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer) {
  1993  	*_db.XpnBytesFreed += _sqlite3DbMallocSize(tls, _db, _p)
  1994  }
  1995  
  1996  func _sqlite3DbMallocSize(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer) (r0 int32) {
  1997  	func() {
  1998  		if _p == nil {
  1999  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24640), unsafe.Pointer(&_sqlite3DbMallocSizeØ00__func__Ø000), unsafe.Pointer(str(807)))
  2000  			crt.X__builtin_abort(tls)
  2001  		}
  2002  	}()
  2003  	if _db != nil && _isLookaside(tls, _db, _p) != 0 {
  2004  		goto _3
  2005  	}
  2006  	if _db == nil {
  2007  		goto _5
  2008  	}
  2009  
  2010  _5:
  2011  	return (_sqlite3Config.Xm.XxSize)(tls, _p)
  2012  
  2013  _3:
  2014  	func() {
  2015  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
  2016  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24653), unsafe.Pointer(&_sqlite3DbMallocSizeØ00__func__Ø000), unsafe.Pointer(str(881)))
  2017  			crt.X__builtin_abort(tls)
  2018  		}
  2019  	}()
  2020  	return int32(_db.Xlookaside.Xsz)
  2021  }
  2022  
  2023  var _sqlite3DbMallocSizeØ00__func__Ø000 [20]int8
  2024  
  2025  func init() {
  2026  	crt.Xstrncpy(nil, &_sqlite3DbMallocSizeØ00__func__Ø000[0], str(911), 20)
  2027  }
  2028  
  2029  func _isLookaside(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer) (r0 int32) {
  2030  	return bool2int((uint32(crt.P2U(_p)) >= uint32(crt.P2U(_db.Xlookaside.XpStart))) && (uint32(crt.P2U(_p)) < uint32(crt.P2U(_db.Xlookaside.XpEnd))))
  2031  }
  2032  
  2033  // C comment
  2034  //  /*
  2035  //  ** Free memory previously obtained from sqlite3Malloc().
  2036  //  */
  2037  func Xsqlite3_free(tls *crt.TLS, _p unsafe.Pointer) {
  2038  	if _p == nil {
  2039  		return
  2040  	}
  2041  
  2042  	if _sqlite3Config.XbMemstat != 0 {
  2043  		Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
  2044  		_sqlite3StatusDown(tls, int32(0), _sqlite3MallocSize(tls, _p))
  2045  		_sqlite3StatusDown(tls, int32(9), int32(1))
  2046  		(_sqlite3Config.Xm.XxFree)(tls, _p)
  2047  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
  2048  		goto _2
  2049  	}
  2050  	(_sqlite3Config.Xm.XxFree)(tls, _p)
  2051  _2:
  2052  }
  2053  
  2054  // C comment
  2055  //  /*
  2056  //  ** Obtain the mutex p. If some other thread already has the mutex, block
  2057  //  ** until it can be obtained.
  2058  //  */
  2059  func Xsqlite3_mutex_enter(tls *crt.TLS, _p *Xsqlite3_mutex) {
  2060  	if _p != nil {
  2061  		func() {
  2062  			if (_sqlite3Config.Xmutex.XxMutexEnter) == nil {
  2063  				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)))
  2064  				crt.X__builtin_abort(tls)
  2065  			}
  2066  		}()
  2067  		func() func(*crt.TLS, *Xsqlite3_mutex) {
  2068  			v := _sqlite3Config.Xmutex.XxMutexEnter
  2069  			return *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&v))
  2070  		}()(tls, _p)
  2071  	}
  2072  }
  2073  
  2074  var _sqlite3_mutex_enterØ00__func__Ø000 [20]int8
  2075  
  2076  func init() {
  2077  	crt.Xstrncpy(nil, &_sqlite3_mutex_enterØ00__func__Ø000[0], str(969), 20)
  2078  }
  2079  
  2080  // C comment
  2081  //  /*
  2082  //  ** State information local to the memory allocation subsystem.
  2083  //  */
  2084  var _mem0 TMem0Global
  2085  
  2086  func _sqlite3StatusDown(tls *crt.TLS, _op int32, _N int32) {
  2087  	func() {
  2088  		if _N < int32(0) {
  2089  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18574), unsafe.Pointer(&_sqlite3StatusDownØ00__func__Ø000), unsafe.Pointer(str(404)))
  2090  			crt.X__builtin_abort(tls)
  2091  		}
  2092  	}()
  2093  	func() {
  2094  		if _op < int32(0) || _op >= int32(10) {
  2095  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18575), unsafe.Pointer(&_sqlite3StatusDownØ00__func__Ø000), unsafe.Pointer(str(989)))
  2096  			crt.X__builtin_abort(tls)
  2097  		}
  2098  	}()
  2099  	func() {
  2100  		if Xsqlite3_mutex_held(tls, func() *Xsqlite3_mutex {
  2101  			if (*elem1((*int8)(unsafe.Pointer(&_statMutex)), uintptr(_op))) != 0 {
  2102  				return _sqlite3Pcache1Mutex(tls)
  2103  			}
  2104  			return _sqlite3MallocMutex(tls)
  2105  		}()) == 0 {
  2106  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18576), unsafe.Pointer(&_sqlite3StatusDownØ00__func__Ø000), unsafe.Pointer(str(1022)))
  2107  			crt.X__builtin_abort(tls)
  2108  		}
  2109  	}()
  2110  	func() {
  2111  		if _op < int32(0) || _op >= int32(10) {
  2112  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18578), unsafe.Pointer(&_sqlite3StatusDownØ00__func__Ø000), unsafe.Pointer(str(1103)))
  2113  			crt.X__builtin_abort(tls)
  2114  		}
  2115  	}()
  2116  	*elem7((*uint32)(unsafe.Pointer(&_sqlite3Stat.XnowValue)), uintptr(_op)) -= uint32(_N)
  2117  }
  2118  
  2119  var _sqlite3StatusDownØ00__func__Ø000 [18]int8
  2120  
  2121  func init() {
  2122  	crt.Xstrncpy(nil, &_sqlite3StatusDownØ00__func__Ø000[0], str(1143), 18)
  2123  }
  2124  
  2125  // C comment
  2126  //  /*
  2127  //  ** Elements of sqlite3Stat[] are protected by either the memory allocator
  2128  //  ** mutex, or by the pcache1 mutex.  The following array determines which.
  2129  //  */
  2130  var _statMutex [10]int8
  2131  
  2132  func init() {
  2133  	_statMutex = [10]int8{0, 1, 1, 0, 0, 0, 0, 1, 0, 0}
  2134  }
  2135  
  2136  // C comment
  2137  //  /*
  2138  //  ** Return the global mutex used by this PCACHE implementation.  The
  2139  //  ** sqlite3_status() routine needs access to this mutex.
  2140  //  */
  2141  func _sqlite3Pcache1Mutex(tls *crt.TLS) (r0 *Xsqlite3_mutex) {
  2142  	return (*Xsqlite3_mutex)(_pcache1_g.Xmutex)
  2143  }
  2144  
  2145  // C comment
  2146  //  /*
  2147  //  ** Global data used by this cache.
  2148  //  */
  2149  var _pcache1_g TPCacheGlobal
  2150  
  2151  // C comment
  2152  //  /*
  2153  //  ** Return the memory allocator mutex. sqlite3_status() needs it.
  2154  //  */
  2155  func _sqlite3MallocMutex(tls *crt.TLS) (r0 *Xsqlite3_mutex) {
  2156  	return (*Xsqlite3_mutex)(_mem0.Xmutex)
  2157  }
  2158  
  2159  var _sqlite3Stat Tsqlite3StatType
  2160  
  2161  // C comment
  2162  //  /*
  2163  //  ** Return the size of a memory allocation previously obtained from
  2164  //  ** sqlite3Malloc() or sqlite3_malloc().
  2165  //  */
  2166  func _sqlite3MallocSize(tls *crt.TLS, _p unsafe.Pointer) (r0 int32) {
  2167  	return (_sqlite3Config.Xm.XxSize)(tls, _p)
  2168  }
  2169  
  2170  // C comment
  2171  //  /*
  2172  //  ** The sqlite3_mutex_leave() routine exits a mutex that was previously
  2173  //  ** entered by the same thread.  The behavior is undefined if the mutex
  2174  //  ** is not currently entered. If a NULL pointer is passed as an argument
  2175  //  ** this function is a no-op.
  2176  //  */
  2177  func Xsqlite3_mutex_leave(tls *crt.TLS, _p *Xsqlite3_mutex) {
  2178  	if _p != nil {
  2179  		func() {
  2180  			if (_sqlite3Config.Xmutex.XxMutexLeave) == nil {
  2181  				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)))
  2182  				crt.X__builtin_abort(tls)
  2183  			}
  2184  		}()
  2185  		func() func(*crt.TLS, *Xsqlite3_mutex) {
  2186  			v := _sqlite3Config.Xmutex.XxMutexLeave
  2187  			return *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&v))
  2188  		}()(tls, _p)
  2189  	}
  2190  }
  2191  
  2192  var _sqlite3_mutex_leaveØ00__func__Ø000 [20]int8
  2193  
  2194  func init() {
  2195  	crt.Xstrncpy(nil, &_sqlite3_mutex_leaveØ00__func__Ø000[0], str(1199), 20)
  2196  }
  2197  
  2198  // C comment
  2199  //  /*
  2200  //  ** Resize the block of memory pointed to by p to n bytes. If the
  2201  //  ** resize fails, set the mallocFailed flag in the connection object.
  2202  //  */
  2203  func _sqlite3DbRealloc(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer, _n uint64) (r0 unsafe.Pointer) {
  2204  	func() {
  2205  		if _db == nil {
  2206  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24904), unsafe.Pointer(&_sqlite3DbReallocØ00__func__Ø000), unsafe.Pointer(str(1219)))
  2207  			crt.X__builtin_abort(tls)
  2208  		}
  2209  	}()
  2210  	if _p == nil {
  2211  		return _sqlite3DbMallocRawNN(tls, _db, _n)
  2212  	}
  2213  	func() {
  2214  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
  2215  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24906), unsafe.Pointer(&_sqlite3DbReallocØ00__func__Ø000), unsafe.Pointer(str(881)))
  2216  			crt.X__builtin_abort(tls)
  2217  		}
  2218  	}()
  2219  	if _isLookaside(tls, _db, _p) != 0 && (_n <= uint64(_db.Xlookaside.Xsz)) {
  2220  		return _p
  2221  	}
  2222  	return _dbReallocFinish(tls, _db, _p, _n)
  2223  }
  2224  
  2225  var _sqlite3DbReallocØ00__func__Ø000 [17]int8
  2226  
  2227  func init() {
  2228  	crt.Xstrncpy(nil, &_sqlite3DbReallocØ00__func__Ø000[0], str(1225), 17)
  2229  }
  2230  
  2231  func _sqlite3DbMallocRawNN(tls *crt.TLS, _db *Xsqlite3, _n uint64) (r0 unsafe.Pointer) {
  2232  	var _pBuf *XScratchFreeslot
  2233  	func() {
  2234  		if _db == nil {
  2235  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24864), unsafe.Pointer(&_sqlite3DbMallocRawNNØ00__func__Ø000), unsafe.Pointer(str(1219)))
  2236  			crt.X__builtin_abort(tls)
  2237  		}
  2238  	}()
  2239  	func() {
  2240  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
  2241  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24865), unsafe.Pointer(&_sqlite3DbMallocRawNNØ00__func__Ø000), unsafe.Pointer(str(881)))
  2242  			crt.X__builtin_abort(tls)
  2243  		}
  2244  	}()
  2245  	func() {
  2246  		if _db.XpnBytesFreed != nil {
  2247  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24866), unsafe.Pointer(&_sqlite3DbMallocRawNNØ00__func__Ø000), unsafe.Pointer(str(1242)))
  2248  			crt.X__builtin_abort(tls)
  2249  		}
  2250  	}()
  2251  	if (_db.Xlookaside.XbDisable) != (0) {
  2252  		goto _6
  2253  	}
  2254  	func() {
  2255  		if int32(_db.XmallocFailed) != int32(0) {
  2256  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24868), unsafe.Pointer(&_sqlite3DbMallocRawNNØ00__func__Ø000), unsafe.Pointer(str(1262)))
  2257  			crt.X__builtin_abort(tls)
  2258  		}
  2259  	}()
  2260  	if _n > uint64(_db.Xlookaside.Xsz) {
  2261  		*elem8((*int32)(unsafe.Pointer(&(_db.Xlookaside.XanStat))), uintptr(1)) += 1
  2262  		goto _12
  2263  	}
  2264  	if store9(&_pBuf, (*XScratchFreeslot)(_db.Xlookaside.XpFree)) == nil {
  2265  		*elem8((*int32)(unsafe.Pointer(&(_db.Xlookaside.XanStat))), uintptr(2)) += 1
  2266  		goto _12
  2267  	}
  2268  	*(**XScratchFreeslot)(unsafe.Pointer(&(_db.Xlookaside.XpFree))) = (*XScratchFreeslot)(_pBuf.XpNext)
  2269  	_db.Xlookaside.XnOut += 1
  2270  	*elem8((*int32)(unsafe.Pointer(&(_db.Xlookaside.XanStat))), 0) += 1
  2271  	if (_db.Xlookaside.XnOut) > (_db.Xlookaside.XmxOut) {
  2272  		_db.Xlookaside.XmxOut = _db.Xlookaside.XnOut
  2273  	}
  2274  	return unsafe.Pointer(_pBuf)
  2275  
  2276  _12:
  2277  	goto _15
  2278  _6:
  2279  	if _db.XmallocFailed != 0 {
  2280  		return nil
  2281  	}
  2282  _15:
  2283  	return _dbMallocRawFinish(tls, _db, _n)
  2284  }
  2285  
  2286  var _sqlite3DbMallocRawNNØ00__func__Ø000 [21]int8
  2287  
  2288  func init() {
  2289  	crt.Xstrncpy(nil, &_sqlite3DbMallocRawNNØ00__func__Ø000[0], str(1282), 21)
  2290  }
  2291  
  2292  // C comment
  2293  //  /* Finish the work of sqlite3DbMallocRawNN for the unusual and
  2294  //  ** slower case when the allocation cannot be fulfilled using lookaside.
  2295  //  */
  2296  func _dbMallocRawFinish(tls *crt.TLS, _db *Xsqlite3, _n uint64) (r0 unsafe.Pointer) {
  2297  	var _p unsafe.Pointer
  2298  	func() {
  2299  		if _db == nil {
  2300  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24824), unsafe.Pointer(&_dbMallocRawFinishØ00__func__Ø000), unsafe.Pointer(str(1219)))
  2301  			crt.X__builtin_abort(tls)
  2302  		}
  2303  	}()
  2304  	_p = _sqlite3Malloc(tls, _n)
  2305  	if _p == nil {
  2306  		_sqlite3OomFault(tls, _db)
  2307  	}
  2308  	return _p
  2309  }
  2310  
  2311  var _dbMallocRawFinishØ00__func__Ø000 [18]int8
  2312  
  2313  func init() {
  2314  	crt.Xstrncpy(nil, &_dbMallocRawFinishØ00__func__Ø000[0], str(1303), 18)
  2315  }
  2316  
  2317  // C comment
  2318  //  /*
  2319  //  ** Allocate memory.  This routine is like sqlite3_malloc() except that it
  2320  //  ** assumes the memory subsystem has already been initialized.
  2321  //  */
  2322  func _sqlite3Malloc(tls *crt.TLS, _n uint64) (r0 unsafe.Pointer) {
  2323  	var _p unsafe.Pointer
  2324  	if (_n == (0)) || (_n >= uint64(2147483392)) {
  2325  		_p = nil
  2326  		goto _4
  2327  	}
  2328  	if _sqlite3Config.XbMemstat != 0 {
  2329  		Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
  2330  		_mallocWithAlarm(tls, int32(_n), &_p)
  2331  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
  2332  		goto _4
  2333  	}
  2334  	_p = (_sqlite3Config.Xm.XxMalloc)(tls, int32(_n))
  2335  _4:
  2336  	func() {
  2337  		if (int32(uintptr(_p)) & int32(7)) != int32(0) {
  2338  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24499), unsafe.Pointer(&_sqlite3MallocØ00__func__Ø000), unsafe.Pointer(str(1321)))
  2339  			crt.X__builtin_abort(tls)
  2340  		}
  2341  	}()
  2342  	return _p
  2343  }
  2344  
  2345  // C comment
  2346  //  /*
  2347  //  ** Do a memory allocation with statistics and alarms.  Assume the
  2348  //  ** lock is already held.
  2349  //  */
  2350  func _mallocWithAlarm(tls *crt.TLS, _n int32, _pp *unsafe.Pointer) {
  2351  	var _nFull int32
  2352  	var _1_nUsed int64
  2353  	var _p unsafe.Pointer
  2354  	func() {
  2355  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_mem0.Xmutex)) == 0 {
  2356  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24437), unsafe.Pointer(&_mallocWithAlarmØ00__func__Ø000), unsafe.Pointer(str(1345)))
  2357  			crt.X__builtin_abort(tls)
  2358  		}
  2359  	}()
  2360  	func() {
  2361  		if _n <= int32(0) {
  2362  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24438), unsafe.Pointer(&_mallocWithAlarmØ00__func__Ø000), unsafe.Pointer(str(1376)))
  2363  			crt.X__builtin_abort(tls)
  2364  		}
  2365  	}()
  2366  	_nFull = (_sqlite3Config.Xm.XxRoundup)(tls, _n)
  2367  	_sqlite3StatusHighwater(tls, int32(5), _n)
  2368  	if _mem0.XalarmThreshold <= (0) {
  2369  		goto _4
  2370  	}
  2371  	_1_nUsed = _sqlite3StatusValue(tls, int32(0))
  2372  	if _1_nUsed >= (_mem0.XalarmThreshold - int64(_nFull)) {
  2373  		_mem0.XnearlyFull = int32(1)
  2374  		_sqlite3MallocAlarm(tls, _nFull)
  2375  		goto _6
  2376  	}
  2377  	_mem0.XnearlyFull = int32(0)
  2378  _6:
  2379  _4:
  2380  	_p = (_sqlite3Config.Xm.XxMalloc)(tls, _nFull)
  2381  	if _p != nil {
  2382  		_nFull = _sqlite3MallocSize(tls, _p)
  2383  		_sqlite3StatusUp(tls, int32(0), _nFull)
  2384  		_sqlite3StatusUp(tls, int32(9), int32(1))
  2385  	}
  2386  	*_pp = _p
  2387  }
  2388  
  2389  var _mallocWithAlarmØ00__func__Ø000 [16]int8
  2390  
  2391  func init() {
  2392  	crt.Xstrncpy(nil, &_mallocWithAlarmØ00__func__Ø000[0], str(1380), 16)
  2393  }
  2394  
  2395  // C comment
  2396  //  /*
  2397  //  ** Adjust the highwater mark if necessary.
  2398  //  ** The caller must hold the appropriate mutex.
  2399  //  */
  2400  func _sqlite3StatusHighwater(tls *crt.TLS, _op int32, _X int32) {
  2401  	var _newValue uint32
  2402  	func() {
  2403  		if _X < int32(0) {
  2404  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18589), unsafe.Pointer(&_sqlite3StatusHighwaterØ00__func__Ø000), unsafe.Pointer(str(1396)))
  2405  			crt.X__builtin_abort(tls)
  2406  		}
  2407  	}()
  2408  	_newValue = uint32(_X)
  2409  	func() {
  2410  		if _op < int32(0) || _op >= int32(10) {
  2411  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18591), unsafe.Pointer(&_sqlite3StatusHighwaterØ00__func__Ø000), unsafe.Pointer(str(1103)))
  2412  			crt.X__builtin_abort(tls)
  2413  		}
  2414  	}()
  2415  	func() {
  2416  		if _op < int32(0) || _op >= int32(10) {
  2417  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18592), unsafe.Pointer(&_sqlite3StatusHighwaterØ00__func__Ø000), unsafe.Pointer(str(989)))
  2418  			crt.X__builtin_abort(tls)
  2419  		}
  2420  	}()
  2421  	func() {
  2422  		if Xsqlite3_mutex_held(tls, func() *Xsqlite3_mutex {
  2423  			if (*elem1((*int8)(unsafe.Pointer(&_statMutex)), uintptr(_op))) != 0 {
  2424  				return _sqlite3Pcache1Mutex(tls)
  2425  			}
  2426  			return _sqlite3MallocMutex(tls)
  2427  		}()) == 0 {
  2428  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18593), unsafe.Pointer(&_sqlite3StatusHighwaterØ00__func__Ø000), unsafe.Pointer(str(1022)))
  2429  			crt.X__builtin_abort(tls)
  2430  		}
  2431  	}()
  2432  	func() {
  2433  		if _op != int32(5) && _op != int32(7) && _op != int32(8) && _op != int32(6) {
  2434  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18595), unsafe.Pointer(&_sqlite3StatusHighwaterØ00__func__Ø000), unsafe.Pointer(str(1401)))
  2435  			crt.X__builtin_abort(tls)
  2436  		}
  2437  	}()
  2438  	if _newValue > (*elem7((*uint32)(unsafe.Pointer(&_sqlite3Stat.XmxValue)), uintptr(_op))) {
  2439  		*elem7((*uint32)(unsafe.Pointer(&_sqlite3Stat.XmxValue)), uintptr(_op)) = _newValue
  2440  	}
  2441  }
  2442  
  2443  var _sqlite3StatusHighwaterØ00__func__Ø000 [23]int8
  2444  
  2445  func init() {
  2446  	crt.Xstrncpy(nil, &_sqlite3StatusHighwaterØ00__func__Ø000[0], str(1535), 23)
  2447  }
  2448  
  2449  // C comment
  2450  //  /*
  2451  //  ** Return the current value of a status parameter.  The caller must
  2452  //  ** be holding the appropriate mutex.
  2453  //  */
  2454  func _sqlite3StatusValue(tls *crt.TLS, _op int32) (r0 int64) {
  2455  	func() {
  2456  		if _op < int32(0) || _op >= int32(10) {
  2457  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18543), unsafe.Pointer(&_sqlite3StatusValueØ00__func__Ø000), unsafe.Pointer(str(1103)))
  2458  			crt.X__builtin_abort(tls)
  2459  		}
  2460  	}()
  2461  	func() {
  2462  		if _op < int32(0) || _op >= int32(10) {
  2463  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18544), unsafe.Pointer(&_sqlite3StatusValueØ00__func__Ø000), unsafe.Pointer(str(989)))
  2464  			crt.X__builtin_abort(tls)
  2465  		}
  2466  	}()
  2467  	func() {
  2468  		if Xsqlite3_mutex_held(tls, func() *Xsqlite3_mutex {
  2469  			if (*elem1((*int8)(unsafe.Pointer(&_statMutex)), uintptr(_op))) != 0 {
  2470  				return _sqlite3Pcache1Mutex(tls)
  2471  			}
  2472  			return _sqlite3MallocMutex(tls)
  2473  		}()) == 0 {
  2474  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18545), unsafe.Pointer(&_sqlite3StatusValueØ00__func__Ø000), unsafe.Pointer(str(1022)))
  2475  			crt.X__builtin_abort(tls)
  2476  		}
  2477  	}()
  2478  	return int64(*elem7((*uint32)(unsafe.Pointer(&_sqlite3Stat.XnowValue)), uintptr(_op)))
  2479  }
  2480  
  2481  var _sqlite3StatusValueØ00__func__Ø000 [19]int8
  2482  
  2483  func init() {
  2484  	crt.Xstrncpy(nil, &_sqlite3StatusValueØ00__func__Ø000[0], str(1558), 19)
  2485  }
  2486  
  2487  // C comment
  2488  //  /*
  2489  //  ** Trigger the alarm
  2490  //  */
  2491  func _sqlite3MallocAlarm(tls *crt.TLS, _nByte int32) {
  2492  	if _mem0.XalarmThreshold <= (0) {
  2493  		return
  2494  	}
  2495  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
  2496  	Xsqlite3_release_memory(tls, _nByte)
  2497  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
  2498  }
  2499  
  2500  // C comment
  2501  //  /*
  2502  //  ** Attempt to release up to n bytes of non-essential memory currently
  2503  //  ** held by SQLite. An example of non-essential memory is memory used to
  2504  //  ** cache database pages that are not currently in use.
  2505  //  */
  2506  func Xsqlite3_release_memory(tls *crt.TLS, _n int32) (r0 int32) {
  2507  	return int32(0)
  2508  }
  2509  
  2510  // C comment
  2511  //  /*
  2512  //  ** Add N to the value of a status record.  The caller must hold the
  2513  //  ** appropriate mutex.  (Locking is checked by assert()).
  2514  //  **
  2515  //  ** The StatusUp() routine can accept positive or negative values for N.
  2516  //  ** The value of N is added to the current status value and the high-water
  2517  //  ** mark is adjusted if necessary.
  2518  //  **
  2519  //  ** The StatusDown() routine lowers the current value by N.  The highwater
  2520  //  ** mark is unchanged.  N must be non-negative for StatusDown().
  2521  //  */
  2522  func _sqlite3StatusUp(tls *crt.TLS, _op int32, _N int32) {
  2523  	func() {
  2524  		if _op < int32(0) || _op >= int32(10) {
  2525  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18563), unsafe.Pointer(&_sqlite3StatusUpØ00__func__Ø000), unsafe.Pointer(str(1103)))
  2526  			crt.X__builtin_abort(tls)
  2527  		}
  2528  	}()
  2529  	func() {
  2530  		if _op < int32(0) || _op >= int32(10) {
  2531  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18564), unsafe.Pointer(&_sqlite3StatusUpØ00__func__Ø000), unsafe.Pointer(str(989)))
  2532  			crt.X__builtin_abort(tls)
  2533  		}
  2534  	}()
  2535  	func() {
  2536  		if Xsqlite3_mutex_held(tls, func() *Xsqlite3_mutex {
  2537  			if (*elem1((*int8)(unsafe.Pointer(&_statMutex)), uintptr(_op))) != 0 {
  2538  				return _sqlite3Pcache1Mutex(tls)
  2539  			}
  2540  			return _sqlite3MallocMutex(tls)
  2541  		}()) == 0 {
  2542  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18565), unsafe.Pointer(&_sqlite3StatusUpØ00__func__Ø000), unsafe.Pointer(str(1022)))
  2543  			crt.X__builtin_abort(tls)
  2544  		}
  2545  	}()
  2546  	*elem7((*uint32)(unsafe.Pointer(&_sqlite3Stat.XnowValue)), uintptr(_op)) += uint32(_N)
  2547  	if (*elem7((*uint32)(unsafe.Pointer(&_sqlite3Stat.XnowValue)), uintptr(_op))) > (*elem7((*uint32)(unsafe.Pointer(&_sqlite3Stat.XmxValue)), uintptr(_op))) {
  2548  		*elem7((*uint32)(unsafe.Pointer(&_sqlite3Stat.XmxValue)), uintptr(_op)) = *elem7((*uint32)(unsafe.Pointer(&_sqlite3Stat.XnowValue)), uintptr(_op))
  2549  	}
  2550  }
  2551  
  2552  var _sqlite3StatusUpØ00__func__Ø000 [16]int8
  2553  
  2554  func init() {
  2555  	crt.Xstrncpy(nil, &_sqlite3StatusUpØ00__func__Ø000[0], str(1577), 16)
  2556  }
  2557  
  2558  var _sqlite3MallocØ00__func__Ø000 [14]int8
  2559  
  2560  func init() {
  2561  	crt.Xstrncpy(nil, &_sqlite3MallocØ00__func__Ø000[0], str(1593), 14)
  2562  }
  2563  
  2564  // C comment
  2565  //  /*
  2566  //  ** Call this routine to record the fact that an OOM (out-of-memory) error
  2567  //  ** has happened.  This routine will set db->mallocFailed, and also
  2568  //  ** temporarily disable the lookaside memory allocator and interrupt
  2569  //  ** any running VDBEs.
  2570  //  */
  2571  func _sqlite3OomFault(tls *crt.TLS, _db *Xsqlite3) {
  2572  	if int32(_db.XmallocFailed) != int32(0) || int32(_db.XbBenignMalloc) != int32(0) {
  2573  		goto _1
  2574  	}
  2575  	_db.XmallocFailed = uint8(1)
  2576  	if _db.XnVdbeExec > int32(0) {
  2577  		*(*int32)(unsafe.Pointer(&_db.Xu1)) = int32(1)
  2578  	}
  2579  	_db.Xlookaside.XbDisable += 1
  2580  _1:
  2581  }
  2582  
  2583  func _dbReallocFinish(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer, _n uint64) (r0 unsafe.Pointer) {
  2584  	var _pNew unsafe.Pointer
  2585  	_pNew = nil
  2586  	func() {
  2587  		if _db == nil {
  2588  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24912), unsafe.Pointer(&_dbReallocFinishØ00__func__Ø000), unsafe.Pointer(str(1219)))
  2589  			crt.X__builtin_abort(tls)
  2590  		}
  2591  	}()
  2592  	func() {
  2593  		if _p == nil {
  2594  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24913), unsafe.Pointer(&_dbReallocFinishØ00__func__Ø000), unsafe.Pointer(str(807)))
  2595  			crt.X__builtin_abort(tls)
  2596  		}
  2597  	}()
  2598  	if int32(_db.XmallocFailed) != int32(0) {
  2599  		goto _4
  2600  	}
  2601  	if _isLookaside(tls, _db, _p) == 0 {
  2602  		goto _5
  2603  	}
  2604  	_pNew = _sqlite3DbMallocRawNN(tls, _db, _n)
  2605  	if _pNew != nil {
  2606  		crt.Xmemcpy(tls, _pNew, _p, uint32(_db.Xlookaside.Xsz))
  2607  		_sqlite3DbFree(tls, _db, _p)
  2608  	}
  2609  	goto _7
  2610  _5:
  2611  
  2612  	_pNew = Xsqlite3_realloc64(tls, _p, _n)
  2613  	if _pNew == nil {
  2614  		_sqlite3OomFault(tls, _db)
  2615  	}
  2616  _7:
  2617  _4:
  2618  	return _pNew
  2619  }
  2620  
  2621  var _dbReallocFinishØ00__func__Ø000 [16]int8
  2622  
  2623  func init() {
  2624  	crt.Xstrncpy(nil, &_dbReallocFinishØ00__func__Ø000[0], str(1607), 16)
  2625  }
  2626  
  2627  func Xsqlite3_realloc64(tls *crt.TLS, _pOld unsafe.Pointer, _n uint64) (r0 unsafe.Pointer) {
  2628  	if Xsqlite3_initialize(tls) != 0 {
  2629  		return nil
  2630  	}
  2631  	return _sqlite3Realloc(tls, _pOld, _n)
  2632  }
  2633  
  2634  // C comment
  2635  //  /*
  2636  //  ** Initialize SQLite.
  2637  //  **
  2638  //  ** This routine must be called to initialize the memory allocation,
  2639  //  ** VFS, and mutex subsystems prior to doing any serious work with
  2640  //  ** SQLite.  But as long as you do not compile with SQLITE_OMIT_AUTOINIT
  2641  //  ** this routine will be called automatically by key routines such as
  2642  //  ** sqlite3_open().
  2643  //  **
  2644  //  ** This routine is a no-op except on its very first call for the process,
  2645  //  ** or for the first call after a call to sqlite3_shutdown.
  2646  //  **
  2647  //  ** The first thread to call this routine runs the initialization to
  2648  //  ** completion.  If subsequent threads call this routine before the first
  2649  //  ** thread has finished the initialization process, then the subsequent
  2650  //  ** threads must block until the first thread finishes with the initialization.
  2651  //  **
  2652  //  ** The first thread might call this routine recursively.  Recursive
  2653  //  ** calls to this routine should not block, of course.  Otherwise the
  2654  //  ** initialization process would never complete.
  2655  //  **
  2656  //  ** Let X be the first thread to enter this routine.  Let Y be some other
  2657  //  ** thread.  Then while the initial invocation of this routine by X is
  2658  //  ** incomplete, it is required that:
  2659  //  **
  2660  //  **    *  Calls to this routine from Y must block until the outer-most
  2661  //  **       call by X completes.
  2662  //  **
  2663  //  **    *  Recursive calls to this routine from thread X return immediately
  2664  //  **       without blocking.
  2665  //  */
  2666  func Xsqlite3_initialize(tls *crt.TLS) (r0 int32) {
  2667  	var _rc int32
  2668  	var _12_x uint64
  2669  	var _12_y float64
  2670  	var _pMaster *Xsqlite3_mutex
  2671  
  2672  	if _sqlite3Config.XisInit != 0 {
  2673  		return int32(0)
  2674  	}
  2675  	_rc = _sqlite3MutexInit(tls)
  2676  	if _rc != 0 {
  2677  		return _rc
  2678  	}
  2679  	_pMaster = _sqlite3MutexAlloc(tls, int32(2))
  2680  	Xsqlite3_mutex_enter(tls, _pMaster)
  2681  	_sqlite3Config.XisMutexInit = int32(1)
  2682  	if _sqlite3Config.XisMallocInit == 0 {
  2683  		_rc = _sqlite3MallocInit(tls)
  2684  	}
  2685  	if _rc != int32(0) {
  2686  		goto _3
  2687  	}
  2688  	_sqlite3Config.XisMallocInit = int32(1)
  2689  	if _sqlite3Config.XpInitMutex != nil {
  2690  		goto _4
  2691  	}
  2692  	*(**Xsqlite3_mutex)(unsafe.Pointer(&_sqlite3Config.XpInitMutex)) = _sqlite3MutexAlloc(tls, int32(1))
  2693  	if _sqlite3Config.XbCoreMutex != 0 && (_sqlite3Config.XpInitMutex == nil) {
  2694  		_rc = _sqlite3NomemError(tls, int32(140658))
  2695  	}
  2696  _4:
  2697  _3:
  2698  	if _rc == int32(0) {
  2699  		_sqlite3Config.XnRefInitMutex += 1
  2700  	}
  2701  	Xsqlite3_mutex_leave(tls, _pMaster)
  2702  	if _rc != int32(0) {
  2703  		return _rc
  2704  	}
  2705  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_sqlite3Config.XpInitMutex))
  2706  	if _sqlite3Config.XisInit != int32(0) || _sqlite3Config.XinProgress != int32(0) {
  2707  		goto _10
  2708  	}
  2709  	_sqlite3Config.XinProgress = int32(1)
  2710  	crt.Xmemset(tls, unsafe.Pointer(&_sqlite3BuiltinFunctions), int32(0), uint32(92))
  2711  	_sqlite3RegisterBuiltinFunctions(tls)
  2712  	if _sqlite3Config.XisPCacheInit == int32(0) {
  2713  		_rc = _sqlite3PcacheInitialize(tls)
  2714  	}
  2715  	if _rc == int32(0) {
  2716  		_sqlite3Config.XisPCacheInit = int32(1)
  2717  		_rc = _sqlite3OsInit(tls)
  2718  	}
  2719  	if _rc == int32(0) {
  2720  		_sqlite3PCacheBufferSetup(tls, _sqlite3Config.XpPage, _sqlite3Config.XszPage, _sqlite3Config.XnPage)
  2721  		_sqlite3Config.XisInit = int32(1)
  2722  	}
  2723  	_sqlite3Config.XinProgress = int32(0)
  2724  _10:
  2725  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_sqlite3Config.XpInitMutex))
  2726  	Xsqlite3_mutex_enter(tls, _pMaster)
  2727  	_sqlite3Config.XnRefInitMutex -= 1
  2728  	if _sqlite3Config.XnRefInitMutex <= int32(0) {
  2729  		func() {
  2730  			if _sqlite3Config.XnRefInitMutex != int32(0) {
  2731  				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)))
  2732  				crt.X__builtin_abort(tls)
  2733  			}
  2734  		}()
  2735  		Xsqlite3_mutex_free(tls, (*Xsqlite3_mutex)(_sqlite3Config.XpInitMutex))
  2736  		*(**Xsqlite3_mutex)(unsafe.Pointer(&_sqlite3Config.XpInitMutex)) = nil
  2737  	}
  2738  	Xsqlite3_mutex_leave(tls, _pMaster)
  2739  	if _rc == int32(0) {
  2740  		_12_x = uint64(9223372036854775807)
  2741  
  2742  		crt.Xmemcpy(tls, unsafe.Pointer(&_12_y), unsafe.Pointer(&_12_x), uint32(8))
  2743  		func() {
  2744  			if _sqlite3IsNaN(tls, _12_y) == 0 {
  2745  				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)))
  2746  				crt.X__builtin_abort(tls)
  2747  			}
  2748  		}()
  2749  	}
  2750  	return _rc
  2751  
  2752  	_ = _12_x
  2753  	panic(0)
  2754  }
  2755  
  2756  // C comment
  2757  //  /*
  2758  //  ** Initialize the mutex system.
  2759  //  */
  2760  func _sqlite3MutexInit(tls *crt.TLS) (r0 int32) {
  2761  	var _rc int32
  2762  	var _1_pFrom, _1_pTo *Xsqlite3_mutex_methods
  2763  	_rc = int32(0)
  2764  	if (_sqlite3Config.Xmutex.XxMutexAlloc) != nil {
  2765  		goto _0
  2766  	}
  2767  	_1_pTo = &_sqlite3Config.Xmutex
  2768  	if _sqlite3Config.XbCoreMutex != 0 {
  2769  		_1_pFrom = _sqlite3DefaultMutex(tls)
  2770  		goto _2
  2771  	}
  2772  	_1_pFrom = _sqlite3NoopMutex(tls)
  2773  _2:
  2774  	_1_pTo.XxMutexInit = _1_pFrom.XxMutexInit
  2775  	_1_pTo.XxMutexEnd = _1_pFrom.XxMutexEnd
  2776  	*(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&_1_pTo.XxMutexFree)) = func() func(*crt.TLS, *Xsqlite3_mutex) {
  2777  		v := _1_pFrom.XxMutexFree
  2778  		return *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&v))
  2779  	}()
  2780  	*(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&_1_pTo.XxMutexEnter)) = func() func(*crt.TLS, *Xsqlite3_mutex) {
  2781  		v := _1_pFrom.XxMutexEnter
  2782  		return *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&v))
  2783  	}()
  2784  	*(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&_1_pTo.XxMutexTry)) = func() func(*crt.TLS, *Xsqlite3_mutex) int32 {
  2785  		v := _1_pFrom.XxMutexTry
  2786  		return *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&v))
  2787  	}()
  2788  	*(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&_1_pTo.XxMutexLeave)) = func() func(*crt.TLS, *Xsqlite3_mutex) {
  2789  		v := _1_pFrom.XxMutexLeave
  2790  		return *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&v))
  2791  	}()
  2792  	*(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&_1_pTo.XxMutexHeld)) = func() func(*crt.TLS, *Xsqlite3_mutex) int32 {
  2793  		v := _1_pFrom.XxMutexHeld
  2794  		return *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&v))
  2795  	}()
  2796  	*(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&_1_pTo.XxMutexNotheld)) = func() func(*crt.TLS, *Xsqlite3_mutex) int32 {
  2797  		v := _1_pFrom.XxMutexNotheld
  2798  		return *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&v))
  2799  	}()
  2800  	_sqlite3MemoryBarrier(tls)
  2801  	*(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer(&_1_pTo.XxMutexAlloc)) = func() func(*crt.TLS, int32) *Xsqlite3_mutex {
  2802  		v := _1_pFrom.XxMutexAlloc
  2803  		return *(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer(&v))
  2804  	}()
  2805  _0:
  2806  	func() {
  2807  		if (_sqlite3Config.Xmutex.XxMutexInit) == nil {
  2808  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(22801), unsafe.Pointer(&_sqlite3MutexInitØ00__func__Ø000), unsafe.Pointer(str(1676)))
  2809  			crt.X__builtin_abort(tls)
  2810  		}
  2811  	}()
  2812  	_rc = (_sqlite3Config.Xmutex.XxMutexInit)(tls)
  2813  	_mutexIsInit = int32(1)
  2814  	bug20530(_mutexIsInit)
  2815  	return _rc
  2816  }
  2817  
  2818  func _sqlite3DefaultMutex(tls *crt.TLS) (r0 *Xsqlite3_mutex_methods) {
  2819  	return &_sqlite3DefaultMutexØ00sMutexØ001
  2820  }
  2821  
  2822  var _sqlite3DefaultMutexØ00sMutexØ001 Xsqlite3_mutex_methods
  2823  
  2824  func init() {
  2825  	_sqlite3DefaultMutexØ00sMutexØ001 = Xsqlite3_mutex_methods{XxMutexInit: _pthreadMutexInit, XxMutexEnd: _pthreadMutexEnd, XxMutexAlloc: *(*func(*crt.TLS, int32) unsafe.Pointer)(unsafe.Pointer(&struct {
  2826  		f func(*crt.TLS, int32) *Xsqlite3_mutex
  2827  	}{_pthreadMutexAlloc})), XxMutexFree: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  2828  		f func(*crt.TLS, *Xsqlite3_mutex)
  2829  	}{_pthreadMutexFree})), XxMutexEnter: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  2830  		f func(*crt.TLS, *Xsqlite3_mutex)
  2831  	}{_pthreadMutexEnter})), XxMutexTry: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
  2832  		f func(*crt.TLS, *Xsqlite3_mutex) int32
  2833  	}{_pthreadMutexTry})), XxMutexLeave: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  2834  		f func(*crt.TLS, *Xsqlite3_mutex)
  2835  	}{_pthreadMutexLeave})), XxMutexHeld: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
  2836  		f func(*crt.TLS, *Xsqlite3_mutex) int32
  2837  	}{_pthreadMutexHeld})), XxMutexNotheld: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
  2838  		f func(*crt.TLS, *Xsqlite3_mutex) int32
  2839  	}{_pthreadMutexNotheld}))}
  2840  }
  2841  
  2842  // C comment
  2843  //  /*
  2844  //  ** Initialize and deinitialize the mutex subsystem.
  2845  //  */
  2846  func _pthreadMutexInit(tls *crt.TLS) (r0 int32) {
  2847  	return int32(0)
  2848  }
  2849  
  2850  func _pthreadMutexEnd(tls *crt.TLS) (r0 int32) {
  2851  	return int32(0)
  2852  }
  2853  
  2854  // C comment
  2855  //  /*
  2856  //  ** The sqlite3_mutex_alloc() routine allocates a new
  2857  //  ** mutex and returns a pointer to it.  If it returns NULL
  2858  //  ** that means that a mutex could not be allocated.  SQLite
  2859  //  ** will unwind its stack and return an error.  The argument
  2860  //  ** to sqlite3_mutex_alloc() is one of these integer constants:
  2861  //  **
  2862  //  ** <ul>
  2863  //  ** <li>  SQLITE_MUTEX_FAST
  2864  //  ** <li>  SQLITE_MUTEX_RECURSIVE
  2865  //  ** <li>  SQLITE_MUTEX_STATIC_MASTER
  2866  //  ** <li>  SQLITE_MUTEX_STATIC_MEM
  2867  //  ** <li>  SQLITE_MUTEX_STATIC_OPEN
  2868  //  ** <li>  SQLITE_MUTEX_STATIC_PRNG
  2869  //  ** <li>  SQLITE_MUTEX_STATIC_LRU
  2870  //  ** <li>  SQLITE_MUTEX_STATIC_PMEM
  2871  //  ** <li>  SQLITE_MUTEX_STATIC_APP1
  2872  //  ** <li>  SQLITE_MUTEX_STATIC_APP2
  2873  //  ** <li>  SQLITE_MUTEX_STATIC_APP3
  2874  //  ** <li>  SQLITE_MUTEX_STATIC_VFS1
  2875  //  ** <li>  SQLITE_MUTEX_STATIC_VFS2
  2876  //  ** <li>  SQLITE_MUTEX_STATIC_VFS3
  2877  //  ** </ul>
  2878  //  **
  2879  //  ** The first two constants cause sqlite3_mutex_alloc() to create
  2880  //  ** a new mutex.  The new mutex is recursive when SQLITE_MUTEX_RECURSIVE
  2881  //  ** is used but not necessarily so when SQLITE_MUTEX_FAST is used.
  2882  //  ** The mutex implementation does not need to make a distinction
  2883  //  ** between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does
  2884  //  ** not want to.  But SQLite will only request a recursive mutex in
  2885  //  ** cases where it really needs one.  If a faster non-recursive mutex
  2886  //  ** implementation is available on the host platform, the mutex subsystem
  2887  //  ** might return such a mutex in response to SQLITE_MUTEX_FAST.
  2888  //  **
  2889  //  ** The other allowed parameters to sqlite3_mutex_alloc() each return
  2890  //  ** a pointer to a static preexisting mutex.  Six static mutexes are
  2891  //  ** used by the current version of SQLite.  Future versions of SQLite
  2892  //  ** may add additional static mutexes.  Static mutexes are for internal
  2893  //  ** use by SQLite only.  Applications that use SQLite mutexes should
  2894  //  ** use only the dynamic mutexes returned by SQLITE_MUTEX_FAST or
  2895  //  ** SQLITE_MUTEX_RECURSIVE.
  2896  //  **
  2897  //  ** Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST
  2898  //  ** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc()
  2899  //  ** returns a different mutex on every call.  But for the static
  2900  //  ** mutex types, the same mutex is returned on every call that has
  2901  //  ** the same type number.
  2902  //  */
  2903  func _pthreadMutexAlloc(tls *crt.TLS, _iType int32) (r0 *Xsqlite3_mutex) {
  2904  	var _3_recursiveAttr crt.Xpthread_mutexattr_t
  2905  	var _p *Xsqlite3_mutex
  2906  	switch _iType {
  2907  	case int32(0):
  2908  		goto _2
  2909  	case int32(1):
  2910  		goto _1
  2911  	default:
  2912  		goto _3
  2913  	}
  2914  
  2915  _1:
  2916  	_p = (*Xsqlite3_mutex)(_sqlite3MallocZero(tls, uint64(40)))
  2917  	if _p != nil {
  2918  		crt.Xpthread_mutexattr_init(tls, &_3_recursiveAttr)
  2919  		crt.Xpthread_mutexattr_settype(tls, &_3_recursiveAttr, int32(1))
  2920  		crt.Xpthread_mutex_init(tls, &_p.Xmutex, &_3_recursiveAttr)
  2921  		crt.Xpthread_mutexattr_destroy(tls, &_3_recursiveAttr)
  2922  	}
  2923  	goto _5
  2924  _2:
  2925  	_p = (*Xsqlite3_mutex)(_sqlite3MallocZero(tls, uint64(40)))
  2926  	if _p != nil {
  2927  		crt.Xpthread_mutex_init(tls, &_p.Xmutex, nil)
  2928  	}
  2929  	goto _5
  2930  _3:
  2931  	if ((_iType - int32(2)) < int32(0)) || ((_iType - int32(2)) >= int32(12)) {
  2932  		_sqlite3MisuseError(tls, int32(23329))
  2933  		return nil
  2934  	}
  2935  	_p = elem10((*Xsqlite3_mutex)(unsafe.Pointer(&_pthreadMutexAllocØ00staticMutexesØ001)), uintptr(_iType-int32(2)))
  2936  	goto _5
  2937  _5:
  2938  	if _p != nil {
  2939  		_p.Xid = _iType
  2940  	}
  2941  	return _p
  2942  }
  2943  
  2944  func _sqlite3MallocZero(tls *crt.TLS, _n uint64) (r0 unsafe.Pointer) {
  2945  	var _p unsafe.Pointer
  2946  	_p = _sqlite3Malloc(tls, _n)
  2947  	if _p != nil {
  2948  		crt.Xmemset(tls, _p, int32(0), uint32(_n))
  2949  	}
  2950  	return _p
  2951  }
  2952  
  2953  var _pthreadMutexAllocØ00staticMutexesØ001 [12]Xsqlite3_mutex
  2954  
  2955  // C comment
  2956  //  /*
  2957  //  ** This routine deallocates a previously
  2958  //  ** allocated mutex.  SQLite is careful to deallocate every
  2959  //  ** mutex that it allocates.
  2960  //  */
  2961  func _pthreadMutexFree(tls *crt.TLS, _p *Xsqlite3_mutex) {
  2962  	func() {
  2963  		if _p.XnRef != int32(0) {
  2964  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(23350), unsafe.Pointer(&_pthreadMutexFreeØ00__func__Ø000), unsafe.Pointer(str(1713)))
  2965  			crt.X__builtin_abort(tls)
  2966  		}
  2967  	}()
  2968  	if (_p.Xid == int32(0)) || (_p.Xid == int32(1)) {
  2969  		crt.Xpthread_mutex_destroy(tls, &_p.Xmutex)
  2970  		Xsqlite3_free(tls, unsafe.Pointer(_p))
  2971  		goto _4
  2972  	}
  2973  	_sqlite3MisuseError(tls, int32(23360))
  2974  _4:
  2975  }
  2976  
  2977  var _pthreadMutexFreeØ00__func__Ø000 [17]int8
  2978  
  2979  func init() {
  2980  	crt.Xstrncpy(nil, &_pthreadMutexFreeØ00__func__Ø000[0], str(1724), 17)
  2981  }
  2982  
  2983  // C comment
  2984  //  /*
  2985  //  ** The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt
  2986  //  ** to enter a mutex.  If another thread is already within the mutex,
  2987  //  ** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return
  2988  //  ** SQLITE_BUSY.  The sqlite3_mutex_try() interface returns SQLITE_OK
  2989  //  ** upon successful entry.  Mutexes created using SQLITE_MUTEX_RECURSIVE can
  2990  //  ** be entered multiple times by the same thread.  In such cases the,
  2991  //  ** mutex must be exited an equal number of times before another thread
  2992  //  ** can enter.  If the same thread tries to enter any other kind of mutex
  2993  //  ** more than once, the behavior is undefined.
  2994  //  */
  2995  func _pthreadMutexEnter(tls *crt.TLS, _p *Xsqlite3_mutex) {
  2996  	func() {
  2997  		if _p.Xid != int32(1) && _pthreadMutexNotheld(tls, _p) == 0 {
  2998  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(23377), unsafe.Pointer(&_pthreadMutexEnterØ00__func__Ø000), unsafe.Pointer(str(1741)))
  2999  			crt.X__builtin_abort(tls)
  3000  		}
  3001  	}()
  3002  	crt.Xpthread_mutex_lock(tls, &_p.Xmutex)
  3003  	func() {
  3004  		if _p.XnRef <= int32(0) && _p.Xowner != (0) {
  3005  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(23406), unsafe.Pointer(&_pthreadMutexEnterØ00__func__Ø000), unsafe.Pointer(str(1797)))
  3006  			crt.X__builtin_abort(tls)
  3007  		}
  3008  	}()
  3009  	_p.Xowner = crt.Xpthread_self(tls)
  3010  	_p.XnRef += 1
  3011  	if _p.Xtrace != 0 {
  3012  		crt.Xprintf(tls, str(1822), unsafe.Pointer(_p), _p.Xtrace, _p.XnRef)
  3013  	}
  3014  }
  3015  
  3016  func _pthreadMutexNotheld(tls *crt.TLS, _p *Xsqlite3_mutex) (r0 int32) {
  3017  	return bool2int((_p.XnRef == int32(0)) || (crt.Xpthread_equal(tls, _p.Xowner, crt.Xpthread_self(tls)) == int32(0)))
  3018  }
  3019  
  3020  var _pthreadMutexEnterØ00__func__Ø000 [18]int8
  3021  
  3022  func init() {
  3023  	crt.Xstrncpy(nil, &_pthreadMutexEnterØ00__func__Ø000[0], str(1856), 18)
  3024  }
  3025  
  3026  func _pthreadMutexTry(tls *crt.TLS, _p *Xsqlite3_mutex) (r0 int32) {
  3027  	var _rc int32
  3028  	func() {
  3029  		if _p.Xid != int32(1) && _pthreadMutexNotheld(tls, _p) == 0 {
  3030  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(23420), unsafe.Pointer(&_pthreadMutexTryØ00__func__Ø000), unsafe.Pointer(str(1741)))
  3031  			crt.X__builtin_abort(tls)
  3032  		}
  3033  	}()
  3034  	if crt.Xpthread_mutex_trylock(tls, &_p.Xmutex) == int32(0) {
  3035  		_p.Xowner = crt.Xpthread_self(tls)
  3036  		_p.XnRef += 1
  3037  		_rc = int32(0)
  3038  		goto _4
  3039  	}
  3040  	_rc = int32(5)
  3041  _4:
  3042  	if (_rc == int32(0)) && _p.Xtrace != 0 {
  3043  		crt.Xprintf(tls, str(1822), unsafe.Pointer(_p), _p.Xtrace, _p.XnRef)
  3044  	}
  3045  	return _rc
  3046  }
  3047  
  3048  var _pthreadMutexTryØ00__func__Ø000 [16]int8
  3049  
  3050  func init() {
  3051  	crt.Xstrncpy(nil, &_pthreadMutexTryØ00__func__Ø000[0], str(1874), 16)
  3052  }
  3053  
  3054  // C comment
  3055  //  /*
  3056  //  ** The sqlite3_mutex_leave() routine exits a mutex that was
  3057  //  ** previously entered by the same thread.  The behavior
  3058  //  ** is undefined if the mutex is not currently entered or
  3059  //  ** is not currently allocated.  SQLite will never do either.
  3060  //  */
  3061  func _pthreadMutexLeave(tls *crt.TLS, _p *Xsqlite3_mutex) {
  3062  	func() {
  3063  		if _pthreadMutexHeld(tls, _p) == 0 {
  3064  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(23476), unsafe.Pointer(&_pthreadMutexLeaveØ00__func__Ø000), unsafe.Pointer(str(1890)))
  3065  			crt.X__builtin_abort(tls)
  3066  		}
  3067  	}()
  3068  	_p.XnRef -= 1
  3069  	if _p.XnRef == int32(0) {
  3070  		_p.Xowner = 0
  3071  	}
  3072  	func() {
  3073  		if _p.XnRef != int32(0) && _p.Xid != int32(1) {
  3074  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(23481), unsafe.Pointer(&_pthreadMutexLeaveØ00__func__Ø000), unsafe.Pointer(str(1910)))
  3075  			crt.X__builtin_abort(tls)
  3076  		}
  3077  	}()
  3078  	crt.Xpthread_mutex_unlock(tls, &_p.Xmutex)
  3079  	if _p.Xtrace != 0 {
  3080  		crt.Xprintf(tls, str(1954), unsafe.Pointer(_p), _p.Xtrace, _p.XnRef)
  3081  	}
  3082  }
  3083  
  3084  func _pthreadMutexHeld(tls *crt.TLS, _p *Xsqlite3_mutex) (r0 int32) {
  3085  	return bool2int((_p.XnRef != int32(0)) && crt.Xpthread_equal(tls, _p.Xowner, crt.Xpthread_self(tls)) != 0)
  3086  }
  3087  
  3088  var _pthreadMutexLeaveØ00__func__Ø000 [18]int8
  3089  
  3090  func init() {
  3091  	crt.Xstrncpy(nil, &_pthreadMutexLeaveØ00__func__Ø000[0], str(1988), 18)
  3092  }
  3093  
  3094  func _sqlite3NoopMutex(tls *crt.TLS) (r0 *Xsqlite3_mutex_methods) {
  3095  	return &_sqlite3NoopMutexØ00sMutexØ001
  3096  }
  3097  
  3098  var _sqlite3NoopMutexØ00sMutexØ001 Xsqlite3_mutex_methods
  3099  
  3100  func init() {
  3101  	_sqlite3NoopMutexØ00sMutexØ001 = Xsqlite3_mutex_methods{XxMutexInit: _debugMutexInit, XxMutexEnd: _debugMutexEnd, XxMutexAlloc: *(*func(*crt.TLS, int32) unsafe.Pointer)(unsafe.Pointer(&struct {
  3102  		f func(*crt.TLS, int32) *Xsqlite3_mutex
  3103  	}{_debugMutexAlloc})), XxMutexFree: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  3104  		f func(*crt.TLS, *Xsqlite3_mutex)
  3105  	}{_debugMutexFree})), XxMutexEnter: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  3106  		f func(*crt.TLS, *Xsqlite3_mutex)
  3107  	}{_debugMutexEnter})), XxMutexTry: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
  3108  		f func(*crt.TLS, *Xsqlite3_mutex) int32
  3109  	}{_debugMutexTry})), XxMutexLeave: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  3110  		f func(*crt.TLS, *Xsqlite3_mutex)
  3111  	}{_debugMutexLeave})), XxMutexHeld: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
  3112  		f func(*crt.TLS, *Xsqlite3_mutex) int32
  3113  	}{_debugMutexHeld})), XxMutexNotheld: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
  3114  		f func(*crt.TLS, *Xsqlite3_mutex) int32
  3115  	}{_debugMutexNotheld}))}
  3116  }
  3117  
  3118  // C comment
  3119  //  /*
  3120  //  ** Initialize and deinitialize the mutex subsystem.
  3121  //  */
  3122  func _debugMutexInit(tls *crt.TLS) (r0 int32) {
  3123  	return int32(0)
  3124  }
  3125  
  3126  func _debugMutexEnd(tls *crt.TLS) (r0 int32) {
  3127  	return int32(0)
  3128  }
  3129  
  3130  // C comment
  3131  //  /*
  3132  //  ** The sqlite3_mutex_alloc() routine allocates a new
  3133  //  ** mutex and returns a pointer to it.  If it returns NULL
  3134  //  ** that means that a mutex could not be allocated.
  3135  //  */
  3136  func _debugMutexAlloc(tls *crt.TLS, _id int32) (r0 *Xsqlite3_mutex) {
  3137  	var _pNew *Xsqlite3_debug_mutex
  3138  	_pNew = nil
  3139  	switch _id {
  3140  	case int32(0):
  3141  		goto _1
  3142  	case int32(1):
  3143  		goto _1
  3144  	default:
  3145  		goto _3
  3146  	}
  3147  
  3148  _1:
  3149  	_pNew = (*Xsqlite3_debug_mutex)(_sqlite3Malloc(tls, uint64(8)))
  3150  	if _pNew != nil {
  3151  		_pNew.Xid = _id
  3152  		_pNew.Xcnt = int32(0)
  3153  	}
  3154  	goto _5
  3155  _3:
  3156  	if ((_id - int32(2)) < int32(0)) || ((_id - int32(2)) >= int32(12)) {
  3157  		_sqlite3MisuseError(tls, int32(23039))
  3158  		return nil
  3159  	}
  3160  	_pNew = elem11((*Xsqlite3_debug_mutex)(unsafe.Pointer(&_debugMutexAllocØ00aStaticØ001)), uintptr(_id-int32(2)))
  3161  	_pNew.Xid = _id
  3162  	goto _5
  3163  _5:
  3164  	return (*Xsqlite3_mutex)(unsafe.Pointer(_pNew))
  3165  }
  3166  
  3167  var _debugMutexAllocØ00aStaticØ001 [12]Xsqlite3_debug_mutex
  3168  
  3169  // C comment
  3170  //  /*
  3171  //  ** This routine deallocates a previously allocated mutex.
  3172  //  */
  3173  func _debugMutexFree(tls *crt.TLS, _pX *Xsqlite3_mutex) {
  3174  	var _p *Xsqlite3_debug_mutex
  3175  	_p = (*Xsqlite3_debug_mutex)(unsafe.Pointer(_pX))
  3176  	func() {
  3177  		if _p.Xcnt != int32(0) {
  3178  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(23056), unsafe.Pointer(&_debugMutexFreeØ00__func__Ø000), unsafe.Pointer(str(2006)))
  3179  			crt.X__builtin_abort(tls)
  3180  		}
  3181  	}()
  3182  	if (_p.Xid == int32(1)) || (_p.Xid == int32(0)) {
  3183  		Xsqlite3_free(tls, unsafe.Pointer(_p))
  3184  		goto _4
  3185  	}
  3186  	_sqlite3MisuseError(tls, int32(23061))
  3187  _4:
  3188  }
  3189  
  3190  var _debugMutexFreeØ00__func__Ø000 [15]int8
  3191  
  3192  func init() {
  3193  	crt.Xstrncpy(nil, &_debugMutexFreeØ00__func__Ø000[0], str(2016), 15)
  3194  }
  3195  
  3196  // C comment
  3197  //  /*
  3198  //  ** The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt
  3199  //  ** to enter a mutex.  If another thread is already within the mutex,
  3200  //  ** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return
  3201  //  ** SQLITE_BUSY.  The sqlite3_mutex_try() interface returns SQLITE_OK
  3202  //  ** upon successful entry.  Mutexes created using SQLITE_MUTEX_RECURSIVE can
  3203  //  ** be entered multiple times by the same thread.  In such cases the,
  3204  //  ** mutex must be exited an equal number of times before another thread
  3205  //  ** can enter.  If the same thread tries to enter any other kind of mutex
  3206  //  ** more than once, the behavior is undefined.
  3207  //  */
  3208  func _debugMutexEnter(tls *crt.TLS, _pX *Xsqlite3_mutex) {
  3209  	var _p *Xsqlite3_debug_mutex
  3210  	_p = (*Xsqlite3_debug_mutex)(unsafe.Pointer(_pX))
  3211  	func() {
  3212  		if _p.Xid != int32(1) && _debugMutexNotheld(tls, _pX) == 0 {
  3213  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(23079), unsafe.Pointer(&_debugMutexEnterØ00__func__Ø000), unsafe.Pointer(str(2031)))
  3214  			crt.X__builtin_abort(tls)
  3215  		}
  3216  	}()
  3217  	_p.Xcnt += 1
  3218  }
  3219  
  3220  func _debugMutexNotheld(tls *crt.TLS, _pX *Xsqlite3_mutex) (r0 int32) {
  3221  	var _p *Xsqlite3_debug_mutex
  3222  	_p = (*Xsqlite3_debug_mutex)(unsafe.Pointer(_pX))
  3223  	return bool2int((_p == nil) || (_p.Xcnt == int32(0)))
  3224  }
  3225  
  3226  var _debugMutexEnterØ00__func__Ø000 [16]int8
  3227  
  3228  func init() {
  3229  	crt.Xstrncpy(nil, &_debugMutexEnterØ00__func__Ø000[0], str(2086), 16)
  3230  }
  3231  
  3232  func _debugMutexTry(tls *crt.TLS, _pX *Xsqlite3_mutex) (r0 int32) {
  3233  	var _p *Xsqlite3_debug_mutex
  3234  	_p = (*Xsqlite3_debug_mutex)(unsafe.Pointer(_pX))
  3235  	func() {
  3236  		if _p.Xid != int32(1) && _debugMutexNotheld(tls, _pX) == 0 {
  3237  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(23084), unsafe.Pointer(&_debugMutexTryØ00__func__Ø000), unsafe.Pointer(str(2031)))
  3238  			crt.X__builtin_abort(tls)
  3239  		}
  3240  	}()
  3241  	_p.Xcnt += 1
  3242  	return int32(0)
  3243  }
  3244  
  3245  var _debugMutexTryØ00__func__Ø000 [14]int8
  3246  
  3247  func init() {
  3248  	crt.Xstrncpy(nil, &_debugMutexTryØ00__func__Ø000[0], str(2102), 14)
  3249  }
  3250  
  3251  // C comment
  3252  //  /*
  3253  //  ** The sqlite3_mutex_leave() routine exits a mutex that was
  3254  //  ** previously entered by the same thread.  The behavior
  3255  //  ** is undefined if the mutex is not currently entered or
  3256  //  ** is not currently allocated.  SQLite will never do either.
  3257  //  */
  3258  func _debugMutexLeave(tls *crt.TLS, _pX *Xsqlite3_mutex) {
  3259  	var _p *Xsqlite3_debug_mutex
  3260  	_p = (*Xsqlite3_debug_mutex)(unsafe.Pointer(_pX))
  3261  	func() {
  3262  		if _debugMutexHeld(tls, _pX) == 0 {
  3263  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(23097), unsafe.Pointer(&_debugMutexLeaveØ00__func__Ø000), unsafe.Pointer(str(2116)))
  3264  			crt.X__builtin_abort(tls)
  3265  		}
  3266  	}()
  3267  	_p.Xcnt -= 1
  3268  	func() {
  3269  		if _p.Xid != int32(1) && _debugMutexNotheld(tls, _pX) == 0 {
  3270  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(23099), unsafe.Pointer(&_debugMutexLeaveØ00__func__Ø000), unsafe.Pointer(str(2031)))
  3271  			crt.X__builtin_abort(tls)
  3272  		}
  3273  	}()
  3274  }
  3275  
  3276  // C comment
  3277  //  /*
  3278  //  ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
  3279  //  ** intended for use inside assert() statements.
  3280  //  */
  3281  func _debugMutexHeld(tls *crt.TLS, _pX *Xsqlite3_mutex) (r0 int32) {
  3282  	var _p *Xsqlite3_debug_mutex
  3283  	_p = (*Xsqlite3_debug_mutex)(unsafe.Pointer(_pX))
  3284  	return bool2int((_p == nil) || (_p.Xcnt > int32(0)))
  3285  }
  3286  
  3287  var _debugMutexLeaveØ00__func__Ø000 [16]int8
  3288  
  3289  func init() {
  3290  	crt.Xstrncpy(nil, &_debugMutexLeaveØ00__func__Ø000[0], str(2135), 16)
  3291  }
  3292  
  3293  // C comment
  3294  //  /*
  3295  //  ** Try to provide a memory barrier operation, needed for initialization
  3296  //  ** and also for the implementation of xShmBarrier in the VFS in cases
  3297  //  ** where SQLite is compiled without mutexes.
  3298  //  */
  3299  func _sqlite3MemoryBarrier(tls *crt.TLS) {
  3300  }
  3301  
  3302  var _sqlite3MutexInitØ00__func__Ø000 [17]int8
  3303  
  3304  func init() {
  3305  	crt.Xstrncpy(nil, &_sqlite3MutexInitØ00__func__Ø000[0], str(2151), 17)
  3306  }
  3307  
  3308  // C comment
  3309  //  /*
  3310  //  ** For debugging purposes, record when the mutex subsystem is initialized
  3311  //  ** and uninitialized so that we can assert() if there is an attempt to
  3312  //  ** allocate a mutex while the system is uninitialized.
  3313  //  */
  3314  var _mutexIsInit int32
  3315  
  3316  func _sqlite3MutexAlloc(tls *crt.TLS, _id int32) (r0 *Xsqlite3_mutex) {
  3317  	if _sqlite3Config.XbCoreMutex == 0 {
  3318  		return nil
  3319  	}
  3320  	func() {
  3321  		if _mutexIsInit == 0 {
  3322  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(22844), unsafe.Pointer(&_sqlite3MutexAllocØ00__func__Ø000), unsafe.Pointer(str(2168)))
  3323  			crt.X__builtin_abort(tls)
  3324  		}
  3325  	}()
  3326  	func() {
  3327  		if (_sqlite3Config.Xmutex.XxMutexAlloc) == nil {
  3328  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(22845), unsafe.Pointer(&_sqlite3MutexAllocØ00__func__Ø000), unsafe.Pointer(str(2193)))
  3329  			crt.X__builtin_abort(tls)
  3330  		}
  3331  	}()
  3332  	return func() func(*crt.TLS, int32) *Xsqlite3_mutex {
  3333  		v := _sqlite3Config.Xmutex.XxMutexAlloc
  3334  		return *(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer(&v))
  3335  	}()(tls, _id)
  3336  }
  3337  
  3338  var _sqlite3MutexAllocØ00__func__Ø000 [18]int8
  3339  
  3340  func init() {
  3341  	crt.Xstrncpy(nil, &_sqlite3MutexAllocØ00__func__Ø000[0], str(2231), 18)
  3342  }
  3343  
  3344  // C comment
  3345  //  /*
  3346  //  ** Initialize the memory allocation subsystem.
  3347  //  */
  3348  func _sqlite3MallocInit(tls *crt.TLS) (r0 int32) {
  3349  	var _rc, _2_i, _2_n, _2_sz int32
  3350  	var _2_pSlot *XScratchFreeslot
  3351  	if (_sqlite3Config.Xm.XxMalloc) == nil {
  3352  		_sqlite3MemSetDefault(tls)
  3353  	}
  3354  	crt.Xmemset(tls, unsafe.Pointer(&_mem0), int32(0), uint32(28))
  3355  	*(**Xsqlite3_mutex)(unsafe.Pointer(&_mem0.Xmutex)) = _sqlite3MutexAlloc(tls, int32(3))
  3356  	if _sqlite3Config.XpScratch == nil || _sqlite3Config.XszScratch < int32(100) || _sqlite3Config.XnScratch <= int32(0) {
  3357  		goto _3
  3358  	}
  3359  	_2_sz = _sqlite3Config.XszScratch & int32(-8)
  3360  	_sqlite3Config.XszScratch = _2_sz
  3361  	_2_pSlot = (*XScratchFreeslot)(_sqlite3Config.XpScratch)
  3362  	_2_n = _sqlite3Config.XnScratch
  3363  	*(**XScratchFreeslot)(unsafe.Pointer(&_mem0.XpScratchFree)) = _2_pSlot
  3364  	_mem0.XnScratchFree = uint32(_2_n)
  3365  	_2_i = int32(0)
  3366  _4:
  3367  	if _2_i >= (_2_n - int32(1)) {
  3368  		goto _7
  3369  	}
  3370  	*(**XScratchFreeslot)(unsafe.Pointer(&_2_pSlot.XpNext)) = (*XScratchFreeslot)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_2_sz) + uintptr(unsafe.Pointer(_2_pSlot))))))
  3371  	_2_pSlot = (*XScratchFreeslot)(_2_pSlot.XpNext)
  3372  	_2_i += 1
  3373  	goto _4
  3374  _7:
  3375  	*(**XScratchFreeslot)(unsafe.Pointer(&_2_pSlot.XpNext)) = nil
  3376  	_mem0.XpScratchEnd = unsafe.Pointer(elem9(_2_pSlot, uintptr(1)))
  3377  	goto _8
  3378  _3:
  3379  	_mem0.XpScratchEnd = nil
  3380  	_sqlite3Config.XpScratch = nil
  3381  	_sqlite3Config.XszScratch = int32(0)
  3382  	_sqlite3Config.XnScratch = int32(0)
  3383  _8:
  3384  	if ((_sqlite3Config.XpPage == nil) || (_sqlite3Config.XszPage < int32(512))) || (_sqlite3Config.XnPage <= int32(0)) {
  3385  		_sqlite3Config.XpPage = nil
  3386  		_sqlite3Config.XszPage = int32(0)
  3387  	}
  3388  	_rc = (_sqlite3Config.Xm.XxInit)(tls, _sqlite3Config.Xm.XpAppData)
  3389  	if _rc != int32(0) {
  3390  		crt.Xmemset(tls, unsafe.Pointer(&_mem0), int32(0), uint32(28))
  3391  	}
  3392  	return _rc
  3393  }
  3394  
  3395  // C comment
  3396  //  /*
  3397  //  ** This routine is the only routine in this file with external linkage.
  3398  //  **
  3399  //  ** Populate the low-level memory allocation function pointers in
  3400  //  ** sqlite3GlobalConfig.m with pointers to the routines in this file.
  3401  //  */
  3402  func _sqlite3MemSetDefault(tls *crt.TLS) {
  3403  	Xsqlite3_config(tls, int32(4), unsafe.Pointer(&_sqlite3MemSetDefaultØ00defaultMethodsØ001))
  3404  }
  3405  
  3406  // C comment
  3407  //  /*
  3408  //  ** This API allows applications to modify the global configuration of
  3409  //  ** the SQLite library at run-time.
  3410  //  **
  3411  //  ** This routine should only be called when there are no outstanding
  3412  //  ** database connections or memory allocations.  This routine is not
  3413  //  ** threadsafe.  Failure to heed these warnings can lead to unpredictable
  3414  //  ** behavior.
  3415  //  */
  3416  func Xsqlite3_config(tls *crt.TLS, _op int32, args ...interface{}) (r0 int32) {
  3417  	var _rc int32
  3418  	var _22_szMmap, _22_mxMmap int64
  3419  	var _ap []interface{}
  3420  	_rc = int32(0)
  3421  	if _sqlite3Config.XisInit != 0 {
  3422  		return _sqlite3MisuseError(tls, int32(140829))
  3423  	}
  3424  	_ap = args
  3425  	switch _op {
  3426  	case int32(1):
  3427  		goto _2
  3428  	case int32(2):
  3429  		goto _3
  3430  	case int32(3):
  3431  		goto _4
  3432  	case int32(4):
  3433  		goto _7
  3434  	case int32(5):
  3435  		goto _8
  3436  	case int32(6):
  3437  		goto _10
  3438  	case int32(7):
  3439  		goto _11
  3440  	case int32(9):
  3441  		goto _9
  3442  	case int32(10):
  3443  		goto _5
  3444  	case int32(11):
  3445  		goto _6
  3446  	case int32(13):
  3447  		goto _17
  3448  	case int32(14):
  3449  		goto _13
  3450  	case int32(15):
  3451  		goto _14
  3452  	case int32(16):
  3453  		goto _18
  3454  	case int32(17):
  3455  		goto _19
  3456  	case int32(18):
  3457  		goto _15
  3458  	case int32(19):
  3459  		goto _16
  3460  	case int32(20):
  3461  		goto _20
  3462  	case int32(22):
  3463  		goto _21
  3464  	case int32(24):
  3465  		goto _12
  3466  	case int32(25):
  3467  		goto _22
  3468  	case int32(26):
  3469  		goto _23
  3470  	default:
  3471  		goto _24
  3472  	}
  3473  
  3474  _2:
  3475  	_sqlite3Config.XbCoreMutex = int32(0)
  3476  	_sqlite3Config.XbFullMutex = int32(0)
  3477  	goto _25
  3478  _3:
  3479  	_sqlite3Config.XbCoreMutex = int32(1)
  3480  	_sqlite3Config.XbFullMutex = int32(0)
  3481  	goto _25
  3482  _4:
  3483  	_sqlite3Config.XbCoreMutex = int32(1)
  3484  	_sqlite3Config.XbFullMutex = int32(1)
  3485  	goto _25
  3486  _5:
  3487  	_sqlite3Config.Xmutex = *(*Xsqlite3_mutex_methods)(crt.VAPointer(&_ap))
  3488  	goto _25
  3489  _6:
  3490  	*(*Xsqlite3_mutex_methods)(crt.VAPointer(&_ap)) = _sqlite3Config.Xmutex
  3491  	goto _25
  3492  _7:
  3493  	_sqlite3Config.Xm = *(*Xsqlite3_mem_methods)(crt.VAPointer(&_ap))
  3494  	goto _25
  3495  _8:
  3496  	if (_sqlite3Config.Xm.XxMalloc) == nil {
  3497  		_sqlite3MemSetDefault(tls)
  3498  	}
  3499  	*(*Xsqlite3_mem_methods)(crt.VAPointer(&_ap)) = _sqlite3Config.Xm
  3500  	goto _25
  3501  _9:
  3502  	_sqlite3Config.XbMemstat = crt.VAInt32(&_ap)
  3503  	goto _25
  3504  _10:
  3505  	_sqlite3Config.XpScratch = crt.VAPointer(&_ap)
  3506  	_sqlite3Config.XszScratch = crt.VAInt32(&_ap)
  3507  	_sqlite3Config.XnScratch = crt.VAInt32(&_ap)
  3508  	goto _25
  3509  _11:
  3510  	_sqlite3Config.XpPage = crt.VAPointer(&_ap)
  3511  	_sqlite3Config.XszPage = crt.VAInt32(&_ap)
  3512  	_sqlite3Config.XnPage = crt.VAInt32(&_ap)
  3513  	goto _25
  3514  _12:
  3515  	*(*int32)(crt.VAPointer(&_ap)) = (_sqlite3HeaderSizeBtree(tls) + _sqlite3HeaderSizePcache(tls)) + _sqlite3HeaderSizePcache1(tls)
  3516  	goto _25
  3517  _13:
  3518  	goto _25
  3519  _14:
  3520  	_rc = int32(1)
  3521  	goto _25
  3522  _15:
  3523  	_sqlite3Config.Xpcache2 = *(*Xsqlite3_pcache_methods2)(crt.VAPointer(&_ap))
  3524  	goto _25
  3525  _16:
  3526  	if (_sqlite3Config.Xpcache2.XxInit) == nil {
  3527  		_sqlite3PCacheSetDefault(tls)
  3528  	}
  3529  	*(*Xsqlite3_pcache_methods2)(crt.VAPointer(&_ap)) = _sqlite3Config.Xpcache2
  3530  	goto _25
  3531  _17:
  3532  	_sqlite3Config.XszLookaside = crt.VAInt32(&_ap)
  3533  	_sqlite3Config.XnLookaside = crt.VAInt32(&_ap)
  3534  	goto _25
  3535  _18:
  3536  	_sqlite3Config.XxLog = crt.VAOther(&_ap).(func(*crt.TLS, unsafe.Pointer, int32, *int8))
  3537  	_sqlite3Config.XpLogArg = crt.VAPointer(&_ap)
  3538  	goto _25
  3539  _19:
  3540  	_sqlite3Config.XbOpenUri = crt.VAInt32(&_ap)
  3541  	goto _25
  3542  _20:
  3543  	_sqlite3Config.XbUseCis = crt.VAInt32(&_ap)
  3544  	goto _25
  3545  _21:
  3546  	_22_szMmap = crt.VAInt64(&_ap)
  3547  	_22_mxMmap = crt.VAInt64(&_ap)
  3548  	if (_22_mxMmap < (0)) || (_22_mxMmap > int64(2147418112)) {
  3549  		_22_mxMmap = int64(2147418112)
  3550  	}
  3551  	if _22_szMmap < (0) {
  3552  		_22_szMmap = 0
  3553  	}
  3554  	if _22_szMmap > _22_mxMmap {
  3555  		_22_szMmap = _22_mxMmap
  3556  	}
  3557  	_sqlite3Config.XmxMmap = _22_mxMmap
  3558  	_sqlite3Config.XszMmap = _22_szMmap
  3559  	goto _25
  3560  _22:
  3561  	_sqlite3Config.XszPma = crt.VAUint32(&_ap)
  3562  	goto _25
  3563  _23:
  3564  	_sqlite3Config.XnStmtSpill = crt.VAInt32(&_ap)
  3565  	goto _25
  3566  _24:
  3567  	_rc = int32(1)
  3568  	goto _25
  3569  _25:
  3570  	_ap = nil
  3571  	return _rc
  3572  }
  3573  
  3574  // C comment
  3575  //  /*
  3576  //  ** Return the size of the header added to each page by this module.
  3577  //  */
  3578  func _sqlite3HeaderSizeBtree(tls *crt.TLS) (r0 int32) {
  3579  	return int32(88)
  3580  }
  3581  
  3582  // C comment
  3583  //  /*
  3584  //  ** Return the size of the header added by this middleware layer
  3585  //  ** in the page-cache hierarchy.
  3586  //  */
  3587  func _sqlite3HeaderSizePcache(tls *crt.TLS) (r0 int32) {
  3588  	return int32(40)
  3589  }
  3590  
  3591  // C comment
  3592  //  /*
  3593  //  ** Return the size of the header on each page of this PCACHE implementation.
  3594  //  */
  3595  func _sqlite3HeaderSizePcache1(tls *crt.TLS) (r0 int32) {
  3596  	return int32(32)
  3597  }
  3598  
  3599  // C comment
  3600  //  /*
  3601  //  ** This function is called during initialization (sqlite3_initialize()) to
  3602  //  ** install the default pluggable cache module, assuming the user has not
  3603  //  ** already provided an alternative.
  3604  //  */
  3605  func _sqlite3PCacheSetDefault(tls *crt.TLS) {
  3606  	Xsqlite3_config(tls, int32(18), unsafe.Pointer(&_sqlite3PCacheSetDefaultØ00defaultMethodsØ001))
  3607  }
  3608  
  3609  var _sqlite3PCacheSetDefaultØ00defaultMethodsØ001 Xsqlite3_pcache_methods2
  3610  
  3611  func init() {
  3612  	_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 {
  3613  		f func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page
  3614  	}{_pcache1Fetch})), XxUnpin: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&struct {
  3615  		f func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, int32)
  3616  	}{_pcache1Unpin})), XxRekey: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, uint32, uint32))(unsafe.Pointer(&struct {
  3617  		f func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, uint32, uint32)
  3618  	}{_pcache1Rekey})), XxTruncate: _pcache1Truncate, XxDestroy: _pcache1Destroy, XxShrink: _pcache1Shrink}
  3619  }
  3620  
  3621  // C comment
  3622  //  /*
  3623  //  ** Implementation of the sqlite3_pcache.xInit method.
  3624  //  */
  3625  func _pcache1Init(tls *crt.TLS, _NotUsed unsafe.Pointer) (r0 int32) {
  3626  	func() {
  3627  		if _pcache1_g.XisInit != int32(0) {
  3628  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45688), unsafe.Pointer(&_pcache1InitØ00__func__Ø000), unsafe.Pointer(str(2249)))
  3629  			crt.X__builtin_abort(tls)
  3630  		}
  3631  	}()
  3632  	crt.Xmemset(tls, unsafe.Pointer(&_pcache1_g), int32(0), uint32(100))
  3633  	_pcache1_g.XseparateCache = bool2int((_sqlite3Config.XpPage == nil) || (_sqlite3Config.XbCoreMutex > int32(0)))
  3634  	if _sqlite3Config.XbCoreMutex != 0 {
  3635  		*(**Xsqlite3_mutex)(unsafe.Pointer(&(_pcache1_g.Xgrp.Xmutex))) = _sqlite3MutexAlloc(tls, int32(6))
  3636  		*(**Xsqlite3_mutex)(unsafe.Pointer(&_pcache1_g.Xmutex)) = _sqlite3MutexAlloc(tls, int32(7))
  3637  	}
  3638  	if (_pcache1_g.XseparateCache != 0 && (_sqlite3Config.XnPage != int32(0))) && (_sqlite3Config.XpPage == nil) {
  3639  		_pcache1_g.XnInitPage = _sqlite3Config.XnPage
  3640  		goto _7
  3641  	}
  3642  	_pcache1_g.XnInitPage = int32(0)
  3643  _7:
  3644  	_pcache1_g.Xgrp.XmxPinned = uint32(10)
  3645  	_pcache1_g.XisInit = int32(1)
  3646  	return int32(0)
  3647  }
  3648  
  3649  var _pcache1InitØ00__func__Ø000 [12]int8
  3650  
  3651  func init() {
  3652  	crt.Xstrncpy(nil, &_pcache1InitØ00__func__Ø000[0], str(2267), 12)
  3653  }
  3654  
  3655  // C comment
  3656  //  /*
  3657  //  ** Implementation of the sqlite3_pcache.xShutdown method.
  3658  //  ** Note that the static mutex allocated in xInit does
  3659  //  ** not need to be freed.
  3660  //  */
  3661  func _pcache1Shutdown(tls *crt.TLS, _NotUsed unsafe.Pointer) {
  3662  	func() {
  3663  		if _pcache1_g.XisInit == int32(0) {
  3664  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45741), unsafe.Pointer(&_pcache1ShutdownØ00__func__Ø000), unsafe.Pointer(str(2279)))
  3665  			crt.X__builtin_abort(tls)
  3666  		}
  3667  	}()
  3668  	crt.Xmemset(tls, unsafe.Pointer(&_pcache1_g), int32(0), uint32(100))
  3669  }
  3670  
  3671  var _pcache1ShutdownØ00__func__Ø000 [16]int8
  3672  
  3673  func init() {
  3674  	crt.Xstrncpy(nil, &_pcache1ShutdownØ00__func__Ø000[0], str(2297), 16)
  3675  }
  3676  
  3677  // C comment
  3678  //  /*
  3679  //  ** Implementation of the sqlite3_pcache.xCreate method.
  3680  //  **
  3681  //  ** Allocate a new cache.
  3682  //  */
  3683  func _pcache1Create(tls *crt.TLS, _szPage int32, _szExtra int32, _bPurgeable int32) (r0 unsafe.Pointer) {
  3684  	var _sz int32
  3685  	var _pCache *XPCache1
  3686  	var _pGroup *XPGroup
  3687  	func() {
  3688  		if (_szPage&(_szPage-int32(1))) != int32(0) || _szPage < int32(512) || _szPage > int32(65536) {
  3689  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45758), unsafe.Pointer(&_pcache1CreateØ00__func__Ø000), unsafe.Pointer(str(2313)))
  3690  			crt.X__builtin_abort(tls)
  3691  		}
  3692  	}()
  3693  	func() {
  3694  		if _szExtra >= int32(300) {
  3695  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45759), unsafe.Pointer(&_pcache1CreateØ00__func__Ø000), unsafe.Pointer(str(2370)))
  3696  			crt.X__builtin_abort(tls)
  3697  		}
  3698  	}()
  3699  	_sz = int32(uint32(60) + (uint32(52) * uint32(_pcache1_g.XseparateCache)))
  3700  	_pCache = (*XPCache1)(_sqlite3MallocZero(tls, uint64(_sz)))
  3701  	if _pCache == nil {
  3702  		goto _6
  3703  	}
  3704  	if _pcache1_g.XseparateCache != 0 {
  3705  		_pGroup = (*XPGroup)(unsafe.Pointer(elem12(_pCache, uintptr(1))))
  3706  		_pGroup.XmxPinned = uint32(10)
  3707  		goto _8
  3708  	}
  3709  	_pGroup = &_pcache1_g.Xgrp
  3710  _8:
  3711  	if int32(_pGroup.Xlru.XisAnchor) == int32(0) {
  3712  		_pGroup.Xlru.XisAnchor = uint8(1)
  3713  		*(**XPgHdr1)(unsafe.Pointer(&(_pGroup.Xlru.XpLruPrev))) = store13((**XPgHdr1)(unsafe.Pointer(&(_pGroup.Xlru.XpLruNext))), &_pGroup.Xlru)
  3714  	}
  3715  	*(**XPGroup)(unsafe.Pointer(&_pCache.XpGroup)) = _pGroup
  3716  	_pCache.XszPage = _szPage
  3717  	_pCache.XszExtra = _szExtra
  3718  	_pCache.XszAlloc = int32(uint32(_szPage+_szExtra) + uint32(32))
  3719  	_pCache.XbPurgeable = func() int32 {
  3720  		if _bPurgeable != 0 {
  3721  			return int32(1)
  3722  		}
  3723  		return int32(0)
  3724  	}()
  3725  	func() {
  3726  		if (*Xsqlite3_mutex)(_pGroup.Xmutex) != nil {
  3727  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45779), unsafe.Pointer(&_pcache1CreateØ00__func__Ø000), unsafe.Pointer(str(2384)))
  3728  			crt.X__builtin_abort(tls)
  3729  		}
  3730  	}()
  3731  	_pcache1ResizeHash(tls, _pCache)
  3732  	if _bPurgeable != 0 {
  3733  		_pCache.XnMin = uint32(10)
  3734  		_pGroup.XnMinPage += _pCache.XnMin
  3735  		_pGroup.XmxPinned = (_pGroup.XnMaxPage + uint32(10)) - _pGroup.XnMinPage
  3736  	}
  3737  	func() {
  3738  		if (*Xsqlite3_mutex)(_pGroup.Xmutex) != nil {
  3739  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45786), unsafe.Pointer(&_pcache1CreateØ00__func__Ø000), unsafe.Pointer(str(2384)))
  3740  			crt.X__builtin_abort(tls)
  3741  		}
  3742  	}()
  3743  	if _pCache.XnHash == (0) {
  3744  		_pcache1Destroy(tls, unsafe.Pointer(_pCache))
  3745  		_pCache = nil
  3746  	}
  3747  _6:
  3748  	return unsafe.Pointer(_pCache)
  3749  }
  3750  
  3751  var _pcache1CreateØ00__func__Ø000 [14]int8
  3752  
  3753  func init() {
  3754  	crt.Xstrncpy(nil, &_pcache1CreateØ00__func__Ø000[0], str(2403), 14)
  3755  }
  3756  
  3757  // C comment
  3758  //  /*
  3759  //  ** This function is used to resize the hash table used by the cache passed
  3760  //  ** as the first argument.
  3761  //  **
  3762  //  ** The PCache mutex must be held when this function is called.
  3763  //  */
  3764  func _pcache1ResizeHash(tls *crt.TLS, _p *XPCache1) {
  3765  	var _nNew, _i, _6_h uint32
  3766  	var _5_pPage, _5_pNext *XPgHdr1
  3767  	var _apNew **XPgHdr1
  3768  	func() {
  3769  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XPGroup)(_p.XpGroup).Xmutex)) == 0 {
  3770  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45528), unsafe.Pointer(&_pcache1ResizeHashØ00__func__Ø000), unsafe.Pointer(str(2417)))
  3771  			crt.X__builtin_abort(tls)
  3772  		}
  3773  	}()
  3774  	_nNew = _p.XnHash * uint32(2)
  3775  	if _nNew < uint32(256) {
  3776  		_nNew = uint32(256)
  3777  	}
  3778  	func() {
  3779  		if (*Xsqlite3_mutex)((*XPGroup)(_p.XpGroup).Xmutex) != nil {
  3780  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45535), unsafe.Pointer(&_pcache1ResizeHashØ00__func__Ø000), unsafe.Pointer(str(2454)))
  3781  			crt.X__builtin_abort(tls)
  3782  		}
  3783  	}()
  3784  	if _p.XnHash != 0 {
  3785  		_sqlite3BeginBenignMalloc(tls)
  3786  	}
  3787  	_apNew = (**XPgHdr1)(_sqlite3MallocZero(tls, uint64(uint32(4)*_nNew)))
  3788  	if _p.XnHash != 0 {
  3789  		_sqlite3EndBenignMalloc(tls)
  3790  	}
  3791  	func() {
  3792  		if (*Xsqlite3_mutex)((*XPGroup)(_p.XpGroup).Xmutex) != nil {
  3793  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45539), unsafe.Pointer(&_pcache1ResizeHashØ00__func__Ø000), unsafe.Pointer(str(2454)))
  3794  			crt.X__builtin_abort(tls)
  3795  		}
  3796  	}()
  3797  	if _apNew == nil {
  3798  		goto _9
  3799  	}
  3800  	_i = 0
  3801  _10:
  3802  	if _i >= _p.XnHash {
  3803  		goto _13
  3804  	}
  3805  	_5_pNext = *elem14((**XPgHdr1)(unsafe.Pointer(_p.XapHash)), uintptr(_i))
  3806  _14:
  3807  	if store13(&_5_pPage, _5_pNext) != nil {
  3808  		_6_h = _5_pPage.XiKey % _nNew
  3809  		_5_pNext = (*XPgHdr1)(_5_pPage.XpNext)
  3810  		*(**XPgHdr1)(unsafe.Pointer(&_5_pPage.XpNext)) = *elem14(_apNew, uintptr(_6_h))
  3811  		*elem14(_apNew, uintptr(_6_h)) = _5_pPage
  3812  		goto _14
  3813  	}
  3814  	_i += 1
  3815  	goto _10
  3816  _13:
  3817  	Xsqlite3_free(tls, unsafe.Pointer(_p.XapHash))
  3818  	*(***XPgHdr1)(unsafe.Pointer(&_p.XapHash)) = _apNew
  3819  	_p.XnHash = _nNew
  3820  _9:
  3821  }
  3822  
  3823  var _pcache1ResizeHashØ00__func__Ø000 [18]int8
  3824  
  3825  func init() {
  3826  	crt.Xstrncpy(nil, &_pcache1ResizeHashØ00__func__Ø000[0], str(2476), 18)
  3827  }
  3828  
  3829  // C comment
  3830  //  /*
  3831  //  ** This (sqlite3EndBenignMalloc()) is called by SQLite code to indicate that
  3832  //  ** subsequent malloc failures are benign. A call to sqlite3EndBenignMalloc()
  3833  //  ** indicates that subsequent malloc failures are non-benign.
  3834  //  */
  3835  func _sqlite3BeginBenignMalloc(tls *crt.TLS) {
  3836  	if _sqlite3Hooks.XxBenignBegin != nil {
  3837  		_sqlite3Hooks.XxBenignBegin(tls)
  3838  	}
  3839  }
  3840  
  3841  var _sqlite3Hooks TBenignMallocHooks
  3842  
  3843  func _sqlite3EndBenignMalloc(tls *crt.TLS) {
  3844  	if _sqlite3Hooks.XxBenignEnd != nil {
  3845  		_sqlite3Hooks.XxBenignEnd(tls)
  3846  	}
  3847  }
  3848  
  3849  // C comment
  3850  //  /*
  3851  //  ** Implementation of the sqlite3_pcache.xDestroy method.
  3852  //  **
  3853  //  ** Destroy a cache allocated using pcache1Create().
  3854  //  */
  3855  func _pcache1Destroy(tls *crt.TLS, _p unsafe.Pointer) {
  3856  	var _pCache *XPCache1
  3857  	var _pGroup *XPGroup
  3858  	_pCache = (*XPCache1)(_p)
  3859  	_pGroup = (*XPGroup)(_pCache.XpGroup)
  3860  	func() {
  3861  		if _pCache.XbPurgeable == 0 && (_pCache.XnMax != (0) || _pCache.XnMin != (0)) {
  3862  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46152), unsafe.Pointer(&_pcache1DestroyØ00__func__Ø000), unsafe.Pointer(str(2494)))
  3863  			crt.X__builtin_abort(tls)
  3864  		}
  3865  	}()
  3866  	func() {
  3867  		if (*Xsqlite3_mutex)(_pGroup.Xmutex) != nil {
  3868  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46153), unsafe.Pointer(&_pcache1DestroyØ00__func__Ø000), unsafe.Pointer(str(2384)))
  3869  			crt.X__builtin_abort(tls)
  3870  		}
  3871  	}()
  3872  	if _pCache.XnPage != 0 {
  3873  		_pcache1TruncateUnsafe(tls, _pCache, 0)
  3874  	}
  3875  	func() {
  3876  		if _pGroup.XnMaxPage < _pCache.XnMax {
  3877  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46155), unsafe.Pointer(&_pcache1DestroyØ00__func__Ø000), unsafe.Pointer(str(2553)))
  3878  			crt.X__builtin_abort(tls)
  3879  		}
  3880  	}()
  3881  	_pGroup.XnMaxPage -= _pCache.XnMax
  3882  	func() {
  3883  		if _pGroup.XnMinPage < _pCache.XnMin {
  3884  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46157), unsafe.Pointer(&_pcache1DestroyØ00__func__Ø000), unsafe.Pointer(str(2586)))
  3885  			crt.X__builtin_abort(tls)
  3886  		}
  3887  	}()
  3888  	_pGroup.XnMinPage -= _pCache.XnMin
  3889  	_pGroup.XmxPinned = (_pGroup.XnMaxPage + uint32(10)) - _pGroup.XnMinPage
  3890  	_pcache1EnforceMaxPage(tls, _pCache)
  3891  	func() {
  3892  		if (*Xsqlite3_mutex)(_pGroup.Xmutex) != nil {
  3893  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46161), unsafe.Pointer(&_pcache1DestroyØ00__func__Ø000), unsafe.Pointer(str(2384)))
  3894  			crt.X__builtin_abort(tls)
  3895  		}
  3896  	}()
  3897  	Xsqlite3_free(tls, _pCache.XpBulk)
  3898  	Xsqlite3_free(tls, unsafe.Pointer(_pCache.XapHash))
  3899  	Xsqlite3_free(tls, unsafe.Pointer(_pCache))
  3900  }
  3901  
  3902  var _pcache1DestroyØ00__func__Ø000 [15]int8
  3903  
  3904  func init() {
  3905  	crt.Xstrncpy(nil, &_pcache1DestroyØ00__func__Ø000[0], str(2619), 15)
  3906  }
  3907  
  3908  // C comment
  3909  //  /*
  3910  //  ** Discard all pages from cache pCache with a page number (key value)
  3911  //  ** greater than or equal to iLimit. Any pinned pages that meet this
  3912  //  ** criteria are unpinned before they are discarded.
  3913  //  **
  3914  //  ** The PCache mutex must be held when this function is called.
  3915  //  */
  3916  func _pcache1TruncateUnsafe(tls *crt.TLS, _pCache *XPCache1, _iLimit uint32) {
  3917  	var _nPage int32
  3918  	var _h, _iStop uint32
  3919  	var _3_pPage *XPgHdr1
  3920  	var _3_pp **XPgHdr1
  3921  	_nPage = int32(0)
  3922  	func() {
  3923  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XPGroup)(_pCache.XpGroup).Xmutex)) == 0 {
  3924  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45641), unsafe.Pointer(&_pcache1TruncateUnsafeØ00__func__Ø000), unsafe.Pointer(str(2634)))
  3925  			crt.X__builtin_abort(tls)
  3926  		}
  3927  	}()
  3928  	func() {
  3929  		if _pCache.XiMaxKey < _iLimit {
  3930  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45642), unsafe.Pointer(&_pcache1TruncateUnsafeØ00__func__Ø000), unsafe.Pointer(str(2676)))
  3931  			crt.X__builtin_abort(tls)
  3932  		}
  3933  	}()
  3934  	func() {
  3935  		if _pCache.XnHash <= (0) {
  3936  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45643), unsafe.Pointer(&_pcache1TruncateUnsafeØ00__func__Ø000), unsafe.Pointer(str(2702)))
  3937  			crt.X__builtin_abort(tls)
  3938  		}
  3939  	}()
  3940  	if (_pCache.XiMaxKey - _iLimit) < _pCache.XnHash {
  3941  		_h = _iLimit % _pCache.XnHash
  3942  		_iStop = _pCache.XiMaxKey % _pCache.XnHash
  3943  		_nPage = int32(-10)
  3944  		goto _7
  3945  	}
  3946  	_h = _pCache.XnHash / uint32(2)
  3947  	_iStop = _h - uint32(1)
  3948  _7:
  3949  	func() {
  3950  		if _h >= _pCache.XnHash {
  3951  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45661), unsafe.Pointer(&_pcache1TruncateUnsafeØ00__func__Ø000), unsafe.Pointer(str(2720)))
  3952  			crt.X__builtin_abort(tls)
  3953  		}
  3954  	}()
  3955  	_3_pp = elem14((**XPgHdr1)(unsafe.Pointer(_pCache.XapHash)), uintptr(_h))
  3956  _13:
  3957  	if store13(&_3_pPage, *_3_pp) == nil {
  3958  		goto _14
  3959  	}
  3960  	if _3_pPage.XiKey < _iLimit {
  3961  		goto _15
  3962  	}
  3963  	_pCache.XnPage -= 1
  3964  	*_3_pp = (*XPgHdr1)(_3_pPage.XpNext)
  3965  	if _3_pPage.XisPinned == 0 {
  3966  		_pcache1PinPage(tls, _3_pPage)
  3967  	}
  3968  	_pcache1FreePage(tls, _3_pPage)
  3969  	goto _17
  3970  _15:
  3971  	_3_pp = (**XPgHdr1)(unsafe.Pointer(&_3_pPage.XpNext))
  3972  	if _nPage >= int32(0) {
  3973  		_nPage += 1
  3974  	}
  3975  _17:
  3976  	goto _13
  3977  _14:
  3978  	if _h == _iStop {
  3979  		goto _10
  3980  	}
  3981  	_h = (_h + uint32(1)) % _pCache.XnHash
  3982  	goto _7
  3983  _10:
  3984  	func() {
  3985  		if _nPage >= int32(0) && _pCache.XnPage != uint32(_nPage) {
  3986  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45677), unsafe.Pointer(&_pcache1TruncateUnsafeØ00__func__Ø000), unsafe.Pointer(str(2736)))
  3987  			crt.X__builtin_abort(tls)
  3988  		}
  3989  	}()
  3990  }
  3991  
  3992  var _pcache1TruncateUnsafeØ00__func__Ø000 [22]int8
  3993  
  3994  func init() {
  3995  	crt.Xstrncpy(nil, &_pcache1TruncateUnsafeØ00__func__Ø000[0], str(2778), 22)
  3996  }
  3997  
  3998  // C comment
  3999  //  /*
  4000  //  ** This function is used internally to remove the page pPage from the
  4001  //  ** PGroup LRU list, if is part of it. If pPage is not part of the PGroup
  4002  //  ** LRU list, then this function is a no-op.
  4003  //  **
  4004  //  ** The PGroup mutex must be held when this function is called.
  4005  //  */
  4006  func _pcache1PinPage(tls *crt.TLS, _pPage *XPgHdr1) (r0 *XPgHdr1) {
  4007  	var _pCache *XPCache1
  4008  	func() {
  4009  		if _pPage == nil {
  4010  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45567), unsafe.Pointer(&_pcache1PinPageØ00__func__Ø000), unsafe.Pointer(str(2800)))
  4011  			crt.X__builtin_abort(tls)
  4012  		}
  4013  	}()
  4014  	func() {
  4015  		if int32(_pPage.XisPinned) != int32(0) {
  4016  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45568), unsafe.Pointer(&_pcache1PinPageØ00__func__Ø000), unsafe.Pointer(str(2809)))
  4017  			crt.X__builtin_abort(tls)
  4018  		}
  4019  	}()
  4020  	_pCache = (*XPCache1)(_pPage.XpCache)
  4021  	func() {
  4022  		if _pPage.XpLruNext == nil {
  4023  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45570), unsafe.Pointer(&_pcache1PinPageØ00__func__Ø000), unsafe.Pointer(str(2828)))
  4024  			crt.X__builtin_abort(tls)
  4025  		}
  4026  	}()
  4027  	func() {
  4028  		if _pPage.XpLruPrev == nil {
  4029  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45571), unsafe.Pointer(&_pcache1PinPageØ00__func__Ø000), unsafe.Pointer(str(2844)))
  4030  			crt.X__builtin_abort(tls)
  4031  		}
  4032  	}()
  4033  	func() {
  4034  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XPGroup)(_pCache.XpGroup).Xmutex)) == 0 {
  4035  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45572), unsafe.Pointer(&_pcache1PinPageØ00__func__Ø000), unsafe.Pointer(str(2634)))
  4036  			crt.X__builtin_abort(tls)
  4037  		}
  4038  	}()
  4039  	*(**XPgHdr1)(unsafe.Pointer(&((*XPgHdr1)(_pPage.XpLruPrev).XpLruNext))) = (*XPgHdr1)(_pPage.XpLruNext)
  4040  	*(**XPgHdr1)(unsafe.Pointer(&((*XPgHdr1)(_pPage.XpLruNext).XpLruPrev))) = (*XPgHdr1)(_pPage.XpLruPrev)
  4041  	*(**XPgHdr1)(unsafe.Pointer(&_pPage.XpLruNext)) = nil
  4042  	*(**XPgHdr1)(unsafe.Pointer(&_pPage.XpLruPrev)) = nil
  4043  	_pPage.XisPinned = uint8(1)
  4044  	func() {
  4045  		if int32(_pPage.XisAnchor) != int32(0) {
  4046  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45578), unsafe.Pointer(&_pcache1PinPageØ00__func__Ø000), unsafe.Pointer(str(2860)))
  4047  			crt.X__builtin_abort(tls)
  4048  		}
  4049  	}()
  4050  	func() {
  4051  		if int32(((*XPGroup)(_pCache.XpGroup).Xlru).XisAnchor) != int32(1) {
  4052  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45579), unsafe.Pointer(&_pcache1PinPageØ00__func__Ø000), unsafe.Pointer(str(2879)))
  4053  			crt.X__builtin_abort(tls)
  4054  		}
  4055  	}()
  4056  	_pCache.XnRecyclable -= 1
  4057  	return _pPage
  4058  }
  4059  
  4060  var _pcache1PinPageØ00__func__Ø000 [15]int8
  4061  
  4062  func init() {
  4063  	crt.Xstrncpy(nil, &_pcache1PinPageØ00__func__Ø000[0], str(2911), 15)
  4064  }
  4065  
  4066  // C comment
  4067  //  /*
  4068  //  ** Free a page object allocated by pcache1AllocPage().
  4069  //  */
  4070  func _pcache1FreePage(tls *crt.TLS, _p *XPgHdr1) {
  4071  	var _pCache *XPCache1
  4072  	func() {
  4073  		if _p == nil {
  4074  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45456), unsafe.Pointer(&_pcache1FreePageØ00__func__Ø000), unsafe.Pointer(str(807)))
  4075  			crt.X__builtin_abort(tls)
  4076  		}
  4077  	}()
  4078  	_pCache = (*XPCache1)(_p.XpCache)
  4079  	func() {
  4080  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XPGroup)((*XPCache1)(_p.XpCache).XpGroup).Xmutex)) == 0 {
  4081  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45458), unsafe.Pointer(&_pcache1FreePageØ00__func__Ø000), unsafe.Pointer(str(2926)))
  4082  			crt.X__builtin_abort(tls)
  4083  		}
  4084  	}()
  4085  	if _p.XisBulkLocal != 0 {
  4086  		*(**XPgHdr1)(unsafe.Pointer(&_p.XpNext)) = (*XPgHdr1)(_pCache.XpFree)
  4087  		*(**XPgHdr1)(unsafe.Pointer(&_pCache.XpFree)) = _p
  4088  		goto _5
  4089  	}
  4090  	_pcache1Free(tls, _p.Xpage.XpBuf)
  4091  _5:
  4092  	if _pCache.XbPurgeable != 0 {
  4093  		(*XPGroup)(_pCache.XpGroup).XnCurrentPage -= 1
  4094  	}
  4095  }
  4096  
  4097  var _pcache1FreePageØ00__func__Ø000 [16]int8
  4098  
  4099  func init() {
  4100  	crt.Xstrncpy(nil, &_pcache1FreePageØ00__func__Ø000[0], str(2971), 16)
  4101  }
  4102  
  4103  // C comment
  4104  //  /*
  4105  //  ** Free an allocated buffer obtained from pcache1Alloc().
  4106  //  */
  4107  func _pcache1Free(tls *crt.TLS, _p unsafe.Pointer) {
  4108  	var _3_nFreed int32
  4109  	var _1_pSlot *XScratchFreeslot
  4110  	if _p == nil {
  4111  		return
  4112  	}
  4113  	if (uint32(crt.P2U(_p)) >= uint32(crt.P2U(_pcache1_g.XpStart))) && (uint32(crt.P2U(_p)) < uint32(crt.P2U(_pcache1_g.XpEnd))) {
  4114  		Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pcache1_g.Xmutex))
  4115  		_sqlite3StatusDown(tls, int32(1), int32(1))
  4116  		_1_pSlot = (*XScratchFreeslot)(_p)
  4117  		*(**XScratchFreeslot)(unsafe.Pointer(&_1_pSlot.XpNext)) = (*XScratchFreeslot)(_pcache1_g.XpFree)
  4118  		*(**XScratchFreeslot)(unsafe.Pointer(&_pcache1_g.XpFree)) = _1_pSlot
  4119  		_pcache1_g.XnFreeSlot += 1
  4120  		_pcache1_g.XbUnderPressure = bool2int(_pcache1_g.XnFreeSlot < _pcache1_g.XnReserve)
  4121  		func() {
  4122  			if _pcache1_g.XnFreeSlot > _pcache1_g.XnSlot {
  4123  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45365), unsafe.Pointer(&_pcache1FreeØ00__func__Ø000), unsafe.Pointer(str(2987)))
  4124  				crt.X__builtin_abort(tls)
  4125  			}
  4126  		}()
  4127  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pcache1_g.Xmutex))
  4128  		goto _5
  4129  	}
  4130  
  4131  	_3_nFreed = int32(0)
  4132  	_3_nFreed = _sqlite3MallocSize(tls, _p)
  4133  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pcache1_g.Xmutex))
  4134  	_sqlite3StatusDown(tls, int32(2), _3_nFreed)
  4135  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pcache1_g.Xmutex))
  4136  	Xsqlite3_free(tls, _p)
  4137  _5:
  4138  }
  4139  
  4140  var _pcache1FreeØ00__func__Ø000 [12]int8
  4141  
  4142  func init() {
  4143  	crt.Xstrncpy(nil, &_pcache1FreeØ00__func__Ø000[0], str(3020), 12)
  4144  }
  4145  
  4146  // C comment
  4147  //  /*
  4148  //  ** If there are currently more than nMaxPage pages allocated, try
  4149  //  ** to recycle pages to reduce the number allocated to nMaxPage.
  4150  //  */
  4151  func _pcache1EnforceMaxPage(tls *crt.TLS, _pCache *XPCache1) {
  4152  	var _p *XPgHdr1
  4153  	var _pGroup *XPGroup
  4154  	_pGroup = (*XPGroup)(_pCache.XpGroup)
  4155  	func() {
  4156  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pGroup.Xmutex)) == 0 {
  4157  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45613), unsafe.Pointer(&_pcache1EnforceMaxPageØ00__func__Ø000), unsafe.Pointer(str(3032)))
  4158  			crt.X__builtin_abort(tls)
  4159  		}
  4160  	}()
  4161  _2:
  4162  	if (_pGroup.XnCurrentPage > _pGroup.XnMaxPage) && (int32(store13(&_p, (*XPgHdr1)(_pGroup.Xlru.XpLruPrev)).XisAnchor) == int32(0)) {
  4163  		func() {
  4164  			if (*XPGroup)((*XPCache1)(_p.XpCache).XpGroup) != _pGroup {
  4165  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45617), unsafe.Pointer(&_pcache1EnforceMaxPageØ00__func__Ø000), unsafe.Pointer(str(3066)))
  4166  				crt.X__builtin_abort(tls)
  4167  			}
  4168  		}()
  4169  		func() {
  4170  			if int32(_p.XisPinned) != int32(0) {
  4171  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45618), unsafe.Pointer(&_pcache1EnforceMaxPageØ00__func__Ø000), unsafe.Pointer(str(3092)))
  4172  				crt.X__builtin_abort(tls)
  4173  			}
  4174  		}()
  4175  		_pcache1PinPage(tls, _p)
  4176  		_pcache1RemoveFromHash(tls, _p, int32(1))
  4177  		goto _2
  4178  	}
  4179  	if (_pCache.XnPage == (0)) && (_pCache.XpBulk != nil) {
  4180  		Xsqlite3_free(tls, _pCache.XpBulk)
  4181  		_pCache.XpBulk = unsafe.Pointer(store13((**XPgHdr1)(unsafe.Pointer(&_pCache.XpFree)), nil))
  4182  	}
  4183  }
  4184  
  4185  var _pcache1EnforceMaxPageØ00__func__Ø000 [22]int8
  4186  
  4187  func init() {
  4188  	crt.Xstrncpy(nil, &_pcache1EnforceMaxPageØ00__func__Ø000[0], str(3107), 22)
  4189  }
  4190  
  4191  // C comment
  4192  //  /*
  4193  //  ** Remove the page supplied as an argument from the hash table
  4194  //  ** (PCache1.apHash structure) that it is currently stored in.
  4195  //  ** Also free the page if freePage is true.
  4196  //  **
  4197  //  ** The PGroup mutex must be held when this function is called.
  4198  //  */
  4199  func _pcache1RemoveFromHash(tls *crt.TLS, _pPage *XPgHdr1, _freeFlag int32) {
  4200  	var _h uint32
  4201  	var _pCache *XPCache1
  4202  	var _pp **XPgHdr1
  4203  	_pCache = (*XPCache1)(_pPage.XpCache)
  4204  	func() {
  4205  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XPGroup)(_pCache.XpGroup).Xmutex)) == 0 {
  4206  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45597), unsafe.Pointer(&_pcache1RemoveFromHashØ00__func__Ø000), unsafe.Pointer(str(2634)))
  4207  			crt.X__builtin_abort(tls)
  4208  		}
  4209  	}()
  4210  	_h = _pPage.XiKey % _pCache.XnHash
  4211  	_pp = elem14((**XPgHdr1)(unsafe.Pointer(_pCache.XapHash)), uintptr(_h))
  4212  _2:
  4213  	if (*_pp) == _pPage {
  4214  		goto _5
  4215  	}
  4216  	_pp = (**XPgHdr1)(unsafe.Pointer(&((*_pp).XpNext)))
  4217  	goto _2
  4218  _5:
  4219  	*_pp = (*XPgHdr1)((*_pp).XpNext)
  4220  	_pCache.XnPage -= 1
  4221  	if _freeFlag != 0 {
  4222  		_pcache1FreePage(tls, _pPage)
  4223  	}
  4224  }
  4225  
  4226  var _pcache1RemoveFromHashØ00__func__Ø000 [22]int8
  4227  
  4228  func init() {
  4229  	crt.Xstrncpy(nil, &_pcache1RemoveFromHashØ00__func__Ø000[0], str(3129), 22)
  4230  }
  4231  
  4232  // C comment
  4233  //  /*
  4234  //  ** Implementation of the sqlite3_pcache.xCachesize method.
  4235  //  **
  4236  //  ** Configure the cache_size limit for a cache.
  4237  //  */
  4238  func _pcache1Cachesize(tls *crt.TLS, _p unsafe.Pointer, _nMax int32) {
  4239  	var _pCache *XPCache1
  4240  	var _1_pGroup *XPGroup
  4241  	_pCache = (*XPCache1)(_p)
  4242  	if _pCache.XbPurgeable != 0 {
  4243  		_1_pGroup = (*XPGroup)(_pCache.XpGroup)
  4244  		func() {
  4245  			if (*Xsqlite3_mutex)(_1_pGroup.Xmutex) != nil {
  4246  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45804), unsafe.Pointer(&_pcache1CachesizeØ00__func__Ø000), unsafe.Pointer(str(2384)))
  4247  				crt.X__builtin_abort(tls)
  4248  			}
  4249  		}()
  4250  		_1_pGroup.XnMaxPage += uint32(_nMax) - _pCache.XnMax
  4251  		_1_pGroup.XmxPinned = (_1_pGroup.XnMaxPage + uint32(10)) - _1_pGroup.XnMinPage
  4252  		_pCache.XnMax = uint32(_nMax)
  4253  		_pCache.Xn90pct = (_pCache.XnMax * uint32(9)) / uint32(10)
  4254  		_pcache1EnforceMaxPage(tls, _pCache)
  4255  		func() {
  4256  			if (*Xsqlite3_mutex)(_1_pGroup.Xmutex) != nil {
  4257  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45810), unsafe.Pointer(&_pcache1CachesizeØ00__func__Ø000), unsafe.Pointer(str(2384)))
  4258  				crt.X__builtin_abort(tls)
  4259  			}
  4260  		}()
  4261  	}
  4262  }
  4263  
  4264  var _pcache1CachesizeØ00__func__Ø000 [17]int8
  4265  
  4266  func init() {
  4267  	crt.Xstrncpy(nil, &_pcache1CachesizeØ00__func__Ø000[0], str(3151), 17)
  4268  }
  4269  
  4270  // C comment
  4271  //  /*
  4272  //  ** Implementation of the sqlite3_pcache.xPagecount method.
  4273  //  */
  4274  func _pcache1Pagecount(tls *crt.TLS, _p unsafe.Pointer) (r0 int32) {
  4275  	var _n int32
  4276  	var _pCache *XPCache1
  4277  	_pCache = (*XPCache1)(_p)
  4278  	func() {
  4279  		if (*Xsqlite3_mutex)((*XPGroup)(_pCache.XpGroup).Xmutex) != nil {
  4280  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45839), unsafe.Pointer(&_pcache1PagecountØ00__func__Ø000), unsafe.Pointer(str(3168)))
  4281  			crt.X__builtin_abort(tls)
  4282  		}
  4283  	}()
  4284  	_n = int32(_pCache.XnPage)
  4285  	func() {
  4286  		if (*Xsqlite3_mutex)((*XPGroup)(_pCache.XpGroup).Xmutex) != nil {
  4287  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45841), unsafe.Pointer(&_pcache1PagecountØ00__func__Ø000), unsafe.Pointer(str(3168)))
  4288  			crt.X__builtin_abort(tls)
  4289  		}
  4290  	}()
  4291  	return _n
  4292  }
  4293  
  4294  var _pcache1PagecountØ00__func__Ø000 [17]int8
  4295  
  4296  func init() {
  4297  	crt.Xstrncpy(nil, &_pcache1PagecountØ00__func__Ø000[0], str(3195), 17)
  4298  }
  4299  
  4300  func _pcache1Fetch(tls *crt.TLS, _p unsafe.Pointer, _iKey uint32, _createFlag int32) (r0 *Xsqlite3_pcache_page) {
  4301  	var _pCache *XPCache1
  4302  	_pCache = (*XPCache1)(_p)
  4303  
  4304  	func() {
  4305  		if _pCache.XbPurgeable == 0 && _createFlag == int32(1) {
  4306  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46037), unsafe.Pointer(&_pcache1FetchØ00__func__Ø000), unsafe.Pointer(str(3212)))
  4307  			crt.X__builtin_abort(tls)
  4308  		}
  4309  	}()
  4310  	func() {
  4311  		if _pCache.XbPurgeable == 0 && _pCache.XnMin != (0) {
  4312  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46038), unsafe.Pointer(&_pcache1FetchØ00__func__Ø000), unsafe.Pointer(str(3248)))
  4313  			crt.X__builtin_abort(tls)
  4314  		}
  4315  	}()
  4316  	func() {
  4317  		if _pCache.XbPurgeable != int32(0) && _pCache.XnMin != uint32(10) {
  4318  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46039), unsafe.Pointer(&_pcache1FetchØ00__func__Ø000), unsafe.Pointer(str(3286)))
  4319  			crt.X__builtin_abort(tls)
  4320  		}
  4321  	}()
  4322  	func() {
  4323  		if _pCache.XnMin != (0) && _pCache.XbPurgeable == 0 {
  4324  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46040), unsafe.Pointer(&_pcache1FetchØ00__func__Ø000), unsafe.Pointer(str(3328)))
  4325  			crt.X__builtin_abort(tls)
  4326  		}
  4327  	}()
  4328  	func() {
  4329  		if _pCache.XnHash <= (0) {
  4330  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46041), unsafe.Pointer(&_pcache1FetchØ00__func__Ø000), unsafe.Pointer(str(3366)))
  4331  			crt.X__builtin_abort(tls)
  4332  		}
  4333  	}()
  4334  	return (*Xsqlite3_pcache_page)(unsafe.Pointer(_pcache1FetchNoMutex(tls, _p, _iKey, _createFlag)))
  4335  }
  4336  
  4337  var _pcache1FetchØ00__func__Ø000 [13]int8
  4338  
  4339  func init() {
  4340  	crt.Xstrncpy(nil, &_pcache1FetchØ00__func__Ø000[0], str(3382), 13)
  4341  }
  4342  
  4343  // C comment
  4344  //  /*
  4345  //  ** Implementation of the sqlite3_pcache.xFetch method.
  4346  //  **
  4347  //  ** Fetch a page by key value.
  4348  //  **
  4349  //  ** Whether or not a new page may be allocated by this function depends on
  4350  //  ** the value of the createFlag argument.  0 means do not allocate a new
  4351  //  ** page.  1 means allocate a new page if space is easily available.  2
  4352  //  ** means to try really hard to allocate a new page.
  4353  //  **
  4354  //  ** For a non-purgeable cache (a cache used as the storage for an in-memory
  4355  //  ** database) there is really no difference between createFlag 1 and 2.  So
  4356  //  ** the calling function (pcache.c) will never have a createFlag of 1 on
  4357  //  ** a non-purgeable cache.
  4358  //  **
  4359  //  ** There are three different approaches to obtaining space for a page,
  4360  //  ** depending on the value of parameter createFlag (which may be 0, 1 or 2).
  4361  //  **
  4362  //  **   1. Regardless of the value of createFlag, the cache is searched for a
  4363  //  **      copy of the requested page. If one is found, it is returned.
  4364  //  **
  4365  //  **   2. If createFlag==0 and the page is not already in the cache, NULL is
  4366  //  **      returned.
  4367  //  **
  4368  //  **   3. If createFlag is 1, and the page is not already in the cache, then
  4369  //  **      return NULL (do not allocate a new page) if any of the following
  4370  //  **      conditions are true:
  4371  //  **
  4372  //  **       (a) the number of pages pinned by the cache is greater than
  4373  //  **           PCache1.nMax, or
  4374  //  **
  4375  //  **       (b) the number of pages pinned by the cache is greater than
  4376  //  **           the sum of nMax for all purgeable caches, less the sum of
  4377  //  **           nMin for all other purgeable caches, or
  4378  //  **
  4379  //  **   4. If none of the first three conditions apply and the cache is marked
  4380  //  **      as purgeable, and if one of the following is true:
  4381  //  **
  4382  //  **       (a) The number of pages allocated for the cache is already
  4383  //  **           PCache1.nMax, or
  4384  //  **
  4385  //  **       (b) The number of pages allocated for all purgeable caches is
  4386  //  **           already equal to or greater than the sum of nMax for all
  4387  //  **           purgeable caches,
  4388  //  **
  4389  //  **       (c) The system is under memory pressure and wants to avoid
  4390  //  **           unnecessary pages cache entry allocations
  4391  //  **
  4392  //  **      then attempt to recycle a page from the LRU list. If it is the right
  4393  //  **      size, return the recycled buffer. Otherwise, free the buffer and
  4394  //  **      proceed to step 5.
  4395  //  **
  4396  //  **   5. Otherwise, allocate and return a new page buffer.
  4397  //  **
  4398  //  ** There are two versions of this routine.  pcache1FetchWithMutex() is
  4399  //  ** the general case.  pcache1FetchNoMutex() is a faster implementation for
  4400  //  ** the common case where pGroup->mutex is NULL.  The pcache1Fetch() wrapper
  4401  //  ** invokes the appropriate routine.
  4402  //  */
  4403  func _pcache1FetchNoMutex(tls *crt.TLS, _p unsafe.Pointer, _iKey uint32, _createFlag int32) (r0 *XPgHdr1) {
  4404  	var _pCache *XPCache1
  4405  	var _pPage *XPgHdr1
  4406  	_pCache = (*XPCache1)(_p)
  4407  	_pPage = nil
  4408  	_pPage = *elem14((**XPgHdr1)(unsafe.Pointer(_pCache.XapHash)), uintptr(_iKey%_pCache.XnHash))
  4409  _0:
  4410  	if (_pPage != nil) && (_pPage.XiKey != _iKey) {
  4411  		_pPage = (*XPgHdr1)(_pPage.XpNext)
  4412  		goto _0
  4413  	}
  4414  	if _pPage == nil {
  4415  		goto _3
  4416  	}
  4417  	if _pPage.XisPinned == 0 {
  4418  		return _pcache1PinPage(tls, _pPage)
  4419  	}
  4420  	return _pPage
  4421  
  4422  _3:
  4423  	if _createFlag != 0 {
  4424  		return _pcache1FetchStage2(tls, _pCache, _iKey, _createFlag)
  4425  	}
  4426  	return nil
  4427  }
  4428  
  4429  // C comment
  4430  //  /*
  4431  //  ** Implement steps 3, 4, and 5 of the pcache1Fetch() algorithm described
  4432  //  ** in the header of the pcache1Fetch() procedure.
  4433  //  **
  4434  //  ** This steps are broken out into a separate procedure because they are
  4435  //  ** usually not needed, and by avoiding the stack initialization required
  4436  //  ** for these steps, the main pcache1Fetch() procedure can run faster.
  4437  //  */
  4438  func _pcache1FetchStage2(tls *crt.TLS, _pCache *XPCache1, _iKey uint32, _createFlag int32) (r0 *XPgHdr1) {
  4439  	var _nPinned, _6_h uint32
  4440  	var _2_pOther *XPCache1
  4441  	var _pPage *XPgHdr1
  4442  	var _pGroup *XPGroup
  4443  	_pGroup = (*XPGroup)(_pCache.XpGroup)
  4444  	_pPage = nil
  4445  	func() {
  4446  		if _pCache.XnPage < _pCache.XnRecyclable {
  4447  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45864), unsafe.Pointer(&_pcache1FetchStage2Ø00__func__Ø000), unsafe.Pointer(str(3395)))
  4448  			crt.X__builtin_abort(tls)
  4449  		}
  4450  	}()
  4451  	_nPinned = _pCache.XnPage - _pCache.XnRecyclable
  4452  	func() {
  4453  		if _pGroup.XmxPinned != ((_pGroup.XnMaxPage + uint32(10)) - _pGroup.XnMinPage) {
  4454  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45866), unsafe.Pointer(&_pcache1FetchStage2Ø00__func__Ø000), unsafe.Pointer(str(3432)))
  4455  			crt.X__builtin_abort(tls)
  4456  		}
  4457  	}()
  4458  	func() {
  4459  		if _pCache.Xn90pct != ((_pCache.XnMax * uint32(9)) / uint32(10)) {
  4460  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45867), unsafe.Pointer(&_pcache1FetchStage2Ø00__func__Ø000), unsafe.Pointer(str(3493)))
  4461  			crt.X__builtin_abort(tls)
  4462  		}
  4463  	}()
  4464  	if (_createFlag == int32(1)) && (((_nPinned >= _pGroup.XmxPinned) || (_nPinned >= _pCache.Xn90pct)) || (_pcache1UnderMemoryPressure(tls, _pCache) != 0 && (_pCache.XnRecyclable < _nPinned))) {
  4465  		return nil
  4466  	}
  4467  	if _pCache.XnPage >= _pCache.XnHash {
  4468  		_pcache1ResizeHash(tls, _pCache)
  4469  	}
  4470  	func() {
  4471  		if _pCache.XnHash <= (0) || _pCache.XapHash == nil {
  4472  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45877), unsafe.Pointer(&_pcache1FetchStage2Ø00__func__Ø000), unsafe.Pointer(str(3529)))
  4473  			crt.X__builtin_abort(tls)
  4474  		}
  4475  	}()
  4476  	if _pCache.XbPurgeable == 0 || ((*XPgHdr1)(_pGroup.Xlru.XpLruPrev).XisAnchor) != 0 || (_pCache.XnPage+uint32(1)) < _pCache.XnMax && _pcache1UnderMemoryPressure(tls, _pCache) == 0 {
  4477  		goto _18
  4478  	}
  4479  	_pPage = (*XPgHdr1)(_pGroup.Xlru.XpLruPrev)
  4480  	func() {
  4481  		if int32(_pPage.XisPinned) != int32(0) {
  4482  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45886), unsafe.Pointer(&_pcache1FetchStage2Ø00__func__Ø000), unsafe.Pointer(str(2809)))
  4483  			crt.X__builtin_abort(tls)
  4484  		}
  4485  	}()
  4486  	_pcache1RemoveFromHash(tls, _pPage, int32(0))
  4487  	_pcache1PinPage(tls, _pPage)
  4488  	_2_pOther = (*XPCache1)(_pPage.XpCache)
  4489  	if _2_pOther.XszAlloc != _pCache.XszAlloc {
  4490  		_pcache1FreePage(tls, _pPage)
  4491  		_pPage = nil
  4492  		goto _22
  4493  	}
  4494  	_pGroup.XnCurrentPage -= uint32(_2_pOther.XbPurgeable - _pCache.XbPurgeable)
  4495  _22:
  4496  _18:
  4497  	if _pPage == nil {
  4498  		_pPage = _pcache1AllocPage(tls, _pCache, bool2int(_createFlag == int32(1)))
  4499  	}
  4500  	if _pPage == nil {
  4501  		goto _24
  4502  	}
  4503  	_6_h = _iKey % _pCache.XnHash
  4504  	_pCache.XnPage += 1
  4505  	_pPage.XiKey = _iKey
  4506  	*(**XPgHdr1)(unsafe.Pointer(&_pPage.XpNext)) = *elem14((**XPgHdr1)(unsafe.Pointer(_pCache.XapHash)), uintptr(_6_h))
  4507  	*(**XPCache1)(unsafe.Pointer(&_pPage.XpCache)) = _pCache
  4508  	*(**XPgHdr1)(unsafe.Pointer(&_pPage.XpLruPrev)) = nil
  4509  	*(**XPgHdr1)(unsafe.Pointer(&_pPage.XpLruNext)) = nil
  4510  	_pPage.XisPinned = uint8(1)
  4511  	*(*unsafe.Pointer)(_pPage.Xpage.XpExtra) = nil
  4512  	*elem14((**XPgHdr1)(unsafe.Pointer(_pCache.XapHash)), uintptr(_6_h)) = _pPage
  4513  	if _iKey > _pCache.XiMaxKey {
  4514  		_pCache.XiMaxKey = _iKey
  4515  	}
  4516  _24:
  4517  	return _pPage
  4518  }
  4519  
  4520  var _pcache1FetchStage2Ø00__func__Ø000 [19]int8
  4521  
  4522  func init() {
  4523  	crt.Xstrncpy(nil, &_pcache1FetchStage2Ø00__func__Ø000[0], str(3563), 19)
  4524  }
  4525  
  4526  // C comment
  4527  //  /*
  4528  //  ** Return true if it desirable to avoid allocating a new page cache
  4529  //  ** entry.
  4530  //  **
  4531  //  ** If memory was allocated specifically to the page cache using
  4532  //  ** SQLITE_CONFIG_PAGECACHE but that memory has all been used, then
  4533  //  ** it is desirable to avoid allocating a new page cache entry because
  4534  //  ** presumably SQLITE_CONFIG_PAGECACHE was suppose to be sufficient
  4535  //  ** for all page cache needs and we should not need to spill the
  4536  //  ** allocation onto the heap.
  4537  //  **
  4538  //  ** Or, the heap is used for all page cache memory but the heap is
  4539  //  ** under memory pressure, then again it is desirable to avoid
  4540  //  ** allocating a new page cache entry in order to avoid stressing
  4541  //  ** the heap even further.
  4542  //  */
  4543  func _pcache1UnderMemoryPressure(tls *crt.TLS, _pCache *XPCache1) (r0 int32) {
  4544  	if _pcache1_g.XnSlot != 0 && ((_pCache.XszPage + _pCache.XszExtra) <= _pcache1_g.XszSlot) {
  4545  		return _pcache1_g.XbUnderPressure
  4546  	}
  4547  	return _sqlite3HeapNearlyFull(tls)
  4548  }
  4549  
  4550  // C comment
  4551  //  /*
  4552  //  ** Return true if the heap is currently under memory pressure - in other
  4553  //  ** words if the amount of heap used is close to the limit set by
  4554  //  ** sqlite3_soft_heap_limit().
  4555  //  */
  4556  func _sqlite3HeapNearlyFull(tls *crt.TLS) (r0 int32) {
  4557  	return _mem0.XnearlyFull
  4558  }
  4559  
  4560  // C comment
  4561  //  /*
  4562  //  ** Allocate a new page object initially associated with cache pCache.
  4563  //  */
  4564  func _pcache1AllocPage(tls *crt.TLS, _pCache *XPCache1, _benignMalloc int32) (r0 *XPgHdr1) {
  4565  	var _pPg unsafe.Pointer
  4566  	var _p *XPgHdr1
  4567  	_p = nil
  4568  	func() {
  4569  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XPGroup)(_pCache.XpGroup).Xmutex)) == 0 {
  4570  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45408), unsafe.Pointer(&_pcache1AllocPageØ00__func__Ø000), unsafe.Pointer(str(2634)))
  4571  			crt.X__builtin_abort(tls)
  4572  		}
  4573  	}()
  4574  	if (_pCache.XpFree != nil) || ((_pCache.XnPage == (0)) && _pcache1InitBulk(tls, _pCache) != 0) {
  4575  		_p = (*XPgHdr1)(_pCache.XpFree)
  4576  		*(**XPgHdr1)(unsafe.Pointer(&_pCache.XpFree)) = (*XPgHdr1)(_p.XpNext)
  4577  		*(**XPgHdr1)(unsafe.Pointer(&_p.XpNext)) = nil
  4578  		goto _5
  4579  	}
  4580  	if _benignMalloc != 0 {
  4581  		_sqlite3BeginBenignMalloc(tls)
  4582  	}
  4583  	_pPg = _pcache1Alloc(tls, _pCache.XszAlloc)
  4584  	_p = (*XPgHdr1)(unsafe.Pointer(elem15((*uint8)(_pPg), uintptr(_pCache.XszPage))))
  4585  	if _benignMalloc != 0 {
  4586  		_sqlite3EndBenignMalloc(tls)
  4587  	}
  4588  	if _pPg == nil {
  4589  		return nil
  4590  	}
  4591  	_p.Xpage.XpBuf = _pPg
  4592  	_p.Xpage.XpExtra = unsafe.Pointer(elem13(_p, uintptr(1)))
  4593  	_p.XisBulkLocal = 0
  4594  	_p.XisAnchor = 0
  4595  _5:
  4596  	if _pCache.XbPurgeable != 0 {
  4597  		(*XPGroup)(_pCache.XpGroup).XnCurrentPage += 1
  4598  	}
  4599  	return _p
  4600  }
  4601  
  4602  var _pcache1AllocPageØ00__func__Ø000 [17]int8
  4603  
  4604  func init() {
  4605  	crt.Xstrncpy(nil, &_pcache1AllocPageØ00__func__Ø000[0], str(3582), 17)
  4606  }
  4607  
  4608  // C comment
  4609  //  /*
  4610  //  ** Try to initialize the pCache->pFree and pCache->pBulk fields.  Return
  4611  //  ** true if pCache->pFree ends up containing one or more free pages.
  4612  //  */
  4613  func _pcache1InitBulk(tls *crt.TLS, _pCache *XPCache1) (r0 int32) {
  4614  	var _4_nBulk int32
  4615  	var _szBulk int64
  4616  	var _zBulk *int8
  4617  	var _5_pX *XPgHdr1
  4618  	if _pcache1_g.XnInitPage == int32(0) {
  4619  		return int32(0)
  4620  	}
  4621  	if _pCache.XnMax < uint32(3) {
  4622  		return int32(0)
  4623  	}
  4624  	_sqlite3BeginBenignMalloc(tls)
  4625  	if _pcache1_g.XnInitPage > int32(0) {
  4626  		_szBulk = int64(_pCache.XszAlloc) * int64(_pcache1_g.XnInitPage)
  4627  		goto _3
  4628  	}
  4629  	_szBulk = int64(-1024) * int64(_pcache1_g.XnInitPage)
  4630  _3:
  4631  	if _szBulk > (int64(_pCache.XszAlloc) * int64(_pCache.XnMax)) {
  4632  		_szBulk = int64(_pCache.XszAlloc) * int64(_pCache.XnMax)
  4633  	}
  4634  	_zBulk = (*int8)(store16(&_pCache.XpBulk, _sqlite3Malloc(tls, uint64(_szBulk))))
  4635  	_sqlite3EndBenignMalloc(tls)
  4636  	if _zBulk == nil {
  4637  		goto _5
  4638  	}
  4639  	_4_nBulk = _sqlite3MallocSize(tls, unsafe.Pointer(_zBulk)) / _pCache.XszAlloc
  4640  _6:
  4641  	_5_pX = (*XPgHdr1)(unsafe.Pointer(elem1(_zBulk, uintptr(_pCache.XszPage))))
  4642  	_5_pX.Xpage.XpBuf = unsafe.Pointer(_zBulk)
  4643  	_5_pX.Xpage.XpExtra = unsafe.Pointer(elem13(_5_pX, uintptr(1)))
  4644  	_5_pX.XisBulkLocal = uint8(1)
  4645  	_5_pX.XisAnchor = 0
  4646  	*(**XPgHdr1)(unsafe.Pointer(&_5_pX.XpNext)) = (*XPgHdr1)(_pCache.XpFree)
  4647  	*(**XPgHdr1)(unsafe.Pointer(&_pCache.XpFree)) = _5_pX
  4648  	*(*uintptr)(unsafe.Pointer(&_zBulk)) += uintptr(_pCache.XszAlloc)
  4649  	if preInc2(&_4_nBulk, -1) != 0 {
  4650  		goto _6
  4651  	}
  4652  _5:
  4653  	return bool2int((*XPgHdr1)(_pCache.XpFree) != nil)
  4654  
  4655  	_ = _4_nBulk
  4656  	panic(0)
  4657  }
  4658  
  4659  // C comment
  4660  //  /*
  4661  //  ** Malloc function used within this file to allocate space from the buffer
  4662  //  ** configured using sqlite3_config(SQLITE_CONFIG_PAGECACHE) option. If no
  4663  //  ** such buffer exists or there is no space left in it, this function falls
  4664  //  ** back to sqlite3Malloc().
  4665  //  **
  4666  //  ** Multiple threads can run this routine at the same time.  Global variables
  4667  //  ** in pcache1 need to be protected via mutex.
  4668  //  */
  4669  func _pcache1Alloc(tls *crt.TLS, _nByte int32) (r0 unsafe.Pointer) {
  4670  	var _4_sz int32
  4671  	var _p unsafe.Pointer
  4672  	_p = nil
  4673  	func() {
  4674  		if Xsqlite3_mutex_notheld(tls, (*Xsqlite3_mutex)(_pcache1_g.Xgrp.Xmutex)) == 0 {
  4675  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45318), unsafe.Pointer(&_pcache1AllocØ00__func__Ø000), unsafe.Pointer(str(3599)))
  4676  			crt.X__builtin_abort(tls)
  4677  		}
  4678  	}()
  4679  	if _nByte > _pcache1_g.XszSlot {
  4680  		goto _2
  4681  	}
  4682  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pcache1_g.Xmutex))
  4683  	_p = _pcache1_g.XpFree
  4684  	if _p != nil {
  4685  		*(**XScratchFreeslot)(unsafe.Pointer(&_pcache1_g.XpFree)) = (*XScratchFreeslot)((*XScratchFreeslot)(_pcache1_g.XpFree).XpNext)
  4686  		_pcache1_g.XnFreeSlot -= 1
  4687  		_pcache1_g.XbUnderPressure = bool2int(_pcache1_g.XnFreeSlot < _pcache1_g.XnReserve)
  4688  		func() {
  4689  			if _pcache1_g.XnFreeSlot < int32(0) {
  4690  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45326), unsafe.Pointer(&_pcache1AllocØ00__func__Ø000), unsafe.Pointer(str(3640)))
  4691  				crt.X__builtin_abort(tls)
  4692  			}
  4693  		}()
  4694  		_sqlite3StatusHighwater(tls, int32(7), _nByte)
  4695  		_sqlite3StatusUp(tls, int32(1), int32(1))
  4696  	}
  4697  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pcache1_g.Xmutex))
  4698  _2:
  4699  	if _p != nil {
  4700  		goto _6
  4701  	}
  4702  	_p = _sqlite3Malloc(tls, uint64(_nByte))
  4703  	if _p != nil {
  4704  		_4_sz = _sqlite3MallocSize(tls, _p)
  4705  		Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pcache1_g.Xmutex))
  4706  		_sqlite3StatusHighwater(tls, int32(7), _nByte)
  4707  		_sqlite3StatusUp(tls, int32(2), _4_sz)
  4708  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pcache1_g.Xmutex))
  4709  	}
  4710  _6:
  4711  	return _p
  4712  }
  4713  
  4714  func Xsqlite3_mutex_notheld(tls *crt.TLS, _p *Xsqlite3_mutex) (r0 int32) {
  4715  	func() {
  4716  		if _p != nil && (_sqlite3Config.Xmutex.XxMutexNotheld) == nil {
  4717  			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)))
  4718  			crt.X__builtin_abort(tls)
  4719  		}
  4720  	}()
  4721  	return bool2int((_p == nil) || func() func(*crt.TLS, *Xsqlite3_mutex) int32 {
  4722  		v := _sqlite3Config.Xmutex.XxMutexNotheld
  4723  		return *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&v))
  4724  	}()(tls, _p) != 0)
  4725  }
  4726  
  4727  var _sqlite3_mutex_notheldØ00__func__Ø000 [22]int8
  4728  
  4729  func init() {
  4730  	crt.Xstrncpy(nil, &_sqlite3_mutex_notheldØ00__func__Ø000[0], str(3709), 22)
  4731  }
  4732  
  4733  var _pcache1AllocØ00__func__Ø000 [13]int8
  4734  
  4735  func init() {
  4736  	crt.Xstrncpy(nil, &_pcache1AllocØ00__func__Ø000[0], str(3731), 13)
  4737  }
  4738  
  4739  // C comment
  4740  //  /*
  4741  //  ** Implementation of the sqlite3_pcache.xUnpin method.
  4742  //  **
  4743  //  ** Mark a page as unpinned (eligible for asynchronous recycling).
  4744  //  */
  4745  func _pcache1Unpin(tls *crt.TLS, _p unsafe.Pointer, _pPg *Xsqlite3_pcache_page, _reuseUnlikely int32) {
  4746  	var _pCache *XPCache1
  4747  	var _pPage *XPgHdr1
  4748  	var _2_ppFirst **XPgHdr1
  4749  	var _pGroup *XPGroup
  4750  	_pCache = (*XPCache1)(_p)
  4751  	_pPage = (*XPgHdr1)(unsafe.Pointer(_pPg))
  4752  	_pGroup = (*XPGroup)(_pCache.XpGroup)
  4753  	func() {
  4754  		if (*XPCache1)(_pPage.XpCache) != _pCache {
  4755  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46067), unsafe.Pointer(&_pcache1UnpinØ00__func__Ø000), unsafe.Pointer(str(3744)))
  4756  			crt.X__builtin_abort(tls)
  4757  		}
  4758  	}()
  4759  	func() {
  4760  		if (*Xsqlite3_mutex)(_pGroup.Xmutex) != nil {
  4761  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46068), unsafe.Pointer(&_pcache1UnpinØ00__func__Ø000), unsafe.Pointer(str(2384)))
  4762  			crt.X__builtin_abort(tls)
  4763  		}
  4764  	}()
  4765  	func() {
  4766  		if (*XPgHdr1)(_pPage.XpLruPrev) != nil || (*XPgHdr1)(_pPage.XpLruNext) != nil {
  4767  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46073), unsafe.Pointer(&_pcache1UnpinØ00__func__Ø000), unsafe.Pointer(str(3766)))
  4768  			crt.X__builtin_abort(tls)
  4769  		}
  4770  	}()
  4771  	func() {
  4772  		if int32(_pPage.XisPinned) != int32(1) {
  4773  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46074), unsafe.Pointer(&_pcache1UnpinØ00__func__Ø000), unsafe.Pointer(str(3807)))
  4774  			crt.X__builtin_abort(tls)
  4775  		}
  4776  	}()
  4777  	if _reuseUnlikely != 0 || (_pGroup.XnCurrentPage > _pGroup.XnMaxPage) {
  4778  		_pcache1RemoveFromHash(tls, _pPage, int32(1))
  4779  		goto _11
  4780  	}
  4781  	_2_ppFirst = (**XPgHdr1)(unsafe.Pointer(&(_pGroup.Xlru.XpLruNext)))
  4782  	*(**XPgHdr1)(unsafe.Pointer(&_pPage.XpLruPrev)) = &_pGroup.Xlru
  4783  	*(**XPgHdr1)(unsafe.Pointer(&(store13((**XPgHdr1)(unsafe.Pointer(&_pPage.XpLruNext)), *_2_ppFirst).XpLruPrev))) = _pPage
  4784  	*_2_ppFirst = _pPage
  4785  	_pCache.XnRecyclable += 1
  4786  	_pPage.XisPinned = 0
  4787  _11:
  4788  	func() {
  4789  		if (*Xsqlite3_mutex)((*XPGroup)(_pCache.XpGroup).Xmutex) != nil {
  4790  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46088), unsafe.Pointer(&_pcache1UnpinØ00__func__Ø000), unsafe.Pointer(str(3168)))
  4791  			crt.X__builtin_abort(tls)
  4792  		}
  4793  	}()
  4794  }
  4795  
  4796  var _pcache1UnpinØ00__func__Ø000 [13]int8
  4797  
  4798  func init() {
  4799  	crt.Xstrncpy(nil, &_pcache1UnpinØ00__func__Ø000[0], str(3826), 13)
  4800  }
  4801  
  4802  // C comment
  4803  //  /*
  4804  //  ** Implementation of the sqlite3_pcache.xRekey method.
  4805  //  */
  4806  func _pcache1Rekey(tls *crt.TLS, _p unsafe.Pointer, _pPg *Xsqlite3_pcache_page, _iOld uint32, _iNew uint32) {
  4807  	var _h uint32
  4808  	var _pCache *XPCache1
  4809  	var _pPage *XPgHdr1
  4810  	var _pp **XPgHdr1
  4811  	_pCache = (*XPCache1)(_p)
  4812  	_pPage = (*XPgHdr1)(unsafe.Pointer(_pPg))
  4813  	func() {
  4814  		if _pPage.XiKey != _iOld {
  4815  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46104), unsafe.Pointer(&_pcache1RekeyØ00__func__Ø000), unsafe.Pointer(str(3839)))
  4816  			crt.X__builtin_abort(tls)
  4817  		}
  4818  	}()
  4819  	func() {
  4820  		if (*XPCache1)(_pPage.XpCache) != _pCache {
  4821  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46105), unsafe.Pointer(&_pcache1RekeyØ00__func__Ø000), unsafe.Pointer(str(3744)))
  4822  			crt.X__builtin_abort(tls)
  4823  		}
  4824  	}()
  4825  	func() {
  4826  		if (*Xsqlite3_mutex)((*XPGroup)(_pCache.XpGroup).Xmutex) != nil {
  4827  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46107), unsafe.Pointer(&_pcache1RekeyØ00__func__Ø000), unsafe.Pointer(str(3168)))
  4828  			crt.X__builtin_abort(tls)
  4829  		}
  4830  	}()
  4831  	_h = _iOld % _pCache.XnHash
  4832  	_pp = elem14((**XPgHdr1)(unsafe.Pointer(_pCache.XapHash)), uintptr(_h))
  4833  _6:
  4834  	if (*_pp) != _pPage {
  4835  		_pp = (**XPgHdr1)(unsafe.Pointer(&((*_pp).XpNext)))
  4836  		goto _6
  4837  	}
  4838  	*_pp = (*XPgHdr1)(_pPage.XpNext)
  4839  	_h = _iNew % _pCache.XnHash
  4840  	_pPage.XiKey = _iNew
  4841  	*(**XPgHdr1)(unsafe.Pointer(&_pPage.XpNext)) = *elem14((**XPgHdr1)(unsafe.Pointer(_pCache.XapHash)), uintptr(_h))
  4842  	*elem14((**XPgHdr1)(unsafe.Pointer(_pCache.XapHash)), uintptr(_h)) = _pPage
  4843  	if _iNew > _pCache.XiMaxKey {
  4844  		_pCache.XiMaxKey = _iNew
  4845  	}
  4846  	func() {
  4847  		if (*Xsqlite3_mutex)((*XPGroup)(_pCache.XpGroup).Xmutex) != nil {
  4848  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46124), unsafe.Pointer(&_pcache1RekeyØ00__func__Ø000), unsafe.Pointer(str(3168)))
  4849  			crt.X__builtin_abort(tls)
  4850  		}
  4851  	}()
  4852  }
  4853  
  4854  var _pcache1RekeyØ00__func__Ø000 [13]int8
  4855  
  4856  func init() {
  4857  	crt.Xstrncpy(nil, &_pcache1RekeyØ00__func__Ø000[0], str(3857), 13)
  4858  }
  4859  
  4860  // C comment
  4861  //  /*
  4862  //  ** Implementation of the sqlite3_pcache.xTruncate method.
  4863  //  **
  4864  //  ** Discard all unpinned pages in the cache with a page number equal to
  4865  //  ** or greater than parameter iLimit. Any pinned pages with a page number
  4866  //  ** equal to or greater than iLimit are implicitly unpinned.
  4867  //  */
  4868  func _pcache1Truncate(tls *crt.TLS, _p unsafe.Pointer, _iLimit uint32) {
  4869  	var _pCache *XPCache1
  4870  	_pCache = (*XPCache1)(_p)
  4871  	func() {
  4872  		if (*Xsqlite3_mutex)((*XPGroup)(_pCache.XpGroup).Xmutex) != nil {
  4873  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46136), unsafe.Pointer(&_pcache1TruncateØ00__func__Ø000), unsafe.Pointer(str(3168)))
  4874  			crt.X__builtin_abort(tls)
  4875  		}
  4876  	}()
  4877  	if _iLimit <= _pCache.XiMaxKey {
  4878  		_pcache1TruncateUnsafe(tls, _pCache, _iLimit)
  4879  		_pCache.XiMaxKey = _iLimit - uint32(1)
  4880  	}
  4881  	func() {
  4882  		if (*Xsqlite3_mutex)((*XPGroup)(_pCache.XpGroup).Xmutex) != nil {
  4883  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46141), unsafe.Pointer(&_pcache1TruncateØ00__func__Ø000), unsafe.Pointer(str(3168)))
  4884  			crt.X__builtin_abort(tls)
  4885  		}
  4886  	}()
  4887  }
  4888  
  4889  var _pcache1TruncateØ00__func__Ø000 [16]int8
  4890  
  4891  func init() {
  4892  	crt.Xstrncpy(nil, &_pcache1TruncateØ00__func__Ø000[0], str(3870), 16)
  4893  }
  4894  
  4895  // C comment
  4896  //  /*
  4897  //  ** Implementation of the sqlite3_pcache.xShrink method.
  4898  //  **
  4899  //  ** Free up as much memory as possible.
  4900  //  */
  4901  func _pcache1Shrink(tls *crt.TLS, _p unsafe.Pointer) {
  4902  	var _1_savedMaxPage int32
  4903  	var _pCache *XPCache1
  4904  	var _1_pGroup *XPGroup
  4905  	_pCache = (*XPCache1)(_p)
  4906  	if _pCache.XbPurgeable != 0 {
  4907  		_1_pGroup = (*XPGroup)(_pCache.XpGroup)
  4908  		func() {
  4909  			if (*Xsqlite3_mutex)(_1_pGroup.Xmutex) != nil {
  4910  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45824), unsafe.Pointer(&_pcache1ShrinkØ00__func__Ø000), unsafe.Pointer(str(2384)))
  4911  				crt.X__builtin_abort(tls)
  4912  			}
  4913  		}()
  4914  		_1_savedMaxPage = int32(_1_pGroup.XnMaxPage)
  4915  		_1_pGroup.XnMaxPage = 0
  4916  		_pcache1EnforceMaxPage(tls, _pCache)
  4917  		_1_pGroup.XnMaxPage = uint32(_1_savedMaxPage)
  4918  		func() {
  4919  			if (*Xsqlite3_mutex)(_1_pGroup.Xmutex) != nil {
  4920  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(45829), unsafe.Pointer(&_pcache1ShrinkØ00__func__Ø000), unsafe.Pointer(str(2384)))
  4921  				crt.X__builtin_abort(tls)
  4922  			}
  4923  		}()
  4924  	}
  4925  }
  4926  
  4927  var _pcache1ShrinkØ00__func__Ø000 [14]int8
  4928  
  4929  func init() {
  4930  	crt.Xstrncpy(nil, &_pcache1ShrinkØ00__func__Ø000[0], str(3886), 14)
  4931  }
  4932  
  4933  var _sqlite3MemSetDefaultØ00defaultMethodsØ001 Xsqlite3_mem_methods
  4934  
  4935  func init() {
  4936  	_sqlite3MemSetDefaultØ00defaultMethodsØ001 = Xsqlite3_mem_methods{XxMalloc: _sqlite3MemMalloc, XxFree: _sqlite3MemFree, XxRealloc: _sqlite3MemRealloc, XxSize: _sqlite3MemSize, XxRoundup: _sqlite3MemRoundup, XxInit: _sqlite3MemInit, XxShutdown: _sqlite3MemShutdown}
  4937  }
  4938  
  4939  // C comment
  4940  //  /*
  4941  //  ** Like malloc(), but remember the size of the allocation
  4942  //  ** so that we can find it later using sqlite3MemSize().
  4943  //  **
  4944  //  ** For this low-level routine, we are guaranteed that nByte>0 because
  4945  //  ** cases of nByte<=0 will be intercepted and dealt with by higher level
  4946  //  ** routines.
  4947  //  */
  4948  func _sqlite3MemMalloc(tls *crt.TLS, _nByte int32) (r0 unsafe.Pointer) {
  4949  	var _p unsafe.Pointer
  4950  	_p = crt.Xmalloc(tls, uint32(_nByte))
  4951  	if _p == nil {
  4952  		Xsqlite3_log(tls, int32(7), str(3900), _nByte)
  4953  	}
  4954  	return _p
  4955  }
  4956  
  4957  // C comment
  4958  //  /*
  4959  //  ** Like free() but works for allocations obtained from sqlite3MemMalloc()
  4960  //  ** or sqlite3MemRealloc().
  4961  //  **
  4962  //  ** For this low-level routine, we already know that pPrior!=0 since
  4963  //  ** cases where pPrior==0 will have been intecepted and dealt with
  4964  //  ** by higher-level routines.
  4965  //  */
  4966  func _sqlite3MemFree(tls *crt.TLS, _pPrior unsafe.Pointer) {
  4967  	crt.Xfree(tls, _pPrior)
  4968  }
  4969  
  4970  // C comment
  4971  //  /*
  4972  //  ** Like realloc().  Resize an allocation previously obtained from
  4973  //  ** sqlite3MemMalloc().
  4974  //  **
  4975  //  ** For this low-level interface, we know that pPrior!=0.  Cases where
  4976  //  ** pPrior==0 while have been intercepted by higher-level routine and
  4977  //  ** redirected to xMalloc.  Similarly, we know that nByte>0 because
  4978  //  ** cases where nByte<=0 will have been intercepted by higher-level
  4979  //  ** routines and redirected to xFree.
  4980  //  */
  4981  func _sqlite3MemRealloc(tls *crt.TLS, _pPrior unsafe.Pointer, _nByte int32) (r0 unsafe.Pointer) {
  4982  	var _p unsafe.Pointer
  4983  	_p = crt.Xrealloc(tls, _pPrior, uint32(_nByte))
  4984  	if _p == nil {
  4985  		Xsqlite3_log(tls, int32(7), str(3938), crt.Xmalloc_usable_size(tls, _pPrior), _nByte)
  4986  	}
  4987  	return _p
  4988  }
  4989  
  4990  // C comment
  4991  //  /*
  4992  //  ** Report the allocated size of a prior return from xMalloc()
  4993  //  ** or xRealloc().
  4994  //  */
  4995  func _sqlite3MemSize(tls *crt.TLS, _pPrior unsafe.Pointer) (r0 int32) {
  4996  	func() {
  4997  		if _pPrior == nil {
  4998  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(20827), unsafe.Pointer(&_sqlite3MemSizeØ00__func__Ø000), unsafe.Pointer(str(3974)))
  4999  			crt.X__builtin_abort(tls)
  5000  		}
  5001  	}()
  5002  	return int32(crt.Xmalloc_usable_size(tls, _pPrior))
  5003  }
  5004  
  5005  var _sqlite3MemSizeØ00__func__Ø000 [15]int8
  5006  
  5007  func init() {
  5008  	crt.Xstrncpy(nil, &_sqlite3MemSizeØ00__func__Ø000[0], str(3984), 15)
  5009  }
  5010  
  5011  // C comment
  5012  //  /*
  5013  //  ** Round up a request size to the next valid allocation size.
  5014  //  */
  5015  func _sqlite3MemRoundup(tls *crt.TLS, _n int32) (r0 int32) {
  5016  	return (_n + int32(7)) & int32(-8)
  5017  }
  5018  
  5019  // C comment
  5020  //  /*
  5021  //  ** Initialize this module.
  5022  //  */
  5023  func _sqlite3MemInit(tls *crt.TLS, _NotUsed unsafe.Pointer) (r0 int32) {
  5024  	return int32(0)
  5025  }
  5026  
  5027  // C comment
  5028  //  /*
  5029  //  ** Deinitialize this module.
  5030  //  */
  5031  func _sqlite3MemShutdown(tls *crt.TLS, _NotUsed unsafe.Pointer) {
  5032  }
  5033  
  5034  func _sqlite3NomemError(tls *crt.TLS, _lineno int32) (r0 int32) {
  5035  	return _reportError(tls, int32(7), _lineno, str(3999))
  5036  }
  5037  
  5038  // C comment
  5039  //  /*
  5040  //  ** Hash table for global functions - functions common to all
  5041  //  ** database connections.  After initialization, this table is
  5042  //  ** read-only.
  5043  //  */
  5044  var _sqlite3BuiltinFunctions XFuncDefHash
  5045  
  5046  // C comment
  5047  //  /*
  5048  //  ** All of the FuncDef structures in the aBuiltinFunc[] array above
  5049  //  ** to the global function hash table.  This occurs at start-time (as
  5050  //  ** a consequence of calling sqlite3_initialize()).
  5051  //  **
  5052  //  ** After this routine runs
  5053  //  */
  5054  func _sqlite3RegisterBuiltinFunctions(tls *crt.TLS) {
  5055  	_sqlite3AlterFunctions(tls)
  5056  	_sqlite3RegisterDateTimeFunctions(tls)
  5057  	_sqlite3InsertBuiltinFuncs(tls, (*XFuncDef)(unsafe.Pointer(&_sqlite3RegisterBuiltinFunctionsØ00aBuiltinFuncØ001)), int32(60))
  5058  }
  5059  
  5060  // C comment
  5061  //  /*
  5062  //  ** Register built-in functions used to help implement ALTER TABLE
  5063  //  */
  5064  func _sqlite3AlterFunctions(tls *crt.TLS) {
  5065  	_sqlite3InsertBuiltinFuncs(tls, (*XFuncDef)(unsafe.Pointer(&_sqlite3AlterFunctionsØ00aAlterTableFuncsØ001)), int32(3))
  5066  }
  5067  
  5068  // C comment
  5069  //  /*
  5070  //  ** Insert a new FuncDef into a FuncDefHash hash table.
  5071  //  */
  5072  func _sqlite3InsertBuiltinFuncs(tls *crt.TLS, _aDef *XFuncDef, _nDef int32) {
  5073  	var _i, _1_nName, _1_h int32
  5074  	var _1_zName *int8
  5075  	var _1_pOther *XFuncDef
  5076  	_i = int32(0)
  5077  _0:
  5078  	if _i >= _nDef {
  5079  		goto _3
  5080  	}
  5081  	_1_zName = elem17(_aDef, uintptr(_i)).XzName
  5082  	_1_nName = _sqlite3Strlen30(tls, _1_zName)
  5083  	_1_h = (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(uint8(*elem1(_1_zName, 0))))) + _1_nName) % int32(23)
  5084  	_1_pOther = _functionSearch(tls, _1_h, _1_zName)
  5085  	if _1_pOther != nil {
  5086  		func() {
  5087  			if _1_pOther == elem17(_aDef, uintptr(_i)) || (*XFuncDef)(_1_pOther.XpNext) == elem17(_aDef, uintptr(_i)) {
  5088  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104459), unsafe.Pointer(&_sqlite3InsertBuiltinFuncsØ00__func__Ø000), unsafe.Pointer(str(4003)))
  5089  				crt.X__builtin_abort(tls)
  5090  			}
  5091  		}()
  5092  		*(**XFuncDef)(unsafe.Pointer(&(elem17(_aDef, uintptr(_i)).XpNext))) = (*XFuncDef)(_1_pOther.XpNext)
  5093  		*(**XFuncDef)(unsafe.Pointer(&_1_pOther.XpNext)) = elem17(_aDef, uintptr(_i))
  5094  		goto _8
  5095  	}
  5096  	*(**XFuncDef)(unsafe.Pointer(&(elem17(_aDef, uintptr(_i)).XpNext))) = nil
  5097  	*(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem17(_aDef, uintptr(_i)).Xu))))) = *elem18((**XFuncDef)(unsafe.Pointer(&_sqlite3BuiltinFunctions.Xa)), uintptr(_1_h))
  5098  	*elem18((**XFuncDef)(unsafe.Pointer(&_sqlite3BuiltinFunctions.Xa)), uintptr(_1_h)) = elem17(_aDef, uintptr(_i))
  5099  _8:
  5100  	_i += 1
  5101  	goto _0
  5102  _3:
  5103  }
  5104  
  5105  // C comment
  5106  //  /*
  5107  //  ** Compute a string length that is limited to what can be stored in
  5108  //  ** lower 30 bits of a 32-bit signed integer.
  5109  //  **
  5110  //  ** The value returned will never be negative.  Nor will it ever be greater
  5111  //  ** than the actual length of the string.  For very long strings (greater
  5112  //  ** than 1GiB) the value returned might be less than the true string length.
  5113  //  */
  5114  func _sqlite3Strlen30(tls *crt.TLS, _z *int8) (r0 int32) {
  5115  	if _z == nil {
  5116  		return int32(0)
  5117  	}
  5118  	return int32(1073741823) & int32(crt.Xstrlen(tls, _z))
  5119  }
  5120  
  5121  // C comment
  5122  //  /* An array to map all upper-case characters into their corresponding
  5123  //  ** lower-case character.
  5124  //  **
  5125  //  ** SQLite only considers US-ASCII (or EBCDIC) characters.  We do not
  5126  //  ** handle case conversions for the UTF character set since the tables
  5127  //  ** involved are nearly as big or bigger than SQLite itself.
  5128  //  */
  5129  var _sqlite3UpperToLower [256]uint8
  5130  
  5131  func init() {
  5132  	_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}
  5133  }
  5134  
  5135  // C comment
  5136  //  /*
  5137  //  ** Search a FuncDefHash for a function with the given name.  Return
  5138  //  ** a pointer to the matching FuncDef if found, or 0 if there is no match.
  5139  //  */
  5140  func _functionSearch(tls *crt.TLS, _h int32, _zFunc *int8) (r0 *XFuncDef) {
  5141  	var _p *XFuncDef
  5142  	_p = *elem18((**XFuncDef)(unsafe.Pointer(&_sqlite3BuiltinFunctions.Xa)), uintptr(_h))
  5143  _0:
  5144  	if _p == nil {
  5145  		goto _3
  5146  	}
  5147  	if _sqlite3StrICmp(tls, _p.XzName, _zFunc) == int32(0) {
  5148  		return _p
  5149  	}
  5150  	_p = (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))
  5151  	goto _0
  5152  _3:
  5153  	return nil
  5154  }
  5155  
  5156  // C comment
  5157  //  /*
  5158  //  ** Internal function prototypes
  5159  //  */
  5160  func _sqlite3StrICmp(tls *crt.TLS, _zLeft *int8, _zRight *int8) (r0 int32) {
  5161  	var _c int32
  5162  	var _a, _b *uint8
  5163  	_a = (*uint8)(unsafe.Pointer(_zLeft))
  5164  	_b = (*uint8)(unsafe.Pointer(_zRight))
  5165  _0:
  5166  	_c = int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(*_a))) - int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(*_b)))
  5167  	if _c != 0 || (int32(*_a) == int32(0)) {
  5168  		goto _2
  5169  	}
  5170  	*(*uintptr)(unsafe.Pointer(&_a)) += uintptr(1)
  5171  	*(*uintptr)(unsafe.Pointer(&_b)) += uintptr(1)
  5172  	goto _0
  5173  _2:
  5174  	return _c
  5175  }
  5176  
  5177  var _sqlite3InsertBuiltinFuncsØ00__func__Ø000 [26]int8
  5178  
  5179  func init() {
  5180  	crt.Xstrncpy(nil, &_sqlite3InsertBuiltinFuncsØ00__func__Ø000[0], str(4047), 26)
  5181  }
  5182  
  5183  var _sqlite3AlterFunctionsØ00aAlterTableFuncsØ001 [3]XFuncDef
  5184  
  5185  func init() {
  5186  	_sqlite3AlterFunctionsØ00aAlterTableFuncsØ001 = [3]XFuncDef{XFuncDef{XnArg: int8(2), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  5187  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  5188  	}{_renameTableFunc})), XzName: str(4073)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  5189  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  5190  	}{_renameTriggerFunc})), XzName: str(4093)}, XFuncDef{XnArg: int8(3), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  5191  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  5192  	}{_renameParentFunc})), XzName: str(4115)}}
  5193  }
  5194  
  5195  // C comment
  5196  //  /*
  5197  //  ** This function is used by SQL generated to implement the
  5198  //  ** ALTER TABLE command. The first argument is the text of a CREATE TABLE or
  5199  //  ** CREATE INDEX command. The second is a table name. The table name in
  5200  //  ** the CREATE TABLE or CREATE INDEX statement is replaced with the third
  5201  //  ** argument and the result returned. Examples:
  5202  //  **
  5203  //  ** sqlite_rename_table('CREATE TABLE abc(a, b, c)', 'def')
  5204  //  **     -> 'CREATE TABLE def(a, b, c)'
  5205  //  **
  5206  //  ** sqlite_rename_table('CREATE INDEX i ON abc(a)', 'def')
  5207  //  **     -> 'CREATE INDEX i ON def(a, b, c)'
  5208  //  */
  5209  func _renameTableFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) {
  5210  	var _token, _len int32
  5211  	var _zRet *int8
  5212  	var _zSql, _zTableName, _zCsr *uint8
  5213  	var _tname XToken
  5214  	var _db *Xsqlite3
  5215  	_zSql = Xsqlite3_value_text(tls, *elem19(_argv, 0))
  5216  	_zTableName = Xsqlite3_value_text(tls, *elem19(_argv, uintptr(1)))
  5217  	_zCsr = _zSql
  5218  	_len = int32(0)
  5219  	_db = Xsqlite3_context_db_handle(tls, _context)
  5220  
  5221  	if _zSql == nil {
  5222  		goto _0
  5223  	}
  5224  _1:
  5225  	if (*_zCsr) == 0 {
  5226  		return
  5227  	}
  5228  	_tname.Xz = (*int8)(unsafe.Pointer(_zCsr))
  5229  	_tname.Xn = uint32(_len)
  5230  _3:
  5231  	*(*uintptr)(unsafe.Pointer(&_zCsr)) += uintptr(_len)
  5232  	_len = _sqlite3GetToken(tls, _zCsr, &_token)
  5233  	if _token == int32(163) {
  5234  		goto _3
  5235  	}
  5236  	func() {
  5237  		if _len <= int32(0) {
  5238  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96186), unsafe.Pointer(&_renameTableFuncØ00__func__Ø000), unsafe.Pointer(str(4136)))
  5239  			crt.X__builtin_abort(tls)
  5240  		}
  5241  	}()
  5242  	if (_token != int32(22)) && (_token != int32(125)) {
  5243  		goto _1
  5244  	}
  5245  	_zRet = _sqlite3MPrintf(tls, _db, str(4142), int32(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)))))
  5246  	Xsqlite3_result_text(tls, _context, _zRet, int32(-1), func() func(*crt.TLS, unsafe.Pointer) {
  5247  		v := _sqlite3MallocSize
  5248  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
  5249  	}())
  5250  _0:
  5251  }
  5252  
  5253  func Xsqlite3_value_text(tls *crt.TLS, _pVal *XMem) (r0 *uint8) {
  5254  	return (*uint8)(_sqlite3ValueText(tls, _pVal, uint8(1)))
  5255  }
  5256  
  5257  // C comment
  5258  //  /* This function is only available internally, it is not part of the
  5259  //  ** external API. It works in a similar way to sqlite3_value_text(),
  5260  //  ** except the data returned is in the encoding specified by the second
  5261  //  ** parameter, which must be one of SQLITE_UTF16BE, SQLITE_UTF16LE or
  5262  //  ** SQLITE_UTF8.
  5263  //  **
  5264  //  ** (2006-02-16:)  The enc value can be or-ed with SQLITE_UTF16_ALIGNED.
  5265  //  ** If that is the case, then the result must be aligned on an even byte
  5266  //  ** boundary.
  5267  //  */
  5268  func _sqlite3ValueText(tls *crt.TLS, _pVal *XMem, _enc uint8) (r0 unsafe.Pointer) {
  5269  	if _pVal == nil {
  5270  		return nil
  5271  	}
  5272  	func() {
  5273  		if (*Xsqlite3)(_pVal.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pVal.Xdb).Xmutex)) == 0 {
  5274  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70759), unsafe.Pointer(&_sqlite3ValueTextØ00__func__Ø000), unsafe.Pointer(str(4153)))
  5275  			crt.X__builtin_abort(tls)
  5276  		}
  5277  	}()
  5278  	func() {
  5279  		if (int32(_enc) & int32(3)) != (int32(_enc) & int32(-9)) {
  5280  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70760), unsafe.Pointer(&_sqlite3ValueTextØ00__func__Ø000), unsafe.Pointer(str(4204)))
  5281  			crt.X__builtin_abort(tls)
  5282  		}
  5283  	}()
  5284  	func() {
  5285  		if (int32(_pVal.Xflags) & int32(32)) != int32(0) {
  5286  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70761), unsafe.Pointer(&_sqlite3ValueTextØ00__func__Ø000), unsafe.Pointer(str(4241)))
  5287  			crt.X__builtin_abort(tls)
  5288  		}
  5289  	}()
  5290  	if ((int32(_pVal.Xflags) & int32(514)) == int32(514)) && (int32(_pVal.Xenc) == int32(_enc)) {
  5291  		return unsafe.Pointer(_pVal.Xz)
  5292  	}
  5293  	if (int32(_pVal.Xflags) & int32(1)) != 0 {
  5294  		return nil
  5295  	}
  5296  	return _valueToText(tls, _pVal, _enc)
  5297  }
  5298  
  5299  var _sqlite3ValueTextØ00__func__Ø000 [17]int8
  5300  
  5301  func init() {
  5302  	crt.Xstrncpy(nil, &_sqlite3ValueTextØ00__func__Ø000[0], str(4271), 17)
  5303  }
  5304  
  5305  // C comment
  5306  //  /*
  5307  //  ** The pVal argument is known to be a value other than NULL.
  5308  //  ** Convert it into a string with encoding enc and return a pointer
  5309  //  ** to a zero-terminated version of that string.
  5310  //  */
  5311  func _valueToText(tls *crt.TLS, _pVal *XMem, _enc uint8) (r0 unsafe.Pointer) {
  5312  	func() {
  5313  		if _pVal == nil {
  5314  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70716), unsafe.Pointer(&_valueToTextØ00__func__Ø000), unsafe.Pointer(str(4288)))
  5315  			crt.X__builtin_abort(tls)
  5316  		}
  5317  	}()
  5318  	func() {
  5319  		if (*Xsqlite3)(_pVal.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pVal.Xdb).Xmutex)) == 0 {
  5320  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70717), unsafe.Pointer(&_valueToTextØ00__func__Ø000), unsafe.Pointer(str(4153)))
  5321  			crt.X__builtin_abort(tls)
  5322  		}
  5323  	}()
  5324  	func() {
  5325  		if (int32(_enc) & int32(3)) != (int32(_enc) & int32(-9)) {
  5326  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70718), unsafe.Pointer(&_valueToTextØ00__func__Ø000), unsafe.Pointer(str(4204)))
  5327  			crt.X__builtin_abort(tls)
  5328  		}
  5329  	}()
  5330  	func() {
  5331  		if (int32(_pVal.Xflags) & int32(32)) != int32(0) {
  5332  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70719), unsafe.Pointer(&_valueToTextØ00__func__Ø000), unsafe.Pointer(str(4241)))
  5333  			crt.X__builtin_abort(tls)
  5334  		}
  5335  	}()
  5336  	func() {
  5337  		if (int32(_pVal.Xflags) & int32(1)) != int32(0) {
  5338  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70720), unsafe.Pointer(&_valueToTextØ00__func__Ø000), unsafe.Pointer(str(4296)))
  5339  			crt.X__builtin_abort(tls)
  5340  		}
  5341  	}()
  5342  	if (int32(_pVal.Xflags) & int32(18)) == 0 {
  5343  		goto _11
  5344  	}
  5345  	if func() int32 {
  5346  		if (int32(_pVal.Xflags) & int32(16384)) != 0 {
  5347  			return _sqlite3VdbeMemExpandBlob(tls, _pVal)
  5348  		}
  5349  		return int32(0)
  5350  	}() != 0 {
  5351  		return nil
  5352  	}
  5353  	{
  5354  		p := &_pVal.Xflags
  5355  		*p = uint16(int32(*p) | int32(2))
  5356  	}
  5357  	if int32(_pVal.Xenc) != (int32(_enc) & int32(-9)) {
  5358  		_sqlite3VdbeChangeEncoding(tls, _pVal, int32(_enc)&int32(-9))
  5359  	}
  5360  	if (int32(_enc)&int32(8)) == int32(0) || int32(1) != (int32(1)&int32(crt.P2U(unsafe.Pointer(_pVal.Xz)))) {
  5361  		goto _17
  5362  	}
  5363  	func() {
  5364  		if (int32(_pVal.Xflags) & int32(6144)) == int32(0) {
  5365  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70728), unsafe.Pointer(&_valueToTextØ00__func__Ø000), unsafe.Pointer(str(4326)))
  5366  			crt.X__builtin_abort(tls)
  5367  		}
  5368  	}()
  5369  	if _sqlite3VdbeMemMakeWriteable(tls, _pVal) != int32(0) {
  5370  		return nil
  5371  	}
  5372  _17:
  5373  	_sqlite3VdbeMemNulTerminate(tls, _pVal)
  5374  	goto _21
  5375  _11:
  5376  	_sqlite3VdbeMemStringify(tls, _pVal, _enc, 0)
  5377  	func() {
  5378  		if int32(0) != (int32(1) & int32(crt.P2U(unsafe.Pointer(_pVal.Xz)))) {
  5379  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70736), unsafe.Pointer(&_valueToTextØ00__func__Ø000), unsafe.Pointer(str(4368)))
  5380  			crt.X__builtin_abort(tls)
  5381  		}
  5382  	}()
  5383  _21:
  5384  	func() {
  5385  		if int32(_pVal.Xenc) != (int32(_enc)&int32(-9)) && (*Xsqlite3)(_pVal.Xdb) != nil && ((*Xsqlite3)(_pVal.Xdb).XmallocFailed) == 0 {
  5386  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70738), unsafe.Pointer(&_valueToTextØ00__func__Ø000), unsafe.Pointer(str(4402)))
  5387  			crt.X__builtin_abort(tls)
  5388  		}
  5389  	}()
  5390  	if int32(_pVal.Xenc) == (int32(_enc) & int32(-9)) {
  5391  		return unsafe.Pointer(_pVal.Xz)
  5392  	}
  5393  	return nil
  5394  }
  5395  
  5396  var _valueToTextØ00__func__Ø000 [12]int8
  5397  
  5398  func init() {
  5399  	crt.Xstrncpy(nil, &_valueToTextØ00__func__Ø000[0], str(4484), 12)
  5400  }
  5401  
  5402  func _sqlite3VdbeMemExpandBlob(tls *crt.TLS, _pMem *XMem) (r0 int32) {
  5403  	var _nByte int32
  5404  	func() {
  5405  		if (int32(_pMem.Xflags) & int32(16384)) == 0 {
  5406  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69923), unsafe.Pointer(&_sqlite3VdbeMemExpandBlobØ00__func__Ø000), unsafe.Pointer(str(4496)))
  5407  			crt.X__builtin_abort(tls)
  5408  		}
  5409  	}()
  5410  	func() {
  5411  		if (int32(_pMem.Xflags) & int32(16)) == 0 {
  5412  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69924), unsafe.Pointer(&_sqlite3VdbeMemExpandBlobØ00__func__Ø000), unsafe.Pointer(str(4519)))
  5413  			crt.X__builtin_abort(tls)
  5414  		}
  5415  	}()
  5416  	func() {
  5417  		if (int32(_pMem.Xflags) & int32(32)) != int32(0) {
  5418  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69925), unsafe.Pointer(&_sqlite3VdbeMemExpandBlobØ00__func__Ø000), unsafe.Pointer(str(4540)))
  5419  			crt.X__builtin_abort(tls)
  5420  		}
  5421  	}()
  5422  	func() {
  5423  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
  5424  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69926), unsafe.Pointer(&_sqlite3VdbeMemExpandBlobØ00__func__Ø000), unsafe.Pointer(str(4568)))
  5425  			crt.X__builtin_abort(tls)
  5426  		}
  5427  	}()
  5428  	_nByte = _pMem.Xn + (*(*int32)(unsafe.Pointer(&_pMem.Xu)))
  5429  	if _nByte <= int32(0) {
  5430  		_nByte = int32(1)
  5431  	}
  5432  	if _sqlite3VdbeMemGrow(tls, _pMem, _nByte, int32(1)) != 0 {
  5433  		return _sqlite3NomemError(tls, int32(69934))
  5434  	}
  5435  	crt.Xmemset(tls, unsafe.Pointer(elem1(_pMem.Xz, uintptr(_pMem.Xn))), int32(0), uint32(*(*int32)(unsafe.Pointer(&_pMem.Xu))))
  5436  	_pMem.Xn += *(*int32)(unsafe.Pointer(&_pMem.Xu))
  5437  	{
  5438  		p := &_pMem.Xflags
  5439  		*p = uint16(int32(*p) & int32(-16897))
  5440  	}
  5441  	return int32(0)
  5442  }
  5443  
  5444  var _sqlite3VdbeMemExpandBlobØ00__func__Ø000 [25]int8
  5445  
  5446  func init() {
  5447  	crt.Xstrncpy(nil, &_sqlite3VdbeMemExpandBlobØ00__func__Ø000[0], str(4619), 25)
  5448  }
  5449  
  5450  // C comment
  5451  //  /*
  5452  //  ** Make sure pMem->z points to a writable allocation of at least
  5453  //  ** min(n,32) bytes.
  5454  //  **
  5455  //  ** If the bPreserve argument is true, then copy of the content of
  5456  //  ** pMem->z into the new allocation.  pMem must be either a string or
  5457  //  ** blob if bPreserve is true.  If bPreserve is false, any prior content
  5458  //  ** in pMem->z is discarded.
  5459  //  */
  5460  func _sqlite3VdbeMemGrow(tls *crt.TLS, _pMem *XMem, _n int32, _bPreserve int32) (r0 int32) {
  5461  	func() {
  5462  		if _sqlite3VdbeCheckMemInvariants(tls, _pMem) == 0 {
  5463  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69822), unsafe.Pointer(&_sqlite3VdbeMemGrowØ00__func__Ø000), unsafe.Pointer(str(4644)))
  5464  			crt.X__builtin_abort(tls)
  5465  		}
  5466  	}()
  5467  	func() {
  5468  		if (int32(_pMem.Xflags) & int32(32)) != int32(0) {
  5469  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69823), unsafe.Pointer(&_sqlite3VdbeMemGrowØ00__func__Ø000), unsafe.Pointer(str(4540)))
  5470  			crt.X__builtin_abort(tls)
  5471  		}
  5472  	}()
  5473  	func() {
  5474  		if _bPreserve != int32(0) && (int32(_pMem.Xflags)&int32(18)) == 0 {
  5475  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69828), unsafe.Pointer(&_sqlite3VdbeMemGrowØ00__func__Ø000), unsafe.Pointer(str(4680)))
  5476  			crt.X__builtin_abort(tls)
  5477  		}
  5478  	}()
  5479  	func() {
  5480  		if _pMem.XszMalloc != int32(0) && _pMem.XszMalloc != _sqlite3DbMallocSize(tls, (*Xsqlite3)(_pMem.Xdb), unsafe.Pointer(_pMem.XzMalloc)) {
  5481  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69831), unsafe.Pointer(&_sqlite3VdbeMemGrowØ00__func__Ø000), unsafe.Pointer(str(4727)))
  5482  			crt.X__builtin_abort(tls)
  5483  		}
  5484  	}()
  5485  	if _n < int32(32) {
  5486  		_n = int32(32)
  5487  	}
  5488  	if (_bPreserve != 0 && (_pMem.XszMalloc > int32(0))) && (_pMem.Xz == _pMem.XzMalloc) {
  5489  		_pMem.Xz = store1(&_pMem.XzMalloc, (*int8)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_pMem.Xdb), unsafe.Pointer(_pMem.Xz), uint64(_n))))
  5490  		_bPreserve = int32(0)
  5491  		goto _14
  5492  	}
  5493  	if _pMem.XszMalloc > int32(0) {
  5494  		_sqlite3DbFreeNN(tls, (*Xsqlite3)(_pMem.Xdb), unsafe.Pointer(_pMem.XzMalloc))
  5495  	}
  5496  	_pMem.XzMalloc = (*int8)(_sqlite3DbMallocRaw(tls, (*Xsqlite3)(_pMem.Xdb), uint64(_n)))
  5497  _14:
  5498  	if _pMem.XzMalloc == nil {
  5499  		_sqlite3VdbeMemSetNull(tls, _pMem)
  5500  		_pMem.Xz = nil
  5501  		_pMem.XszMalloc = int32(0)
  5502  		return _sqlite3NomemError(tls, int32(69845))
  5503  	}
  5504  	_pMem.XszMalloc = _sqlite3DbMallocSize(tls, (*Xsqlite3)(_pMem.Xdb), unsafe.Pointer(_pMem.XzMalloc))
  5505  	if (_bPreserve != 0 && (_pMem.Xz != nil)) && func() int32 {
  5506  		if _pMem.Xz != _pMem.XzMalloc {
  5507  			return int32(1)
  5508  		}
  5509  		return func() int32 {
  5510  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69850), unsafe.Pointer(&_sqlite3VdbeMemGrowØ00__func__Ø000), unsafe.Pointer(str(4809)))
  5511  			crt.X__builtin_abort(tls)
  5512  			return int32(0)
  5513  		}()
  5514  	}() != 0 {
  5515  		crt.Xmemcpy(tls, unsafe.Pointer(_pMem.XzMalloc), unsafe.Pointer(_pMem.Xz), uint32(_pMem.Xn))
  5516  	}
  5517  	if (int32(_pMem.Xflags) & int32(1024)) != int32(0) {
  5518  		func() {
  5519  			if _pMem.XxDel == nil || *(*uintptr)(unsafe.Pointer(&struct {
  5520  				f func(*crt.TLS, unsafe.Pointer)
  5521  			}{_pMem.XxDel})) == *(*uintptr)(unsafe.Pointer(&struct {
  5522  				f func(*crt.TLS, unsafe.Pointer)
  5523  			}{func() func(*crt.TLS, unsafe.Pointer) {
  5524  				v := _sqlite3MallocSize
  5525  				return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
  5526  			}()})) {
  5527  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69854), unsafe.Pointer(&_sqlite3VdbeMemGrowØ00__func__Ø000), unsafe.Pointer(str(4811)))
  5528  				crt.X__builtin_abort(tls)
  5529  			}
  5530  		}()
  5531  		_pMem.XxDel(tls, unsafe.Pointer(_pMem.Xz))
  5532  	}
  5533  	_pMem.Xz = _pMem.XzMalloc
  5534  	{
  5535  		p := &_pMem.Xflags
  5536  		*p = uint16(int32(*p) & int32(-7169))
  5537  	}
  5538  	return int32(0)
  5539  }
  5540  
  5541  // C comment
  5542  //  /*
  5543  //  ** Check invariants on a Mem object.
  5544  //  **
  5545  //  ** This routine is intended for use inside of assert() statements, like
  5546  //  ** this:    assert( sqlite3VdbeCheckMemInvariants(pMem) );
  5547  //  */
  5548  func _sqlite3VdbeCheckMemInvariants(tls *crt.TLS, _p *XMem) (r0 int32) {
  5549  	func() {
  5550  		if (int32(_p.Xflags)&int32(1024)) != int32(0) && _p.XxDel == nil {
  5551  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69733), unsafe.Pointer(&_sqlite3VdbeCheckMemInvariantsØ00__func__Ø000), unsafe.Pointer(str(4855)))
  5552  			crt.X__builtin_abort(tls)
  5553  		}
  5554  	}()
  5555  	func() {
  5556  		if (int32(_p.Xflags)&int32(1024)) != int32(0) && _p.XszMalloc != int32(0) {
  5557  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69739), unsafe.Pointer(&_sqlite3VdbeCheckMemInvariantsØ00__func__Ø000), unsafe.Pointer(str(4893)))
  5558  			crt.X__builtin_abort(tls)
  5559  		}
  5560  	}()
  5561  	func() {
  5562  		if (int32(_p.Xflags) & int32(12)) == int32(12) {
  5563  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69742), unsafe.Pointer(&_sqlite3VdbeCheckMemInvariantsØ00__func__Ø000), unsafe.Pointer(str(4935)))
  5564  			crt.X__builtin_abort(tls)
  5565  		}
  5566  	}()
  5567  	func() {
  5568  		if (int32(_p.Xflags)&int32(1)) != int32(0) && (int32(_p.Xflags)&int32(30)) != int32(0) {
  5569  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69745), unsafe.Pointer(&_sqlite3VdbeCheckMemInvariantsØ00__func__Ø000), unsafe.Pointer(str(4987)))
  5570  			crt.X__builtin_abort(tls)
  5571  		}
  5572  	}()
  5573  	func() {
  5574  		if _p.XszMalloc != int32(0) && _p.XszMalloc != _sqlite3DbMallocSize(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(_p.XzMalloc)) {
  5575  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69749), unsafe.Pointer(&_sqlite3VdbeCheckMemInvariantsØ00__func__Ø000), unsafe.Pointer(str(5067)))
  5576  			crt.X__builtin_abort(tls)
  5577  		}
  5578  	}()
  5579  	if (int32(_p.Xflags)&int32(18)) != 0 && (_p.Xn > int32(0)) {
  5580  		func() {
  5581  			if (((func() int32 {
  5582  				if (_p.XszMalloc > int32(0)) && (_p.Xz == _p.XzMalloc) {
  5583  					return int32(1)
  5584  				}
  5585  				return int32(0)
  5586  			}() + func() int32 {
  5587  				if (int32(_p.Xflags) & int32(1024)) != int32(0) {
  5588  					return int32(1)
  5589  				}
  5590  				return int32(0)
  5591  			}()) + func() int32 {
  5592  				if (int32(_p.Xflags) & int32(4096)) != int32(0) {
  5593  					return int32(1)
  5594  				}
  5595  				return int32(0)
  5596  			}()) + func() int32 {
  5597  				if (int32(_p.Xflags) & int32(2048)) != int32(0) {
  5598  					return int32(1)
  5599  				}
  5600  				return int32(0)
  5601  			}()) != int32(1) {
  5602  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69761), unsafe.Pointer(&_sqlite3VdbeCheckMemInvariantsØ00__func__Ø000), unsafe.Pointer(str(5136)))
  5603  				crt.X__builtin_abort(tls)
  5604  			}
  5605  		}()
  5606  	}
  5607  	return int32(1)
  5608  }
  5609  
  5610  var _sqlite3VdbeCheckMemInvariantsØ00__func__Ø000 [30]int8
  5611  
  5612  func init() {
  5613  	crt.Xstrncpy(nil, &_sqlite3VdbeCheckMemInvariantsØ00__func__Ø000[0], str(5293), 30)
  5614  }
  5615  
  5616  var _sqlite3VdbeMemGrowØ00__func__Ø000 [19]int8
  5617  
  5618  func init() {
  5619  	crt.Xstrncpy(nil, &_sqlite3VdbeMemGrowØ00__func__Ø000[0], str(5323), 19)
  5620  }
  5621  
  5622  // C comment
  5623  //  /*
  5624  //  ** Attempt to reallocate p.  If the reallocation fails, then free p
  5625  //  ** and set the mallocFailed flag in the database connection.
  5626  //  */
  5627  func _sqlite3DbReallocOrFree(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer, _n uint64) (r0 unsafe.Pointer) {
  5628  	var _pNew unsafe.Pointer
  5629  	_pNew = _sqlite3DbRealloc(tls, _db, _p, _n)
  5630  	if _pNew == nil {
  5631  		_sqlite3DbFree(tls, _db, _p)
  5632  	}
  5633  	return _pNew
  5634  }
  5635  
  5636  // C comment
  5637  //  /*
  5638  //  ** Allocate memory, either lookaside (if possible) or heap.
  5639  //  ** If the allocation fails, set the mallocFailed flag in
  5640  //  ** the connection pointer.
  5641  //  **
  5642  //  ** If db!=0 and db->mallocFailed is true (indicating a prior malloc
  5643  //  ** failure on the same database connection) then always return 0.
  5644  //  ** Hence for a particular database connection, once malloc starts
  5645  //  ** failing, it fails consistently until mallocFailed is reset.
  5646  //  ** This is an important assumption.  There are many places in the
  5647  //  ** code that do things like this:
  5648  //  **
  5649  //  **         int *a = (int*)sqlite3DbMallocRaw(db, 100);
  5650  //  **         int *b = (int*)sqlite3DbMallocRaw(db, 200);
  5651  //  **         if( b ) a[10] = 9;
  5652  //  **
  5653  //  ** In other words, if a subsequent malloc (ex: "b") worked, it is assumed
  5654  //  ** that all prior mallocs (ex: "a") worked too.
  5655  //  **
  5656  //  ** The sqlite3MallocRawNN() variant guarantees that the "db" parameter is
  5657  //  ** not a NULL pointer.
  5658  //  */
  5659  func _sqlite3DbMallocRaw(tls *crt.TLS, _db *Xsqlite3, _n uint64) (r0 unsafe.Pointer) {
  5660  	var _p unsafe.Pointer
  5661  	if _db != nil {
  5662  		return _sqlite3DbMallocRawNN(tls, _db, _n)
  5663  	}
  5664  	_p = _sqlite3Malloc(tls, _n)
  5665  	return _p
  5666  }
  5667  
  5668  // C comment
  5669  //  /*
  5670  //  ** Delete any previous value and set the value stored in *pMem to NULL.
  5671  //  **
  5672  //  ** This routine calls the Mem.xDel destructor to dispose of values that
  5673  //  ** require the destructor.  But it preserves the Mem.zMalloc memory allocation.
  5674  //  ** To free all resources, use sqlite3VdbeMemRelease(), which both calls this
  5675  //  ** routine to invoke the destructor and deallocates Mem.zMalloc.
  5676  //  **
  5677  //  ** Use this routine to reset the Mem prior to insert a new value.
  5678  //  **
  5679  //  ** Use sqlite3VdbeMemRelease() to complete erase the Mem prior to abandoning it.
  5680  //  */
  5681  func _sqlite3VdbeMemSetNull(tls *crt.TLS, _pMem *XMem) {
  5682  	if (int32(_pMem.Xflags) & int32(9312)) != int32(0) {
  5683  		_vdbeMemClearExternAndSetNull(tls, _pMem)
  5684  		goto _1
  5685  	}
  5686  	_pMem.Xflags = uint16(1)
  5687  _1:
  5688  }
  5689  
  5690  // C comment
  5691  //  /*
  5692  //  ** If the memory cell contains a value that must be freed by
  5693  //  ** invoking the external callback in Mem.xDel, then this routine
  5694  //  ** will free that value.  It also sets Mem.flags to MEM_Null.
  5695  //  **
  5696  //  ** This is a helper routine for sqlite3VdbeMemSetNull() and
  5697  //  ** for sqlite3VdbeMemRelease().  Use those other routines as the
  5698  //  ** entry point for releasing Mem resources.
  5699  //  */
  5700  func _vdbeMemClearExternAndSetNull(tls *crt.TLS, _p *XMem) {
  5701  	var _4_pFrame *XVdbeFrame
  5702  	func() {
  5703  		if (*Xsqlite3)(_p.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
  5704  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70064), unsafe.Pointer(&_vdbeMemClearExternAndSetNullØ00__func__Ø000), unsafe.Pointer(str(5342)))
  5705  			crt.X__builtin_abort(tls)
  5706  		}
  5707  	}()
  5708  	func() {
  5709  		if (int32(_p.Xflags) & int32(9312)) == int32(0) {
  5710  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70065), unsafe.Pointer(&_vdbeMemClearExternAndSetNullØ00__func__Ø000), unsafe.Pointer(str(5387)))
  5711  			crt.X__builtin_abort(tls)
  5712  		}
  5713  	}()
  5714  	if (int32(_p.Xflags) & int32(8192)) != 0 {
  5715  		_sqlite3VdbeMemFinalize(tls, _p, (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xu))))
  5716  		func() {
  5717  			if (int32(_p.Xflags) & int32(8192)) != int32(0) {
  5718  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70068), unsafe.Pointer(&_vdbeMemClearExternAndSetNullØ00__func__Ø000), unsafe.Pointer(str(5405)))
  5719  				crt.X__builtin_abort(tls)
  5720  			}
  5721  		}()
  5722  	}
  5723  	if (int32(_p.Xflags) & int32(1024)) != 0 {
  5724  		func() {
  5725  			if (int32(_p.Xflags) & int32(32)) != int32(0) {
  5726  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70072), unsafe.Pointer(&_vdbeMemClearExternAndSetNullØ00__func__Ø000), unsafe.Pointer(str(5429)))
  5727  				crt.X__builtin_abort(tls)
  5728  			}
  5729  		}()
  5730  		func() {
  5731  			if *(*uintptr)(unsafe.Pointer(&struct {
  5732  				f func(*crt.TLS, unsafe.Pointer)
  5733  			}{_p.XxDel})) == *(*uintptr)(unsafe.Pointer(&struct {
  5734  				f func(*crt.TLS, unsafe.Pointer)
  5735  			}{func() func(*crt.TLS, unsafe.Pointer) {
  5736  				v := _sqlite3MallocSize
  5737  				return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
  5738  			}()})) || _p.XxDel == nil {
  5739  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70073), unsafe.Pointer(&_vdbeMemClearExternAndSetNullØ00__func__Ø000), unsafe.Pointer(str(5454)))
  5740  				crt.X__builtin_abort(tls)
  5741  			}
  5742  		}()
  5743  		_p.XxDel(tls, unsafe.Pointer(_p.Xz))
  5744  		goto _17
  5745  	}
  5746  	if (int32(_p.Xflags) & int32(32)) != 0 {
  5747  		_sqlite3RowSetClear(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xu))))
  5748  		goto _17
  5749  	}
  5750  	if (int32(_p.Xflags) & int32(64)) != 0 {
  5751  		_4_pFrame = (*XVdbeFrame)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))
  5752  		*(**XVdbeFrame)(unsafe.Pointer(&_4_pFrame.XpParent)) = (*XVdbeFrame)((*TVdbe)(_4_pFrame.Xv).XpDelFrame)
  5753  		*(**XVdbeFrame)(unsafe.Pointer(&((*TVdbe)(_4_pFrame.Xv).XpDelFrame))) = _4_pFrame
  5754  	}
  5755  _17:
  5756  	_p.Xflags = uint16(1)
  5757  }
  5758  
  5759  var _vdbeMemClearExternAndSetNullØ00__func__Ø000 [29]int8
  5760  
  5761  func init() {
  5762  	crt.Xstrncpy(nil, &_vdbeMemClearExternAndSetNullØ00__func__Ø000[0], str(5492), 29)
  5763  }
  5764  
  5765  // C comment
  5766  //  /*
  5767  //  ** Memory cell pMem contains the context of an aggregate function.
  5768  //  ** This routine calls the finalize method for that function.  The
  5769  //  ** result of the aggregate is stored back into pMem.
  5770  //  **
  5771  //  ** Return SQLITE_ERROR if the finalizer reports an error.  SQLITE_OK
  5772  //  ** otherwise.
  5773  //  */
  5774  func _sqlite3VdbeMemFinalize(tls *crt.TLS, _pMem *XMem, _pFunc *XFuncDef) (r0 int32) {
  5775  	var _rc int32
  5776  	var _1_ctx Xsqlite3_context
  5777  	var _1_t XMem
  5778  	_rc = int32(0)
  5779  	if func() int32 {
  5780  		if (_pFunc != nil) && (_pFunc.XxFinalize != nil) {
  5781  			return int32(1)
  5782  		}
  5783  		return func() int32 {
  5784  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70033), unsafe.Pointer(&_sqlite3VdbeMemFinalizeØ00__func__Ø000), unsafe.Pointer(str(4809)))
  5785  			crt.X__builtin_abort(tls)
  5786  			return int32(0)
  5787  		}()
  5788  	}() == 0 {
  5789  		goto _3
  5790  	}
  5791  	func() {
  5792  		if (int32(_pMem.Xflags)&int32(1)) == int32(0) && _pFunc != (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer(&_pMem.Xu))) {
  5793  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70036), unsafe.Pointer(&_sqlite3VdbeMemFinalizeØ00__func__Ø000), unsafe.Pointer(str(5521)))
  5794  			crt.X__builtin_abort(tls)
  5795  		}
  5796  	}()
  5797  	func() {
  5798  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
  5799  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70037), unsafe.Pointer(&_sqlite3VdbeMemFinalizeØ00__func__Ø000), unsafe.Pointer(str(4568)))
  5800  			crt.X__builtin_abort(tls)
  5801  		}
  5802  	}()
  5803  	crt.Xmemset(tls, unsafe.Pointer(&_1_ctx), int32(0), uint32(32))
  5804  	crt.Xmemset(tls, unsafe.Pointer(&_1_t), int32(0), uint32(48))
  5805  	_1_t.Xflags = uint16(1)
  5806  	*(**Xsqlite3)(unsafe.Pointer(&_1_t.Xdb)) = (*Xsqlite3)(_pMem.Xdb)
  5807  	*(**XMem)(unsafe.Pointer(&_1_ctx.XpOut)) = &_1_t
  5808  	*(**XMem)(unsafe.Pointer(&_1_ctx.XpMem)) = _pMem
  5809  	*(**XFuncDef)(unsafe.Pointer(&_1_ctx.XpFunc)) = _pFunc
  5810  	func() func(*crt.TLS, *Xsqlite3_context) {
  5811  		v := _pFunc.XxFinalize
  5812  		return *(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer(&v))
  5813  	}()(tls, &_1_ctx)
  5814  	func() {
  5815  		if (int32(_pMem.Xflags) & int32(1024)) != int32(0) {
  5816  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70046), unsafe.Pointer(&_sqlite3VdbeMemFinalizeØ00__func__Ø000), unsafe.Pointer(str(5572)))
  5817  			crt.X__builtin_abort(tls)
  5818  		}
  5819  	}()
  5820  	if _pMem.XszMalloc > int32(0) {
  5821  		_sqlite3DbFreeNN(tls, (*Xsqlite3)(_pMem.Xdb), unsafe.Pointer(_pMem.XzMalloc))
  5822  	}
  5823  	crt.Xmemcpy(tls, unsafe.Pointer(_pMem), unsafe.Pointer(&_1_t), uint32(48))
  5824  	_rc = _1_ctx.XisError
  5825  _3:
  5826  	return _rc
  5827  }
  5828  
  5829  var _sqlite3VdbeMemFinalizeØ00__func__Ø000 [23]int8
  5830  
  5831  func init() {
  5832  	crt.Xstrncpy(nil, &_sqlite3VdbeMemFinalizeØ00__func__Ø000[0], str(5599), 23)
  5833  }
  5834  
  5835  // C comment
  5836  //  /*
  5837  //  ** Deallocate all chunks from a RowSet.  This frees all memory that
  5838  //  ** the RowSet has allocated over its lifetime.  This routine is
  5839  //  ** the destructor for the RowSet.
  5840  //  */
  5841  func _sqlite3RowSetClear(tls *crt.TLS, _p *XRowSet) {
  5842  	var _pChunk, _pNextChunk *TRowSetChunk
  5843  	_pChunk = (*TRowSetChunk)(_p.XpChunk)
  5844  _0:
  5845  	if _pChunk == nil {
  5846  		goto _3
  5847  	}
  5848  	_pNextChunk = (*TRowSetChunk)(_pChunk.XpNextChunk)
  5849  	_sqlite3DbFree(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(_pChunk))
  5850  	_pChunk = _pNextChunk
  5851  	goto _0
  5852  _3:
  5853  	*(**TRowSetChunk)(unsafe.Pointer(&_p.XpChunk)) = nil
  5854  	_p.XnFresh = 0
  5855  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpEntry)) = nil
  5856  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpLast)) = nil
  5857  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpForest)) = nil
  5858  	_p.XrsFlags = uint16(1)
  5859  }
  5860  
  5861  // C comment
  5862  //  /*
  5863  //  ** If pMem is an object with a valid string representation, this routine
  5864  //  ** ensures the internal encoding for the string representation is
  5865  //  ** 'desiredEnc', one of SQLITE_UTF8, SQLITE_UTF16LE or SQLITE_UTF16BE.
  5866  //  **
  5867  //  ** If pMem is not a string object, or the encoding of the string
  5868  //  ** representation is already stored using the requested encoding, then this
  5869  //  ** routine is a no-op.
  5870  //  **
  5871  //  ** SQLITE_OK is returned if the conversion is successful (or not required).
  5872  //  ** SQLITE_NOMEM may be returned if a malloc() fails during conversion
  5873  //  ** between formats.
  5874  //  */
  5875  func _sqlite3VdbeChangeEncoding(tls *crt.TLS, _pMem *XMem, _desiredEnc int32) (r0 int32) {
  5876  	var _rc int32
  5877  	func() {
  5878  		if (int32(_pMem.Xflags) & int32(32)) != int32(0) {
  5879  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69790), unsafe.Pointer(&_sqlite3VdbeChangeEncodingØ00__func__Ø000), unsafe.Pointer(str(4540)))
  5880  			crt.X__builtin_abort(tls)
  5881  		}
  5882  	}()
  5883  	func() {
  5884  		if _desiredEnc != int32(1) && _desiredEnc != int32(2) && _desiredEnc != int32(3) {
  5885  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69791), unsafe.Pointer(&_sqlite3VdbeChangeEncodingØ00__func__Ø000), unsafe.Pointer(str(5622)))
  5886  			crt.X__builtin_abort(tls)
  5887  		}
  5888  	}()
  5889  	if ((int32(_pMem.Xflags) & int32(2)) == 0) || (int32(_pMem.Xenc) == _desiredEnc) {
  5890  		return int32(0)
  5891  	}
  5892  	func() {
  5893  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
  5894  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69796), unsafe.Pointer(&_sqlite3VdbeChangeEncodingØ00__func__Ø000), unsafe.Pointer(str(4568)))
  5895  			crt.X__builtin_abort(tls)
  5896  		}
  5897  	}()
  5898  	_rc = _sqlite3VdbeMemTranslate(tls, _pMem, uint8(_desiredEnc))
  5899  	func() {
  5900  		if _rc != int32(0) && _rc != int32(7) {
  5901  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69805), unsafe.Pointer(&_sqlite3VdbeChangeEncodingØ00__func__Ø000), unsafe.Pointer(str(5706)))
  5902  			crt.X__builtin_abort(tls)
  5903  		}
  5904  	}()
  5905  	func() {
  5906  		if _rc != int32(0) && int32(_pMem.Xenc) == _desiredEnc {
  5907  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69806), unsafe.Pointer(&_sqlite3VdbeChangeEncodingØ00__func__Ø000), unsafe.Pointer(str(5740)))
  5908  			crt.X__builtin_abort(tls)
  5909  		}
  5910  	}()
  5911  	func() {
  5912  		if _rc != int32(7) && int32(_pMem.Xenc) != _desiredEnc {
  5913  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69807), unsafe.Pointer(&_sqlite3VdbeChangeEncodingØ00__func__Ø000), unsafe.Pointer(str(5779)))
  5914  			crt.X__builtin_abort(tls)
  5915  		}
  5916  	}()
  5917  	return _rc
  5918  }
  5919  
  5920  var _sqlite3VdbeChangeEncodingØ00__func__Ø000 [26]int8
  5921  
  5922  func init() {
  5923  	crt.Xstrncpy(nil, &_sqlite3VdbeChangeEncodingØ00__func__Ø000[0], str(5821), 26)
  5924  }
  5925  
  5926  // C comment
  5927  //  /*
  5928  //  ** This routine transforms the internal text encoding used by pMem to
  5929  //  ** desiredEnc. It is an error if the string is already of the desired
  5930  //  ** encoding, or if *pMem does not contain a string value.
  5931  //  */
  5932  func _sqlite3VdbeMemTranslate(tls *crt.TLS, _pMem *XMem, _desiredEnc uint8) (r0 int32) {
  5933  	var _len, _1_rc, _28_c2, _37_c2 int32
  5934  	var _c uint32
  5935  	var _1_temp uint8
  5936  	var _zOut, _zIn, _zTerm, _z *uint8
  5937  	func() {
  5938  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
  5939  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27333), unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000), unsafe.Pointer(str(4568)))
  5940  			crt.X__builtin_abort(tls)
  5941  		}
  5942  	}()
  5943  	func() {
  5944  		if (int32(_pMem.Xflags) & int32(2)) == 0 {
  5945  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27334), unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000), unsafe.Pointer(str(5847)))
  5946  			crt.X__builtin_abort(tls)
  5947  		}
  5948  	}()
  5949  	func() {
  5950  		if int32(_pMem.Xenc) == int32(_desiredEnc) {
  5951  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27335), unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000), unsafe.Pointer(str(5867)))
  5952  			crt.X__builtin_abort(tls)
  5953  		}
  5954  	}()
  5955  	func() {
  5956  		if int32(_pMem.Xenc) == int32(0) {
  5957  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27336), unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000), unsafe.Pointer(str(5889)))
  5958  			crt.X__builtin_abort(tls)
  5959  		}
  5960  	}()
  5961  	func() {
  5962  		if _pMem.Xn < int32(0) {
  5963  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27337), unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000), unsafe.Pointer(str(5902)))
  5964  			crt.X__builtin_abort(tls)
  5965  		}
  5966  	}()
  5967  	if int32(_pMem.Xenc) == int32(1) || int32(_desiredEnc) == int32(1) {
  5968  		goto _12
  5969  	}
  5970  	_1_rc = _sqlite3VdbeMemMakeWriteable(tls, _pMem)
  5971  	if _1_rc != int32(0) {
  5972  		func() {
  5973  			if _1_rc != int32(7) {
  5974  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27356), unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000), unsafe.Pointer(str(5913)))
  5975  				crt.X__builtin_abort(tls)
  5976  			}
  5977  		}()
  5978  		return _sqlite3NomemError(tls, int32(27357))
  5979  	}
  5980  	_zIn = (*uint8)(unsafe.Pointer(_pMem.Xz))
  5981  	_zTerm = elem15(_zIn, uintptr(_pMem.Xn&int32(-2)))
  5982  _16:
  5983  	if crt.P2U(unsafe.Pointer(_zIn)) < crt.P2U(unsafe.Pointer(_zTerm)) {
  5984  		_1_temp = *_zIn
  5985  		*_zIn = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zIn)) + uintptr(int32(1))))
  5986  		*(*uintptr)(unsafe.Pointer(&_zIn)) += uintptr(1)
  5987  		*postInc15(&_zIn, 1) = _1_temp
  5988  		goto _16
  5989  	}
  5990  	_pMem.Xenc = _desiredEnc
  5991  	goto _translate_out
  5992  _12:
  5993  	if int32(_desiredEnc) == int32(1) {
  5994  		_pMem.Xn &= int32(-2)
  5995  		_len = (_pMem.Xn * int32(2)) + int32(1)
  5996  		goto _19
  5997  	}
  5998  	_len = (_pMem.Xn * int32(2)) + int32(2)
  5999  _19:
  6000  	_zIn = (*uint8)(unsafe.Pointer(_pMem.Xz))
  6001  	_zTerm = elem15(_zIn, uintptr(_pMem.Xn))
  6002  	_zOut = (*uint8)(_sqlite3DbMallocRaw(tls, (*Xsqlite3)(_pMem.Xdb), uint64(_len)))
  6003  	if _zOut == nil {
  6004  		return _sqlite3NomemError(tls, int32(27399))
  6005  	}
  6006  	_z = _zOut
  6007  	if int32(_pMem.Xenc) != int32(1) {
  6008  		goto _21
  6009  	}
  6010  	if int32(_desiredEnc) != int32(2) {
  6011  		goto _22
  6012  	}
  6013  _23:
  6014  	if crt.P2U(unsafe.Pointer(_zIn)) >= crt.P2U(unsafe.Pointer(_zTerm)) {
  6015  		goto _24
  6016  	}
  6017  	_c = uint32(*postInc15(&_zIn, 1))
  6018  	if _c < uint32(192) {
  6019  		goto _25
  6020  	}
  6021  	_c = uint32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3Utf8Trans1)), uintptr(_c-uint32(192))))
  6022  _26:
  6023  	if (_zIn != _zTerm) && ((int32(*_zIn) & int32(192)) == int32(128)) {
  6024  		_c = (_c << 6) + uint32(int32(63)&int32(*postInc15(&_zIn, 1)))
  6025  		goto _26
  6026  	}
  6027  	if ((_c < uint32(128)) || ((_c & uint32(4294965248)) == uint32(55296))) || ((_c & uint32(4294967294)) == uint32(65534)) {
  6028  		_c = uint32(65533)
  6029  	}
  6030  _25:
  6031  	if _c <= uint32(65535) {
  6032  		*postInc15(&_z, 1) = uint8(_c & uint32(255))
  6033  		*postInc15(&_z, 1) = uint8((_c >> 8) & uint32(255))
  6034  		goto _33
  6035  	}
  6036  	*postInc15(&_z, 1) = uint8(((_c >> 10) & uint32(63)) + (((_c - uint32(65536)) >> 10) & uint32(192)))
  6037  	*postInc15(&_z, 1) = uint8(uint32(216) + (((_c - uint32(65536)) >> 18) & uint32(3)))
  6038  	*postInc15(&_z, 1) = uint8(_c & uint32(255))
  6039  	*postInc15(&_z, 1) = uint8(uint32(220) + ((_c >> 8) & uint32(3)))
  6040  _33:
  6041  	goto _23
  6042  _24:
  6043  	goto _34
  6044  _22:
  6045  	func() {
  6046  		if int32(_desiredEnc) != int32(3) {
  6047  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27411), unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000), unsafe.Pointer(str(5930)))
  6048  			crt.X__builtin_abort(tls)
  6049  		}
  6050  	}()
  6051  _37:
  6052  	if crt.P2U(unsafe.Pointer(_zIn)) >= crt.P2U(unsafe.Pointer(_zTerm)) {
  6053  		goto _38
  6054  	}
  6055  	_c = uint32(*postInc15(&_zIn, 1))
  6056  	if _c < uint32(192) {
  6057  		goto _39
  6058  	}
  6059  	_c = uint32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3Utf8Trans1)), uintptr(_c-uint32(192))))
  6060  _40:
  6061  	if (_zIn != _zTerm) && ((int32(*_zIn) & int32(192)) == int32(128)) {
  6062  		_c = (_c << 6) + uint32(int32(63)&int32(*postInc15(&_zIn, 1)))
  6063  		goto _40
  6064  	}
  6065  	if ((_c < uint32(128)) || ((_c & uint32(4294965248)) == uint32(55296))) || ((_c & uint32(4294967294)) == uint32(65534)) {
  6066  		_c = uint32(65533)
  6067  	}
  6068  _39:
  6069  	if _c <= uint32(65535) {
  6070  		*postInc15(&_z, 1) = uint8((_c >> 8) & uint32(255))
  6071  		*postInc15(&_z, 1) = uint8(_c & uint32(255))
  6072  		goto _47
  6073  	}
  6074  	*postInc15(&_z, 1) = uint8(uint32(216) + (((_c - uint32(65536)) >> 18) & uint32(3)))
  6075  	*postInc15(&_z, 1) = uint8(((_c >> 10) & uint32(63)) + (((_c - uint32(65536)) >> 10) & uint32(192)))
  6076  	*postInc15(&_z, 1) = uint8(uint32(220) + ((_c >> 8) & uint32(3)))
  6077  	*postInc15(&_z, 1) = uint8(_c & uint32(255))
  6078  _47:
  6079  	goto _37
  6080  _38:
  6081  _34:
  6082  	_pMem.Xn = int32(uintptr(unsafe.Pointer(_z)) - uintptr(unsafe.Pointer(_zOut)))
  6083  	*postInc15(&_z, 1) = 0
  6084  	goto _48
  6085  _21:
  6086  	func() {
  6087  		if int32(_desiredEnc) != int32(1) {
  6088  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27421), unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000), unsafe.Pointer(str(5957)))
  6089  			crt.X__builtin_abort(tls)
  6090  		}
  6091  	}()
  6092  	if int32(_pMem.Xenc) != int32(2) {
  6093  		goto _51
  6094  	}
  6095  _52:
  6096  	if crt.P2U(unsafe.Pointer(_zIn)) >= crt.P2U(unsafe.Pointer(_zTerm)) {
  6097  		goto _53
  6098  	}
  6099  	_c = uint32(*postInc15(&_zIn, 1))
  6100  	_c += uint32(int32(*postInc15(&_zIn, 1)) << 8)
  6101  	if ((_c >= uint32(55296)) && (_c < uint32(57344))) && (crt.P2U(unsafe.Pointer(_zIn)) < crt.P2U(unsafe.Pointer(_zTerm))) {
  6102  		_28_c2 = int32(*postInc15(&_zIn, 1))
  6103  		_28_c2 += int32(*postInc15(&_zIn, 1)) << 8
  6104  		_c = (uint32(_28_c2&int32(1023)) + ((_c & uint32(63)) << 10)) + (((_c & uint32(960)) + uint32(64)) << 10)
  6105  	}
  6106  	if _c < uint32(128) {
  6107  		*postInc15(&_z, 1) = uint8(_c & uint32(255))
  6108  		goto _62
  6109  	}
  6110  	if _c < uint32(2048) {
  6111  		*postInc15(&_z, 1) = uint8(int32(192) + int32(uint8((_c>>6)&uint32(31))))
  6112  		*postInc15(&_z, 1) = uint8(int32(128) + int32(uint8(_c&uint32(63))))
  6113  		goto _62
  6114  	}
  6115  	if _c < uint32(65536) {
  6116  		*postInc15(&_z, 1) = uint8(int32(224) + int32(uint8((_c>>12)&uint32(15))))
  6117  		*postInc15(&_z, 1) = uint8(int32(128) + int32(uint8((_c>>6)&uint32(63))))
  6118  		*postInc15(&_z, 1) = uint8(int32(128) + int32(uint8(_c&uint32(63))))
  6119  		goto _62
  6120  	}
  6121  	*postInc15(&_z, 1) = uint8(int32(240) + int32(uint8((_c>>18)&uint32(7))))
  6122  	*postInc15(&_z, 1) = uint8(int32(128) + int32(uint8((_c>>12)&uint32(63))))
  6123  	*postInc15(&_z, 1) = uint8(int32(128) + int32(uint8((_c>>6)&uint32(63))))
  6124  	*postInc15(&_z, 1) = uint8(int32(128) + int32(uint8(_c&uint32(63))))
  6125  _62:
  6126  	goto _52
  6127  _53:
  6128  	goto _63
  6129  _51:
  6130  _64:
  6131  	if crt.P2U(unsafe.Pointer(_zIn)) >= crt.P2U(unsafe.Pointer(_zTerm)) {
  6132  		goto _65
  6133  	}
  6134  	_c = uint32(int32(*postInc15(&_zIn, 1)) << 8)
  6135  	_c += uint32(*postInc15(&_zIn, 1))
  6136  	if ((_c >= uint32(55296)) && (_c < uint32(57344))) && (crt.P2U(unsafe.Pointer(_zIn)) < crt.P2U(unsafe.Pointer(_zTerm))) {
  6137  		_37_c2 = int32(*postInc15(&_zIn, 1)) << 8
  6138  		_37_c2 += int32(*postInc15(&_zIn, 1))
  6139  		_c = (uint32(_37_c2&int32(1023)) + ((_c & uint32(63)) << 10)) + (((_c & uint32(960)) + uint32(64)) << 10)
  6140  	}
  6141  	if _c < uint32(128) {
  6142  		*postInc15(&_z, 1) = uint8(_c & uint32(255))
  6143  		goto _74
  6144  	}
  6145  	if _c < uint32(2048) {
  6146  		*postInc15(&_z, 1) = uint8(int32(192) + int32(uint8((_c>>6)&uint32(31))))
  6147  		*postInc15(&_z, 1) = uint8(int32(128) + int32(uint8(_c&uint32(63))))
  6148  		goto _74
  6149  	}
  6150  	if _c < uint32(65536) {
  6151  		*postInc15(&_z, 1) = uint8(int32(224) + int32(uint8((_c>>12)&uint32(15))))
  6152  		*postInc15(&_z, 1) = uint8(int32(128) + int32(uint8((_c>>6)&uint32(63))))
  6153  		*postInc15(&_z, 1) = uint8(int32(128) + int32(uint8(_c&uint32(63))))
  6154  		goto _74
  6155  	}
  6156  	*postInc15(&_z, 1) = uint8(int32(240) + int32(uint8((_c>>18)&uint32(7))))
  6157  	*postInc15(&_z, 1) = uint8(int32(128) + int32(uint8((_c>>12)&uint32(63))))
  6158  	*postInc15(&_z, 1) = uint8(int32(128) + int32(uint8((_c>>6)&uint32(63))))
  6159  	*postInc15(&_z, 1) = uint8(int32(128) + int32(uint8(_c&uint32(63))))
  6160  _74:
  6161  	goto _64
  6162  _65:
  6163  _63:
  6164  	_pMem.Xn = int32(uintptr(unsafe.Pointer(_z)) - uintptr(unsafe.Pointer(_zOut)))
  6165  _48:
  6166  	*_z = 0
  6167  	func() {
  6168  		if (_pMem.Xn + func() int32 {
  6169  			if int32(_desiredEnc) == int32(1) {
  6170  				return int32(1)
  6171  			}
  6172  			return int32(2)
  6173  		}()) > _len {
  6174  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27438), unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000), unsafe.Pointer(str(5981)))
  6175  			crt.X__builtin_abort(tls)
  6176  		}
  6177  	}()
  6178  	_c = uint32(_pMem.Xflags)
  6179  	_sqlite3VdbeMemRelease(tls, _pMem)
  6180  	_pMem.Xflags = uint16(uint32(514) | (_c & uint32(32799)))
  6181  	_pMem.Xenc = _desiredEnc
  6182  	_pMem.Xz = (*int8)(unsafe.Pointer(_zOut))
  6183  	_pMem.XzMalloc = _pMem.Xz
  6184  	_pMem.XszMalloc = _sqlite3DbMallocSize(tls, (*Xsqlite3)(_pMem.Xdb), unsafe.Pointer(_pMem.Xz))
  6185  _translate_out:
  6186  	return int32(0)
  6187  }
  6188  
  6189  var _sqlite3VdbeMemTranslateØ00__func__Ø000 [24]int8
  6190  
  6191  func init() {
  6192  	crt.Xstrncpy(nil, &_sqlite3VdbeMemTranslateØ00__func__Ø000[0], str(6026), 24)
  6193  }
  6194  
  6195  // C comment
  6196  //  /*
  6197  //  ** Change pMem so that its MEM_Str or MEM_Blob value is stored in
  6198  //  ** MEM.zMalloc, where it can be safely written.
  6199  //  **
  6200  //  ** Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails.
  6201  //  */
  6202  func _sqlite3VdbeMemMakeWriteable(tls *crt.TLS, _pMem *XMem) (r0 int32) {
  6203  	func() {
  6204  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
  6205  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69895), unsafe.Pointer(&_sqlite3VdbeMemMakeWriteableØ00__func__Ø000), unsafe.Pointer(str(4568)))
  6206  			crt.X__builtin_abort(tls)
  6207  		}
  6208  	}()
  6209  	func() {
  6210  		if (int32(_pMem.Xflags) & int32(32)) != int32(0) {
  6211  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69896), unsafe.Pointer(&_sqlite3VdbeMemMakeWriteableØ00__func__Ø000), unsafe.Pointer(str(4540)))
  6212  			crt.X__builtin_abort(tls)
  6213  		}
  6214  	}()
  6215  	if (int32(_pMem.Xflags) & int32(18)) == int32(0) {
  6216  		goto _5
  6217  	}
  6218  	if func() int32 {
  6219  		if (int32(_pMem.Xflags) & int32(16384)) != 0 {
  6220  			return _sqlite3VdbeMemExpandBlob(tls, _pMem)
  6221  		}
  6222  		return int32(0)
  6223  	}() != 0 {
  6224  		return int32(7)
  6225  	}
  6226  	if _pMem.XszMalloc != int32(0) && _pMem.Xz == _pMem.XzMalloc {
  6227  		goto _10
  6228  	}
  6229  	if _sqlite3VdbeMemGrow(tls, _pMem, _pMem.Xn+int32(2), int32(1)) != 0 {
  6230  		return _sqlite3NomemError(tls, int32(69901))
  6231  	}
  6232  	*elem1(_pMem.Xz, uintptr(_pMem.Xn)) = 0
  6233  	*elem1(_pMem.Xz, uintptr(_pMem.Xn+int32(1))) = 0
  6234  	{
  6235  		p := &_pMem.Xflags
  6236  		*p = uint16(int32(*p) | int32(512))
  6237  	}
  6238  _10:
  6239  _5:
  6240  	{
  6241  		p := &_pMem.Xflags
  6242  		*p = uint16(int32(*p) & int32(-4097))
  6243  	}
  6244  	*(**XMem)(unsafe.Pointer(&_pMem.XpScopyFrom)) = nil
  6245  	return int32(0)
  6246  }
  6247  
  6248  var _sqlite3VdbeMemMakeWriteableØ00__func__Ø000 [28]int8
  6249  
  6250  func init() {
  6251  	crt.Xstrncpy(nil, &_sqlite3VdbeMemMakeWriteableØ00__func__Ø000[0], str(6050), 28)
  6252  }
  6253  
  6254  // C comment
  6255  //  /*
  6256  //  ** This lookup table is used to help decode the first byte of
  6257  //  ** a multi-byte UTF8 character.
  6258  //  */
  6259  var _sqlite3Utf8Trans1 [64]uint8
  6260  
  6261  func init() {
  6262  	_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}
  6263  }
  6264  
  6265  // C comment
  6266  //  /*
  6267  //  ** Release any memory resources held by the Mem.  Both the memory that is
  6268  //  ** free by Mem.xDel and the Mem.zMalloc allocation are freed.
  6269  //  **
  6270  //  ** Use this routine prior to clean up prior to abandoning a Mem, or to
  6271  //  ** reset a Mem back to its minimum memory utilization.
  6272  //  **
  6273  //  ** Use sqlite3VdbeMemSetNull() to release just the Mem.xDel space
  6274  //  ** prior to inserting new content into the Mem.
  6275  //  */
  6276  func _sqlite3VdbeMemRelease(tls *crt.TLS, _p *XMem) {
  6277  	func() {
  6278  		if _sqlite3VdbeCheckMemInvariants(tls, _p) == 0 {
  6279  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70115), unsafe.Pointer(&_sqlite3VdbeMemReleaseØ00__func__Ø000), unsafe.Pointer(str(6078)))
  6280  			crt.X__builtin_abort(tls)
  6281  		}
  6282  	}()
  6283  	if ((int32(_p.Xflags) & int32(9312)) != int32(0)) || _p.XszMalloc != 0 {
  6284  		_vdbeMemClear(tls, _p)
  6285  	}
  6286  }
  6287  
  6288  var _sqlite3VdbeMemReleaseØ00__func__Ø000 [22]int8
  6289  
  6290  func init() {
  6291  	crt.Xstrncpy(nil, &_sqlite3VdbeMemReleaseØ00__func__Ø000[0], str(6111), 22)
  6292  }
  6293  
  6294  // C comment
  6295  //  /*
  6296  //  ** Release memory held by the Mem p, both external memory cleared
  6297  //  ** by p->xDel and memory in p->zMalloc.
  6298  //  **
  6299  //  ** This is a helper routine invoked by sqlite3VdbeMemRelease() in
  6300  //  ** the unusual case where there really is memory in p that needs
  6301  //  ** to be freed.
  6302  //  */
  6303  func _vdbeMemClear(tls *crt.TLS, _p *XMem) {
  6304  	if (int32(_p.Xflags) & int32(9312)) != int32(0) {
  6305  		_vdbeMemClearExternAndSetNull(tls, _p)
  6306  	}
  6307  	if _p.XszMalloc != 0 {
  6308  		_sqlite3DbFreeNN(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(_p.XzMalloc))
  6309  		_p.XszMalloc = int32(0)
  6310  	}
  6311  	_p.Xz = nil
  6312  }
  6313  
  6314  // C comment
  6315  //  /*
  6316  //  ** Make sure the given Mem is \u0000 terminated.
  6317  //  */
  6318  func _sqlite3VdbeMemNulTerminate(tls *crt.TLS, _pMem *XMem) (r0 int32) {
  6319  	func() {
  6320  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
  6321  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69962), unsafe.Pointer(&_sqlite3VdbeMemNulTerminateØ00__func__Ø000), unsafe.Pointer(str(4568)))
  6322  			crt.X__builtin_abort(tls)
  6323  		}
  6324  	}()
  6325  	if (int32(_pMem.Xflags) & int32(514)) != int32(2) {
  6326  		return int32(0)
  6327  	}
  6328  	return _vdbeMemAddTerminator(tls, _pMem)
  6329  }
  6330  
  6331  var _sqlite3VdbeMemNulTerminateØ00__func__Ø000 [27]int8
  6332  
  6333  func init() {
  6334  	crt.Xstrncpy(nil, &_sqlite3VdbeMemNulTerminateØ00__func__Ø000[0], str(6133), 27)
  6335  }
  6336  
  6337  // C comment
  6338  //  /*
  6339  //  ** It is already known that pMem contains an unterminated string.
  6340  //  ** Add the zero terminator.
  6341  //  */
  6342  func _vdbeMemAddTerminator(tls *crt.TLS, _pMem *XMem) (r0 int32) {
  6343  	if _sqlite3VdbeMemGrow(tls, _pMem, _pMem.Xn+int32(2), int32(1)) != 0 {
  6344  		return _sqlite3NomemError(tls, int32(69950))
  6345  	}
  6346  	*elem1(_pMem.Xz, uintptr(_pMem.Xn)) = 0
  6347  	*elem1(_pMem.Xz, uintptr(_pMem.Xn+int32(1))) = 0
  6348  	{
  6349  		p := &_pMem.Xflags
  6350  		*p = uint16(int32(*p) | int32(512))
  6351  	}
  6352  	return int32(0)
  6353  }
  6354  
  6355  // C comment
  6356  //  /*
  6357  //  ** Add MEM_Str to the set of representations for the given Mem.  Numbers
  6358  //  ** are converted using sqlite3_snprintf().  Converting a BLOB to a string
  6359  //  ** is a no-op.
  6360  //  **
  6361  //  ** Existing representations MEM_Int and MEM_Real are invalidated if
  6362  //  ** bForce is true but are retained if bForce is false.
  6363  //  **
  6364  //  ** A MEM_Null value will never be passed to this function. This function is
  6365  //  ** used for converting values to text for returning to the user (i.e. via
  6366  //  ** sqlite3_value_text()), or for ensuring that values to be used as btree
  6367  //  ** keys are strings. In the former case a NULL pointer is returned the
  6368  //  ** user and the latter is an internal programming error.
  6369  //  */
  6370  func _sqlite3VdbeMemStringify(tls *crt.TLS, _pMem *XMem, _enc uint8, _bForce uint8) (r0 int32) {
  6371  	var _fg, _nByte int32
  6372  	_fg = int32(_pMem.Xflags)
  6373  	_nByte = int32(32)
  6374  	func() {
  6375  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
  6376  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69990), unsafe.Pointer(&_sqlite3VdbeMemStringifyØ00__func__Ø000), unsafe.Pointer(str(4568)))
  6377  			crt.X__builtin_abort(tls)
  6378  		}
  6379  	}()
  6380  	func() {
  6381  		if (_fg & int32(16384)) != 0 {
  6382  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69991), unsafe.Pointer(&_sqlite3VdbeMemStringifyØ00__func__Ø000), unsafe.Pointer(str(6160)))
  6383  			crt.X__builtin_abort(tls)
  6384  		}
  6385  	}()
  6386  	func() {
  6387  		if (_fg & int32(18)) != 0 {
  6388  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69992), unsafe.Pointer(&_sqlite3VdbeMemStringifyØ00__func__Ø000), unsafe.Pointer(str(6175)))
  6389  			crt.X__builtin_abort(tls)
  6390  		}
  6391  	}()
  6392  	func() {
  6393  		if (_fg & int32(12)) == 0 {
  6394  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69993), unsafe.Pointer(&_sqlite3VdbeMemStringifyØ00__func__Ø000), unsafe.Pointer(str(6200)))
  6395  			crt.X__builtin_abort(tls)
  6396  		}
  6397  	}()
  6398  	func() {
  6399  		if (int32(_pMem.Xflags) & int32(32)) != int32(0) {
  6400  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69994), unsafe.Pointer(&_sqlite3VdbeMemStringifyØ00__func__Ø000), unsafe.Pointer(str(4540)))
  6401  			crt.X__builtin_abort(tls)
  6402  		}
  6403  	}()
  6404  	func() {
  6405  		if (int32(uintptr(unsafe.Pointer(_pMem))) & int32(7)) != int32(0) {
  6406  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69995), unsafe.Pointer(&_sqlite3VdbeMemStringifyØ00__func__Ø000), unsafe.Pointer(str(6222)))
  6407  			crt.X__builtin_abort(tls)
  6408  		}
  6409  	}()
  6410  	if _sqlite3VdbeMemClearAndResize(tls, _pMem, _nByte) != 0 {
  6411  		_pMem.Xenc = 0
  6412  		return _sqlite3NomemError(tls, int32(70000))
  6413  	}
  6414  	if (_fg & int32(4)) != 0 {
  6415  		Xsqlite3_snprintf(tls, _nByte, _pMem.Xz, str(6249), *(*int64)(unsafe.Pointer(&_pMem.Xu)))
  6416  		goto _15
  6417  	}
  6418  	func() {
  6419  		if (_fg & int32(8)) == 0 {
  6420  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70012), unsafe.Pointer(&_sqlite3VdbeMemStringifyØ00__func__Ø000), unsafe.Pointer(str(6254)))
  6421  			crt.X__builtin_abort(tls)
  6422  		}
  6423  	}()
  6424  	Xsqlite3_snprintf(tls, _nByte, _pMem.Xz, str(6268), *(*float64)(unsafe.Pointer(&_pMem.Xu)))
  6425  _15:
  6426  	_pMem.Xn = _sqlite3Strlen30(tls, _pMem.Xz)
  6427  	_pMem.Xenc = uint8(1)
  6428  	{
  6429  		p := &_pMem.Xflags
  6430  		*p = uint16(int32(*p) | int32(514))
  6431  	}
  6432  	if _bForce != 0 {
  6433  		{
  6434  			p := &_pMem.Xflags
  6435  			*p = uint16(int32(*p) & int32(-13))
  6436  		}
  6437  	}
  6438  	_sqlite3VdbeChangeEncoding(tls, _pMem, int32(_enc))
  6439  	return int32(0)
  6440  }
  6441  
  6442  var _sqlite3VdbeMemStringifyØ00__func__Ø000 [24]int8
  6443  
  6444  func init() {
  6445  	crt.Xstrncpy(nil, &_sqlite3VdbeMemStringifyØ00__func__Ø000[0], str(6275), 24)
  6446  }
  6447  
  6448  // C comment
  6449  //  /*
  6450  //  ** Change the pMem->zMalloc allocation to be at least szNew bytes.
  6451  //  ** If pMem->zMalloc already meets or exceeds the requested size, this
  6452  //  ** routine is a no-op.
  6453  //  **
  6454  //  ** Any prior string or blob content in the pMem object may be discarded.
  6455  //  ** The pMem->xDel destructor is called, if it exists.  Though MEM_Str
  6456  //  ** and MEM_Blob values may be discarded, MEM_Int, MEM_Real, and MEM_Null
  6457  //  ** values are preserved.
  6458  //  **
  6459  //  ** Return SQLITE_OK on success or an error code (probably SQLITE_NOMEM)
  6460  //  ** if unable to complete the resizing.
  6461  //  */
  6462  func _sqlite3VdbeMemClearAndResize(tls *crt.TLS, _pMem *XMem, _szNew int32) (r0 int32) {
  6463  	func() {
  6464  		if _szNew <= int32(0) {
  6465  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69877), unsafe.Pointer(&_sqlite3VdbeMemClearAndResizeØ00__func__Ø000), unsafe.Pointer(str(6299)))
  6466  			crt.X__builtin_abort(tls)
  6467  		}
  6468  	}()
  6469  	func() {
  6470  		if (int32(_pMem.Xflags)&int32(1024)) != int32(0) && _pMem.XszMalloc != int32(0) {
  6471  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69878), unsafe.Pointer(&_sqlite3VdbeMemClearAndResizeØ00__func__Ø000), unsafe.Pointer(str(6307)))
  6472  			crt.X__builtin_abort(tls)
  6473  		}
  6474  	}()
  6475  	if _pMem.XszMalloc < _szNew {
  6476  		return _sqlite3VdbeMemGrow(tls, _pMem, _szNew, int32(0))
  6477  	}
  6478  	func() {
  6479  		if (int32(_pMem.Xflags) & int32(1024)) != int32(0) {
  6480  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69882), unsafe.Pointer(&_sqlite3VdbeMemClearAndResizeØ00__func__Ø000), unsafe.Pointer(str(5572)))
  6481  			crt.X__builtin_abort(tls)
  6482  		}
  6483  	}()
  6484  	_pMem.Xz = _pMem.XzMalloc
  6485  	{
  6486  		p := &_pMem.Xflags
  6487  		*p = uint16(int32(*p) & int32(13))
  6488  	}
  6489  	return int32(0)
  6490  }
  6491  
  6492  var _sqlite3VdbeMemClearAndResizeØ00__func__Ø000 [29]int8
  6493  
  6494  func init() {
  6495  	crt.Xstrncpy(nil, &_sqlite3VdbeMemClearAndResizeØ00__func__Ø000[0], str(6355), 29)
  6496  }
  6497  
  6498  func Xsqlite3_snprintf(tls *crt.TLS, _n int32, _zBuf *int8, _zFormat *int8, args ...interface{}) (r0 *int8) {
  6499  	var _z *int8
  6500  	var _ap []interface{}
  6501  	_ap = args
  6502  	_z = Xsqlite3_vsnprintf(tls, _n, _zBuf, _zFormat, _ap)
  6503  	_ap = nil
  6504  	return _z
  6505  }
  6506  
  6507  // C comment
  6508  //  /*
  6509  //  ** sqlite3_snprintf() works like snprintf() except that it ignores the
  6510  //  ** current locale settings.  This is important for SQLite because we
  6511  //  ** are not able to use a "," as the decimal point in place of "." as
  6512  //  ** specified by some locales.
  6513  //  **
  6514  //  ** Oops:  The first two arguments of sqlite3_snprintf() are backwards
  6515  //  ** from the snprintf() standard.  Unfortunately, it is too late to change
  6516  //  ** this without breaking compatibility, so we just have to live with the
  6517  //  ** mistake.
  6518  //  **
  6519  //  ** sqlite3_vsnprintf() is the varargs version.
  6520  //  */
  6521  func Xsqlite3_vsnprintf(tls *crt.TLS, _n int32, _zBuf *int8, _zFormat *int8, _ap []interface{}) (r0 *int8) {
  6522  	var _acc XStrAccum
  6523  	if _n <= int32(0) {
  6524  		return _zBuf
  6525  	}
  6526  	if _zBuf != nil && _zFormat != nil {
  6527  		goto _2
  6528  	}
  6529  	_sqlite3MisuseError(tls, int32(26087))
  6530  	if _zBuf != nil {
  6531  		*elem1(_zBuf, 0) = 0
  6532  	}
  6533  	return _zBuf
  6534  
  6535  _2:
  6536  	_sqlite3StrAccumInit(tls, &_acc, nil, _zBuf, _n, int32(0))
  6537  	_sqlite3VXPrintf(tls, &_acc, _zFormat, _ap)
  6538  	*elem1(_zBuf, uintptr(_acc.XnChar)) = 0
  6539  	return _zBuf
  6540  }
  6541  
  6542  // C comment
  6543  //  /*
  6544  //  ** Extract the user data from a sqlite3_context structure and return a
  6545  //  ** pointer to it.
  6546  //  **
  6547  //  ** IMPLEMENTATION-OF: R-46798-50301 The sqlite3_context_db_handle() interface
  6548  //  ** returns a copy of the pointer to the database connection (the 1st
  6549  //  ** parameter) of the sqlite3_create_function() and
  6550  //  ** sqlite3_create_function16() routines that originally registered the
  6551  //  ** application defined function.
  6552  //  */
  6553  func Xsqlite3_context_db_handle(tls *crt.TLS, _p *Xsqlite3_context) (r0 *Xsqlite3) {
  6554  	func() {
  6555  		if _p == nil || _p.XpOut == nil {
  6556  			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)))
  6557  			crt.X__builtin_abort(tls)
  6558  		}
  6559  	}()
  6560  	return (*Xsqlite3)((*XMem)(_p.XpOut).Xdb)
  6561  }
  6562  
  6563  var _sqlite3_context_db_handleØ00__func__Ø000 [26]int8
  6564  
  6565  func init() {
  6566  	crt.Xstrncpy(nil, &_sqlite3_context_db_handleØ00__func__Ø000[0], str(6397), 26)
  6567  }
  6568  
  6569  // C comment
  6570  //  /*
  6571  //  ** Return the length (in bytes) of the token that begins at z[0].
  6572  //  ** Store the token type in *tokenType before returning.
  6573  //  */
  6574  func _sqlite3GetToken(tls *crt.TLS, _z *uint8, _tokenType *int32) (r0 int32) {
  6575  	var _i, _c, _35_delim, _58_n int32
  6576  	switch int32(*elem15((*uint8)(unsafe.Pointer(&_aiClass)), uintptr(*_z))) {
  6577  	case int32(0):
  6578  		goto _26
  6579  	case int32(1):
  6580  		goto _25
  6581  	case int32(2):
  6582  		goto _27
  6583  	case int32(3):
  6584  		goto _20
  6585  	case int32(4):
  6586  		goto _23
  6587  	case int32(5):
  6588  		goto _23
  6589  	case int32(6):
  6590  		goto _22
  6591  	case int32(7):
  6592  		goto _1
  6593  	case int32(8):
  6594  		goto _18
  6595  	case int32(9):
  6596  		goto _21
  6597  	case int32(10):
  6598  		goto _14
  6599  	case int32(11):
  6600  		goto _2
  6601  	case int32(12):
  6602  		goto _11
  6603  	case int32(13):
  6604  		goto _12
  6605  	case int32(14):
  6606  		goto _10
  6607  	case int32(15):
  6608  		goto _13
  6609  	case int32(16):
  6610  		goto _8
  6611  	case int32(17):
  6612  		goto _3
  6613  	case int32(18):
  6614  		goto _4
  6615  	case int32(19):
  6616  		goto _5
  6617  	case int32(20):
  6618  		goto _6
  6619  	case int32(21):
  6620  		goto _7
  6621  	case int32(22):
  6622  		goto _9
  6623  	case int32(23):
  6624  		goto _15
  6625  	case int32(24):
  6626  		goto _16
  6627  	case int32(25):
  6628  		goto _17
  6629  	case int32(26):
  6630  		goto _19
  6631  	default:
  6632  		goto _28
  6633  	}
  6634  
  6635  _1:
  6636  	_i = int32(1)
  6637  _29:
  6638  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(_i))))) & int32(1)) == 0 {
  6639  		goto _32
  6640  	}
  6641  	_i += 1
  6642  	goto _29
  6643  _32:
  6644  	*_tokenType = int32(163)
  6645  	return _i
  6646  
  6647  _2:
  6648  	if int32(*elem15(_z, uintptr(1))) != int32(45) {
  6649  		goto _33
  6650  	}
  6651  	_i = int32(2)
  6652  _34:
  6653  	if store2(&_c, int32(*elem15(_z, uintptr(_i)))) == int32(0) || _c == int32(10) {
  6654  		goto _38
  6655  	}
  6656  	_i += 1
  6657  	goto _34
  6658  _38:
  6659  	*_tokenType = int32(163)
  6660  	return _i
  6661  
  6662  _33:
  6663  	*_tokenType = int32(89)
  6664  	return int32(1)
  6665  
  6666  _3:
  6667  	*_tokenType = int32(22)
  6668  	return int32(1)
  6669  
  6670  _4:
  6671  	*_tokenType = int32(23)
  6672  	return int32(1)
  6673  
  6674  _5:
  6675  	*_tokenType = int32(1)
  6676  	return int32(1)
  6677  
  6678  _6:
  6679  	*_tokenType = int32(88)
  6680  	return int32(1)
  6681  
  6682  _7:
  6683  	*_tokenType = int32(90)
  6684  	return int32(1)
  6685  
  6686  _8:
  6687  	if (int32(*elem15(_z, uintptr(1))) != int32(42)) || (int32(*elem15(_z, uintptr(2))) == int32(0)) {
  6688  		*_tokenType = int32(91)
  6689  		return int32(1)
  6690  	}
  6691  	*func() *int32 { _i = int32(3); return &_c }() = int32(*elem15(_z, uintptr(2)))
  6692  _41:
  6693  	if _c == int32(42) && int32(*elem15(_z, uintptr(_i))) == int32(47) || store2(&_c, int32(*elem15(_z, uintptr(_i)))) == int32(0) {
  6694  		goto _46
  6695  	}
  6696  	_i += 1
  6697  	goto _41
  6698  _46:
  6699  	if _c != 0 {
  6700  		_i += 1
  6701  	}
  6702  	*_tokenType = int32(163)
  6703  	return _i
  6704  
  6705  _9:
  6706  	*_tokenType = int32(92)
  6707  	return int32(1)
  6708  
  6709  _10:
  6710  	*_tokenType = int32(78)
  6711  	return int32(1) + bool2int(int32(*elem15(_z, uintptr(1))) == int32(61))
  6712  
  6713  _11:
  6714  	if store2(&_c, int32(*elem15(_z, uintptr(1)))) == int32(61) {
  6715  		*_tokenType = int32(80)
  6716  		return int32(2)
  6717  	}
  6718  	if _c == int32(62) {
  6719  		*_tokenType = int32(77)
  6720  		return int32(2)
  6721  	}
  6722  	if _c == int32(60) {
  6723  		*_tokenType = int32(86)
  6724  		return int32(2)
  6725  	}
  6726  	*_tokenType = int32(81)
  6727  	return int32(1)
  6728  
  6729  _12:
  6730  	if store2(&_c, int32(*elem15(_z, uintptr(1)))) == int32(61) {
  6731  		*_tokenType = int32(82)
  6732  		return int32(2)
  6733  	}
  6734  	if _c == int32(62) {
  6735  		*_tokenType = int32(87)
  6736  		return int32(2)
  6737  	}
  6738  	*_tokenType = int32(79)
  6739  	return int32(1)
  6740  
  6741  _13:
  6742  	if int32(*elem15(_z, uintptr(1))) != int32(61) {
  6743  		*_tokenType = int32(164)
  6744  		return int32(1)
  6745  	}
  6746  	*_tokenType = int32(77)
  6747  	return int32(2)
  6748  
  6749  _14:
  6750  	if int32(*elem15(_z, uintptr(1))) != int32(124) {
  6751  		*_tokenType = int32(85)
  6752  		return int32(1)
  6753  	}
  6754  	*_tokenType = int32(93)
  6755  	return int32(2)
  6756  
  6757  _15:
  6758  	*_tokenType = int32(26)
  6759  	return int32(1)
  6760  
  6761  _16:
  6762  	*_tokenType = int32(84)
  6763  	return int32(1)
  6764  
  6765  _17:
  6766  	*_tokenType = int32(95)
  6767  	return int32(1)
  6768  
  6769  _18:
  6770  	_35_delim = int32(*elem15(_z, 0))
  6771  	_i = int32(1)
  6772  _62:
  6773  	if store2(&_c, int32(*elem15(_z, uintptr(_i)))) == int32(0) {
  6774  		goto _65
  6775  	}
  6776  	if _c != _35_delim {
  6777  		goto _66
  6778  	}
  6779  	if int32(*elem15(_z, uintptr(_i+int32(1)))) == _35_delim {
  6780  		_i += 1
  6781  		goto _68
  6782  	}
  6783  	goto _65
  6784  _68:
  6785  _66:
  6786  	_i += 1
  6787  	goto _62
  6788  _65:
  6789  	if _c == int32(39) {
  6790  		*_tokenType = int32(97)
  6791  		return _i + int32(1)
  6792  	}
  6793  	if _c != int32(0) {
  6794  		*_tokenType = int32(27)
  6795  		return _i + int32(1)
  6796  	}
  6797  	*_tokenType = int32(164)
  6798  	return _i
  6799  
  6800  _19:
  6801  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(1))))) & int32(4)) == 0 {
  6802  		*_tokenType = int32(122)
  6803  		return int32(1)
  6804  	}
  6805  _20:
  6806  	*_tokenType = int32(134)
  6807  	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 {
  6808  		goto _77
  6809  	}
  6810  	_i = int32(3)
  6811  _78:
  6812  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(_i))))) & int32(8)) == 0 {
  6813  		goto _81
  6814  	}
  6815  	_i += 1
  6816  	goto _78
  6817  _81:
  6818  	return _i
  6819  
  6820  _77:
  6821  	_i = int32(0)
  6822  _82:
  6823  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(_i))))) & int32(4)) == 0 {
  6824  		goto _85
  6825  	}
  6826  	_i += 1
  6827  	goto _82
  6828  _85:
  6829  	if int32(*elem15(_z, uintptr(_i))) != int32(46) {
  6830  		goto _86
  6831  	}
  6832  	_i += 1
  6833  _87:
  6834  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(_i))))) & int32(4)) != 0 {
  6835  		_i += 1
  6836  		goto _87
  6837  	}
  6838  	*_tokenType = int32(132)
  6839  _86:
  6840  	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) {
  6841  		goto _94
  6842  	}
  6843  	_i += int32(2)
  6844  _95:
  6845  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(_i))))) & int32(4)) != 0 {
  6846  		_i += 1
  6847  		goto _95
  6848  	}
  6849  	*_tokenType = int32(132)
  6850  _94:
  6851  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(_i))))) & int32(70)) != int32(0) {
  6852  		*_tokenType = int32(164)
  6853  		_i += 1
  6854  		goto _94
  6855  	}
  6856  	return _i
  6857  
  6858  _21:
  6859  	*func() *int32 { _i = int32(1); return &_c }() = int32(*elem15(_z, 0))
  6860  _99:
  6861  	if _c == int32(93) || store2(&_c, int32(*elem15(_z, uintptr(_i)))) == int32(0) {
  6862  		goto _103
  6863  	}
  6864  	_i += 1
  6865  	goto _99
  6866  _103:
  6867  	*_tokenType = func() int32 {
  6868  		if _c == int32(93) {
  6869  			return int32(27)
  6870  		}
  6871  		return int32(164)
  6872  	}()
  6873  	return _i
  6874  
  6875  _22:
  6876  	*_tokenType = int32(135)
  6877  	_i = int32(1)
  6878  _106:
  6879  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(_i))))) & int32(4)) == 0 {
  6880  		goto _109
  6881  	}
  6882  	_i += 1
  6883  	goto _106
  6884  _109:
  6885  	return _i
  6886  
  6887  _23:
  6888  	_58_n = int32(0)
  6889  	*_tokenType = int32(135)
  6890  	_i = int32(1)
  6891  _110:
  6892  	if store2(&_c, int32(*elem15(_z, uintptr(_i)))) == int32(0) {
  6893  		goto _113
  6894  	}
  6895  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(_c)))) & int32(70)) != int32(0) {
  6896  		_58_n += 1
  6897  		goto _126
  6898  	}
  6899  	if _c != int32(40) || _58_n <= int32(0) {
  6900  		goto _117
  6901  	}
  6902  _118:
  6903  	_i += 1
  6904  	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)) {
  6905  		goto _118
  6906  	}
  6907  	if _c == int32(41) {
  6908  		_i += 1
  6909  		goto _122
  6910  	}
  6911  	*_tokenType = int32(164)
  6912  _122:
  6913  	goto _113
  6914  _117:
  6915  	if (_c == int32(58)) && (int32(*elem15(_z, uintptr(_i+int32(1)))) == int32(58)) {
  6916  		_i += 1
  6917  		goto _126
  6918  	}
  6919  	goto _113
  6920  _126:
  6921  	_i += 1
  6922  	goto _110
  6923  _113:
  6924  	if _58_n == int32(0) {
  6925  		*_tokenType = int32(164)
  6926  	}
  6927  	return _i
  6928  
  6929  _25:
  6930  	_i = int32(1)
  6931  _128:
  6932  	if int32(*elem15((*uint8)(unsafe.Pointer(&_aiClass)), uintptr(*elem15(_z, uintptr(_i))))) > int32(1) {
  6933  		goto _131
  6934  	}
  6935  	_i += 1
  6936  	goto _128
  6937  _131:
  6938  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(_i))))) & int32(70)) != int32(0) {
  6939  		_i += 1
  6940  		goto _133
  6941  	}
  6942  	*_tokenType = int32(27)
  6943  	return _keywordCode(tls, (*int8)(unsafe.Pointer(_z)), _i, _tokenType)
  6944  
  6945  _26:
  6946  	if int32(*elem15(_z, uintptr(1))) != int32(39) {
  6947  		goto _134
  6948  	}
  6949  	*_tokenType = int32(133)
  6950  	_i = int32(2)
  6951  _135:
  6952  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(_i))))) & int32(8)) == 0 {
  6953  		goto _138
  6954  	}
  6955  	_i += 1
  6956  	goto _135
  6957  _138:
  6958  	if int32(*elem15(_z, uintptr(_i))) == int32(39) && (_i%int32(2)) == 0 {
  6959  		goto _140
  6960  	}
  6961  	*_tokenType = int32(164)
  6962  _141:
  6963  	if ((*elem15(_z, uintptr(_i))) != 0) && (int32(*elem15(_z, uintptr(_i))) != int32(39)) {
  6964  		_i += 1
  6965  		goto _141
  6966  	}
  6967  _140:
  6968  	if (*elem15(_z, uintptr(_i))) != 0 {
  6969  		_i += 1
  6970  	}
  6971  	return _i
  6972  
  6973  _134:
  6974  _27:
  6975  	_i = int32(1)
  6976  	goto _133
  6977  _28:
  6978  	*_tokenType = int32(164)
  6979  	return int32(1)
  6980  
  6981  _133:
  6982  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_z, uintptr(_i))))) & int32(70)) != int32(0) {
  6983  		_i += 1
  6984  		goto _133
  6985  	}
  6986  	*_tokenType = int32(27)
  6987  	return _i
  6988  }
  6989  
  6990  var _aiClass [256]uint8
  6991  
  6992  func init() {
  6993  	_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}
  6994  }
  6995  
  6996  var _sqlite3CtypeMap [256]uint8
  6997  
  6998  func init() {
  6999  	_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}
  7000  }
  7001  
  7002  // C comment
  7003  //  /*
  7004  //  ** The sqlite3KeywordCode function looks up an identifier to determine if
  7005  //  ** it is a keyword.  If it is a keyword, the token code of that keyword is
  7006  //  ** returned.  If the input is not a keyword, TK_ID is returned.
  7007  //  **
  7008  //  ** The implementation of this routine was generated by a program,
  7009  //  ** mkkeywordhash.c, located in the tool subdirectory of the distribution.
  7010  //  ** The output of the mkkeywordhash.c program is written into a file
  7011  //  ** named keywordhash.h and then included into this source file by
  7012  //  ** the #include below.
  7013  //  */
  7014  //  /************** Include keywordhash.h in the middle of tokenize.c ************/
  7015  //  /************** Begin file keywordhash.h *************************************/
  7016  //  /***** This file contains automatically generated code ******
  7017  //  **
  7018  //  ** The code in this file has been automatically generated by
  7019  //  **
  7020  //  **   sqlite/tool/mkkeywordhash.c
  7021  //  **
  7022  //  ** The code in this file implements a function that determines whether
  7023  //  ** or not a given identifier is really an SQL keyword.  The same thing
  7024  //  ** might be implemented more directly using a hand-written hash table.
  7025  //  ** But by using this automatically generated code, the size of the code
  7026  //  ** is substantially reduced.  This is important for embedded applications
  7027  //  ** on platforms with limited memory.
  7028  //  */
  7029  //  /* Hash score: 182 */
  7030  func _keywordCode(tls *crt.TLS, _z *int8, _n int32, _pType *int32) (r0 int32) {
  7031  	var _i, _j int32
  7032  	var _zKW *int8
  7033  	if _n < int32(2) {
  7034  		goto _0
  7035  	}
  7036  	_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)
  7037  	_i = int32(*elem15((*uint8)(unsafe.Pointer(&_keywordCodeØ00aHashØ002)), uintptr(_i))) - int32(1)
  7038  _1:
  7039  	if _i < int32(0) {
  7040  		goto _4
  7041  	}
  7042  	if int32(*elem15((*uint8)(unsafe.Pointer(&_keywordCodeØ00aLenØ004)), uintptr(_i))) != _n {
  7043  		goto _2
  7044  	}
  7045  	_j = int32(0)
  7046  	_zKW = elem1((*int8)(unsafe.Pointer(&_keywordCodeØ00zTextØ001)), uintptr(*elem20((*uint16)(unsafe.Pointer(&_keywordCodeØ00aOffsetØ005)), uintptr(_i))))
  7047  _6:
  7048  	if (_j < _n) && ((int32(*elem1(_z, uintptr(_j))) & int32(-33)) == int32(*elem1(_zKW, uintptr(_j)))) {
  7049  		_j += 1
  7050  		goto _6
  7051  	}
  7052  	if _j < _n {
  7053  		goto _2
  7054  	}
  7055  	*_pType = int32(*elem15((*uint8)(unsafe.Pointer(&_keywordCodeØ00aCodeØ006)), uintptr(_i)))
  7056  	goto _4
  7057  _2:
  7058  	_i = int32(*elem15((*uint8)(unsafe.Pointer(&_keywordCodeØ00aNextØ003)), uintptr(_i))) - int32(1)
  7059  	goto _1
  7060  _4:
  7061  _0:
  7062  	return _n
  7063  }
  7064  
  7065  var _keywordCodeØ00aHashØ002 [127]uint8
  7066  
  7067  func init() {
  7068  	_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}
  7069  }
  7070  
  7071  var _keywordCodeØ00aLenØ004 [124]uint8
  7072  
  7073  func init() {
  7074  	_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}
  7075  }
  7076  
  7077  var _keywordCodeØ00zTextØ001 [553]int8
  7078  
  7079  func init() {
  7080  	_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}
  7081  }
  7082  
  7083  var _keywordCodeØ00aOffsetØ005 [124]uint16
  7084  
  7085  func init() {
  7086  	_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)}
  7087  }
  7088  
  7089  var _keywordCodeØ00aCodeØ006 [124]uint8
  7090  
  7091  func init() {
  7092  	_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}
  7093  }
  7094  
  7095  var _keywordCodeØ00aNextØ003 [124]uint8
  7096  
  7097  func init() {
  7098  	_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}
  7099  }
  7100  
  7101  var _renameTableFuncØ00__func__Ø000 [16]int8
  7102  
  7103  func init() {
  7104  	crt.Xstrncpy(nil, &_renameTableFuncØ00__func__Ø000[0], str(6423), 16)
  7105  }
  7106  
  7107  // C comment
  7108  //  /*
  7109  //  ** Print into memory obtained from sqliteMalloc().  Use the internal
  7110  //  ** %-conversion extensions.
  7111  //  */
  7112  func _sqlite3MPrintf(tls *crt.TLS, _db *Xsqlite3, _zFormat *int8, args ...interface{}) (r0 *int8) {
  7113  	var _z *int8
  7114  	var _ap []interface{}
  7115  	_ap = args
  7116  	_z = _sqlite3VMPrintf(tls, _db, _zFormat, _ap)
  7117  	_ap = nil
  7118  	return _z
  7119  }
  7120  
  7121  // C comment
  7122  //  /*
  7123  //  ** Print into memory obtained from sqliteMalloc().  Use the internal
  7124  //  ** %-conversion extensions.
  7125  //  */
  7126  func _sqlite3VMPrintf(tls *crt.TLS, _db *Xsqlite3, _zFormat *int8, _ap []interface{}) (r0 *int8) {
  7127  	var _z *int8
  7128  	var _acc XStrAccum
  7129  	var _zBase [70]int8
  7130  	func() {
  7131  		if _db == nil {
  7132  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(26004), unsafe.Pointer(&_sqlite3VMPrintfØ00__func__Ø000), unsafe.Pointer(str(1219)))
  7133  			crt.X__builtin_abort(tls)
  7134  		}
  7135  	}()
  7136  	_sqlite3StrAccumInit(tls, &_acc, _db, (*int8)(unsafe.Pointer(&_zBase)), int32(70), *elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), 0))
  7137  	_acc.XprintfFlags = uint8(1)
  7138  	_sqlite3VXPrintf(tls, &_acc, _zFormat, _ap)
  7139  	_z = _sqlite3StrAccumFinish(tls, &_acc)
  7140  	if int32(_acc.XaccError) == int32(1) {
  7141  		_sqlite3OomFault(tls, _db)
  7142  	}
  7143  	return _z
  7144  
  7145  	_ = _zBase
  7146  	panic(0)
  7147  }
  7148  
  7149  var _sqlite3VMPrintfØ00__func__Ø000 [16]int8
  7150  
  7151  func init() {
  7152  	crt.Xstrncpy(nil, &_sqlite3VMPrintfØ00__func__Ø000[0], str(6439), 16)
  7153  }
  7154  
  7155  func _sqlite3StrAccumFinish(tls *crt.TLS, _p *XStrAccum) (r0 *int8) {
  7156  	if _p.XzText == nil {
  7157  		goto _0
  7158  	}
  7159  	func() {
  7160  		if (_p.XzText == _p.XzBase) != ((int32(_p.XprintfFlags) & int32(4)) == int32(0)) {
  7161  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25951), unsafe.Pointer(&_sqlite3StrAccumFinishØ00__func__Ø000), unsafe.Pointer(str(6455)))
  7162  			crt.X__builtin_abort(tls)
  7163  		}
  7164  	}()
  7165  	*elem1(_p.XzText, uintptr(_p.XnChar)) = 0
  7166  	if (_p.XmxAlloc > (0)) && ((int32(_p.XprintfFlags) & int32(4)) == int32(0)) {
  7167  		return _strAccumFinishRealloc(tls, _p)
  7168  	}
  7169  _0:
  7170  	return _p.XzText
  7171  }
  7172  
  7173  var _sqlite3StrAccumFinishØ00__func__Ø000 [22]int8
  7174  
  7175  func init() {
  7176  	crt.Xstrncpy(nil, &_sqlite3StrAccumFinishØ00__func__Ø000[0], str(6492), 22)
  7177  }
  7178  
  7179  // C comment
  7180  //  /*
  7181  //  ** Finish off a string by making sure it is zero-terminated.
  7182  //  ** Return a pointer to the resulting string.  Return a NULL
  7183  //  ** pointer if any kind of error was encountered.
  7184  //  */
  7185  func _strAccumFinishRealloc(tls *crt.TLS, _p *XStrAccum) (r0 *int8) {
  7186  	func() {
  7187  		if _p.XmxAlloc <= (0) || (int32(_p.XprintfFlags)&int32(4)) != int32(0) {
  7188  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25939), unsafe.Pointer(&_strAccumFinishReallocØ00__func__Ø000), unsafe.Pointer(str(6514)))
  7189  			crt.X__builtin_abort(tls)
  7190  		}
  7191  	}()
  7192  	_p.XzText = (*int8)(_sqlite3DbMallocRaw(tls, (*Xsqlite3)(_p.Xdb), uint64(_p.XnChar+uint32(1))))
  7193  	if _p.XzText != nil {
  7194  		crt.Xmemcpy(tls, unsafe.Pointer(_p.XzText), unsafe.Pointer(_p.XzBase), _p.XnChar+uint32(1))
  7195  		{
  7196  			p := &_p.XprintfFlags
  7197  			*p = uint8(int32(*p) | int32(4))
  7198  		}
  7199  		goto _4
  7200  	}
  7201  	_setStrAccumError(tls, _p, uint8(1))
  7202  _4:
  7203  	return _p.XzText
  7204  }
  7205  
  7206  var _strAccumFinishReallocØ00__func__Ø000 [22]int8
  7207  
  7208  func init() {
  7209  	crt.Xstrncpy(nil, &_strAccumFinishReallocØ00__func__Ø000[0], str(6545), 22)
  7210  }
  7211  
  7212  func Xsqlite3_result_text(tls *crt.TLS, _pCtx *Xsqlite3_context, _z *int8, _n int32, _xDel func(*crt.TLS, unsafe.Pointer)) {
  7213  	func() {
  7214  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
  7215  			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)))
  7216  			crt.X__builtin_abort(tls)
  7217  		}
  7218  	}()
  7219  	_setResultStrOrError(tls, _pCtx, _z, _n, uint8(1), _xDel)
  7220  }
  7221  
  7222  var _sqlite3_result_textØ00__func__Ø000 [20]int8
  7223  
  7224  func init() {
  7225  	crt.Xstrncpy(nil, &_sqlite3_result_textØ00__func__Ø000[0], str(6609), 20)
  7226  }
  7227  
  7228  // C comment
  7229  //  /**************************** sqlite3_result_  *******************************
  7230  //  ** The following routines are used by user-defined functions to specify
  7231  //  ** the function result.
  7232  //  **
  7233  //  ** The setStrOrError() function calls sqlite3VdbeMemSetStr() to store the
  7234  //  ** result as a string or blob but if the string or blob is too large, it
  7235  //  ** then sets the error code to SQLITE_TOOBIG
  7236  //  **
  7237  //  ** The invokeValueDestructor(P,X) routine invokes destructor function X()
  7238  //  ** on value P is not going to be used and need to be destroyed.
  7239  //  */
  7240  func _setResultStrOrError(tls *crt.TLS, _pCtx *Xsqlite3_context, _z *int8, _n int32, _enc uint8, _xDel func(*crt.TLS, unsafe.Pointer)) {
  7241  	if _sqlite3VdbeMemSetStr(tls, (*XMem)(_pCtx.XpOut), _z, _n, _enc, _xDel) == int32(18) {
  7242  		Xsqlite3_result_error_toobig(tls, _pCtx)
  7243  	}
  7244  }
  7245  
  7246  // C comment
  7247  //  /*
  7248  //  ** Change the value of a Mem to be a string or a BLOB.
  7249  //  **
  7250  //  ** The memory management strategy depends on the value of the xDel
  7251  //  ** parameter. If the value passed is SQLITE_TRANSIENT, then the
  7252  //  ** string is copied into a (possibly existing) buffer managed by the
  7253  //  ** Mem structure. Otherwise, any existing buffer is freed and the
  7254  //  ** pointer copied.
  7255  //  **
  7256  //  ** If the string is too large (if it exceeds the SQLITE_LIMIT_LENGTH
  7257  //  ** size limit) then no memory allocation occurs.  If the string can be
  7258  //  ** stored without allocating memory, then it is.  If a memory allocation
  7259  //  ** is required to store the string, then value of pMem is unchanged.  In
  7260  //  ** either case, SQLITE_TOOBIG is returned.
  7261  //  */
  7262  func _sqlite3VdbeMemSetStr(tls *crt.TLS, _pMem *XMem, _z *int8, _n int32, _enc uint8, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
  7263  	var _nByte, _iLimit, _8_nAlloc int32
  7264  	var _flags uint16
  7265  	_nByte = _n
  7266  	_flags = uint16(0)
  7267  	func() {
  7268  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
  7269  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70571), unsafe.Pointer(&_sqlite3VdbeMemSetStrØ00__func__Ø000), unsafe.Pointer(str(4568)))
  7270  			crt.X__builtin_abort(tls)
  7271  		}
  7272  	}()
  7273  	func() {
  7274  		if (int32(_pMem.Xflags) & int32(32)) != int32(0) {
  7275  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70572), unsafe.Pointer(&_sqlite3VdbeMemSetStrØ00__func__Ø000), unsafe.Pointer(str(6629)))
  7276  			crt.X__builtin_abort(tls)
  7277  		}
  7278  	}()
  7279  	if _z == nil {
  7280  		_sqlite3VdbeMemSetNull(tls, _pMem)
  7281  		return int32(0)
  7282  	}
  7283  	if _pMem.Xdb != nil {
  7284  		_iLimit = *elem8((*int32)(unsafe.Pointer(&((*Xsqlite3)(_pMem.Xdb).XaLimit))), 0)
  7285  		goto _7
  7286  	}
  7287  	_iLimit = int32(1000000000)
  7288  _7:
  7289  	_flags = uint16(func() int32 {
  7290  		if int32(_enc) == int32(0) {
  7291  			return int32(16)
  7292  		}
  7293  		return int32(2)
  7294  	}())
  7295  	if _nByte >= int32(0) {
  7296  		goto _10
  7297  	}
  7298  	func() {
  7299  		if int32(_enc) == int32(0) {
  7300  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70587), unsafe.Pointer(&_sqlite3VdbeMemSetStrØ00__func__Ø000), unsafe.Pointer(str(6659)))
  7301  			crt.X__builtin_abort(tls)
  7302  		}
  7303  	}()
  7304  	if int32(_enc) != int32(1) {
  7305  		goto _13
  7306  	}
  7307  	_nByte = _sqlite3Strlen30(tls, _z)
  7308  	if _nByte > _iLimit {
  7309  		_nByte = _iLimit + int32(1)
  7310  	}
  7311  	goto _15
  7312  _13:
  7313  	_nByte = int32(0)
  7314  _16:
  7315  	if _nByte > _iLimit || (int32(*elem1(_z, uintptr(_nByte)))|int32(*elem1(_z, uintptr(_nByte+int32(1))))) == 0 {
  7316  		goto _20
  7317  	}
  7318  	_nByte += int32(2)
  7319  	goto _16
  7320  _20:
  7321  _15:
  7322  	{
  7323  		p := &_flags
  7324  		*p = uint16(int32(*p) | int32(512))
  7325  	}
  7326  _10:
  7327  	if *(*uintptr)(unsafe.Pointer(&struct {
  7328  		f func(*crt.TLS, unsafe.Pointer)
  7329  	}{_xDel})) != *(*uintptr)(unsafe.Pointer(&struct {
  7330  		f func(*crt.TLS, unsafe.Pointer)
  7331  	}{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))})) {
  7332  		goto _21
  7333  	}
  7334  	_8_nAlloc = _nByte
  7335  	if (int32(_flags) & int32(512)) != 0 {
  7336  		_8_nAlloc += func() int32 {
  7337  			if int32(_enc) == int32(1) {
  7338  				return int32(1)
  7339  			}
  7340  			return int32(2)
  7341  		}()
  7342  	}
  7343  	if _nByte > _iLimit {
  7344  		return int32(18)
  7345  	}
  7346  	if _sqlite3VdbeMemClearAndResize(tls, _pMem, func() int32 {
  7347  		if _8_nAlloc > int32(32) {
  7348  			return _8_nAlloc
  7349  		}
  7350  		return int32(32)
  7351  	}()) != 0 {
  7352  		return _sqlite3NomemError(tls, int32(70613))
  7353  	}
  7354  	crt.Xmemcpy(tls, unsafe.Pointer(_pMem.Xz), unsafe.Pointer(_z), uint32(_8_nAlloc))
  7355  	goto _31
  7356  _21:
  7357  	if *(*uintptr)(unsafe.Pointer(&struct {
  7358  		f func(*crt.TLS, unsafe.Pointer)
  7359  	}{_xDel})) == *(*uintptr)(unsafe.Pointer(&struct {
  7360  		f func(*crt.TLS, unsafe.Pointer)
  7361  	}{func() func(*crt.TLS, unsafe.Pointer) {
  7362  		v := _sqlite3MallocSize
  7363  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
  7364  	}()})) {
  7365  		_sqlite3VdbeMemRelease(tls, _pMem)
  7366  		_pMem.XzMalloc = store1(&_pMem.Xz, _z)
  7367  		_pMem.XszMalloc = _sqlite3DbMallocSize(tls, (*Xsqlite3)(_pMem.Xdb), unsafe.Pointer(_pMem.XzMalloc))
  7368  		goto _31
  7369  	}
  7370  	_sqlite3VdbeMemRelease(tls, _pMem)
  7371  	_pMem.Xz = _z
  7372  	_pMem.XxDel = _xDel
  7373  	{
  7374  		p := &_flags
  7375  		*p = uint16(int32(*p) | func() int32 {
  7376  			if _xDel == nil {
  7377  				return int32(2048)
  7378  			}
  7379  			return int32(1024)
  7380  		}())
  7381  	}
  7382  _31:
  7383  	_pMem.Xn = _nByte
  7384  	_pMem.Xflags = _flags
  7385  	_pMem.Xenc = uint8(func() int32 {
  7386  		if int32(_enc) == int32(0) {
  7387  			return int32(1)
  7388  		}
  7389  		return int32(_enc)
  7390  	}())
  7391  	if (int32(_pMem.Xenc) != int32(1)) && _sqlite3VdbeMemHandleBom(tls, _pMem) != 0 {
  7392  		return _sqlite3NomemError(tls, int32(70633))
  7393  	}
  7394  	if _nByte > _iLimit {
  7395  		return int32(18)
  7396  	}
  7397  	return int32(0)
  7398  }
  7399  
  7400  var _sqlite3VdbeMemSetStrØ00__func__Ø000 [21]int8
  7401  
  7402  func init() {
  7403  	crt.Xstrncpy(nil, &_sqlite3VdbeMemSetStrØ00__func__Ø000[0], str(6666), 21)
  7404  }
  7405  
  7406  // C comment
  7407  //  /*
  7408  //  ** This routine checks for a byte-order mark at the beginning of the
  7409  //  ** UTF-16 string stored in *pMem. If one is present, it is removed and
  7410  //  ** the encoding of the Mem adjusted. This routine does not do any
  7411  //  ** byte-swapping, it just sets Mem.enc appropriately.
  7412  //  **
  7413  //  ** The allocation (static, dynamic etc.) and encoding of the Mem may be
  7414  //  ** changed by this function.
  7415  //  */
  7416  func _sqlite3VdbeMemHandleBom(tls *crt.TLS, _pMem *XMem) (r0 int32) {
  7417  	var _rc int32
  7418  	var _bom, _1_b1, _1_b2 uint8
  7419  	_rc = int32(0)
  7420  	_bom = uint8(0)
  7421  	func() {
  7422  		if _pMem.Xn < int32(0) {
  7423  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27472), unsafe.Pointer(&_sqlite3VdbeMemHandleBomØ00__func__Ø000), unsafe.Pointer(str(5902)))
  7424  			crt.X__builtin_abort(tls)
  7425  		}
  7426  	}()
  7427  	if _pMem.Xn <= int32(1) {
  7428  		goto _2
  7429  	}
  7430  	_1_b1 = *(*uint8)(unsafe.Pointer(_pMem.Xz))
  7431  	_1_b2 = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMem.Xz)) + uintptr(int32(1))))
  7432  	if (int32(_1_b1) == int32(254)) && (int32(_1_b2) == int32(255)) {
  7433  		_bom = uint8(3)
  7434  	}
  7435  	if (int32(_1_b1) == int32(255)) && (int32(_1_b2) == int32(254)) {
  7436  		_bom = uint8(2)
  7437  	}
  7438  _2:
  7439  	if _bom == 0 {
  7440  		goto _7
  7441  	}
  7442  	_rc = _sqlite3VdbeMemMakeWriteable(tls, _pMem)
  7443  	if _rc == int32(0) {
  7444  		_pMem.Xn -= int32(2)
  7445  		crt.Xmemmove(tls, unsafe.Pointer(_pMem.Xz), unsafe.Pointer(elem1(_pMem.Xz, uintptr(2))), uint32(_pMem.Xn))
  7446  		*elem1(_pMem.Xz, uintptr(_pMem.Xn)) = 0
  7447  		*elem1(_pMem.Xz, uintptr(_pMem.Xn+int32(1))) = 0
  7448  		{
  7449  			p := &_pMem.Xflags
  7450  			*p = uint16(int32(*p) | int32(512))
  7451  		}
  7452  		_pMem.Xenc = _bom
  7453  	}
  7454  _7:
  7455  	return _rc
  7456  }
  7457  
  7458  var _sqlite3VdbeMemHandleBomØ00__func__Ø000 [24]int8
  7459  
  7460  func init() {
  7461  	crt.Xstrncpy(nil, &_sqlite3VdbeMemHandleBomØ00__func__Ø000[0], str(6687), 24)
  7462  }
  7463  
  7464  // C comment
  7465  //  /* Force an SQLITE_TOOBIG error. */
  7466  func Xsqlite3_result_error_toobig(tls *crt.TLS, _pCtx *Xsqlite3_context) {
  7467  	func() {
  7468  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
  7469  			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)))
  7470  			crt.X__builtin_abort(tls)
  7471  		}
  7472  	}()
  7473  	_pCtx.XisError = int32(18)
  7474  	_pCtx.XfErrorOrAux = uint8(1)
  7475  	_sqlite3VdbeMemSetStr(tls, (*XMem)(_pCtx.XpOut), str(6711), int32(-1), uint8(1), nil)
  7476  }
  7477  
  7478  var _sqlite3_result_error_toobigØ00__func__Ø000 [28]int8
  7479  
  7480  func init() {
  7481  	crt.Xstrncpy(nil, &_sqlite3_result_error_toobigØ00__func__Ø000[0], str(6734), 28)
  7482  }
  7483  
  7484  // C comment
  7485  //  /* This function is used by SQL generated to implement the
  7486  //  ** ALTER TABLE command. The first argument is the text of a CREATE TRIGGER
  7487  //  ** statement. The second is a table name. The table name in the CREATE
  7488  //  ** TRIGGER statement is replaced with the third argument and the result
  7489  //  ** returned. This is analagous to renameTableFunc() above, except for CREATE
  7490  //  ** TRIGGER, not CREATE INDEX and CREATE TABLE.
  7491  //  */
  7492  func _renameTriggerFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) {
  7493  	var _token, _dist, _len int32
  7494  	var _zRet *int8
  7495  	var _zSql, _zTableName, _zCsr *uint8
  7496  	var _tname XToken
  7497  	var _db *Xsqlite3
  7498  	_zSql = Xsqlite3_value_text(tls, *elem19(_argv, 0))
  7499  	_zTableName = Xsqlite3_value_text(tls, *elem19(_argv, uintptr(1)))
  7500  	_dist = int32(3)
  7501  	_zCsr = _zSql
  7502  	_len = int32(0)
  7503  	_db = Xsqlite3_context_db_handle(tls, _context)
  7504  
  7505  	if _zSql == nil {
  7506  		goto _0
  7507  	}
  7508  _1:
  7509  	if (*_zCsr) == 0 {
  7510  		return
  7511  	}
  7512  	_tname.Xz = (*int8)(unsafe.Pointer(_zCsr))
  7513  	_tname.Xn = uint32(_len)
  7514  _3:
  7515  	*(*uintptr)(unsafe.Pointer(&_zCsr)) += uintptr(_len)
  7516  	_len = _sqlite3GetToken(tls, _zCsr, &_token)
  7517  	if _token == int32(163) {
  7518  		goto _3
  7519  	}
  7520  	func() {
  7521  		if _len <= int32(0) {
  7522  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96310), unsafe.Pointer(&_renameTriggerFuncØ00__func__Ø000), unsafe.Pointer(str(4136)))
  7523  			crt.X__builtin_abort(tls)
  7524  		}
  7525  	}()
  7526  	_dist += 1
  7527  	if (_token == int32(122)) || (_token == int32(107)) {
  7528  		_dist = int32(0)
  7529  	}
  7530  	if (_dist != int32(2)) || (((_token != int32(137)) && (_token != int32(45))) && (_token != int32(5))) {
  7531  		goto _1
  7532  	}
  7533  	_zRet = _sqlite3MPrintf(tls, _db, str(4142), int32(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)))))
  7534  	Xsqlite3_result_text(tls, _context, _zRet, int32(-1), func() func(*crt.TLS, unsafe.Pointer) {
  7535  		v := _sqlite3MallocSize
  7536  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
  7537  	}())
  7538  _0:
  7539  }
  7540  
  7541  var _renameTriggerFuncØ00__func__Ø000 [18]int8
  7542  
  7543  func init() {
  7544  	crt.Xstrncpy(nil, &_renameTriggerFuncØ00__func__Ø000[0], str(6762), 18)
  7545  }
  7546  
  7547  func _renameParentFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) {
  7548  	var _n, _token int32
  7549  	var _zOutput, _zResult, _2_zParent, _4_zOut *int8
  7550  	var _zInput, _zOld, _zNew, _z *uint8
  7551  	var _db *Xsqlite3
  7552  	_db = Xsqlite3_context_db_handle(tls, _context)
  7553  	_zOutput = nil
  7554  	_zInput = Xsqlite3_value_text(tls, *elem19(_argv, 0))
  7555  	_zOld = Xsqlite3_value_text(tls, *elem19(_argv, uintptr(1)))
  7556  	_zNew = Xsqlite3_value_text(tls, *elem19(_argv, uintptr(2)))
  7557  
  7558  	if (_zInput == nil) || (_zOld == nil) {
  7559  		return
  7560  	}
  7561  	_z = _zInput
  7562  _2:
  7563  	if (*_z) == 0 {
  7564  		goto _5
  7565  	}
  7566  	_n = _sqlite3GetToken(tls, _z, &_token)
  7567  	if _token != int32(105) {
  7568  		goto _6
  7569  	}
  7570  _7:
  7571  	*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_n)
  7572  	_n = _sqlite3GetToken(tls, _z, &_token)
  7573  	if _token == int32(163) {
  7574  		goto _7
  7575  	}
  7576  	if _token == int32(164) {
  7577  		goto _5
  7578  	}
  7579  	_2_zParent = _sqlite3DbStrNDup(tls, _db, (*int8)(unsafe.Pointer(_z)), uint64(_n))
  7580  	if _2_zParent == nil {
  7581  		goto _5
  7582  	}
  7583  	_sqlite3Dequote(tls, _2_zParent)
  7584  	if int32(0) == _sqlite3StrICmp(tls, (*int8)(unsafe.Pointer(_zOld)), _2_zParent) {
  7585  		_4_zOut = _sqlite3MPrintf(tls, _db, str(6780), unsafe.Pointer(func() *int8 {
  7586  			if _zOutput != nil {
  7587  				return _zOutput
  7588  			}
  7589  			return str(284)
  7590  		}()), int32(uintptr(unsafe.Pointer(_z))-uintptr(unsafe.Pointer(_zInput))), unsafe.Pointer(_zInput), unsafe.Pointer(_zNew))
  7591  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zOutput))
  7592  		_zOutput = _4_zOut
  7593  		_zInput = elem15(_z, uintptr(_n))
  7594  	}
  7595  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_2_zParent))
  7596  _6:
  7597  	_z = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + uintptr(_n)))
  7598  	goto _2
  7599  _5:
  7600  	Xsqlite3_result_text(tls, func() *Xsqlite3_context {
  7601  		_zResult = _sqlite3MPrintf(tls, _db, str(6791), unsafe.Pointer(func() *int8 {
  7602  			if _zOutput != nil {
  7603  				return _zOutput
  7604  			}
  7605  			return str(284)
  7606  		}()), unsafe.Pointer(_zInput))
  7607  		return _context
  7608  	}(), _zResult, int32(-1), func() func(*crt.TLS, unsafe.Pointer) {
  7609  		v := _sqlite3MallocSize
  7610  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
  7611  	}())
  7612  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zOutput))
  7613  }
  7614  
  7615  func _sqlite3DbStrNDup(tls *crt.TLS, _db *Xsqlite3, _z *int8, _n uint64) (r0 *int8) {
  7616  	var _zNew *int8
  7617  	func() {
  7618  		if _db == nil {
  7619  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24971), unsafe.Pointer(&_sqlite3DbStrNDupØ00__func__Ø000), unsafe.Pointer(str(1219)))
  7620  			crt.X__builtin_abort(tls)
  7621  		}
  7622  	}()
  7623  	if _z == nil {
  7624  		return nil
  7625  	}
  7626  	func() {
  7627  		if (_n & uint64(2147483647)) != _n {
  7628  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24975), unsafe.Pointer(&_sqlite3DbStrNDupØ00__func__Ø000), unsafe.Pointer(str(6796)))
  7629  			crt.X__builtin_abort(tls)
  7630  		}
  7631  	}()
  7632  	_zNew = (*int8)(_sqlite3DbMallocRawNN(tls, _db, _n+uint64(1)))
  7633  	if _zNew != nil {
  7634  		crt.Xmemcpy(tls, unsafe.Pointer(_zNew), unsafe.Pointer(_z), uint32(_n))
  7635  		*elem1(_zNew, uintptr(_n)) = 0
  7636  	}
  7637  	return _zNew
  7638  }
  7639  
  7640  var _sqlite3DbStrNDupØ00__func__Ø000 [17]int8
  7641  
  7642  func init() {
  7643  	crt.Xstrncpy(nil, &_sqlite3DbStrNDupØ00__func__Ø000[0], str(6814), 17)
  7644  }
  7645  
  7646  // C comment
  7647  //  /*
  7648  //  ** Convert an SQL-style quoted string into a normal string by removing
  7649  //  ** the quote characters.  The conversion is done in-place.  If the
  7650  //  ** input does not begin with a quote character, then this routine
  7651  //  ** is a no-op.
  7652  //  **
  7653  //  ** The input string must be zero-terminated.  A new zero-terminator
  7654  //  ** is added to the dequoted string.
  7655  //  **
  7656  //  ** The return value is -1 if no dequoting occurs or the length of the
  7657  //  ** dequoted string, exclusive of the zero terminator, if dequoting does
  7658  //  ** occur.
  7659  //  **
  7660  //  ** 2002-Feb-14: This routine is extended to remove MS-Access style
  7661  //  ** brackets from around identifiers.  For example:  "[a-b-c]" becomes
  7662  //  ** "a-b-c".
  7663  //  */
  7664  func _sqlite3Dequote(tls *crt.TLS, _z *int8) {
  7665  	var _i, _j int32
  7666  	var _quote int8
  7667  	if _z == nil {
  7668  		return
  7669  	}
  7670  	_quote = *elem1(_z, 0)
  7671  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(_quote)))) & int32(128)) == 0 {
  7672  		return
  7673  	}
  7674  	if int32(_quote) == int32(91) {
  7675  		_quote = int8(93)
  7676  	}
  7677  	*func() *int32 { _i = int32(1); return &_j }() = int32(0)
  7678  _3:
  7679  	func() {
  7680  		if (*elem1(_z, uintptr(_i))) == 0 {
  7681  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27909), unsafe.Pointer(&_sqlite3DequoteØ00__func__Ø000), unsafe.Pointer(str(6831)))
  7682  			crt.X__builtin_abort(tls)
  7683  		}
  7684  	}()
  7685  	if int32(*elem1(_z, uintptr(_i))) != int32(_quote) {
  7686  		goto _8
  7687  	}
  7688  	if int32(*elem1(_z, uintptr(_i+int32(1)))) == int32(_quote) {
  7689  		*elem1(_z, uintptr(postInc2(&_j, 1))) = _quote
  7690  		_i += 1
  7691  		goto _10
  7692  	}
  7693  	goto _5
  7694  _10:
  7695  	goto _11
  7696  _8:
  7697  	*elem1(_z, uintptr(postInc2(&_j, 1))) = *elem1(_z, uintptr(_i))
  7698  _11:
  7699  	_i += 1
  7700  	goto _3
  7701  _5:
  7702  	*elem1(_z, uintptr(_j)) = 0
  7703  }
  7704  
  7705  var _sqlite3DequoteØ00__func__Ø000 [15]int8
  7706  
  7707  func init() {
  7708  	crt.Xstrncpy(nil, &_sqlite3DequoteØ00__func__Ø000[0], str(6836), 15)
  7709  }
  7710  
  7711  // C comment
  7712  //  /*
  7713  //  ** This function registered all of the above C functions as SQL
  7714  //  ** functions.  This should be the only routine in this file with
  7715  //  ** external linkage.
  7716  //  */
  7717  func _sqlite3RegisterDateTimeFunctions(tls *crt.TLS) {
  7718  	_sqlite3InsertBuiltinFuncs(tls, (*XFuncDef)(unsafe.Pointer(&_sqlite3RegisterDateTimeFunctionsØ00aDateTimeFuncsØ001)), int32(8))
  7719  }
  7720  
  7721  var _sqlite3RegisterDateTimeFunctionsØ00aDateTimeFuncsØ001 [8]XFuncDef
  7722  
  7723  func init() {
  7724  	_sqlite3RegisterDateTimeFunctionsØ00aDateTimeFuncsØ001 = [8]XFuncDef{XFuncDef{XnArg: int8(-1), XfuncFlags: uint16(8193), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  7725  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  7726  	}{_juliandayFunc})), XzName: str(6851)}, XFuncDef{XnArg: int8(-1), XfuncFlags: uint16(8193), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  7727  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  7728  	}{_dateFunc})), XzName: str(6861)}, XFuncDef{XnArg: int8(-1), XfuncFlags: uint16(8193), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  7729  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  7730  	}{_timeFunc})), XzName: str(6866)}, XFuncDef{XnArg: int8(-1), XfuncFlags: uint16(8193), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  7731  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  7732  	}{_datetimeFunc})), XzName: str(6871)}, XFuncDef{XnArg: int8(-1), XfuncFlags: uint16(8193), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  7733  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  7734  	}{_strftimeFunc})), XzName: str(6880)}, XFuncDef{XfuncFlags: uint16(8193), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  7735  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  7736  	}{_ctimeFunc})), XzName: str(6889)}, XFuncDef{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  	}{_ctimestampFunc})), XzName: str(6902)}, XFuncDef{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  	}{_cdateFunc})), XzName: str(6920)}}
  7741  }
  7742  
  7743  // C comment
  7744  //  /*
  7745  //  **    julianday( TIMESTRING, MOD, MOD, ...)
  7746  //  **
  7747  //  ** Return the julian day number of the date specified in the arguments
  7748  //  */
  7749  func _juliandayFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
  7750  	var _x XDateTime
  7751  	if _isDate(tls, _context, _argc, _argv, &_x) == int32(0) {
  7752  		_computeJD(tls, &_x)
  7753  		Xsqlite3_result_double(tls, _context, float64(_x.XiJD)/(8.64e+07))
  7754  	}
  7755  }
  7756  
  7757  // C comment
  7758  //  /*
  7759  //  ** Process time function arguments.  argv[0] is a date-time stamp.
  7760  //  ** argv[1] and following are modifiers.  Parse them all and write
  7761  //  ** the resulting time into the DateTime structure p.  Return 0
  7762  //  ** on success and 1 if there are any errors.
  7763  //  **
  7764  //  ** If there are zero parameters (if even argv[0] is undefined)
  7765  //  ** then assume a default value of "now" for argv[0].
  7766  //  */
  7767  func _isDate(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem, _p *XDateTime) (r0 int32) {
  7768  	var _i, _n, _eType int32
  7769  	var _z *uint8
  7770  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint32(48))
  7771  	if _argc == int32(0) {
  7772  		return _setDateTimeToCurrent(tls, _context, _p)
  7773  	}
  7774  	if (store2(&_eType, Xsqlite3_value_type(tls, *elem19(_argv, 0))) == int32(2)) || (_eType == int32(1)) {
  7775  		_setRawDateNumber(tls, _p, Xsqlite3_value_double(tls, *elem19(_argv, 0)))
  7776  		goto _3
  7777  	}
  7778  	_z = Xsqlite3_value_text(tls, *elem19(_argv, 0))
  7779  	if (_z == nil) || _parseDateOrTime(tls, _context, (*int8)(unsafe.Pointer(_z)), _p) != 0 {
  7780  		return int32(1)
  7781  	}
  7782  _3:
  7783  	_i = int32(1)
  7784  _6:
  7785  	if _i >= _argc {
  7786  		goto _9
  7787  	}
  7788  	_z = Xsqlite3_value_text(tls, *elem19(_argv, uintptr(_i)))
  7789  	_n = Xsqlite3_value_bytes(tls, *elem19(_argv, uintptr(_i)))
  7790  	if (_z == nil) || _parseModifier(tls, _context, (*int8)(unsafe.Pointer(_z)), _n, _p) != 0 {
  7791  		return int32(1)
  7792  	}
  7793  	_i += 1
  7794  	goto _6
  7795  _9:
  7796  	_computeJD(tls, _p)
  7797  	if (_p.XisError != 0) || (_validJulianDay(tls, _p.XiJD) == 0) {
  7798  		return int32(1)
  7799  	}
  7800  	return int32(0)
  7801  }
  7802  
  7803  // C comment
  7804  //  /*
  7805  //  ** Set the time to the current time reported by the VFS.
  7806  //  **
  7807  //  ** Return the number of errors.
  7808  //  */
  7809  func _setDateTimeToCurrent(tls *crt.TLS, _context *Xsqlite3_context, _p *XDateTime) (r0 int32) {
  7810  	_p.XiJD = _sqlite3StmtCurrentTime(tls, _context)
  7811  	if _p.XiJD > (0) {
  7812  		_p.XvalidJD = int8(1)
  7813  		return int32(0)
  7814  	}
  7815  	return int32(1)
  7816  }
  7817  
  7818  // C comment
  7819  //  /*
  7820  //  ** Return the current time for a statement.  If the current time
  7821  //  ** is requested more than once within the same run of a single prepared
  7822  //  ** statement, the exact same time is returned for each invocation regardless
  7823  //  ** of the amount of time that elapses between invocations.  In other words,
  7824  //  ** the time returned is always the time of the first call.
  7825  //  */
  7826  func _sqlite3StmtCurrentTime(tls *crt.TLS, _p *Xsqlite3_context) (r0 int64) {
  7827  	var _rc int32
  7828  	var _piTime *int64
  7829  	_piTime = &((*TVdbe)(_p.XpVdbe).XiCurrentTime)
  7830  	func() {
  7831  		if (*TVdbe)(_p.XpVdbe) == nil {
  7832  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76829), unsafe.Pointer(&_sqlite3StmtCurrentTimeØ00__func__Ø000), unsafe.Pointer(str(6933)))
  7833  			crt.X__builtin_abort(tls)
  7834  		}
  7835  	}()
  7836  	if (*_piTime) != (0) {
  7837  		goto _2
  7838  	}
  7839  	_rc = _sqlite3OsCurrentTimeInt64(tls, (*Xsqlite3_vfs)((*Xsqlite3)((*XMem)(_p.XpOut).Xdb).XpVfs), _piTime)
  7840  	if _rc != 0 {
  7841  		*_piTime = 0
  7842  	}
  7843  _2:
  7844  	return *_piTime
  7845  }
  7846  
  7847  var _sqlite3StmtCurrentTimeØ00__func__Ø000 [23]int8
  7848  
  7849  func init() {
  7850  	crt.Xstrncpy(nil, &_sqlite3StmtCurrentTimeØ00__func__Ø000[0], str(6945), 23)
  7851  }
  7852  
  7853  func _sqlite3OsCurrentTimeInt64(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _pTimeOut *int64) (r0 int32) {
  7854  	var _rc int32
  7855  	var _2_r float64
  7856  	if (_pVfs.XiVersion >= int32(2)) && (_pVfs.XxCurrentTimeInt64 != nil) {
  7857  		_rc = func() func(*crt.TLS, *Xsqlite3_vfs, *int64) int32 {
  7858  			v := _pVfs.XxCurrentTimeInt64
  7859  			return *(*func(*crt.TLS, *Xsqlite3_vfs, *int64) int32)(unsafe.Pointer(&v))
  7860  		}()(tls, _pVfs, _pTimeOut)
  7861  		goto _2
  7862  	}
  7863  	_rc = func() func(*crt.TLS, *Xsqlite3_vfs, *float64) int32 {
  7864  		v := _pVfs.XxCurrentTime
  7865  		return *(*func(*crt.TLS, *Xsqlite3_vfs, *float64) int32)(unsafe.Pointer(&v))
  7866  	}()(tls, _pVfs, &_2_r)
  7867  	*_pTimeOut = int64(_2_r * (8.64e+07))
  7868  _2:
  7869  	return _rc
  7870  }
  7871  
  7872  // C comment
  7873  //  /* SQLITE_OMIT_UTF16 */
  7874  //  /* EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five
  7875  //  ** fundamental datatypes: 64-bit signed integer 64-bit IEEE floating
  7876  //  ** point number string BLOB NULL
  7877  //  */
  7878  func Xsqlite3_value_type(tls *crt.TLS, _pVal *XMem) (r0 int32) {
  7879  	return int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3_value_typeØ00aTypeØ001)), uintptr(int32(_pVal.Xflags)&int32(31))))
  7880  }
  7881  
  7882  var _sqlite3_value_typeØ00aTypeØ001 [32]uint8
  7883  
  7884  func init() {
  7885  	_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}
  7886  }
  7887  
  7888  // C comment
  7889  //  /*
  7890  //  ** Input "r" is a numeric quantity which might be a julian day number,
  7891  //  ** or the number of seconds since 1970.  If the value if r is within
  7892  //  ** range of a julian day number, install it as such and set validJD.
  7893  //  ** If the value is a valid unix timestamp, put it in p->s and set p->rawS.
  7894  //  */
  7895  func _setRawDateNumber(tls *crt.TLS, _p *XDateTime, _r float64) {
  7896  	_p.Xs = _r
  7897  	_p.XrawS = int8(1)
  7898  	if (_r >= float64(0)) && (_r < (5.3734845e+06)) {
  7899  		_p.XiJD = int64((_r * (8.64e+07)) + (0.5))
  7900  		_p.XvalidJD = int8(1)
  7901  	}
  7902  }
  7903  
  7904  func Xsqlite3_value_double(tls *crt.TLS, _pVal *XMem) (r0 float64) {
  7905  	return _sqlite3VdbeRealValue(tls, _pVal)
  7906  }
  7907  
  7908  func _sqlite3VdbeRealValue(tls *crt.TLS, _pMem *XMem) (r0 float64) {
  7909  	func() {
  7910  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
  7911  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70197), unsafe.Pointer(&_sqlite3VdbeRealValueØ00__func__Ø000), unsafe.Pointer(str(4568)))
  7912  			crt.X__builtin_abort(tls)
  7913  		}
  7914  	}()
  7915  	func() {
  7916  		if (int32(uintptr(unsafe.Pointer(_pMem))) & int32(7)) != int32(0) {
  7917  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70198), unsafe.Pointer(&_sqlite3VdbeRealValueØ00__func__Ø000), unsafe.Pointer(str(6222)))
  7918  			crt.X__builtin_abort(tls)
  7919  		}
  7920  	}()
  7921  	if (int32(_pMem.Xflags) & int32(8)) != 0 {
  7922  		return *(*float64)(unsafe.Pointer(&_pMem.Xu))
  7923  	}
  7924  	if (int32(_pMem.Xflags) & int32(4)) != 0 {
  7925  		return float64(*(*int64)(unsafe.Pointer(&_pMem.Xu)))
  7926  	}
  7927  	if (int32(_pMem.Xflags) & int32(18)) != 0 {
  7928  		return _memRealValue(tls, _pMem)
  7929  	}
  7930  	return float64(0)
  7931  }
  7932  
  7933  var _sqlite3VdbeRealValueØ00__func__Ø000 [21]int8
  7934  
  7935  func init() {
  7936  	crt.Xstrncpy(nil, &_sqlite3VdbeRealValueØ00__func__Ø000[0], str(6968), 21)
  7937  }
  7938  
  7939  // C comment
  7940  //  /*
  7941  //  ** Return the best representation of pMem that we can get into a
  7942  //  ** double.  If pMem is already a double or an integer, return its
  7943  //  ** value.  If it is a string or blob, try to convert it to a double.
  7944  //  ** If it is a NULL, return 0.0.
  7945  //  */
  7946  func _memRealValue(tls *crt.TLS, _pMem *XMem) (r0 float64) {
  7947  	var _val float64
  7948  	_val = 0
  7949  	_sqlite3AtoF(tls, _pMem.Xz, &_val, _pMem.Xn, _pMem.Xenc)
  7950  	return _val
  7951  }
  7952  
  7953  // C comment
  7954  //  /*
  7955  //  ** The string z[] is an text representation of a real number.
  7956  //  ** Convert this string to a double and write it into *pResult.
  7957  //  **
  7958  //  ** The string z[] is length bytes in length (bytes, not characters) and
  7959  //  ** uses the encoding enc.  The string is not necessarily zero-terminated.
  7960  //  **
  7961  //  ** Return TRUE if the result is a valid real number (or integer) and FALSE
  7962  //  ** if the string is empty or contains extraneous text.  Valid numbers
  7963  //  ** are in one of these formats:
  7964  //  **
  7965  //  **    [+-]digits[E[+-]digits]
  7966  //  **    [+-]digits.[digits][E[+-]digits]
  7967  //  **    [+-].digits[E[+-]digits]
  7968  //  **
  7969  //  ** Leading and trailing whitespace is ignored for the purpose of determining
  7970  //  ** validity.
  7971  //  **
  7972  //  ** If some prefix of the input string is a valid number, this routine
  7973  //  ** returns FALSE but it still converts the prefix and writes the result
  7974  //  ** into *pResult.
  7975  //  */
  7976  func _sqlite3AtoF(tls *crt.TLS, _z *int8, _pResult *float64, _length int32, _enc uint8) (r0 int32) {
  7977  	var _incr, _sign, _d, _esign, _e, _eValid, _nDigits, _nonNum, _2_i int32
  7978  	var _s int64
  7979  	var _zEnd *int8
  7980  	var _result, _22_scale float64
  7981  	_zEnd = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + uintptr(_length)))
  7982  	_sign = int32(1)
  7983  	_s = int64(0)
  7984  	_d = int32(0)
  7985  	_esign = int32(1)
  7986  	_e = int32(0)
  7987  	_eValid = int32(1)
  7988  	_nDigits = int32(0)
  7989  	_nonNum = int32(0)
  7990  	func() {
  7991  		if int32(_enc) != int32(1) && int32(_enc) != int32(2) && int32(_enc) != int32(3) {
  7992  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(28016), unsafe.Pointer(&_sqlite3AtoFØ00__func__Ø000), unsafe.Pointer(str(6989)))
  7993  			crt.X__builtin_abort(tls)
  7994  		}
  7995  	}()
  7996  	*_pResult = float64(0)
  7997  	if int32(_enc) == int32(1) {
  7998  		_incr = int32(1)
  7999  		goto _5
  8000  	}
  8001  	_incr = int32(2)
  8002  
  8003  	_2_i = int32(3) - int32(_enc)
  8004  _6:
  8005  	if _2_i >= _length || int32(*elem1(_z, uintptr(_2_i))) != int32(0) {
  8006  		goto _10
  8007  	}
  8008  	_2_i += int32(2)
  8009  	goto _6
  8010  _10:
  8011  	_nonNum = bool2int(_2_i < _length)
  8012  	_zEnd = elem1(_z, uintptr(_2_i^int32(1)))
  8013  	*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(int32(_enc) & int32(1))
  8014  _5:
  8015  	if (crt.P2U(unsafe.Pointer(_z)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_z))))&int32(1)) != 0 {
  8016  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_incr)
  8017  		goto _5
  8018  	}
  8019  	if crt.P2U(unsafe.Pointer(_z)) >= crt.P2U(unsafe.Pointer(_zEnd)) {
  8020  		return int32(0)
  8021  	}
  8022  	if int32(*_z) == int32(45) {
  8023  		_sign = int32(-1)
  8024  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_incr)
  8025  		goto _17
  8026  	}
  8027  	if int32(*_z) == int32(43) {
  8028  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_incr)
  8029  	}
  8030  _17:
  8031  	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)) {
  8032  		_s = (_s * int64(10)) + int64(int32(*_z)-int32(48))
  8033  		*func() *int32 { *(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_incr); return &_nDigits }() += 1
  8034  		goto _17
  8035  	}
  8036  _19:
  8037  	if (crt.P2U(unsafe.Pointer(_z)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_z))))&int32(4)) != 0 {
  8038  		*func() *int32 {
  8039  			*func() *int32 { *(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_incr); return &_nDigits }() += 1
  8040  			return &_d
  8041  		}() += 1
  8042  		goto _19
  8043  	}
  8044  	if crt.P2U(unsafe.Pointer(_z)) >= crt.P2U(unsafe.Pointer(_zEnd)) {
  8045  		goto _do_atof_calc
  8046  	}
  8047  	if int32(*_z) != int32(46) {
  8048  		goto _26
  8049  	}
  8050  	*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_incr)
  8051  _27:
  8052  	if crt.P2U(unsafe.Pointer(_z)) >= crt.P2U(unsafe.Pointer(_zEnd)) || (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_z))))&int32(4)) == 0 {
  8053  		goto _28
  8054  	}
  8055  	if _s < int64(922337203685477579) {
  8056  		_s = (_s * int64(10)) + int64(int32(*_z)-int32(48))
  8057  		_d -= 1
  8058  	}
  8059  	*func() *int32 { *(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_incr); return &_nDigits }() += 1
  8060  	goto _27
  8061  _28:
  8062  _26:
  8063  	if crt.P2U(unsafe.Pointer(_z)) >= crt.P2U(unsafe.Pointer(_zEnd)) {
  8064  		goto _do_atof_calc
  8065  	}
  8066  	if int32(*_z) != int32(101) && int32(*_z) != int32(69) {
  8067  		goto _33
  8068  	}
  8069  	*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_incr)
  8070  	_eValid = int32(0)
  8071  	if crt.P2U(unsafe.Pointer(_z)) >= crt.P2U(unsafe.Pointer(_zEnd)) {
  8072  		goto _do_atof_calc
  8073  	}
  8074  	if int32(*_z) == int32(45) {
  8075  		_esign = int32(-1)
  8076  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_incr)
  8077  		goto _37
  8078  	}
  8079  	if int32(*_z) == int32(43) {
  8080  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_incr)
  8081  	}
  8082  _37:
  8083  	if (crt.P2U(unsafe.Pointer(_z)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_z))))&int32(4)) != 0 {
  8084  		_e = func() int32 {
  8085  			if _e < int32(10000) {
  8086  				return ((_e * int32(10)) + (int32(*_z) - int32(48)))
  8087  			}
  8088  			return int32(10000)
  8089  		}()
  8090  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_incr)
  8091  		_eValid = int32(1)
  8092  		goto _37
  8093  	}
  8094  _33:
  8095  	if (crt.P2U(unsafe.Pointer(_z)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_z))))&int32(1)) != 0 {
  8096  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_incr)
  8097  		goto _33
  8098  	}
  8099  _do_atof_calc:
  8100  	_e = (_e * _esign) + _d
  8101  	if _e < int32(0) {
  8102  		_esign = int32(-1)
  8103  		_e *= int32(-1)
  8104  		goto _47
  8105  	}
  8106  	_esign = int32(1)
  8107  _47:
  8108  	if _s == (0) {
  8109  		_result = func() float64 {
  8110  			if _sign < int32(0) {
  8111  				return (-0)
  8112  			}
  8113  			return float64(0)
  8114  		}()
  8115  		goto _51
  8116  	}
  8117  _52:
  8118  	if _e <= int32(0) {
  8119  		goto _53
  8120  	}
  8121  	if _esign <= int32(0) {
  8122  		goto _54
  8123  	}
  8124  	if _s >= int64(922337203685477580) {
  8125  		goto _53
  8126  	}
  8127  	_s *= int64(10)
  8128  	goto _56
  8129  _54:
  8130  	if (_s % int64(10)) != (0) {
  8131  		goto _53
  8132  	}
  8133  	_s /= int64(10)
  8134  _56:
  8135  	_e -= 1
  8136  	goto _52
  8137  _53:
  8138  	_s = func() int64 {
  8139  		if _sign < int32(0) {
  8140  			return (-_s)
  8141  		}
  8142  		return _s
  8143  	}()
  8144  	if _e == int32(0) {
  8145  		_result = float64(_s)
  8146  		goto _61
  8147  	}
  8148  	_22_scale = 1
  8149  	if _e <= int32(307) {
  8150  		goto _62
  8151  	}
  8152  	if _e >= int32(342) {
  8153  		goto _63
  8154  	}
  8155  _64:
  8156  	if (_e % int32(308)) != 0 {
  8157  		_22_scale *= float64(10)
  8158  		_e -= int32(1)
  8159  		goto _64
  8160  	}
  8161  	if _esign < int32(0) {
  8162  		_result = float64(_s) / _22_scale
  8163  		_result /= float64(1e+308)
  8164  		goto _67
  8165  	}
  8166  	_result = float64(_s) * _22_scale
  8167  	_result *= float64(1e+308)
  8168  _67:
  8169  	goto _68
  8170  _63:
  8171  	func() {
  8172  		if _e < int32(342) {
  8173  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(28146), unsafe.Pointer(&_sqlite3AtoFØ00__func__Ø000), unsafe.Pointer(str(7052)))
  8174  			crt.X__builtin_abort(tls)
  8175  		}
  8176  	}()
  8177  	if _esign < int32(0) {
  8178  		_result = float64(0) * float64(_s)
  8179  		goto _72
  8180  	}
  8181  	_result = inf * float64(_s)
  8182  _72:
  8183  _68:
  8184  	goto _73
  8185  _62:
  8186  _74:
  8187  	if (_e % int32(22)) != 0 {
  8188  		_22_scale *= float64(10)
  8189  		_e -= int32(1)
  8190  		goto _74
  8191  	}
  8192  _75:
  8193  	if _e > int32(0) {
  8194  		_22_scale *= float64(1e+22)
  8195  		_e -= int32(22)
  8196  		goto _75
  8197  	}
  8198  	if _esign < int32(0) {
  8199  		_result = float64(_s) / _22_scale
  8200  		goto _79
  8201  	}
  8202  	_result = float64(_s) * _22_scale
  8203  _79:
  8204  _73:
  8205  _61:
  8206  _51:
  8207  	*_pResult = _result
  8208  	return bool2int((((_z == _zEnd) && (_nDigits > int32(0))) && _eValid != 0) && (_nonNum == int32(0)))
  8209  }
  8210  
  8211  var _sqlite3AtoFØ00__func__Ø000 [12]int8
  8212  
  8213  func init() {
  8214  	crt.Xstrncpy(nil, &_sqlite3AtoFØ00__func__Ø000[0], str(7059), 12)
  8215  }
  8216  
  8217  // C comment
  8218  //  /*
  8219  //  ** Attempt to parse the given string into a julian day number.  Return
  8220  //  ** the number of errors.
  8221  //  **
  8222  //  ** The following are acceptable forms for the input string:
  8223  //  **
  8224  //  **      YYYY-MM-DD HH:MM:SS.FFF  +/-HH:MM
  8225  //  **      DDDD.DD
  8226  //  **      now
  8227  //  **
  8228  //  ** In the first form, the +/-HH:MM is always optional.  The fractional
  8229  //  ** seconds extension (the ".FFF") is optional.  The seconds portion
  8230  //  ** (":SS.FFF") is option.  The year and date can be omitted as long
  8231  //  ** as there is a time string.  The time string can be omitted as long
  8232  //  ** as there is a year and date.
  8233  //  */
  8234  func _parseDateOrTime(tls *crt.TLS, _context *Xsqlite3_context, _zDate *int8, _p *XDateTime) (r0 int32) {
  8235  	var _r float64
  8236  	if _parseYyyyMmDd(tls, _zDate, _p) == int32(0) {
  8237  		return int32(0)
  8238  	}
  8239  	if _parseHhMmSs(tls, _zDate, _p) == int32(0) {
  8240  		return int32(0)
  8241  	}
  8242  	if _sqlite3StrICmp(tls, _zDate, str(7071)) == int32(0) {
  8243  		return _setDateTimeToCurrent(tls, _context, _p)
  8244  	}
  8245  	if _sqlite3AtoF(tls, _zDate, &_r, _sqlite3Strlen30(tls, _zDate), uint8(1)) != 0 {
  8246  		_setRawDateNumber(tls, _p, _r)
  8247  		return int32(0)
  8248  	}
  8249  	return int32(1)
  8250  }
  8251  
  8252  // C comment
  8253  //  /*
  8254  //  ** Parse dates of the form
  8255  //  **
  8256  //  **     YYYY-MM-DD HH:MM:SS.FFF
  8257  //  **     YYYY-MM-DD HH:MM:SS
  8258  //  **     YYYY-MM-DD HH:MM
  8259  //  **     YYYY-MM-DD
  8260  //  **
  8261  //  ** Write the result into the DateTime structure and return 0
  8262  //  ** on success and 1 if the input string is not a well-formed
  8263  //  ** date.
  8264  //  */
  8265  func _parseYyyyMmDd(tls *crt.TLS, _zDate *int8, _p *XDateTime) (r0 int32) {
  8266  	var _Y, _M, _D, _neg int32
  8267  	if int32(*elem1(_zDate, 0)) == int32(45) {
  8268  		*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
  8269  		_neg = int32(1)
  8270  		goto _1
  8271  	}
  8272  	_neg = int32(0)
  8273  _1:
  8274  	if _getDigits(tls, _zDate, str(7075), unsafe.Pointer(&_Y), unsafe.Pointer(&_M), unsafe.Pointer(&_D)) != int32(3) {
  8275  		return int32(1)
  8276  	}
  8277  	*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(int32(10))
  8278  _3:
  8279  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_zDate))))&int32(1)) != 0 || (int32(84) == int32(*(*uint8)(unsafe.Pointer(_zDate)))) {
  8280  		*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
  8281  		goto _3
  8282  	}
  8283  	if _parseHhMmSs(tls, _zDate, _p) == int32(0) {
  8284  		goto _9
  8285  	}
  8286  	if int32(*_zDate) == int32(0) {
  8287  		_p.XvalidHMS = 0
  8288  		goto _9
  8289  	}
  8290  	return int32(1)
  8291  
  8292  _9:
  8293  	_p.XvalidJD = 0
  8294  	_p.XvalidYMD = int8(1)
  8295  	_p.XY = func() int32 {
  8296  		if _neg != 0 {
  8297  			return (-_Y)
  8298  		}
  8299  		return _Y
  8300  	}()
  8301  	_p.XM = _M
  8302  	_p.XD = _D
  8303  	if _p.XvalidTZ != 0 {
  8304  		_computeJD(tls, _p)
  8305  	}
  8306  	return int32(0)
  8307  }
  8308  
  8309  // C comment
  8310  //  /*
  8311  //  ** Convert zDate into one or more integers according to the conversion
  8312  //  ** specifier zFormat.
  8313  //  **
  8314  //  ** zFormat[] contains 4 characters for each integer converted, except for
  8315  //  ** the last integer which is specified by three characters.  The meaning
  8316  //  ** of a four-character format specifiers ABCD is:
  8317  //  **
  8318  //  **    A:   number of digits to convert.  Always "2" or "4".
  8319  //  **    B:   minimum value.  Always "0" or "1".
  8320  //  **    C:   maximum value, decoded as:
  8321  //  **           a:  12
  8322  //  **           b:  14
  8323  //  **           c:  24
  8324  //  **           d:  31
  8325  //  **           e:  59
  8326  //  **           f:  9999
  8327  //  **    D:   the separator character, or \000 to indicate this is the
  8328  //  **         last number to convert.
  8329  //  **
  8330  //  ** Example:  To translate an ISO-8601 date YYYY-MM-DD, the format would
  8331  //  ** be "40f-21a-20c".  The "40f-" indicates the 4-digit year followed by "-".
  8332  //  ** The "21a-" indicates the 2-digit month followed by "-".  The "20c" indicates
  8333  //  ** the 2-digit day which is the last integer in the set.
  8334  //  **
  8335  //  ** The function returns the number of successful conversions.
  8336  //  */
  8337  func _getDigits(tls *crt.TLS, _zDate *int8, _zFormat *int8, args ...interface{}) (r0 int32) {
  8338  	var _cnt, _1_val int32
  8339  	var _nextC, _1_N, _1_min int8
  8340  	var _1_max uint16
  8341  	var _ap []interface{}
  8342  	_cnt = int32(0)
  8343  	_ap = args
  8344  _0:
  8345  	_1_N = int8(int32(*elem1(_zFormat, 0)) - int32(48))
  8346  	_1_min = int8(int32(*elem1(_zFormat, uintptr(1))) - int32(48))
  8347  	_1_val = int32(0)
  8348  	func() {
  8349  		if int32(*elem1(_zFormat, uintptr(2))) < int32(97) || int32(*elem1(_zFormat, uintptr(2))) > int32(102) {
  8350  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(18950), unsafe.Pointer(&_getDigitsØ00__func__Ø000), unsafe.Pointer(str(7087)))
  8351  			crt.X__builtin_abort(tls)
  8352  		}
  8353  	}()
  8354  	_1_max = *elem20((*uint16)(unsafe.Pointer(&_getDigitsØ00aMxØ001)), uintptr(int32(*elem1(_zFormat, uintptr(2)))-int32(97)))
  8355  	_nextC = *elem1(_zFormat, uintptr(3))
  8356  	_1_val = int32(0)
  8357  _4:
  8358  	if postInc5(&_1_N, -1) == 0 {
  8359  		goto _5
  8360  	}
  8361  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_zDate)))) & int32(4)) == 0 {
  8362  		goto _end_getDigits
  8363  	}
  8364  	_1_val = ((_1_val * int32(10)) + int32(*_zDate)) - int32(48)
  8365  	*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
  8366  	goto _4
  8367  _5:
  8368  	if ((_1_val < int32(_1_min)) || (_1_val > int32(_1_max))) || ((int32(_nextC) != int32(0)) && (int32(_nextC) != int32(*_zDate))) {
  8369  		goto _end_getDigits
  8370  	}
  8371  	*(*int32)(crt.VAPointer(&_ap)) = _1_val
  8372  	*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
  8373  	_cnt += 1
  8374  	*(*uintptr)(unsafe.Pointer(&_zFormat)) += uintptr(int32(4))
  8375  	if _nextC != 0 {
  8376  		goto _0
  8377  	}
  8378  _end_getDigits:
  8379  	_ap = nil
  8380  	return _cnt
  8381  
  8382  	_ = _1_N
  8383  	panic(0)
  8384  }
  8385  
  8386  var _getDigitsØ00__func__Ø000 [10]int8
  8387  
  8388  func init() {
  8389  	crt.Xstrncpy(nil, &_getDigitsØ00__func__Ø000[0], str(7122), 10)
  8390  }
  8391  
  8392  var _getDigitsØ00aMxØ001 [6]uint16
  8393  
  8394  func init() {
  8395  	_getDigitsØ00aMxØ001 = [6]uint16{uint16(12), uint16(14), uint16(24), uint16(31), uint16(59), uint16(9999)}
  8396  }
  8397  
  8398  // C comment
  8399  //  /*
  8400  //  ** Parse times of the form HH:MM or HH:MM:SS or HH:MM:SS.FFFF.
  8401  //  ** The HH, MM, and SS must each be exactly 2 digits.  The
  8402  //  ** fractional seconds FFFF can be one or more digits.
  8403  //  **
  8404  //  ** Return 1 if there is a parsing error and 0 on success.
  8405  //  */
  8406  func _parseHhMmSs(tls *crt.TLS, _zDate *int8, _p *XDateTime) (r0 int32) {
  8407  	var _h, _m, _s int32
  8408  	var _ms, _4_rScale float64
  8409  	_ms = 0
  8410  	if _getDigits(tls, _zDate, str(7132), unsafe.Pointer(&_h), unsafe.Pointer(&_m)) != int32(2) {
  8411  		return int32(1)
  8412  	}
  8413  	*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(int32(5))
  8414  	if int32(*_zDate) != int32(58) {
  8415  		goto _1
  8416  	}
  8417  	*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
  8418  	if _getDigits(tls, _zDate, str(7140), unsafe.Pointer(&_s)) != int32(1) {
  8419  		return int32(1)
  8420  	}
  8421  	*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(int32(2))
  8422  	if int32(*_zDate) != int32(46) || (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_zDate, uintptr(1))))))&int32(4)) == 0 {
  8423  		goto _4
  8424  	}
  8425  	_4_rScale = 1
  8426  	*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
  8427  _5:
  8428  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_zDate)))) & int32(4)) != 0 {
  8429  		_ms = ((_ms * float64(10)) + float64(*_zDate)) - (48)
  8430  		_4_rScale *= float64(10)
  8431  		*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
  8432  		goto _5
  8433  	}
  8434  	_ms /= _4_rScale
  8435  _4:
  8436  	goto _7
  8437  _1:
  8438  	_s = int32(0)
  8439  _7:
  8440  	_p.XvalidJD = 0
  8441  	_p.XrawS = 0
  8442  	_p.XvalidHMS = int8(1)
  8443  	_p.Xh = _h
  8444  	_p.Xm = _m
  8445  	_p.Xs = float64(_s) + _ms
  8446  	if _parseTimezone(tls, _zDate, _p) != 0 {
  8447  		return int32(1)
  8448  	}
  8449  	_p.XvalidTZ = int8(func() int32 {
  8450  		if _p.Xtz != int32(0) {
  8451  			return int32(1)
  8452  		}
  8453  		return int32(0)
  8454  	}())
  8455  	return int32(0)
  8456  }
  8457  
  8458  // C comment
  8459  //  /*
  8460  //  ** Parse a timezone extension on the end of a date-time.
  8461  //  ** The extension is of the form:
  8462  //  **
  8463  //  **        (+/-)HH:MM
  8464  //  **
  8465  //  ** Or the "zulu" notation:
  8466  //  **
  8467  //  **        Z
  8468  //  **
  8469  //  ** If the parse is successful, write the number of minutes
  8470  //  ** of change in p->tz and return 0.  If a parser error occurs,
  8471  //  ** return non-zero.
  8472  //  **
  8473  //  ** A missing specifier is not considered an error.
  8474  //  */
  8475  func _parseTimezone(tls *crt.TLS, _zDate *int8, _p *XDateTime) (r0 int32) {
  8476  	var _sgn, _nHr, _nMn, _c int32
  8477  	_sgn = int32(0)
  8478  _0:
  8479  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_zDate)))) & int32(1)) != 0 {
  8480  		*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
  8481  		goto _0
  8482  	}
  8483  	_p.Xtz = int32(0)
  8484  	_c = int32(*_zDate)
  8485  	if _c == int32(45) {
  8486  		_sgn = int32(-1)
  8487  		goto _5
  8488  	}
  8489  	if _c == int32(43) {
  8490  		_sgn = int32(1)
  8491  		goto _5
  8492  	}
  8493  	if (_c == int32(90)) || (_c == int32(122)) {
  8494  		*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
  8495  		goto _zulu_time
  8496  	}
  8497  	return bool2int(_c != int32(0))
  8498  
  8499  _5:
  8500  	*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
  8501  	if _getDigits(tls, _zDate, str(7144), unsafe.Pointer(&_nHr), unsafe.Pointer(&_nMn)) != int32(2) {
  8502  		return int32(1)
  8503  	}
  8504  	*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(int32(5))
  8505  	_p.Xtz = _sgn * (_nMn + (_nHr * int32(60)))
  8506  _zulu_time:
  8507  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_zDate)))) & int32(1)) != 0 {
  8508  		*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
  8509  		goto _zulu_time
  8510  	}
  8511  	_p.XtzSet = int8(1)
  8512  	return bool2int(int32(*_zDate) != int32(0))
  8513  }
  8514  
  8515  // C comment
  8516  //  /*
  8517  //  ** Convert from YYYY-MM-DD HH:MM:SS to julian day.  We always assume
  8518  //  ** that the YYYY-MM-DD is according to the Gregorian calendar.
  8519  //  **
  8520  //  ** Reference:  Meeus page 61
  8521  //  */
  8522  func _computeJD(tls *crt.TLS, _p *XDateTime) {
  8523  	var _Y, _M, _D, _A, _B, _X1, _X2 int32
  8524  	if _p.XvalidJD != 0 {
  8525  		return
  8526  	}
  8527  	if _p.XvalidYMD != 0 {
  8528  		_Y = _p.XY
  8529  		_M = _p.XM
  8530  		_D = _p.XD
  8531  		goto _2
  8532  	}
  8533  	_Y = int32(2000)
  8534  	_M = int32(1)
  8535  	_D = int32(1)
  8536  _2:
  8537  	if ((_Y < int32(-4713)) || (_Y > int32(9999))) || (_p.XrawS != 0) {
  8538  		_datetimeError(tls, _p)
  8539  		return
  8540  	}
  8541  	if _M <= int32(2) {
  8542  		_Y -= 1
  8543  		_M += int32(12)
  8544  	}
  8545  	_A = _Y / int32(100)
  8546  	_B = (int32(2) - _A) + (_A / int32(4))
  8547  	_X1 = (int32(36525) * (_Y + int32(4716))) / int32(100)
  8548  	_X2 = (int32(306001) * (_M + int32(1))) / int32(10000)
  8549  	_p.XiJD = int64((float64(((_X1+_X2)+_D)+_B) - (1524.5)) * (8.64e+07))
  8550  	_p.XvalidJD = int8(1)
  8551  	if _p.XvalidHMS == 0 {
  8552  		goto _7
  8553  	}
  8554  	_p.XiJD += int64((_p.Xh*int32(3600000))+(_p.Xm*int32(60000))) + int64(_p.Xs*(1000))
  8555  	if _p.XvalidTZ != 0 {
  8556  		_p.XiJD -= int64(_p.Xtz * int32(60000))
  8557  		_p.XvalidYMD = 0
  8558  		_p.XvalidHMS = 0
  8559  		_p.XvalidTZ = 0
  8560  	}
  8561  _7:
  8562  }
  8563  
  8564  // C comment
  8565  //  /*
  8566  //  ** Put the DateTime object into its error state.
  8567  //  */
  8568  func _datetimeError(tls *crt.TLS, _p *XDateTime) {
  8569  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint32(48))
  8570  	_p.XisError = int8(1)
  8571  }
  8572  
  8573  func Xsqlite3_value_bytes(tls *crt.TLS, _pVal *XMem) (r0 int32) {
  8574  	return _sqlite3ValueBytes(tls, _pVal, uint8(1))
  8575  }
  8576  
  8577  func _sqlite3ValueBytes(tls *crt.TLS, _pVal *XMem, _enc uint8) (r0 int32) {
  8578  	var _p *XMem
  8579  	_p = _pVal
  8580  	func() {
  8581  		if (int32(_p.Xflags)&int32(1)) != int32(0) && (int32(_p.Xflags)&int32(18)) != int32(0) {
  8582  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71404), unsafe.Pointer(&_sqlite3ValueBytesØ00__func__Ø000), unsafe.Pointer(str(7152)))
  8583  			crt.X__builtin_abort(tls)
  8584  		}
  8585  	}()
  8586  	if ((int32(_p.Xflags) & int32(2)) != int32(0)) && (int32(_pVal.Xenc) == int32(_enc)) {
  8587  		return _p.Xn
  8588  	}
  8589  	if (int32(_p.Xflags) & int32(16)) == int32(0) {
  8590  		goto _5
  8591  	}
  8592  	if (int32(_p.Xflags) & int32(16384)) != 0 {
  8593  		return _p.Xn + (*(*int32)(unsafe.Pointer(&_p.Xu)))
  8594  	}
  8595  	return _p.Xn
  8596  
  8597  _5:
  8598  	if (int32(_p.Xflags) & int32(1)) != 0 {
  8599  		return int32(0)
  8600  	}
  8601  	return _valueBytes(tls, _pVal, _enc)
  8602  }
  8603  
  8604  var _sqlite3ValueBytesØ00__func__Ø000 [18]int8
  8605  
  8606  func init() {
  8607  	crt.Xstrncpy(nil, &_sqlite3ValueBytesØ00__func__Ø000[0], str(7215), 18)
  8608  }
  8609  
  8610  // C comment
  8611  //  /*
  8612  //  ** The sqlite3ValueBytes() routine returns the number of bytes in the
  8613  //  ** sqlite3_value object assuming that it uses the encoding "enc".
  8614  //  ** The valueBytes() routine is a helper function.
  8615  //  */
  8616  func _valueBytes(tls *crt.TLS, _pVal *XMem, _enc uint8) (r0 int32) {
  8617  	return func() int32 {
  8618  		if _valueToText(tls, _pVal, _enc) != nil {
  8619  			return _pVal.Xn
  8620  		}
  8621  		return int32(0)
  8622  	}()
  8623  }
  8624  
  8625  // C comment
  8626  //  /*
  8627  //  ** Process a modifier to a date-time stamp.  The modifiers are
  8628  //  ** as follows:
  8629  //  **
  8630  //  **     NNN days
  8631  //  **     NNN hours
  8632  //  **     NNN minutes
  8633  //  **     NNN.NNNN seconds
  8634  //  **     NNN months
  8635  //  **     NNN years
  8636  //  **     start of month
  8637  //  **     start of year
  8638  //  **     start of week
  8639  //  **     start of day
  8640  //  **     weekday N
  8641  //  **     unixepoch
  8642  //  **     localtime
  8643  //  **     utc
  8644  //  **
  8645  //  ** Return 0 on success and 1 if there is any kind of error. If the error
  8646  //  ** is in a system call (i.e. localtime()), then an error message is written
  8647  //  ** to context pCtx. If the error is an unrecognized modifier, no error is
  8648  //  ** written to pCtx.
  8649  //  */
  8650  func _parseModifier(tls *crt.TLS, _pCtx *Xsqlite3_context, _z *int8, _n int32, _p *XDateTime) (r0 int32) {
  8651  	var _rc, _17_i, _24_x, _25_y int32
  8652  	var _8_c1, _12_Z, _20_day int64
  8653  	var _20_z2 *int8
  8654  	var _r, _17_rRounder float64
  8655  	var _20_tx XDateTime
  8656  	_rc = int32(1)
  8657  	switch int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(uint8(*elem1(_z, 0))))) {
  8658  	case int32(43):
  8659  		goto _5
  8660  	case int32(45):
  8661  		goto _5
  8662  	case int32(48):
  8663  		goto _5
  8664  	case int32(49):
  8665  		goto _5
  8666  	case int32(50):
  8667  		goto _5
  8668  	case int32(51):
  8669  		goto _5
  8670  	case int32(52):
  8671  		goto _5
  8672  	case int32(53):
  8673  		goto _5
  8674  	case int32(54):
  8675  		goto _5
  8676  	case int32(55):
  8677  		goto _5
  8678  	case int32(56):
  8679  		goto _5
  8680  	case int32(57):
  8681  		goto _5
  8682  	case int32(108):
  8683  		goto _1
  8684  	case int32(115):
  8685  		goto _4
  8686  	case int32(117):
  8687  		goto _2
  8688  	case int32(119):
  8689  		goto _3
  8690  	default:
  8691  		goto _17
  8692  	}
  8693  
  8694  _1:
  8695  	if Xsqlite3_stricmp(tls, _z, str(7233)) == int32(0) {
  8696  		_computeJD(tls, _p)
  8697  		_p.XiJD += _localtimeOffset(tls, _p, _pCtx, &_rc)
  8698  		_clearYMD_HMS_TZ(tls, _p)
  8699  	}
  8700  	goto _19
  8701  _2:
  8702  	if Xsqlite3_stricmp(tls, _z, str(7243)) != int32(0) || _p.XrawS == 0 {
  8703  		goto _21
  8704  	}
  8705  	_r = (_p.Xs * float64(1000)) + (2.1086676e+14)
  8706  	if (_r >= float64(0)) && (_r < (4.642690608e+14)) {
  8707  		_clearYMD_HMS_TZ(tls, _p)
  8708  		_p.XiJD = int64(_r)
  8709  		_p.XvalidJD = int8(1)
  8710  		_p.XrawS = 0
  8711  		_rc = int32(0)
  8712  	}
  8713  	goto _25
  8714  _21:
  8715  	if Xsqlite3_stricmp(tls, _z, str(7253)) != int32(0) {
  8716  		goto _25
  8717  	}
  8718  	if int32(_p.XtzSet) != int32(0) {
  8719  		goto _26
  8720  	}
  8721  	_computeJD(tls, _p)
  8722  	_8_c1 = _localtimeOffset(tls, _p, _pCtx, &_rc)
  8723  	if _rc == int32(0) {
  8724  		_p.XiJD -= _8_c1
  8725  		_clearYMD_HMS_TZ(tls, _p)
  8726  		_p.XiJD += _8_c1 - _localtimeOffset(tls, _p, _pCtx, &_rc)
  8727  	}
  8728  	_p.XtzSet = int8(1)
  8729  	goto _28
  8730  _26:
  8731  	_rc = int32(0)
  8732  _28:
  8733  _25:
  8734  	goto _19
  8735  _3:
  8736  	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) {
  8737  		goto _33
  8738  	}
  8739  	_computeYMD_HMS(tls, _p)
  8740  	_p.XvalidTZ = 0
  8741  	_p.XvalidJD = 0
  8742  	_computeJD(tls, _p)
  8743  	_12_Z = ((_p.XiJD + int64(129600000)) / int64(86400000)) % int64(7)
  8744  	if _12_Z > int64(_n) {
  8745  		_12_Z -= int64(7)
  8746  	}
  8747  	_p.XiJD += (int64(_n) - _12_Z) * int64(86400000)
  8748  	_clearYMD_HMS_TZ(tls, _p)
  8749  	_rc = int32(0)
  8750  _33:
  8751  	goto _19
  8752  _4:
  8753  	if Xsqlite3_strnicmp(tls, _z, str(7266), int32(9)) != int32(0) {
  8754  		goto _19
  8755  	}
  8756  	if ((_p.XvalidJD == 0) && (_p.XvalidYMD == 0)) && (_p.XvalidHMS == 0) {
  8757  		goto _19
  8758  	}
  8759  	*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(int32(9))
  8760  	_computeYMD(tls, _p)
  8761  	_p.XvalidHMS = int8(1)
  8762  	_p.Xh = store2(&_p.Xm, int32(0))
  8763  	_p.Xs = float64(0)
  8764  	_p.XrawS = 0
  8765  	_p.XvalidTZ = 0
  8766  	_p.XvalidJD = 0
  8767  	if Xsqlite3_stricmp(tls, _z, str(7276)) == int32(0) {
  8768  		_p.XD = int32(1)
  8769  		_rc = int32(0)
  8770  		goto _43
  8771  	}
  8772  	if Xsqlite3_stricmp(tls, _z, str(7282)) == int32(0) {
  8773  		_p.XM = int32(1)
  8774  		_p.XD = int32(1)
  8775  		_rc = int32(0)
  8776  		goto _43
  8777  	}
  8778  	if Xsqlite3_stricmp(tls, _z, str(7287)) == int32(0) {
  8779  		_rc = int32(0)
  8780  	}
  8781  _43:
  8782  	goto _19
  8783  _5:
  8784  	_n = int32(1)
  8785  _44:
  8786  	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 {
  8787  		goto _49
  8788  	}
  8789  	_n += 1
  8790  	goto _44
  8791  _49:
  8792  	if _sqlite3AtoF(tls, _z, &_r, _n, uint8(1)) == 0 {
  8793  		_rc = int32(1)
  8794  		goto _19
  8795  	}
  8796  	if int32(*elem1(_z, uintptr(_n))) != int32(58) {
  8797  		goto _51
  8798  	}
  8799  	_20_z2 = _z
  8800  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_20_z2)))) & int32(4)) == 0 {
  8801  		*(*uintptr)(unsafe.Pointer(&_20_z2)) += uintptr(1)
  8802  	}
  8803  	crt.Xmemset(tls, unsafe.Pointer(&_20_tx), int32(0), uint32(48))
  8804  	if _parseHhMmSs(tls, _20_z2, &_20_tx) != 0 {
  8805  		goto _19
  8806  	}
  8807  	_computeJD(tls, &_20_tx)
  8808  	_20_tx.XiJD -= int64(43200000)
  8809  	_20_day = _20_tx.XiJD / int64(86400000)
  8810  	_20_tx.XiJD -= _20_day * int64(86400000)
  8811  	if int32(*elem1(_z, 0)) == int32(45) {
  8812  		_20_tx.XiJD = -_20_tx.XiJD
  8813  	}
  8814  	_computeJD(tls, _p)
  8815  	_clearYMD_HMS_TZ(tls, _p)
  8816  	_p.XiJD += _20_tx.XiJD
  8817  	_rc = int32(0)
  8818  	goto _19
  8819  _51:
  8820  	*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_n)
  8821  _55:
  8822  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_z)))) & int32(1)) != 0 {
  8823  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
  8824  		goto _55
  8825  	}
  8826  	_n = _sqlite3Strlen30(tls, _z)
  8827  	if (_n > int32(10)) || (_n < int32(3)) {
  8828  		goto _19
  8829  	}
  8830  	if int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(uint8(*elem1(_z, uintptr(_n-int32(1))))))) == int32(115) {
  8831  		_n -= 1
  8832  	}
  8833  	_computeJD(tls, _p)
  8834  	_rc = int32(1)
  8835  	_17_rRounder = func() float64 {
  8836  		if _r < (0) {
  8837  			return (-0.5)
  8838  		}
  8839  		return (0.5)
  8840  	}()
  8841  	_17_i = int32(0)
  8842  _62:
  8843  	if _17_i >= int32(6) {
  8844  		goto _65
  8845  	}
  8846  	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) {
  8847  		goto _69
  8848  	}
  8849  	switch int32(elem21((*t22)(unsafe.Pointer(&_aXformType)), uintptr(_17_i)).XeType) {
  8850  	case int32(1):
  8851  		goto _71
  8852  	case int32(2):
  8853  		goto _72
  8854  	default:
  8855  		goto _73
  8856  	}
  8857  
  8858  _71:
  8859  	_computeYMD_HMS(tls, _p)
  8860  	_p.XM += int32(_r)
  8861  	_24_x = func() int32 {
  8862  		if _p.XM > int32(0) {
  8863  			return ((_p.XM - int32(1)) / int32(12))
  8864  		}
  8865  		return ((_p.XM - int32(12)) / int32(12))
  8866  	}()
  8867  	_p.XY += _24_x
  8868  	_p.XM -= _24_x * int32(12)
  8869  	_p.XvalidJD = 0
  8870  	_r -= float64(int32(_r))
  8871  	goto _73
  8872  _72:
  8873  	_25_y = int32(_r)
  8874  	_computeYMD_HMS(tls, _p)
  8875  	_p.XY += _25_y
  8876  	_p.XvalidJD = 0
  8877  	_r -= float64(int32(_r))
  8878  	goto _73
  8879  _73:
  8880  	_computeJD(tls, _p)
  8881  	_p.XiJD += int64((_r * (elem21((*t22)(unsafe.Pointer(&_aXformType)), uintptr(_17_i)).XrXform)) + _17_rRounder)
  8882  	_rc = int32(0)
  8883  	goto _65
  8884  _69:
  8885  	_17_i += 1
  8886  	goto _62
  8887  _65:
  8888  	_clearYMD_HMS_TZ(tls, _p)
  8889  	goto _19
  8890  _17:
  8891  	goto _19
  8892  _19:
  8893  	return _rc
  8894  }
  8895  
  8896  // C comment
  8897  //  /*
  8898  //  ** Some systems have stricmp().  Others have strcasecmp().  Because
  8899  //  ** there is no consistency, we will define our own.
  8900  //  **
  8901  //  ** IMPLEMENTATION-OF: R-30243-02494 The sqlite3_stricmp() and
  8902  //  ** sqlite3_strnicmp() APIs allow applications and extensions to compare
  8903  //  ** the contents of two buffers containing UTF-8 strings in a
  8904  //  ** case-independent fashion, using the same definition of "case
  8905  //  ** independence" that SQLite uses internally when comparing identifiers.
  8906  //  */
  8907  func Xsqlite3_stricmp(tls *crt.TLS, _zLeft *int8, _zRight *int8) (r0 int32) {
  8908  	if _zLeft == nil {
  8909  		return func() int32 {
  8910  			if _zRight != nil {
  8911  				return int32(-1)
  8912  			}
  8913  			return int32(0)
  8914  		}()
  8915  	}
  8916  	if _zRight == nil {
  8917  		return int32(1)
  8918  	}
  8919  	return _sqlite3StrICmp(tls, _zLeft, _zRight)
  8920  }
  8921  
  8922  // C comment
  8923  //  /*
  8924  //  ** Compute the difference (in milliseconds) between localtime and UTC
  8925  //  ** (a.k.a. GMT) for the time value p where p is in UTC. If no error occurs,
  8926  //  ** return this value and set *pRc to SQLITE_OK.
  8927  //  **
  8928  //  ** Or, if an error does occur, set *pRc to SQLITE_ERROR. The returned value
  8929  //  ** is undefined in this case.
  8930  //  */
  8931  func _localtimeOffset(tls *crt.TLS, _p *XDateTime, _pCtx *Xsqlite3_context, _pRc *int32) (r0 int64) {
  8932  	var _t, _2_s int32
  8933  	var _sLocal crt.Xtm
  8934  	var _x, _y XDateTime
  8935  	crt.Xmemset(tls, unsafe.Pointer(&_sLocal), int32(0), uint32(44))
  8936  	_x = *_p
  8937  	_computeYMD_HMS(tls, &_x)
  8938  	if (_x.XY < int32(1971)) || (_x.XY >= int32(2038)) {
  8939  		_x.XY = int32(2000)
  8940  		_x.XM = int32(1)
  8941  		_x.XD = int32(1)
  8942  		_x.Xh = int32(0)
  8943  		_x.Xm = int32(0)
  8944  		_x.Xs = float64(0)
  8945  		goto _2
  8946  	}
  8947  	_2_s = int32(_x.Xs + (0.5))
  8948  	_x.Xs = float64(_2_s)
  8949  _2:
  8950  	_x.Xtz = int32(0)
  8951  	_x.XvalidJD = 0
  8952  	_computeJD(tls, &_x)
  8953  	_t = int32((_x.XiJD / int64(1000)) - int64(210866760000))
  8954  	if _osLocaltime(tls, &_t, &_sLocal) != 0 {
  8955  		Xsqlite3_result_error(tls, _pCtx, str(7291), int32(-1))
  8956  		*_pRc = int32(1)
  8957  		return 0
  8958  	}
  8959  	_y.XY = _sLocal.Xtm_year + int32(1900)
  8960  	_y.XM = _sLocal.Xtm_mon + int32(1)
  8961  	_y.XD = _sLocal.Xtm_mday
  8962  	_y.Xh = _sLocal.Xtm_hour
  8963  	_y.Xm = _sLocal.Xtm_min
  8964  	_y.Xs = float64(_sLocal.Xtm_sec)
  8965  	_y.XvalidYMD = int8(1)
  8966  	_y.XvalidHMS = int8(1)
  8967  	_y.XvalidJD = 0
  8968  	_y.XrawS = 0
  8969  	_y.XvalidTZ = 0
  8970  	_y.XisError = 0
  8971  	_computeJD(tls, &_y)
  8972  	*_pRc = int32(0)
  8973  	return _y.XiJD - _x.XiJD
  8974  }
  8975  
  8976  // C comment
  8977  //  /*
  8978  //  ** Compute both YMD and HMS
  8979  //  */
  8980  func _computeYMD_HMS(tls *crt.TLS, _p *XDateTime) {
  8981  	_computeYMD(tls, _p)
  8982  	_computeHMS(tls, _p)
  8983  }
  8984  
  8985  // C comment
  8986  //  /*
  8987  //  ** Compute the Year, Month, and Day from the julian day number.
  8988  //  */
  8989  func _computeYMD(tls *crt.TLS, _p *XDateTime) {
  8990  	var _Z, _A, _B, _C, _D, _E, _X1 int32
  8991  	if _p.XvalidYMD != 0 {
  8992  		return
  8993  	}
  8994  	if _p.XvalidJD == 0 {
  8995  		_p.XY = int32(2000)
  8996  		_p.XM = int32(1)
  8997  		_p.XD = int32(1)
  8998  		goto _4
  8999  	}
  9000  	if _validJulianDay(tls, _p.XiJD) == 0 {
  9001  		_datetimeError(tls, _p)
  9002  		return
  9003  	}
  9004  	_Z = int32((_p.XiJD + int64(43200000)) / int64(86400000))
  9005  	_A = int32((float64(_Z) - (1.86721625e+06)) / (36524.25))
  9006  	_A = ((_Z + int32(1)) + _A) - (_A / int32(4))
  9007  	_B = _A + int32(1524)
  9008  	_C = int32((float64(_B) - (122.1)) / (365.25))
  9009  	_D = (int32(36525) * (_C & int32(32767))) / int32(100)
  9010  	_E = int32(float64(_B-_D) / (30.6001))
  9011  	_X1 = int32((30.6001) * float64(_E))
  9012  	_p.XD = (_B - _D) - _X1
  9013  	_p.XM = func() int32 {
  9014  		if _E < int32(14) {
  9015  			return (_E - int32(1))
  9016  		}
  9017  		return (_E - int32(13))
  9018  	}()
  9019  	_p.XY = func() int32 {
  9020  		if _p.XM > int32(2) {
  9021  			return (_C - int32(4716))
  9022  		}
  9023  		return (_C - int32(4715))
  9024  	}()
  9025  _4:
  9026  	_p.XvalidYMD = int8(1)
  9027  }
  9028  
  9029  // C comment
  9030  //  /*
  9031  //  ** Return TRUE if the given julian day number is within range.
  9032  //  **
  9033  //  ** The input is the JulianDay times 86400000.
  9034  //  */
  9035  func _validJulianDay(tls *crt.TLS, _iJD int64) (r0 int32) {
  9036  	return bool2int((_iJD >= (0)) && (_iJD <= int64(464269060799999)))
  9037  }
  9038  
  9039  // C comment
  9040  //  /*
  9041  //  ** Compute the Hour, Minute, and Seconds from the julian day number.
  9042  //  */
  9043  func _computeHMS(tls *crt.TLS, _p *XDateTime) {
  9044  	var _s int32
  9045  	if _p.XvalidHMS != 0 {
  9046  		return
  9047  	}
  9048  	_computeJD(tls, _p)
  9049  	_s = int32((_p.XiJD + int64(43200000)) % int64(86400000))
  9050  	_p.Xs = float64(_s) / float64(1000)
  9051  	_s = int32(_p.Xs)
  9052  	_p.Xs -= float64(_s)
  9053  	_p.Xh = _s / int32(3600)
  9054  	_s -= _p.Xh * int32(3600)
  9055  	_p.Xm = _s / int32(60)
  9056  	_p.Xs += float64(_s - (_p.Xm * int32(60)))
  9057  	_p.XrawS = 0
  9058  	_p.XvalidHMS = int8(1)
  9059  }
  9060  
  9061  // C comment
  9062  //  /*
  9063  //  ** The following routine implements the rough equivalent of localtime_r()
  9064  //  ** using whatever operating-system specific localtime facility that
  9065  //  ** is available.  This routine returns 0 on success and
  9066  //  ** non-zero on any kind of error.
  9067  //  **
  9068  //  ** If the sqlite3GlobalConfig.bLocaltimeFault variable is true then this
  9069  //  ** routine will always fail.
  9070  //  **
  9071  //  ** EVIDENCE-OF: R-62172-00036 In this implementation, the standard C
  9072  //  ** library function localtime_r() is used to assist in the calculation of
  9073  //  ** local time.
  9074  //  */
  9075  func _osLocaltime(tls *crt.TLS, _t *int32, _pTm *crt.Xtm) (r0 int32) {
  9076  	var _rc int32
  9077  	var _mutex *Xsqlite3_mutex
  9078  	var _pX *crt.Xtm
  9079  	_mutex = _sqlite3MutexAlloc(tls, int32(2))
  9080  	Xsqlite3_mutex_enter(tls, _mutex)
  9081  	_pX = crt.Xlocaltime(tls, _t)
  9082  	if _sqlite3Config.XbLocaltimeFault != 0 {
  9083  		_pX = nil
  9084  	}
  9085  	if _pX != nil {
  9086  		*_pTm = *_pX
  9087  	}
  9088  	Xsqlite3_mutex_leave(tls, _mutex)
  9089  	_rc = bool2int(_pX == nil)
  9090  	return _rc
  9091  }
  9092  
  9093  func Xsqlite3_result_error(tls *crt.TLS, _pCtx *Xsqlite3_context, _z *int8, _n int32) {
  9094  	func() {
  9095  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
  9096  			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)))
  9097  			crt.X__builtin_abort(tls)
  9098  		}
  9099  	}()
  9100  	_pCtx.XisError = int32(1)
  9101  	_pCtx.XfErrorOrAux = uint8(1)
  9102  	_sqlite3VdbeMemSetStr(tls, (*XMem)(_pCtx.XpOut), _z, _n, uint8(1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
  9103  }
  9104  
  9105  var _sqlite3_result_errorØ00__func__Ø000 [21]int8
  9106  
  9107  func init() {
  9108  	crt.Xstrncpy(nil, &_sqlite3_result_errorØ00__func__Ø000[0], str(7314), 21)
  9109  }
  9110  
  9111  // C comment
  9112  //  /*
  9113  //  ** Clear the YMD and HMS and the TZ
  9114  //  */
  9115  func _clearYMD_HMS_TZ(tls *crt.TLS, _p *XDateTime) {
  9116  	_p.XvalidYMD = 0
  9117  	_p.XvalidHMS = 0
  9118  	_p.XvalidTZ = 0
  9119  }
  9120  
  9121  func Xsqlite3_strnicmp(tls *crt.TLS, _zLeft *int8, _zRight *int8, _N int32) (r0 int32) {
  9122  	var _a, _b *uint8
  9123  	if _zLeft == nil {
  9124  		return func() int32 {
  9125  			if _zRight != nil {
  9126  				return int32(-1)
  9127  			}
  9128  			return int32(0)
  9129  		}()
  9130  	}
  9131  	if _zRight == nil {
  9132  		return int32(1)
  9133  	}
  9134  	_a = (*uint8)(unsafe.Pointer(_zLeft))
  9135  	_b = (*uint8)(unsafe.Pointer(_zRight))
  9136  _5:
  9137  	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)))) {
  9138  		*(*uintptr)(unsafe.Pointer(&_a)) += uintptr(1)
  9139  		*(*uintptr)(unsafe.Pointer(&_b)) += uintptr(1)
  9140  		goto _5
  9141  	}
  9142  	return func() int32 {
  9143  		if _N < int32(0) {
  9144  			return int32(0)
  9145  		}
  9146  		return (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(*_a))) - int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(*_b))))
  9147  	}()
  9148  }
  9149  
  9150  // C comment
  9151  //  /*
  9152  //  ** The following table defines various date transformations of the form
  9153  //  **
  9154  //  **            'NNN days'
  9155  //  **
  9156  //  ** Where NNN is an arbitrary floating-point number and "days" can be one
  9157  //  ** of several units of time.
  9158  //  */
  9159  var _aXformType [6]t22
  9160  
  9161  func init() {
  9162  	_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}}
  9163  }
  9164  
  9165  func Xsqlite3_result_double(tls *crt.TLS, _pCtx *Xsqlite3_context, _rVal float64) {
  9166  	func() {
  9167  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
  9168  			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)))
  9169  			crt.X__builtin_abort(tls)
  9170  		}
  9171  	}()
  9172  	_sqlite3VdbeMemSetDouble(tls, (*XMem)(_pCtx.XpOut), _rVal)
  9173  }
  9174  
  9175  var _sqlite3_result_doubleØ00__func__Ø000 [22]int8
  9176  
  9177  func init() {
  9178  	crt.Xstrncpy(nil, &_sqlite3_result_doubleØ00__func__Ø000[0], str(7354), 22)
  9179  }
  9180  
  9181  // C comment
  9182  //  /*
  9183  //  ** Delete any previous value and set the value stored in *pMem to val,
  9184  //  ** manifest type REAL.
  9185  //  */
  9186  func _sqlite3VdbeMemSetDouble(tls *crt.TLS, _pMem *XMem, _val float64) {
  9187  	_sqlite3VdbeMemSetNull(tls, _pMem)
  9188  	if _sqlite3IsNaN(tls, _val) == 0 {
  9189  		*(*float64)(unsafe.Pointer(&_pMem.Xu)) = _val
  9190  		_pMem.Xflags = uint16(8)
  9191  	}
  9192  }
  9193  
  9194  // C comment
  9195  //  /*
  9196  //  ** Return true if the floating point value is Not a Number (NaN).
  9197  //  **
  9198  //  ** Use the math library isnan() function if compiled with SQLITE_HAVE_ISNAN.
  9199  //  ** Otherwise, we have our own implementation that works on most systems.
  9200  //  */
  9201  func _sqlite3IsNaN(tls *crt.TLS, _x float64) (r0 int32) {
  9202  	var _rc int32
  9203  	var _y, _z float64
  9204  	_y = _x
  9205  	_z = _y
  9206  	_rc = bool2int(_y != _z)
  9207  	return _rc
  9208  }
  9209  
  9210  // C comment
  9211  //  /*
  9212  //  **    date( TIMESTRING, MOD, MOD, ...)
  9213  //  **
  9214  //  ** Return YYYY-MM-DD
  9215  //  */
  9216  func _dateFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
  9217  	var _x XDateTime
  9218  	var _1_zBuf [100]int8
  9219  	if _isDate(tls, _context, _argc, _argv, &_x) == int32(0) {
  9220  		_computeYMD(tls, &_x)
  9221  		Xsqlite3_snprintf(tls, int32(100), (*int8)(unsafe.Pointer(&_1_zBuf)), str(7376), _x.XY, _x.XM, _x.XD)
  9222  		Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(&_1_zBuf)), int32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
  9223  	}
  9224  	_ = _1_zBuf
  9225  }
  9226  
  9227  // C comment
  9228  //  /*
  9229  //  **    time( TIMESTRING, MOD, MOD, ...)
  9230  //  **
  9231  //  ** Return HH:MM:SS
  9232  //  */
  9233  func _timeFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
  9234  	var _x XDateTime
  9235  	var _1_zBuf [100]int8
  9236  	if _isDate(tls, _context, _argc, _argv, &_x) == int32(0) {
  9237  		_computeHMS(tls, &_x)
  9238  		Xsqlite3_snprintf(tls, int32(100), (*int8)(unsafe.Pointer(&_1_zBuf)), str(7391), _x.Xh, _x.Xm, int32(_x.Xs))
  9239  		Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(&_1_zBuf)), int32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
  9240  	}
  9241  	_ = _1_zBuf
  9242  }
  9243  
  9244  // C comment
  9245  //  /*
  9246  //  **    datetime( TIMESTRING, MOD, MOD, ...)
  9247  //  **
  9248  //  ** Return YYYY-MM-DD HH:MM:SS
  9249  //  */
  9250  func _datetimeFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
  9251  	var _x XDateTime
  9252  	var _1_zBuf [100]int8
  9253  	if _isDate(tls, _context, _argc, _argv, &_x) == int32(0) {
  9254  		_computeYMD_HMS(tls, &_x)
  9255  		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))
  9256  		Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(&_1_zBuf)), int32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
  9257  	}
  9258  	_ = _1_zBuf
  9259  }
  9260  
  9261  // C comment
  9262  //  /*
  9263  //  **    strftime( FORMAT, TIMESTRING, MOD, MOD, ...)
  9264  //  **
  9265  //  ** Return a string described by FORMAT.  Conversions as follows:
  9266  //  **
  9267  //  **   %d  day of month
  9268  //  **   %f  ** fractional seconds  SS.SSS
  9269  //  **   %H  hour 00-24
  9270  //  **   %j  day of year 000-366
  9271  //  **   %J  ** julian day number
  9272  //  **   %m  month 01-12
  9273  //  **   %M  minute 00-59
  9274  //  **   %s  seconds since 1970-01-01
  9275  //  **   %S  seconds 00-59
  9276  //  **   %w  day of week 0-6  sunday==0
  9277  //  **   %W  week of year 00-53
  9278  //  **   %Y  year 0000-9999
  9279  //  **   %%  %
  9280  //  */
  9281  func _strftimeFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
  9282  	var _13_nDay, _14_wd int32
  9283  	var _i, _j uint32
  9284  	var _n uint64
  9285  	var _z, _zFmt *int8
  9286  	var _12_s float64
  9287  	var _db *Xsqlite3
  9288  	var _x, _13_y XDateTime
  9289  	var _zBuf [100]int8
  9290  	if _argc == int32(0) {
  9291  		return
  9292  	}
  9293  	_zFmt = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, 0))))
  9294  	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(4))))))))))), &_x) != 0 {
  9295  		return
  9296  	}
  9297  	_db = Xsqlite3_context_db_handle(tls, _context)
  9298  	*func() *uint64 { _i = 0; return &_n }() = uint64(1)
  9299  _3:
  9300  	if (*elem1(_zFmt, uintptr(_i))) == 0 {
  9301  		goto _6
  9302  	}
  9303  	if int32(*elem1(_zFmt, uintptr(_i))) != int32(37) {
  9304  		goto _7
  9305  	}
  9306  	switch int32(*elem1(_zFmt, uintptr(_i+uint32(1)))) {
  9307  	case int32(37):
  9308  		goto _15
  9309  	case int32(72):
  9310  		goto _9
  9311  	case int32(74):
  9312  		goto _20
  9313  	case int32(77):
  9314  		goto _9
  9315  	case int32(83):
  9316  		goto _9
  9317  	case int32(87):
  9318  		goto _9
  9319  	case int32(89):
  9320  		goto _19
  9321  	case int32(100):
  9322  		goto _9
  9323  	case int32(102):
  9324  		goto _17
  9325  	case int32(106):
  9326  		goto _18
  9327  	case int32(109):
  9328  		goto _9
  9329  	case int32(115):
  9330  		goto _20
  9331  	case int32(119):
  9332  		goto _15
  9333  	default:
  9334  		goto _22
  9335  	}
  9336  
  9337  _9:
  9338  	_n += 1
  9339  _15:
  9340  	goto _23
  9341  _17:
  9342  	_n += uint64(8)
  9343  	goto _23
  9344  _18:
  9345  	_n += uint64(3)
  9346  	goto _23
  9347  _19:
  9348  	_n += uint64(8)
  9349  	goto _23
  9350  _20:
  9351  	_n += uint64(50)
  9352  	goto _23
  9353  _22:
  9354  	return
  9355  _23:
  9356  	_i += 1
  9357  _7:
  9358  	*func() *uint64 { _i += 1; return &_n }() += 1
  9359  	goto _3
  9360  _6:
  9361  	if _n < uint64(100) {
  9362  		_z = (*int8)(unsafe.Pointer(&_zBuf))
  9363  		goto _27
  9364  	}
  9365  	if _n > uint64(*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), 0)) {
  9366  		Xsqlite3_result_error_toobig(tls, _context)
  9367  		return
  9368  	}
  9369  	_z = (*int8)(_sqlite3DbMallocRawNN(tls, _db, uint64(int32(_n))))
  9370  	if _z == nil {
  9371  		Xsqlite3_result_error_nomem(tls, _context)
  9372  		return
  9373  	}
  9374  _27:
  9375  	_computeJD(tls, &_x)
  9376  	_computeYMD_HMS(tls, &_x)
  9377  	_i = store23(&_j, 0)
  9378  _29:
  9379  	if (*elem1(_zFmt, uintptr(_i))) == 0 {
  9380  		goto _32
  9381  	}
  9382  	if int32(*elem1(_zFmt, uintptr(_i))) != int32(37) {
  9383  		*elem1(_z, uintptr(postInc23(&_j, uint32(1)))) = *elem1(_zFmt, uintptr(_i))
  9384  		goto _34
  9385  	}
  9386  	_i += 1
  9387  	switch int32(*elem1(_zFmt, uintptr(_i))) {
  9388  	case int32(72):
  9389  		goto _38
  9390  	case int32(74):
  9391  		goto _41
  9392  	case int32(77):
  9393  		goto _43
  9394  	case int32(83):
  9395  		goto _45
  9396  	case int32(87):
  9397  		goto _39
  9398  	case int32(89):
  9399  		goto _47
  9400  	case int32(100):
  9401  		goto _36
  9402  	case int32(102):
  9403  		goto _37
  9404  	case int32(106):
  9405  		goto _39
  9406  	case int32(109):
  9407  		goto _42
  9408  	case int32(115):
  9409  		goto _44
  9410  	case int32(119):
  9411  		goto _46
  9412  	default:
  9413  		goto _48
  9414  	}
  9415  
  9416  _36:
  9417  	Xsqlite3_snprintf(tls, int32(3), elem1(_z, uintptr(_j)), str(7436), _x.XD)
  9418  	_j += uint32(2)
  9419  	goto _49
  9420  _37:
  9421  	_12_s = _x.Xs
  9422  	if _12_s > (59.999) {
  9423  		_12_s = 59.999
  9424  	}
  9425  	Xsqlite3_snprintf(tls, int32(7), elem1(_z, uintptr(_j)), str(7441), _12_s)
  9426  	_j += uint32(_sqlite3Strlen30(tls, elem1(_z, uintptr(_j))))
  9427  	goto _49
  9428  _38:
  9429  	Xsqlite3_snprintf(tls, int32(3), elem1(_z, uintptr(_j)), str(7436), _x.Xh)
  9430  	_j += uint32(2)
  9431  	goto _49
  9432  _39:
  9433  	_13_y = _x
  9434  	_13_y.XvalidJD = 0
  9435  	_13_y.XM = int32(1)
  9436  	_13_y.XD = int32(1)
  9437  	_computeJD(tls, &_13_y)
  9438  	_13_nDay = int32(((_x.XiJD - _13_y.XiJD) + int64(43200000)) / int64(86400000))
  9439  	if int32(*elem1(_zFmt, uintptr(_i))) == int32(87) {
  9440  		_14_wd = int32(((_x.XiJD + int64(43200000)) / int64(86400000)) % int64(7))
  9441  		Xsqlite3_snprintf(tls, int32(3), elem1(_z, uintptr(_j)), str(7436), ((_13_nDay+int32(7))-_14_wd)/int32(7))
  9442  		_j += uint32(2)
  9443  		goto _52
  9444  	}
  9445  	Xsqlite3_snprintf(tls, int32(4), elem1(_z, uintptr(_j)), str(7448), _13_nDay+int32(1))
  9446  	_j += uint32(3)
  9447  _52:
  9448  	goto _49
  9449  _41:
  9450  	Xsqlite3_snprintf(tls, int32(20), elem1(_z, uintptr(_j)), str(7453), float64(_x.XiJD)/(8.64e+07))
  9451  	_j += uint32(_sqlite3Strlen30(tls, elem1(_z, uintptr(_j))))
  9452  	goto _49
  9453  _42:
  9454  	Xsqlite3_snprintf(tls, int32(3), elem1(_z, uintptr(_j)), str(7436), _x.XM)
  9455  	_j += uint32(2)
  9456  	goto _49
  9457  _43:
  9458  	Xsqlite3_snprintf(tls, int32(3), elem1(_z, uintptr(_j)), str(7436), _x.Xm)
  9459  	_j += uint32(2)
  9460  	goto _49
  9461  _44:
  9462  	Xsqlite3_snprintf(tls, int32(30), elem1(_z, uintptr(_j)), str(6249), (_x.XiJD/int64(1000))-int64(210866760000))
  9463  	_j += uint32(_sqlite3Strlen30(tls, elem1(_z, uintptr(_j))))
  9464  	goto _49
  9465  _45:
  9466  	Xsqlite3_snprintf(tls, int32(3), elem1(_z, uintptr(_j)), str(7436), int32(_x.Xs))
  9467  	_j += uint32(2)
  9468  	goto _49
  9469  _46:
  9470  	*elem1(_z, uintptr(postInc23(&_j, uint32(1)))) = int8(int32(int8(((_x.XiJD+int64(129600000))/int64(86400000))%int64(7))) + int32(48))
  9471  	goto _49
  9472  _47:
  9473  	Xsqlite3_snprintf(tls, int32(5), elem1(_z, uintptr(_j)), str(7459), _x.XY)
  9474  	_j += uint32(_sqlite3Strlen30(tls, elem1(_z, uintptr(_j))))
  9475  	goto _49
  9476  _48:
  9477  	*elem1(_z, uintptr(postInc23(&_j, uint32(1)))) = int8(37)
  9478  	goto _49
  9479  _49:
  9480  _34:
  9481  	_i += 1
  9482  	goto _29
  9483  _32:
  9484  	*elem1(_z, uintptr(_j)) = 0
  9485  	Xsqlite3_result_text(tls, _context, _z, int32(-1), func() func(*crt.TLS, unsafe.Pointer) {
  9486  		if _z == (*int8)(unsafe.Pointer(&_zBuf)) {
  9487  			return (*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
  9488  		}
  9489  		return func() func(*crt.TLS, unsafe.Pointer) {
  9490  			v := _sqlite3MallocSize
  9491  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
  9492  		}()
  9493  	}())
  9494  	_ = _zBuf
  9495  }
  9496  
  9497  // C comment
  9498  //  /* An SQLITE_NOMEM error. */
  9499  func Xsqlite3_result_error_nomem(tls *crt.TLS, _pCtx *Xsqlite3_context) {
  9500  	func() {
  9501  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
  9502  			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)))
  9503  			crt.X__builtin_abort(tls)
  9504  		}
  9505  	}()
  9506  	_sqlite3VdbeMemSetNull(tls, (*XMem)(_pCtx.XpOut))
  9507  	_pCtx.XisError = _sqlite3NomemError(tls, int32(76578))
  9508  	_pCtx.XfErrorOrAux = uint8(1)
  9509  	_sqlite3OomFault(tls, (*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb))
  9510  }
  9511  
  9512  var _sqlite3_result_error_nomemØ00__func__Ø000 [27]int8
  9513  
  9514  func init() {
  9515  	crt.Xstrncpy(nil, &_sqlite3_result_error_nomemØ00__func__Ø000[0], str(7464), 27)
  9516  }
  9517  
  9518  // C comment
  9519  //  /*
  9520  //  ** current_time()
  9521  //  **
  9522  //  ** This function returns the same value as time('now').
  9523  //  */
  9524  func _ctimeFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
  9525  	_ = _NotUsed2
  9526  
  9527  	_timeFunc(tls, _context, int32(0), nil)
  9528  }
  9529  
  9530  // C comment
  9531  //  /*
  9532  //  ** current_timestamp()
  9533  //  **
  9534  //  ** This function returns the same value as datetime('now').
  9535  //  */
  9536  func _ctimestampFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
  9537  	_ = _NotUsed2
  9538  
  9539  	_datetimeFunc(tls, _context, int32(0), nil)
  9540  }
  9541  
  9542  // C comment
  9543  //  /*
  9544  //  ** current_date()
  9545  //  **
  9546  //  ** This function returns the same value as date('now').
  9547  //  */
  9548  func _cdateFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
  9549  	_ = _NotUsed2
  9550  
  9551  	_dateFunc(tls, _context, int32(0), nil)
  9552  }
  9553  
  9554  var _sqlite3RegisterBuiltinFunctionsØ00aBuiltinFuncØ001 [60]XFuncDef
  9555  
  9556  func init() {
  9557  	_sqlite3RegisterBuiltinFunctionsØ00aBuiltinFuncØ001 = [60]XFuncDef{XFuncDef{XnArg: int8(1), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9558  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9559  	}{_loadExt})), XzName: str(7491)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9560  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9561  	}{_loadExt})), XzName: str(7491)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(8193), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9562  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9563  	}{_compileoptionusedFunc})), XzName: str(7506)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(8193), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9564  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9565  	}{_compileoptiongetFunc})), XzName: str(7532)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(3073), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9566  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9567  	}{_versionFunc})), XzName: str(7557)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(3073), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9568  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9569  	}{_versionFunc})), XzName: str(7566)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(3073), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9570  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9571  	}{_versionFunc})), XzName: str(7577)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(18433), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9572  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9573  	}{_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 {
  9574  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9575  	}{_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 {
  9576  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9577  	}{_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 {
  9578  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9579  	}{_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 {
  9580  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9581  	}{_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 {
  9582  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9583  	}{_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 {
  9584  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9585  	}{_trimFunc})), XzName: str(7605)}, XFuncDef{XnArg: int8(-1), XfuncFlags: uint16(2081), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9586  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9587  	}{_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 {
  9588  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9589  	}{_minmaxStep})), XxFinalize: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  9590  		f func(*crt.TLS, *Xsqlite3_context)
  9591  	}{_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 {
  9592  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9593  	}{_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 {
  9594  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9595  	}{_minmaxStep})), XxFinalize: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  9596  		f func(*crt.TLS, *Xsqlite3_context)
  9597  	}{_minMaxFinalize})), XzName: str(7614)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(2177), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9598  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9599  	}{_typeofFunc})), XzName: str(7618)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(2113), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9600  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9601  	}{_lengthFunc})), XzName: str(7625)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9602  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9603  	}{_instrFunc})), XzName: str(7632)}, XFuncDef{XnArg: int8(-1), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9604  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9605  	}{_printfFunc})), XzName: str(7638)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9606  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9607  	}{_unicodeFunc})), XzName: str(7645)}, XFuncDef{XnArg: int8(-1), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9608  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9609  	}{_charFunc})), XzName: str(7653)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9610  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9611  	}{_absFunc})), XzName: str(7658)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9612  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9613  	}{_roundFunc})), XzName: str(7662)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9614  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9615  	}{_roundFunc})), XzName: str(7662)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9616  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9617  	}{_upperFunc})), XzName: str(7668)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9618  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9619  	}{_lowerFunc})), XzName: str(7674)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9620  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9621  	}{_hexFunc})), XzName: str(7680)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(2561), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9622  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9623  	}{_versionFunc})), XzName: str(7684)}, XFuncDef{XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9624  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9625  	}{_randomFunc})), XzName: str(7691)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9626  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9627  	}{_randomBlob})), XzName: str(7698)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(2081), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9628  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9629  	}{_nullifFunc})), XzName: str(7709)}, XFuncDef{XfuncFlags: uint16(8193), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9630  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9631  	}{_versionFunc})), XzName: str(7716)}, XFuncDef{XfuncFlags: uint16(8193), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9632  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9633  	}{_sourceidFunc})), XzName: str(7731)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9634  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9635  	}{_errlogFunc})), XzName: str(7748)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9636  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9637  	}{_quoteFunc})), XzName: str(7759)}, XFuncDef{XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9638  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9639  	}{_last_insert_rowid})), XzName: str(7765)}, XFuncDef{XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9640  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9641  	}{_changes})), XzName: str(7783)}, XFuncDef{XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9642  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9643  	}{_total_changes})), XzName: str(7791)}, XFuncDef{XnArg: int8(3), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9644  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9645  	}{_replaceFunc})), XzName: str(7805)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9646  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9647  	}{_zeroblobFunc})), XzName: str(7813)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9648  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9649  	}{_substrFunc})), XzName: str(7822)}, XFuncDef{XnArg: int8(3), XfuncFlags: uint16(2049), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9650  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9651  	}{_substrFunc})), XzName: str(7822)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9652  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9653  	}{_sumStep})), XxFinalize: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  9654  		f func(*crt.TLS, *Xsqlite3_context)
  9655  	}{_sumFinalize})), XzName: str(7829)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9656  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9657  	}{_sumStep})), XxFinalize: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  9658  		f func(*crt.TLS, *Xsqlite3_context)
  9659  	}{_totalFinalize})), XzName: str(7833)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9660  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9661  	}{_sumStep})), XxFinalize: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  9662  		f func(*crt.TLS, *Xsqlite3_context)
  9663  	}{_avgFinalize})), XzName: str(7839)}, XFuncDef{XfuncFlags: uint16(257), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9664  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9665  	}{_countStep})), XxFinalize: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  9666  		f func(*crt.TLS, *Xsqlite3_context)
  9667  	}{_countFinalize})), XzName: str(7843)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9668  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9669  	}{_countStep})), XxFinalize: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  9670  		f func(*crt.TLS, *Xsqlite3_context)
  9671  	}{_countFinalize})), XzName: str(7843)}, XFuncDef{XnArg: int8(1), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9672  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9673  	}{_groupConcatStep})), XxFinalize: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  9674  		f func(*crt.TLS, *Xsqlite3_context)
  9675  	}{_groupConcatFinalize})), XzName: str(7849)}, XFuncDef{XnArg: int8(2), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
  9676  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9677  	}{_groupConcatStep})), XxFinalize: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
  9678  		f func(*crt.TLS, *Xsqlite3_context)
  9679  	}{_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 {
  9680  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9681  	}{_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 {
  9682  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9683  	}{_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 {
  9684  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9685  	}{_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 {
  9686  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
  9687  	}{_versionFunc})), XzName: str(7872)}}
  9688  }
  9689  
  9690  // C comment
  9691  //  /*
  9692  //  ** A function that loads a shared-library extension then returns NULL.
  9693  //  */
  9694  func _loadExt(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
  9695  	var _zFile, _zProc, _zErrMsg *int8
  9696  	var _db *Xsqlite3
  9697  	_zFile = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, 0))))
  9698  	_db = Xsqlite3_context_db_handle(tls, _context)
  9699  	_zErrMsg = nil
  9700  	if (_db.Xflags & int32(8388608)) == int32(0) {
  9701  		Xsqlite3_result_error(tls, _context, str(7881), int32(-1))
  9702  		return
  9703  	}
  9704  	if _argc == int32(2) {
  9705  		_zProc = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, uintptr(1)))))
  9706  		goto _2
  9707  	}
  9708  	_zProc = nil
  9709  _2:
  9710  	if (_zFile != nil) && Xsqlite3_load_extension(tls, _db, _zFile, _zProc, &_zErrMsg) != 0 {
  9711  		Xsqlite3_result_error(tls, _context, _zErrMsg, int32(-1))
  9712  		Xsqlite3_free(tls, unsafe.Pointer(_zErrMsg))
  9713  	}
  9714  }
  9715  
  9716  // C comment
  9717  //  /*
  9718  //  ** CAPI3REF: Load An Extension
  9719  //  ** METHOD: sqlite3
  9720  //  **
  9721  //  ** ^This interface loads an SQLite extension library from the named file.
  9722  //  **
  9723  //  ** ^The sqlite3_load_extension() interface attempts to load an
  9724  //  ** [SQLite extension] library contained in the file zFile.  If
  9725  //  ** the file cannot be loaded directly, attempts are made to load
  9726  //  ** with various operating-system specific extensions added.
  9727  //  ** So for example, if "samplelib" cannot be loaded, then names like
  9728  //  ** "samplelib.so" or "samplelib.dylib" or "samplelib.dll" might
  9729  //  ** be tried also.
  9730  //  **
  9731  //  ** ^The entry point is zProc.
  9732  //  ** ^(zProc may be 0, in which case SQLite will try to come up with an
  9733  //  ** entry point name on its own.  It first tries "sqlite3_extension_init".
  9734  //  ** If that does not work, it constructs a name "sqlite3_X_init" where the
  9735  //  ** X is consists of the lower-case equivalent of all ASCII alphabetic
  9736  //  ** characters in the filename from the last "/" to the first following
  9737  //  ** "." and omitting any initial "lib".)^
  9738  //  ** ^The sqlite3_load_extension() interface returns
  9739  //  ** [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong.
  9740  //  ** ^If an error occurs and pzErrMsg is not 0, then the
  9741  //  ** [sqlite3_load_extension()] interface shall attempt to
  9742  //  ** fill *pzErrMsg with error message text stored in memory
  9743  //  ** obtained from [sqlite3_malloc()]. The calling function
  9744  //  ** should free this memory by calling [sqlite3_free()].
  9745  //  **
  9746  //  ** ^Extension loading must be enabled using
  9747  //  ** [sqlite3_enable_load_extension()] or
  9748  //  ** [sqlite3_db_config](db,[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION],1,NULL)
  9749  //  ** prior to calling this API,
  9750  //  ** otherwise an error will be returned.
  9751  //  **
  9752  //  ** <b>Security warning:</b> It is recommended that the
  9753  //  ** [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method be used to enable only this
  9754  //  ** interface.  The use of the [sqlite3_enable_load_extension()] interface
  9755  //  ** should be avoided.  This will keep the SQL function [load_extension()]
  9756  //  ** disabled and prevent SQL injections from giving attackers
  9757  //  ** access to extension loading capabilities.
  9758  //  **
  9759  //  ** See also the [load_extension() SQL function].
  9760  //  */
  9761  func Xsqlite3_load_extension(tls *crt.TLS, _db *Xsqlite3, _zFile *int8, _zProc *int8, _pzErrMsg **int8) (r0 int32) {
  9762  	var _rc int32
  9763  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
  9764  	_rc = _sqlite3LoadExtension(tls, _db, _zFile, _zProc, _pzErrMsg)
  9765  	_rc = _sqlite3ApiExit(tls, _db, _rc)
  9766  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
  9767  	return _rc
  9768  }
  9769  
  9770  // C comment
  9771  //  /*
  9772  //  ** Attempt to load an SQLite extension library contained in the file
  9773  //  ** zFile.  The entry point is zProc.  zProc may be 0 in which case a
  9774  //  ** default entry point name (sqlite3_extension_init) is used.  Use
  9775  //  ** of the default name is recommended.
  9776  //  **
  9777  //  ** Return SQLITE_OK on success and SQLITE_ERROR if something goes wrong.
  9778  //  **
  9779  //  ** If an error occurs and pzErrMsg is not 0, then fill *pzErrMsg with
  9780  //  ** error message text.  The calling function should free this memory
  9781  //  ** by calling sqlite3DbFree(db, ).
  9782  //  */
  9783  func _sqlite3LoadExtension(tls *crt.TLS, _db *Xsqlite3, _zFile *int8, _zProc *int8, _pzErrMsg **int8) (r0 int32) {
  9784  	var _ii, _rc, _7_iFile, _7_iEntry, _7_c, _7_ncFile int32
  9785  	var _nMsg uint64
  9786  	var _zErrmsg, _zEntry, _zAltEntry, _3_zAltFile *int8
  9787  	var _handle unsafe.Pointer
  9788  	var _aHandle *unsafe.Pointer
  9789  	var _pVfs *Xsqlite3_vfs
  9790  	var _xInit func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32
  9791  	_pVfs = (*Xsqlite3_vfs)(_db.XpVfs)
  9792  	_zErrmsg = nil
  9793  	_zAltEntry = nil
  9794  	_nMsg = uint64(int32(300) + _sqlite3Strlen30(tls, _zFile))
  9795  	if _pzErrMsg != nil {
  9796  		*_pzErrMsg = nil
  9797  	}
  9798  	if (_db.Xflags & int32(4194304)) != int32(0) {
  9799  		goto _1
  9800  	}
  9801  	if _pzErrMsg != nil {
  9802  		*_pzErrMsg = Xsqlite3_mprintf(tls, str(7881))
  9803  	}
  9804  	return int32(1)
  9805  
  9806  _1:
  9807  	_zEntry = func() *int8 {
  9808  		if _zProc != nil {
  9809  			return _zProc
  9810  		}
  9811  		return str(7896)
  9812  	}()
  9813  	_handle = _sqlite3OsDlOpen(tls, _pVfs, _zFile)
  9814  	_ii = int32(0)
  9815  _5:
  9816  	if _ii >= int32(1) || _handle != nil {
  9817  		goto _9
  9818  	}
  9819  	_3_zAltFile = Xsqlite3_mprintf(tls, str(7919), unsafe.Pointer(_zFile), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_sqlite3LoadExtensionØ00azEndingsØ001)), uintptr(_ii))))
  9820  	if _3_zAltFile == nil {
  9821  		return _sqlite3NomemError(tls, int32(112306))
  9822  	}
  9823  	_handle = _sqlite3OsDlOpen(tls, _pVfs, _3_zAltFile)
  9824  	Xsqlite3_free(tls, unsafe.Pointer(_3_zAltFile))
  9825  	_ii += 1
  9826  	goto _5
  9827  _9:
  9828  	if _handle != nil {
  9829  		goto _11
  9830  	}
  9831  	if _pzErrMsg == nil {
  9832  		goto _12
  9833  	}
  9834  	*_pzErrMsg = store1(&_zErrmsg, (*int8)(Xsqlite3_malloc64(tls, _nMsg)))
  9835  	if _zErrmsg != nil {
  9836  		Xsqlite3_snprintf(tls, int32(_nMsg), _zErrmsg, str(7925), unsafe.Pointer(_zFile))
  9837  		_sqlite3OsDlError(tls, _pVfs, int32(_nMsg-uint64(1)), _zErrmsg)
  9838  	}
  9839  _12:
  9840  	return int32(1)
  9841  
  9842  _11:
  9843  	_xInit = func() func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32 {
  9844  		v := _sqlite3OsDlSym(tls, _pVfs, _handle, _zEntry)
  9845  		return *(*func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32)(unsafe.Pointer(&v))
  9846  	}()
  9847  	if _xInit != nil || _zProc != nil {
  9848  		goto _15
  9849  	}
  9850  	_7_ncFile = _sqlite3Strlen30(tls, _zFile)
  9851  	_zAltEntry = (*int8)(Xsqlite3_malloc64(tls, uint64(_7_ncFile+int32(30))))
  9852  	if _zAltEntry == nil {
  9853  		_sqlite3OsDlClose(tls, _pVfs, _handle)
  9854  		return _sqlite3NomemError(tls, int32(112341))
  9855  	}
  9856  	crt.Xmemcpy(tls, unsafe.Pointer(_zAltEntry), unsafe.Pointer(str(7960)), uint32(8))
  9857  	_7_iFile = _7_ncFile - int32(1)
  9858  _17:
  9859  	if _7_iFile < int32(0) || int32(*elem1(_zFile, uintptr(_7_iFile))) == int32(47) {
  9860  		goto _21
  9861  	}
  9862  	_7_iFile -= 1
  9863  	goto _17
  9864  _21:
  9865  	_7_iFile += 1
  9866  	if Xsqlite3_strnicmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFile))+uintptr(_7_iFile))), str(7969), int32(3)) == int32(0) {
  9867  		_7_iFile += int32(3)
  9868  	}
  9869  	_7_iEntry = int32(8)
  9870  _23:
  9871  	if store2(&_7_c, int32(*elem1(_zFile, uintptr(_7_iFile)))) == int32(0) || _7_c == int32(46) {
  9872  		goto _27
  9873  	}
  9874  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(_7_c)))) & int32(2)) != 0 {
  9875  		*elem1(_zAltEntry, uintptr(postInc2(&_7_iEntry, 1))) = int8(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(uint32(_7_c))))
  9876  	}
  9877  	_7_iFile += 1
  9878  	goto _23
  9879  _27:
  9880  	crt.Xmemcpy(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zAltEntry))+uintptr(_7_iEntry)))), unsafe.Pointer(str(7973)), uint32(6))
  9881  	_zEntry = _zAltEntry
  9882  	_xInit = func() func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32 {
  9883  		v := _sqlite3OsDlSym(tls, _pVfs, _handle, _zEntry)
  9884  		return *(*func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32)(unsafe.Pointer(&v))
  9885  	}()
  9886  _15:
  9887  	if _xInit != nil {
  9888  		goto _29
  9889  	}
  9890  	if _pzErrMsg == nil {
  9891  		goto _30
  9892  	}
  9893  	_nMsg += uint64(_sqlite3Strlen30(tls, _zEntry))
  9894  	*_pzErrMsg = store1(&_zErrmsg, (*int8)(Xsqlite3_malloc64(tls, _nMsg)))
  9895  	if _zErrmsg != nil {
  9896  		Xsqlite3_snprintf(tls, int32(_nMsg), _zErrmsg, str(7979), unsafe.Pointer(_zEntry), unsafe.Pointer(_zFile))
  9897  		_sqlite3OsDlError(tls, _pVfs, int32(_nMsg-uint64(1)), _zErrmsg)
  9898  	}
  9899  _30:
  9900  	_sqlite3OsDlClose(tls, _pVfs, _handle)
  9901  	Xsqlite3_free(tls, unsafe.Pointer(_zAltEntry))
  9902  	return int32(1)
  9903  
  9904  _29:
  9905  	Xsqlite3_free(tls, unsafe.Pointer(_zAltEntry))
  9906  	_rc = _xInit(tls, _db, &_zErrmsg, &_sqlite3Apis)
  9907  	if _rc == 0 {
  9908  		goto _32
  9909  	}
  9910  	if _rc == int32(256) {
  9911  		return int32(0)
  9912  	}
  9913  	if _pzErrMsg != nil {
  9914  		*_pzErrMsg = Xsqlite3_mprintf(tls, str(8022), unsafe.Pointer(_zErrmsg))
  9915  	}
  9916  	Xsqlite3_free(tls, unsafe.Pointer(_zErrmsg))
  9917  	_sqlite3OsDlClose(tls, _pVfs, _handle)
  9918  	return int32(1)
  9919  
  9920  _32:
  9921  	_aHandle = (*unsafe.Pointer)(_sqlite3DbMallocZero(tls, _db, uint64(uint32(4)*uint32(_db.XnExtension+int32(1)))))
  9922  	if _aHandle == nil {
  9923  		return _sqlite3NomemError(tls, int32(112385))
  9924  	}
  9925  	if _db.XnExtension > int32(0) {
  9926  		crt.Xmemcpy(tls, unsafe.Pointer(_aHandle), unsafe.Pointer(_db.XaExtension), uint32(4)*uint32(_db.XnExtension))
  9927  	}
  9928  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_db.XaExtension))
  9929  	_db.XaExtension = _aHandle
  9930  	*elem24(_db.XaExtension, uintptr(postInc2(&_db.XnExtension, 1))) = _handle
  9931  	return int32(0)
  9932  }
  9933  
  9934  // C comment
  9935  //  /*
  9936  //  ** Print into memory obtained from sqlite3_malloc()().  Omit the internal
  9937  //  ** %-conversion extensions.
  9938  //  */
  9939  func Xsqlite3_mprintf(tls *crt.TLS, _zFormat *int8, args ...interface{}) (r0 *int8) {
  9940  	var _z *int8
  9941  	var _ap []interface{}
  9942  	if Xsqlite3_initialize(tls) != 0 {
  9943  		return nil
  9944  	}
  9945  	_ap = args
  9946  	_z = Xsqlite3_vmprintf(tls, _zFormat, _ap)
  9947  	_ap = nil
  9948  	return _z
  9949  }
  9950  
  9951  // C comment
  9952  //  /*
  9953  //  ** Print into memory obtained from sqlite3_malloc().  Omit the internal
  9954  //  ** %-conversion extensions.
  9955  //  */
  9956  func Xsqlite3_vmprintf(tls *crt.TLS, _zFormat *int8, _ap []interface{}) (r0 *int8) {
  9957  	var _z *int8
  9958  	var _acc XStrAccum
  9959  	var _zBase [70]int8
  9960  	if _zFormat == nil {
  9961  		_sqlite3MisuseError(tls, int32(26040))
  9962  		return nil
  9963  	}
  9964  	if Xsqlite3_initialize(tls) != 0 {
  9965  		return nil
  9966  	}
  9967  	_sqlite3StrAccumInit(tls, &_acc, nil, (*int8)(unsafe.Pointer(&_zBase)), int32(70), int32(1000000000))
  9968  	_sqlite3VXPrintf(tls, &_acc, _zFormat, _ap)
  9969  	_z = _sqlite3StrAccumFinish(tls, &_acc)
  9970  	return _z
  9971  
  9972  	_ = _zBase
  9973  	panic(0)
  9974  }
  9975  
  9976  func _sqlite3OsDlOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8) (r0 unsafe.Pointer) {
  9977  	return func() func(*crt.TLS, *Xsqlite3_vfs, *int8) unsafe.Pointer {
  9978  		v := _pVfs.XxDlOpen
  9979  		return *(*func(*crt.TLS, *Xsqlite3_vfs, *int8) unsafe.Pointer)(unsafe.Pointer(&v))
  9980  	}()(tls, _pVfs, _zPath)
  9981  }
  9982  
  9983  var _sqlite3LoadExtensionØ00azEndingsØ001 [1]*int8
  9984  
  9985  func init() {
  9986  	_sqlite3LoadExtensionØ00azEndingsØ001 = [1]*int8{str(8054)}
  9987  }
  9988  
  9989  func Xsqlite3_malloc64(tls *crt.TLS, _n uint64) (r0 unsafe.Pointer) {
  9990  	if Xsqlite3_initialize(tls) != 0 {
  9991  		return nil
  9992  	}
  9993  	return _sqlite3Malloc(tls, _n)
  9994  }
  9995  
  9996  func _sqlite3OsDlError(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _nByte int32, _zBufOut *int8) {
  9997  	func() func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) {
  9998  		v := _pVfs.XxDlError
  9999  		return *(*func(*crt.TLS, *Xsqlite3_vfs, int32, *int8))(unsafe.Pointer(&v))
 10000  	}()(tls, _pVfs, _nByte, _zBufOut)
 10001  }
 10002  
 10003  func _sqlite3OsDlSym(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _pHdle unsafe.Pointer, _zSym *int8) (r0 func(*crt.TLS)) {
 10004  	return func() func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS) {
 10005  		v := _pVfs.XxDlSym
 10006  		return *(*func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&v))
 10007  	}()(tls, _pVfs, _pHdle, _zSym)
 10008  }
 10009  
 10010  func _sqlite3OsDlClose(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _pHandle unsafe.Pointer) {
 10011  	func() func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer) {
 10012  		v := _pVfs.XxDlClose
 10013  		return *(*func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer))(unsafe.Pointer(&v))
 10014  	}()(tls, _pVfs, _pHandle)
 10015  }
 10016  
 10017  // C comment
 10018  //  /*
 10019  //  ** The following structure contains pointers to all SQLite API routines.
 10020  //  ** A pointer to this structure is passed into extensions when they are
 10021  //  ** loaded so that the extension can make calls back into the SQLite
 10022  //  ** library.
 10023  //  **
 10024  //  ** When adding new APIs, add them to the bottom of this structure
 10025  //  ** in order to preserve backwards compatibility.
 10026  //  **
 10027  //  ** Extensions that use newer APIs should first call the
 10028  //  ** sqlite3_libversion_number() to make sure that the API they
 10029  //  ** intend to use is supported by the library.  Extensions should
 10030  //  ** also check to make sure that the pointer to the function is
 10031  //  ** not NULL before calling it.
 10032  //  */
 10033  var _sqlite3Apis Xsqlite3_api_routines
 10034  
 10035  func init() {
 10036  	_sqlite3Apis = Xsqlite3_api_routines{Xaggregate_context: *(*func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer)(unsafe.Pointer(&struct {
 10037  		f func(*crt.TLS, *Xsqlite3_context, int32) unsafe.Pointer
 10038  	}{Xsqlite3_aggregate_context})), Xaggregate_count: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10039  		f func(*crt.TLS, *Xsqlite3_context) int32
 10040  	}{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 {
 10041  		f func(*crt.TLS, unsafe.Pointer, int32, *XMem) int32
 10042  	}{Xsqlite3_bind_value})), Xbusy_handler: *(*func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32) int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10043  		f func(*crt.TLS, *Xsqlite3, func(*crt.TLS, unsafe.Pointer, int32) int32, unsafe.Pointer) int32
 10044  	}{Xsqlite3_busy_handler})), Xbusy_timeout: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
 10045  		f func(*crt.TLS, *Xsqlite3, int32) int32
 10046  	}{Xsqlite3_busy_timeout})), Xchanges: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10047  		f func(*crt.TLS, *Xsqlite3) int32
 10048  	}{Xsqlite3_changes})), Xclose: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10049  		f func(*crt.TLS, *Xsqlite3) int32
 10050  	}{Xsqlite3_close})), Xcollation_needed: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *int8)) int32)(unsafe.Pointer(&struct {
 10051  		f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8)) int32
 10052  	}{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 {
 10053  		f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer)) int32
 10054  	}{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 {
 10055  		f func(*crt.TLS, unsafe.Pointer, int32) *XMem
 10056  	}{Xsqlite3_column_value})), Xcommit_hook: *(*func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer) int32, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10057  		f func(*crt.TLS, *Xsqlite3, func(*crt.TLS, unsafe.Pointer) int32, unsafe.Pointer) unsafe.Pointer
 10058  	}{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 {
 10059  		f func(*crt.TLS, *Xsqlite3, *int8, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32) int32
 10060  	}{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 {
 10061  		f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32) int32
 10062  	}{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 {
 10063  		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
 10064  	}{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 {
 10065  		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
 10066  	}{Xsqlite3_create_function16})), Xcreate_module: *(*func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10067  		f func(*crt.TLS, *Xsqlite3, *int8, *Xsqlite3_module, unsafe.Pointer) int32
 10068  	}{Xsqlite3_create_module})), Xdata_count: Xsqlite3_data_count, Xdb_handle: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10069  		f func(*crt.TLS, unsafe.Pointer) *Xsqlite3
 10070  	}{Xsqlite3_db_handle})), Xdeclare_vtab: *(*func(*crt.TLS, unsafe.Pointer, *int8) int32)(unsafe.Pointer(&struct {
 10071  		f func(*crt.TLS, *Xsqlite3, *int8) int32
 10072  	}{Xsqlite3_declare_vtab})), Xenable_shared_cache: Xsqlite3_enable_shared_cache, Xerrcode: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10073  		f func(*crt.TLS, *Xsqlite3) int32
 10074  	}{Xsqlite3_errcode})), Xerrmsg: *(*func(*crt.TLS, unsafe.Pointer) *int8)(unsafe.Pointer(&struct {
 10075  		f func(*crt.TLS, *Xsqlite3) *int8
 10076  	}{Xsqlite3_errmsg})), Xerrmsg16: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10077  		f func(*crt.TLS, *Xsqlite3) unsafe.Pointer
 10078  	}{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 {
 10079  		f func(*crt.TLS, *Xsqlite3, *int8, func(*crt.TLS, unsafe.Pointer, int32, **int8, **int8) int32, unsafe.Pointer, **int8) int32
 10080  	}{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 {
 10081  		f func(*crt.TLS, *Xsqlite3) int32
 10082  	}{Xsqlite3_get_autocommit})), Xget_auxdata: *(*func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer)(unsafe.Pointer(&struct {
 10083  		f func(*crt.TLS, *Xsqlite3_context, int32) unsafe.Pointer
 10084  	}{Xsqlite3_get_auxdata})), Xget_table: *(*func(*crt.TLS, unsafe.Pointer, *int8, ***int8, *int32, *int32, **int8) int32)(unsafe.Pointer(&struct {
 10085  		f func(*crt.TLS, *Xsqlite3, *int8, ***int8, *int32, *int32, **int8) int32
 10086  	}{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 {
 10087  		f func(*crt.TLS, *Xsqlite3) int64
 10088  	}{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 {
 10089  		f func(*crt.TLS, *int8, **Xsqlite3) int32
 10090  	}{Xsqlite3_open})), Xopen16: *(*func(*crt.TLS, unsafe.Pointer, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10091  		f func(*crt.TLS, unsafe.Pointer, **Xsqlite3) int32
 10092  	}{Xsqlite3_open16})), Xprepare: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *unsafe.Pointer, **int8) int32)(unsafe.Pointer(&struct {
 10093  		f func(*crt.TLS, *Xsqlite3, *int8, int32, *unsafe.Pointer, **int8) int32
 10094  	}{Xsqlite3_prepare})), Xprepare16: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *unsafe.Pointer, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10095  		f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, *unsafe.Pointer, *unsafe.Pointer) int32
 10096  	}{Xsqlite3_prepare16})), Xprofile: *(*func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, *int8, uint64), unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10097  		f func(*crt.TLS, *Xsqlite3, func(*crt.TLS, unsafe.Pointer, *int8, uint64), unsafe.Pointer) unsafe.Pointer
 10098  	}{Xsqlite3_profile})), Xprogress_handler: *(*func(*crt.TLS, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer) int32, unsafe.Pointer))(unsafe.Pointer(&struct {
 10099  		f func(*crt.TLS, *Xsqlite3, int32, func(*crt.TLS, unsafe.Pointer) int32, unsafe.Pointer)
 10100  	}{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 {
 10101  		f func(*crt.TLS, *Xsqlite3_context, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer))
 10102  	}{Xsqlite3_result_blob})), Xresult_double: *(*func(*crt.TLS, unsafe.Pointer, float64))(unsafe.Pointer(&struct {
 10103  		f func(*crt.TLS, *Xsqlite3_context, float64)
 10104  	}{Xsqlite3_result_double})), Xresult_error: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32))(unsafe.Pointer(&struct {
 10105  		f func(*crt.TLS, *Xsqlite3_context, *int8, int32)
 10106  	}{Xsqlite3_result_error})), Xresult_error16: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&struct {
 10107  		f func(*crt.TLS, *Xsqlite3_context, unsafe.Pointer, int32)
 10108  	}{Xsqlite3_result_error16})), Xresult_int: *(*func(*crt.TLS, unsafe.Pointer, int32))(unsafe.Pointer(&struct {
 10109  		f func(*crt.TLS, *Xsqlite3_context, int32)
 10110  	}{Xsqlite3_result_int})), Xresult_int64: *(*func(*crt.TLS, unsafe.Pointer, int64))(unsafe.Pointer(&struct {
 10111  		f func(*crt.TLS, *Xsqlite3_context, int64)
 10112  	}{Xsqlite3_result_int64})), Xresult_null: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
 10113  		f func(*crt.TLS, *Xsqlite3_context)
 10114  	}{Xsqlite3_result_null})), Xresult_text: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, func(*crt.TLS, unsafe.Pointer)))(unsafe.Pointer(&struct {
 10115  		f func(*crt.TLS, *Xsqlite3_context, *int8, int32, func(*crt.TLS, unsafe.Pointer))
 10116  	}{Xsqlite3_result_text})), Xresult_text16: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer)))(unsafe.Pointer(&struct {
 10117  		f func(*crt.TLS, *Xsqlite3_context, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer))
 10118  	}{Xsqlite3_result_text16})), Xresult_text16be: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer)))(unsafe.Pointer(&struct {
 10119  		f func(*crt.TLS, *Xsqlite3_context, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer))
 10120  	}{Xsqlite3_result_text16be})), Xresult_text16le: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer)))(unsafe.Pointer(&struct {
 10121  		f func(*crt.TLS, *Xsqlite3_context, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer))
 10122  	}{Xsqlite3_result_text16le})), Xresult_value: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&struct {
 10123  		f func(*crt.TLS, *Xsqlite3_context, *XMem)
 10124  	}{Xsqlite3_result_value})), Xrollback_hook: *(*func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer), unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10125  		f func(*crt.TLS, *Xsqlite3, func(*crt.TLS, unsafe.Pointer), unsafe.Pointer) unsafe.Pointer
 10126  	}{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 {
 10127  		f func(*crt.TLS, *Xsqlite3, func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32, unsafe.Pointer) int32
 10128  	}{Xsqlite3_set_authorizer})), Xset_auxdata: *(*func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer)))(unsafe.Pointer(&struct {
 10129  		f func(*crt.TLS, *Xsqlite3_context, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer))
 10130  	}{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 {
 10131  		f func(*crt.TLS, *Xsqlite3, *int8, *int8, *int8, **int8, **int8, *int32, *int32, *int32) int32
 10132  	}{Xsqlite3_table_column_metadata})), Xthread_cleanup: Xsqlite3_thread_cleanup, Xtotal_changes: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10133  		f func(*crt.TLS, *Xsqlite3) int32
 10134  	}{Xsqlite3_total_changes})), Xtrace: *(*func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, *int8), unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10135  		f func(*crt.TLS, *Xsqlite3, func(*crt.TLS, unsafe.Pointer, *int8), unsafe.Pointer) unsafe.Pointer
 10136  	}{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 {
 10137  		f func(*crt.TLS, *Xsqlite3, func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, int64), unsafe.Pointer) unsafe.Pointer
 10138  	}{Xsqlite3_update_hook})), Xuser_data: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10139  		f func(*crt.TLS, *Xsqlite3_context) unsafe.Pointer
 10140  	}{Xsqlite3_user_data})), Xvalue_blob: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10141  		f func(*crt.TLS, *XMem) unsafe.Pointer
 10142  	}{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 {
 10143  		f func(*crt.TLS, *XMem) unsafe.Pointer
 10144  	}{Xsqlite3_value_text16})), Xvalue_text16be: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10145  		f func(*crt.TLS, *XMem) unsafe.Pointer
 10146  	}{Xsqlite3_value_text16be})), Xvalue_text16le: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10147  		f func(*crt.TLS, *XMem) unsafe.Pointer
 10148  	}{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 {
 10149  		f func(*crt.TLS, *int8, []interface{}) *int8
 10150  	}{Xsqlite3_vmprintf})), Xoverload_function: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32) int32)(unsafe.Pointer(&struct {
 10151  		f func(*crt.TLS, *Xsqlite3, *int8, int32) int32
 10152  	}{Xsqlite3_overload_function})), Xprepare_v2: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *unsafe.Pointer, **int8) int32)(unsafe.Pointer(&struct {
 10153  		f func(*crt.TLS, *Xsqlite3, *int8, int32, *unsafe.Pointer, **int8) int32
 10154  	}{Xsqlite3_prepare_v2})), Xprepare16_v2: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *unsafe.Pointer, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10155  		f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, *unsafe.Pointer, *unsafe.Pointer) int32
 10156  	}{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 {
 10157  		f func(*crt.TLS, *Xsqlite3, *int8, *Xsqlite3_module, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer)) int32
 10158  	}{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 {
 10159  		f func(*crt.TLS, *Xsqlite3, *int8, *int8, *int8, int64, int32, *unsafe.Pointer) int32
 10160  	}{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 {
 10161  		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
 10162  	}{Xsqlite3_create_collation_v2})), Xfile_control: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10163  		f func(*crt.TLS, *Xsqlite3, *int8, int32, unsafe.Pointer) int32
 10164  	}{Xsqlite3_file_control})), Xmemory_highwater: Xsqlite3_memory_highwater, Xmemory_used: Xsqlite3_memory_used, Xmutex_alloc: *(*func(*crt.TLS, int32) unsafe.Pointer)(unsafe.Pointer(&struct {
 10165  		f func(*crt.TLS, int32) *Xsqlite3_mutex
 10166  	}{Xsqlite3_mutex_alloc})), Xmutex_enter: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
 10167  		f func(*crt.TLS, *Xsqlite3_mutex)
 10168  	}{Xsqlite3_mutex_enter})), Xmutex_free: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
 10169  		f func(*crt.TLS, *Xsqlite3_mutex)
 10170  	}{Xsqlite3_mutex_free})), Xmutex_leave: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
 10171  		f func(*crt.TLS, *Xsqlite3_mutex)
 10172  	}{Xsqlite3_mutex_leave})), Xmutex_try: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10173  		f func(*crt.TLS, *Xsqlite3_mutex) int32
 10174  	}{Xsqlite3_mutex_try})), Xopen_v2: *(*func(*crt.TLS, *int8, *unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
 10175  		f func(*crt.TLS, *int8, **Xsqlite3, int32, *int8) int32
 10176  	}{Xsqlite3_open_v2})), Xrelease_memory: Xsqlite3_release_memory, Xresult_error_nomem: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
 10177  		f func(*crt.TLS, *Xsqlite3_context)
 10178  	}{Xsqlite3_result_error_nomem})), Xresult_error_toobig: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
 10179  		f func(*crt.TLS, *Xsqlite3_context)
 10180  	}{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 {
 10181  		f func(*crt.TLS, *int8) *Xsqlite3_vfs
 10182  	}{Xsqlite3_vfs_find})), Xvfs_register: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
 10183  		f func(*crt.TLS, *Xsqlite3_vfs, int32) int32
 10184  	}{Xsqlite3_vfs_register})), Xvfs_unregister: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10185  		f func(*crt.TLS, *Xsqlite3_vfs) int32
 10186  	}{Xsqlite3_vfs_unregister})), Xxthreadsafe: Xsqlite3_threadsafe, Xresult_zeroblob: *(*func(*crt.TLS, unsafe.Pointer, int32))(unsafe.Pointer(&struct {
 10187  		f func(*crt.TLS, *Xsqlite3_context, int32)
 10188  	}{Xsqlite3_result_zeroblob})), Xresult_error_code: *(*func(*crt.TLS, unsafe.Pointer, int32))(unsafe.Pointer(&struct {
 10189  		f func(*crt.TLS, *Xsqlite3_context, int32)
 10190  	}{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 {
 10191  		f func(*crt.TLS, *Xsqlite3_context) *Xsqlite3
 10192  	}{Xsqlite3_context_db_handle})), Xextended_result_codes: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
 10193  		f func(*crt.TLS, *Xsqlite3, int32) int32
 10194  	}{Xsqlite3_extended_result_codes})), Xlimit: *(*func(*crt.TLS, unsafe.Pointer, int32, int32) int32)(unsafe.Pointer(&struct {
 10195  		f func(*crt.TLS, *Xsqlite3, int32, int32) int32
 10196  	}{Xsqlite3_limit})), Xnext_stmt: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10197  		f func(*crt.TLS, *Xsqlite3, unsafe.Pointer) unsafe.Pointer
 10198  	}{Xsqlite3_next_stmt})), Xsql: Xsqlite3_sql, Xstatus: Xsqlite3_status, Xbackup_finish: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10199  		f func(*crt.TLS, *Xsqlite3_backup) int32
 10200  	}{Xsqlite3_backup_finish})), Xbackup_init: *(*func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, *int8) unsafe.Pointer)(unsafe.Pointer(&struct {
 10201  		f func(*crt.TLS, *Xsqlite3, *int8, *Xsqlite3, *int8) *Xsqlite3_backup
 10202  	}{Xsqlite3_backup_init})), Xbackup_pagecount: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10203  		f func(*crt.TLS, *Xsqlite3_backup) int32
 10204  	}{Xsqlite3_backup_pagecount})), Xbackup_remaining: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10205  		f func(*crt.TLS, *Xsqlite3_backup) int32
 10206  	}{Xsqlite3_backup_remaining})), Xbackup_step: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
 10207  		f func(*crt.TLS, *Xsqlite3_backup, int32) int32
 10208  	}{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 {
 10209  		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
 10210  	}{Xsqlite3_create_function_v2})), Xdb_config: *(*func(*crt.TLS, unsafe.Pointer, int32, ...interface{}) int32)(unsafe.Pointer(&struct {
 10211  		f func(*crt.TLS, *Xsqlite3, int32, ...interface{}) int32
 10212  	}{Xsqlite3_db_config})), Xdb_mutex: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
 10213  		f func(*crt.TLS, *Xsqlite3) *Xsqlite3_mutex
 10214  	}{Xsqlite3_db_mutex})), Xdb_status: *(*func(*crt.TLS, unsafe.Pointer, int32, *int32, *int32, int32) int32)(unsafe.Pointer(&struct {
 10215  		f func(*crt.TLS, *Xsqlite3, int32, *int32, *int32, int32) int32
 10216  	}{Xsqlite3_db_status})), Xextended_errcode: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10217  		f func(*crt.TLS, *Xsqlite3) int32
 10218  	}{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 {
 10219  		f func(*crt.TLS, *Xsqlite3, int32) int32
 10220  	}{Xsqlite3_wal_autocheckpoint})), Xwal_checkpoint: *(*func(*crt.TLS, unsafe.Pointer, *int8) int32)(unsafe.Pointer(&struct {
 10221  		f func(*crt.TLS, *Xsqlite3, *int8) int32
 10222  	}{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 {
 10223  		f func(*crt.TLS, *Xsqlite3, func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32, unsafe.Pointer) unsafe.Pointer
 10224  	}{Xsqlite3_wal_hook})), Xblob_reopen: Xsqlite3_blob_reopen, Xvtab_config: *(*func(*crt.TLS, unsafe.Pointer, int32, ...interface{}) int32)(unsafe.Pointer(&struct {
 10225  		f func(*crt.TLS, *Xsqlite3, int32, ...interface{}) int32
 10226  	}{Xsqlite3_vtab_config})), Xvtab_on_conflict: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10227  		f func(*crt.TLS, *Xsqlite3) int32
 10228  	}{Xsqlite3_vtab_on_conflict})), Xclose_v2: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10229  		f func(*crt.TLS, *Xsqlite3) int32
 10230  	}{Xsqlite3_close_v2})), Xdb_filename: *(*func(*crt.TLS, unsafe.Pointer, *int8) *int8)(unsafe.Pointer(&struct {
 10231  		f func(*crt.TLS, *Xsqlite3, *int8) *int8
 10232  	}{Xsqlite3_db_filename})), Xdb_readonly: *(*func(*crt.TLS, unsafe.Pointer, *int8) int32)(unsafe.Pointer(&struct {
 10233  		f func(*crt.TLS, *Xsqlite3, *int8) int32
 10234  	}{Xsqlite3_db_readonly})), Xdb_release_memory: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10235  		f func(*crt.TLS, *Xsqlite3) int32
 10236  	}{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 {
 10237  		f func(*crt.TLS, int32, *int8, *int8, []interface{}) *int8
 10238  	}{Xsqlite3_vsnprintf})), Xwal_checkpoint_v2: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32, *int32) int32)(unsafe.Pointer(&struct {
 10239  		f func(*crt.TLS, *Xsqlite3, *int8, int32, *int32, *int32) int32
 10240  	}{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 {
 10241  		f func(*crt.TLS, *Xsqlite3, *int8, *int8, **int8) int32
 10242  	}{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 {
 10243  		f func(*crt.TLS, *Xsqlite3_context, unsafe.Pointer, uint64, func(*crt.TLS, unsafe.Pointer))
 10244  	}{Xsqlite3_result_blob64})), Xresult_text64: *(*func(*crt.TLS, unsafe.Pointer, *int8, uint64, func(*crt.TLS, unsafe.Pointer), uint8))(unsafe.Pointer(&struct {
 10245  		f func(*crt.TLS, *Xsqlite3_context, *int8, uint64, func(*crt.TLS, unsafe.Pointer), uint8)
 10246  	}{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 {
 10247  		f func(*crt.TLS, *Xsqlite3_context, uint64) int32
 10248  	}{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 {
 10249  		f func(*crt.TLS, *Xsqlite3_context, uint32)
 10250  	}{Xsqlite3_result_subtype})), Xstatus64: Xsqlite3_status64, Xstrlike: Xsqlite3_strlike, Xdb_cacheflush: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10251  		f func(*crt.TLS, *Xsqlite3) int32
 10252  	}{Xsqlite3_db_cacheflush})), Xsystem_errno: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 10253  		f func(*crt.TLS, *Xsqlite3) int32
 10254  	}{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 {
 10255  		f func(*crt.TLS, *Xsqlite3, uint32, func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32, unsafe.Pointer) int32
 10256  	}{Xsqlite3_trace_v2})), Xexpanded_sql: Xsqlite3_expanded_sql, Xset_last_insert_rowid: *(*func(*crt.TLS, unsafe.Pointer, int64))(unsafe.Pointer(&struct {
 10257  		f func(*crt.TLS, *Xsqlite3, int64)
 10258  	}{Xsqlite3_set_last_insert_rowid}))}
 10259  }
 10260  
 10261  // C comment
 10262  //  /*
 10263  //  ** Allocate or return the aggregate context for a user function.  A new
 10264  //  ** context is allocated on the first call.  Subsequent calls return the
 10265  //  ** same context that was returned on prior calls.
 10266  //  */
 10267  func Xsqlite3_aggregate_context(tls *crt.TLS, _p *Xsqlite3_context, _nByte int32) (r0 unsafe.Pointer) {
 10268  	func() {
 10269  		if _p == nil || _p.XpFunc == nil || ((*XFuncDef)(_p.XpFunc).XxFinalize) == nil {
 10270  			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)))
 10271  			crt.X__builtin_abort(tls)
 10272  		}
 10273  	}()
 10274  	func() {
 10275  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_p.XpOut).Xdb).Xmutex)) == 0 {
 10276  			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)))
 10277  			crt.X__builtin_abort(tls)
 10278  		}
 10279  	}()
 10280  	if (int32((*XMem)(_p.XpMem).Xflags) & int32(8192)) == int32(0) {
 10281  		return _createAggContext(tls, _p, _nByte)
 10282  	}
 10283  	return unsafe.Pointer((*XMem)(_p.XpMem).Xz)
 10284  }
 10285  
 10286  var _sqlite3_aggregate_contextØ00__func__Ø000 [26]int8
 10287  
 10288  func init() {
 10289  	crt.Xstrncpy(nil, &_sqlite3_aggregate_contextØ00__func__Ø000[0], str(8133), 26)
 10290  }
 10291  
 10292  // C comment
 10293  //  /*
 10294  //  ** Create a new aggregate context for p and return a pointer to
 10295  //  ** its pMem->z element.
 10296  //  */
 10297  func _createAggContext(tls *crt.TLS, _p *Xsqlite3_context, _nByte int32) (r0 unsafe.Pointer) {
 10298  	var _pMem *XMem
 10299  	_pMem = (*XMem)(_p.XpMem)
 10300  	func() {
 10301  		if (int32(_pMem.Xflags) & int32(8192)) != int32(0) {
 10302  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76869), unsafe.Pointer(&_createAggContextØ00__func__Ø000), unsafe.Pointer(str(8159)))
 10303  			crt.X__builtin_abort(tls)
 10304  		}
 10305  	}()
 10306  	if _nByte <= int32(0) {
 10307  		_sqlite3VdbeMemSetNull(tls, _pMem)
 10308  		_pMem.Xz = nil
 10309  		goto _3
 10310  	}
 10311  	_sqlite3VdbeMemClearAndResize(tls, _pMem, _nByte)
 10312  	_pMem.Xflags = uint16(8192)
 10313  	*(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pMem.Xu)))) = (*XFuncDef)(_p.XpFunc)
 10314  	if _pMem.Xz != nil {
 10315  		crt.Xmemset(tls, unsafe.Pointer(_pMem.Xz), int32(0), uint32(_nByte))
 10316  	}
 10317  _3:
 10318  	return unsafe.Pointer(_pMem.Xz)
 10319  }
 10320  
 10321  var _createAggContextØ00__func__Ø000 [17]int8
 10322  
 10323  func init() {
 10324  	crt.Xstrncpy(nil, &_createAggContextØ00__func__Ø000[0], str(8186), 17)
 10325  }
 10326  
 10327  // C comment
 10328  //  /*
 10329  //  ** Return the number of times the Step function of an aggregate has been
 10330  //  ** called.
 10331  //  **
 10332  //  ** This function is deprecated.  Do not use it for new code.  It is
 10333  //  ** provide only to avoid breaking legacy code.  New aggregate function
 10334  //  ** implementations should keep their own counts within their aggregate
 10335  //  ** context.
 10336  //  */
 10337  func Xsqlite3_aggregate_count(tls *crt.TLS, _p *Xsqlite3_context) (r0 int32) {
 10338  	func() {
 10339  		if _p == nil || _p.XpMem == nil || _p.XpFunc == nil || ((*XFuncDef)(_p.XpFunc).XxFinalize) == nil {
 10340  			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)))
 10341  			crt.X__builtin_abort(tls)
 10342  		}
 10343  	}()
 10344  	return (*XMem)(_p.XpMem).Xn
 10345  }
 10346  
 10347  var _sqlite3_aggregate_countØ00__func__Ø000 [24]int8
 10348  
 10349  func init() {
 10350  	crt.Xstrncpy(nil, &_sqlite3_aggregate_countØ00__func__Ø000[0], str(8251), 24)
 10351  }
 10352  
 10353  // C comment
 10354  //  /*
 10355  //  ** Bind a blob value to an SQL statement variable.
 10356  //  */
 10357  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) {
 10358  	if _nData < int32(0) {
 10359  		return _sqlite3MisuseError(tls, int32(77424))
 10360  	}
 10361  	return _bindText(tls, _pStmt, _i, _zData, _nData, _xDel, 0)
 10362  }
 10363  
 10364  // C comment
 10365  //  /*
 10366  //  ** Bind a text or BLOB value.
 10367  //  */
 10368  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) {
 10369  	var _rc int32
 10370  	var _p *TVdbe
 10371  	var _pVar *XMem
 10372  	_p = (*TVdbe)(_pStmt)
 10373  	_rc = _vdbeUnbind(tls, _p, _i)
 10374  	if _rc != int32(0) {
 10375  		goto _0
 10376  	}
 10377  	if _zData == nil {
 10378  		goto _1
 10379  	}
 10380  	_pVar = elem25((*XMem)(_p.XaVar), uintptr(_i-int32(1)))
 10381  	_rc = _sqlite3VdbeMemSetStr(tls, _pVar, (*int8)(_zData), _nData, _encoding, _xDel)
 10382  	if (_rc == int32(0)) && (int32(_encoding) != int32(0)) {
 10383  		_rc = _sqlite3VdbeChangeEncoding(tls, _pVar, int32((*Xsqlite3)(_p.Xdb).Xenc))
 10384  	}
 10385  	_sqlite3Error(tls, (*Xsqlite3)(_p.Xdb), _rc)
 10386  	_rc = _sqlite3ApiExit(tls, (*Xsqlite3)(_p.Xdb), _rc)
 10387  _1:
 10388  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex))
 10389  	goto _6
 10390  _0:
 10391  	if (_xDel != nil) && (*(*uintptr)(unsafe.Pointer(&struct {
 10392  		f func(*crt.TLS, unsafe.Pointer)
 10393  	}{_xDel})) != *(*uintptr)(unsafe.Pointer(&struct {
 10394  		f func(*crt.TLS, unsafe.Pointer)
 10395  	}{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))}))) {
 10396  		_xDel(tls, _zData)
 10397  	}
 10398  _6:
 10399  	return _rc
 10400  }
 10401  
 10402  // C comment
 10403  //  /******************************* sqlite3_bind_  ***************************
 10404  //  **
 10405  //  ** Routines used to attach values to wildcards in a compiled SQL statement.
 10406  //  */
 10407  //  /*
 10408  //  ** Unbind the value bound to variable i in virtual machine p. This is the
 10409  //  ** the same as binding a NULL value to the column. If the "i" parameter is
 10410  //  ** out of range, then SQLITE_RANGE is returned. Othewise SQLITE_OK.
 10411  //  **
 10412  //  ** A successful evaluation of this routine acquires the mutex on p.
 10413  //  ** the mutex is released if any kind of error occurs.
 10414  //  **
 10415  //  ** The error code stored in database p->db is overwritten with the return
 10416  //  ** value in any case.
 10417  //  */
 10418  func _vdbeUnbind(tls *crt.TLS, _p *TVdbe, _i int32) (r0 int32) {
 10419  	var _pVar *XMem
 10420  	if _vdbeSafetyNotNull(tls, _p) != 0 {
 10421  		return _sqlite3MisuseError(tls, int32(77342))
 10422  	}
 10423  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex))
 10424  	if (_p.Xmagic != uint32(770837923)) || (_p.Xpc >= int32(0)) {
 10425  		_sqlite3Error(tls, (*Xsqlite3)(_p.Xdb), int32(21))
 10426  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex))
 10427  		Xsqlite3_log(tls, int32(21), str(8275), unsafe.Pointer(_p.XzSql))
 10428  		return _sqlite3MisuseError(tls, int32(77350))
 10429  	}
 10430  	if (_i < int32(1)) || (_i > int32(_p.XnVar)) {
 10431  		_sqlite3Error(tls, (*Xsqlite3)(_p.Xdb), int32(25))
 10432  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex))
 10433  		return int32(25)
 10434  	}
 10435  	_i -= 1
 10436  	_pVar = elem25((*XMem)(_p.XaVar), uintptr(_i))
 10437  	_sqlite3VdbeMemRelease(tls, _pVar)
 10438  	_pVar.Xflags = uint16(1)
 10439  	_sqlite3Error(tls, (*Xsqlite3)(_p.Xdb), int32(0))
 10440  	func() {
 10441  		if ((uint32(_p.Xexpired>>9)<<31)>>31) == 0 && _p.Xexpmask != (0) {
 10442  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(77372), unsafe.Pointer(&_vdbeUnbindØ00__func__Ø000), unsafe.Pointer(str(8315)))
 10443  			crt.X__builtin_abort(tls)
 10444  		}
 10445  	}()
 10446  	if (_p.Xexpmask != (0)) && ((_p.Xexpmask & func() uint32 {
 10447  		if _i >= int32(31) {
 10448  			return uint32(2147483648)
 10449  		}
 10450  		return (uint32(1) << uint(_i))
 10451  	}()) != (0)) {
 10452  		storebits26(&_p.Xexpired, int16(1), 1, 0)
 10453  	}
 10454  	return int32(0)
 10455  }
 10456  
 10457  func _vdbeSafetyNotNull(tls *crt.TLS, _p *TVdbe) (r0 int32) {
 10458  	if _p == nil {
 10459  		Xsqlite3_log(tls, int32(21), str(8347))
 10460  		return int32(1)
 10461  	}
 10462  	return _vdbeSafety(tls, _p)
 10463  }
 10464  
 10465  // C comment
 10466  //  /*
 10467  //  ** Check on a Vdbe to make sure it has not been finalized.  Log
 10468  //  ** an error and return true if it has been finalized (or is otherwise
 10469  //  ** invalid).  Return false if it is ok.
 10470  //  */
 10471  func _vdbeSafety(tls *crt.TLS, _p *TVdbe) (r0 int32) {
 10472  	if (*Xsqlite3)(_p.Xdb) == nil {
 10473  		Xsqlite3_log(tls, int32(21), str(8387))
 10474  		return int32(1)
 10475  	}
 10476  	return int32(0)
 10477  }
 10478  
 10479  // C comment
 10480  //  /*
 10481  //  ** Set the current error code to err_code and clear any prior error message.
 10482  //  ** Also set iSysErrno (by calling sqlite3System) if the err_code indicates
 10483  //  ** that would be appropriate.
 10484  //  */
 10485  func _sqlite3Error(tls *crt.TLS, _db *Xsqlite3, _err_code int32) {
 10486  	func() {
 10487  		if _db == nil {
 10488  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27796), unsafe.Pointer(&_sqlite3ErrorØ00__func__Ø000), unsafe.Pointer(str(1219)))
 10489  			crt.X__builtin_abort(tls)
 10490  		}
 10491  	}()
 10492  	_db.XerrCode = _err_code
 10493  	if _err_code != 0 || (_db.XpErr != nil) {
 10494  		_sqlite3ErrorFinish(tls, _db, _err_code)
 10495  	}
 10496  }
 10497  
 10498  var _sqlite3ErrorØ00__func__Ø000 [13]int8
 10499  
 10500  func init() {
 10501  	crt.Xstrncpy(nil, &_sqlite3ErrorØ00__func__Ø000[0], str(8432), 13)
 10502  }
 10503  
 10504  // C comment
 10505  //  /*
 10506  //  ** Helper function for sqlite3Error() - called rarely.  Broken out into
 10507  //  ** a separate routine to avoid unnecessary register saves on entry to
 10508  //  ** sqlite3Error().
 10509  //  */
 10510  func _sqlite3ErrorFinish(tls *crt.TLS, _db *Xsqlite3, _err_code int32) {
 10511  	if _db.XpErr != nil {
 10512  		_sqlite3ValueSetNull(tls, (*XMem)(_db.XpErr))
 10513  	}
 10514  	_sqlite3SystemError(tls, _db, _err_code)
 10515  }
 10516  
 10517  func _sqlite3ValueSetNull(tls *crt.TLS, _p *XMem) {
 10518  	_sqlite3VdbeMemSetNull(tls, _p)
 10519  }
 10520  
 10521  // C comment
 10522  //  /*
 10523  //  ** Load the sqlite3.iSysErrno field if that is an appropriate thing
 10524  //  ** to do based on the SQLite error code in rc.
 10525  //  */
 10526  func _sqlite3SystemError(tls *crt.TLS, _db *Xsqlite3, _rc int32) {
 10527  	if _rc == int32(3082) {
 10528  		return
 10529  	}
 10530  	_rc &= int32(255)
 10531  	if (_rc == int32(14)) || (_rc == int32(10)) {
 10532  		_db.XiSysErrno = _sqlite3OsGetLastError(tls, (*Xsqlite3_vfs)(_db.XpVfs))
 10533  	}
 10534  }
 10535  
 10536  func _sqlite3OsGetLastError(tls *crt.TLS, _pVfs *Xsqlite3_vfs) (r0 int32) {
 10537  	return func() int32 {
 10538  		if _pVfs.XxGetLastError != nil {
 10539  			return func() func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32 {
 10540  				v := _pVfs.XxGetLastError
 10541  				return *(*func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32)(unsafe.Pointer(&v))
 10542  			}()(tls, _pVfs, int32(0), nil)
 10543  		}
 10544  		return int32(0)
 10545  	}()
 10546  }
 10547  
 10548  var _vdbeUnbindØ00__func__Ø000 [11]int8
 10549  
 10550  func init() {
 10551  	crt.Xstrncpy(nil, &_vdbeUnbindØ00__func__Ø000[0], str(8445), 11)
 10552  }
 10553  
 10554  // C comment
 10555  //  /*
 10556  //  ** This function must be called before exiting any API function (i.e.
 10557  //  ** returning control to the user) that has called sqlite3_malloc or
 10558  //  ** sqlite3_realloc.
 10559  //  **
 10560  //  ** The returned value is normally a copy of the second argument to this
 10561  //  ** function. However, if a malloc() failure has occurred since the previous
 10562  //  ** invocation SQLITE_NOMEM is returned instead.
 10563  //  **
 10564  //  ** If an OOM as occurred, then the connection error-code (the value
 10565  //  ** returned by sqlite3_errcode()) is set to SQLITE_NOMEM.
 10566  //  */
 10567  func _sqlite3ApiExit(tls *crt.TLS, _db *Xsqlite3, _rc int32) (r0 int32) {
 10568  	func() {
 10569  		if _db == nil {
 10570  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25050), unsafe.Pointer(&_sqlite3ApiExitØ00__func__Ø000), unsafe.Pointer(str(1219)))
 10571  			crt.X__builtin_abort(tls)
 10572  		}
 10573  	}()
 10574  	func() {
 10575  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 10576  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25051), unsafe.Pointer(&_sqlite3ApiExitØ00__func__Ø000), unsafe.Pointer(str(881)))
 10577  			crt.X__builtin_abort(tls)
 10578  		}
 10579  	}()
 10580  	if (_db.XmallocFailed != 0) || (_rc == int32(3082)) {
 10581  		return _apiOomError(tls, _db)
 10582  	}
 10583  	return _rc & _db.XerrMask
 10584  }
 10585  
 10586  var _sqlite3ApiExitØ00__func__Ø000 [15]int8
 10587  
 10588  func init() {
 10589  	crt.Xstrncpy(nil, &_sqlite3ApiExitØ00__func__Ø000[0], str(8456), 15)
 10590  }
 10591  
 10592  // C comment
 10593  //  /*
 10594  //  ** Take actions at the end of an API call to indicate an OOM error
 10595  //  */
 10596  func _apiOomError(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 10597  	_sqlite3OomClear(tls, _db)
 10598  	_sqlite3Error(tls, _db, int32(7))
 10599  	return _sqlite3NomemError(tls, int32(25030))
 10600  }
 10601  
 10602  // C comment
 10603  //  /*
 10604  //  ** This routine reactivates the memory allocator and clears the
 10605  //  ** db->mallocFailed flag as necessary.
 10606  //  **
 10607  //  ** The memory allocator is not restarted if there are running
 10608  //  ** VDBEs.
 10609  //  */
 10610  func _sqlite3OomClear(tls *crt.TLS, _db *Xsqlite3) {
 10611  	if (_db.XmallocFailed != 0) && (_db.XnVdbeExec == int32(0)) {
 10612  		_db.XmallocFailed = 0
 10613  		*(*int32)(unsafe.Pointer(&_db.Xu1)) = int32(0)
 10614  		func() {
 10615  			if (_db.Xlookaside.XbDisable) <= (0) {
 10616  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25019), unsafe.Pointer(&_sqlite3OomClearØ00__func__Ø000), unsafe.Pointer(str(8471)))
 10617  				crt.X__builtin_abort(tls)
 10618  			}
 10619  		}()
 10620  		_db.Xlookaside.XbDisable -= 1
 10621  	}
 10622  }
 10623  
 10624  var _sqlite3OomClearØ00__func__Ø000 [16]int8
 10625  
 10626  func init() {
 10627  	crt.Xstrncpy(nil, &_sqlite3OomClearØ00__func__Ø000[0], str(8496), 16)
 10628  }
 10629  
 10630  func Xsqlite3_bind_double(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _rValue float64) (r0 int32) {
 10631  	var _rc int32
 10632  	var _p *TVdbe
 10633  	_p = (*TVdbe)(_pStmt)
 10634  	_rc = _vdbeUnbind(tls, _p, _i)
 10635  	if _rc == int32(0) {
 10636  		_sqlite3VdbeMemSetDouble(tls, elem25((*XMem)(_p.XaVar), uintptr(_i-int32(1))), _rValue)
 10637  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex))
 10638  	}
 10639  	return _rc
 10640  }
 10641  
 10642  func Xsqlite3_bind_int(tls *crt.TLS, _p unsafe.Pointer, _i int32, _iValue int32) (r0 int32) {
 10643  	return Xsqlite3_bind_int64(tls, _p, _i, int64(_iValue))
 10644  }
 10645  
 10646  func Xsqlite3_bind_int64(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _iValue int64) (r0 int32) {
 10647  	var _rc int32
 10648  	var _p *TVdbe
 10649  	_p = (*TVdbe)(_pStmt)
 10650  	_rc = _vdbeUnbind(tls, _p, _i)
 10651  	if _rc == int32(0) {
 10652  		_sqlite3VdbeMemSetInt64(tls, elem25((*XMem)(_p.XaVar), uintptr(_i-int32(1))), _iValue)
 10653  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex))
 10654  	}
 10655  	return _rc
 10656  }
 10657  
 10658  // C comment
 10659  //  /*
 10660  //  ** Delete any previous value and set the value stored in *pMem to val,
 10661  //  ** manifest type INTEGER.
 10662  //  */
 10663  func _sqlite3VdbeMemSetInt64(tls *crt.TLS, _pMem *XMem, _val int64) {
 10664  	if (int32(_pMem.Xflags) & int32(9312)) != int32(0) {
 10665  		_vdbeReleaseAndSetInt64(tls, _pMem, _val)
 10666  		goto _1
 10667  	}
 10668  	*(*int64)(unsafe.Pointer(&_pMem.Xu)) = _val
 10669  	_pMem.Xflags = uint16(4)
 10670  _1:
 10671  }
 10672  
 10673  // C comment
 10674  //  /*
 10675  //  ** The pMem is known to contain content that needs to be destroyed prior
 10676  //  ** to a value change.  So invoke the destructor, then set the value to
 10677  //  ** a 64-bit integer.
 10678  //  */
 10679  func _vdbeReleaseAndSetInt64(tls *crt.TLS, _pMem *XMem, _val int64) {
 10680  	_sqlite3VdbeMemSetNull(tls, _pMem)
 10681  	*(*int64)(unsafe.Pointer(&_pMem.Xu)) = _val
 10682  	_pMem.Xflags = uint16(4)
 10683  }
 10684  
 10685  func Xsqlite3_bind_null(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 int32) {
 10686  	var _rc int32
 10687  	var _p *TVdbe
 10688  	_p = (*TVdbe)(_pStmt)
 10689  	_rc = _vdbeUnbind(tls, _p, _i)
 10690  	if _rc == int32(0) {
 10691  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex))
 10692  	}
 10693  	return _rc
 10694  }
 10695  
 10696  // C comment
 10697  //  /*
 10698  //  ** Return the number of wildcards that can be potentially bound to.
 10699  //  ** This routine is added to support DBD::SQLite.
 10700  //  */
 10701  func Xsqlite3_bind_parameter_count(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
 10702  	var _p *TVdbe
 10703  	_p = (*TVdbe)(_pStmt)
 10704  	return func() int32 {
 10705  		if _p != nil {
 10706  			return int32(_p.XnVar)
 10707  		}
 10708  		return int32(0)
 10709  	}()
 10710  }
 10711  
 10712  // C comment
 10713  //  /*
 10714  //  ** CAPI3REF: Index Of A Parameter With A Given Name
 10715  //  ** METHOD: sqlite3_stmt
 10716  //  **
 10717  //  ** ^Return the index of an SQL parameter given its name.  ^The
 10718  //  ** index value returned is suitable for use as the second
 10719  //  ** parameter to [sqlite3_bind_blob|sqlite3_bind()].  ^A zero
 10720  //  ** is returned if no matching parameter is found.  ^The parameter
 10721  //  ** name must be given in UTF-8 even if the original statement
 10722  //  ** was prepared from UTF-16 text using [sqlite3_prepare16_v2()].
 10723  //  **
 10724  //  ** See also: [sqlite3_bind_blob|sqlite3_bind()],
 10725  //  ** [sqlite3_bind_parameter_count()], and
 10726  //  ** [sqlite3_bind_parameter_name()].
 10727  //  */
 10728  func Xsqlite3_bind_parameter_index(tls *crt.TLS, _pStmt unsafe.Pointer, _zName *int8) (r0 int32) {
 10729  	return _sqlite3VdbeParameterIndex(tls, (*TVdbe)(_pStmt), _zName, _sqlite3Strlen30(tls, _zName))
 10730  }
 10731  
 10732  // C comment
 10733  //  /*
 10734  //  ** Given a wildcard parameter name, return the index of the variable
 10735  //  ** with that name.  If there is no variable with the given name,
 10736  //  ** return 0.
 10737  //  */
 10738  func _sqlite3VdbeParameterIndex(tls *crt.TLS, _p *TVdbe, _zName *int8, _nName int32) (r0 int32) {
 10739  	if (_p == nil) || (_zName == nil) {
 10740  		return int32(0)
 10741  	}
 10742  	return _sqlite3VListNameToNum(tls, _p.XpVList, _zName, _nName)
 10743  }
 10744  
 10745  // C comment
 10746  //  /*
 10747  //  ** Return the number of the variable named zName, if it is in VList.
 10748  //  ** or return 0 if there is no such variable.
 10749  //  */
 10750  func _sqlite3VListNameToNum(tls *crt.TLS, _pIn *int32, _zName *int8, _nName int32) (r0 int32) {
 10751  	var _i, _mx int32
 10752  	var _1_z *int8
 10753  	if _pIn == nil {
 10754  		return int32(0)
 10755  	}
 10756  	_mx = *elem8(_pIn, uintptr(1))
 10757  	_i = int32(2)
 10758  _1:
 10759  	_1_z = (*int8)(unsafe.Pointer(elem8(_pIn, uintptr(_i+int32(2)))))
 10760  	if (crt.Xstrncmp(tls, _1_z, _zName, uint32(_nName)) == int32(0)) && (int32(*elem1(_1_z, uintptr(_nName))) == int32(0)) {
 10761  		return *elem8(_pIn, uintptr(_i))
 10762  	}
 10763  	_i += *elem8(_pIn, uintptr(_i+int32(1)))
 10764  	if _i < _mx {
 10765  		goto _1
 10766  	}
 10767  	return int32(0)
 10768  }
 10769  
 10770  // C comment
 10771  //  /*
 10772  //  ** Return the name of a wildcard parameter.  Return NULL if the index
 10773  //  ** is out of range or if the wildcard is unnamed.
 10774  //  **
 10775  //  ** The result is always UTF-8.
 10776  //  */
 10777  func Xsqlite3_bind_parameter_name(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 *int8) {
 10778  	var _p *TVdbe
 10779  	_p = (*TVdbe)(_pStmt)
 10780  	if _p == nil {
 10781  		return nil
 10782  	}
 10783  	return _sqlite3VListNumToName(tls, _p.XpVList, _i)
 10784  }
 10785  
 10786  // C comment
 10787  //  /*
 10788  //  ** Return a pointer to the name of a variable in the given VList that
 10789  //  ** has the value iVal.  Or return a NULL if there is no such variable in
 10790  //  ** the list
 10791  //  */
 10792  func _sqlite3VListNumToName(tls *crt.TLS, _pIn *int32, _iVal int32) (r0 *int8) {
 10793  	var _i, _mx int32
 10794  	if _pIn == nil {
 10795  		return nil
 10796  	}
 10797  	_mx = *elem8(_pIn, uintptr(1))
 10798  	_i = int32(2)
 10799  _1:
 10800  	if (*elem8(_pIn, uintptr(_i))) == _iVal {
 10801  		return (*int8)(unsafe.Pointer(elem8(_pIn, uintptr(_i+int32(2)))))
 10802  	}
 10803  	_i += *elem8(_pIn, uintptr(_i+int32(1)))
 10804  	if _i < _mx {
 10805  		goto _1
 10806  	}
 10807  	return nil
 10808  }
 10809  
 10810  func Xsqlite3_bind_text(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _zData *int8, _nData int32, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
 10811  	return _bindText(tls, _pStmt, _i, unsafe.Pointer(_zData), _nData, _xDel, uint8(1))
 10812  }
 10813  
 10814  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) {
 10815  	return _bindText(tls, _pStmt, _i, _zData, _nData, _xDel, uint8(2))
 10816  }
 10817  
 10818  // C comment
 10819  //  /* SQLITE_OMIT_UTF16 */
 10820  func Xsqlite3_bind_value(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _pValue *XMem) (r0 int32) {
 10821  	var _rc int32
 10822  	switch Xsqlite3_value_type(tls, _pValue) {
 10823  	case int32(1):
 10824  		goto _1
 10825  	case int32(2):
 10826  		goto _2
 10827  	case int32(3):
 10828  		goto _4
 10829  	case int32(4):
 10830  		goto _3
 10831  	default:
 10832  		goto _5
 10833  	}
 10834  
 10835  _1:
 10836  	_rc = Xsqlite3_bind_int64(tls, _pStmt, _i, *(*int64)(unsafe.Pointer(&_pValue.Xu)))
 10837  	goto _6
 10838  _2:
 10839  	_rc = Xsqlite3_bind_double(tls, _pStmt, _i, *(*float64)(unsafe.Pointer(&_pValue.Xu)))
 10840  	goto _6
 10841  _3:
 10842  	if (int32(_pValue.Xflags) & int32(16384)) != 0 {
 10843  		_rc = Xsqlite3_bind_zeroblob(tls, _pStmt, _i, *(*int32)(unsafe.Pointer(&_pValue.Xu)))
 10844  		goto _8
 10845  	}
 10846  	_rc = Xsqlite3_bind_blob(tls, _pStmt, _i, unsafe.Pointer(_pValue.Xz), _pValue.Xn, *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
 10847  _8:
 10848  	goto _6
 10849  _4:
 10850  	_rc = _bindText(tls, _pStmt, _i, unsafe.Pointer(_pValue.Xz), _pValue.Xn, *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})), _pValue.Xenc)
 10851  	goto _6
 10852  _5:
 10853  	_rc = Xsqlite3_bind_null(tls, _pStmt, _i)
 10854  	goto _6
 10855  _6:
 10856  	return _rc
 10857  }
 10858  
 10859  func Xsqlite3_bind_zeroblob(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _n int32) (r0 int32) {
 10860  	var _rc int32
 10861  	var _p *TVdbe
 10862  	_p = (*TVdbe)(_pStmt)
 10863  	_rc = _vdbeUnbind(tls, _p, _i)
 10864  	if _rc == int32(0) {
 10865  		_sqlite3VdbeMemSetZeroBlob(tls, elem25((*XMem)(_p.XaVar), uintptr(_i-int32(1))), _n)
 10866  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex))
 10867  	}
 10868  	return _rc
 10869  }
 10870  
 10871  // C comment
 10872  //  /*
 10873  //  ** Delete any previous value and set the value to be a BLOB of length
 10874  //  ** n containing all zeros.
 10875  //  */
 10876  func _sqlite3VdbeMemSetZeroBlob(tls *crt.TLS, _pMem *XMem, _n int32) {
 10877  	_sqlite3VdbeMemRelease(tls, _pMem)
 10878  	_pMem.Xflags = uint16(16400)
 10879  	_pMem.Xn = int32(0)
 10880  	if _n < int32(0) {
 10881  		_n = int32(0)
 10882  	}
 10883  	*(*int32)(unsafe.Pointer(&_pMem.Xu)) = _n
 10884  	_pMem.Xenc = uint8(1)
 10885  	_pMem.Xz = nil
 10886  }
 10887  
 10888  // C comment
 10889  //  /*
 10890  //  ** This routine sets the busy callback for an Sqlite database to the
 10891  //  ** given callback function with the given argument.
 10892  //  */
 10893  func Xsqlite3_busy_handler(tls *crt.TLS, _db *Xsqlite3, _xBusy func(*crt.TLS, unsafe.Pointer, int32) int32, _pArg unsafe.Pointer) (r0 int32) {
 10894  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
 10895  		return _sqlite3MisuseError(tls, int32(141988))
 10896  	}
 10897  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 10898  	_db.XbusyHandler.XxFunc = _xBusy
 10899  	_db.XbusyHandler.XpArg = _pArg
 10900  	_db.XbusyHandler.XnBusy = int32(0)
 10901  	_db.XbusyTimeout = int32(0)
 10902  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 10903  	return int32(0)
 10904  }
 10905  
 10906  // C comment
 10907  //  /*
 10908  //  ** Check to make sure we have a valid db pointer.  This test is not
 10909  //  ** foolproof but it does provide some measure of protection against
 10910  //  ** misuse of the interface such as passing in db pointers that are
 10911  //  ** NULL or which have been previously closed.  If this routine returns
 10912  //  ** 1 it means that the db pointer is valid and 0 if it should not be
 10913  //  ** dereferenced for any reason.  The calling function should invoke
 10914  //  ** SQLITE_MISUSE immediately.
 10915  //  **
 10916  //  ** sqlite3SafetyCheckOk() requires that the db pointer be valid for
 10917  //  ** use.  sqlite3SafetyCheckSickOrOk() allows a db pointer that failed to
 10918  //  ** open properly and is not fit for general use but which can be
 10919  //  ** used as an argument to sqlite3_errmsg() or sqlite3_close().
 10920  //  */
 10921  func _sqlite3SafetyCheckOk(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 10922  	var _magic uint32
 10923  	if _db == nil {
 10924  		_logBadConnection(tls, str(285))
 10925  		return int32(0)
 10926  	}
 10927  	_magic = _db.Xmagic
 10928  	if _magic == uint32(2687084183) {
 10929  		goto _1
 10930  	}
 10931  	if _sqlite3SafetyCheckSickOrOk(tls, _db) != 0 {
 10932  		_logBadConnection(tls, str(8512))
 10933  	}
 10934  	return int32(0)
 10935  
 10936  _1:
 10937  	return int32(1)
 10938  }
 10939  
 10940  // C comment
 10941  //  /*
 10942  //  ** Log an error that is an API call on a connection pointer that should
 10943  //  ** not have been used.  The "type" of connection pointer is given as the
 10944  //  ** argument.  The zType is a word like "NULL" or "closed" or "invalid".
 10945  //  */
 10946  func _logBadConnection(tls *crt.TLS, _zType *int8) {
 10947  	Xsqlite3_log(tls, int32(21), str(8521), unsafe.Pointer(_zType))
 10948  }
 10949  
 10950  func _sqlite3SafetyCheckSickOrOk(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 10951  	var _magic uint32
 10952  	_magic = _db.Xmagic
 10953  	if ((_magic != uint32(1266094736)) && (_magic != uint32(2687084183))) && (_magic != uint32(4030429446)) {
 10954  		_logBadConnection(tls, str(8566))
 10955  		return int32(0)
 10956  	}
 10957  	return int32(1)
 10958  }
 10959  
 10960  // C comment
 10961  //  /*
 10962  //  ** This routine installs a default busy handler that waits for the
 10963  //  ** specified number of milliseconds before returning 0.
 10964  //  */
 10965  func Xsqlite3_busy_timeout(tls *crt.TLS, _db *Xsqlite3, _ms int32) (r0 int32) {
 10966  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
 10967  		return _sqlite3MisuseError(tls, int32(142038))
 10968  	}
 10969  	if _ms > int32(0) {
 10970  		Xsqlite3_busy_handler(tls, _db, _sqliteDefaultBusyCallback, unsafe.Pointer(_db))
 10971  		_db.XbusyTimeout = _ms
 10972  		goto _2
 10973  	}
 10974  	Xsqlite3_busy_handler(tls, _db, nil, nil)
 10975  _2:
 10976  	return int32(0)
 10977  }
 10978  
 10979  // C comment
 10980  //  /*
 10981  //  ** This routine implements a busy callback that sleeps and tries
 10982  //  ** again until a timeout value is reached.  The timeout value is
 10983  //  ** an integer number of milliseconds passed in as the first
 10984  //  ** argument.
 10985  //  */
 10986  func _sqliteDefaultBusyCallback(tls *crt.TLS, _ptr unsafe.Pointer, _count int32) (r0 int32) {
 10987  	var _timeout, _delay, _prior int32
 10988  	var _db *Xsqlite3
 10989  	_db = (*Xsqlite3)(_ptr)
 10990  	_timeout = _db.XbusyTimeout
 10991  	func() {
 10992  		if _count < int32(0) {
 10993  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(141934), unsafe.Pointer(&_sqliteDefaultBusyCallbackØ00__func__Ø000), unsafe.Pointer(str(8574)))
 10994  			crt.X__builtin_abort(tls)
 10995  		}
 10996  	}()
 10997  	if _count < int32(12) {
 10998  		_delay = int32(*elem15((*uint8)(unsafe.Pointer(&_sqliteDefaultBusyCallbackØ00delaysØ001)), uintptr(_count)))
 10999  		_prior = int32(*elem15((*uint8)(unsafe.Pointer(&_sqliteDefaultBusyCallbackØ00totalsØ002)), uintptr(_count)))
 11000  		goto _3
 11001  	}
 11002  	_delay = int32(*elem15((*uint8)(unsafe.Pointer(&_sqliteDefaultBusyCallbackØ00delaysØ001)), uintptr(11)))
 11003  	_prior = int32(*elem15((*uint8)(unsafe.Pointer(&_sqliteDefaultBusyCallbackØ00totalsØ002)), uintptr(11))) + (_delay * (_count - int32(11)))
 11004  _3:
 11005  	if (_prior + _delay) <= _timeout {
 11006  		goto _4
 11007  	}
 11008  	_delay = _timeout - _prior
 11009  	if _delay <= int32(0) {
 11010  		return int32(0)
 11011  	}
 11012  _4:
 11013  	_sqlite3OsSleep(tls, (*Xsqlite3_vfs)(_db.XpVfs), _delay*int32(1000))
 11014  	return int32(1)
 11015  }
 11016  
 11017  var _sqliteDefaultBusyCallbackØ00__func__Ø000 [26]int8
 11018  
 11019  func init() {
 11020  	crt.Xstrncpy(nil, &_sqliteDefaultBusyCallbackØ00__func__Ø000[0], str(8583), 26)
 11021  }
 11022  
 11023  var _sqliteDefaultBusyCallbackØ00delaysØ001 [12]uint8
 11024  
 11025  func init() {
 11026  	_sqliteDefaultBusyCallbackØ00delaysØ001 = [12]uint8{1, 2, 5, 10, 15, 20, 25, 25, 25, 50, 50, 100}
 11027  }
 11028  
 11029  var _sqliteDefaultBusyCallbackØ00totalsØ002 [12]uint8
 11030  
 11031  func init() {
 11032  	_sqliteDefaultBusyCallbackØ00totalsØ002 = [12]uint8{0, 1, 3, 8, 18, 33, 53, 78, 103, 128, 178, 228}
 11033  }
 11034  
 11035  func _sqlite3OsSleep(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _nMicro int32) (r0 int32) {
 11036  	return func() func(*crt.TLS, *Xsqlite3_vfs, int32) int32 {
 11037  		v := _pVfs.XxSleep
 11038  		return *(*func(*crt.TLS, *Xsqlite3_vfs, int32) int32)(unsafe.Pointer(&v))
 11039  	}()(tls, _pVfs, _nMicro)
 11040  }
 11041  
 11042  // C comment
 11043  //  /*
 11044  //  ** Return the number of changes in the most recent call to sqlite3_exec().
 11045  //  */
 11046  func Xsqlite3_changes(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 11047  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
 11048  		_sqlite3MisuseError(tls, int32(141413))
 11049  		return int32(0)
 11050  	}
 11051  	return _db.XnChange
 11052  }
 11053  
 11054  // C comment
 11055  //  /*
 11056  //  ** Two variations on the public interface for closing a database
 11057  //  ** connection. The sqlite3_close() version returns SQLITE_BUSY and
 11058  //  ** leaves the connection option if there are unfinalized prepared
 11059  //  ** statements or unfinished sqlite3_backups.  The sqlite3_close_v2()
 11060  //  ** version forces the connection to become a zombie if there are
 11061  //  ** unclosed resources, and arranges for deallocation when the last
 11062  //  ** prepare statement or sqlite3_backup closes.
 11063  //  */
 11064  func Xsqlite3_close(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 11065  	return _sqlite3Close(tls, _db, int32(0))
 11066  }
 11067  
 11068  // C comment
 11069  //  /*
 11070  //  ** Close an existing SQLite database
 11071  //  */
 11072  func _sqlite3Close(tls *crt.TLS, _db *Xsqlite3, _forceZombie int32) (r0 int32) {
 11073  	if _db == nil {
 11074  		return int32(0)
 11075  	}
 11076  	if _sqlite3SafetyCheckSickOrOk(tls, _db) == 0 {
 11077  		return _sqlite3MisuseError(tls, int32(141522))
 11078  	}
 11079  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 11080  	if (int32(_db.XmTrace) & int32(8)) != 0 {
 11081  		_db.XxTrace(tls, uint32(8), _db.XpTraceArg, unsafe.Pointer(_db), nil)
 11082  	}
 11083  	_disconnectAllVtab(tls, _db)
 11084  	_sqlite3VtabRollback(tls, _db)
 11085  	if (_forceZombie == 0) && _connectionIsBusy(tls, _db) != 0 {
 11086  		_sqlite3ErrorWithMsg(tls, _db, int32(5), str(8609))
 11087  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 11088  		return int32(5)
 11089  	}
 11090  	_db.Xmagic = uint32(1691352191)
 11091  	_sqlite3LeaveMutexAndCloseZombie(tls, _db)
 11092  	return int32(0)
 11093  }
 11094  
 11095  // C comment
 11096  //  /*
 11097  //  ** Disconnect all sqlite3_vtab objects that belong to database connection
 11098  //  ** db. This is called when db is being closed.
 11099  //  */
 11100  func _disconnectAllVtab(tls *crt.TLS, _db *Xsqlite3) {
 11101  	var _i int32
 11102  	var _1_pSchema *XSchema
 11103  	var _p *XHashElem
 11104  	var _3_pTab *XTable
 11105  	var _4_pMod *XModule
 11106  	_sqlite3BtreeEnterAll(tls, _db)
 11107  	_i = int32(0)
 11108  _0:
 11109  	if _i >= _db.XnDb {
 11110  		goto _3
 11111  	}
 11112  	_1_pSchema = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpSchema)
 11113  	if (elem27((*XDb)(_db.XaDb), uintptr(_i)).XpSchema) == nil {
 11114  		goto _4
 11115  	}
 11116  	_p = (*XHashElem)(_1_pSchema.XtblHash.Xfirst)
 11117  _5:
 11118  	if _p == nil {
 11119  		goto _8
 11120  	}
 11121  	_3_pTab = (*XTable)(_p.Xdata)
 11122  	if _3_pTab.XnModuleArg != 0 {
 11123  		_sqlite3VtabDisconnect(tls, _db, _3_pTab)
 11124  	}
 11125  	_p = (*XHashElem)(_p.Xnext)
 11126  	goto _5
 11127  _8:
 11128  _4:
 11129  	_i += 1
 11130  	goto _0
 11131  _3:
 11132  	_p = (*XHashElem)(_db.XaModule.Xfirst)
 11133  _10:
 11134  	if _p == nil {
 11135  		goto _13
 11136  	}
 11137  	_4_pMod = (*XModule)(_p.Xdata)
 11138  	if _4_pMod.XpEpoTab != nil {
 11139  		_sqlite3VtabDisconnect(tls, _db, (*XTable)(_4_pMod.XpEpoTab))
 11140  	}
 11141  	_p = (*XHashElem)(_p.Xnext)
 11142  	goto _10
 11143  _13:
 11144  	_sqlite3VtabUnlockList(tls, _db)
 11145  	_sqlite3BtreeLeaveAll(tls, _db)
 11146  }
 11147  
 11148  func _sqlite3BtreeEnterAll(tls *crt.TLS, _db *Xsqlite3) {
 11149  	if int32(_db.XskipBtreeMutex) == int32(0) {
 11150  		_btreeEnterAll(tls, _db)
 11151  	}
 11152  }
 11153  
 11154  // C comment
 11155  //  /*
 11156  //  ** Enter the mutex on every Btree associated with a database
 11157  //  ** connection.  This is needed (for example) prior to parsing
 11158  //  ** a statement since we will be comparing table and column names
 11159  //  ** against all schemas and we do not want those schemas being
 11160  //  ** reset out from under us.
 11161  //  **
 11162  //  ** There is a corresponding leave-all procedures.
 11163  //  **
 11164  //  ** Enter the mutexes in accending order by BtShared pointer address
 11165  //  ** to avoid the possibility of deadlock when two threads with
 11166  //  ** two or more btrees in common both try to lock all their btrees
 11167  //  ** at the same instant.
 11168  //  */
 11169  func _btreeEnterAll(tls *crt.TLS, _db *Xsqlite3) {
 11170  	var _i, _skipOk int32
 11171  	var _p *XBtree
 11172  	_skipOk = int32(1)
 11173  	func() {
 11174  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 11175  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58913), unsafe.Pointer(&_btreeEnterAllØ00__func__Ø000), unsafe.Pointer(str(881)))
 11176  			crt.X__builtin_abort(tls)
 11177  		}
 11178  	}()
 11179  	_i = int32(0)
 11180  _2:
 11181  	if _i >= _db.XnDb {
 11182  		goto _5
 11183  	}
 11184  	_p = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 11185  	if (_p != nil) && (_p.Xsharable != 0) {
 11186  		_sqlite3BtreeEnter(tls, _p)
 11187  		_skipOk = int32(0)
 11188  	}
 11189  	_i += 1
 11190  	goto _2
 11191  _5:
 11192  	_db.XskipBtreeMutex = uint8(_skipOk)
 11193  }
 11194  
 11195  var _btreeEnterAllØ00__func__Ø000 [14]int8
 11196  
 11197  func init() {
 11198  	crt.Xstrncpy(nil, &_btreeEnterAllØ00__func__Ø000[0], str(8677), 14)
 11199  }
 11200  
 11201  // C comment
 11202  //  /*
 11203  //  ** Enter a mutex on the given BTree object.
 11204  //  **
 11205  //  ** If the object is not sharable, then no mutex is ever required
 11206  //  ** and this routine is a no-op.  The underlying mutex is non-recursive.
 11207  //  ** But we keep a reference count in Btree.wantToLock so the behavior
 11208  //  ** of this interface is recursive.
 11209  //  **
 11210  //  ** To avoid deadlocks, multiple Btrees are locked in the same order
 11211  //  ** by all database connections.  The p->pNext is a list of other
 11212  //  ** Btrees belonging to the same database connection as the p Btree
 11213  //  ** which need to be locked after p.  If we cannot get a lock on
 11214  //  ** p, then first unlock all of the others on p->pNext, then wait
 11215  //  ** for the lock to become available on p, then relock all of the
 11216  //  ** subsequent Btrees that desire a lock.
 11217  //  */
 11218  func _sqlite3BtreeEnter(tls *crt.TLS, _p *XBtree) {
 11219  	func() {
 11220  		if (*XBtree)(_p.XpNext) != nil && crt.P2U((*XBtree)(_p.XpNext).XpBt) <= crt.P2U(_p.XpBt) {
 11221  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58799), unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000), unsafe.Pointer(str(8691)))
 11222  			crt.X__builtin_abort(tls)
 11223  		}
 11224  	}()
 11225  	func() {
 11226  		if (*XBtree)(_p.XpPrev) != nil && crt.P2U((*XBtree)(_p.XpPrev).XpBt) >= crt.P2U(_p.XpBt) {
 11227  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58800), unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000), unsafe.Pointer(str(8727)))
 11228  			crt.X__builtin_abort(tls)
 11229  		}
 11230  	}()
 11231  	func() {
 11232  		if (*XBtree)(_p.XpNext) != nil && (*Xsqlite3)((*XBtree)(_p.XpNext).Xdb) != (*Xsqlite3)(_p.Xdb) {
 11233  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58801), unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000), unsafe.Pointer(str(8763)))
 11234  			crt.X__builtin_abort(tls)
 11235  		}
 11236  	}()
 11237  	func() {
 11238  		if (*XBtree)(_p.XpPrev) != nil && (*Xsqlite3)((*XBtree)(_p.XpPrev).Xdb) != (*Xsqlite3)(_p.Xdb) {
 11239  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58802), unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000), unsafe.Pointer(str(8798)))
 11240  			crt.X__builtin_abort(tls)
 11241  		}
 11242  	}()
 11243  	func() {
 11244  		if _p.Xsharable == 0 && ((*XBtree)(_p.XpNext) != nil || (*XBtree)(_p.XpPrev) != nil) {
 11245  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58803), unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000), unsafe.Pointer(str(8833)))
 11246  			crt.X__builtin_abort(tls)
 11247  		}
 11248  	}()
 11249  	func() {
 11250  		if _p.Xlocked != 0 && _p.XwantToLock <= int32(0) {
 11251  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58806), unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000), unsafe.Pointer(str(8877)))
 11252  			crt.X__builtin_abort(tls)
 11253  		}
 11254  	}()
 11255  	func() {
 11256  		if _p.Xsharable == 0 && _p.XwantToLock != int32(0) {
 11257  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58807), unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000), unsafe.Pointer(str(8907)))
 11258  			crt.X__builtin_abort(tls)
 11259  		}
 11260  	}()
 11261  	func() {
 11262  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 11263  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58810), unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000), unsafe.Pointer(str(8939)))
 11264  			crt.X__builtin_abort(tls)
 11265  		}
 11266  	}()
 11267  	func() {
 11268  		if (int32(_p.Xlocked) != int32(0) || _p.Xsharable == 0) && (*Xsqlite3)((*XBtShared)(_p.XpBt).Xdb) != (*Xsqlite3)(_p.Xdb) {
 11269  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58814), unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000), unsafe.Pointer(str(8972)))
 11270  			crt.X__builtin_abort(tls)
 11271  		}
 11272  	}()
 11273  	if _p.Xsharable == 0 {
 11274  		return
 11275  	}
 11276  	_p.XwantToLock += 1
 11277  	if _p.Xlocked != 0 {
 11278  		return
 11279  	}
 11280  	_btreeLockCarefully(tls, _p)
 11281  }
 11282  
 11283  var _sqlite3BtreeEnterØ00__func__Ø000 [18]int8
 11284  
 11285  func init() {
 11286  	crt.Xstrncpy(nil, &_sqlite3BtreeEnterØ00__func__Ø000[0], str(9023), 18)
 11287  }
 11288  
 11289  // C comment
 11290  //  /* This is a helper function for sqlite3BtreeLock(). By moving
 11291  //  ** complex, but seldom used logic, out of sqlite3BtreeLock() and
 11292  //  ** into this routine, we avoid unnecessary stack pointer changes
 11293  //  ** and thus help the sqlite3BtreeLock() routine to run much faster
 11294  //  ** in the common case.
 11295  //  */
 11296  func _btreeLockCarefully(tls *crt.TLS, _p *XBtree) {
 11297  	var _pLater *XBtree
 11298  	if Xsqlite3_mutex_try(tls, (*Xsqlite3_mutex)((*XBtShared)(_p.XpBt).Xmutex)) == int32(0) {
 11299  		*(**Xsqlite3)(unsafe.Pointer(&((*XBtShared)(_p.XpBt).Xdb))) = (*Xsqlite3)(_p.Xdb)
 11300  		_p.Xlocked = uint8(1)
 11301  		return
 11302  	}
 11303  	_pLater = (*XBtree)(_p.XpNext)
 11304  _1:
 11305  	if _pLater == nil {
 11306  		goto _4
 11307  	}
 11308  	func() {
 11309  		if _pLater.Xsharable == 0 {
 11310  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58847), unsafe.Pointer(&_btreeLockCarefullyØ00__func__Ø000), unsafe.Pointer(str(9041)))
 11311  			crt.X__builtin_abort(tls)
 11312  		}
 11313  	}()
 11314  	func() {
 11315  		if (*XBtree)(_pLater.XpNext) != nil && crt.P2U((*XBtree)(_pLater.XpNext).XpBt) <= crt.P2U(_pLater.XpBt) {
 11316  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58848), unsafe.Pointer(&_btreeLockCarefullyØ00__func__Ø000), unsafe.Pointer(str(9058)))
 11317  			crt.X__builtin_abort(tls)
 11318  		}
 11319  	}()
 11320  	func() {
 11321  		if _pLater.Xlocked != 0 && _pLater.XwantToLock <= int32(0) {
 11322  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58849), unsafe.Pointer(&_btreeLockCarefullyØ00__func__Ø000), unsafe.Pointer(str(9109)))
 11323  			crt.X__builtin_abort(tls)
 11324  		}
 11325  	}()
 11326  	if _pLater.Xlocked != 0 {
 11327  		_unlockBtreeMutex(tls, _pLater)
 11328  	}
 11329  	_pLater = (*XBtree)(_pLater.XpNext)
 11330  	goto _1
 11331  _4:
 11332  	_lockBtreeMutex(tls, _p)
 11333  	_pLater = (*XBtree)(_p.XpNext)
 11334  _14:
 11335  	if _pLater == nil {
 11336  		goto _17
 11337  	}
 11338  	if _pLater.XwantToLock != 0 {
 11339  		_lockBtreeMutex(tls, _pLater)
 11340  	}
 11341  	_pLater = (*XBtree)(_pLater.XpNext)
 11342  	goto _14
 11343  _17:
 11344  }
 11345  
 11346  // C comment
 11347  //  /*
 11348  //  ** Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another
 11349  //  ** thread holds the mutex and it cannot be obtained, return SQLITE_BUSY.
 11350  //  */
 11351  func Xsqlite3_mutex_try(tls *crt.TLS, _p *Xsqlite3_mutex) (r0 int32) {
 11352  	var _rc int32
 11353  	_rc = int32(0)
 11354  	if _p != nil {
 11355  		func() {
 11356  			if (_sqlite3Config.Xmutex.XxMutexTry) == nil {
 11357  				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)))
 11358  				crt.X__builtin_abort(tls)
 11359  			}
 11360  		}()
 11361  		return func() func(*crt.TLS, *Xsqlite3_mutex) int32 {
 11362  			v := _sqlite3Config.Xmutex.XxMutexTry
 11363  			return *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&v))
 11364  		}()(tls, _p)
 11365  	}
 11366  	return _rc
 11367  }
 11368  
 11369  var _sqlite3_mutex_tryØ00__func__Ø000 [18]int8
 11370  
 11371  func init() {
 11372  	crt.Xstrncpy(nil, &_sqlite3_mutex_tryØ00__func__Ø000[0], str(9185), 18)
 11373  }
 11374  
 11375  var _btreeLockCarefullyØ00__func__Ø000 [19]int8
 11376  
 11377  func init() {
 11378  	crt.Xstrncpy(nil, &_btreeLockCarefullyØ00__func__Ø000[0], str(9203), 19)
 11379  }
 11380  
 11381  // C comment
 11382  //  /*
 11383  //  ** Release the BtShared mutex associated with B-Tree handle p and
 11384  //  ** clear the p->locked boolean.
 11385  //  */
 11386  func _unlockBtreeMutex(tls *crt.TLS, _p *XBtree) {
 11387  	var _pBt *XBtShared
 11388  	_pBt = (*XBtShared)(_p.XpBt)
 11389  	func() {
 11390  		if int32(_p.Xlocked) != int32(1) {
 11391  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58766), unsafe.Pointer(&_unlockBtreeMutexØ00__func__Ø000), unsafe.Pointer(str(9222)))
 11392  			crt.X__builtin_abort(tls)
 11393  		}
 11394  	}()
 11395  	func() {
 11396  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 11397  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58767), unsafe.Pointer(&_unlockBtreeMutexØ00__func__Ø000), unsafe.Pointer(str(9235)))
 11398  			crt.X__builtin_abort(tls)
 11399  		}
 11400  	}()
 11401  	func() {
 11402  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 11403  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58768), unsafe.Pointer(&_unlockBtreeMutexØ00__func__Ø000), unsafe.Pointer(str(8939)))
 11404  			crt.X__builtin_abort(tls)
 11405  		}
 11406  	}()
 11407  	func() {
 11408  		if (*Xsqlite3)(_p.Xdb) != (*Xsqlite3)(_pBt.Xdb) {
 11409  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58769), unsafe.Pointer(&_unlockBtreeMutexØ00__func__Ø000), unsafe.Pointer(str(9266)))
 11410  			crt.X__builtin_abort(tls)
 11411  		}
 11412  	}()
 11413  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pBt.Xmutex))
 11414  	_p.Xlocked = 0
 11415  }
 11416  
 11417  var _unlockBtreeMutexØ00__func__Ø000 [17]int8
 11418  
 11419  func init() {
 11420  	crt.Xstrncpy(nil, &_unlockBtreeMutexØ00__func__Ø000[0], str(9281), 17)
 11421  }
 11422  
 11423  // C comment
 11424  //  /*
 11425  //  ** Obtain the BtShared mutex associated with B-Tree handle p. Also,
 11426  //  ** set BtShared.db to the database handle associated with p and the
 11427  //  ** p->locked boolean to true.
 11428  //  */
 11429  func _lockBtreeMutex(tls *crt.TLS, _p *XBtree) {
 11430  	func() {
 11431  		if int32(_p.Xlocked) != int32(0) {
 11432  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58751), unsafe.Pointer(&_lockBtreeMutexØ00__func__Ø000), unsafe.Pointer(str(9298)))
 11433  			crt.X__builtin_abort(tls)
 11434  		}
 11435  	}()
 11436  	func() {
 11437  		if Xsqlite3_mutex_notheld(tls, (*Xsqlite3_mutex)((*XBtShared)(_p.XpBt).Xmutex)) == 0 {
 11438  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58752), unsafe.Pointer(&_lockBtreeMutexØ00__func__Ø000), unsafe.Pointer(str(9311)))
 11439  			crt.X__builtin_abort(tls)
 11440  		}
 11441  	}()
 11442  	func() {
 11443  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 11444  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58753), unsafe.Pointer(&_lockBtreeMutexØ00__func__Ø000), unsafe.Pointer(str(8939)))
 11445  			crt.X__builtin_abort(tls)
 11446  		}
 11447  	}()
 11448  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*XBtShared)(_p.XpBt).Xmutex))
 11449  	*(**Xsqlite3)(unsafe.Pointer(&((*XBtShared)(_p.XpBt).Xdb))) = (*Xsqlite3)(_p.Xdb)
 11450  	_p.Xlocked = uint8(1)
 11451  }
 11452  
 11453  var _lockBtreeMutexØ00__func__Ø000 [15]int8
 11454  
 11455  func init() {
 11456  	crt.Xstrncpy(nil, &_lockBtreeMutexØ00__func__Ø000[0], str(9348), 15)
 11457  }
 11458  
 11459  // C comment
 11460  //  /*
 11461  //  ** Table *p is a virtual table. This function removes the VTable object
 11462  //  ** for table *p associated with database connection db from the linked
 11463  //  ** list in p->pVTab. It also decrements the VTable ref count. This is
 11464  //  ** used when closing database connection db to free all of its VTable
 11465  //  ** objects without disturbing the rest of the Schema object (which may
 11466  //  ** be being used by other shared-cache connections).
 11467  //  */
 11468  func _sqlite3VtabDisconnect(tls *crt.TLS, _db *Xsqlite3, _p *XTable) {
 11469  	var _2_pVTab *XVTable
 11470  	var _ppVTab **XVTable
 11471  	func() {
 11472  		if _p.XnModuleArg == 0 {
 11473  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125207), unsafe.Pointer(&_sqlite3VtabDisconnectØ00__func__Ø000), unsafe.Pointer(str(9363)))
 11474  			crt.X__builtin_abort(tls)
 11475  		}
 11476  	}()
 11477  	func() {
 11478  		if _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
 11479  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125208), unsafe.Pointer(&_sqlite3VtabDisconnectØ00__func__Ø000), unsafe.Pointer(str(9376)))
 11480  			crt.X__builtin_abort(tls)
 11481  		}
 11482  	}()
 11483  	func() {
 11484  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 11485  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125209), unsafe.Pointer(&_sqlite3VtabDisconnectØ00__func__Ø000), unsafe.Pointer(str(881)))
 11486  			crt.X__builtin_abort(tls)
 11487  		}
 11488  	}()
 11489  	_ppVTab = (**XVTable)(unsafe.Pointer(&_p.XpVTable))
 11490  _6:
 11491  	if (*_ppVTab) == nil {
 11492  		goto _9
 11493  	}
 11494  	if (*Xsqlite3)((*_ppVTab).Xdb) == _db {
 11495  		_2_pVTab = *_ppVTab
 11496  		*_ppVTab = (*XVTable)(_2_pVTab.XpNext)
 11497  		_sqlite3VtabUnlock(tls, _2_pVTab)
 11498  		goto _9
 11499  	}
 11500  	_ppVTab = (**XVTable)(unsafe.Pointer(&((*_ppVTab).XpNext)))
 11501  	goto _6
 11502  _9:
 11503  }
 11504  
 11505  var _sqlite3VtabDisconnectØ00__func__Ø000 [22]int8
 11506  
 11507  func init() {
 11508  	crt.Xstrncpy(nil, &_sqlite3VtabDisconnectØ00__func__Ø000[0], str(9408), 22)
 11509  }
 11510  
 11511  // C comment
 11512  //  /*
 11513  //  ** Return true if the current thread holds the database connection
 11514  //  ** mutex and all required BtShared mutexes.
 11515  //  **
 11516  //  ** This routine is used inside assert() statements only.
 11517  //  */
 11518  func _sqlite3BtreeHoldsAllMutexes(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 11519  	var _i int32
 11520  	var _2_p *XBtree
 11521  	if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 11522  		return int32(0)
 11523  	}
 11524  	_i = int32(0)
 11525  _1:
 11526  	if _i >= _db.XnDb {
 11527  		goto _4
 11528  	}
 11529  	_2_p = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 11530  	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)) {
 11531  		return int32(0)
 11532  	}
 11533  	_i += 1
 11534  	goto _1
 11535  _4:
 11536  	return int32(1)
 11537  }
 11538  
 11539  // C comment
 11540  //  /*
 11541  //  ** Decrement the ref-count on a virtual table object. When the ref-count
 11542  //  ** reaches zero, call the xDisconnect() method to delete the object.
 11543  //  */
 11544  func _sqlite3VtabUnlock(tls *crt.TLS, _pVTab *XVTable) {
 11545  	var _db *Xsqlite3
 11546  	var _1_p *Xsqlite3_vtab
 11547  	_db = (*Xsqlite3)(_pVTab.Xdb)
 11548  	func() {
 11549  		if _db == nil {
 11550  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125143), unsafe.Pointer(&_sqlite3VtabUnlockØ00__func__Ø000), unsafe.Pointer(str(9430)))
 11551  			crt.X__builtin_abort(tls)
 11552  		}
 11553  	}()
 11554  	func() {
 11555  		if _pVTab.XnRef <= int32(0) {
 11556  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125144), unsafe.Pointer(&_sqlite3VtabUnlockØ00__func__Ø000), unsafe.Pointer(str(9433)))
 11557  			crt.X__builtin_abort(tls)
 11558  		}
 11559  	}()
 11560  	func() {
 11561  		if _db.Xmagic != uint32(2687084183) && _db.Xmagic != uint32(1691352191) {
 11562  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125145), unsafe.Pointer(&_sqlite3VtabUnlockØ00__func__Ø000), unsafe.Pointer(str(9447)))
 11563  			crt.X__builtin_abort(tls)
 11564  		}
 11565  	}()
 11566  	_pVTab.XnRef -= 1
 11567  	if _pVTab.XnRef != int32(0) {
 11568  		goto _7
 11569  	}
 11570  	_1_p = (*Xsqlite3_vtab)(_pVTab.XpVtab)
 11571  	if _1_p != nil {
 11572  		func() func(*crt.TLS, *Xsqlite3_vtab) int32 {
 11573  			v := (*Xsqlite3_module)(_1_p.XpModule).XxDisconnect
 11574  			return *(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&v))
 11575  		}()(tls, _1_p)
 11576  	}
 11577  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pVTab))
 11578  _7:
 11579  }
 11580  
 11581  var _sqlite3VtabUnlockØ00__func__Ø000 [18]int8
 11582  
 11583  func init() {
 11584  	crt.Xstrncpy(nil, &_sqlite3VtabUnlockØ00__func__Ø000[0], str(9510), 18)
 11585  }
 11586  
 11587  // C comment
 11588  //  /*
 11589  //  ** Disconnect all the virtual table objects in the sqlite3.pDisconnect list.
 11590  //  **
 11591  //  ** This function may only be called when the mutexes associated with all
 11592  //  ** shared b-tree databases opened using connection db are held by the
 11593  //  ** caller. This is done to protect the sqlite3.pDisconnect list. The
 11594  //  ** sqlite3.pDisconnect list is accessed only as follows:
 11595  //  **
 11596  //  **   1) By this function. In this case, all BtShared mutexes and the mutex
 11597  //  **      associated with the database handle itself must be held.
 11598  //  **
 11599  //  **   2) By function vtabDisconnectAll(), when it adds a VTable entry to
 11600  //  **      the sqlite3.pDisconnect list. In this case either the BtShared mutex
 11601  //  **      associated with the database the virtual table is stored in is held
 11602  //  **      or, if the virtual table is stored in a non-sharable database, then
 11603  //  **      the database handle mutex is held.
 11604  //  **
 11605  //  ** As a result, a sqlite3.pDisconnect cannot be accessed simultaneously
 11606  //  ** by multiple threads. It is thread-safe.
 11607  //  */
 11608  func _sqlite3VtabUnlockList(tls *crt.TLS, _db *Xsqlite3) {
 11609  	var _p, _2_pNext *XVTable
 11610  	_p = (*XVTable)(_db.XpDisconnect)
 11611  	*(**XVTable)(unsafe.Pointer(&_db.XpDisconnect)) = nil
 11612  	func() {
 11613  		if _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
 11614  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125246), unsafe.Pointer(&_sqlite3VtabUnlockListØ00__func__Ø000), unsafe.Pointer(str(9376)))
 11615  			crt.X__builtin_abort(tls)
 11616  		}
 11617  	}()
 11618  	func() {
 11619  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 11620  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125247), unsafe.Pointer(&_sqlite3VtabUnlockListØ00__func__Ø000), unsafe.Pointer(str(881)))
 11621  			crt.X__builtin_abort(tls)
 11622  		}
 11623  	}()
 11624  	if _p == nil {
 11625  		goto _4
 11626  	}
 11627  	_sqlite3ExpirePreparedStatements(tls, _db)
 11628  _5:
 11629  	_2_pNext = (*XVTable)(_p.XpNext)
 11630  	_sqlite3VtabUnlock(tls, _p)
 11631  	_p = _2_pNext
 11632  	if _p != nil {
 11633  		goto _5
 11634  	}
 11635  _4:
 11636  }
 11637  
 11638  var _sqlite3VtabUnlockListØ00__func__Ø000 [22]int8
 11639  
 11640  func init() {
 11641  	crt.Xstrncpy(nil, &_sqlite3VtabUnlockListØ00__func__Ø000[0], str(9528), 22)
 11642  }
 11643  
 11644  // C comment
 11645  //  /*
 11646  //  ** Mark every prepared statement associated with a database connection
 11647  //  ** as expired.
 11648  //  **
 11649  //  ** An expired statement means that recompilation of the statement is
 11650  //  ** recommend.  Statements expire when things happen that make their
 11651  //  ** programs obsolete.  Removing user-defined functions or collating
 11652  //  ** sequences, or changing an authorization function are the types of
 11653  //  ** things that make prepared statements obsolete.
 11654  //  */
 11655  func _sqlite3ExpirePreparedStatements(tls *crt.TLS, _db *Xsqlite3) {
 11656  	var _p *TVdbe
 11657  	_p = (*TVdbe)(_db.XpVdbe)
 11658  _0:
 11659  	if _p == nil {
 11660  		goto _3
 11661  	}
 11662  	storebits26(&_p.Xexpired, int16(1), 1, 0)
 11663  	_p = (*TVdbe)(_p.XpNext)
 11664  	goto _0
 11665  _3:
 11666  }
 11667  
 11668  func _sqlite3BtreeLeaveAll(tls *crt.TLS, _db *Xsqlite3) {
 11669  	if int32(_db.XskipBtreeMutex) == int32(0) {
 11670  		_btreeLeaveAll(tls, _db)
 11671  	}
 11672  }
 11673  
 11674  func _btreeLeaveAll(tls *crt.TLS, _db *Xsqlite3) {
 11675  	var _i int32
 11676  	var _p *XBtree
 11677  	func() {
 11678  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 11679  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58929), unsafe.Pointer(&_btreeLeaveAllØ00__func__Ø000), unsafe.Pointer(str(881)))
 11680  			crt.X__builtin_abort(tls)
 11681  		}
 11682  	}()
 11683  	_i = int32(0)
 11684  _2:
 11685  	if _i >= _db.XnDb {
 11686  		goto _5
 11687  	}
 11688  	_p = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 11689  	if _p != nil {
 11690  		_sqlite3BtreeLeave(tls, _p)
 11691  	}
 11692  	_i += 1
 11693  	goto _2
 11694  _5:
 11695  }
 11696  
 11697  var _btreeLeaveAllØ00__func__Ø000 [14]int8
 11698  
 11699  func init() {
 11700  	crt.Xstrncpy(nil, &_btreeLeaveAllØ00__func__Ø000[0], str(9550), 14)
 11701  }
 11702  
 11703  // C comment
 11704  //  /*
 11705  //  ** Exit the recursive mutex on a Btree.
 11706  //  */
 11707  func _sqlite3BtreeLeave(tls *crt.TLS, _p *XBtree) {
 11708  	func() {
 11709  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 11710  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58867), unsafe.Pointer(&_sqlite3BtreeLeaveØ00__func__Ø000), unsafe.Pointer(str(8939)))
 11711  			crt.X__builtin_abort(tls)
 11712  		}
 11713  	}()
 11714  	if _p.Xsharable == 0 {
 11715  		goto _2
 11716  	}
 11717  	func() {
 11718  		if _p.XwantToLock <= int32(0) {
 11719  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58869), unsafe.Pointer(&_sqlite3BtreeLeaveØ00__func__Ø000), unsafe.Pointer(str(9564)))
 11720  			crt.X__builtin_abort(tls)
 11721  		}
 11722  	}()
 11723  	_p.XwantToLock -= 1
 11724  	if _p.XwantToLock == int32(0) {
 11725  		_unlockBtreeMutex(tls, _p)
 11726  	}
 11727  _2:
 11728  }
 11729  
 11730  var _sqlite3BtreeLeaveØ00__func__Ø000 [18]int8
 11731  
 11732  func init() {
 11733  	crt.Xstrncpy(nil, &_sqlite3BtreeLeaveØ00__func__Ø000[0], str(9580), 18)
 11734  }
 11735  
 11736  // C comment
 11737  //  /*
 11738  //  ** Invoke the xRollback method of all virtual tables in the
 11739  //  ** sqlite3.aVTrans array. Then clear the array itself.
 11740  //  */
 11741  func _sqlite3VtabRollback(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 11742  	_callFinaliser(tls, _db, int32(68))
 11743  	return int32(0)
 11744  }
 11745  
 11746  // C comment
 11747  //  /*
 11748  //  ** This function invokes either the xRollback or xCommit method
 11749  //  ** of each of the virtual tables in the sqlite3.aVTrans array. The method
 11750  //  ** called is identified by the second argument, "offset", which is
 11751  //  ** the offset of the method to call in the sqlite3_module structure.
 11752  //  **
 11753  //  ** The array is cleared after invoking the callbacks.
 11754  //  */
 11755  func _callFinaliser(tls *crt.TLS, _db *Xsqlite3, _offset int32) {
 11756  	var _i int32
 11757  	var _2_pVTab *XVTable
 11758  	var _2_p *Xsqlite3_vtab
 11759  	var _1_aVTrans **XVTable
 11760  	var _3_x func(*crt.TLS, *Xsqlite3_vtab) int32
 11761  	if _db.XaVTrans == nil {
 11762  		goto _0
 11763  	}
 11764  	_1_aVTrans = (**XVTable)(unsafe.Pointer(_db.XaVTrans))
 11765  	*(***XVTable)(unsafe.Pointer(&_db.XaVTrans)) = nil
 11766  	_i = int32(0)
 11767  _1:
 11768  	if _i >= _db.XnVTrans {
 11769  		goto _4
 11770  	}
 11771  	_2_pVTab = *elem28(_1_aVTrans, uintptr(_i))
 11772  	_2_p = (*Xsqlite3_vtab)(_2_pVTab.XpVtab)
 11773  	if _2_p == nil {
 11774  		goto _5
 11775  	}
 11776  	_3_x = *(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_2_p.XpModule) + uintptr(_offset)))))
 11777  	if _3_x != nil {
 11778  		_3_x(tls, _2_p)
 11779  	}
 11780  _5:
 11781  	_2_pVTab.XiSavepoint = int32(0)
 11782  	_sqlite3VtabUnlock(tls, _2_pVTab)
 11783  	_i += 1
 11784  	goto _1
 11785  _4:
 11786  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_1_aVTrans))
 11787  	_db.XnVTrans = int32(0)
 11788  _0:
 11789  }
 11790  
 11791  // C comment
 11792  //  /*
 11793  //  ** Return TRUE if database connection db has unfinalized prepared
 11794  //  ** statements or unfinished sqlite3_backup objects.
 11795  //  */
 11796  func _connectionIsBusy(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 11797  	var _j int32
 11798  	var _1_pBt *XBtree
 11799  	func() {
 11800  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 11801  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(141503), unsafe.Pointer(&_connectionIsBusyØ00__func__Ø000), unsafe.Pointer(str(881)))
 11802  			crt.X__builtin_abort(tls)
 11803  		}
 11804  	}()
 11805  	if _db.XpVdbe != nil {
 11806  		return int32(1)
 11807  	}
 11808  	_j = int32(0)
 11809  _3:
 11810  	if _j >= _db.XnDb {
 11811  		goto _6
 11812  	}
 11813  	_1_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_j)).XpBt)
 11814  	if (_1_pBt != nil) && _sqlite3BtreeIsInBackup(tls, _1_pBt) != 0 {
 11815  		return int32(1)
 11816  	}
 11817  	_j += 1
 11818  	goto _3
 11819  _6:
 11820  	return int32(0)
 11821  }
 11822  
 11823  var _connectionIsBusyØ00__func__Ø000 [17]int8
 11824  
 11825  func init() {
 11826  	crt.Xstrncpy(nil, &_connectionIsBusyØ00__func__Ø000[0], str(9598), 17)
 11827  }
 11828  
 11829  func _sqlite3BtreeIsInBackup(tls *crt.TLS, _p *XBtree) (r0 int32) {
 11830  	func() {
 11831  		if _p == nil {
 11832  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68680), unsafe.Pointer(&_sqlite3BtreeIsInBackupØ00__func__Ø000), unsafe.Pointer(str(9615)))
 11833  			crt.X__builtin_abort(tls)
 11834  		}
 11835  	}()
 11836  	func() {
 11837  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 11838  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68681), unsafe.Pointer(&_sqlite3BtreeIsInBackupØ00__func__Ø000), unsafe.Pointer(str(8939)))
 11839  			crt.X__builtin_abort(tls)
 11840  		}
 11841  	}()
 11842  	return bool2int(_p.XnBackup != int32(0))
 11843  }
 11844  
 11845  var _sqlite3BtreeIsInBackupØ00__func__Ø000 [23]int8
 11846  
 11847  func init() {
 11848  	crt.Xstrncpy(nil, &_sqlite3BtreeIsInBackupØ00__func__Ø000[0], str(9617), 23)
 11849  }
 11850  
 11851  // C comment
 11852  //  /*
 11853  //  ** Set the most recent error code and error string for the sqlite
 11854  //  ** handle "db". The error code is set to "err_code".
 11855  //  **
 11856  //  ** If it is not NULL, string zFormat specifies the format of the
 11857  //  ** error string in the style of the printf functions: The following
 11858  //  ** format characters are allowed:
 11859  //  **
 11860  //  **      %s      Insert a string
 11861  //  **      %z      A string that should be freed after use
 11862  //  **      %d      Insert an integer
 11863  //  **      %T      Insert a token
 11864  //  **      %S      Insert the first element of a SrcList
 11865  //  **
 11866  //  ** zFormat and any string tokens that follow it are assumed to be
 11867  //  ** encoded in UTF-8.
 11868  //  **
 11869  //  ** To clear the most recent error for sqlite handle "db", sqlite3Error
 11870  //  ** should be called with err_code set to SQLITE_OK and zFormat set
 11871  //  ** to NULL.
 11872  //  */
 11873  func _sqlite3ErrorWithMsg(tls *crt.TLS, _db *Xsqlite3, _err_code int32, _zFormat *int8, args ...interface{}) {
 11874  	var _2_z *int8
 11875  	var _2_ap []interface{}
 11876  	func() {
 11877  		if _db == nil {
 11878  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27835), unsafe.Pointer(&_sqlite3ErrorWithMsgØ00__func__Ø000), unsafe.Pointer(str(1219)))
 11879  			crt.X__builtin_abort(tls)
 11880  		}
 11881  	}()
 11882  	_db.XerrCode = _err_code
 11883  	_sqlite3SystemError(tls, _db, _err_code)
 11884  	if _zFormat == nil {
 11885  		_sqlite3Error(tls, _db, _err_code)
 11886  		goto _5
 11887  	}
 11888  	if (_db.XpErr != nil) || (store25((**XMem)(unsafe.Pointer(&_db.XpErr)), _sqlite3ValueNew(tls, _db)) != nil) {
 11889  		_2_ap = args
 11890  		_2_z = _sqlite3VMPrintf(tls, _db, _zFormat, _2_ap)
 11891  		_2_ap = nil
 11892  		_sqlite3ValueSetStr(tls, (*XMem)(_db.XpErr), int32(-1), unsafe.Pointer(_2_z), uint8(1), func() func(*crt.TLS, unsafe.Pointer) {
 11893  			v := _sqlite3MallocSize
 11894  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
 11895  		}())
 11896  	}
 11897  _5:
 11898  }
 11899  
 11900  var _sqlite3ErrorWithMsgØ00__func__Ø000 [20]int8
 11901  
 11902  func init() {
 11903  	crt.Xstrncpy(nil, &_sqlite3ErrorWithMsgØ00__func__Ø000[0], str(9640), 20)
 11904  }
 11905  
 11906  // C comment
 11907  //  /*
 11908  //  ** Create a new sqlite3_value object.
 11909  //  */
 11910  func _sqlite3ValueNew(tls *crt.TLS, _db *Xsqlite3) (r0 *XMem) {
 11911  	var _p *XMem
 11912  	_p = (*XMem)(_sqlite3DbMallocZero(tls, _db, uint64(48)))
 11913  	if _p != nil {
 11914  		_p.Xflags = uint16(1)
 11915  		*(**Xsqlite3)(unsafe.Pointer(&_p.Xdb)) = _db
 11916  	}
 11917  	return _p
 11918  }
 11919  
 11920  // C comment
 11921  //  /*
 11922  //  ** Allocate and zero memory.  If the allocation fails, make
 11923  //  ** the mallocFailed flag in the connection pointer.
 11924  //  */
 11925  func _sqlite3DbMallocZero(tls *crt.TLS, _db *Xsqlite3, _n uint64) (r0 unsafe.Pointer) {
 11926  	var _p unsafe.Pointer
 11927  	_p = _sqlite3DbMallocRaw(tls, _db, _n)
 11928  	if _p != nil {
 11929  		crt.Xmemset(tls, _p, int32(0), uint32(_n))
 11930  	}
 11931  	return _p
 11932  }
 11933  
 11934  // C comment
 11935  //  /*
 11936  //  ** Change the string value of an sqlite3_value object
 11937  //  */
 11938  func _sqlite3ValueSetStr(tls *crt.TLS, _v *XMem, _n int32, _z unsafe.Pointer, _enc uint8, _xDel func(*crt.TLS, unsafe.Pointer)) {
 11939  	if _v != nil {
 11940  		_sqlite3VdbeMemSetStr(tls, _v, (*int8)(_z), _n, _enc, _xDel)
 11941  	}
 11942  }
 11943  
 11944  // C comment
 11945  //  /*
 11946  //  ** Close the mutex on database connection db.
 11947  //  **
 11948  //  ** Furthermore, if database connection db is a zombie (meaning that there
 11949  //  ** has been a prior call to sqlite3_close(db) or sqlite3_close_v2(db)) and
 11950  //  ** every sqlite3_stmt has now been finalized and every sqlite3_backup has
 11951  //  ** finished, then free all resources.
 11952  //  */
 11953  func _sqlite3LeaveMutexAndCloseZombie(tls *crt.TLS, _db *Xsqlite3) {
 11954  	var _j int32
 11955  	var _2_pDb *XDb
 11956  	var _i *XHashElem
 11957  	var _6_pNext, _6_p *XFuncDef
 11958  	var _8_pColl *XCollSeq
 11959  	var _11_pMod *XModule
 11960  	if (_db.Xmagic != uint32(1691352191)) || _connectionIsBusy(tls, _db) != 0 {
 11961  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 11962  		return
 11963  	}
 11964  	_sqlite3RollbackAll(tls, _db, int32(0))
 11965  	_sqlite3CloseSavepoints(tls, _db)
 11966  	_j = int32(0)
 11967  _2:
 11968  	if _j >= _db.XnDb {
 11969  		goto _5
 11970  	}
 11971  	_2_pDb = elem27((*XDb)(_db.XaDb), uintptr(_j))
 11972  	if _2_pDb.XpBt == nil {
 11973  		goto _6
 11974  	}
 11975  	_sqlite3BtreeClose(tls, (*XBtree)(_2_pDb.XpBt))
 11976  	*(**XBtree)(unsafe.Pointer(&_2_pDb.XpBt)) = nil
 11977  	if _j != int32(1) {
 11978  		*(**XSchema)(unsafe.Pointer(&_2_pDb.XpSchema)) = nil
 11979  	}
 11980  _6:
 11981  	_j += 1
 11982  	goto _2
 11983  _5:
 11984  	if (elem27((*XDb)(_db.XaDb), uintptr(1)).XpSchema) != nil {
 11985  		_sqlite3SchemaClear(tls, elem27((*XDb)(_db.XaDb), uintptr(1)).XpSchema)
 11986  	}
 11987  	_sqlite3VtabUnlockList(tls, _db)
 11988  	_sqlite3CollapseDatabaseArray(tls, _db)
 11989  	func() {
 11990  		if _db.XnDb > int32(2) {
 11991  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(141633), unsafe.Pointer(&_sqlite3LeaveMutexAndCloseZombieØ00__func__Ø000), unsafe.Pointer(str(9660)))
 11992  			crt.X__builtin_abort(tls)
 11993  		}
 11994  	}()
 11995  	func() {
 11996  		if (*XDb)(_db.XaDb) != (*XDb)(unsafe.Pointer(&_db.XaDbStatic)) {
 11997  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(141634), unsafe.Pointer(&_sqlite3LeaveMutexAndCloseZombieØ00__func__Ø000), unsafe.Pointer(str(9671)))
 11998  			crt.X__builtin_abort(tls)
 11999  		}
 12000  	}()
 12001  	_i = (*XHashElem)(_db.XaFunc.Xfirst)
 12002  _13:
 12003  	if _i == nil {
 12004  		goto _16
 12005  	}
 12006  	_6_p = (*XFuncDef)(_i.Xdata)
 12007  _17:
 12008  	_functionDestroy(tls, _db, _6_p)
 12009  	_6_pNext = (*XFuncDef)(_6_p.XpNext)
 12010  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_6_p))
 12011  	_6_p = _6_pNext
 12012  	if _6_p != nil {
 12013  		goto _17
 12014  	}
 12015  	_i = (*XHashElem)(_i.Xnext)
 12016  	goto _13
 12017  _16:
 12018  	_sqlite3HashClear(tls, &_db.XaFunc)
 12019  	_i = (*XHashElem)(_db.XaCollSeq.Xfirst)
 12020  _18:
 12021  	if _i == nil {
 12022  		goto _21
 12023  	}
 12024  	_8_pColl = (*XCollSeq)(_i.Xdata)
 12025  	_j = int32(0)
 12026  _22:
 12027  	if _j >= int32(3) {
 12028  		goto _25
 12029  	}
 12030  	if (elem29(_8_pColl, uintptr(_j)).XxDel) != nil {
 12031  		(elem29(_8_pColl, uintptr(_j)).XxDel)(tls, elem29(_8_pColl, uintptr(_j)).XpUser)
 12032  	}
 12033  	_j += 1
 12034  	goto _22
 12035  _25:
 12036  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_8_pColl))
 12037  	_i = (*XHashElem)(_i.Xnext)
 12038  	goto _18
 12039  _21:
 12040  	_sqlite3HashClear(tls, &_db.XaCollSeq)
 12041  	_i = (*XHashElem)(_db.XaModule.Xfirst)
 12042  _27:
 12043  	if _i == nil {
 12044  		goto _30
 12045  	}
 12046  	_11_pMod = (*XModule)(_i.Xdata)
 12047  	if _11_pMod.XxDestroy != nil {
 12048  		_11_pMod.XxDestroy(tls, _11_pMod.XpAux)
 12049  	}
 12050  	_sqlite3VtabEponymousTableClear(tls, _db, _11_pMod)
 12051  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_11_pMod))
 12052  	_i = (*XHashElem)(_i.Xnext)
 12053  	goto _27
 12054  _30:
 12055  	_sqlite3HashClear(tls, &_db.XaModule)
 12056  	_sqlite3Error(tls, _db, int32(0))
 12057  	_sqlite3ValueFree(tls, (*XMem)(_db.XpErr))
 12058  	_sqlite3CloseExtensions(tls, _db)
 12059  	_db.Xmagic = uint32(3040180528)
 12060  	_sqlite3DbFree(tls, _db, elem27((*XDb)(_db.XaDb), uintptr(1)).XpSchema)
 12061  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 12062  	_db.Xmagic = uint32(2671521075)
 12063  	Xsqlite3_mutex_free(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 12064  	func() {
 12065  		if (_db.Xlookaside.XnOut) != int32(0) {
 12066  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(141695), unsafe.Pointer(&_sqlite3LeaveMutexAndCloseZombieØ00__func__Ø000), unsafe.Pointer(str(9694)))
 12067  			crt.X__builtin_abort(tls)
 12068  		}
 12069  	}()
 12070  	if (_db.Xlookaside.XbMalloced) != 0 {
 12071  		Xsqlite3_free(tls, _db.Xlookaside.XpStart)
 12072  	}
 12073  	Xsqlite3_free(tls, unsafe.Pointer(_db))
 12074  }
 12075  
 12076  // C comment
 12077  //  /*
 12078  //  ** Rollback all database files.  If tripCode is not SQLITE_OK, then
 12079  //  ** any write cursors are invalidated ("tripped" - as in "tripping a circuit
 12080  //  ** breaker") and made to return tripCode if there are any further
 12081  //  ** attempts to use that cursor.  Read cursors remain open and valid
 12082  //  ** but are "saved" in case the table pages are moved around.
 12083  //  */
 12084  func _sqlite3RollbackAll(tls *crt.TLS, _db *Xsqlite3, _tripCode int32) {
 12085  	var _i, _inTrans, _schemaChange int32
 12086  	var _1_p *XBtree
 12087  	_inTrans = int32(0)
 12088  	func() {
 12089  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 12090  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(141713), unsafe.Pointer(&_sqlite3RollbackAllØ00__func__Ø000), unsafe.Pointer(str(881)))
 12091  			crt.X__builtin_abort(tls)
 12092  		}
 12093  	}()
 12094  	_sqlite3BeginBenignMalloc(tls)
 12095  	_sqlite3BtreeEnterAll(tls, _db)
 12096  	_schemaChange = bool2int(((_db.Xflags & int32(2)) != int32(0)) && (int32(_db.Xinit.Xbusy) == int32(0)))
 12097  	_i = int32(0)
 12098  _3:
 12099  	if _i >= _db.XnDb {
 12100  		goto _6
 12101  	}
 12102  	_1_p = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 12103  	if _1_p == nil {
 12104  		goto _7
 12105  	}
 12106  	if _sqlite3BtreeIsInTrans(tls, _1_p) != 0 {
 12107  		_inTrans = int32(1)
 12108  	}
 12109  	_sqlite3BtreeRollback(tls, _1_p, _tripCode, bool2int(_schemaChange == 0))
 12110  _7:
 12111  	_i += 1
 12112  	goto _3
 12113  _6:
 12114  	_sqlite3VtabRollback(tls, _db)
 12115  	_sqlite3EndBenignMalloc(tls)
 12116  	if ((_db.Xflags & int32(2)) != int32(0)) && (int32(_db.Xinit.Xbusy) == int32(0)) {
 12117  		_sqlite3ExpirePreparedStatements(tls, _db)
 12118  		_sqlite3ResetAllSchemasOfConnection(tls, _db)
 12119  	}
 12120  	_sqlite3BtreeLeaveAll(tls, _db)
 12121  	_db.XnDeferredCons = 0
 12122  	_db.XnDeferredImmCons = 0
 12123  	_db.Xflags &= int32(-33554433)
 12124  	if (_db.XxRollbackCallback != nil) && (_inTrans != 0 || (_db.XautoCommit == 0)) {
 12125  		_db.XxRollbackCallback(tls, _db.XpRollbackArg)
 12126  	}
 12127  }
 12128  
 12129  var _sqlite3RollbackAllØ00__func__Ø000 [19]int8
 12130  
 12131  func init() {
 12132  	crt.Xstrncpy(nil, &_sqlite3RollbackAllØ00__func__Ø000[0], str(9716), 19)
 12133  }
 12134  
 12135  // C comment
 12136  //  /*
 12137  //  ** Return non-zero if a transaction is active.
 12138  //  */
 12139  func _sqlite3BtreeIsInTrans(tls *crt.TLS, _p *XBtree) (r0 int32) {
 12140  	func() {
 12141  		if _p != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 12142  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68641), unsafe.Pointer(&_sqlite3BtreeIsInTransØ00__func__Ø000), unsafe.Pointer(str(9735)))
 12143  			crt.X__builtin_abort(tls)
 12144  		}
 12145  	}()
 12146  	return bool2int((_p != nil) && (int32(_p.XinTrans) == int32(2)))
 12147  }
 12148  
 12149  var _sqlite3BtreeIsInTransØ00__func__Ø000 [22]int8
 12150  
 12151  func init() {
 12152  	crt.Xstrncpy(nil, &_sqlite3BtreeIsInTransØ00__func__Ø000[0], str(9776), 22)
 12153  }
 12154  
 12155  // C comment
 12156  //  /*
 12157  //  ** Rollback the transaction in progress.
 12158  //  **
 12159  //  ** If tripCode is not SQLITE_OK then cursors will be invalidated (tripped).
 12160  //  ** Only write cursors are tripped if writeOnly is true but all cursors are
 12161  //  ** tripped if writeOnly is false.  Any attempt to use
 12162  //  ** a tripped cursor will result in an error.
 12163  //  **
 12164  //  ** This will release the write lock on the database file.  If there
 12165  //  ** are no active cursors, it also releases the read lock.
 12166  //  */
 12167  func _sqlite3BtreeRollback(tls *crt.TLS, _p *XBtree, _tripCode int32, _writeOnly int32) (r0 int32) {
 12168  	var _rc, _3_rc2, _4_rc2, _6_nPage int32
 12169  	var _pBt *XBtShared
 12170  	var _pPage1 *XMemPage
 12171  	_pBt = (*XBtShared)(_p.XpBt)
 12172  	func() {
 12173  		if _writeOnly != int32(1) && _writeOnly != int32(0) {
 12174  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63037), unsafe.Pointer(&_sqlite3BtreeRollbackØ00__func__Ø000), unsafe.Pointer(str(9798)))
 12175  			crt.X__builtin_abort(tls)
 12176  		}
 12177  	}()
 12178  	func() {
 12179  		if _tripCode != int32(516) && _tripCode != int32(0) {
 12180  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63038), unsafe.Pointer(&_sqlite3BtreeRollbackØ00__func__Ø000), unsafe.Pointer(str(9827)))
 12181  			crt.X__builtin_abort(tls)
 12182  		}
 12183  	}()
 12184  	_sqlite3BtreeEnter(tls, _p)
 12185  	if _tripCode != int32(0) {
 12186  		goto _6
 12187  	}
 12188  	_rc = store2(&_tripCode, _saveAllCursors(tls, _pBt, 0, nil))
 12189  	if _rc != 0 {
 12190  		_writeOnly = int32(0)
 12191  	}
 12192  	goto _8
 12193  _6:
 12194  	_rc = int32(0)
 12195  _8:
 12196  	if _tripCode == 0 {
 12197  		goto _9
 12198  	}
 12199  	_3_rc2 = _sqlite3BtreeTripAllCursors(tls, _p, _tripCode, _writeOnly)
 12200  	func() {
 12201  		if _rc != int32(0) && (_writeOnly != int32(0) || _3_rc2 != int32(0)) {
 12202  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63048), unsafe.Pointer(&_sqlite3BtreeRollbackØ00__func__Ø000), unsafe.Pointer(str(9882)))
 12203  			crt.X__builtin_abort(tls)
 12204  		}
 12205  	}()
 12206  	if _3_rc2 != int32(0) {
 12207  		_rc = _3_rc2
 12208  	}
 12209  _9:
 12210  	func() {
 12211  		if int32((*XBtShared)(_p.XpBt).XinTransaction) == int32(0) && ((*XBtShared)(_p.XpBt).XnTransaction) != int32(0) {
 12212  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63051), unsafe.Pointer(&_sqlite3BtreeRollbackØ00__func__Ø000), unsafe.Pointer(str(9932)))
 12213  			crt.X__builtin_abort(tls)
 12214  		}
 12215  	}()
 12216  	func() {
 12217  		if int32((*XBtShared)(_p.XpBt).XinTransaction) < int32(_p.XinTrans) {
 12218  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63051), unsafe.Pointer(&_sqlite3BtreeRollbackØ00__func__Ø000), unsafe.Pointer(str(9993)))
 12219  			crt.X__builtin_abort(tls)
 12220  		}
 12221  	}()
 12222  	if int32(_p.XinTrans) != int32(2) {
 12223  		goto _20
 12224  	}
 12225  	func() {
 12226  		if int32(2) != int32(_pBt.XinTransaction) {
 12227  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63056), unsafe.Pointer(&_sqlite3BtreeRollbackØ00__func__Ø000), unsafe.Pointer(str(10027)))
 12228  			crt.X__builtin_abort(tls)
 12229  		}
 12230  	}()
 12231  	_4_rc2 = _sqlite3PagerRollback(tls, (*XPager)(_pBt.XpPager))
 12232  	if _4_rc2 != int32(0) {
 12233  		_rc = _4_rc2
 12234  	}
 12235  	if _btreeGetPage(tls, _pBt, uint32(1), &_pPage1, int32(0)) != int32(0) {
 12236  		goto _24
 12237  	}
 12238  	_6_nPage = int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(int32(28))+uintptr(unsafe.Pointer(_pPage1.XaData))))))
 12239  	if _6_nPage == int32(0) {
 12240  		_sqlite3PagerPagecount(tls, (*XPager)(_pBt.XpPager), &_6_nPage)
 12241  	}
 12242  	_pBt.XnPage = uint32(_6_nPage)
 12243  	_releasePage(tls, _pPage1)
 12244  _24:
 12245  	func() {
 12246  		if _countValidCursors(tls, _pBt, int32(1)) != int32(0) {
 12247  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63073), unsafe.Pointer(&_sqlite3BtreeRollbackØ00__func__Ø000), unsafe.Pointer(str(10059)))
 12248  			crt.X__builtin_abort(tls)
 12249  		}
 12250  	}()
 12251  	_pBt.XinTransaction = uint8(1)
 12252  	_btreeClearHasContent(tls, _pBt)
 12253  _20:
 12254  	_btreeEndTransaction(tls, _p)
 12255  	_sqlite3BtreeLeave(tls, _p)
 12256  	return _rc
 12257  }
 12258  
 12259  var _sqlite3BtreeRollbackØ00__func__Ø000 [21]int8
 12260  
 12261  func init() {
 12262  	crt.Xstrncpy(nil, &_sqlite3BtreeRollbackØ00__func__Ø000[0], str(10088), 21)
 12263  }
 12264  
 12265  // C comment
 12266  //  /*
 12267  //  ** Save the positions of all cursors (except pExcept) that are open on
 12268  //  ** the table with root-page iRoot.  "Saving the cursor position" means that
 12269  //  ** the location in the btree is remembered in such a way that it can be
 12270  //  ** moved back to the same spot after the btree has been modified.  This
 12271  //  ** routine is called just before cursor pExcept is used to modify the
 12272  //  ** table, for example in BtreeDelete() or BtreeInsert().
 12273  //  **
 12274  //  ** If there are two or more cursors on the same btree, then all such
 12275  //  ** cursors should have their BTCF_Multiple flag set.  The btreeCursor()
 12276  //  ** routine enforces that rule.  This routine only needs to be called in
 12277  //  ** the uncommon case when pExpect has the BTCF_Multiple flag set.
 12278  //  **
 12279  //  ** If pExpect!=NULL and if no other cursors are found on the same root-page,
 12280  //  ** then the BTCF_Multiple flag on pExpect is cleared, to avoid another
 12281  //  ** pointless call to this routine.
 12282  //  **
 12283  //  ** Implementation note:  This routine merely checks to see if any cursors
 12284  //  ** need to be saved.  It calls out to saveCursorsOnList() in the (unusual)
 12285  //  ** event that cursors are in need to being saved.
 12286  //  */
 12287  func _saveAllCursors(tls *crt.TLS, _pBt *XBtShared, _iRoot uint32, _pExcept *XBtCursor) (r0 int32) {
 12288  	var _p *XBtCursor
 12289  	func() {
 12290  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 12291  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59740), unsafe.Pointer(&_saveAllCursorsØ00__func__Ø000), unsafe.Pointer(str(9235)))
 12292  			crt.X__builtin_abort(tls)
 12293  		}
 12294  	}()
 12295  	func() {
 12296  		if _pExcept != nil && (*XBtShared)(_pExcept.XpBt) != _pBt {
 12297  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59741), unsafe.Pointer(&_saveAllCursorsØ00__func__Ø000), unsafe.Pointer(str(10109)))
 12298  			crt.X__builtin_abort(tls)
 12299  		}
 12300  	}()
 12301  	_p = (*XBtCursor)(_pBt.XpCursor)
 12302  _5:
 12303  	if _p == nil {
 12304  		goto _8
 12305  	}
 12306  	if (_p != _pExcept) && (((0) == _iRoot) || (_p.XpgnoRoot == _iRoot)) {
 12307  		goto _8
 12308  	}
 12309  	_p = (*XBtCursor)(_p.XpNext)
 12310  	goto _5
 12311  _8:
 12312  	if _p != nil {
 12313  		return _saveCursorsOnList(tls, _p, _iRoot, _pExcept)
 12314  	}
 12315  	if _pExcept != nil {
 12316  		{
 12317  			p := &_pExcept.XcurFlags
 12318  			*p = uint8(int32(*p) & int32(-33))
 12319  		}
 12320  	}
 12321  	return int32(0)
 12322  }
 12323  
 12324  var _saveAllCursorsØ00__func__Ø000 [15]int8
 12325  
 12326  func init() {
 12327  	crt.Xstrncpy(nil, &_saveAllCursorsØ00__func__Ø000[0], str(10141), 15)
 12328  }
 12329  
 12330  // C comment
 12331  //  /* This helper routine to saveAllCursors does the actual work of saving
 12332  //  ** the cursors if and when a cursor is found that actually requires saving.
 12333  //  ** The common case is that no cursors need to be saved, so this routine is
 12334  //  ** broken out from its caller to avoid unnecessary stack pointer movement.
 12335  //  */
 12336  func _saveCursorsOnList(tls *crt.TLS, _p *XBtCursor, _iRoot uint32, _pExcept *XBtCursor) (r0 int32) {
 12337  	var _3_rc int32
 12338  _0:
 12339  	if _p == _pExcept || (0) != _iRoot && _p.XpgnoRoot != _iRoot {
 12340  		goto _3
 12341  	}
 12342  	if int32(_p.XeState) != int32(1) && int32(_p.XeState) != int32(2) {
 12343  		goto _5
 12344  	}
 12345  	_3_rc = _saveCursorPosition(tls, _p)
 12346  	if int32(0) != _3_rc {
 12347  		return _3_rc
 12348  	}
 12349  	goto _7
 12350  _5:
 12351  	_btreeReleaseAllCursorPages(tls, _p)
 12352  _7:
 12353  _3:
 12354  	_p = (*XBtCursor)(_p.XpNext)
 12355  	if _p != nil {
 12356  		goto _0
 12357  	}
 12358  	return int32(0)
 12359  }
 12360  
 12361  // C comment
 12362  //  /*
 12363  //  ** Save the current cursor position in the variables BtCursor.nKey
 12364  //  ** and BtCursor.pKey. The cursor's state is set to CURSOR_REQUIRESEEK.
 12365  //  **
 12366  //  ** The caller must ensure that the cursor is valid (has eState==CURSOR_VALID)
 12367  //  ** prior to calling this routine.
 12368  //  */
 12369  func _saveCursorPosition(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 12370  	var _rc int32
 12371  	func() {
 12372  		if int32(1) != int32(_pCur.XeState) && int32(2) != int32(_pCur.XeState) {
 12373  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59694), unsafe.Pointer(&_saveCursorPositionØ00__func__Ø000), unsafe.Pointer(str(10156)))
 12374  			crt.X__builtin_abort(tls)
 12375  		}
 12376  	}()
 12377  	func() {
 12378  		if nil != _pCur.XpKey {
 12379  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59695), unsafe.Pointer(&_saveCursorPositionØ00__func__Ø000), unsafe.Pointer(str(10216)))
 12380  			crt.X__builtin_abort(tls)
 12381  		}
 12382  	}()
 12383  	func() {
 12384  		if _cursorHoldsMutex(tls, _pCur) == 0 {
 12385  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59696), unsafe.Pointer(&_saveCursorPositionØ00__func__Ø000), unsafe.Pointer(str(10230)))
 12386  			crt.X__builtin_abort(tls)
 12387  		}
 12388  	}()
 12389  	if int32(_pCur.XeState) == int32(2) {
 12390  		_pCur.XeState = uint8(1)
 12391  		goto _8
 12392  	}
 12393  	_pCur.XskipNext = int32(0)
 12394  _8:
 12395  	_rc = _saveCursorKey(tls, _pCur)
 12396  	if _rc == int32(0) {
 12397  		_btreeReleaseAllCursorPages(tls, _pCur)
 12398  		_pCur.XeState = uint8(3)
 12399  	}
 12400  	{
 12401  		p := &_pCur.XcurFlags
 12402  		*p = uint8(int32(*p) & int32(-15))
 12403  	}
 12404  	return _rc
 12405  }
 12406  
 12407  var _saveCursorPositionØ00__func__Ø000 [19]int8
 12408  
 12409  func init() {
 12410  	crt.Xstrncpy(nil, &_saveCursorPositionØ00__func__Ø000[0], str(10253), 19)
 12411  }
 12412  
 12413  func _cursorHoldsMutex(tls *crt.TLS, _p *XBtCursor) (r0 int32) {
 12414  	return Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_p.XpBt).Xmutex))
 12415  }
 12416  
 12417  // C comment
 12418  //  /*
 12419  //  ** The cursor passed as the only argument must point to a valid entry
 12420  //  ** when this function is called (i.e. have eState==CURSOR_VALID). This
 12421  //  ** function saves the current cursor key in variables pCur->nKey and
 12422  //  ** pCur->pKey. SQLITE_OK is returned if successful or an SQLite error
 12423  //  ** code otherwise.
 12424  //  **
 12425  //  ** If the cursor is open on an intkey table, then the integer key
 12426  //  ** (the rowid) is stored in pCur->nKey and pCur->pKey is left set to
 12427  //  ** NULL. If the cursor is open on a non-intkey table, then pCur->pKey is
 12428  //  ** set to point to a malloced buffer pCur->nKey bytes in size containing
 12429  //  ** the key.
 12430  //  */
 12431  func _saveCursorKey(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 12432  	var _rc int32
 12433  	var _2_pKey unsafe.Pointer
 12434  	_rc = int32(0)
 12435  	func() {
 12436  		if int32(1) != int32(_pCur.XeState) {
 12437  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59657), unsafe.Pointer(&_saveCursorKeyØ00__func__Ø000), unsafe.Pointer(str(10272)))
 12438  			crt.X__builtin_abort(tls)
 12439  		}
 12440  	}()
 12441  	func() {
 12442  		if nil != _pCur.XpKey {
 12443  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59658), unsafe.Pointer(&_saveCursorKeyØ00__func__Ø000), unsafe.Pointer(str(10216)))
 12444  			crt.X__builtin_abort(tls)
 12445  		}
 12446  	}()
 12447  	func() {
 12448  		if _cursorHoldsMutex(tls, _pCur) == 0 {
 12449  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59659), unsafe.Pointer(&_saveCursorKeyØ00__func__Ø000), unsafe.Pointer(str(10230)))
 12450  			crt.X__builtin_abort(tls)
 12451  		}
 12452  	}()
 12453  	if _pCur.XcurIntKey != 0 {
 12454  		_pCur.XnKey = _sqlite3BtreeIntegerKey(tls, _pCur)
 12455  		goto _7
 12456  	}
 12457  	_pCur.XnKey = int64(_sqlite3BtreePayloadSize(tls, _pCur))
 12458  	_2_pKey = _sqlite3Malloc(tls, uint64(_pCur.XnKey))
 12459  	if _2_pKey == nil {
 12460  		goto _8
 12461  	}
 12462  	_rc = _sqlite3BtreePayload(tls, _pCur, 0, uint32(int32(_pCur.XnKey)), _2_pKey)
 12463  	if _rc == int32(0) {
 12464  		_pCur.XpKey = _2_pKey
 12465  		goto _10
 12466  	}
 12467  	Xsqlite3_free(tls, _2_pKey)
 12468  _10:
 12469  	goto _11
 12470  _8:
 12471  	_rc = _sqlite3NomemError(tls, int32(59677))
 12472  _11:
 12473  _7:
 12474  	func() {
 12475  		if _pCur.XcurIntKey != 0 && _pCur.XpKey != nil {
 12476  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59680), unsafe.Pointer(&_saveCursorKeyØ00__func__Ø000), unsafe.Pointer(str(10299)))
 12477  			crt.X__builtin_abort(tls)
 12478  		}
 12479  	}()
 12480  	return _rc
 12481  }
 12482  
 12483  var _saveCursorKeyØ00__func__Ø000 [14]int8
 12484  
 12485  func init() {
 12486  	crt.Xstrncpy(nil, &_saveCursorKeyØ00__func__Ø000[0], str(10331), 14)
 12487  }
 12488  
 12489  // C comment
 12490  //  /*
 12491  //  ** Return the value of the integer key or "rowid" for a table btree.
 12492  //  ** This routine is only valid for a cursor that is pointing into a
 12493  //  ** ordinary table btree.  If the cursor points to an index btree or
 12494  //  ** is invalid, the result of this routine is undefined.
 12495  //  */
 12496  func _sqlite3BtreeIntegerKey(tls *crt.TLS, _pCur *XBtCursor) (r0 int64) {
 12497  	func() {
 12498  		if _cursorHoldsMutex(tls, _pCur) == 0 {
 12499  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63392), unsafe.Pointer(&_sqlite3BtreeIntegerKeyØ00__func__Ø000), unsafe.Pointer(str(10230)))
 12500  			crt.X__builtin_abort(tls)
 12501  		}
 12502  	}()
 12503  	func() {
 12504  		if int32(_pCur.XeState) != int32(1) {
 12505  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63393), unsafe.Pointer(&_sqlite3BtreeIntegerKeyØ00__func__Ø000), unsafe.Pointer(str(10345)))
 12506  			crt.X__builtin_abort(tls)
 12507  		}
 12508  	}()
 12509  	func() {
 12510  		if _pCur.XcurIntKey == 0 {
 12511  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63394), unsafe.Pointer(&_sqlite3BtreeIntegerKeyØ00__func__Ø000), unsafe.Pointer(str(10372)))
 12512  			crt.X__builtin_abort(tls)
 12513  		}
 12514  	}()
 12515  	_getCellInfo(tls, _pCur)
 12516  	return _pCur.Xinfo.XnKey
 12517  }
 12518  
 12519  var _sqlite3BtreeIntegerKeyØ00__func__Ø000 [23]int8
 12520  
 12521  func init() {
 12522  	crt.Xstrncpy(nil, &_sqlite3BtreeIntegerKeyØ00__func__Ø000[0], str(10388), 23)
 12523  }
 12524  
 12525  func _getCellInfo(tls *crt.TLS, _pCur *XBtCursor) {
 12526  	var _1_iPage int32
 12527  	if int32(_pCur.Xinfo.XnSize) == int32(0) {
 12528  		_1_iPage = int32(_pCur.XiPage)
 12529  		{
 12530  			p := &_pCur.XcurFlags
 12531  			*p = uint8(int32(*p) | int32(2))
 12532  		}
 12533  		_btreeParseCell(tls, *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_1_iPage)), int32(_pCur.Xix), &_pCur.Xinfo)
 12534  		goto _1
 12535  	}
 12536  	_assertCellInfo(tls, _pCur)
 12537  _1:
 12538  }
 12539  
 12540  func _btreeParseCell(tls *crt.TLS, _pPage *XMemPage, _iCell int32, _pInfo *XCellInfo) {
 12541  	func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) {
 12542  		v := _pPage.XxParseCell
 12543  		return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v))
 12544  	}()(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)
 12545  }
 12546  
 12547  func _assertCellInfo(tls *crt.TLS, _pCur *XBtCursor) {
 12548  	var _iPage int32
 12549  	var _info XCellInfo
 12550  	_iPage = int32(_pCur.XiPage)
 12551  	crt.Xmemset(tls, unsafe.Pointer(&_info), int32(0), uint32(20))
 12552  	_btreeParseCell(tls, *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_iPage)), int32(_pCur.Xix), &_info)
 12553  	func() {
 12554  		if _sqlite3Config.XneverCorrupt != int32(0) && crt.Xmemcmp(tls, unsafe.Pointer(&_info), unsafe.Pointer(&_pCur.Xinfo), uint32(20)) != int32(0) {
 12555  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63355), unsafe.Pointer(&_assertCellInfoØ00__func__Ø000), unsafe.Pointer(str(10411)))
 12556  			crt.X__builtin_abort(tls)
 12557  		}
 12558  	}()
 12559  }
 12560  
 12561  var _assertCellInfoØ00__func__Ø000 [15]int8
 12562  
 12563  func init() {
 12564  	crt.Xstrncpy(nil, &_assertCellInfoØ00__func__Ø000[0], str(10469), 15)
 12565  }
 12566  
 12567  // C comment
 12568  //  /*
 12569  //  ** Return the number of bytes of payload for the entry that pCur is
 12570  //  ** currently pointing to.  For table btrees, this will be the amount
 12571  //  ** of data.  For index btrees, this will be the size of the key.
 12572  //  **
 12573  //  ** The caller must guarantee that the cursor is pointing to a non-NULL
 12574  //  ** valid entry.  In other words, the calling procedure must guarantee
 12575  //  ** that the cursor has Cursor.eState==CURSOR_VALID.
 12576  //  */
 12577  func _sqlite3BtreePayloadSize(tls *crt.TLS, _pCur *XBtCursor) (r0 uint32) {
 12578  	func() {
 12579  		if _cursorHoldsMutex(tls, _pCur) == 0 {
 12580  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63409), unsafe.Pointer(&_sqlite3BtreePayloadSizeØ00__func__Ø000), unsafe.Pointer(str(10230)))
 12581  			crt.X__builtin_abort(tls)
 12582  		}
 12583  	}()
 12584  	func() {
 12585  		if int32(_pCur.XeState) != int32(1) {
 12586  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63410), unsafe.Pointer(&_sqlite3BtreePayloadSizeØ00__func__Ø000), unsafe.Pointer(str(10345)))
 12587  			crt.X__builtin_abort(tls)
 12588  		}
 12589  	}()
 12590  	_getCellInfo(tls, _pCur)
 12591  	return _pCur.Xinfo.XnPayload
 12592  }
 12593  
 12594  var _sqlite3BtreePayloadSizeØ00__func__Ø000 [24]int8
 12595  
 12596  func init() {
 12597  	crt.Xstrncpy(nil, &_sqlite3BtreePayloadSizeØ00__func__Ø000[0], str(10484), 24)
 12598  }
 12599  
 12600  // C comment
 12601  //  /*
 12602  //  ** Read part of the payload for the row at which that cursor pCur is currently
 12603  //  ** pointing.  "amt" bytes will be transferred into pBuf[].  The transfer
 12604  //  ** begins at "offset".
 12605  //  **
 12606  //  ** pCur can be pointing to either a table or an index b-tree.
 12607  //  ** If pointing to a table btree, then the content section is read.  If
 12608  //  ** pCur is pointing to an index b-tree then the key section is read.
 12609  //  **
 12610  //  ** For sqlite3BtreePayload(), the caller must ensure that pCur is pointing
 12611  //  ** to a valid row in the table.  For sqlite3BtreePayloadChecked(), the
 12612  //  ** cursor might be invalid or might need to be restored before being read.
 12613  //  **
 12614  //  ** Return SQLITE_OK on success or an error code if anything goes
 12615  //  ** wrong.  An error is returned if "offset+amt" is larger than
 12616  //  ** the available payload.
 12617  //  */
 12618  func _sqlite3BtreePayload(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt uint32, _pBuf unsafe.Pointer) (r0 int32) {
 12619  	func() {
 12620  		if _cursorHoldsMutex(tls, _pCur) == 0 {
 12621  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63755), unsafe.Pointer(&_sqlite3BtreePayloadØ00__func__Ø000), unsafe.Pointer(str(10230)))
 12622  			crt.X__builtin_abort(tls)
 12623  		}
 12624  	}()
 12625  	func() {
 12626  		if int32(_pCur.XeState) != int32(1) {
 12627  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63756), unsafe.Pointer(&_sqlite3BtreePayloadØ00__func__Ø000), unsafe.Pointer(str(10345)))
 12628  			crt.X__builtin_abort(tls)
 12629  		}
 12630  	}()
 12631  	func() {
 12632  		if int32(_pCur.XiPage) < int32(0) || (*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))) == nil {
 12633  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63757), unsafe.Pointer(&_sqlite3BtreePayloadØ00__func__Ø000), unsafe.Pointer(str(10508)))
 12634  			crt.X__builtin_abort(tls)
 12635  		}
 12636  	}()
 12637  	func() {
 12638  		if int32(_pCur.Xix) >= int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnCell) {
 12639  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63758), unsafe.Pointer(&_sqlite3BtreePayloadØ00__func__Ø000), unsafe.Pointer(str(10552)))
 12640  			crt.X__builtin_abort(tls)
 12641  		}
 12642  	}()
 12643  	return _accessPayload(tls, _pCur, _offset, _amt, (*uint8)(_pBuf), int32(0))
 12644  }
 12645  
 12646  var _sqlite3BtreePayloadØ00__func__Ø000 [20]int8
 12647  
 12648  func init() {
 12649  	crt.Xstrncpy(nil, &_sqlite3BtreePayloadØ00__func__Ø000[0], str(10594), 20)
 12650  }
 12651  
 12652  // C comment
 12653  //  /*
 12654  //  ** This function is used to read or overwrite payload information
 12655  //  ** for the entry that the pCur cursor is pointing to. The eOp
 12656  //  ** argument is interpreted as follows:
 12657  //  **
 12658  //  **   0: The operation is a read. Populate the overflow cache.
 12659  //  **   1: The operation is a write. Populate the overflow cache.
 12660  //  **
 12661  //  ** A total of "amt" bytes are read or written beginning at "offset".
 12662  //  ** Data is read to or from the buffer pBuf.
 12663  //  **
 12664  //  ** The content being read or written might appear on the main page
 12665  //  ** or be scattered out on multiple overflow pages.
 12666  //  **
 12667  //  ** If the current cursor entry uses one or more overflow pages
 12668  //  ** this function may allocate space for and lazily populate
 12669  //  ** the overflow page-list cache array (BtCursor.aOverflow).
 12670  //  ** Subsequent calls use this cache to make seeking to the supplied offset
 12671  //  ** more efficient.
 12672  //  **
 12673  //  ** Once an overflow page-list cache has been allocated, it must be
 12674  //  ** invalidated if some other cursor writes to the same table, or if
 12675  //  ** the cursor is moved to a different row. Additionally, in auto-vacuum
 12676  //  ** mode, the following events may invalidate an overflow page-list cache.
 12677  //  **
 12678  //  **   * An incremental vacuum,
 12679  //  **   * A commit in auto_vacuum="full" mode,
 12680  //  **   * Creating a table (may require moving an overflow page).
 12681  //  */
 12682  func _accessPayload(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt uint32, _pBuf *uint8, _eOp int32) (r0 int32) {
 12683  	var _rc, _iIdx, _2_a, _6_nOvfl, _16_a int32
 12684  	var _5_ovflSize, _5_nextPage uint32
 12685  	var _aPayload *uint8
 12686  	var _7_aNew *uint32
 12687  	var _18_pDbPage *XPgHdr
 12688  	var _pBt *XBtShared
 12689  	var _pPage *XMemPage
 12690  	_rc = int32(0)
 12691  	_iIdx = int32(0)
 12692  	_pPage = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))
 12693  	_pBt = (*XBtShared)(_pCur.XpBt)
 12694  	func() {
 12695  		if _pPage == nil {
 12696  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63568), unsafe.Pointer(&_accessPayloadØ00__func__Ø000), unsafe.Pointer(str(10614)))
 12697  			crt.X__builtin_abort(tls)
 12698  		}
 12699  	}()
 12700  	func() {
 12701  		if _eOp != int32(0) && _eOp != int32(1) {
 12702  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63569), unsafe.Pointer(&_accessPayloadØ00__func__Ø000), unsafe.Pointer(str(10620)))
 12703  			crt.X__builtin_abort(tls)
 12704  		}
 12705  	}()
 12706  	func() {
 12707  		if int32(_pCur.XeState) != int32(1) {
 12708  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63570), unsafe.Pointer(&_accessPayloadØ00__func__Ø000), unsafe.Pointer(str(10345)))
 12709  			crt.X__builtin_abort(tls)
 12710  		}
 12711  	}()
 12712  	func() {
 12713  		if int32(_pCur.Xix) >= int32(_pPage.XnCell) {
 12714  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63571), unsafe.Pointer(&_accessPayloadØ00__func__Ø000), unsafe.Pointer(str(10637)))
 12715  			crt.X__builtin_abort(tls)
 12716  		}
 12717  	}()
 12718  	func() {
 12719  		if _cursorHoldsMutex(tls, _pCur) == 0 {
 12720  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63572), unsafe.Pointer(&_accessPayloadØ00__func__Ø000), unsafe.Pointer(str(10230)))
 12721  			crt.X__builtin_abort(tls)
 12722  		}
 12723  	}()
 12724  	_getCellInfo(tls, _pCur)
 12725  	_aPayload = _pCur.Xinfo.XpPayload
 12726  	func() {
 12727  		if (_offset + _amt) > (_pCur.Xinfo.XnPayload) {
 12728  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63576), unsafe.Pointer(&_accessPayloadØ00__func__Ø000), unsafe.Pointer(str(10659)))
 12729  			crt.X__builtin_abort(tls)
 12730  		}
 12731  	}()
 12732  	func() {
 12733  		if crt.P2U(unsafe.Pointer(_aPayload)) <= crt.P2U(unsafe.Pointer(_pPage.XaData)) {
 12734  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63578), unsafe.Pointer(&_accessPayloadØ00__func__Ø000), unsafe.Pointer(str(10693)))
 12735  			crt.X__builtin_abort(tls)
 12736  		}
 12737  	}()
 12738  	if uint32(int32(uintptr(unsafe.Pointer(_aPayload))-uintptr(unsafe.Pointer(_pPage.XaData)))) > (_pBt.XusableSize - uint32(_pCur.Xinfo.XnLocal)) {
 12739  		return _sqlite3CorruptError(tls, int32(63585))
 12740  	}
 12741  	if _offset >= uint32(_pCur.Xinfo.XnLocal) {
 12742  		goto _16
 12743  	}
 12744  	_2_a = int32(_amt)
 12745  	if (uint32(_2_a) + _offset) > uint32(_pCur.Xinfo.XnLocal) {
 12746  		_2_a = int32(uint32(_pCur.Xinfo.XnLocal) - _offset)
 12747  	}
 12748  	_rc = _copyPayload(tls, unsafe.Pointer(elem15(_aPayload, uintptr(_offset))), unsafe.Pointer(_pBuf), _2_a, _eOp, (*XPgHdr)(_pPage.XpDbPage))
 12749  	_offset = 0
 12750  	*(*uintptr)(unsafe.Pointer(&_pBuf)) += uintptr(_2_a)
 12751  	_amt -= uint32(_2_a)
 12752  	goto _18
 12753  _16:
 12754  	_offset -= uint32(_pCur.Xinfo.XnLocal)
 12755  _18:
 12756  	if _rc != int32(0) || _amt <= (0) {
 12757  		goto _20
 12758  	}
 12759  	_5_ovflSize = _pBt.XusableSize - uint32(4)
 12760  	_5_nextPage = _sqlite3Get4byte(tls, elem15(_aPayload, uintptr(_pCur.Xinfo.XnLocal)))
 12761  	if (int32(_pCur.XcurFlags) & int32(4)) != int32(0) {
 12762  		goto _21
 12763  	}
 12764  	_6_nOvfl = int32(((((_pCur.Xinfo.XnPayload) - uint32(_pCur.Xinfo.XnLocal)) + _5_ovflSize) - uint32(1)) / _5_ovflSize)
 12765  	if _6_nOvfl <= _pCur.XnOvflAlloc {
 12766  		goto _22
 12767  	}
 12768  	_7_aNew = (*uint32)(_sqlite3Realloc(tls, unsafe.Pointer(_pCur.XaOverflow), uint64(uint32(_6_nOvfl*int32(2))*uint32(4))))
 12769  	if _7_aNew == nil {
 12770  		return _sqlite3NomemError(tls, int32(63623))
 12771  	}
 12772  	_pCur.XnOvflAlloc = _6_nOvfl * int32(2)
 12773  	_pCur.XaOverflow = _7_aNew
 12774  _22:
 12775  	crt.Xmemset(tls, unsafe.Pointer(_pCur.XaOverflow), int32(0), uint32(_6_nOvfl)*uint32(4))
 12776  	{
 12777  		p := &_pCur.XcurFlags
 12778  		*p = uint8(int32(*p) | int32(4))
 12779  	}
 12780  	goto _25
 12781  _21:
 12782  	if (*elem7(_pCur.XaOverflow, uintptr(_offset/_5_ovflSize))) != 0 {
 12783  		_iIdx = int32(_offset / _5_ovflSize)
 12784  		_5_nextPage = *elem7(_pCur.XaOverflow, uintptr(_iIdx))
 12785  		_offset = _offset % _5_ovflSize
 12786  	}
 12787  _25:
 12788  	func() {
 12789  		if _rc != int32(0) || _amt <= (0) {
 12790  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63643), unsafe.Pointer(&_accessPayloadØ00__func__Ø000), unsafe.Pointer(str(10717)))
 12791  			crt.X__builtin_abort(tls)
 12792  		}
 12793  	}()
 12794  _30:
 12795  	if _5_nextPage == 0 {
 12796  		goto _31
 12797  	}
 12798  	func() {
 12799  		if (*elem7(_pCur.XaOverflow, uintptr(_iIdx))) != (0) && (*elem7(_pCur.XaOverflow, uintptr(_iIdx))) != _5_nextPage && _sqlite3Config.XneverCorrupt != int32(0) {
 12800  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63646), unsafe.Pointer(&_accessPayloadØ00__func__Ø000), unsafe.Pointer(str(10740)))
 12801  			crt.X__builtin_abort(tls)
 12802  		}
 12803  	}()
 12804  	*elem7(_pCur.XaOverflow, uintptr(_iIdx)) = _5_nextPage
 12805  	if _offset < _5_ovflSize {
 12806  		goto _36
 12807  	}
 12808  	func() {
 12809  		if (int32(_pCur.XcurFlags) & int32(4)) == 0 {
 12810  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63658), unsafe.Pointer(&_accessPayloadØ00__func__Ø000), unsafe.Pointer(str(10814)))
 12811  			crt.X__builtin_abort(tls)
 12812  		}
 12813  	}()
 12814  	func() {
 12815  		if (*Xsqlite3)((*XBtree)(_pCur.XpBtree).Xdb) != (*Xsqlite3)(_pBt.Xdb) {
 12816  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63659), unsafe.Pointer(&_accessPayloadØ00__func__Ø000), unsafe.Pointer(str(10846)))
 12817  			crt.X__builtin_abort(tls)
 12818  		}
 12819  	}()
 12820  	if (*elem7(_pCur.XaOverflow, uintptr(_iIdx+int32(1)))) != 0 {
 12821  		_5_nextPage = *elem7(_pCur.XaOverflow, uintptr(_iIdx+int32(1)))
 12822  		goto _42
 12823  	}
 12824  	_rc = _getOverflowPage(tls, _pBt, _5_nextPage, nil, &_5_nextPage)
 12825  _42:
 12826  	_offset -= _5_ovflSize
 12827  	goto _43
 12828  _36:
 12829  	_16_a = int32(_amt)
 12830  	if (uint32(_16_a) + _offset) > _5_ovflSize {
 12831  		_16_a = int32(_5_ovflSize - _offset)
 12832  	}
 12833  	_rc = _sqlite3PagerGet(tls, (*XPager)(_pBt.XpPager), _5_nextPage, &_18_pDbPage, func() int32 {
 12834  		if _eOp == int32(0) {
 12835  			return int32(2)
 12836  		}
 12837  		return int32(0)
 12838  	}())
 12839  	if _rc == int32(0) {
 12840  		_aPayload = (*uint8)(_sqlite3PagerGetData(tls, _18_pDbPage))
 12841  		_5_nextPage = _sqlite3Get4byte(tls, _aPayload)
 12842  		_rc = _copyPayload(tls, unsafe.Pointer(elem15(_aPayload, uintptr(_offset+uint32(4)))), unsafe.Pointer(_pBuf), _16_a, _eOp, _18_pDbPage)
 12843  		_sqlite3PagerUnref(tls, _18_pDbPage)
 12844  		_offset = 0
 12845  	}
 12846  	_amt -= uint32(_16_a)
 12847  	if _amt == (0) {
 12848  		return _rc
 12849  	}
 12850  	*(*uintptr)(unsafe.Pointer(&_pBuf)) += uintptr(_16_a)
 12851  _43:
 12852  	if _rc != 0 {
 12853  		goto _31
 12854  	}
 12855  	_iIdx += 1
 12856  	goto _30
 12857  _31:
 12858  _20:
 12859  	if (_rc == int32(0)) && (_amt > (0)) {
 12860  		return _sqlite3CorruptError(tls, int32(63732))
 12861  	}
 12862  	return _rc
 12863  }
 12864  
 12865  var _accessPayloadØ00__func__Ø000 [14]int8
 12866  
 12867  func init() {
 12868  	crt.Xstrncpy(nil, &_accessPayloadØ00__func__Ø000[0], str(10872), 14)
 12869  }
 12870  
 12871  // C comment
 12872  //  /*
 12873  //  ** The SQLITE_*_BKPT macros are substitutes for the error codes with
 12874  //  ** the same name but without the _BKPT suffix.  These macros invoke
 12875  //  ** routines that report the line-number on which the error originated
 12876  //  ** using sqlite3_log().  The routines also provide a convenient place
 12877  //  ** to set a debugger breakpoint.
 12878  //  */
 12879  func _sqlite3CorruptError(tls *crt.TLS, _lineno int32) (r0 int32) {
 12880  	return _reportError(tls, int32(11), _lineno, str(10886))
 12881  }
 12882  
 12883  // C comment
 12884  //  /*
 12885  //  ** Copy data from a buffer to a page, or from a page to a buffer.
 12886  //  **
 12887  //  ** pPayload is a pointer to data stored on database page pDbPage.
 12888  //  ** If argument eOp is false, then nByte bytes of data are copied
 12889  //  ** from pPayload to the buffer pointed at by pBuf. If eOp is true,
 12890  //  ** then sqlite3PagerWrite() is called on pDbPage and nByte bytes
 12891  //  ** of data are copied from the buffer pBuf to pPayload.
 12892  //  **
 12893  //  ** SQLITE_OK is returned on success, otherwise an error code.
 12894  //  */
 12895  func _copyPayload(tls *crt.TLS, _pPayload unsafe.Pointer, _pBuf unsafe.Pointer, _nByte int32, _eOp int32, _pDbPage *XPgHdr) (r0 int32) {
 12896  	var _1_rc int32
 12897  	if _eOp == 0 {
 12898  		goto _0
 12899  	}
 12900  	_1_rc = _sqlite3PagerWrite(tls, _pDbPage)
 12901  	if _1_rc != int32(0) {
 12902  		return _1_rc
 12903  	}
 12904  	crt.Xmemcpy(tls, _pPayload, _pBuf, uint32(_nByte))
 12905  	goto _2
 12906  _0:
 12907  	crt.Xmemcpy(tls, _pBuf, _pPayload, uint32(_nByte))
 12908  _2:
 12909  	return int32(0)
 12910  }
 12911  
 12912  // C comment
 12913  //  /*
 12914  //  ** Mark a data page as writeable. This routine must be called before
 12915  //  ** making changes to a page. The caller must check the return value
 12916  //  ** of this function and be careful not to change any page data unless
 12917  //  ** this routine returns SQLITE_OK.
 12918  //  **
 12919  //  ** The difference between this function and pager_write() is that this
 12920  //  ** function also deals with the special case where 2 or more pages
 12921  //  ** fit on a single disk sector. In this case all co-resident pages
 12922  //  ** must have been written to the journal file before returning.
 12923  //  **
 12924  //  ** If an error occurs, SQLITE_NOMEM or an IO error code is returned
 12925  //  ** as appropriate. Otherwise, SQLITE_OK.
 12926  //  */
 12927  func _sqlite3PagerWrite(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
 12928  	var _pPager *XPager
 12929  	_pPager = (*XPager)(_pPg.XpPager)
 12930  	func() {
 12931  		if (int32(_pPg.Xflags) & int32(32)) != int32(0) {
 12932  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52989), unsafe.Pointer(&_sqlite3PagerWriteØ00__func__Ø000), unsafe.Pointer(str(10906)))
 12933  			crt.X__builtin_abort(tls)
 12934  		}
 12935  	}()
 12936  	func() {
 12937  		if int32(_pPager.XeState) < int32(2) {
 12938  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52990), unsafe.Pointer(&_sqlite3PagerWriteØ00__func__Ø000), unsafe.Pointer(str(10935)))
 12939  			crt.X__builtin_abort(tls)
 12940  		}
 12941  	}()
 12942  	func() {
 12943  		if _assert_pager_state(tls, _pPager) == 0 {
 12944  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52991), unsafe.Pointer(&_sqlite3PagerWriteØ00__func__Ø000), unsafe.Pointer(str(10971)))
 12945  			crt.X__builtin_abort(tls)
 12946  		}
 12947  	}()
 12948  	if (int32(_pPg.Xflags)&int32(4)) == int32(0) || _pPager.XdbSize < _pPg.Xpgno {
 12949  		goto _7
 12950  	}
 12951  	if _pPager.XnSavepoint != 0 {
 12952  		return _subjournalPageIfRequired(tls, _pPg)
 12953  	}
 12954  	return int32(0)
 12955  
 12956  _7:
 12957  	if _pPager.XerrCode != 0 {
 12958  		return _pPager.XerrCode
 12959  	}
 12960  	if _pPager.XsectorSize > uint32(_pPager.XpageSize) {
 12961  		func() {
 12962  			if int32(_pPager.XtempFile) != int32(0) {
 12963  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52998), unsafe.Pointer(&_sqlite3PagerWriteØ00__func__Ø000), unsafe.Pointer(str(10998)))
 12964  				crt.X__builtin_abort(tls)
 12965  			}
 12966  		}()
 12967  		return _pagerWriteLargeSector(tls, _pPg)
 12968  	}
 12969  	return _pager_write(tls, _pPg)
 12970  }
 12971  
 12972  var _sqlite3PagerWriteØ00__func__Ø000 [18]int8
 12973  
 12974  func init() {
 12975  	crt.Xstrncpy(nil, &_sqlite3PagerWriteØ00__func__Ø000[0], str(11018), 18)
 12976  }
 12977  
 12978  // C comment
 12979  //  /*
 12980  //  ** Usage:
 12981  //  **
 12982  //  **   assert( assert_pager_state(pPager) );
 12983  //  **
 12984  //  ** This function runs many asserts to try to find inconsistencies in
 12985  //  ** the internal state of the Pager object.
 12986  //  */
 12987  func _assert_pager_state(tls *crt.TLS, _p *XPager) (r0 int32) {
 12988  	var _pPager *XPager
 12989  	_pPager = _p
 12990  	func() {
 12991  		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) {
 12992  			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)))
 12993  			crt.X__builtin_abort(tls)
 12994  		}
 12995  	}()
 12996  	func() {
 12997  		if int32(_p.XtempFile) != int32(0) && int32(_p.XeLock) != int32(4) {
 12998  			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)))
 12999  			crt.X__builtin_abort(tls)
 13000  		}
 13001  	}()
 13002  	func() {
 13003  		if int32(_p.XtempFile) != int32(0) && _pPager.XchangeCountDone == 0 {
 13004  			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)))
 13005  			crt.X__builtin_abort(tls)
 13006  		}
 13007  	}()
 13008  	func() {
 13009  		if int32(_p.XjournalMode) != int32(2) && _p.XuseJournal == 0 {
 13010  			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)))
 13011  			crt.X__builtin_abort(tls)
 13012  		}
 13013  	}()
 13014  	func() {
 13015  		if int32(_p.XjournalMode) == int32(2) && (*Xsqlite3_io_methods)((*Xsqlite3_file)(_p.Xjfd).XpMethods) != nil {
 13016  			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)))
 13017  			crt.X__builtin_abort(tls)
 13018  		}
 13019  	}()
 13020  	if _pPager.XmemDb != 0 {
 13021  		func() {
 13022  			if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_p.Xfd).XpMethods) != nil {
 13023  				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)))
 13024  				crt.X__builtin_abort(tls)
 13025  			}
 13026  		}()
 13027  		func() {
 13028  			if _p.XnoSync == 0 {
 13029  				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)))
 13030  				crt.X__builtin_abort(tls)
 13031  			}
 13032  		}()
 13033  		func() {
 13034  			if int32(_p.XjournalMode) != int32(2) && int32(_p.XjournalMode) != int32(4) {
 13035  				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)))
 13036  				crt.X__builtin_abort(tls)
 13037  			}
 13038  		}()
 13039  		func() {
 13040  			if int32(_p.XeState) == int32(6) || int32(_p.XeState) == int32(0) {
 13041  				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)))
 13042  				crt.X__builtin_abort(tls)
 13043  			}
 13044  		}()
 13045  		func() {
 13046  			if bool2int((*XWal)(_p.XpWal) != nil) != int32(0) {
 13047  				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)))
 13048  				crt.X__builtin_abort(tls)
 13049  			}
 13050  		}()
 13051  	}
 13052  	func() {
 13053  		if int32(_pPager.XchangeCountDone) != int32(0) && int32(_pPager.XeLock) < int32(2) {
 13054  			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)))
 13055  			crt.X__builtin_abort(tls)
 13056  		}
 13057  	}()
 13058  	func() {
 13059  		if int32(_p.XeLock) == int32(3) {
 13060  			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)))
 13061  			crt.X__builtin_abort(tls)
 13062  		}
 13063  	}()
 13064  	switch int32(_p.XeState) {
 13065  	case int32(0):
 13066  		goto _39
 13067  	case int32(1):
 13068  		goto _40
 13069  	case int32(2):
 13070  		goto _41
 13071  	case int32(3):
 13072  		goto _42
 13073  	case int32(4):
 13074  		goto _43
 13075  	case int32(5):
 13076  		goto _44
 13077  	case int32(6):
 13078  		goto _45
 13079  	default:
 13080  		goto _46
 13081  	}
 13082  
 13083  _39:
 13084  	func() {
 13085  		if _pPager.XmemDb != 0 {
 13086  			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)))
 13087  			crt.X__builtin_abort(tls)
 13088  		}
 13089  	}()
 13090  	func() {
 13091  		if _pPager.XerrCode != int32(0) {
 13092  			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)))
 13093  			crt.X__builtin_abort(tls)
 13094  		}
 13095  	}()
 13096  	func() {
 13097  		if _sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.XpPCache)) != int32(0) && _pPager.XtempFile == 0 {
 13098  			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)))
 13099  			crt.X__builtin_abort(tls)
 13100  		}
 13101  	}()
 13102  	goto _46
 13103  _40:
 13104  	func() {
 13105  		if _pPager.XerrCode != int32(0) {
 13106  			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)))
 13107  			crt.X__builtin_abort(tls)
 13108  		}
 13109  	}()
 13110  	func() {
 13111  		if int32(_p.XeLock) == int32(5) {
 13112  			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)))
 13113  			crt.X__builtin_abort(tls)
 13114  		}
 13115  	}()
 13116  	func() {
 13117  		if int32(_p.XeLock) < int32(1) {
 13118  			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)))
 13119  			crt.X__builtin_abort(tls)
 13120  		}
 13121  	}()
 13122  	goto _46
 13123  _41:
 13124  	func() {
 13125  		if int32(_p.XeLock) == int32(5) {
 13126  			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)))
 13127  			crt.X__builtin_abort(tls)
 13128  		}
 13129  	}()
 13130  	func() {
 13131  		if _pPager.XerrCode != int32(0) {
 13132  			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)))
 13133  			crt.X__builtin_abort(tls)
 13134  		}
 13135  	}()
 13136  	if (*XWal)(_pPager.XpWal) == nil {
 13137  		func() {
 13138  			if int32(_p.XeLock) < int32(2) {
 13139  				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)))
 13140  				crt.X__builtin_abort(tls)
 13141  			}
 13142  		}()
 13143  	}
 13144  	func() {
 13145  		if _pPager.XdbSize != _pPager.XdbOrigSize {
 13146  			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)))
 13147  			crt.X__builtin_abort(tls)
 13148  		}
 13149  	}()
 13150  	func() {
 13151  		if _pPager.XdbOrigSize != _pPager.XdbFileSize {
 13152  			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)))
 13153  			crt.X__builtin_abort(tls)
 13154  		}
 13155  	}()
 13156  	func() {
 13157  		if _pPager.XdbOrigSize != _pPager.XdbHintSize {
 13158  			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)))
 13159  			crt.X__builtin_abort(tls)
 13160  		}
 13161  	}()
 13162  	func() {
 13163  		if int32(_pPager.XsetMaster) != int32(0) {
 13164  			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)))
 13165  			crt.X__builtin_abort(tls)
 13166  		}
 13167  	}()
 13168  	goto _46
 13169  _42:
 13170  	func() {
 13171  		if int32(_p.XeLock) == int32(5) {
 13172  			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)))
 13173  			crt.X__builtin_abort(tls)
 13174  		}
 13175  	}()
 13176  	func() {
 13177  		if _pPager.XerrCode != int32(0) {
 13178  			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)))
 13179  			crt.X__builtin_abort(tls)
 13180  		}
 13181  	}()
 13182  	if (*XWal)(_pPager.XpWal) == nil {
 13183  		func() {
 13184  			if int32(_p.XeLock) < int32(2) {
 13185  				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)))
 13186  				crt.X__builtin_abort(tls)
 13187  			}
 13188  		}()
 13189  		func() {
 13190  			if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_p.Xjfd).XpMethods) == nil && int32(_p.XjournalMode) != int32(2) && int32(_p.XjournalMode) != int32(5) {
 13191  				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)))
 13192  				crt.X__builtin_abort(tls)
 13193  			}
 13194  		}()
 13195  	}
 13196  	func() {
 13197  		if _pPager.XdbOrigSize != _pPager.XdbFileSize {
 13198  			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)))
 13199  			crt.X__builtin_abort(tls)
 13200  		}
 13201  	}()
 13202  	func() {
 13203  		if _pPager.XdbOrigSize != _pPager.XdbHintSize {
 13204  			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)))
 13205  			crt.X__builtin_abort(tls)
 13206  		}
 13207  	}()
 13208  	goto _46
 13209  _43:
 13210  	func() {
 13211  		if int32(_p.XeLock) != int32(4) {
 13212  			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)))
 13213  			crt.X__builtin_abort(tls)
 13214  		}
 13215  	}()
 13216  	func() {
 13217  		if _pPager.XerrCode != int32(0) {
 13218  			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)))
 13219  			crt.X__builtin_abort(tls)
 13220  		}
 13221  	}()
 13222  	func() {
 13223  		if (*XWal)(_pPager.XpWal) != nil {
 13224  			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)))
 13225  			crt.X__builtin_abort(tls)
 13226  		}
 13227  	}()
 13228  	func() {
 13229  		if int32(_p.XeLock) < int32(4) {
 13230  			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)))
 13231  			crt.X__builtin_abort(tls)
 13232  		}
 13233  	}()
 13234  	func() {
 13235  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_p.Xjfd).XpMethods) == nil && int32(_p.XjournalMode) != int32(2) && int32(_p.XjournalMode) != int32(5) {
 13236  			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)))
 13237  			crt.X__builtin_abort(tls)
 13238  		}
 13239  	}()
 13240  	func() {
 13241  		if _pPager.XdbOrigSize > _pPager.XdbHintSize {
 13242  			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)))
 13243  			crt.X__builtin_abort(tls)
 13244  		}
 13245  	}()
 13246  	goto _46
 13247  _44:
 13248  	func() {
 13249  		if int32(_p.XeLock) != int32(4) {
 13250  			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)))
 13251  			crt.X__builtin_abort(tls)
 13252  		}
 13253  	}()
 13254  	func() {
 13255  		if _pPager.XerrCode != int32(0) {
 13256  			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)))
 13257  			crt.X__builtin_abort(tls)
 13258  		}
 13259  	}()
 13260  	func() {
 13261  		if (*XWal)(_pPager.XpWal) != nil {
 13262  			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)))
 13263  			crt.X__builtin_abort(tls)
 13264  		}
 13265  	}()
 13266  	func() {
 13267  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_p.Xjfd).XpMethods) == nil && int32(_p.XjournalMode) != int32(2) && int32(_p.XjournalMode) != int32(5) {
 13268  			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)))
 13269  			crt.X__builtin_abort(tls)
 13270  		}
 13271  	}()
 13272  	goto _46
 13273  _45:
 13274  	func() {
 13275  		if _pPager.XerrCode == int32(0) {
 13276  			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)))
 13277  			crt.X__builtin_abort(tls)
 13278  		}
 13279  	}()
 13280  	func() {
 13281  		if _sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.XpPCache)) <= int32(0) && _pPager.XtempFile == 0 {
 13282  			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)))
 13283  			crt.X__builtin_abort(tls)
 13284  		}
 13285  	}()
 13286  	goto _46
 13287  _46:
 13288  	return int32(1)
 13289  }
 13290  
 13291  var _assert_pager_stateØ00__func__Ø000 [19]int8
 13292  
 13293  func init() {
 13294  	crt.Xstrncpy(nil, &_assert_pager_stateØ00__func__Ø000[0], str(12296), 19)
 13295  }
 13296  
 13297  // C comment
 13298  //  /*
 13299  //  ** Return the total number of references to all pages held by the cache.
 13300  //  **
 13301  //  ** This is not the total number of pages referenced, but the sum of the
 13302  //  ** reference count for all pages.
 13303  //  */
 13304  func _sqlite3PcacheRefCount(tls *crt.TLS, _pCache *XPCache) (r0 int32) {
 13305  	return _pCache.XnRefSum
 13306  }
 13307  
 13308  func _subjournalPageIfRequired(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
 13309  	if _subjRequiresPage(tls, _pPg) != 0 {
 13310  		return _subjournalPage(tls, _pPg)
 13311  	}
 13312  	return int32(0)
 13313  }
 13314  
 13315  // C comment
 13316  //  /*
 13317  //  ** Return true if it is necessary to write page *pPg into the sub-journal.
 13318  //  ** A page needs to be written into the sub-journal if there exists one
 13319  //  ** or more open savepoints for which:
 13320  //  **
 13321  //  **   * The page-number is less than or equal to PagerSavepoint.nOrig, and
 13322  //  **   * The bit corresponding to the page-number is not set in
 13323  //  **     PagerSavepoint.pInSavepoint.
 13324  //  */
 13325  func _subjRequiresPage(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
 13326  	var _i int32
 13327  	var _pgno uint32
 13328  	var _pPager *XPager
 13329  	var _p *XPagerSavepoint
 13330  	_pPager = (*XPager)(_pPg.XpPager)
 13331  	_pgno = _pPg.Xpgno
 13332  	_i = int32(0)
 13333  _0:
 13334  	if _i >= _pPager.XnSavepoint {
 13335  		goto _3
 13336  	}
 13337  	_p = elem31((*XPagerSavepoint)(_pPager.XaSavepoint), uintptr(_i))
 13338  	if (_p.XnOrig >= _pgno) && (int32(0) == _sqlite3BitvecTestNotNull(tls, (*XBitvec)(_p.XpInSavepoint), _pgno)) {
 13339  		return int32(1)
 13340  	}
 13341  	_i += 1
 13342  	goto _0
 13343  _3:
 13344  	return int32(0)
 13345  }
 13346  
 13347  // C comment
 13348  //  /*
 13349  //  ** Check to see if the i-th bit is set.  Return true or false.
 13350  //  ** If p is NULL (if the bitmap has not been created) or if
 13351  //  ** i is out of range, then return false.
 13352  //  */
 13353  func _sqlite3BitvecTestNotNull(tls *crt.TLS, _p *XBitvec, _i uint32) (r0 int32) {
 13354  	var _1_bin, _4_h uint32
 13355  	func() {
 13356  		if _p == nil {
 13357  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(43840), unsafe.Pointer(&_sqlite3BitvecTestNotNullØ00__func__Ø000), unsafe.Pointer(str(807)))
 13358  			crt.X__builtin_abort(tls)
 13359  		}
 13360  	}()
 13361  	_i -= 1
 13362  	if _i >= _p.XiSize {
 13363  		return int32(0)
 13364  	}
 13365  _2:
 13366  	if _p.XiDivisor == 0 {
 13367  		goto _4
 13368  	}
 13369  	_1_bin = _i / _p.XiDivisor
 13370  	_i = _i % _p.XiDivisor
 13371  	_p = *elem32((**XBitvec)(unsafe.Pointer((*[125]unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))), uintptr(_1_bin))
 13372  	if _p == nil {
 13373  		return int32(0)
 13374  	}
 13375  	goto _2
 13376  _4:
 13377  	if _p.XiSize <= uint32(4000) {
 13378  		return bool2int((int32(*elem15((*uint8)(unsafe.Pointer((*[500]uint8)(unsafe.Pointer(&_p.Xu)))), uintptr(_i/uint32(8)))) & (int32(1) << uint(int32(_i&uint32(7))))) != int32(0))
 13379  	}
 13380  	_4_h = (postInc23(&_i, uint32(1)) * uint32(1)) % uint32(125)
 13381  _8:
 13382  	if (*elem7((*uint32)(unsafe.Pointer((*[125]uint32)(unsafe.Pointer(&_p.Xu)))), uintptr(_4_h))) == 0 {
 13383  		goto _9
 13384  	}
 13385  	if (*elem7((*uint32)(unsafe.Pointer((*[125]uint32)(unsafe.Pointer(&_p.Xu)))), uintptr(_4_h))) == _i {
 13386  		return int32(1)
 13387  	}
 13388  	_4_h = (_4_h + uint32(1)) % uint32(125)
 13389  	goto _8
 13390  _9:
 13391  	return int32(0)
 13392  }
 13393  
 13394  var _sqlite3BitvecTestNotNullØ00__func__Ø000 [25]int8
 13395  
 13396  func init() {
 13397  	crt.Xstrncpy(nil, &_sqlite3BitvecTestNotNullØ00__func__Ø000[0], str(12315), 25)
 13398  }
 13399  
 13400  // C comment
 13401  //  /*
 13402  //  ** Append a record of the current state of page pPg to the sub-journal.
 13403  //  **
 13404  //  ** If successful, set the bit corresponding to pPg->pgno in the bitvecs
 13405  //  ** for all open savepoints before returning.
 13406  //  **
 13407  //  ** This function returns SQLITE_OK if everything is successful, an IO
 13408  //  ** error code if the attempt to write to the sub-journal fails, or
 13409  //  ** SQLITE_NOMEM if a malloc fails while setting a bit in a savepoint
 13410  //  ** bitvec.
 13411  //  */
 13412  func _subjournalPage(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
 13413  	var _rc int32
 13414  	var _2_offset int64
 13415  	var _2_pData2 *int8
 13416  	var _2_pData unsafe.Pointer
 13417  	var _pPager *XPager
 13418  	_rc = int32(0)
 13419  	_pPager = (*XPager)(_pPg.XpPager)
 13420  	if int32(_pPager.XjournalMode) == int32(2) {
 13421  		goto _0
 13422  	}
 13423  	func() {
 13424  		if _pPager.XuseJournal == 0 {
 13425  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51384), unsafe.Pointer(&_subjournalPageØ00__func__Ø000), unsafe.Pointer(str(12340)))
 13426  			crt.X__builtin_abort(tls)
 13427  		}
 13428  	}()
 13429  	func() {
 13430  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil && (*XWal)(_pPager.XpWal) == nil {
 13431  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51385), unsafe.Pointer(&_subjournalPageØ00__func__Ø000), unsafe.Pointer(str(12359)))
 13432  			crt.X__builtin_abort(tls)
 13433  		}
 13434  	}()
 13435  	func() {
 13436  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xsjfd).XpMethods) == nil && _pPager.XnSubRec != (0) {
 13437  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51386), unsafe.Pointer(&_subjournalPageØ00__func__Ø000), unsafe.Pointer(str(12402)))
 13438  			crt.X__builtin_abort(tls)
 13439  		}
 13440  	}()
 13441  	func() {
 13442  		if (*XWal)(_pPager.XpWal) == nil && _pageInJournal(tls, _pPager, _pPg) == 0 && _pPg.Xpgno <= _pPager.XdbOrigSize {
 13443  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51387), unsafe.Pointer(&_subjournalPageØ00__func__Ø000), unsafe.Pointer(str(12445)))
 13444  			crt.X__builtin_abort(tls)
 13445  		}
 13446  	}()
 13447  	_rc = _openSubJournal(tls, _pPager)
 13448  	if _rc != int32(0) {
 13449  		goto _13
 13450  	}
 13451  	_2_pData = _pPg.XpData
 13452  	_2_offset = int64(_pPager.XnSubRec) * int64(int32(4)+_pPager.XpageSize)
 13453  	_2_pData2 = (*int8)(_2_pData)
 13454  	_rc = _write32bits(tls, (*Xsqlite3_file)(_pPager.Xsjfd), _2_offset, _pPg.Xpgno)
 13455  	if _rc == int32(0) {
 13456  		_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.Xsjfd), unsafe.Pointer(_2_pData2), _pPager.XpageSize, _2_offset+int64(4))
 13457  	}
 13458  _13:
 13459  _0:
 13460  	if _rc == int32(0) {
 13461  		_pPager.XnSubRec += 1
 13462  		func() {
 13463  			if _pPager.XnSavepoint <= int32(0) {
 13464  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51415), unsafe.Pointer(&_subjournalPageØ00__func__Ø000), unsafe.Pointer(str(12527)))
 13465  				crt.X__builtin_abort(tls)
 13466  			}
 13467  		}()
 13468  		_rc = _addToSavepointBitvecs(tls, _pPager, _pPg.Xpgno)
 13469  	}
 13470  	return _rc
 13471  }
 13472  
 13473  var _subjournalPageØ00__func__Ø000 [15]int8
 13474  
 13475  func init() {
 13476  	crt.Xstrncpy(nil, &_subjournalPageØ00__func__Ø000[0], str(12548), 15)
 13477  }
 13478  
 13479  // C comment
 13480  //  /*
 13481  //  ** Return true if the page is already in the journal file.
 13482  //  */
 13483  func _pageInJournal(tls *crt.TLS, _pPager *XPager, _pPg *XPgHdr) (r0 int32) {
 13484  	return _sqlite3BitvecTest(tls, (*XBitvec)(_pPager.XpInJournal), _pPg.Xpgno)
 13485  }
 13486  
 13487  func _sqlite3BitvecTest(tls *crt.TLS, _p *XBitvec, _i uint32) (r0 int32) {
 13488  	return bool2int((_p != nil) && _sqlite3BitvecTestNotNull(tls, _p, _i) != 0)
 13489  }
 13490  
 13491  // C comment
 13492  //  /*
 13493  //  ** Ensure that the sub-journal file is open. If it is already open, this
 13494  //  ** function is a no-op.
 13495  //  **
 13496  //  ** SQLITE_OK is returned if everything goes according to plan. An
 13497  //  ** SQLITE_IOERR_XXX error code is returned if a call to sqlite3OsOpen()
 13498  //  ** fails.
 13499  //  */
 13500  func _openSubJournal(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 13501  	var _rc, _1_flags, _1_nStmtSpill int32
 13502  	_rc = int32(0)
 13503  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xsjfd).XpMethods) != nil {
 13504  		goto _0
 13505  	}
 13506  	_1_flags = int32(8222)
 13507  	_1_nStmtSpill = _sqlite3Config.XnStmtSpill
 13508  	if (int32(_pPager.XjournalMode) == int32(4)) || (_pPager.XsubjInMemory != 0) {
 13509  		_1_nStmtSpill = int32(-1)
 13510  	}
 13511  	_rc = _sqlite3JournalOpen(tls, (*Xsqlite3_vfs)(_pPager.XpVfs), nil, (*Xsqlite3_file)(_pPager.Xsjfd), _1_flags, _1_nStmtSpill)
 13512  _0:
 13513  	return _rc
 13514  }
 13515  
 13516  // C comment
 13517  //  /*
 13518  //  ** Open a journal file.
 13519  //  **
 13520  //  ** The behaviour of the journal file depends on the value of parameter
 13521  //  ** nSpill. If nSpill is 0, then the journal file is always create and
 13522  //  ** accessed using the underlying VFS. If nSpill is less than zero, then
 13523  //  ** all content is always stored in main-memory. Finally, if nSpill is a
 13524  //  ** positive value, then the journal file is initially created in-memory
 13525  //  ** but may be flushed to disk later on. In this case the journal file is
 13526  //  ** flushed to disk either when it grows larger than nSpill bytes in size,
 13527  //  ** or when sqlite3JournalCreate() is called.
 13528  //  */
 13529  func _sqlite3JournalOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zName *int8, _pJfd *Xsqlite3_file, _flags int32, _nSpill int32) (r0 int32) {
 13530  	var _p *XMemJournal
 13531  	_p = (*XMemJournal)(unsafe.Pointer(_pJfd))
 13532  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint32(56))
 13533  	if _nSpill == int32(0) {
 13534  		return _sqlite3OsOpen(tls, _pVfs, _zName, _pJfd, _flags, nil)
 13535  	}
 13536  	if _nSpill > int32(0) {
 13537  		_p.XnChunkSize = _nSpill
 13538  		goto _2
 13539  	}
 13540  	_p.XnChunkSize = int32(1020)
 13541  	func() {
 13542  		if uint32(1024) != (uint32(12) + uint32(_p.XnChunkSize-int32(8))) {
 13543  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89134), unsafe.Pointer(&_sqlite3JournalOpenØ00__func__Ø000), unsafe.Pointer(str(12563)))
 13544  			crt.X__builtin_abort(tls)
 13545  		}
 13546  	}()
 13547  _2:
 13548  	*(**Xsqlite3_io_methods)(unsafe.Pointer(&_p.XpMethod)) = &_MemJournalMethods
 13549  	_p.XnSpill = _nSpill
 13550  	_p.Xflags = _flags
 13551  	_p.XzJournal = _zName
 13552  	*(**Xsqlite3_vfs)(unsafe.Pointer(&_p.XpVfs)) = _pVfs
 13553  	return int32(0)
 13554  }
 13555  
 13556  // C comment
 13557  //  /*
 13558  //  ** The next group of routines are convenience wrappers around the
 13559  //  ** VFS methods.
 13560  //  */
 13561  func _sqlite3OsOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _pFile *Xsqlite3_file, _flags int32, _pFlagsOut *int32) (r0 int32) {
 13562  	var _rc int32
 13563  	_rc = func() func(*crt.TLS, *Xsqlite3_vfs, *int8, *Xsqlite3_file, int32, *int32) int32 {
 13564  		v := _pVfs.XxOpen
 13565  		return *(*func(*crt.TLS, *Xsqlite3_vfs, *int8, *Xsqlite3_file, int32, *int32) int32)(unsafe.Pointer(&v))
 13566  	}()(tls, _pVfs, _zPath, _pFile, _flags&int32(556927), _pFlagsOut)
 13567  	func() {
 13568  		if _rc != int32(0) && (*Xsqlite3_io_methods)(_pFile.XpMethods) != nil {
 13569  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(20292), unsafe.Pointer(&_sqlite3OsOpenØ00__func__Ø000), unsafe.Pointer(str(12623)))
 13570  			crt.X__builtin_abort(tls)
 13571  		}
 13572  	}()
 13573  	return _rc
 13574  }
 13575  
 13576  var _sqlite3OsOpenØ00__func__Ø000 [14]int8
 13577  
 13578  func init() {
 13579  	crt.Xstrncpy(nil, &_sqlite3OsOpenØ00__func__Ø000[0], str(12659), 14)
 13580  }
 13581  
 13582  var _sqlite3JournalOpenØ00__func__Ø000 [19]int8
 13583  
 13584  func init() {
 13585  	crt.Xstrncpy(nil, &_sqlite3JournalOpenØ00__func__Ø000[0], str(12673), 19)
 13586  }
 13587  
 13588  // C comment
 13589  //  /*
 13590  //  ** Table of methods for MemJournal sqlite3_file object.
 13591  //  */
 13592  var _MemJournalMethods Xsqlite3_io_methods
 13593  
 13594  func init() {
 13595  	_MemJournalMethods = Xsqlite3_io_methods{XiVersion: int32(1), XxClose: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 13596  		f func(*crt.TLS, *Xsqlite3_file) int32
 13597  	}{_memjrnlClose})), XxRead: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
 13598  		f func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32
 13599  	}{_memjrnlRead})), XxWrite: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
 13600  		f func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32
 13601  	}{_memjrnlWrite})), XxTruncate: *(*func(*crt.TLS, unsafe.Pointer, int64) int32)(unsafe.Pointer(&struct {
 13602  		f func(*crt.TLS, *Xsqlite3_file, int64) int32
 13603  	}{_memjrnlTruncate})), XxSync: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
 13604  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
 13605  	}{_memjrnlSync})), XxFileSize: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
 13606  		f func(*crt.TLS, *Xsqlite3_file, *int64) int32
 13607  	}{_memjrnlFileSize}))}
 13608  }
 13609  
 13610  // C comment
 13611  //  /*
 13612  //  ** Close the file.
 13613  //  */
 13614  func _memjrnlClose(tls *crt.TLS, _pJfd *Xsqlite3_file) (r0 int32) {
 13615  	var _p *XMemJournal
 13616  	_p = (*XMemJournal)(unsafe.Pointer(_pJfd))
 13617  	_memjrnlFreeChunks(tls, _p)
 13618  	return int32(0)
 13619  }
 13620  
 13621  // C comment
 13622  //  /*
 13623  //  ** Free the list of FileChunk structures headed at MemJournal.pFirst.
 13624  //  */
 13625  func _memjrnlFreeChunks(tls *crt.TLS, _p *XMemJournal) {
 13626  	var _pIter, _pNext *XFileChunk
 13627  	_pIter = (*XFileChunk)(_p.XpFirst)
 13628  _0:
 13629  	if _pIter == nil {
 13630  		goto _3
 13631  	}
 13632  	_pNext = (*XFileChunk)(_pIter.XpNext)
 13633  	Xsqlite3_free(tls, unsafe.Pointer(_pIter))
 13634  	_pIter = _pNext
 13635  	goto _0
 13636  _3:
 13637  	*(**XFileChunk)(unsafe.Pointer(&_p.XpFirst)) = nil
 13638  }
 13639  
 13640  // C comment
 13641  //  /*
 13642  //  ** Read data from the in-memory journal file.  This is the implementation
 13643  //  ** of the sqlite3_vfs.xRead method.
 13644  //  */
 13645  func _memjrnlRead(tls *crt.TLS, _pJfd *Xsqlite3_file, _zBuf unsafe.Pointer, _iAmt int32, _iOfst int64) (r0 int32) {
 13646  	var _nRead, _iChunkOffset, _4_iSpace, _4_nCopy int32
 13647  	var _1_iOff int64
 13648  	var _zOut *uint8
 13649  	var _p *XMemJournal
 13650  	var _pChunk *XFileChunk
 13651  	_p = (*XMemJournal)(unsafe.Pointer(_pJfd))
 13652  	_zOut = (*uint8)(_zBuf)
 13653  	_nRead = _iAmt
 13654  	func() {
 13655  		if (int64(_iAmt) + _iOfst) > (_p.Xendpoint.XiOffset) {
 13656  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88870), unsafe.Pointer(&_memjrnlReadØ00__func__Ø000), unsafe.Pointer(str(12692)))
 13657  			crt.X__builtin_abort(tls)
 13658  		}
 13659  	}()
 13660  	func() {
 13661  		if (_p.Xreadpoint.XiOffset) != (0) && (*XFileChunk)(_p.Xreadpoint.XpChunk) == nil {
 13662  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88871), unsafe.Pointer(&_memjrnlReadØ00__func__Ø000), unsafe.Pointer(str(12726)))
 13663  			crt.X__builtin_abort(tls)
 13664  		}
 13665  	}()
 13666  	if (_p.Xreadpoint.XiOffset) == _iOfst && _iOfst != (0) {
 13667  		goto _6
 13668  	}
 13669  	_1_iOff = int64(0)
 13670  	_pChunk = (*XFileChunk)(_p.XpFirst)
 13671  _7:
 13672  	if func() int32 {
 13673  		if _pChunk != nil {
 13674  			return int32(1)
 13675  		}
 13676  		return func() int32 {
 13677  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88875), unsafe.Pointer(&_memjrnlReadØ00__func__Ø000), unsafe.Pointer(str(4809)))
 13678  			crt.X__builtin_abort(tls)
 13679  			return int32(0)
 13680  		}()
 13681  	}() == 0 || (_1_iOff+int64(_p.XnChunkSize)) > _iOfst {
 13682  		goto _13
 13683  	}
 13684  	_1_iOff += int64(_p.XnChunkSize)
 13685  	_pChunk = (*XFileChunk)(_pChunk.XpNext)
 13686  	goto _7
 13687  _13:
 13688  	goto _14
 13689  _6:
 13690  	_pChunk = (*XFileChunk)(_p.Xreadpoint.XpChunk)
 13691  	func() {
 13692  		if _pChunk == nil {
 13693  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88882), unsafe.Pointer(&_memjrnlReadØ00__func__Ø000), unsafe.Pointer(str(12776)))
 13694  			crt.X__builtin_abort(tls)
 13695  		}
 13696  	}()
 13697  _14:
 13698  	_iChunkOffset = int32(_iOfst % int64(_p.XnChunkSize))
 13699  _17:
 13700  	_4_iSpace = _p.XnChunkSize - _iChunkOffset
 13701  	_4_nCopy = func() int32 {
 13702  		if _nRead < (_p.XnChunkSize - _iChunkOffset) {
 13703  			return _nRead
 13704  		}
 13705  		return (_p.XnChunkSize - _iChunkOffset)
 13706  	}()
 13707  	crt.Xmemcpy(tls, unsafe.Pointer(_zOut), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_pChunk.XzChunk))+uintptr(_iChunkOffset)))), uint32(_4_nCopy))
 13708  	*(*uintptr)(unsafe.Pointer(&_zOut)) += uintptr(_4_nCopy)
 13709  	_nRead -= _4_iSpace
 13710  	_iChunkOffset = int32(0)
 13711  	if ((_nRead >= int32(0)) && (store33(&_pChunk, (*XFileChunk)(_pChunk.XpNext)) != nil)) && (_nRead > int32(0)) {
 13712  		goto _17
 13713  	}
 13714  	_p.Xreadpoint.XiOffset = func() int64 {
 13715  		if _pChunk != nil {
 13716  			return (_iOfst + int64(_iAmt))
 13717  		}
 13718  		return (0)
 13719  	}()
 13720  	*(**XFileChunk)(unsafe.Pointer(&(_p.Xreadpoint.XpChunk))) = _pChunk
 13721  	return int32(0)
 13722  }
 13723  
 13724  var _memjrnlReadØ00__func__Ø000 [12]int8
 13725  
 13726  func init() {
 13727  	crt.Xstrncpy(nil, &_memjrnlReadØ00__func__Ø000[0], str(12786), 12)
 13728  }
 13729  
 13730  // C comment
 13731  //  /*
 13732  //  ** Write data to the file.
 13733  //  */
 13734  func _memjrnlWrite(tls *crt.TLS, _pJfd *Xsqlite3_file, _zBuf unsafe.Pointer, _iAmt int32, _iOfst int64) (r0 int32) {
 13735  	var _nWrite, _1_rc, _5_iChunkOffset, _5_iSpace int32
 13736  	var _zWrite *uint8
 13737  	var _p *XMemJournal
 13738  	var _5_pChunk, _6_pNew *XFileChunk
 13739  	_p = (*XMemJournal)(unsafe.Pointer(_pJfd))
 13740  	_nWrite = _iAmt
 13741  	_zWrite = (*uint8)(_zBuf)
 13742  	if _p.XnSpill <= int32(0) || (int64(_iAmt)+_iOfst) <= int64(_p.XnSpill) {
 13743  		goto _1
 13744  	}
 13745  	_1_rc = _memjrnlCreateFile(tls, _p)
 13746  	if _1_rc == int32(0) {
 13747  		_1_rc = _sqlite3OsWrite(tls, _pJfd, _zBuf, _iAmt, _iOfst)
 13748  	}
 13749  	return _1_rc
 13750  
 13751  _1:
 13752  	func() {
 13753  		if _iOfst != (_p.Xendpoint.XiOffset) && _iOfst != (0) {
 13754  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88982), unsafe.Pointer(&_memjrnlWriteØ00__func__Ø000), unsafe.Pointer(str(12798)))
 13755  			crt.X__builtin_abort(tls)
 13756  		}
 13757  	}()
 13758  	func() {
 13759  		if _iOfst <= (0) && (*XFileChunk)(_p.XpFirst) != nil {
 13760  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88989), unsafe.Pointer(&_memjrnlWriteØ00__func__Ø000), unsafe.Pointer(str(12837)))
 13761  			crt.X__builtin_abort(tls)
 13762  		}
 13763  	}()
 13764  _10:
 13765  	if _nWrite <= int32(0) {
 13766  		goto _11
 13767  	}
 13768  	_5_pChunk = (*XFileChunk)(_p.Xendpoint.XpChunk)
 13769  	_5_iChunkOffset = int32((_p.Xendpoint.XiOffset) % int64(_p.XnChunkSize))
 13770  	_5_iSpace = func() int32 {
 13771  		if _nWrite < (_p.XnChunkSize - _5_iChunkOffset) {
 13772  			return _nWrite
 13773  		}
 13774  		return (_p.XnChunkSize - _5_iChunkOffset)
 13775  	}()
 13776  	if _5_iChunkOffset != int32(0) {
 13777  		goto _14
 13778  	}
 13779  	_6_pNew = (*XFileChunk)(Xsqlite3_malloc(tls, int32(uint32(12)+uint32(_p.XnChunkSize-int32(8)))))
 13780  	if _6_pNew == nil {
 13781  		return _sqlite3IoerrnomemError(tls, int32(89001))
 13782  	}
 13783  	*(**XFileChunk)(unsafe.Pointer(&_6_pNew.XpNext)) = nil
 13784  	if _5_pChunk != nil {
 13785  		func() {
 13786  			if _p.XpFirst == nil {
 13787  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89005), unsafe.Pointer(&_memjrnlWriteØ00__func__Ø000), unsafe.Pointer(str(12861)))
 13788  				crt.X__builtin_abort(tls)
 13789  			}
 13790  		}()
 13791  		*(**XFileChunk)(unsafe.Pointer(&_5_pChunk.XpNext)) = _6_pNew
 13792  		goto _19
 13793  	}
 13794  	func() {
 13795  		if _p.XpFirst != nil {
 13796  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89008), unsafe.Pointer(&_memjrnlWriteØ00__func__Ø000), unsafe.Pointer(str(12871)))
 13797  			crt.X__builtin_abort(tls)
 13798  		}
 13799  	}()
 13800  	*(**XFileChunk)(unsafe.Pointer(&_p.XpFirst)) = _6_pNew
 13801  _19:
 13802  	*(**XFileChunk)(unsafe.Pointer(&(_p.Xendpoint.XpChunk))) = _6_pNew
 13803  _14:
 13804  	crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&((*XFileChunk)(_p.Xendpoint.XpChunk).XzChunk)))+uintptr(_5_iChunkOffset)))), unsafe.Pointer(_zWrite), uint32(_5_iSpace))
 13805  	*(*uintptr)(unsafe.Pointer(&_zWrite)) += uintptr(_5_iSpace)
 13806  	_nWrite -= _5_iSpace
 13807  	_p.Xendpoint.XiOffset += int64(_5_iSpace)
 13808  	goto _10
 13809  _11:
 13810  	_p.XnSize = int32(int64(_iAmt) + _iOfst)
 13811  	return int32(0)
 13812  }
 13813  
 13814  // C comment
 13815  //  /*
 13816  //  ** Flush the contents of memory to a real file on disk.
 13817  //  */
 13818  func _memjrnlCreateFile(tls *crt.TLS, _p *XMemJournal) (r0 int32) {
 13819  	var _rc, _1_nChunk int32
 13820  	var _1_iOff int64
 13821  	var _pReal *Xsqlite3_file
 13822  	var _copy XMemJournal
 13823  	var _1_pIter *XFileChunk
 13824  	_pReal = (*Xsqlite3_file)(unsafe.Pointer(_p))
 13825  	_copy = *_p
 13826  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint32(56))
 13827  	_rc = _sqlite3OsOpen(tls, (*Xsqlite3_vfs)(_copy.XpVfs), _copy.XzJournal, _pReal, _copy.Xflags, nil)
 13828  	if _rc != int32(0) {
 13829  		goto _0
 13830  	}
 13831  	_1_nChunk = _copy.XnChunkSize
 13832  	_1_iOff = int64(0)
 13833  	_1_pIter = (*XFileChunk)(_copy.XpFirst)
 13834  _1:
 13835  	if _1_pIter == nil {
 13836  		goto _4
 13837  	}
 13838  	if (_1_iOff + int64(_1_nChunk)) > (_copy.Xendpoint.XiOffset) {
 13839  		_1_nChunk = int32((_copy.Xendpoint.XiOffset) - _1_iOff)
 13840  	}
 13841  	_rc = _sqlite3OsWrite(tls, _pReal, unsafe.Pointer(&_1_pIter.XzChunk), _1_nChunk, _1_iOff)
 13842  	if _rc != 0 {
 13843  		goto _4
 13844  	}
 13845  	_1_iOff += int64(_1_nChunk)
 13846  	_1_pIter = (*XFileChunk)(_1_pIter.XpNext)
 13847  	goto _1
 13848  _4:
 13849  	if _rc == int32(0) {
 13850  		_memjrnlFreeChunks(tls, &_copy)
 13851  	}
 13852  _0:
 13853  	if _rc != int32(0) {
 13854  		_sqlite3OsClose(tls, _pReal)
 13855  		*_p = _copy
 13856  	}
 13857  	return _rc
 13858  }
 13859  
 13860  func _sqlite3OsWrite(tls *crt.TLS, _id *Xsqlite3_file, _pBuf unsafe.Pointer, _amt int32, _offset int64) (r0 int32) {
 13861  	return func() func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32 {
 13862  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxWrite
 13863  		return *(*func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&v))
 13864  	}()(tls, _id, _pBuf, _amt, _offset)
 13865  }
 13866  
 13867  // C comment
 13868  //  /*
 13869  //  ** The following routines are convenience wrappers around methods
 13870  //  ** of the sqlite3_file object.  This is mostly just syntactic sugar. All
 13871  //  ** of this would be completely automatic if SQLite were coded using
 13872  //  ** C++ instead of plain old C.
 13873  //  */
 13874  func _sqlite3OsClose(tls *crt.TLS, _pId *Xsqlite3_file) {
 13875  	if _pId.XpMethods != nil {
 13876  		func() func(*crt.TLS, *Xsqlite3_file) int32 {
 13877  			v := (*Xsqlite3_io_methods)(_pId.XpMethods).XxClose
 13878  			return *(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&v))
 13879  		}()(tls, _pId)
 13880  		*(**Xsqlite3_io_methods)(unsafe.Pointer(&_pId.XpMethods)) = nil
 13881  	}
 13882  }
 13883  
 13884  var _memjrnlWriteØ00__func__Ø000 [13]int8
 13885  
 13886  func init() {
 13887  	crt.Xstrncpy(nil, &_memjrnlWriteØ00__func__Ø000[0], str(12882), 13)
 13888  }
 13889  
 13890  // C comment
 13891  //  /*
 13892  //  ** This version of the memory allocation is for use by the application.
 13893  //  ** First make sure the memory subsystem is initialized, then do the
 13894  //  ** allocation.
 13895  //  */
 13896  func Xsqlite3_malloc(tls *crt.TLS, _n int32) (r0 unsafe.Pointer) {
 13897  	if Xsqlite3_initialize(tls) != 0 {
 13898  		return nil
 13899  	}
 13900  	return func() unsafe.Pointer {
 13901  		if _n <= int32(0) {
 13902  			return nil
 13903  		}
 13904  		return _sqlite3Malloc(tls, uint64(_n))
 13905  	}()
 13906  }
 13907  
 13908  func _sqlite3IoerrnomemError(tls *crt.TLS, _lineno int32) (r0 int32) {
 13909  	return _reportError(tls, int32(3082), _lineno, str(12895))
 13910  }
 13911  
 13912  // C comment
 13913  //  /*
 13914  //  ** Truncate the file.
 13915  //  **
 13916  //  ** If the journal file is already on disk, truncate it there. Or, if it
 13917  //  ** is still in main memory but is being truncated to zero bytes in size,
 13918  //  ** ignore
 13919  //  */
 13920  func _memjrnlTruncate(tls *crt.TLS, _pJfd *Xsqlite3_file, _size int64) (r0 int32) {
 13921  	var _p *XMemJournal
 13922  	_p = (*XMemJournal)(unsafe.Pointer(_pJfd))
 13923  	if func() int32 {
 13924  		if _size == (0) {
 13925  			return int32(1)
 13926  		}
 13927  		return func() int32 {
 13928  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89035), unsafe.Pointer(&_memjrnlTruncateØ00__func__Ø000), unsafe.Pointer(str(4809)))
 13929  			crt.X__builtin_abort(tls)
 13930  			return int32(0)
 13931  		}()
 13932  	}() != 0 {
 13933  		_memjrnlFreeChunks(tls, _p)
 13934  		_p.XnSize = int32(0)
 13935  		*(**XFileChunk)(unsafe.Pointer(&(_p.Xendpoint.XpChunk))) = nil
 13936  		_p.Xendpoint.XiOffset = 0
 13937  		*(**XFileChunk)(unsafe.Pointer(&(_p.Xreadpoint.XpChunk))) = nil
 13938  		_p.Xreadpoint.XiOffset = 0
 13939  	}
 13940  	return int32(0)
 13941  }
 13942  
 13943  var _memjrnlTruncateØ00__func__Ø000 [16]int8
 13944  
 13945  func init() {
 13946  	crt.Xstrncpy(nil, &_memjrnlTruncateØ00__func__Ø000[0], str(12909), 16)
 13947  }
 13948  
 13949  // C comment
 13950  //  /*
 13951  //  ** Sync the file.
 13952  //  **
 13953  //  ** If the real file has been created, call its xSync method. Otherwise,
 13954  //  ** syncing an in-memory journal is a no-op.
 13955  //  */
 13956  func _memjrnlSync(tls *crt.TLS, _pJfd *Xsqlite3_file, _flags int32) (r0 int32) {
 13957  	_ = _flags
 13958  	return int32(0)
 13959  }
 13960  
 13961  // C comment
 13962  //  /*
 13963  //  ** Query the size of the file in bytes.
 13964  //  */
 13965  func _memjrnlFileSize(tls *crt.TLS, _pJfd *Xsqlite3_file, _pSize *int64) (r0 int32) {
 13966  	var _p *XMemJournal
 13967  	_p = (*XMemJournal)(unsafe.Pointer(_pJfd))
 13968  	*_pSize = _p.Xendpoint.XiOffset
 13969  	return int32(0)
 13970  }
 13971  
 13972  // C comment
 13973  //  /*
 13974  //  ** Write a 32-bit integer into the given file descriptor.  Return SQLITE_OK
 13975  //  ** on success or an error code is something goes wrong.
 13976  //  */
 13977  func _write32bits(tls *crt.TLS, _fd *Xsqlite3_file, _offset int64, _val uint32) (r0 int32) {
 13978  	var _ac [4]int8
 13979  	_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(&_ac)))), _val)
 13980  	return _sqlite3OsWrite(tls, _fd, unsafe.Pointer(&_ac), int32(4), _offset)
 13981  
 13982  	_ = _ac
 13983  	panic(0)
 13984  }
 13985  
 13986  func _sqlite3Put4byte(tls *crt.TLS, _p *uint8, _v uint32) {
 13987  	*elem15(_p, 0) = uint8(_v >> 24)
 13988  	*elem15(_p, uintptr(1)) = uint8(_v >> 16)
 13989  	*elem15(_p, uintptr(2)) = uint8(_v >> 8)
 13990  	*elem15(_p, uintptr(3)) = uint8(_v)
 13991  }
 13992  
 13993  // C comment
 13994  //  /*
 13995  //  ** Set the bit number pgno in the PagerSavepoint.pInSavepoint
 13996  //  ** bitvecs of all open savepoints. Return SQLITE_OK if successful
 13997  //  ** or SQLITE_NOMEM if a malloc failure occurs.
 13998  //  */
 13999  func _addToSavepointBitvecs(tls *crt.TLS, _pPager *XPager, _pgno uint32) (r0 int32) {
 14000  	var _ii, _rc int32
 14001  	var _1_p *XPagerSavepoint
 14002  	_rc = int32(0)
 14003  	_ii = int32(0)
 14004  _0:
 14005  	if _ii >= _pPager.XnSavepoint {
 14006  		goto _3
 14007  	}
 14008  	_1_p = elem31((*XPagerSavepoint)(_pPager.XaSavepoint), uintptr(_ii))
 14009  	if _pgno <= _1_p.XnOrig {
 14010  		_rc |= _sqlite3BitvecSet(tls, (*XBitvec)(_1_p.XpInSavepoint), _pgno)
 14011  		func() {
 14012  			if _rc != int32(0) && _rc != int32(7) {
 14013  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48693), unsafe.Pointer(&_addToSavepointBitvecsØ00__func__Ø000), unsafe.Pointer(str(5706)))
 14014  				crt.X__builtin_abort(tls)
 14015  			}
 14016  		}()
 14017  	}
 14018  	_ii += 1
 14019  	goto _0
 14020  _3:
 14021  	return _rc
 14022  }
 14023  
 14024  // C comment
 14025  //  /*
 14026  //  ** Set the i-th bit.  Return 0 on success and an error code if
 14027  //  ** anything goes wrong.
 14028  //  **
 14029  //  ** This routine might cause sub-bitmaps to be allocated.  Failing
 14030  //  ** to get the memory needed to hold the sub-bitmap is the only
 14031  //  ** that can go wrong with an insert, assuming p and i are valid.
 14032  //  **
 14033  //  ** The calling function must ensure that p is a valid Bitvec object
 14034  //  ** and that the value for "i" is within range of the Bitvec object.
 14035  //  ** Otherwise the behavior is undefined.
 14036  //  */
 14037  func _sqlite3BitvecSet(tls *crt.TLS, _p *XBitvec, _i uint32) (r0 int32) {
 14038  	var _8_rc int32
 14039  	var _h, _1_bin, _8_j uint32
 14040  	var _8_aiValues *uint32
 14041  	if _p == nil {
 14042  		return int32(0)
 14043  	}
 14044  	func() {
 14045  		if _i <= (0) {
 14046  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(43881), unsafe.Pointer(&_sqlite3BitvecSetØ00__func__Ø000), unsafe.Pointer(str(12925)))
 14047  			crt.X__builtin_abort(tls)
 14048  		}
 14049  	}()
 14050  	func() {
 14051  		if _i > _p.XiSize {
 14052  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(43882), unsafe.Pointer(&_sqlite3BitvecSetØ00__func__Ø000), unsafe.Pointer(str(12929)))
 14053  			crt.X__builtin_abort(tls)
 14054  		}
 14055  	}()
 14056  	_i -= 1
 14057  _5:
 14058  	if _p.XiSize <= uint32(4000) || _p.XiDivisor == 0 {
 14059  		goto _6
 14060  	}
 14061  	_1_bin = _i / _p.XiDivisor
 14062  	_i = _i % _p.XiDivisor
 14063  	if (*elem32((**XBitvec)(unsafe.Pointer((*[125]unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))), uintptr(_1_bin))) != nil {
 14064  		goto _8
 14065  	}
 14066  	*elem32((**XBitvec)(unsafe.Pointer((*[125]unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))), uintptr(_1_bin)) = _sqlite3BitvecCreate(tls, _p.XiDivisor)
 14067  	if (*elem32((**XBitvec)(unsafe.Pointer((*[125]unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))), uintptr(_1_bin))) == nil {
 14068  		return _sqlite3NomemError(tls, int32(43889))
 14069  	}
 14070  _8:
 14071  	_p = *elem32((**XBitvec)(unsafe.Pointer((*[125]unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))), uintptr(_1_bin))
 14072  	goto _5
 14073  _6:
 14074  	if _p.XiSize <= uint32(4000) {
 14075  		{
 14076  			p := elem15((*uint8)(unsafe.Pointer((*[500]uint8)(unsafe.Pointer(&_p.Xu)))), uintptr(_i/uint32(8)))
 14077  			*p = uint8(int32(*p) | (int32(1) << uint(int32(_i&uint32(7)))))
 14078  		}
 14079  		return int32(0)
 14080  	}
 14081  	_h = (postInc23(&_i, uint32(1)) * uint32(1)) % uint32(125)
 14082  	if (*elem7((*uint32)(unsafe.Pointer((*[125]uint32)(unsafe.Pointer(&_p.Xu)))), uintptr(_h))) != 0 {
 14083  		goto _11
 14084  	}
 14085  	if _p.XnSet < uint32(124) {
 14086  		goto _bitvec_set_end
 14087  	}
 14088  	goto _bitvec_set_rehash
 14089  _11:
 14090  	if (*elem7((*uint32)(unsafe.Pointer((*[125]uint32)(unsafe.Pointer(&_p.Xu)))), uintptr(_h))) == _i {
 14091  		return int32(0)
 14092  	}
 14093  	_h += 1
 14094  	if _h >= uint32(125) {
 14095  		_h = 0
 14096  	}
 14097  	if (*elem7((*uint32)(unsafe.Pointer((*[125]uint32)(unsafe.Pointer(&_p.Xu)))), uintptr(_h))) != 0 {
 14098  		goto _11
 14099  	}
 14100  _bitvec_set_rehash:
 14101  	if _p.XnSet < uint32(62) {
 14102  		goto _bitvec_set_end
 14103  	}
 14104  	_8_aiValues = (*uint32)(_sqlite3DbMallocRaw(tls, nil, uint64(500)))
 14105  	if _8_aiValues == nil {
 14106  		return _sqlite3NomemError(tls, int32(43924))
 14107  	}
 14108  	crt.Xmemcpy(tls, unsafe.Pointer(_8_aiValues), unsafe.Pointer((*[125]uint32)(unsafe.Pointer(&_p.Xu))), uint32(500))
 14109  	crt.Xmemset(tls, unsafe.Pointer((*[125]unsafe.Pointer)(unsafe.Pointer(&_p.Xu))), int32(0), uint32(500))
 14110  	_p.XiDivisor = ((_p.XiSize + uint32(125)) - uint32(1)) / uint32(125)
 14111  	_8_rc = _sqlite3BitvecSet(tls, _p, _i)
 14112  	_8_j = 0
 14113  _20:
 14114  	if _8_j >= uint32(125) {
 14115  		goto _23
 14116  	}
 14117  	if (*elem7(_8_aiValues, uintptr(_8_j))) != 0 {
 14118  		_8_rc |= _sqlite3BitvecSet(tls, _p, *elem7(_8_aiValues, uintptr(_8_j)))
 14119  	}
 14120  	_8_j += 1
 14121  	goto _20
 14122  _23:
 14123  	_sqlite3DbFree(tls, nil, unsafe.Pointer(_8_aiValues))
 14124  	return _8_rc
 14125  
 14126  _bitvec_set_end:
 14127  	_p.XnSet += 1
 14128  	*elem7((*uint32)(unsafe.Pointer((*[125]uint32)(unsafe.Pointer(&_p.Xu)))), uintptr(_h)) = _i
 14129  	return int32(0)
 14130  }
 14131  
 14132  var _sqlite3BitvecSetØ00__func__Ø000 [17]int8
 14133  
 14134  func init() {
 14135  	crt.Xstrncpy(nil, &_sqlite3BitvecSetØ00__func__Ø000[0], str(12941), 17)
 14136  }
 14137  
 14138  // C comment
 14139  //  /*
 14140  //  ** Create a new bitmap object able to handle bits between 0 and iSize,
 14141  //  ** inclusive.  Return a pointer to the new object.  Return NULL if
 14142  //  ** malloc fails.
 14143  //  */
 14144  func _sqlite3BitvecCreate(tls *crt.TLS, _iSize uint32) (r0 *XBitvec) {
 14145  	var _p *XBitvec
 14146  
 14147  	_p = (*XBitvec)(_sqlite3MallocZero(tls, uint64(512)))
 14148  	if _p != nil {
 14149  		_p.XiSize = _iSize
 14150  	}
 14151  	return _p
 14152  }
 14153  
 14154  var _addToSavepointBitvecsØ00__func__Ø000 [22]int8
 14155  
 14156  func init() {
 14157  	crt.Xstrncpy(nil, &_addToSavepointBitvecsØ00__func__Ø000[0], str(12958), 22)
 14158  }
 14159  
 14160  // C comment
 14161  //  /*
 14162  //  ** This is a variant of sqlite3PagerWrite() that runs when the sector size
 14163  //  ** is larger than the page size.  SQLite makes the (reasonable) assumption that
 14164  //  ** all bytes of a sector are written together by hardware.  Hence, all bytes of
 14165  //  ** a sector need to be journalled in case of a power loss in the middle of
 14166  //  ** a write.
 14167  //  **
 14168  //  ** Usually, the sector size is less than or equal to the page size, in which
 14169  //  ** case pages can be individually written.  This routine only runs in the
 14170  //  ** exceptional case where the page size is smaller than the sector size.
 14171  //  */
 14172  func _pagerWriteLargeSector(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
 14173  	var _rc, _nPage, _ii, _needSync int32
 14174  	var _nPageCount, _pg1, _nPagePerSector, _4_pg uint32
 14175  	var _pPager *XPager
 14176  	var _4_pPage, _12_pPage *XPgHdr
 14177  	_rc = int32(0)
 14178  	_nPage = int32(0)
 14179  	_needSync = int32(0)
 14180  	_pPager = (*XPager)(_pPg.XpPager)
 14181  	_nPagePerSector = _pPager.XsectorSize / uint32(_pPager.XpageSize)
 14182  	func() {
 14183  		if _pPager.XmemDb != 0 {
 14184  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52907), unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000), unsafe.Pointer(str(11702)))
 14185  			crt.X__builtin_abort(tls)
 14186  		}
 14187  	}()
 14188  	func() {
 14189  		if (int32(_pPager.XdoNotSpill) & int32(4)) != int32(0) {
 14190  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52908), unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000), unsafe.Pointer(str(12980)))
 14191  			crt.X__builtin_abort(tls)
 14192  		}
 14193  	}()
 14194  	{
 14195  		p := &_pPager.XdoNotSpill
 14196  		*p = uint8(int32(*p) | int32(4))
 14197  	}
 14198  	_pg1 = ((_pPg.Xpgno - uint32(1)) & (^(_nPagePerSector - uint32(1)))) + uint32(1)
 14199  	_nPageCount = _pPager.XdbSize
 14200  	if _pPg.Xpgno > _nPageCount {
 14201  		_nPage = int32((_pPg.Xpgno - _pg1) + uint32(1))
 14202  		goto _7
 14203  	}
 14204  	if ((_pg1 + _nPagePerSector) - uint32(1)) > _nPageCount {
 14205  		_nPage = int32((_nPageCount + uint32(1)) - _pg1)
 14206  		goto _7
 14207  	}
 14208  	_nPage = int32(_nPagePerSector)
 14209  _7:
 14210  	func() {
 14211  		if _nPage <= int32(0) {
 14212  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52925), unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000), unsafe.Pointer(str(13023)))
 14213  			crt.X__builtin_abort(tls)
 14214  		}
 14215  	}()
 14216  	func() {
 14217  		if _pg1 > _pPg.Xpgno {
 14218  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52926), unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000), unsafe.Pointer(str(13031)))
 14219  			crt.X__builtin_abort(tls)
 14220  		}
 14221  	}()
 14222  	func() {
 14223  		if (_pg1 + uint32(_nPage)) <= _pPg.Xpgno {
 14224  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52927), unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000), unsafe.Pointer(str(13046)))
 14225  			crt.X__builtin_abort(tls)
 14226  		}
 14227  	}()
 14228  	_ii = int32(0)
 14229  _14:
 14230  	if _ii >= _nPage || _rc != int32(0) {
 14231  		goto _18
 14232  	}
 14233  	_4_pg = _pg1 + uint32(_ii)
 14234  	if _4_pg != _pPg.Xpgno && _sqlite3BitvecTest(tls, (*XBitvec)(_pPager.XpInJournal), _4_pg) != 0 {
 14235  		goto _20
 14236  	}
 14237  	if _4_pg == uint32((_sqlite3PendingByte/_pPager.XpageSize)+int32(1)) {
 14238  		goto _21
 14239  	}
 14240  	_rc = _sqlite3PagerGet(tls, _pPager, _4_pg, &_4_pPage, int32(0))
 14241  	if _rc != int32(0) {
 14242  		goto _22
 14243  	}
 14244  	_rc = _pager_write(tls, _4_pPage)
 14245  	if (int32(_4_pPage.Xflags) & int32(8)) != 0 {
 14246  		_needSync = int32(1)
 14247  	}
 14248  	_sqlite3PagerUnrefNotNull(tls, _4_pPage)
 14249  _22:
 14250  _21:
 14251  	goto _25
 14252  _20:
 14253  	if store34(&_4_pPage, _sqlite3PagerLookup(tls, _pPager, _4_pg)) == nil {
 14254  		goto _25
 14255  	}
 14256  	if (int32(_4_pPage.Xflags) & int32(8)) != 0 {
 14257  		_needSync = int32(1)
 14258  	}
 14259  	_sqlite3PagerUnrefNotNull(tls, _4_pPage)
 14260  _25:
 14261  	_ii += 1
 14262  	goto _14
 14263  _18:
 14264  	if _rc != int32(0) || _needSync == 0 {
 14265  		goto _28
 14266  	}
 14267  	func() {
 14268  		if _pPager.XmemDb != 0 {
 14269  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52958), unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000), unsafe.Pointer(str(11702)))
 14270  			crt.X__builtin_abort(tls)
 14271  		}
 14272  	}()
 14273  	_ii = int32(0)
 14274  _31:
 14275  	if _ii >= _nPage {
 14276  		goto _34
 14277  	}
 14278  	_12_pPage = _sqlite3PagerLookup(tls, _pPager, _pg1+uint32(_ii))
 14279  	if _12_pPage != nil {
 14280  		{
 14281  			p := &_12_pPage.Xflags
 14282  			*p = uint16(int32(*p) | int32(8))
 14283  		}
 14284  		_sqlite3PagerUnrefNotNull(tls, _12_pPage)
 14285  	}
 14286  	_ii += 1
 14287  	goto _31
 14288  _34:
 14289  _28:
 14290  	func() {
 14291  		if (int32(_pPager.XdoNotSpill) & int32(4)) == int32(0) {
 14292  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52968), unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000), unsafe.Pointer(str(13068)))
 14293  			crt.X__builtin_abort(tls)
 14294  		}
 14295  	}()
 14296  	{
 14297  		p := &_pPager.XdoNotSpill
 14298  		*p = uint8(int32(*p) & int32(-5))
 14299  	}
 14300  	return _rc
 14301  }
 14302  
 14303  var _pagerWriteLargeSectorØ00__func__Ø000 [22]int8
 14304  
 14305  func init() {
 14306  	crt.Xstrncpy(nil, &_pagerWriteLargeSectorØ00__func__Ø000[0], str(13111), 22)
 14307  }
 14308  
 14309  var _sqlite3PendingByte int32
 14310  
 14311  func init() {
 14312  	_sqlite3PendingByte = int32(1073741824)
 14313  }
 14314  
 14315  // C comment
 14316  //  /* Dispatch all page fetch requests to the appropriate getter method.
 14317  //  */
 14318  func _sqlite3PagerGet(tls *crt.TLS, _pPager *XPager, _pgno uint32, _ppPage **XPgHdr, _flags int32) (r0 int32) {
 14319  	return func() func(*crt.TLS, *XPager, uint32, **XPgHdr, int32) int32 {
 14320  		v := _pPager.XxGet
 14321  		return *(*func(*crt.TLS, *XPager, uint32, **XPgHdr, int32) int32)(unsafe.Pointer(&v))
 14322  	}()(tls, _pPager, _pgno, _ppPage, _flags)
 14323  }
 14324  
 14325  // C comment
 14326  //  /*
 14327  //  ** Mark a single data page as writeable. The page is written into the
 14328  //  ** main journal or sub-journal as required. If the page is written into
 14329  //  ** one of the journals, the corresponding bit is set in the
 14330  //  ** Pager.pInJournal bitvec and the PagerSavepoint.pInSavepoint bitvecs
 14331  //  ** of any open savepoints as appropriate.
 14332  //  */
 14333  func _pager_write(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
 14334  	var _rc int32
 14335  	var _pPager *XPager
 14336  	_pPager = (*XPager)(_pPg.XpPager)
 14337  	_rc = int32(0)
 14338  	func() {
 14339  		if int32(_pPager.XeState) != int32(2) && int32(_pPager.XeState) != int32(3) && int32(_pPager.XeState) != int32(4) {
 14340  			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)))
 14341  			crt.X__builtin_abort(tls)
 14342  		}
 14343  	}()
 14344  	func() {
 14345  		if _assert_pager_state(tls, _pPager) == 0 {
 14346  			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)))
 14347  			crt.X__builtin_abort(tls)
 14348  		}
 14349  	}()
 14350  	func() {
 14351  		if _pPager.XerrCode != int32(0) {
 14352  			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)))
 14353  			crt.X__builtin_abort(tls)
 14354  		}
 14355  	}()
 14356  	func() {
 14357  		if int32(_pPager.XreadOnly) != int32(0) {
 14358  			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)))
 14359  			crt.X__builtin_abort(tls)
 14360  		}
 14361  	}()
 14362  	if int32(_pPager.XeState) != int32(2) {
 14363  		goto _10
 14364  	}
 14365  	_rc = _pager_open_journal(tls, _pPager)
 14366  	if _rc != int32(0) {
 14367  		return _rc
 14368  	}
 14369  _10:
 14370  	func() {
 14371  		if int32(_pPager.XeState) < int32(3) {
 14372  			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)))
 14373  			crt.X__builtin_abort(tls)
 14374  		}
 14375  	}()
 14376  	func() {
 14377  		if _assert_pager_state(tls, _pPager) == 0 {
 14378  			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)))
 14379  			crt.X__builtin_abort(tls)
 14380  		}
 14381  	}()
 14382  	_sqlite3PcacheMakeDirty(tls, _pPg)
 14383  	func() {
 14384  		if ((*XBitvec)(_pPager.XpInJournal) != nil) != ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) != nil) {
 14385  			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)))
 14386  			crt.X__builtin_abort(tls)
 14387  		}
 14388  	}()
 14389  	if (*XBitvec)(_pPager.XpInJournal) == nil || _sqlite3BitvecTestNotNull(tls, (*XBitvec)(_pPager.XpInJournal), _pPg.Xpgno) != int32(0) {
 14390  		goto _19
 14391  	}
 14392  	func() {
 14393  		if bool2int((*XWal)(_pPager.XpWal) != nil) != int32(0) {
 14394  			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)))
 14395  			crt.X__builtin_abort(tls)
 14396  		}
 14397  	}()
 14398  	if _pPg.Xpgno > _pPager.XdbOrigSize {
 14399  		goto _22
 14400  	}
 14401  	_rc = _pagerAddPageToRollbackJournal(tls, _pPg)
 14402  	if _rc != int32(0) {
 14403  		return _rc
 14404  	}
 14405  	goto _24
 14406  _22:
 14407  	if int32(_pPager.XeState) != int32(4) {
 14408  		{
 14409  			p := &_pPg.Xflags
 14410  			*p = uint16(int32(*p) | int32(8))
 14411  		}
 14412  	}
 14413  _24:
 14414  _19:
 14415  	{
 14416  		p := &_pPg.Xflags
 14417  		*p = uint16(int32(*p) | int32(4))
 14418  	}
 14419  	if _pPager.XnSavepoint > int32(0) {
 14420  		_rc = _subjournalPageIfRequired(tls, _pPg)
 14421  	}
 14422  	if _pPager.XdbSize < _pPg.Xpgno {
 14423  		_pPager.XdbSize = _pPg.Xpgno
 14424  	}
 14425  	return _rc
 14426  }
 14427  
 14428  var _pager_writeØ00__func__Ø000 [12]int8
 14429  
 14430  func init() {
 14431  	crt.Xstrncpy(nil, &_pager_writeØ00__func__Ø000[0], str(13395), 12)
 14432  }
 14433  
 14434  // C comment
 14435  //  /*
 14436  //  ** This function is called at the start of every write transaction.
 14437  //  ** There must already be a RESERVED or EXCLUSIVE lock on the database
 14438  //  ** file when this routine is called.
 14439  //  **
 14440  //  ** Open the journal file for pager pPager and write a journal header
 14441  //  ** to the start of it. If there are active savepoints, open the sub-journal
 14442  //  ** as well. This function is only used when the journal file is being
 14443  //  ** opened to write a rollback log for a transaction. It is not used
 14444  //  ** when opening a hot journal file to roll it back.
 14445  //  **
 14446  //  ** If the journal file is already open (as it may be in exclusive mode),
 14447  //  ** then this function just writes a journal header to the start of the
 14448  //  ** already open file.
 14449  //  **
 14450  //  ** Whether or not the journal file is opened by this function, the
 14451  //  ** Pager.pInJournal bitvec structure is allocated.
 14452  //  **
 14453  //  ** Return SQLITE_OK if everything is successful. Otherwise, return
 14454  //  ** SQLITE_NOMEM if the attempt to allocate Pager.pInJournal fails, or
 14455  //  ** an IO error code if opening or writing the journal file fails.
 14456  //  */
 14457  func _pager_open_journal(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 14458  	var _rc, _5_flags, _5_nSpill int32
 14459  	var _pVfs *Xsqlite3_vfs
 14460  	_rc = int32(0)
 14461  	_pVfs = (*Xsqlite3_vfs)(_pPager.XpVfs)
 14462  	func() {
 14463  		if int32(_pPager.XeState) != int32(2) {
 14464  			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)))
 14465  			crt.X__builtin_abort(tls)
 14466  		}
 14467  	}()
 14468  	func() {
 14469  		if _assert_pager_state(tls, _pPager) == 0 {
 14470  			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)))
 14471  			crt.X__builtin_abort(tls)
 14472  		}
 14473  	}()
 14474  	func() {
 14475  		if (*XBitvec)(_pPager.XpInJournal) != nil {
 14476  			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)))
 14477  			crt.X__builtin_abort(tls)
 14478  		}
 14479  	}()
 14480  	if func() int32 {
 14481  		if _pPager.XerrCode != 0 {
 14482  			return func() int32 {
 14483  				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)))
 14484  				crt.X__builtin_abort(tls)
 14485  				return int32(1)
 14486  			}()
 14487  		}
 14488  		return int32(0)
 14489  	}() != 0 {
 14490  		return _pPager.XerrCode
 14491  	}
 14492  	if (*XWal)(_pPager.XpWal) != nil || int32(_pPager.XjournalMode) == int32(2) {
 14493  		goto _10
 14494  	}
 14495  	*(**XBitvec)(unsafe.Pointer(&_pPager.XpInJournal)) = _sqlite3BitvecCreate(tls, _pPager.XdbSize)
 14496  	if (*XBitvec)(_pPager.XpInJournal) == nil {
 14497  		return _sqlite3NomemError(tls, int32(52602))
 14498  	}
 14499  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) != nil {
 14500  		goto _12
 14501  	}
 14502  	if int32(_pPager.XjournalMode) == int32(4) {
 14503  		_sqlite3MemJournalOpen(tls, (*Xsqlite3_file)(_pPager.Xjfd))
 14504  		goto _14
 14505  	}
 14506  	_5_flags = int32(6)
 14507  	if _pPager.XtempFile != 0 {
 14508  		_5_flags |= int32(4104)
 14509  		_5_nSpill = _sqlite3Config.XnStmtSpill
 14510  		goto _16
 14511  	}
 14512  	_5_flags |= int32(2048)
 14513  	_5_nSpill = int32(0)
 14514  _16:
 14515  	_rc = _databaseIsUnmoved(tls, _pPager)
 14516  	if _rc == int32(0) {
 14517  		_rc = _sqlite3JournalOpen(tls, _pVfs, _pPager.XzJournal, (*Xsqlite3_file)(_pPager.Xjfd), _5_flags, _5_nSpill)
 14518  	}
 14519  _14:
 14520  	func() {
 14521  		if _rc == int32(0) && (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil {
 14522  			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)))
 14523  			crt.X__builtin_abort(tls)
 14524  		}
 14525  	}()
 14526  _12:
 14527  	if _rc == int32(0) {
 14528  		_pPager.XnRec = int32(0)
 14529  		_pPager.XjournalOff = 0
 14530  		_pPager.XsetMaster = 0
 14531  		_pPager.XjournalHdr = 0
 14532  		_rc = _writeJournalHdr(tls, _pPager)
 14533  	}
 14534  _10:
 14535  	if _rc != int32(0) {
 14536  		_sqlite3BitvecDestroy(tls, (*XBitvec)(_pPager.XpInJournal))
 14537  		*(**XBitvec)(unsafe.Pointer(&_pPager.XpInJournal)) = nil
 14538  		goto _23
 14539  	}
 14540  	func() {
 14541  		if int32(_pPager.XeState) != int32(2) {
 14542  			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)))
 14543  			crt.X__builtin_abort(tls)
 14544  		}
 14545  	}()
 14546  	_pPager.XeState = uint8(3)
 14547  _23:
 14548  	return _rc
 14549  }
 14550  
 14551  var _pager_open_journalØ00__func__Ø000 [19]int8
 14552  
 14553  func init() {
 14554  	crt.Xstrncpy(nil, &_pager_open_journalØ00__func__Ø000[0], str(13502), 19)
 14555  }
 14556  
 14557  // C comment
 14558  //  /*
 14559  //  ** Open an in-memory journal file.
 14560  //  */
 14561  func _sqlite3MemJournalOpen(tls *crt.TLS, _pJfd *Xsqlite3_file) {
 14562  	_sqlite3JournalOpen(tls, nil, nil, _pJfd, int32(0), int32(-1))
 14563  }
 14564  
 14565  // C comment
 14566  //  /* Verify that the database file has not be deleted or renamed out from
 14567  //  ** under the pager.  Return SQLITE_OK if the database is still were it ought
 14568  //  ** to be on disk.  Return non-zero (SQLITE_READONLY_DBMOVED or some other error
 14569  //  ** code from sqlite3OsAccess()) if the database has gone missing.
 14570  //  */
 14571  func _databaseIsUnmoved(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 14572  	var _bHasMoved, _rc int32
 14573  	_bHasMoved = int32(0)
 14574  	if _pPager.XtempFile != 0 {
 14575  		return int32(0)
 14576  	}
 14577  	if _pPager.XdbSize == (0) {
 14578  		return int32(0)
 14579  	}
 14580  	func() {
 14581  		if _pPager.XzFilename == nil || (*elem1(_pPager.XzFilename, 0)) == 0 {
 14582  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51865), unsafe.Pointer(&_databaseIsUnmovedØ00__func__Ø000), unsafe.Pointer(str(13521)))
 14583  			crt.X__builtin_abort(tls)
 14584  		}
 14585  	}()
 14586  	_rc = _sqlite3OsFileControl(tls, (*Xsqlite3_file)(_pPager.Xfd), int32(20), unsafe.Pointer(&_bHasMoved))
 14587  	if _rc == int32(12) {
 14588  		_rc = int32(0)
 14589  		goto _8
 14590  	}
 14591  	if (_rc == int32(0)) && _bHasMoved != 0 {
 14592  		_rc = int32(1032)
 14593  	}
 14594  _8:
 14595  	return _rc
 14596  }
 14597  
 14598  var _databaseIsUnmovedØ00__func__Ø000 [18]int8
 14599  
 14600  func init() {
 14601  	crt.Xstrncpy(nil, &_databaseIsUnmovedØ00__func__Ø000[0], str(13563), 18)
 14602  }
 14603  
 14604  // C comment
 14605  //  /*
 14606  //  ** Use sqlite3OsFileControl() when we are doing something that might fail
 14607  //  ** and we need to know about the failures.  Use sqlite3OsFileControlHint()
 14608  //  ** when simply tossing information over the wall to the VFS and we do not
 14609  //  ** really care if the VFS receives and understands the information since it
 14610  //  ** is only a hint and can be safely ignored.  The sqlite3OsFileControlHint()
 14611  //  ** routine has no return value since the return value would be meaningless.
 14612  //  */
 14613  func _sqlite3OsFileControl(tls *crt.TLS, _id *Xsqlite3_file, _op int32, _pArg unsafe.Pointer) (r0 int32) {
 14614  	return func() func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32 {
 14615  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxFileControl
 14616  		return *(*func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32)(unsafe.Pointer(&v))
 14617  	}()(tls, _id, _op, _pArg)
 14618  }
 14619  
 14620  // C comment
 14621  //  /*
 14622  //  ** The journal file must be open when this routine is called. A journal
 14623  //  ** header (JOURNAL_HDR_SZ bytes) is written into the journal file at the
 14624  //  ** current location.
 14625  //  **
 14626  //  ** The format for the journal header is as follows:
 14627  //  ** - 8 bytes: Magic identifying journal format.
 14628  //  ** - 4 bytes: Number of records in journal, or -1 no-sync mode is on.
 14629  //  ** - 4 bytes: Random number used for page hash.
 14630  //  ** - 4 bytes: Initial database page count.
 14631  //  ** - 4 bytes: Sector size used by the process that wrote this journal.
 14632  //  ** - 4 bytes: Database page size.
 14633  //  **
 14634  //  ** Followed by (JOURNAL_HDR_SZ - 28) bytes of unused space.
 14635  //  */
 14636  func _writeJournalHdr(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 14637  	var _rc, _ii int32
 14638  	var _nHeader, _nWrite uint32
 14639  	var _zHeader *int8
 14640  	_rc = int32(0)
 14641  	_zHeader = _pPager.XpTmpSpace
 14642  	_nHeader = uint32(_pPager.XpageSize)
 14643  	func() {
 14644  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil {
 14645  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48342), unsafe.Pointer(&_writeJournalHdrØ00__func__Ø000), unsafe.Pointer(str(13581)))
 14646  			crt.X__builtin_abort(tls)
 14647  		}
 14648  	}()
 14649  	if _nHeader > _pPager.XsectorSize {
 14650  		_nHeader = _pPager.XsectorSize
 14651  	}
 14652  	_ii = int32(0)
 14653  _3:
 14654  	if _ii >= _pPager.XnSavepoint {
 14655  		goto _6
 14656  	}
 14657  	if (elem31((*XPagerSavepoint)(_pPager.XaSavepoint), uintptr(_ii)).XiHdrOffset) == (0) {
 14658  		elem31((*XPagerSavepoint)(_pPager.XaSavepoint), uintptr(_ii)).XiHdrOffset = _pPager.XjournalOff
 14659  	}
 14660  	_ii += 1
 14661  	goto _3
 14662  _6:
 14663  	_pPager.XjournalHdr = store35(&_pPager.XjournalOff, _journalHdrOffset(tls, _pPager))
 14664  	func() {
 14665  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil && _pPager.XnoSync == 0 {
 14666  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48380), unsafe.Pointer(&_writeJournalHdrØ00__func__Ø000), unsafe.Pointer(str(13601)))
 14667  			crt.X__builtin_abort(tls)
 14668  		}
 14669  	}()
 14670  	if ((_pPager.XnoSync != 0) || (int32(_pPager.XjournalMode) == int32(4))) || (_sqlite3OsDeviceCharacteristics(tls, (*Xsqlite3_file)(_pPager.Xfd))&int32(512)) != 0 {
 14671  		crt.Xmemcpy(tls, unsafe.Pointer(_zHeader), unsafe.Pointer(&_aJournalMagic), uint32(8))
 14672  		_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(elem1(_zHeader, uintptr(8)))), uint32(4294967295))
 14673  		goto _14
 14674  	}
 14675  	crt.Xmemset(tls, unsafe.Pointer(_zHeader), int32(0), uint32(12))
 14676  _14:
 14677  	Xsqlite3_randomness(tls, int32(4), unsafe.Pointer(&_pPager.XcksumInit))
 14678  	_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(elem1(_zHeader, uintptr(12)))), _pPager.XcksumInit)
 14679  	_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(elem1(_zHeader, uintptr(16)))), _pPager.XdbOrigSize)
 14680  	_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(elem1(_zHeader, uintptr(20)))), _pPager.XsectorSize)
 14681  	_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(elem1(_zHeader, uintptr(24)))), uint32(_pPager.XpageSize))
 14682  	crt.Xmemset(tls, unsafe.Pointer(elem1(_zHeader, uintptr(28))), int32(0), _nHeader-uint32(28))
 14683  	_nWrite = 0
 14684  _15:
 14685  	if _rc != int32(0) || _nWrite >= _pPager.XsectorSize {
 14686  		goto _19
 14687  	}
 14688  	_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.Xjfd), unsafe.Pointer(_zHeader), int32(_nHeader), _pPager.XjournalOff)
 14689  	func() {
 14690  		if _pPager.XjournalHdr > _pPager.XjournalOff {
 14691  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48429), unsafe.Pointer(&_writeJournalHdrØ00__func__Ø000), unsafe.Pointer(str(13638)))
 14692  			crt.X__builtin_abort(tls)
 14693  		}
 14694  	}()
 14695  	_pPager.XjournalOff += int64(_nHeader)
 14696  	_nWrite += _nHeader
 14697  	goto _15
 14698  _19:
 14699  	return _rc
 14700  }
 14701  
 14702  var _writeJournalHdrØ00__func__Ø000 [16]int8
 14703  
 14704  func init() {
 14705  	crt.Xstrncpy(nil, &_writeJournalHdrØ00__func__Ø000[0], str(13679), 16)
 14706  }
 14707  
 14708  // C comment
 14709  //  /*
 14710  //  ** Return the offset of the sector boundary at or immediately
 14711  //  ** following the value in pPager->journalOff, assuming a sector
 14712  //  ** size of pPager->sectorSize bytes.
 14713  //  **
 14714  //  ** i.e for a sector size of 512:
 14715  //  **
 14716  //  **   Pager.journalOff          Return value
 14717  //  **   ---------------------------------------
 14718  //  **   0                         0
 14719  //  **   512                       512
 14720  //  **   100                       512
 14721  //  **   2000                      2048
 14722  //  **
 14723  //  */
 14724  func _journalHdrOffset(tls *crt.TLS, _pPager *XPager) (r0 int64) {
 14725  	var _offset, _c int64
 14726  	_offset = int64(0)
 14727  	_c = _pPager.XjournalOff
 14728  	if _c != 0 {
 14729  		_offset = (((_c - int64(1)) / int64(_pPager.XsectorSize)) + int64(1)) * int64(_pPager.XsectorSize)
 14730  	}
 14731  	func() {
 14732  		if (_offset % int64(_pPager.XsectorSize)) != (0) {
 14733  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48258), unsafe.Pointer(&_journalHdrOffsetØ00__func__Ø000), unsafe.Pointer(str(13695)))
 14734  			crt.X__builtin_abort(tls)
 14735  		}
 14736  	}()
 14737  	func() {
 14738  		if _offset < _c {
 14739  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48259), unsafe.Pointer(&_journalHdrOffsetØ00__func__Ø000), unsafe.Pointer(str(13728)))
 14740  			crt.X__builtin_abort(tls)
 14741  		}
 14742  	}()
 14743  	func() {
 14744  		if (_offset - _c) >= int64(_pPager.XsectorSize) {
 14745  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48260), unsafe.Pointer(&_journalHdrOffsetØ00__func__Ø000), unsafe.Pointer(str(13738)))
 14746  			crt.X__builtin_abort(tls)
 14747  		}
 14748  	}()
 14749  	return _offset
 14750  }
 14751  
 14752  var _journalHdrOffsetØ00__func__Ø000 [17]int8
 14753  
 14754  func init() {
 14755  	crt.Xstrncpy(nil, &_journalHdrOffsetØ00__func__Ø000[0], str(13772), 17)
 14756  }
 14757  
 14758  func _sqlite3OsDeviceCharacteristics(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) {
 14759  	return func() func(*crt.TLS, *Xsqlite3_file) int32 {
 14760  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxDeviceCharacteristics
 14761  		return *(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&v))
 14762  	}()(tls, _id)
 14763  }
 14764  
 14765  // C comment
 14766  //  /*
 14767  //  ** Journal files begin with the following magic string.  The data
 14768  //  ** was obtained from /dev/random.  It is used only as a sanity check.
 14769  //  **
 14770  //  ** Since version 2.8.0, the journal format contains additional sanity
 14771  //  ** checking information.  If the power fails while the journal is being
 14772  //  ** written, semi-random garbage data might appear in the journal
 14773  //  ** file after power is restored.  If an attempt is then made
 14774  //  ** to roll the journal back, the database could be corrupted.  The additional
 14775  //  ** sanity checking data is an attempt to discover the garbage in the
 14776  //  ** journal and ignore it.
 14777  //  **
 14778  //  ** The sanity checking information for the new journal format consists
 14779  //  ** of a 32-bit checksum on each page of data.  The checksum covers both
 14780  //  ** the page number and the pPager->pageSize bytes of data for the page.
 14781  //  ** This cksum is initialized to a 32-bit random value that appears in the
 14782  //  ** journal file right after the header.  The random initializer is important,
 14783  //  ** because garbage data that appears at the end of a journal is likely
 14784  //  ** data that was once in other files that have now been deleted.  If the
 14785  //  ** garbage data came from an obsolete journal file, the checksums might
 14786  //  ** be correct.  But by initializing the checksum to random value which
 14787  //  ** is different for every journal, we minimize that risk.
 14788  //  */
 14789  var _aJournalMagic [8]uint8
 14790  
 14791  func init() {
 14792  	_aJournalMagic = [8]uint8{217, 213, 5, 249, 32, 161, 99, 215}
 14793  }
 14794  
 14795  // C comment
 14796  //  /*
 14797  //  ** Return N random bytes.
 14798  //  */
 14799  func Xsqlite3_randomness(tls *crt.TLS, _N int32, _pBuf unsafe.Pointer) {
 14800  	var _2_i int32
 14801  	var _t uint8
 14802  	var _zBuf *uint8
 14803  	var _mutex *Xsqlite3_mutex
 14804  	var _2_k [256]int8
 14805  	_zBuf = (*uint8)(_pBuf)
 14806  	if Xsqlite3_initialize(tls) != 0 {
 14807  		return
 14808  	}
 14809  	_mutex = _sqlite3MutexAlloc(tls, int32(5))
 14810  	Xsqlite3_mutex_enter(tls, _mutex)
 14811  	if (_N <= int32(0)) || (_pBuf == nil) {
 14812  		_sqlite3Prng.XisInit = 0
 14813  		Xsqlite3_mutex_leave(tls, _mutex)
 14814  		return
 14815  	}
 14816  	if _sqlite3Prng.XisInit != 0 {
 14817  		goto _3
 14818  	}
 14819  	_sqlite3Prng.Xj = 0
 14820  	_sqlite3Prng.Xi = 0
 14821  	_sqlite3OsRandomness(tls, Xsqlite3_vfs_find(tls, nil), int32(256), (*int8)(unsafe.Pointer(&_2_k)))
 14822  	_2_i = int32(0)
 14823  _4:
 14824  	if _2_i >= int32(256) {
 14825  		goto _7
 14826  	}
 14827  	*elem15((*uint8)(unsafe.Pointer(&_sqlite3Prng.Xs)), uintptr(_2_i)) = uint8(_2_i)
 14828  	_2_i += 1
 14829  	goto _4
 14830  _7:
 14831  	_2_i = int32(0)
 14832  _8:
 14833  	if _2_i >= int32(256) {
 14834  		goto _11
 14835  	}
 14836  	{
 14837  		p := &_sqlite3Prng.Xj
 14838  		*p = uint8(int32(*p) + (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3Prng.Xs)), uintptr(_2_i))) + int32(*elem1((*int8)(unsafe.Pointer(&_2_k)), uintptr(_2_i)))))
 14839  	}
 14840  	_t = *elem15((*uint8)(unsafe.Pointer(&_sqlite3Prng.Xs)), uintptr(_sqlite3Prng.Xj))
 14841  	*elem15((*uint8)(unsafe.Pointer(&_sqlite3Prng.Xs)), uintptr(_sqlite3Prng.Xj)) = *elem15((*uint8)(unsafe.Pointer(&_sqlite3Prng.Xs)), uintptr(_2_i))
 14842  	*elem15((*uint8)(unsafe.Pointer(&_sqlite3Prng.Xs)), uintptr(_2_i)) = _t
 14843  	_2_i += 1
 14844  	goto _8
 14845  _11:
 14846  	_sqlite3Prng.XisInit = uint8(1)
 14847  _3:
 14848  	func() {
 14849  		if _N <= int32(0) {
 14850  			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)))
 14851  			crt.X__builtin_abort(tls)
 14852  		}
 14853  	}()
 14854  _14:
 14855  	_sqlite3Prng.Xi += 1
 14856  	_t = *elem15((*uint8)(unsafe.Pointer(&_sqlite3Prng.Xs)), uintptr(_sqlite3Prng.Xi))
 14857  	{
 14858  		p := &_sqlite3Prng.Xj
 14859  		*p = uint8(int32(*p) + int32(_t))
 14860  	}
 14861  	*elem15((*uint8)(unsafe.Pointer(&_sqlite3Prng.Xs)), uintptr(_sqlite3Prng.Xi)) = *elem15((*uint8)(unsafe.Pointer(&_sqlite3Prng.Xs)), uintptr(_sqlite3Prng.Xj))
 14862  	*elem15((*uint8)(unsafe.Pointer(&_sqlite3Prng.Xs)), uintptr(_sqlite3Prng.Xj)) = _t
 14863  	{
 14864  		p := &_t
 14865  		*p = uint8(int32(*p) + int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3Prng.Xs)), uintptr(_sqlite3Prng.Xi))))
 14866  	}
 14867  	*postInc15(&_zBuf, 1) = *elem15((*uint8)(unsafe.Pointer(&_sqlite3Prng.Xs)), uintptr(_t))
 14868  	if preInc2(&_N, -1) != 0 {
 14869  		goto _14
 14870  	}
 14871  	Xsqlite3_mutex_leave(tls, _mutex)
 14872  	_ = _zBuf
 14873  	_ = _2_k
 14874  }
 14875  
 14876  // C comment
 14877  //  /* All threads share a single random number generator.
 14878  //  ** This structure is the current state of the generator.
 14879  //  */
 14880  var _sqlite3Prng Tsqlite3PrngType
 14881  
 14882  // C comment
 14883  //  /* SQLITE_OMIT_LOAD_EXTENSION */
 14884  func _sqlite3OsRandomness(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _nByte int32, _zBufOut *int8) (r0 int32) {
 14885  	return func() func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32 {
 14886  		v := _pVfs.XxRandomness
 14887  		return *(*func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32)(unsafe.Pointer(&v))
 14888  	}()(tls, _pVfs, _nByte, _zBufOut)
 14889  }
 14890  
 14891  // C comment
 14892  //  /*
 14893  //  ** Locate a VFS by name.  If no name is given, simply return the
 14894  //  ** first VFS on the list.
 14895  //  */
 14896  func Xsqlite3_vfs_find(tls *crt.TLS, _zVfs *int8) (r0 *Xsqlite3_vfs) {
 14897  	var _rc int32
 14898  	var _mutex *Xsqlite3_mutex
 14899  	var _pVfs *Xsqlite3_vfs
 14900  	_pVfs = nil
 14901  	_rc = Xsqlite3_initialize(tls)
 14902  	if _rc != 0 {
 14903  		return nil
 14904  	}
 14905  	_mutex = _sqlite3MutexAlloc(tls, int32(2))
 14906  	Xsqlite3_mutex_enter(tls, _mutex)
 14907  	_pVfs = _vfsList
 14908  _1:
 14909  	if _pVfs == nil {
 14910  		goto _4
 14911  	}
 14912  	if _zVfs == nil {
 14913  		goto _4
 14914  	}
 14915  	if crt.Xstrcmp(tls, _zVfs, _pVfs.XzName) == int32(0) {
 14916  		goto _4
 14917  	}
 14918  	_pVfs = (*Xsqlite3_vfs)(_pVfs.XpNext)
 14919  	goto _1
 14920  _4:
 14921  	Xsqlite3_mutex_leave(tls, _mutex)
 14922  	return _pVfs
 14923  }
 14924  
 14925  // C comment
 14926  //  /*
 14927  //  ** The list of all registered VFS implementations.
 14928  //  */
 14929  var _vfsList *Xsqlite3_vfs
 14930  
 14931  var _sqlite3_randomnessØ00__func__Ø000 [19]int8
 14932  
 14933  func init() {
 14934  	crt.Xstrncpy(nil, &_sqlite3_randomnessØ00__func__Ø000[0], str(13793), 19)
 14935  }
 14936  
 14937  // C comment
 14938  //  /*
 14939  //  ** Destroy a bitmap object.  Reclaim all memory used.
 14940  //  */
 14941  func _sqlite3BitvecDestroy(tls *crt.TLS, _p *XBitvec) {
 14942  	var _1_i uint32
 14943  	if _p == nil {
 14944  		return
 14945  	}
 14946  	if _p.XiDivisor == 0 {
 14947  		goto _1
 14948  	}
 14949  	_1_i = 0
 14950  _2:
 14951  	if _1_i >= uint32(125) {
 14952  		goto _5
 14953  	}
 14954  	_sqlite3BitvecDestroy(tls, *elem32((**XBitvec)(unsafe.Pointer((*[125]unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))), uintptr(_1_i)))
 14955  	_1_i += 1
 14956  	goto _2
 14957  _5:
 14958  _1:
 14959  	Xsqlite3_free(tls, unsafe.Pointer(_p))
 14960  }
 14961  
 14962  // C comment
 14963  //  /*
 14964  //  ** Make sure the page is marked as dirty. If it isn't dirty already,
 14965  //  ** make it so.
 14966  //  */
 14967  func _sqlite3PcacheMakeDirty(tls *crt.TLS, _p *XPgHdr) {
 14968  	func() {
 14969  		if int32(_p.XnRef) <= int32(0) {
 14970  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44679), unsafe.Pointer(&_sqlite3PcacheMakeDirtyØ00__func__Ø000), unsafe.Pointer(str(13812)))
 14971  			crt.X__builtin_abort(tls)
 14972  		}
 14973  	}()
 14974  	func() {
 14975  		if _sqlite3PcachePageSanity(tls, _p) == 0 {
 14976  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44680), unsafe.Pointer(&_sqlite3PcacheMakeDirtyØ00__func__Ø000), unsafe.Pointer(str(13822)))
 14977  			crt.X__builtin_abort(tls)
 14978  		}
 14979  	}()
 14980  	if (int32(_p.Xflags) & int32(17)) == 0 {
 14981  		goto _4
 14982  	}
 14983  	{
 14984  		p := &_p.Xflags
 14985  		*p = uint16(int32(*p) & int32(-17))
 14986  	}
 14987  	if (int32(_p.Xflags) & int32(1)) != 0 {
 14988  		{
 14989  			p := &_p.Xflags
 14990  			*p = uint16(int32(*p) ^ int32(3))
 14991  		}
 14992  		func() {
 14993  			if (int32(_p.Xflags) & int32(3)) != int32(2) {
 14994  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44686), unsafe.Pointer(&_sqlite3PcacheMakeDirtyØ00__func__Ø000), unsafe.Pointer(str(13849)))
 14995  				crt.X__builtin_abort(tls)
 14996  			}
 14997  		}()
 14998  		_pcacheManageDirtyList(tls, _p, uint8(2))
 14999  	}
 15000  	func() {
 15001  		if _sqlite3PcachePageSanity(tls, _p) == 0 {
 15002  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44689), unsafe.Pointer(&_sqlite3PcacheMakeDirtyØ00__func__Ø000), unsafe.Pointer(str(13822)))
 15003  			crt.X__builtin_abort(tls)
 15004  		}
 15005  	}()
 15006  _4:
 15007  }
 15008  
 15009  var _sqlite3PcacheMakeDirtyØ00__func__Ø000 [23]int8
 15010  
 15011  func init() {
 15012  	crt.Xstrncpy(nil, &_sqlite3PcacheMakeDirtyØ00__func__Ø000[0], str(13901), 23)
 15013  }
 15014  
 15015  // C comment
 15016  //  /* Check invariants on a PgHdr object */
 15017  func _sqlite3PcachePageSanity(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
 15018  	var _pCache *XPCache
 15019  	func() {
 15020  		if _pPg == nil {
 15021  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44233), unsafe.Pointer(&_sqlite3PcachePageSanityØ00__func__Ø000), unsafe.Pointer(str(13924)))
 15022  			crt.X__builtin_abort(tls)
 15023  		}
 15024  	}()
 15025  	func() {
 15026  		if _pPg.Xpgno <= (0) && (*XPager)(_pPg.XpPager) != nil {
 15027  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44234), unsafe.Pointer(&_sqlite3PcachePageSanityØ00__func__Ø000), unsafe.Pointer(str(13931)))
 15028  			crt.X__builtin_abort(tls)
 15029  		}
 15030  	}()
 15031  	_pCache = (*XPCache)(_pPg.XpCache)
 15032  	func() {
 15033  		if _pCache == nil {
 15034  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44236), unsafe.Pointer(&_sqlite3PcachePageSanityØ00__func__Ø000), unsafe.Pointer(str(13961)))
 15035  			crt.X__builtin_abort(tls)
 15036  		}
 15037  	}()
 15038  	if (int32(_pPg.Xflags) & int32(1)) != 0 {
 15039  		func() {
 15040  			if (int32(_pPg.Xflags) & int32(2)) != int32(0) {
 15041  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44238), unsafe.Pointer(&_sqlite3PcachePageSanityØ00__func__Ø000), unsafe.Pointer(str(13971)))
 15042  				crt.X__builtin_abort(tls)
 15043  			}
 15044  		}()
 15045  		func() {
 15046  			if (*XPgHdr)(_pCache.XpDirty) == _pPg {
 15047  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44239), unsafe.Pointer(&_sqlite3PcachePageSanityØ00__func__Ø000), unsafe.Pointer(str(14001)))
 15048  				crt.X__builtin_abort(tls)
 15049  			}
 15050  		}()
 15051  		func() {
 15052  			if (*XPgHdr)(_pCache.XpDirtyTail) == _pPg {
 15053  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44240), unsafe.Pointer(&_sqlite3PcachePageSanityØ00__func__Ø000), unsafe.Pointer(str(14021)))
 15054  				crt.X__builtin_abort(tls)
 15055  			}
 15056  		}()
 15057  	}
 15058  	if (int32(_pPg.Xflags) & int32(4)) != 0 {
 15059  		func() {
 15060  			if (int32(_pPg.Xflags) & int32(2)) == 0 {
 15061  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44244), unsafe.Pointer(&_sqlite3PcachePageSanityØ00__func__Ø000), unsafe.Pointer(str(14045)))
 15062  				crt.X__builtin_abort(tls)
 15063  			}
 15064  		}()
 15065  	}
 15066  	return int32(1)
 15067  }
 15068  
 15069  var _sqlite3PcachePageSanityØ00__func__Ø000 [24]int8
 15070  
 15071  func init() {
 15072  	crt.Xstrncpy(nil, &_sqlite3PcachePageSanityØ00__func__Ø000[0], str(14070), 24)
 15073  }
 15074  
 15075  // C comment
 15076  //  /*
 15077  //  ** Manage pPage's participation on the dirty list.  Bits of the addRemove
 15078  //  ** argument determines what operation to do.  The 0x01 bit means first
 15079  //  ** remove pPage from the dirty list.  The 0x02 means add pPage back to
 15080  //  ** the dirty list.  Doing both moves pPage to the front of the dirty list.
 15081  //  */
 15082  func _pcacheManageDirtyList(tls *crt.TLS, _pPage *XPgHdr, _addRemove uint8) {
 15083  	var _p *XPCache
 15084  	_p = (*XPCache)(_pPage.XpCache)
 15085  	if (int32(_addRemove) & int32(1)) == 0 {
 15086  		goto _0
 15087  	}
 15088  	func() {
 15089  		if _pPage.XpDirtyNext == nil && _pPage != (*XPgHdr)(_p.XpDirtyTail) {
 15090  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44288), unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000), unsafe.Pointer(str(14094)))
 15091  			crt.X__builtin_abort(tls)
 15092  		}
 15093  	}()
 15094  	func() {
 15095  		if _pPage.XpDirtyPrev == nil && _pPage != (*XPgHdr)(_p.XpDirty) {
 15096  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44289), unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000), unsafe.Pointer(str(14136)))
 15097  			crt.X__builtin_abort(tls)
 15098  		}
 15099  	}()
 15100  	if (*XPgHdr)(_p.XpSynced) == _pPage {
 15101  		*(**XPgHdr)(unsafe.Pointer(&_p.XpSynced)) = (*XPgHdr)(_pPage.XpDirtyPrev)
 15102  	}
 15103  	if _pPage.XpDirtyNext != nil {
 15104  		*(**XPgHdr)(unsafe.Pointer(&((*XPgHdr)(_pPage.XpDirtyNext).XpDirtyPrev))) = (*XPgHdr)(_pPage.XpDirtyPrev)
 15105  		goto _9
 15106  	}
 15107  	func() {
 15108  		if _pPage != (*XPgHdr)(_p.XpDirtyTail) {
 15109  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44299), unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000), unsafe.Pointer(str(14174)))
 15110  			crt.X__builtin_abort(tls)
 15111  		}
 15112  	}()
 15113  	*(**XPgHdr)(unsafe.Pointer(&_p.XpDirtyTail)) = (*XPgHdr)(_pPage.XpDirtyPrev)
 15114  _9:
 15115  	if _pPage.XpDirtyPrev != nil {
 15116  		*(**XPgHdr)(unsafe.Pointer(&((*XPgHdr)(_pPage.XpDirtyPrev).XpDirtyNext))) = (*XPgHdr)(_pPage.XpDirtyNext)
 15117  		goto _13
 15118  	}
 15119  	func() {
 15120  		if _pPage != (*XPgHdr)(_p.XpDirty) {
 15121  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44309), unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000), unsafe.Pointer(str(14195)))
 15122  			crt.X__builtin_abort(tls)
 15123  		}
 15124  	}()
 15125  	*(**XPgHdr)(unsafe.Pointer(&_p.XpDirty)) = (*XPgHdr)(_pPage.XpDirtyNext)
 15126  	func() {
 15127  		if _p.XbPurgeable == 0 && int32(_p.XeCreate) != int32(2) {
 15128  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44311), unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000), unsafe.Pointer(str(14212)))
 15129  			crt.X__builtin_abort(tls)
 15130  		}
 15131  	}()
 15132  	if (*XPgHdr)(_p.XpDirty) == nil {
 15133  		func() {
 15134  			if int32(_p.XbPurgeable) != int32(0) && int32(_p.XeCreate) != int32(1) {
 15135  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44313), unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000), unsafe.Pointer(str(14243)))
 15136  				crt.X__builtin_abort(tls)
 15137  			}
 15138  		}()
 15139  		_p.XeCreate = uint8(2)
 15140  	}
 15141  _13:
 15142  	*(**XPgHdr)(unsafe.Pointer(&_pPage.XpDirtyNext)) = nil
 15143  	*(**XPgHdr)(unsafe.Pointer(&_pPage.XpDirtyPrev)) = nil
 15144  _0:
 15145  	if (int32(_addRemove) & int32(2)) == 0 {
 15146  		goto _23
 15147  	}
 15148  	func() {
 15149  		if (*XPgHdr)(_pPage.XpDirtyNext) != nil || (*XPgHdr)(_pPage.XpDirtyPrev) != nil || (*XPgHdr)(_p.XpDirty) == _pPage {
 15150  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44321), unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000), unsafe.Pointer(str(14277)))
 15151  			crt.X__builtin_abort(tls)
 15152  		}
 15153  	}()
 15154  	*(**XPgHdr)(unsafe.Pointer(&_pPage.XpDirtyNext)) = (*XPgHdr)(_p.XpDirty)
 15155  	if _pPage.XpDirtyNext != nil {
 15156  		func() {
 15157  			if (*XPgHdr)((*XPgHdr)(_pPage.XpDirtyNext).XpDirtyPrev) != nil {
 15158  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44325), unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000), unsafe.Pointer(str(14342)))
 15159  				crt.X__builtin_abort(tls)
 15160  			}
 15161  		}()
 15162  		*(**XPgHdr)(unsafe.Pointer(&((*XPgHdr)(_pPage.XpDirtyNext).XpDirtyPrev))) = _pPage
 15163  		goto _31
 15164  	}
 15165  	*(**XPgHdr)(unsafe.Pointer(&_p.XpDirtyTail)) = _pPage
 15166  	if _p.XbPurgeable != 0 {
 15167  		func() {
 15168  			if int32(_p.XeCreate) != int32(2) {
 15169  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44330), unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000), unsafe.Pointer(str(14375)))
 15170  				crt.X__builtin_abort(tls)
 15171  			}
 15172  		}()
 15173  		_p.XeCreate = uint8(1)
 15174  	}
 15175  _31:
 15176  	*(**XPgHdr)(unsafe.Pointer(&_p.XpDirty)) = _pPage
 15177  	if (_p.XpSynced == nil) && (int32(0) == (int32(_pPage.Xflags) & int32(8))) {
 15178  		*(**XPgHdr)(unsafe.Pointer(&_p.XpSynced)) = _pPage
 15179  	}
 15180  _23:
 15181  }
 15182  
 15183  var _pcacheManageDirtyListØ00__func__Ø000 [22]int8
 15184  
 15185  func init() {
 15186  	crt.Xstrncpy(nil, &_pcacheManageDirtyListØ00__func__Ø000[0], str(14389), 22)
 15187  }
 15188  
 15189  // C comment
 15190  //  /*
 15191  //  ** Write page pPg onto the end of the rollback journal.
 15192  //  */
 15193  func _pagerAddPageToRollbackJournal(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
 15194  	var _rc int32
 15195  	var _iOff int64
 15196  	var _cksum uint32
 15197  	var _pData2 *int8
 15198  	var _pPager *XPager
 15199  	_pPager = (*XPager)(_pPg.XpPager)
 15200  	_iOff = _pPager.XjournalOff
 15201  	func() {
 15202  		if _pPg.Xpgno == uint32((_sqlite3PendingByte/_pPager.XpageSize)+int32(1)) {
 15203  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52754), unsafe.Pointer(&_pagerAddPageToRollbackJournalØ00__func__Ø000), unsafe.Pointer(str(14411)))
 15204  			crt.X__builtin_abort(tls)
 15205  		}
 15206  	}()
 15207  	func() {
 15208  		if _pPager.XjournalHdr > _pPager.XjournalOff {
 15209  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52756), unsafe.Pointer(&_pagerAddPageToRollbackJournalØ00__func__Ø000), unsafe.Pointer(str(14444)))
 15210  			crt.X__builtin_abort(tls)
 15211  		}
 15212  	}()
 15213  	_pData2 = (*int8)(_pPg.XpData)
 15214  	_cksum = _pager_cksum(tls, _pPager, (*uint8)(unsafe.Pointer(_pData2)))
 15215  	{
 15216  		p := &_pPg.Xflags
 15217  		*p = uint16(int32(*p) | int32(8))
 15218  	}
 15219  	_rc = _write32bits(tls, (*Xsqlite3_file)(_pPager.Xjfd), _iOff, _pPg.Xpgno)
 15220  	if _rc != int32(0) {
 15221  		return _rc
 15222  	}
 15223  	_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.Xjfd), unsafe.Pointer(_pData2), _pPager.XpageSize, _iOff+int64(4))
 15224  	if _rc != int32(0) {
 15225  		return _rc
 15226  	}
 15227  	_rc = _write32bits(tls, (*Xsqlite3_file)(_pPager.Xjfd), (_iOff+int64(_pPager.XpageSize))+int64(4), _cksum)
 15228  	if _rc != int32(0) {
 15229  		return _rc
 15230  	}
 15231  	_pPager.XjournalOff += int64(int32(8) + _pPager.XpageSize)
 15232  	_pPager.XnRec += 1
 15233  	func() {
 15234  		if (*XBitvec)(_pPager.XpInJournal) == nil {
 15235  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52785), unsafe.Pointer(&_pagerAddPageToRollbackJournalØ00__func__Ø000), unsafe.Pointer(str(14483)))
 15236  			crt.X__builtin_abort(tls)
 15237  		}
 15238  	}()
 15239  	_rc = _sqlite3BitvecSet(tls, (*XBitvec)(_pPager.XpInJournal), _pPg.Xpgno)
 15240  	func() {
 15241  		if _rc != int32(0) && _rc != int32(7) {
 15242  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52788), unsafe.Pointer(&_pagerAddPageToRollbackJournalØ00__func__Ø000), unsafe.Pointer(str(5706)))
 15243  			crt.X__builtin_abort(tls)
 15244  		}
 15245  	}()
 15246  	_rc |= _addToSavepointBitvecs(tls, _pPager, _pPg.Xpgno)
 15247  	func() {
 15248  		if _rc != int32(0) && _rc != int32(7) {
 15249  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52790), unsafe.Pointer(&_pagerAddPageToRollbackJournalØ00__func__Ø000), unsafe.Pointer(str(5706)))
 15250  			crt.X__builtin_abort(tls)
 15251  		}
 15252  	}()
 15253  	return _rc
 15254  }
 15255  
 15256  var _pagerAddPageToRollbackJournalØ00__func__Ø000 [30]int8
 15257  
 15258  func init() {
 15259  	crt.Xstrncpy(nil, &_pagerAddPageToRollbackJournalØ00__func__Ø000[0], str(14505), 30)
 15260  }
 15261  
 15262  // C comment
 15263  //  /*
 15264  //  ** Parameter aData must point to a buffer of pPager->pageSize bytes
 15265  //  ** of data. Compute and return a checksum based ont the contents of the
 15266  //  ** page of data and the current value of pPager->cksumInit.
 15267  //  **
 15268  //  ** This is not a real checksum. It is really just the sum of the
 15269  //  ** random initial value (pPager->cksumInit) and every 200th byte
 15270  //  ** of the page data, starting with byte offset (pPager->pageSize%200).
 15271  //  ** Each byte is interpreted as an 8-bit unsigned integer.
 15272  //  **
 15273  //  ** Changing the formula used to compute this checksum results in an
 15274  //  ** incompatible journal file format.
 15275  //  **
 15276  //  ** If journal corruption occurs due to a power failure, the most likely
 15277  //  ** scenario is that one end or the other of the record will be changed.
 15278  //  ** It is much less likely that the two ends of the journal record will be
 15279  //  ** correct and the middle be corrupt.  Thus, this "checksum" scheme,
 15280  //  ** though fast and simple, catches the mostly likely kind of corruption.
 15281  //  */
 15282  func _pager_cksum(tls *crt.TLS, _pPager *XPager, _aData *uint8) (r0 uint32) {
 15283  	var _i int32
 15284  	var _cksum uint32
 15285  	_cksum = _pPager.XcksumInit
 15286  	_i = _pPager.XpageSize - int32(200)
 15287  _0:
 15288  	if _i > int32(0) {
 15289  		_cksum += uint32(*elem15(_aData, uintptr(_i)))
 15290  		_i -= int32(200)
 15291  		goto _0
 15292  	}
 15293  	return _cksum
 15294  }
 15295  
 15296  // C comment
 15297  //  /*
 15298  //  ** Release a page reference.
 15299  //  **
 15300  //  ** If the number of references to the page drop to zero, then the
 15301  //  ** page is added to the LRU list.  When all references to all pages
 15302  //  ** are released, a rollback occurs and the lock on the database is
 15303  //  ** removed.
 15304  //  */
 15305  func _sqlite3PagerUnrefNotNull(tls *crt.TLS, _pPg *XPgHdr) {
 15306  	var _pPager *XPager
 15307  	func() {
 15308  		if _pPg == nil {
 15309  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52551), unsafe.Pointer(&_sqlite3PagerUnrefNotNullØ00__func__Ø000), unsafe.Pointer(str(13924)))
 15310  			crt.X__builtin_abort(tls)
 15311  		}
 15312  	}()
 15313  	_pPager = (*XPager)(_pPg.XpPager)
 15314  	if (int32(_pPg.Xflags) & int32(32)) != 0 {
 15315  		_pagerReleaseMapPage(tls, _pPg)
 15316  		goto _3
 15317  	}
 15318  	_sqlite3PcacheRelease(tls, _pPg)
 15319  _3:
 15320  	_pagerUnlockIfUnused(tls, _pPager)
 15321  }
 15322  
 15323  var _sqlite3PagerUnrefNotNullØ00__func__Ø000 [25]int8
 15324  
 15325  func init() {
 15326  	crt.Xstrncpy(nil, &_sqlite3PagerUnrefNotNullØ00__func__Ø000[0], str(14535), 25)
 15327  }
 15328  
 15329  // C comment
 15330  //  /*
 15331  //  ** Release a reference to page pPg. pPg must have been returned by an
 15332  //  ** earlier call to pagerAcquireMapPage().
 15333  //  */
 15334  func _pagerReleaseMapPage(tls *crt.TLS, _pPg *XPgHdr) {
 15335  	var _pPager *XPager
 15336  	_pPager = (*XPager)(_pPg.XpPager)
 15337  	_pPager.XnMmapOut -= 1
 15338  	*(**XPgHdr)(unsafe.Pointer(&_pPg.XpDirty)) = (*XPgHdr)(_pPager.XpMmapFreelist)
 15339  	*(**XPgHdr)(unsafe.Pointer(&_pPager.XpMmapFreelist)) = _pPg
 15340  	func() {
 15341  		if ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods).XiVersion) < int32(3) {
 15342  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50978), unsafe.Pointer(&_pagerReleaseMapPageØ00__func__Ø000), unsafe.Pointer(str(14560)))
 15343  			crt.X__builtin_abort(tls)
 15344  		}
 15345  	}()
 15346  	_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pPager.Xfd), int64(_pPg.Xpgno-uint32(1))*int64(_pPager.XpageSize), _pPg.XpData)
 15347  }
 15348  
 15349  var _pagerReleaseMapPageØ00__func__Ø000 [20]int8
 15350  
 15351  func init() {
 15352  	crt.Xstrncpy(nil, &_pagerReleaseMapPageØ00__func__Ø000[0], str(14594), 20)
 15353  }
 15354  
 15355  func _sqlite3OsUnfetch(tls *crt.TLS, _id *Xsqlite3_file, _iOff int64, _p unsafe.Pointer) (r0 int32) {
 15356  	return func() func(*crt.TLS, *Xsqlite3_file, int64, unsafe.Pointer) int32 {
 15357  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxUnfetch
 15358  		return *(*func(*crt.TLS, *Xsqlite3_file, int64, unsafe.Pointer) int32)(unsafe.Pointer(&v))
 15359  	}()(tls, _id, _iOff, _p)
 15360  }
 15361  
 15362  // C comment
 15363  //  /*
 15364  //  ** Decrement the reference count on a page. If the page is clean and the
 15365  //  ** reference count drops to 0, then it is made eligible for recycling.
 15366  //  */
 15367  func _sqlite3PcacheRelease(tls *crt.TLS, _p *XPgHdr) {
 15368  	func() {
 15369  		if int32(_p.XnRef) <= int32(0) {
 15370  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44634), unsafe.Pointer(&_sqlite3PcacheReleaseØ00__func__Ø000), unsafe.Pointer(str(13812)))
 15371  			crt.X__builtin_abort(tls)
 15372  		}
 15373  	}()
 15374  	(*XPCache)(_p.XpCache).XnRefSum -= 1
 15375  	if int32(preInc26(&_p.XnRef, -1)) != int32(0) {
 15376  		goto _2
 15377  	}
 15378  	if (int32(_p.Xflags) & int32(1)) != 0 {
 15379  		_pcacheUnpin(tls, _p)
 15380  		goto _5
 15381  	}
 15382  	if (*XPgHdr)(_p.XpDirtyPrev) != nil {
 15383  		_pcacheManageDirtyList(tls, _p, uint8(3))
 15384  	}
 15385  _5:
 15386  _2:
 15387  }
 15388  
 15389  var _sqlite3PcacheReleaseØ00__func__Ø000 [21]int8
 15390  
 15391  func init() {
 15392  	crt.Xstrncpy(nil, &_sqlite3PcacheReleaseØ00__func__Ø000[0], str(14614), 21)
 15393  }
 15394  
 15395  // C comment
 15396  //  /*
 15397  //  ** Wrapper around the pluggable caches xUnpin method. If the cache is
 15398  //  ** being used for an in-memory database, this function is a no-op.
 15399  //  */
 15400  func _pcacheUnpin(tls *crt.TLS, _p *XPgHdr) {
 15401  	if ((*XPCache)(_p.XpCache).XbPurgeable) != 0 {
 15402  		func() func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, int32) {
 15403  			v := _sqlite3Config.Xpcache2.XxUnpin
 15404  			return *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, int32))(unsafe.Pointer(&v))
 15405  		}()(tls, (*XPCache)(_p.XpCache).XpCache, (*Xsqlite3_pcache_page)(_p.XpPage), int32(0))
 15406  	}
 15407  }
 15408  
 15409  func _pagerUnlockIfUnused(tls *crt.TLS, _pPager *XPager) {
 15410  	if (_pPager.XnMmapOut == int32(0)) && (_sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.XpPCache)) == int32(0)) {
 15411  		_pagerUnlockAndRollback(tls, _pPager)
 15412  	}
 15413  }
 15414  
 15415  // C comment
 15416  //  /*
 15417  //  ** Execute a rollback if a transaction is active and unlock the
 15418  //  ** database file.
 15419  //  **
 15420  //  ** If the pager has already entered the ERROR state, do not attempt
 15421  //  ** the rollback at this time. Instead, pager_unlock() is called. The
 15422  //  ** call to pager_unlock() will discard all in-memory pages, unlock
 15423  //  ** the database file and move the pager back to OPEN state. If this
 15424  //  ** means that there is a hot-journal left in the file-system, the next
 15425  //  ** connection to obtain a shared lock on the pager (which may be this one)
 15426  //  ** will roll it back.
 15427  //  **
 15428  //  ** If the pager has not already entered the ERROR state, but an IO or
 15429  //  ** malloc error occurs during a rollback, then this will itself cause
 15430  //  ** the pager to enter the ERROR state. Which will be cleared by the
 15431  //  ** call to pager_unlock(), as described above.
 15432  //  */
 15433  func _pagerUnlockAndRollback(tls *crt.TLS, _pPager *XPager) {
 15434  	if int32(_pPager.XeState) == int32(6) || int32(_pPager.XeState) == int32(0) {
 15435  		goto _1
 15436  	}
 15437  	func() {
 15438  		if _assert_pager_state(tls, _pPager) == 0 {
 15439  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49056), unsafe.Pointer(&_pagerUnlockAndRollbackØ00__func__Ø000), unsafe.Pointer(str(10971)))
 15440  			crt.X__builtin_abort(tls)
 15441  		}
 15442  	}()
 15443  	if int32(_pPager.XeState) >= int32(2) {
 15444  		_sqlite3BeginBenignMalloc(tls)
 15445  		_sqlite3PagerRollback(tls, _pPager)
 15446  		_sqlite3EndBenignMalloc(tls)
 15447  		goto _6
 15448  	}
 15449  	if _pPager.XexclusiveMode == 0 {
 15450  		func() {
 15451  			if int32(_pPager.XeState) != int32(1) {
 15452  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49062), unsafe.Pointer(&_pagerUnlockAndRollbackØ00__func__Ø000), unsafe.Pointer(str(14635)))
 15453  				crt.X__builtin_abort(tls)
 15454  			}
 15455  		}()
 15456  		_pager_end_transaction(tls, _pPager, int32(0), int32(0))
 15457  	}
 15458  _6:
 15459  _1:
 15460  	_pager_unlock(tls, _pPager)
 15461  }
 15462  
 15463  var _pagerUnlockAndRollbackØ00__func__Ø000 [23]int8
 15464  
 15465  func init() {
 15466  	crt.Xstrncpy(nil, &_pagerUnlockAndRollbackØ00__func__Ø000[0], str(14664), 23)
 15467  }
 15468  
 15469  // C comment
 15470  //  /*
 15471  //  ** If a write transaction is open, then all changes made within the
 15472  //  ** transaction are reverted and the current write-transaction is closed.
 15473  //  ** The pager falls back to PAGER_READER state if successful, or PAGER_ERROR
 15474  //  ** state if an error occurs.
 15475  //  **
 15476  //  ** If the pager is already in PAGER_ERROR state when this function is called,
 15477  //  ** it returns Pager.errCode immediately. No work is performed in this case.
 15478  //  **
 15479  //  ** Otherwise, in rollback mode, this function performs two functions:
 15480  //  **
 15481  //  **   1) It rolls back the journal file, restoring all database file and
 15482  //  **      in-memory cache pages to the state they were in when the transaction
 15483  //  **      was opened, and
 15484  //  **
 15485  //  **   2) It finalizes the journal file, so that it is not used for hot
 15486  //  **      rollback at any point in the future.
 15487  //  **
 15488  //  ** Finalization of the journal file (task 2) is only performed if the
 15489  //  ** rollback is successful.
 15490  //  **
 15491  //  ** In WAL mode, all cache-entries containing data modified within the
 15492  //  ** current transaction are either expelled from the cache or reverted to
 15493  //  ** their pre-transaction state by re-reading data from the database or
 15494  //  ** WAL files. The WAL transaction is then closed.
 15495  //  */
 15496  func _sqlite3PagerRollback(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 15497  	var _rc, _1_rc2, _2_eState int32
 15498  	_rc = int32(0)
 15499  	func() {
 15500  		if _assert_pager_state(tls, _pPager) == 0 {
 15501  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53472), unsafe.Pointer(&_sqlite3PagerRollbackØ00__func__Ø000), unsafe.Pointer(str(10971)))
 15502  			crt.X__builtin_abort(tls)
 15503  		}
 15504  	}()
 15505  	if int32(_pPager.XeState) == int32(6) {
 15506  		return _pPager.XerrCode
 15507  	}
 15508  	if int32(_pPager.XeState) <= int32(1) {
 15509  		return int32(0)
 15510  	}
 15511  	if (*XWal)(_pPager.XpWal) == nil {
 15512  		goto _4
 15513  	}
 15514  	_rc = _sqlite3PagerSavepoint(tls, _pPager, int32(2), int32(-1))
 15515  	_1_rc2 = _pager_end_transaction(tls, _pPager, int32(_pPager.XsetMaster), int32(0))
 15516  	if _rc == int32(0) {
 15517  		_rc = _1_rc2
 15518  	}
 15519  	goto _11
 15520  _4:
 15521  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) != nil && int32(_pPager.XeState) != int32(2) {
 15522  		goto _8
 15523  	}
 15524  	_2_eState = int32(_pPager.XeState)
 15525  	_rc = _pager_end_transaction(tls, _pPager, int32(0), int32(0))
 15526  	if (_pPager.XmemDb == 0) && (_2_eState > int32(2)) {
 15527  		_pPager.XerrCode = int32(4)
 15528  		_pPager.XeState = uint8(6)
 15529  		_setGetterMethod(tls, _pPager)
 15530  		return _rc
 15531  	}
 15532  	goto _11
 15533  _8:
 15534  	_rc = _pager_playback(tls, _pPager, int32(0))
 15535  _11:
 15536  	func() {
 15537  		if int32(_pPager.XeState) != int32(1) && _rc == int32(0) {
 15538  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53498), unsafe.Pointer(&_sqlite3PagerRollbackØ00__func__Ø000), unsafe.Pointer(str(14687)))
 15539  			crt.X__builtin_abort(tls)
 15540  		}
 15541  	}()
 15542  	func() {
 15543  		if _rc != int32(0) && _rc != int32(13) && _rc != int32(11) && _rc != int32(7) && (_rc&int32(255)) != int32(10) && _rc != int32(14) {
 15544  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53499), unsafe.Pointer(&_sqlite3PagerRollbackØ00__func__Ø000), unsafe.Pointer(str(14733)))
 15545  			crt.X__builtin_abort(tls)
 15546  		}
 15547  	}()
 15548  	return _pager_error(tls, _pPager, _rc)
 15549  }
 15550  
 15551  var _sqlite3PagerRollbackØ00__func__Ø000 [21]int8
 15552  
 15553  func init() {
 15554  	crt.Xstrncpy(nil, &_sqlite3PagerRollbackØ00__func__Ø000[0], str(14858), 21)
 15555  }
 15556  
 15557  func _sqlite3PagerSavepoint(tls *crt.TLS, _pPager *XPager, _op int32, _iSavepoint int32) (r0 int32) {
 15558  	var _rc, _1_ii, _1_nNew int32
 15559  	var _6_pSavepoint *XPagerSavepoint
 15560  	_rc = _pPager.XerrCode
 15561  	func() {
 15562  		if _op != int32(1) && _op != int32(2) {
 15563  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53702), unsafe.Pointer(&_sqlite3PagerSavepointØ00__func__Ø000), unsafe.Pointer(str(14879)))
 15564  			crt.X__builtin_abort(tls)
 15565  		}
 15566  	}()
 15567  	func() {
 15568  		if _iSavepoint < int32(0) && _op != int32(2) {
 15569  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53703), unsafe.Pointer(&_sqlite3PagerSavepointØ00__func__Ø000), unsafe.Pointer(str(14927)))
 15570  			crt.X__builtin_abort(tls)
 15571  		}
 15572  	}()
 15573  	if _rc != int32(0) || _iSavepoint >= _pPager.XnSavepoint {
 15574  		goto _7
 15575  	}
 15576  	_1_nNew = _iSavepoint + func() int32 {
 15577  		if _op == int32(1) {
 15578  			return int32(0)
 15579  		}
 15580  		return int32(1)
 15581  	}()
 15582  	_1_ii = _1_nNew
 15583  _10:
 15584  	if _1_ii >= _pPager.XnSavepoint {
 15585  		goto _13
 15586  	}
 15587  	_sqlite3BitvecDestroy(tls, (*XBitvec)(elem31((*XPagerSavepoint)(_pPager.XaSavepoint), uintptr(_1_ii)).XpInSavepoint))
 15588  	_1_ii += 1
 15589  	goto _10
 15590  _13:
 15591  	_pPager.XnSavepoint = _1_nNew
 15592  	if _op != int32(1) {
 15593  		goto _14
 15594  	}
 15595  	if _1_nNew != int32(0) || (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xsjfd).XpMethods) == nil {
 15596  		goto _16
 15597  	}
 15598  	if _sqlite3JournalIsInMemory(tls, (*Xsqlite3_file)(_pPager.Xsjfd)) != 0 {
 15599  		_rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pPager.Xsjfd), 0)
 15600  		func() {
 15601  			if _rc != int32(0) {
 15602  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53726), unsafe.Pointer(&_sqlite3PagerSavepointØ00__func__Ø000), unsafe.Pointer(str(14967)))
 15603  				crt.X__builtin_abort(tls)
 15604  			}
 15605  		}()
 15606  	}
 15607  	_pPager.XnSubRec = 0
 15608  _16:
 15609  	goto _22
 15610  _14:
 15611  	if ((*XWal)(_pPager.XpWal) != nil) || ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) != nil) {
 15612  		_6_pSavepoint = func() *XPagerSavepoint {
 15613  			if _1_nNew == int32(0) {
 15614  				return nil
 15615  			}
 15616  			return elem31((*XPagerSavepoint)(_pPager.XaSavepoint), uintptr(_1_nNew-int32(1)))
 15617  		}()
 15618  		_rc = _pagerPlaybackSavepoint(tls, _pPager, _6_pSavepoint)
 15619  		func() {
 15620  			if _rc == int32(101) {
 15621  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53739), unsafe.Pointer(&_sqlite3PagerSavepointØ00__func__Ø000), unsafe.Pointer(str(14981)))
 15622  				crt.X__builtin_abort(tls)
 15623  			}
 15624  		}()
 15625  	}
 15626  _22:
 15627  _7:
 15628  	return _rc
 15629  }
 15630  
 15631  var _sqlite3PagerSavepointØ00__func__Ø000 [22]int8
 15632  
 15633  func init() {
 15634  	crt.Xstrncpy(nil, &_sqlite3PagerSavepointØ00__func__Ø000[0], str(14997), 22)
 15635  }
 15636  
 15637  // C comment
 15638  //  /*
 15639  //  ** The file-handle passed as the only argument is open on a journal file.
 15640  //  ** Return true if this "journal file" is currently stored in heap memory,
 15641  //  ** or false otherwise.
 15642  //  */
 15643  func _sqlite3JournalIsInMemory(tls *crt.TLS, _p *Xsqlite3_file) (r0 int32) {
 15644  	return bool2int((*Xsqlite3_io_methods)(_p.XpMethods) == &_MemJournalMethods)
 15645  }
 15646  
 15647  func _sqlite3OsTruncate(tls *crt.TLS, _id *Xsqlite3_file, _size int64) (r0 int32) {
 15648  	return func() func(*crt.TLS, *Xsqlite3_file, int64) int32 {
 15649  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxTruncate
 15650  		return *(*func(*crt.TLS, *Xsqlite3_file, int64) int32)(unsafe.Pointer(&v))
 15651  	}()(tls, _id, _size)
 15652  }
 15653  
 15654  // C comment
 15655  //  /*
 15656  //  ** Playback savepoint pSavepoint. Or, if pSavepoint==NULL, then playback
 15657  //  ** the entire master journal file. The case pSavepoint==NULL occurs when
 15658  //  ** a ROLLBACK TO command is invoked on a SAVEPOINT that is a transaction
 15659  //  ** savepoint.
 15660  //  **
 15661  //  ** When pSavepoint is not NULL (meaning a non-transaction savepoint is
 15662  //  ** being rolled back), then the rollback consists of up to three stages,
 15663  //  ** performed in the order specified:
 15664  //  **
 15665  //  **   * Pages are played back from the main journal starting at byte
 15666  //  **     offset PagerSavepoint.iOffset and continuing to
 15667  //  **     PagerSavepoint.iHdrOffset, or to the end of the main journal
 15668  //  **     file if PagerSavepoint.iHdrOffset is zero.
 15669  //  **
 15670  //  **   * If PagerSavepoint.iHdrOffset is not zero, then pages are played
 15671  //  **     back starting from the journal header immediately following
 15672  //  **     PagerSavepoint.iHdrOffset to the end of the main journal file.
 15673  //  **
 15674  //  **   * Pages are then played back from the sub-journal file, starting
 15675  //  **     with the PagerSavepoint.iSubRec and continuing to the end of
 15676  //  **     the journal file.
 15677  //  **
 15678  //  ** Throughout the rollback process, each time a page is rolled back, the
 15679  //  ** corresponding bit is set in a bitvec structure (variable pDone in the
 15680  //  ** implementation below). This is used to ensure that a page is only
 15681  //  ** rolled back the first time it is encountered in either journal.
 15682  //  **
 15683  //  ** If pSavepoint is NULL, then pages are only played back from the main
 15684  //  ** journal file. There is no need for a bitvec in this case.
 15685  //  **
 15686  //  ** In either case, before playback commences the Pager.dbSize variable
 15687  //  ** is reset to the value that it held at the start of the savepoint
 15688  //  ** (or transaction). No page with a page-number greater than this value
 15689  //  ** is played back. If one is encountered it is simply skipped.
 15690  //  */
 15691  func _pagerPlaybackSavepoint(tls *crt.TLS, _pPager *XPager, _pSavepoint *XPagerSavepoint) (r0 int32) {
 15692  	var _rc int32
 15693  	var _szJ, _iHdrOff, _10_offset int64
 15694  	var _7_ii, _7_nJRec, _7_dummy, _10_ii uint32
 15695  	var _pDone *XBitvec
 15696  	_rc = int32(0)
 15697  	_pDone = nil
 15698  	func() {
 15699  		if int32(_pPager.XeState) == int32(6) {
 15700  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50292), unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000), unsafe.Pointer(str(15019)))
 15701  			crt.X__builtin_abort(tls)
 15702  		}
 15703  	}()
 15704  	func() {
 15705  		if int32(_pPager.XeState) < int32(2) {
 15706  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50293), unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000), unsafe.Pointer(str(10935)))
 15707  			crt.X__builtin_abort(tls)
 15708  		}
 15709  	}()
 15710  	if _pSavepoint == nil {
 15711  		goto _4
 15712  	}
 15713  	_pDone = _sqlite3BitvecCreate(tls, _pSavepoint.XnOrig)
 15714  	if _pDone == nil {
 15715  		return _sqlite3NomemError(tls, int32(50299))
 15716  	}
 15717  _4:
 15718  	_pPager.XdbSize = func() uint32 {
 15719  		if _pSavepoint != nil {
 15720  			return _pSavepoint.XnOrig
 15721  		}
 15722  		return _pPager.XdbOrigSize
 15723  	}()
 15724  	_pPager.XchangeCountDone = _pPager.XtempFile
 15725  	if (_pSavepoint == nil) && ((*XWal)(_pPager.XpWal) != nil) {
 15726  		return _pagerRollbackWal(tls, _pPager)
 15727  	}
 15728  	_szJ = _pPager.XjournalOff
 15729  	func() {
 15730  		if bool2int((*XWal)(_pPager.XpWal) != nil) != int32(0) && _szJ != (0) {
 15731  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50319), unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000), unsafe.Pointer(str(15047)))
 15732  			crt.X__builtin_abort(tls)
 15733  		}
 15734  	}()
 15735  	if _pSavepoint == nil || (*XWal)(_pPager.XpWal) != nil {
 15736  		goto _14
 15737  	}
 15738  	_iHdrOff = func() int64 {
 15739  		if _pSavepoint.XiHdrOffset != 0 {
 15740  			return _pSavepoint.XiHdrOffset
 15741  		}
 15742  		return _szJ
 15743  	}()
 15744  	_pPager.XjournalOff = _pSavepoint.XiOffset
 15745  _17:
 15746  	if (_rc == int32(0)) && (_pPager.XjournalOff < _iHdrOff) {
 15747  		_rc = _pager_playback_one_page(tls, _pPager, &_pPager.XjournalOff, _pDone, int32(1), int32(1))
 15748  		goto _17
 15749  	}
 15750  	func() {
 15751  		if _rc == int32(101) {
 15752  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50334), unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000), unsafe.Pointer(str(14981)))
 15753  			crt.X__builtin_abort(tls)
 15754  		}
 15755  	}()
 15756  	goto _22
 15757  _14:
 15758  	_pPager.XjournalOff = 0
 15759  _22:
 15760  	if _rc != int32(0) || _pPager.XjournalOff >= _szJ {
 15761  		goto _24
 15762  	}
 15763  	_7_nJRec = 0
 15764  	_rc = _readJournalHdr(tls, _pPager, int32(0), _szJ, &_7_nJRec, &_7_dummy)
 15765  	func() {
 15766  		if _rc == int32(101) {
 15767  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50349), unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000), unsafe.Pointer(str(14981)))
 15768  			crt.X__builtin_abort(tls)
 15769  		}
 15770  	}()
 15771  	if (_7_nJRec == (0)) && ((_pPager.XjournalHdr + int64(_pPager.XsectorSize)) == _pPager.XjournalOff) {
 15772  		_7_nJRec = uint32((_szJ - _pPager.XjournalOff) / int64(_pPager.XpageSize+int32(8)))
 15773  	}
 15774  	_7_ii = 0
 15775  _30:
 15776  	if _rc != int32(0) || _7_ii >= _7_nJRec || _pPager.XjournalOff >= _szJ {
 15777  		goto _35
 15778  	}
 15779  	_rc = _pager_playback_one_page(tls, _pPager, &_pPager.XjournalOff, _pDone, int32(1), int32(1))
 15780  	_7_ii += 1
 15781  	goto _30
 15782  _35:
 15783  	func() {
 15784  		if _rc == int32(101) {
 15785  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50364), unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000), unsafe.Pointer(str(14981)))
 15786  			crt.X__builtin_abort(tls)
 15787  		}
 15788  	}()
 15789  	goto _22
 15790  _24:
 15791  	func() {
 15792  		if _rc == int32(0) && _pPager.XjournalOff < _szJ {
 15793  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50366), unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000), unsafe.Pointer(str(15080)))
 15794  			crt.X__builtin_abort(tls)
 15795  		}
 15796  	}()
 15797  	if _pSavepoint == nil {
 15798  		goto _41
 15799  	}
 15800  	_10_offset = int64(_pSavepoint.XiSubRec) * int64(int32(4)+_pPager.XpageSize)
 15801  	if (*XWal)(_pPager.XpWal) != nil {
 15802  		_rc = _sqlite3WalSavepointUndo(tls, (*XWal)(_pPager.XpWal), (*uint32)(unsafe.Pointer(&_pSavepoint.XaWalData)))
 15803  	}
 15804  	_10_ii = _pSavepoint.XiSubRec
 15805  _43:
 15806  	if _rc != int32(0) || _10_ii >= _pPager.XnSubRec {
 15807  		goto _47
 15808  	}
 15809  	func() {
 15810  		if _10_offset != (int64(_10_ii) * int64(int32(4)+_pPager.XpageSize)) {
 15811  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50380), unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000), unsafe.Pointer(str(15121)))
 15812  			crt.X__builtin_abort(tls)
 15813  		}
 15814  	}()
 15815  	_rc = _pager_playback_one_page(tls, _pPager, &_10_offset, _pDone, int32(0), int32(1))
 15816  	_10_ii += 1
 15817  	goto _43
 15818  _47:
 15819  	func() {
 15820  		if _rc == int32(101) {
 15821  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50383), unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000), unsafe.Pointer(str(14981)))
 15822  			crt.X__builtin_abort(tls)
 15823  		}
 15824  	}()
 15825  _41:
 15826  	_sqlite3BitvecDestroy(tls, _pDone)
 15827  	if _rc == int32(0) {
 15828  		_pPager.XjournalOff = _szJ
 15829  	}
 15830  	return _rc
 15831  }
 15832  
 15833  var _pagerPlaybackSavepointØ00__func__Ø000 [23]int8
 15834  
 15835  func init() {
 15836  	crt.Xstrncpy(nil, &_pagerPlaybackSavepointØ00__func__Ø000[0], str(15158), 23)
 15837  }
 15838  
 15839  // C comment
 15840  //  /*
 15841  //  ** This function is called to rollback a transaction on a WAL database.
 15842  //  */
 15843  func _pagerRollbackWal(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 15844  	var _rc int32
 15845  	var _pList, _1_pNext *XPgHdr
 15846  	_pPager.XdbSize = _pPager.XdbOrigSize
 15847  	_rc = _sqlite3WalUndo(tls, (*XWal)(_pPager.XpWal), _pagerUndoCallback, unsafe.Pointer(_pPager))
 15848  	_pList = _sqlite3PcacheDirtyList(tls, (*XPCache)(_pPager.XpPCache))
 15849  _0:
 15850  	if (_pList != nil) && (_rc == int32(0)) {
 15851  		_1_pNext = (*XPgHdr)(_pList.XpDirty)
 15852  		_rc = _pagerUndoCallback(tls, unsafe.Pointer(_pPager), _pList.Xpgno)
 15853  		_pList = _1_pNext
 15854  		goto _0
 15855  	}
 15856  	return _rc
 15857  }
 15858  
 15859  // C comment
 15860  //  /*
 15861  //  ** If any data has been written (but not committed) to the log file, this
 15862  //  ** function moves the write-pointer back to the start of the transaction.
 15863  //  **
 15864  //  ** Additionally, the callback function is invoked for each frame written
 15865  //  ** to the WAL since the start of the transaction. If the callback returns
 15866  //  ** other than SQLITE_OK, it is not invoked again and the error code is
 15867  //  ** returned to the caller.
 15868  //  **
 15869  //  ** Otherwise, if the callback function does not return an error, this
 15870  //  ** function returns SQLITE_OK.
 15871  //  */
 15872  func _sqlite3WalUndo(tls *crt.TLS, _pWal *XWal, _xUndo func(*crt.TLS, unsafe.Pointer, uint32) int32, _pUndoCtx unsafe.Pointer) (r0 int32) {
 15873  	var _rc int32
 15874  	var _1_iMax, _1_iFrame uint32
 15875  	_rc = int32(0)
 15876  	if func() int32 {
 15877  		if _pWal.XwriteLock != 0 {
 15878  			return int32(1)
 15879  		}
 15880  		return func() int32 {
 15881  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57261), unsafe.Pointer(&_sqlite3WalUndoØ00__func__Ø000), unsafe.Pointer(str(4809)))
 15882  			crt.X__builtin_abort(tls)
 15883  			return int32(0)
 15884  		}()
 15885  	}() == 0 {
 15886  		goto _2
 15887  	}
 15888  	_1_iMax = _pWal.Xhdr.XmxFrame
 15889  	crt.Xmemcpy(tls, unsafe.Pointer(&_pWal.Xhdr), unsafe.Pointer(_walIndexHdr(tls, _pWal)), uint32(48))
 15890  	_1_iFrame = (_pWal.Xhdr.XmxFrame) + uint32(1)
 15891  _3:
 15892  	if func() int32 {
 15893  		if _rc == int32(0) {
 15894  			return int32(1)
 15895  		}
 15896  		return func() int32 {
 15897  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57271), unsafe.Pointer(&_sqlite3WalUndoØ00__func__Ø000), unsafe.Pointer(str(4809)))
 15898  			crt.X__builtin_abort(tls)
 15899  			return int32(0)
 15900  		}()
 15901  	}() == 0 || _1_iFrame > _1_iMax {
 15902  		goto _9
 15903  	}
 15904  	func() {
 15905  		if _walFramePgno(tls, _pWal, _1_iFrame) == uint32(1) {
 15906  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57285), unsafe.Pointer(&_sqlite3WalUndoØ00__func__Ø000), unsafe.Pointer(str(15181)))
 15907  			crt.X__builtin_abort(tls)
 15908  		}
 15909  	}()
 15910  	_rc = _xUndo(tls, _pUndoCtx, _walFramePgno(tls, _pWal, _1_iFrame))
 15911  	_1_iFrame += 1
 15912  	goto _3
 15913  _9:
 15914  	if _1_iMax != (_pWal.Xhdr.XmxFrame) {
 15915  		_walCleanupHash(tls, _pWal)
 15916  	}
 15917  _2:
 15918  	return _rc
 15919  }
 15920  
 15921  var _sqlite3WalUndoØ00__func__Ø000 [15]int8
 15922  
 15923  func init() {
 15924  	crt.Xstrncpy(nil, &_sqlite3WalUndoØ00__func__Ø000[0], str(15211), 15)
 15925  }
 15926  
 15927  // C comment
 15928  //  /*
 15929  //  ** Return a pointer to the WalIndexHdr structure in the wal-index.
 15930  //  */
 15931  func _walIndexHdr(tls *crt.TLS, _pWal *XWal) (r0 *XWalIndexHdr) {
 15932  	func() {
 15933  		if _pWal.XnWiData <= int32(0) || (*elem36(_pWal.XapWiData, 0)) == nil {
 15934  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55066), unsafe.Pointer(&_walIndexHdrØ00__func__Ø000), unsafe.Pointer(str(15226)))
 15935  			crt.X__builtin_abort(tls)
 15936  		}
 15937  	}()
 15938  	return (*XWalIndexHdr)(unsafe.Pointer(*elem36(_pWal.XapWiData, 0)))
 15939  }
 15940  
 15941  var _walIndexHdrØ00__func__Ø000 [12]int8
 15942  
 15943  func init() {
 15944  	crt.Xstrncpy(nil, &_walIndexHdrØ00__func__Ø000[0], str(15263), 12)
 15945  }
 15946  
 15947  // C comment
 15948  //  /*
 15949  //  ** Return the page number associated with frame iFrame in this WAL.
 15950  //  */
 15951  func _walFramePgno(tls *crt.TLS, _pWal *XWal, _iFrame uint32) (r0 uint32) {
 15952  	var _iHash int32
 15953  	_iHash = _walFramePage(tls, _iFrame)
 15954  	if _iHash == int32(0) {
 15955  		return *elem7(*elem36(_pWal.XapWiData, 0), uintptr((uint32(34)+_iFrame)-uint32(1)))
 15956  	}
 15957  	return *elem7(*elem36(_pWal.XapWiData, uintptr(_iHash)), uintptr(((_iFrame-uint32(1))-uint32(4062))%uint32(4096)))
 15958  }
 15959  
 15960  // C comment
 15961  //  /*
 15962  //  ** Return the number of the wal-index page that contains the hash-table
 15963  //  ** and page-number array that contain entries corresponding to WAL frame
 15964  //  ** iFrame. The wal-index is broken up into 32KB pages. Wal-index pages
 15965  //  ** are numbered starting from 0.
 15966  //  */
 15967  func _walFramePage(tls *crt.TLS, _iFrame uint32) (r0 int32) {
 15968  	var _iHash int32
 15969  	_iHash = int32((((_iFrame + uint32(4096)) - uint32(4062)) - uint32(1)) / uint32(4096))
 15970  	func() {
 15971  		if _iHash != int32(0) && _iFrame <= uint32(4062) || _iHash < int32(1) && _iFrame > uint32(4062) || _iHash > int32(1) && _iFrame <= uint32(8158) || _iHash < int32(2) && _iFrame > uint32(8158) || _iHash > int32(2) && _iFrame <= uint32(12254) {
 15972  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55378), unsafe.Pointer(&_walFramePageØ00__func__Ø000), unsafe.Pointer(str(15275)))
 15973  			crt.X__builtin_abort(tls)
 15974  		}
 15975  	}()
 15976  	return _iHash
 15977  }
 15978  
 15979  var _walFramePageØ00__func__Ø000 [13]int8
 15980  
 15981  func init() {
 15982  	crt.Xstrncpy(nil, &_walFramePageØ00__func__Ø000[0], str(15548), 13)
 15983  }
 15984  
 15985  // C comment
 15986  //  /*
 15987  //  ** Remove entries from the hash table that point to WAL slots greater
 15988  //  ** than pWal->hdr.mxFrame.
 15989  //  **
 15990  //  ** This function is called whenever pWal->hdr.mxFrame is decreased due
 15991  //  ** to a rollback or savepoint.
 15992  //  **
 15993  //  ** At most only the hash table containing pWal->hdr.mxFrame needs to be
 15994  //  ** updated.  Any later hash tables will be automatically cleared when
 15995  //  ** pWal->hdr.mxFrame advances to the point where those hash tables are
 15996  //  ** actually needed.
 15997  //  */
 15998  func _walCleanupHash(tls *crt.TLS, _pWal *XWal) {
 15999  	var _iLimit, _nByte, _i int32
 16000  	var _iZero uint32
 16001  	var _aPgno *uint32
 16002  	var _aHash *uint16
 16003  	_aHash = nil
 16004  	_aPgno = nil
 16005  	_iZero = uint32(0)
 16006  	_iLimit = int32(0)
 16007  	func() {
 16008  		if _pWal.XwriteLock == 0 {
 16009  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55418), unsafe.Pointer(&_walCleanupHashØ00__func__Ø000), unsafe.Pointer(str(15561)))
 16010  			crt.X__builtin_abort(tls)
 16011  		}
 16012  	}()
 16013  	if (_pWal.Xhdr.XmxFrame) == (0) {
 16014  		return
 16015  	}
 16016  	func() {
 16017  		if _pWal.XnWiData <= _walFramePage(tls, _pWal.Xhdr.XmxFrame) {
 16018  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55429), unsafe.Pointer(&_walCleanupHashØ00__func__Ø000), unsafe.Pointer(str(15577)))
 16019  			crt.X__builtin_abort(tls)
 16020  		}
 16021  	}()
 16022  	func() {
 16023  		if (*elem36(_pWal.XapWiData, uintptr(_walFramePage(tls, _pWal.Xhdr.XmxFrame)))) == nil {
 16024  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55430), unsafe.Pointer(&_walCleanupHashØ00__func__Ø000), unsafe.Pointer(str(15623)))
 16025  			crt.X__builtin_abort(tls)
 16026  		}
 16027  	}()
 16028  	_walHashGet(tls, _pWal, _walFramePage(tls, _pWal.Xhdr.XmxFrame), &_aHash, &_aPgno, &_iZero)
 16029  	_iLimit = int32((_pWal.Xhdr.XmxFrame) - _iZero)
 16030  	func() {
 16031  		if _iLimit <= int32(0) {
 16032  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55437), unsafe.Pointer(&_walCleanupHashØ00__func__Ø000), unsafe.Pointer(str(15671)))
 16033  			crt.X__builtin_abort(tls)
 16034  		}
 16035  	}()
 16036  	_i = int32(0)
 16037  _9:
 16038  	if _i >= int32(8192) {
 16039  		goto _12
 16040  	}
 16041  	if int32(*elem20(_aHash, uintptr(_i))) > _iLimit {
 16042  		*elem20(_aHash, uintptr(_i)) = 0
 16043  	}
 16044  	_i += 1
 16045  	goto _9
 16046  _12:
 16047  	_nByte = int32(uintptr(unsafe.Pointer(_aHash)) - uintptr(unsafe.Pointer(elem7(_aPgno, uintptr(_iLimit+int32(1))))))
 16048  	crt.Xmemset(tls, unsafe.Pointer(elem7(_aPgno, uintptr(_iLimit+int32(1)))), int32(0), uint32(_nByte))
 16049  }
 16050  
 16051  var _walCleanupHashØ00__func__Ø000 [15]int8
 16052  
 16053  func init() {
 16054  	crt.Xstrncpy(nil, &_walCleanupHashØ00__func__Ø000[0], str(15680), 15)
 16055  }
 16056  
 16057  // C comment
 16058  //  /*
 16059  //  ** Return pointers to the hash table and page number array stored on
 16060  //  ** page iHash of the wal-index. The wal-index is broken into 32KB pages
 16061  //  ** numbered starting from 0.
 16062  //  **
 16063  //  ** Set output variable *paHash to point to the start of the hash table
 16064  //  ** in the wal-index file. Set *piZero to one less than the frame
 16065  //  ** number of the first frame indexed by this hash table. If a
 16066  //  ** slot in the hash table is set to N, it refers to frame number
 16067  //  ** (*piZero+N) in the log.
 16068  //  **
 16069  //  ** Finally, set *paPgno so that *paPgno[1] is the page number of the
 16070  //  ** first frame indexed by the hash table, frame (*piZero+1).
 16071  //  */
 16072  func _walHashGet(tls *crt.TLS, _pWal *XWal, _iHash int32, _paHash **uint16, _paPgno **uint32, _piZero *uint32) (r0 int32) {
 16073  	var _rc int32
 16074  	var _1_iZero uint32
 16075  	var _aPgno *uint32
 16076  	var _1_aHash *uint16
 16077  	_rc = _walIndexPage(tls, _pWal, _iHash, &_aPgno)
 16078  	func() {
 16079  		if _rc != int32(0) && _iHash <= int32(0) {
 16080  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55349), unsafe.Pointer(&_walHashGetØ00__func__Ø000), unsafe.Pointer(str(15695)))
 16081  			crt.X__builtin_abort(tls)
 16082  		}
 16083  	}()
 16084  	if _rc != int32(0) {
 16085  		goto _3
 16086  	}
 16087  	_1_aHash = (*uint16)(unsafe.Pointer(elem7(_aPgno, uintptr(4096))))
 16088  	if _iHash == int32(0) {
 16089  		_aPgno = elem7(_aPgno, uintptr(34))
 16090  		_1_iZero = 0
 16091  		goto _5
 16092  	}
 16093  	_1_iZero = uint32(4062) + uint32((_iHash-int32(1))*int32(4096))
 16094  _5:
 16095  	*_paPgno = elem7(_aPgno, uintptr(4294967295))
 16096  	*_paHash = _1_aHash
 16097  	*_piZero = _1_iZero
 16098  _3:
 16099  	return _rc
 16100  }
 16101  
 16102  // C comment
 16103  //  /*
 16104  //  ** Obtain a pointer to the iPage'th page of the wal-index. The wal-index
 16105  //  ** is broken into pages of WALINDEX_PGSZ bytes. Wal-index pages are
 16106  //  ** numbered from zero.
 16107  //  **
 16108  //  ** If this call is successful, *ppPage is set to point to the wal-index
 16109  //  ** page and SQLITE_OK is returned. If an error (an OOM or VFS error) occurs,
 16110  //  ** then an SQLite error code is returned and *ppPage is set to 0.
 16111  //  */
 16112  func _walIndexPage(tls *crt.TLS, _pWal *XWal, _iPage int32, _ppPage **uint32) (r0 int32) {
 16113  	var _rc, _1_nByte int32
 16114  	var _1_apNew **uint32
 16115  	_rc = int32(0)
 16116  	if _pWal.XnWiData > _iPage {
 16117  		goto _0
 16118  	}
 16119  	_1_nByte = int32(uint32(4) * uint32(_iPage+int32(1)))
 16120  	_1_apNew = (**uint32)(Xsqlite3_realloc64(tls, unsafe.Pointer(_pWal.XapWiData), uint64(_1_nByte)))
 16121  	if _1_apNew == nil {
 16122  		*_ppPage = nil
 16123  		return _sqlite3NomemError(tls, int32(55025))
 16124  	}
 16125  	crt.Xmemset(tls, unsafe.Pointer(elem36(_1_apNew, uintptr(_pWal.XnWiData))), int32(0), uint32(4)*uint32((_iPage+int32(1))-_pWal.XnWiData))
 16126  	_pWal.XapWiData = _1_apNew
 16127  	_pWal.XnWiData = _iPage + int32(1)
 16128  _0:
 16129  	if (*elem36(_pWal.XapWiData, uintptr(_iPage))) != nil {
 16130  		goto _2
 16131  	}
 16132  	if int32(_pWal.XexclusiveMode) != int32(2) {
 16133  		goto _3
 16134  	}
 16135  	*elem36(_pWal.XapWiData, uintptr(_iPage)) = (*uint32)(_sqlite3MallocZero(tls, uint64(32768)))
 16136  	if (*elem36(_pWal.XapWiData, uintptr(_iPage))) == nil {
 16137  		_rc = _sqlite3NomemError(tls, int32(55037))
 16138  	}
 16139  	goto _5
 16140  _3:
 16141  	_rc = _sqlite3OsShmMap(tls, (*Xsqlite3_file)(_pWal.XpDbFd), _iPage, int32(32768), int32(_pWal.XwriteLock), (*unsafe.Pointer)(unsafe.Pointer(elem36(_pWal.XapWiData, uintptr(_iPage)))))
 16142  	if _rc == int32(8) {
 16143  		{
 16144  			p := &_pWal.XreadOnly
 16145  			*p = uint8(int32(*p) | int32(2))
 16146  		}
 16147  		_rc = int32(0)
 16148  	}
 16149  _5:
 16150  _2:
 16151  	*_ppPage = *elem36(_pWal.XapWiData, uintptr(_iPage))
 16152  	func() {
 16153  		if _iPage != int32(0) && (*_ppPage) == nil && _rc == int32(0) {
 16154  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55050), unsafe.Pointer(&_walIndexPageØ00__func__Ø000), unsafe.Pointer(str(15720)))
 16155  			crt.X__builtin_abort(tls)
 16156  		}
 16157  	}()
 16158  	return _rc
 16159  }
 16160  
 16161  func _sqlite3OsShmMap(tls *crt.TLS, _id *Xsqlite3_file, _iPage int32, _pgsz int32, _bExtend int32, _pp *unsafe.Pointer) (r0 int32) {
 16162  	return func() func(*crt.TLS, *Xsqlite3_file, int32, int32, int32, *unsafe.Pointer) int32 {
 16163  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxShmMap
 16164  		return *(*func(*crt.TLS, *Xsqlite3_file, int32, int32, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&v))
 16165  	}()(tls, _id, _iPage, _pgsz, _bExtend, _pp)
 16166  }
 16167  
 16168  var _walIndexPageØ00__func__Ø000 [13]int8
 16169  
 16170  func init() {
 16171  	crt.Xstrncpy(nil, &_walIndexPageØ00__func__Ø000[0], str(15757), 13)
 16172  }
 16173  
 16174  var _walHashGetØ00__func__Ø000 [11]int8
 16175  
 16176  func init() {
 16177  	crt.Xstrncpy(nil, &_walHashGetØ00__func__Ø000[0], str(15770), 11)
 16178  }
 16179  
 16180  // C comment
 16181  //  /*
 16182  //  ** This function is invoked once for each page that has already been
 16183  //  ** written into the log file when a WAL transaction is rolled back.
 16184  //  ** Parameter iPg is the page number of said page. The pCtx argument
 16185  //  ** is actually a pointer to the Pager structure.
 16186  //  **
 16187  //  ** If page iPg is present in the cache, and has no outstanding references,
 16188  //  ** it is discarded. Otherwise, if there are one or more outstanding
 16189  //  ** references, the page content is reloaded from the database. If the
 16190  //  ** attempt to reload content from the database is required and fails,
 16191  //  ** return an SQLite error code. Otherwise, SQLITE_OK.
 16192  //  */
 16193  func _pagerUndoCallback(tls *crt.TLS, _pCtx unsafe.Pointer, _iPg uint32) (r0 int32) {
 16194  	var _rc int32
 16195  	var _3_iFrame uint32
 16196  	var _pPager *XPager
 16197  	var _pPg *XPgHdr
 16198  	_rc = int32(0)
 16199  	_pPager = (*XPager)(_pCtx)
 16200  	func() {
 16201  		if (*XWal)(_pPager.XpWal) == nil {
 16202  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49991), unsafe.Pointer(&_pagerUndoCallbackØ00__func__Ø000), unsafe.Pointer(str(15781)))
 16203  			crt.X__builtin_abort(tls)
 16204  		}
 16205  	}()
 16206  	_pPg = _sqlite3PagerLookup(tls, _pPager, _iPg)
 16207  	if _pPg == nil {
 16208  		goto _2
 16209  	}
 16210  	if _sqlite3PcachePageRefcount(tls, _pPg) == int32(1) {
 16211  		_sqlite3PcacheDrop(tls, _pPg)
 16212  		goto _4
 16213  	}
 16214  	_3_iFrame = uint32(0)
 16215  	_rc = _sqlite3WalFindFrame(tls, (*XWal)(_pPager.XpWal), _pPg.Xpgno, &_3_iFrame)
 16216  	if _rc == int32(0) {
 16217  		_rc = _readDbPage(tls, _pPg, _3_iFrame)
 16218  	}
 16219  	if _rc == int32(0) {
 16220  		func() func(*crt.TLS, *XPgHdr) {
 16221  			v := _pPager.XxReiniter
 16222  			return *(*func(*crt.TLS, *XPgHdr))(unsafe.Pointer(&v))
 16223  		}()(tls, _pPg)
 16224  	}
 16225  	_sqlite3PagerUnrefNotNull(tls, _pPg)
 16226  _4:
 16227  _2:
 16228  	_sqlite3BackupRestart(tls, (*Xsqlite3_backup)(_pPager.XpBackup))
 16229  	return _rc
 16230  }
 16231  
 16232  var _pagerUndoCallbackØ00__func__Ø000 [18]int8
 16233  
 16234  func init() {
 16235  	crt.Xstrncpy(nil, &_pagerUndoCallbackØ00__func__Ø000[0], str(15801), 18)
 16236  }
 16237  
 16238  // C comment
 16239  //  /*
 16240  //  ** Acquire a page if it is already in the in-memory cache.  Do
 16241  //  ** not read the page from disk.  Return a pointer to the page,
 16242  //  ** or 0 if the page is not in cache.
 16243  //  **
 16244  //  ** See also sqlite3PagerGet().  The difference between this routine
 16245  //  ** and sqlite3PagerGet() is that _get() will go to the disk and read
 16246  //  ** in the page if the page is not already in cache.  This routine
 16247  //  ** returns NULL if the page is not in cache or if a disk I/O error
 16248  //  ** has ever happened.
 16249  //  */
 16250  func _sqlite3PagerLookup(tls *crt.TLS, _pPager *XPager, _pgno uint32) (r0 *XPgHdr) {
 16251  	var _pPage *Xsqlite3_pcache_page
 16252  	func() {
 16253  		if _pPager == nil {
 16254  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52532), unsafe.Pointer(&_sqlite3PagerLookupØ00__func__Ø000), unsafe.Pointer(str(15819)))
 16255  			crt.X__builtin_abort(tls)
 16256  		}
 16257  	}()
 16258  	func() {
 16259  		if _pgno == (0) {
 16260  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52533), unsafe.Pointer(&_sqlite3PagerLookupØ00__func__Ø000), unsafe.Pointer(str(15829)))
 16261  			crt.X__builtin_abort(tls)
 16262  		}
 16263  	}()
 16264  	func() {
 16265  		if (*XPCache)(_pPager.XpPCache) == nil {
 16266  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52534), unsafe.Pointer(&_sqlite3PagerLookupØ00__func__Ø000), unsafe.Pointer(str(15837)))
 16267  			crt.X__builtin_abort(tls)
 16268  		}
 16269  	}()
 16270  	_pPage = _sqlite3PcacheFetch(tls, (*XPCache)(_pPager.XpPCache), _pgno, int32(0))
 16271  	func() {
 16272  		if _pPage != nil && _pPager.XhasHeldSharedLock == 0 {
 16273  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52536), unsafe.Pointer(&_sqlite3PagerLookupØ00__func__Ø000), unsafe.Pointer(str(15856)))
 16274  			crt.X__builtin_abort(tls)
 16275  		}
 16276  	}()
 16277  	if _pPage == nil {
 16278  		return nil
 16279  	}
 16280  	return _sqlite3PcacheFetchFinish(tls, (*XPCache)(_pPager.XpPCache), _pgno, _pPage)
 16281  }
 16282  
 16283  var _sqlite3PagerLookupØ00__func__Ø000 [19]int8
 16284  
 16285  func init() {
 16286  	crt.Xstrncpy(nil, &_sqlite3PagerLookupØ00__func__Ø000[0], str(15894), 19)
 16287  }
 16288  
 16289  // C comment
 16290  //  /*
 16291  //  ** Try to obtain a page from the cache.
 16292  //  **
 16293  //  ** This routine returns a pointer to an sqlite3_pcache_page object if
 16294  //  ** such an object is already in cache, or if a new one is created.
 16295  //  ** This routine returns a NULL pointer if the object was not in cache
 16296  //  ** and could not be created.
 16297  //  **
 16298  //  ** The createFlags should be 0 to check for existing pages and should
 16299  //  ** be 3 (not 1, but 3) to try to create a new page.
 16300  //  **
 16301  //  ** If the createFlag is 0, then NULL is always returned if the page
 16302  //  ** is not already in the cache.  If createFlag is 1, then a new page
 16303  //  ** is created only if that can be done without spilling dirty pages
 16304  //  ** and without exceeding the cache size limit.
 16305  //  **
 16306  //  ** The caller needs to invoke sqlite3PcacheFetchFinish() to properly
 16307  //  ** initialize the sqlite3_pcache_page object and convert it into a
 16308  //  ** PgHdr object.  The sqlite3PcacheFetch() and sqlite3PcacheFetchFinish()
 16309  //  ** routines are split this way for performance reasons. When separated
 16310  //  ** they can both (usually) operate without having to push values to
 16311  //  ** the stack on entry and pop them back off on exit, which saves a
 16312  //  ** lot of pushing and popping.
 16313  //  */
 16314  func _sqlite3PcacheFetch(tls *crt.TLS, _pCache *XPCache, _pgno uint32, _createFlag int32) (r0 *Xsqlite3_pcache_page) {
 16315  	var _eCreate int32
 16316  	var _pRes *Xsqlite3_pcache_page
 16317  	func() {
 16318  		if _pCache == nil {
 16319  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44495), unsafe.Pointer(&_sqlite3PcacheFetchØ00__func__Ø000), unsafe.Pointer(str(13961)))
 16320  			crt.X__builtin_abort(tls)
 16321  		}
 16322  	}()
 16323  	func() {
 16324  		if _pCache.XpCache == nil {
 16325  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44496), unsafe.Pointer(&_sqlite3PcacheFetchØ00__func__Ø000), unsafe.Pointer(str(15913)))
 16326  			crt.X__builtin_abort(tls)
 16327  		}
 16328  	}()
 16329  	func() {
 16330  		if _createFlag != int32(3) && _createFlag != int32(0) {
 16331  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44497), unsafe.Pointer(&_sqlite3PcacheFetchØ00__func__Ø000), unsafe.Pointer(str(15931)))
 16332  			crt.X__builtin_abort(tls)
 16333  		}
 16334  	}()
 16335  	func() {
 16336  		if int32(_pCache.XeCreate) != func() int32 {
 16337  			if (_pCache.XbPurgeable != 0) && (_pCache.XpDirty != nil) {
 16338  				return int32(1)
 16339  			}
 16340  			return int32(2)
 16341  		}() {
 16342  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44498), unsafe.Pointer(&_sqlite3PcacheFetchØ00__func__Ø000), unsafe.Pointer(str(15962)))
 16343  			crt.X__builtin_abort(tls)
 16344  		}
 16345  	}()
 16346  	_eCreate = _createFlag & int32(_pCache.XeCreate)
 16347  	func() {
 16348  		if _eCreate != int32(0) && _eCreate != int32(1) && _eCreate != int32(2) {
 16349  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44508), unsafe.Pointer(&_sqlite3PcacheFetchØ00__func__Ø000), unsafe.Pointer(str(16028)))
 16350  			crt.X__builtin_abort(tls)
 16351  		}
 16352  	}()
 16353  	func() {
 16354  		if _createFlag != int32(0) && int32(_pCache.XeCreate) != _eCreate {
 16355  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44509), unsafe.Pointer(&_sqlite3PcacheFetchØ00__func__Ø000), unsafe.Pointer(str(16067)))
 16356  			crt.X__builtin_abort(tls)
 16357  		}
 16358  	}()
 16359  	func() {
 16360  		if _createFlag != int32(0) && _eCreate != (int32(1)+bool2int((_pCache.XbPurgeable == 0) || (_pCache.XpDirty == nil))) {
 16361  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44510), unsafe.Pointer(&_sqlite3PcacheFetchØ00__func__Ø000), unsafe.Pointer(str(16109)))
 16362  			crt.X__builtin_abort(tls)
 16363  		}
 16364  	}()
 16365  	_pRes = func() func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page {
 16366  		v := _sqlite3Config.Xpcache2.XxFetch
 16367  		return *(*func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page)(unsafe.Pointer(&v))
 16368  	}()(tls, _pCache.XpCache, _pgno, _eCreate)
 16369  	return _pRes
 16370  }
 16371  
 16372  var _sqlite3PcacheFetchØ00__func__Ø000 [19]int8
 16373  
 16374  func init() {
 16375  	crt.Xstrncpy(nil, &_sqlite3PcacheFetchØ00__func__Ø000[0], str(16176), 19)
 16376  }
 16377  
 16378  // C comment
 16379  //  /*
 16380  //  ** This routine converts the sqlite3_pcache_page object returned by
 16381  //  ** sqlite3PcacheFetch() into an initialized PgHdr object.  This routine
 16382  //  ** must be called after sqlite3PcacheFetch() in order to get a usable
 16383  //  ** result.
 16384  //  */
 16385  func _sqlite3PcacheFetchFinish(tls *crt.TLS, _pCache *XPCache, _pgno uint32, _pPage *Xsqlite3_pcache_page) (r0 *XPgHdr) {
 16386  	var _pPgHdr *XPgHdr
 16387  	func() {
 16388  		if _pPage == nil {
 16389  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44617), unsafe.Pointer(&_sqlite3PcacheFetchFinishØ00__func__Ø000), unsafe.Pointer(str(2800)))
 16390  			crt.X__builtin_abort(tls)
 16391  		}
 16392  	}()
 16393  	_pPgHdr = (*XPgHdr)(_pPage.XpExtra)
 16394  	if _pPgHdr.XpPage == nil {
 16395  		return _pcacheFetchFinishWithInit(tls, _pCache, _pgno, _pPage)
 16396  	}
 16397  	_pCache.XnRefSum += 1
 16398  	_pPgHdr.XnRef += 1
 16399  	func() {
 16400  		if _sqlite3PcachePageSanity(tls, _pPgHdr) == 0 {
 16401  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44625), unsafe.Pointer(&_sqlite3PcacheFetchFinishØ00__func__Ø000), unsafe.Pointer(str(16195)))
 16402  			crt.X__builtin_abort(tls)
 16403  		}
 16404  	}()
 16405  	return _pPgHdr
 16406  }
 16407  
 16408  var _sqlite3PcacheFetchFinishØ00__func__Ø000 [25]int8
 16409  
 16410  func init() {
 16411  	crt.Xstrncpy(nil, &_sqlite3PcacheFetchFinishØ00__func__Ø000[0], str(16227), 25)
 16412  }
 16413  
 16414  // C comment
 16415  //  /*
 16416  //  ** This is a helper routine for sqlite3PcacheFetchFinish()
 16417  //  **
 16418  //  ** In the uncommon case where the page being fetched has not been
 16419  //  ** initialized, this routine is invoked to do the initialization.
 16420  //  ** This routine is broken out into a separate function since it
 16421  //  ** requires extra stack manipulation that can be avoided in the common
 16422  //  ** case.
 16423  //  */
 16424  func _pcacheFetchFinishWithInit(tls *crt.TLS, _pCache *XPCache, _pgno uint32, _pPage *Xsqlite3_pcache_page) (r0 *XPgHdr) {
 16425  	var _pPgHdr *XPgHdr
 16426  	func() {
 16427  		if _pPage == nil {
 16428  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44590), unsafe.Pointer(&_pcacheFetchFinishWithInitØ00__func__Ø000), unsafe.Pointer(str(2800)))
 16429  			crt.X__builtin_abort(tls)
 16430  		}
 16431  	}()
 16432  	_pPgHdr = (*XPgHdr)(_pPage.XpExtra)
 16433  	func() {
 16434  		if (*Xsqlite3_pcache_page)(_pPgHdr.XpPage) != nil {
 16435  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44592), unsafe.Pointer(&_pcacheFetchFinishWithInitØ00__func__Ø000), unsafe.Pointer(str(16252)))
 16436  			crt.X__builtin_abort(tls)
 16437  		}
 16438  	}()
 16439  	crt.Xmemset(tls, unsafe.Pointer(&_pPgHdr.XpDirty), int32(0), uint32(28))
 16440  	*(**Xsqlite3_pcache_page)(unsafe.Pointer(&_pPgHdr.XpPage)) = _pPage
 16441  	_pPgHdr.XpData = _pPage.XpBuf
 16442  	_pPgHdr.XpExtra = unsafe.Pointer(elem34(_pPgHdr, uintptr(1)))
 16443  	crt.Xmemset(tls, _pPgHdr.XpExtra, int32(0), uint32(8))
 16444  	*(**XPCache)(unsafe.Pointer(&_pPgHdr.XpCache)) = _pCache
 16445  	_pPgHdr.Xpgno = _pgno
 16446  	_pPgHdr.Xflags = uint16(1)
 16447  	return _sqlite3PcacheFetchFinish(tls, _pCache, _pgno, _pPage)
 16448  }
 16449  
 16450  var _pcacheFetchFinishWithInitØ00__func__Ø000 [26]int8
 16451  
 16452  func init() {
 16453  	crt.Xstrncpy(nil, &_pcacheFetchFinishWithInitØ00__func__Ø000[0], str(16269), 26)
 16454  }
 16455  
 16456  // C comment
 16457  //  /*
 16458  //  ** Return the number of references to the page supplied as an argument.
 16459  //  */
 16460  func _sqlite3PcachePageRefcount(tls *crt.TLS, _p *XPgHdr) (r0 int32) {
 16461  	return int32(_p.XnRef)
 16462  }
 16463  
 16464  // C comment
 16465  //  /*
 16466  //  ** Drop a page from the cache. There must be exactly one reference to the
 16467  //  ** page. This function deletes that reference, so after it returns the
 16468  //  ** page pointed to by p is invalid.
 16469  //  */
 16470  func _sqlite3PcacheDrop(tls *crt.TLS, _p *XPgHdr) {
 16471  	func() {
 16472  		if int32(_p.XnRef) != int32(1) {
 16473  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44665), unsafe.Pointer(&_sqlite3PcacheDropØ00__func__Ø000), unsafe.Pointer(str(16295)))
 16474  			crt.X__builtin_abort(tls)
 16475  		}
 16476  	}()
 16477  	func() {
 16478  		if _sqlite3PcachePageSanity(tls, _p) == 0 {
 16479  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44666), unsafe.Pointer(&_sqlite3PcacheDropØ00__func__Ø000), unsafe.Pointer(str(13822)))
 16480  			crt.X__builtin_abort(tls)
 16481  		}
 16482  	}()
 16483  	if (int32(_p.Xflags) & int32(2)) != 0 {
 16484  		_pcacheManageDirtyList(tls, _p, uint8(1))
 16485  	}
 16486  	(*XPCache)(_p.XpCache).XnRefSum -= 1
 16487  	func() func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, int32) {
 16488  		v := _sqlite3Config.Xpcache2.XxUnpin
 16489  		return *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, int32))(unsafe.Pointer(&v))
 16490  	}()(tls, (*XPCache)(_p.XpCache).XpCache, (*Xsqlite3_pcache_page)(_p.XpPage), int32(1))
 16491  }
 16492  
 16493  var _sqlite3PcacheDropØ00__func__Ø000 [18]int8
 16494  
 16495  func init() {
 16496  	crt.Xstrncpy(nil, &_sqlite3PcacheDropØ00__func__Ø000[0], str(16306), 18)
 16497  }
 16498  
 16499  // C comment
 16500  //  /*
 16501  //  ** Search the wal file for page pgno. If found, set *piRead to the frame that
 16502  //  ** contains the page. Otherwise, if pgno is not in the wal file, set *piRead
 16503  //  ** to zero.
 16504  //  **
 16505  //  ** Return SQLITE_OK if successful, or an error code if an error occurs. If an
 16506  //  ** error does occur, the final value of *piRead is undefined.
 16507  //  */
 16508  func _sqlite3WalFindFrame(tls *crt.TLS, _pWal *XWal, _pgno uint32, _piRead *uint32) (r0 int32) {
 16509  	var _iHash, _iMinHash, _2_iKey, _2_nCollide, _2_rc int32
 16510  	var _iRead, _iLast, _2_iZero, _4_iFrame uint32
 16511  	var _2_aPgno *uint32
 16512  	var _2_aHash *uint16
 16513  	_iRead = uint32(0)
 16514  	_iLast = _pWal.Xhdr.XmxFrame
 16515  	func() {
 16516  		if int32(_pWal.XreadLock) < int32(0) && _pWal.XlockError == 0 {
 16517  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57067), unsafe.Pointer(&_sqlite3WalFindFrameØ00__func__Ø000), unsafe.Pointer(str(16324)))
 16518  			crt.X__builtin_abort(tls)
 16519  		}
 16520  	}()
 16521  	if (_iLast == (0)) || (int32(_pWal.XreadLock) == int32(0)) {
 16522  		*_piRead = 0
 16523  		return int32(0)
 16524  	}
 16525  	_iMinHash = _walFramePage(tls, _pWal.XminFrame)
 16526  	_iHash = _walFramePage(tls, _iLast)
 16527  _5:
 16528  	if _iHash < _iMinHash || _iRead != (0) {
 16529  		goto _9
 16530  	}
 16531  	_2_rc = _walHashGet(tls, _pWal, _iHash, &_2_aHash, &_2_aPgno, &_2_iZero)
 16532  	if _2_rc != int32(0) {
 16533  		return _2_rc
 16534  	}
 16535  	_2_nCollide = int32(8192)
 16536  	_2_iKey = _walHash(tls, _pgno)
 16537  _11:
 16538  	if (*elem20(_2_aHash, uintptr(_2_iKey))) == 0 {
 16539  		goto _14
 16540  	}
 16541  	_4_iFrame = uint32(*elem20(_2_aHash, uintptr(_2_iKey))) + _2_iZero
 16542  	if ((_4_iFrame <= _iLast) && (_4_iFrame >= _pWal.XminFrame)) && ((*elem7(_2_aPgno, uintptr(*elem20(_2_aHash, uintptr(_2_iKey))))) == _pgno) {
 16543  		func() {
 16544  			if _4_iFrame <= _iRead && _sqlite3Config.XneverCorrupt != int32(0) {
 16545  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57122), unsafe.Pointer(&_sqlite3WalFindFrameØ00__func__Ø000), unsafe.Pointer(str(16361)))
 16546  				crt.X__builtin_abort(tls)
 16547  			}
 16548  		}()
 16549  		_iRead = _4_iFrame
 16550  	}
 16551  	if postInc2(&_2_nCollide, -1) == int32(0) {
 16552  		return _sqlite3CorruptError(tls, int32(57126))
 16553  	}
 16554  	_2_iKey = _walNextHash(tls, _2_iKey)
 16555  	goto _11
 16556  _14:
 16557  	_iHash -= 1
 16558  	goto _5
 16559  _9:
 16560  	*_piRead = _iRead
 16561  	return int32(0)
 16562  
 16563  	_ = _2_nCollide
 16564  	panic(0)
 16565  }
 16566  
 16567  var _sqlite3WalFindFrameØ00__func__Ø000 [20]int8
 16568  
 16569  func init() {
 16570  	crt.Xstrncpy(nil, &_sqlite3WalFindFrameØ00__func__Ø000[0], str(16388), 20)
 16571  }
 16572  
 16573  // C comment
 16574  //  /*
 16575  //  ** Compute a hash on a page number.  The resulting hash value must land
 16576  //  ** between 0 and (HASHTABLE_NSLOT-1).  The walHashNext() function advances
 16577  //  ** the hash to the next value in the event of a collision.
 16578  //  */
 16579  func _walHash(tls *crt.TLS, _iPage uint32) (r0 int32) {
 16580  	func() {
 16581  		if _iPage <= (0) {
 16582  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55316), unsafe.Pointer(&_walHashØ00__func__Ø000), unsafe.Pointer(str(16408)))
 16583  			crt.X__builtin_abort(tls)
 16584  		}
 16585  	}()
 16586  	return int32((_iPage * uint32(383)) & uint32(8191))
 16587  }
 16588  
 16589  var _walHashØ00__func__Ø000 [8]int8
 16590  
 16591  func init() {
 16592  	crt.Xstrncpy(nil, &_walHashØ00__func__Ø000[0], str(16416), 8)
 16593  }
 16594  
 16595  func _walNextHash(tls *crt.TLS, _iPriorHash int32) (r0 int32) {
 16596  	return (_iPriorHash + int32(1)) & int32(8191)
 16597  }
 16598  
 16599  // C comment
 16600  //  /*
 16601  //  ** Read the content for page pPg out of the database file and into
 16602  //  ** pPg->pData. A shared lock or greater must be held on the database
 16603  //  ** file before this function is called.
 16604  //  **
 16605  //  ** If page 1 is read, then the value of Pager.dbFileVers[] is set to
 16606  //  ** the value read from the database file.
 16607  //  **
 16608  //  ** If an IO error occurs, then the IO error is returned to the caller.
 16609  //  ** Otherwise, SQLITE_OK is returned.
 16610  //  */
 16611  func _readDbPage(tls *crt.TLS, _pPg *XPgHdr, _iFrame uint32) (r0 int32) {
 16612  	var _rc, _pgsz int32
 16613  	var _2_iOffset int64
 16614  	var _pgno uint32
 16615  	var _6_dbFileVers *uint8
 16616  	var _pPager *XPager
 16617  	_pPager = (*XPager)(_pPg.XpPager)
 16618  	_pgno = _pPg.Xpgno
 16619  	_rc = int32(0)
 16620  	_pgsz = _pPager.XpageSize
 16621  	func() {
 16622  		if int32(_pPager.XeState) < int32(1) || _pPager.XmemDb != 0 {
 16623  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49903), unsafe.Pointer(&_readDbPageØ00__func__Ø000), unsafe.Pointer(str(16424)))
 16624  			crt.X__builtin_abort(tls)
 16625  		}
 16626  	}()
 16627  	func() {
 16628  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil {
 16629  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49904), unsafe.Pointer(&_readDbPageØ00__func__Ø000), unsafe.Pointer(str(16463)))
 16630  			crt.X__builtin_abort(tls)
 16631  		}
 16632  	}()
 16633  	if _iFrame != 0 {
 16634  		_rc = _sqlite3WalReadFrame(tls, (*XWal)(_pPager.XpWal), _iFrame, _pgsz, (*uint8)(_pPg.XpData))
 16635  		goto _6
 16636  	}
 16637  	_2_iOffset = int64(_pgno-uint32(1)) * int64(_pPager.XpageSize)
 16638  	_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.Xfd), _pPg.XpData, _pgsz, _2_iOffset)
 16639  	if _rc == int32(522) {
 16640  		_rc = int32(0)
 16641  	}
 16642  _6:
 16643  	if _pgno != uint32(1) {
 16644  		goto _8
 16645  	}
 16646  	if _rc != 0 {
 16647  		crt.Xmemset(tls, unsafe.Pointer(&_pPager.XdbFileVers), int32(255), uint32(16))
 16648  		goto _10
 16649  	}
 16650  	_6_dbFileVers = elem15((*uint8)(_pPg.XpData), uintptr(24))
 16651  	crt.Xmemcpy(tls, unsafe.Pointer(&_pPager.XdbFileVers), unsafe.Pointer(_6_dbFileVers), uint32(16))
 16652  _10:
 16653  _8:
 16654  	return _rc
 16655  }
 16656  
 16657  var _readDbPageØ00__func__Ø000 [11]int8
 16658  
 16659  func init() {
 16660  	crt.Xstrncpy(nil, &_readDbPageØ00__func__Ø000[0], str(16482), 11)
 16661  }
 16662  
 16663  // C comment
 16664  //  /*
 16665  //  ** Read the contents of frame iRead from the wal file into buffer pOut
 16666  //  ** (which is nOut bytes in size). Return SQLITE_OK if successful, or an
 16667  //  ** error code otherwise.
 16668  //  */
 16669  func _sqlite3WalReadFrame(tls *crt.TLS, _pWal *XWal, _iRead uint32, _nOut int32, _pOut *uint8) (r0 int32) {
 16670  	var _sz int32
 16671  	var _iOffset int64
 16672  	_sz = int32(_pWal.Xhdr.XszPage)
 16673  	_sz = (_sz & int32(65024)) + ((_sz & int32(1)) << 16)
 16674  	_iOffset = (int64(32) + (int64(_iRead-uint32(1)) * int64(_sz+int32(24)))) + int64(24)
 16675  	return _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.XpWalFd), unsafe.Pointer(_pOut), func() int32 {
 16676  		if _nOut > _sz {
 16677  			return _sz
 16678  		}
 16679  		return _nOut
 16680  	}(), _iOffset)
 16681  }
 16682  
 16683  func _sqlite3OsRead(tls *crt.TLS, _id *Xsqlite3_file, _pBuf unsafe.Pointer, _amt int32, _offset int64) (r0 int32) {
 16684  	return func() func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32 {
 16685  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxRead
 16686  		return *(*func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&v))
 16687  	}()(tls, _id, _pBuf, _amt, _offset)
 16688  }
 16689  
 16690  // C comment
 16691  //  /*
 16692  //  ** Restart the backup process. This is called when the pager layer
 16693  //  ** detects that the database has been modified by an external database
 16694  //  ** connection. In this case there is no way of knowing which of the
 16695  //  ** pages that have been copied into the destination database are still
 16696  //  ** valid and which are not, so the entire process needs to be restarted.
 16697  //  **
 16698  //  ** It is assumed that the mutex associated with the BtShared object
 16699  //  ** corresponding to the source database is held when this function is
 16700  //  ** called.
 16701  //  */
 16702  func _sqlite3BackupRestart(tls *crt.TLS, _pBackup *Xsqlite3_backup) {
 16703  	var _p *Xsqlite3_backup
 16704  	_p = _pBackup
 16705  _0:
 16706  	if _p == nil {
 16707  		goto _3
 16708  	}
 16709  	func() {
 16710  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)((*XBtree)(_p.XpSrc).XpBt).Xmutex)) == 0 {
 16711  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69631), unsafe.Pointer(&_sqlite3BackupRestartØ00__func__Ø000), unsafe.Pointer(str(16493)))
 16712  			crt.X__builtin_abort(tls)
 16713  		}
 16714  	}()
 16715  	_p.XiNext = uint32(1)
 16716  	_p = (*Xsqlite3_backup)(_p.XpNext)
 16717  	goto _0
 16718  _3:
 16719  }
 16720  
 16721  var _sqlite3BackupRestartØ00__func__Ø000 [21]int8
 16722  
 16723  func init() {
 16724  	crt.Xstrncpy(nil, &_sqlite3BackupRestartØ00__func__Ø000[0], str(16533), 21)
 16725  }
 16726  
 16727  // C comment
 16728  //  /*
 16729  //  ** Return a list of all dirty pages in the cache, sorted by page number.
 16730  //  */
 16731  func _sqlite3PcacheDirtyList(tls *crt.TLS, _pCache *XPCache) (r0 *XPgHdr) {
 16732  	var _p *XPgHdr
 16733  	_p = (*XPgHdr)(_pCache.XpDirty)
 16734  _0:
 16735  	if _p == nil {
 16736  		goto _3
 16737  	}
 16738  	*(**XPgHdr)(unsafe.Pointer(&_p.XpDirty)) = (*XPgHdr)(_p.XpDirtyNext)
 16739  	_p = (*XPgHdr)(_p.XpDirtyNext)
 16740  	goto _0
 16741  _3:
 16742  	return _pcacheSortDirtyList(tls, (*XPgHdr)(_pCache.XpDirty))
 16743  }
 16744  
 16745  func _pcacheSortDirtyList(tls *crt.TLS, _pIn *XPgHdr) (r0 *XPgHdr) {
 16746  	var _i int32
 16747  	var _p *XPgHdr
 16748  	var _a [32]*XPgHdr
 16749  	crt.Xmemset(tls, unsafe.Pointer(&_a), int32(0), uint32(128))
 16750  _0:
 16751  	if _pIn == nil {
 16752  		goto _1
 16753  	}
 16754  	_p = _pIn
 16755  	_pIn = (*XPgHdr)(_p.XpDirty)
 16756  	*(**XPgHdr)(unsafe.Pointer(&_p.XpDirty)) = nil
 16757  	_i = int32(0)
 16758  _2:
 16759  	if func() int32 {
 16760  		if _i < int32(31) {
 16761  			return int32(1)
 16762  		}
 16763  		return func() int32 {
 16764  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44866), unsafe.Pointer(&_pcacheSortDirtyListØ00__func__Ø000), unsafe.Pointer(str(4809)))
 16765  			crt.X__builtin_abort(tls)
 16766  			return int32(0)
 16767  		}()
 16768  	}() == 0 {
 16769  		goto _7
 16770  	}
 16771  	if (*elem37((**XPgHdr)(unsafe.Pointer(&_a)), uintptr(_i))) == nil {
 16772  		*elem37((**XPgHdr)(unsafe.Pointer(&_a)), uintptr(_i)) = _p
 16773  		goto _7
 16774  	}
 16775  	_p = _pcacheMergeDirtyList(tls, *elem37((**XPgHdr)(unsafe.Pointer(&_a)), uintptr(_i)), _p)
 16776  	*elem37((**XPgHdr)(unsafe.Pointer(&_a)), uintptr(_i)) = nil
 16777  	_i += 1
 16778  	goto _2
 16779  _7:
 16780  	if func() int32 {
 16781  		if _i == int32(31) {
 16782  			return func() int32 {
 16783  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44875), unsafe.Pointer(&_pcacheSortDirtyListØ00__func__Ø000), unsafe.Pointer(str(4809)))
 16784  				crt.X__builtin_abort(tls)
 16785  				return int32(1)
 16786  			}()
 16787  		}
 16788  		return int32(0)
 16789  	}() != 0 {
 16790  		*elem37((**XPgHdr)(unsafe.Pointer(&_a)), uintptr(_i)) = _pcacheMergeDirtyList(tls, *elem37((**XPgHdr)(unsafe.Pointer(&_a)), uintptr(_i)), _p)
 16791  	}
 16792  	goto _0
 16793  _1:
 16794  	_p = *elem37((**XPgHdr)(unsafe.Pointer(&_a)), 0)
 16795  	_i = int32(1)
 16796  _13:
 16797  	if _i >= int32(32) {
 16798  		goto _16
 16799  	}
 16800  	if (*elem37((**XPgHdr)(unsafe.Pointer(&_a)), uintptr(_i))) == nil {
 16801  		goto _14
 16802  	}
 16803  	_p = func() *XPgHdr {
 16804  		if _p != nil {
 16805  			return _pcacheMergeDirtyList(tls, _p, *elem37((**XPgHdr)(unsafe.Pointer(&_a)), uintptr(_i)))
 16806  		}
 16807  		return (*elem37((**XPgHdr)(unsafe.Pointer(&_a)), uintptr(_i)))
 16808  	}()
 16809  _14:
 16810  	_i += 1
 16811  	goto _13
 16812  _16:
 16813  	return _p
 16814  
 16815  	_ = _a
 16816  	panic(0)
 16817  }
 16818  
 16819  var _pcacheSortDirtyListØ00__func__Ø000 [20]int8
 16820  
 16821  func init() {
 16822  	crt.Xstrncpy(nil, &_pcacheSortDirtyListØ00__func__Ø000[0], str(16554), 20)
 16823  }
 16824  
 16825  // C comment
 16826  //  /*
 16827  //  ** Merge two lists of pages connected by pDirty and in pgno order.
 16828  //  ** Do not bother fixing the pDirtyPrev pointers.
 16829  //  */
 16830  func _pcacheMergeDirtyList(tls *crt.TLS, _pA *XPgHdr, _pB *XPgHdr) (r0 *XPgHdr) {
 16831  	var _result XPgHdr
 16832  	var _pTail *XPgHdr
 16833  	_pTail = &_result
 16834  	func() {
 16835  		if _pA == nil || _pB == nil {
 16836  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44824), unsafe.Pointer(&_pcacheMergeDirtyListØ00__func__Ø000), unsafe.Pointer(str(16574)))
 16837  			crt.X__builtin_abort(tls)
 16838  		}
 16839  	}()
 16840  _3:
 16841  	if _pA.Xpgno >= _pB.Xpgno {
 16842  		goto _6
 16843  	}
 16844  	*(**XPgHdr)(unsafe.Pointer(&_pTail.XpDirty)) = _pA
 16845  	_pTail = _pA
 16846  	_pA = (*XPgHdr)(_pA.XpDirty)
 16847  	if _pA == nil {
 16848  		*(**XPgHdr)(unsafe.Pointer(&_pTail.XpDirty)) = _pB
 16849  		goto _5
 16850  	}
 16851  	goto _8
 16852  _6:
 16853  	*(**XPgHdr)(unsafe.Pointer(&_pTail.XpDirty)) = _pB
 16854  	_pTail = _pB
 16855  	_pB = (*XPgHdr)(_pB.XpDirty)
 16856  	if _pB == nil {
 16857  		*(**XPgHdr)(unsafe.Pointer(&_pTail.XpDirty)) = _pA
 16858  		goto _5
 16859  	}
 16860  _8:
 16861  	goto _3
 16862  _5:
 16863  	return (*XPgHdr)(_result.XpDirty)
 16864  }
 16865  
 16866  var _pcacheMergeDirtyListØ00__func__Ø000 [21]int8
 16867  
 16868  func init() {
 16869  	crt.Xstrncpy(nil, &_pcacheMergeDirtyListØ00__func__Ø000[0], str(16589), 21)
 16870  }
 16871  
 16872  // C comment
 16873  //  /*
 16874  //  ** Read a single page from either the journal file (if isMainJrnl==1) or
 16875  //  ** from the sub-journal (if isMainJrnl==0) and playback that page.
 16876  //  ** The page begins at offset *pOffset into the file. The *pOffset
 16877  //  ** value is increased to the start of the next page in the journal.
 16878  //  **
 16879  //  ** The main rollback journal uses checksums - the statement journal does
 16880  //  ** not.
 16881  //  **
 16882  //  ** If the page number of the page record read from the (sub-)journal file
 16883  //  ** is greater than the current value of Pager.dbSize, then playback is
 16884  //  ** skipped and SQLITE_OK is returned.
 16885  //  **
 16886  //  ** If pDone is not NULL, then it is a record of pages that have already
 16887  //  ** been played back.  If the page at *pOffset has already been played back
 16888  //  ** (if the corresponding pDone bit is set) then skip the playback.
 16889  //  ** Make sure the pDone bit corresponding to the *pOffset page is set
 16890  //  ** prior to returning.
 16891  //  **
 16892  //  ** If the page record is successfully read from the (sub-)journal file
 16893  //  ** and played back, then SQLITE_OK is returned. If an IO error occurs
 16894  //  ** while reading the record from the (sub-)journal file or while writing
 16895  //  ** to the database file, then the IO error code is returned. If data
 16896  //  ** is successfully read from the (sub-)journal file but appears to be
 16897  //  ** corrupted, SQLITE_DONE is returned. Data is considered corrupted in
 16898  //  ** two circumstances:
 16899  //  **
 16900  //  **   * If the record page-number is illegal (0 or PAGER_MJ_PGNO), or
 16901  //  **   * If the record is being rolled back from the main journal file
 16902  //  **     and the checksum field does not match the record content.
 16903  //  **
 16904  //  ** Neither of these two scenarios are possible during a savepoint rollback.
 16905  //  **
 16906  //  ** If this is a savepoint rollback, then memory may have to be dynamically
 16907  //  ** allocated by this function. If this is the case and an allocation fails,
 16908  //  ** SQLITE_NOMEM is returned.
 16909  //  */
 16910  func _pager_playback_one_page(tls *crt.TLS, _pPager *XPager, _pOffset *int64, _pDone *XBitvec, _isMainJrnl int32, _isSavepnt int32) (r0 int32) {
 16911  	var _rc, _isSynced int32
 16912  	var _11_ofst int64
 16913  	var _pgno, _cksum uint32
 16914  	var _aData *int8
 16915  	var _15_pData unsafe.Pointer
 16916  	var _jfd *Xsqlite3_file
 16917  	var _pPg *XPgHdr
 16918  	func() {
 16919  		if (_isMainJrnl & int32(-2)) != int32(0) {
 16920  			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)))
 16921  			crt.X__builtin_abort(tls)
 16922  		}
 16923  	}()
 16924  	func() {
 16925  		if (_isSavepnt & int32(-2)) != int32(0) {
 16926  			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)))
 16927  			crt.X__builtin_abort(tls)
 16928  		}
 16929  	}()
 16930  	func() {
 16931  		if _isMainJrnl == 0 && _pDone == nil {
 16932  			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)))
 16933  			crt.X__builtin_abort(tls)
 16934  		}
 16935  	}()
 16936  	func() {
 16937  		if _isSavepnt == 0 && _pDone != nil {
 16938  			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)))
 16939  			crt.X__builtin_abort(tls)
 16940  		}
 16941  	}()
 16942  	_aData = _pPager.XpTmpSpace
 16943  	func() {
 16944  		if _aData == nil {
 16945  			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)))
 16946  			crt.X__builtin_abort(tls)
 16947  		}
 16948  	}()
 16949  	func() {
 16950  		if bool2int((*XWal)(_pPager.XpWal) != nil) != int32(0) && (_isMainJrnl != 0 || _isSavepnt == 0) {
 16951  			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)))
 16952  			crt.X__builtin_abort(tls)
 16953  		}
 16954  	}()
 16955  	func() {
 16956  		if int32(_pPager.XeState) < int32(3) && (int32(_pPager.XeState) != int32(0) || int32(_pPager.XeLock) != int32(4)) {
 16957  			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)))
 16958  			crt.X__builtin_abort(tls)
 16959  		}
 16960  	}()
 16961  	func() {
 16962  		if int32(_pPager.XeState) < int32(3) && _isMainJrnl == 0 {
 16963  			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)))
 16964  			crt.X__builtin_abort(tls)
 16965  		}
 16966  	}()
 16967  	_jfd = func() *Xsqlite3_file {
 16968  		if _isMainJrnl != 0 {
 16969  			return (*Xsqlite3_file)(_pPager.Xjfd)
 16970  		}
 16971  		return (*Xsqlite3_file)(_pPager.Xsjfd)
 16972  	}()
 16973  	_rc = _read32bits(tls, _jfd, *_pOffset, &_pgno)
 16974  	if _rc != int32(0) {
 16975  		return _rc
 16976  	}
 16977  	_rc = _sqlite3OsRead(tls, _jfd, unsafe.Pointer(_aData), _pPager.XpageSize, (*_pOffset)+int64(4))
 16978  	if _rc != int32(0) {
 16979  		return _rc
 16980  	}
 16981  	*_pOffset += int64((_pPager.XpageSize + int32(4)) + (_isMainJrnl * int32(4)))
 16982  	if (_pgno == (0)) || (_pgno == uint32((_sqlite3PendingByte/_pPager.XpageSize)+int32(1))) {
 16983  		func() {
 16984  			if _isSavepnt != 0 {
 16985  				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)))
 16986  				crt.X__builtin_abort(tls)
 16987  			}
 16988  		}()
 16989  		return int32(101)
 16990  	}
 16991  	if (_pgno > _pPager.XdbSize) || _sqlite3BitvecTest(tls, _pDone, _pgno) != 0 {
 16992  		return int32(0)
 16993  	}
 16994  	if _isMainJrnl == 0 {
 16995  		goto _33
 16996  	}
 16997  	_rc = _read32bits(tls, _jfd, (*_pOffset)-int64(4), &_cksum)
 16998  	if _rc != 0 {
 16999  		return _rc
 17000  	}
 17001  	if (_isSavepnt == 0) && (_pager_cksum(tls, _pPager, (*uint8)(unsafe.Pointer(_aData))) != _cksum) {
 17002  		return int32(101)
 17003  	}
 17004  _33:
 17005  	if (_pDone != nil) && (store2(&_rc, _sqlite3BitvecSet(tls, _pDone, _pgno)) != int32(0)) {
 17006  		return _rc
 17007  	}
 17008  	if (_pgno == uint32(1)) && (int32(_pPager.XnReserve) != int32(*elem15((*uint8)(unsafe.Pointer(_aData)), uintptr(20)))) {
 17009  		_pPager.XnReserve = int16(*elem15((*uint8)(unsafe.Pointer(_aData)), uintptr(20)))
 17010  	}
 17011  	if (*XWal)(_pPager.XpWal) != nil {
 17012  		_pPg = nil
 17013  		goto _42
 17014  	}
 17015  	_pPg = _sqlite3PagerLookup(tls, _pPager, _pgno)
 17016  _42:
 17017  	func() {
 17018  		if _pPg == nil && _pPager.XmemDb != 0 {
 17019  			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)))
 17020  			crt.X__builtin_abort(tls)
 17021  		}
 17022  	}()
 17023  	func() {
 17024  		if int32(_pPager.XeState) == int32(0) && _pPg != nil && _pPager.XtempFile == 0 {
 17025  			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)))
 17026  			crt.X__builtin_abort(tls)
 17027  		}
 17028  	}()
 17029  	if _isMainJrnl != 0 {
 17030  		_isSynced = bool2int((_pPager.XnoSync != 0) || ((*_pOffset) <= _pPager.XjournalHdr))
 17031  		goto _52
 17032  	}
 17033  	_isSynced = bool2int((_pPg == nil) || (int32(0) == (int32(_pPg.Xflags) & int32(8))))
 17034  _52:
 17035  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil || int32(_pPager.XeState) < int32(4) && int32(_pPager.XeState) != int32(0) || _isSynced == 0 {
 17036  		goto _57
 17037  	}
 17038  	_11_ofst = int64(_pgno-uint32(1)) * int64(_pPager.XpageSize)
 17039  	func() {
 17040  		if (*XWal)(_pPager.XpWal) != nil {
 17041  			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)))
 17042  			crt.X__builtin_abort(tls)
 17043  		}
 17044  	}()
 17045  	_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.Xfd), unsafe.Pointer(_aData), _pPager.XpageSize, _11_ofst)
 17046  	if _pgno > _pPager.XdbFileSize {
 17047  		_pPager.XdbFileSize = _pgno
 17048  	}
 17049  	if _pPager.XpBackup != nil {
 17050  		_sqlite3BackupUpdate(tls, (*Xsqlite3_backup)(_pPager.XpBackup), _pgno, (*uint8)(unsafe.Pointer(_aData)))
 17051  	}
 17052  	goto _64
 17053  _57:
 17054  	if _isMainJrnl != 0 || _pPg != nil {
 17055  		goto _64
 17056  	}
 17057  	func() {
 17058  		if _isSavepnt == 0 {
 17059  			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)))
 17060  			crt.X__builtin_abort(tls)
 17061  		}
 17062  	}()
 17063  	func() {
 17064  		if (int32(_pPager.XdoNotSpill) & int32(2)) != int32(0) {
 17065  			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)))
 17066  			crt.X__builtin_abort(tls)
 17067  		}
 17068  	}()
 17069  	{
 17070  		p := &_pPager.XdoNotSpill
 17071  		*p = uint8(int32(*p) | int32(2))
 17072  	}
 17073  	_rc = _sqlite3PagerGet(tls, _pPager, _pgno, &_pPg, int32(1))
 17074  	func() {
 17075  		if (int32(_pPager.XdoNotSpill) & int32(2)) == int32(0) {
 17076  			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)))
 17077  			crt.X__builtin_abort(tls)
 17078  		}
 17079  	}()
 17080  	{
 17081  		p := &_pPager.XdoNotSpill
 17082  		*p = uint8(int32(*p) & int32(-3))
 17083  	}
 17084  	if _rc != int32(0) {
 17085  		return _rc
 17086  	}
 17087  	_sqlite3PcacheMakeDirty(tls, _pPg)
 17088  _64:
 17089  	if _pPg == nil {
 17090  		goto _72
 17091  	}
 17092  	_15_pData = _pPg.XpData
 17093  	crt.Xmemcpy(tls, _15_pData, unsafe.Pointer(_aData), uint32(_pPager.XpageSize))
 17094  	func() func(*crt.TLS, *XPgHdr) {
 17095  		v := _pPager.XxReiniter
 17096  		return *(*func(*crt.TLS, *XPgHdr))(unsafe.Pointer(&v))
 17097  	}()(tls, _pPg)
 17098  	if _pgno == uint32(1) {
 17099  		crt.Xmemcpy(tls, unsafe.Pointer(&_pPager.XdbFileVers), unsafe.Pointer(elem15((*uint8)(_15_pData), uintptr(24))), uint32(16))
 17100  	}
 17101  	_sqlite3PcacheRelease(tls, _pPg)
 17102  _72:
 17103  	return _rc
 17104  }
 17105  
 17106  var _pager_playback_one_pageØ00__func__Ø000 [24]int8
 17107  
 17108  func init() {
 17109  	crt.Xstrncpy(nil, &_pager_playback_one_pageØ00__func__Ø000[0], str(17085), 24)
 17110  }
 17111  
 17112  // C comment
 17113  //  /*
 17114  //  ** Read a 32-bit integer from the given file descriptor.  Store the integer
 17115  //  ** that is read in *pRes.  Return SQLITE_OK if everything worked, or an
 17116  //  ** error code is something goes wrong.
 17117  //  **
 17118  //  ** All values are stored on disk as big-endian.
 17119  //  */
 17120  func _read32bits(tls *crt.TLS, _fd *Xsqlite3_file, _offset int64, _pRes *uint32) (r0 int32) {
 17121  	var _rc int32
 17122  	var _ac [4]uint8
 17123  	_rc = _sqlite3OsRead(tls, _fd, unsafe.Pointer(&_ac), int32(4), _offset)
 17124  	if _rc == int32(0) {
 17125  		*_pRes = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(&_ac)))
 17126  	}
 17127  	return _rc
 17128  
 17129  	_ = _ac
 17130  	panic(0)
 17131  }
 17132  
 17133  // C comment
 17134  //  /*
 17135  //  ** Read or write a four-byte big-endian integer value.
 17136  //  */
 17137  func _sqlite3Get4byte(tls *crt.TLS, _p *uint8) (r0 uint32) {
 17138  	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)))
 17139  }
 17140  
 17141  func _sqlite3BackupUpdate(tls *crt.TLS, _pBackup *Xsqlite3_backup, _iPage uint32, _aData *uint8) {
 17142  	if _pBackup != nil {
 17143  		_backupUpdate(tls, _pBackup, _iPage, _aData)
 17144  	}
 17145  }
 17146  
 17147  // C comment
 17148  //  /*
 17149  //  ** This function is called after the contents of page iPage of the
 17150  //  ** source database have been modified. If page iPage has already been
 17151  //  ** copied into the destination database, then the data written to the
 17152  //  ** destination is now invalidated. The destination copy of iPage needs
 17153  //  ** to be updated with the new data before the backup operation is
 17154  //  ** complete.
 17155  //  **
 17156  //  ** It is assumed that the mutex associated with the BtShared object
 17157  //  ** corresponding to the source database is held when this function is
 17158  //  ** called.
 17159  //  */
 17160  func _backupUpdate(tls *crt.TLS, _p *Xsqlite3_backup, _iPage uint32, _aData *uint8) {
 17161  	var _2_rc int32
 17162  	func() {
 17163  		if _p == nil {
 17164  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69593), unsafe.Pointer(&_backupUpdateØ00__func__Ø000), unsafe.Pointer(str(807)))
 17165  			crt.X__builtin_abort(tls)
 17166  		}
 17167  	}()
 17168  _2:
 17169  	func() {
 17170  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)((*XBtree)(_p.XpSrc).XpBt).Xmutex)) == 0 {
 17171  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69595), unsafe.Pointer(&_backupUpdateØ00__func__Ø000), unsafe.Pointer(str(16493)))
 17172  			crt.X__builtin_abort(tls)
 17173  		}
 17174  	}()
 17175  	if _isFatalError(tls, _p.Xrc) != 0 || _iPage >= _p.XiNext {
 17176  		goto _6
 17177  	}
 17178  	func() {
 17179  		if _p.XpDestDb == nil {
 17180  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69602), unsafe.Pointer(&_backupUpdateØ00__func__Ø000), unsafe.Pointer(str(17109)))
 17181  			crt.X__builtin_abort(tls)
 17182  		}
 17183  	}()
 17184  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.XpDestDb).Xmutex))
 17185  	_2_rc = _backupOnePage(tls, _p, _iPage, _aData, int32(1))
 17186  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.XpDestDb).Xmutex))
 17187  	func() {
 17188  		if _2_rc == int32(5) || _2_rc == int32(6) {
 17189  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69606), unsafe.Pointer(&_backupUpdateØ00__func__Ø000), unsafe.Pointer(str(17120)))
 17190  			crt.X__builtin_abort(tls)
 17191  		}
 17192  	}()
 17193  	if _2_rc != int32(0) {
 17194  		_p.Xrc = _2_rc
 17195  	}
 17196  _6:
 17197  	if store38(&_p, (*Xsqlite3_backup)(_p.XpNext)) != nil {
 17198  		goto _2
 17199  	}
 17200  }
 17201  
 17202  var _backupUpdateØ00__func__Ø000 [13]int8
 17203  
 17204  func init() {
 17205  	crt.Xstrncpy(nil, &_backupUpdateØ00__func__Ø000[0], str(17157), 13)
 17206  }
 17207  
 17208  // C comment
 17209  //  /*
 17210  //  ** Argument rc is an SQLite error code. Return true if this error is
 17211  //  ** considered fatal if encountered during a backup operation. All errors
 17212  //  ** are considered fatal except for SQLITE_BUSY and SQLITE_LOCKED.
 17213  //  */
 17214  func _isFatalError(tls *crt.TLS, _rc int32) (r0 int32) {
 17215  	return bool2int(((_rc != int32(0)) && (_rc != int32(5))) && func() int32 {
 17216  		if _rc != int32(6) {
 17217  			return int32(1)
 17218  		}
 17219  		return func() int32 {
 17220  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69117), unsafe.Pointer(&_isFatalErrorØ00__func__Ø000), unsafe.Pointer(str(4809)))
 17221  			crt.X__builtin_abort(tls)
 17222  			return int32(0)
 17223  		}()
 17224  	}() != 0)
 17225  }
 17226  
 17227  var _isFatalErrorØ00__func__Ø000 [13]int8
 17228  
 17229  func init() {
 17230  	crt.Xstrncpy(nil, &_isFatalErrorØ00__func__Ø000[0], str(17170), 13)
 17231  }
 17232  
 17233  // C comment
 17234  //  /*
 17235  //  ** Parameter zSrcData points to a buffer containing the data for
 17236  //  ** page iSrcPg from the source database. Copy this data into the
 17237  //  ** destination database.
 17238  //  */
 17239  func _backupOnePage(tls *crt.TLS, _p *Xsqlite3_backup, _iSrcPg uint32, _zSrcData *uint8, _bUpdate int32) (r0 int32) {
 17240  	var _nSrcPgsz, _nDestPgsz, _nCopy, _rc int32
 17241  	var _iEnd, _iOff int64
 17242  	var _2_iDest uint32
 17243  	var _3_zIn, _3_zDestData, _3_zOut *uint8
 17244  	var _pDestPager *XPager
 17245  	var _2_pDestPg *XPgHdr
 17246  	_pDestPager = _sqlite3BtreePager(tls, (*XBtree)(_p.XpDest))
 17247  	_nSrcPgsz = _sqlite3BtreeGetPageSize(tls, (*XBtree)(_p.XpSrc))
 17248  	_nDestPgsz = _sqlite3BtreeGetPageSize(tls, (*XBtree)(_p.XpDest))
 17249  	_nCopy = func() int32 {
 17250  		if _nSrcPgsz < _nDestPgsz {
 17251  			return _nSrcPgsz
 17252  		}
 17253  		return _nDestPgsz
 17254  	}()
 17255  	_iEnd = int64(_iSrcPg) * int64(_nSrcPgsz)
 17256  	_rc = int32(0)
 17257  	func() {
 17258  		if _sqlite3BtreeGetReserveNoMutex(tls, (*XBtree)(_p.XpSrc)) < int32(0) {
 17259  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69146), unsafe.Pointer(&_backupOnePageØ00__func__Ø000), unsafe.Pointer(str(17183)))
 17260  			crt.X__builtin_abort(tls)
 17261  		}
 17262  	}()
 17263  	func() {
 17264  		if _p.XbDestLocked == 0 {
 17265  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69147), unsafe.Pointer(&_backupOnePageØ00__func__Ø000), unsafe.Pointer(str(17225)))
 17266  			crt.X__builtin_abort(tls)
 17267  		}
 17268  	}()
 17269  	func() {
 17270  		if _isFatalError(tls, _p.Xrc) != 0 {
 17271  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69148), unsafe.Pointer(&_backupOnePageØ00__func__Ø000), unsafe.Pointer(str(17240)))
 17272  			crt.X__builtin_abort(tls)
 17273  		}
 17274  	}()
 17275  	func() {
 17276  		if _iSrcPg == ((uint32(_sqlite3PendingByte) / ((*XBtShared)((*XBtree)(_p.XpSrc).XpBt).XpageSize)) + uint32(1)) {
 17277  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69149), unsafe.Pointer(&_backupOnePageØ00__func__Ø000), unsafe.Pointer(str(17261)))
 17278  			crt.X__builtin_abort(tls)
 17279  		}
 17280  	}()
 17281  	func() {
 17282  		if _zSrcData == nil {
 17283  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69150), unsafe.Pointer(&_backupOnePageØ00__func__Ø000), unsafe.Pointer(str(17301)))
 17284  			crt.X__builtin_abort(tls)
 17285  		}
 17286  	}()
 17287  	if (_nSrcPgsz != _nDestPgsz) && _sqlite3PagerIsMemdb(tls, _pDestPager) != 0 {
 17288  		_rc = int32(8)
 17289  	}
 17290  	_iOff = _iEnd - int64(_nSrcPgsz)
 17291  _14:
 17292  	if _rc != int32(0) || _iOff >= _iEnd {
 17293  		goto _18
 17294  	}
 17295  	_2_pDestPg = nil
 17296  	_2_iDest = uint32(_iOff/int64(_nDestPgsz)) + uint32(1)
 17297  	if _2_iDest == ((uint32(_sqlite3PendingByte) / ((*XBtShared)((*XBtree)(_p.XpDest).XpBt).XpageSize)) + uint32(1)) {
 17298  		goto _15
 17299  	}
 17300  	if int32(0) != store2(&_rc, _sqlite3PagerGet(tls, _pDestPager, _2_iDest, &_2_pDestPg, int32(0))) || int32(0) != store2(&_rc, _sqlite3PagerWrite(tls, _2_pDestPg)) {
 17301  		goto _21
 17302  	}
 17303  	_3_zIn = elem15(_zSrcData, uintptr(_iOff%int64(_nSrcPgsz)))
 17304  	_3_zDestData = (*uint8)(_sqlite3PagerGetData(tls, _2_pDestPg))
 17305  	_3_zOut = elem15(_3_zDestData, uintptr(_iOff%int64(_nDestPgsz)))
 17306  	crt.Xmemcpy(tls, unsafe.Pointer(_3_zOut), unsafe.Pointer(_3_zIn), uint32(_nCopy))
 17307  	*elem15((*uint8)(_sqlite3PagerGetExtra(tls, _2_pDestPg)), 0) = 0
 17308  	if (_iOff == (0)) && (_bUpdate == int32(0)) {
 17309  		_sqlite3Put4byte(tls, elem15(_3_zOut, uintptr(28)), _sqlite3BtreeLastPage(tls, (*XBtree)(_p.XpSrc)))
 17310  	}
 17311  _21:
 17312  	_sqlite3PagerUnref(tls, _2_pDestPg)
 17313  _15:
 17314  	_iOff += int64(_nDestPgsz)
 17315  	goto _14
 17316  _18:
 17317  	return _rc
 17318  }
 17319  
 17320  // C comment
 17321  //  /*
 17322  //  ** Return the pager associated with a BTree.  This routine is used for
 17323  //  ** testing and debugging only.
 17324  //  */
 17325  func _sqlite3BtreePager(tls *crt.TLS, _p *XBtree) (r0 *XPager) {
 17326  	return (*XPager)((*XBtShared)(_p.XpBt).XpPager)
 17327  }
 17328  
 17329  // C comment
 17330  //  /*
 17331  //  ** Return the currently defined page size
 17332  //  */
 17333  func _sqlite3BtreeGetPageSize(tls *crt.TLS, _p *XBtree) (r0 int32) {
 17334  	return int32((*XBtShared)(_p.XpBt).XpageSize)
 17335  }
 17336  
 17337  // C comment
 17338  //  /*
 17339  //  ** This function is similar to sqlite3BtreeGetReserve(), except that it
 17340  //  ** may only be called if it is guaranteed that the b-tree mutex is already
 17341  //  ** held.
 17342  //  **
 17343  //  ** This is useful in one special case in the backup API code where it is
 17344  //  ** known that the shared b-tree mutex is held, but the mutex on the
 17345  //  ** database handle that owns *p is not. In this case if sqlite3BtreeEnter()
 17346  //  ** were to be called, it might collide with some other operation on the
 17347  //  ** database handle that owns *p, causing undefined behavior.
 17348  //  */
 17349  func _sqlite3BtreeGetReserveNoMutex(tls *crt.TLS, _p *XBtree) (r0 int32) {
 17350  	var _n int32
 17351  	func() {
 17352  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_p.XpBt).Xmutex)) == 0 {
 17353  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61796), unsafe.Pointer(&_sqlite3BtreeGetReserveNoMutexØ00__func__Ø000), unsafe.Pointer(str(17310)))
 17354  			crt.X__builtin_abort(tls)
 17355  		}
 17356  	}()
 17357  	_n = int32(((*XBtShared)(_p.XpBt).XpageSize) - ((*XBtShared)(_p.XpBt).XusableSize))
 17358  	return _n
 17359  }
 17360  
 17361  var _sqlite3BtreeGetReserveNoMutexØ00__func__Ø000 [30]int8
 17362  
 17363  func init() {
 17364  	crt.Xstrncpy(nil, &_sqlite3BtreeGetReserveNoMutexØ00__func__Ø000[0], str(17344), 30)
 17365  }
 17366  
 17367  var _backupOnePageØ00__func__Ø000 [14]int8
 17368  
 17369  func init() {
 17370  	crt.Xstrncpy(nil, &_backupOnePageØ00__func__Ø000[0], str(17374), 14)
 17371  }
 17372  
 17373  // C comment
 17374  //  /*
 17375  //  ** Return true if this is an in-memory or temp-file backed pager.
 17376  //  */
 17377  func _sqlite3PagerIsMemdb(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 17378  	return int32(_pPager.XtempFile)
 17379  }
 17380  
 17381  // C comment
 17382  //  /*
 17383  //  ** Return a pointer to the data for the specified page.
 17384  //  */
 17385  func _sqlite3PagerGetData(tls *crt.TLS, _pPg *XPgHdr) (r0 unsafe.Pointer) {
 17386  	func() {
 17387  		if int32(_pPg.XnRef) <= int32(0) && ((*XPager)(_pPg.XpPager).XmemDb) == 0 {
 17388  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54024), unsafe.Pointer(&_sqlite3PagerGetDataØ00__func__Ø000), unsafe.Pointer(str(17388)))
 17389  			crt.X__builtin_abort(tls)
 17390  		}
 17391  	}()
 17392  	return _pPg.XpData
 17393  }
 17394  
 17395  var _sqlite3PagerGetDataØ00__func__Ø000 [20]int8
 17396  
 17397  func init() {
 17398  	crt.Xstrncpy(nil, &_sqlite3PagerGetDataØ00__func__Ø000[0], str(17422), 20)
 17399  }
 17400  
 17401  // C comment
 17402  //  /*
 17403  //  ** Return a pointer to the Pager.nExtra bytes of "extra" space
 17404  //  ** allocated along with the specified page.
 17405  //  */
 17406  func _sqlite3PagerGetExtra(tls *crt.TLS, _pPg *XPgHdr) (r0 unsafe.Pointer) {
 17407  	return _pPg.XpExtra
 17408  }
 17409  
 17410  func _sqlite3BtreeLastPage(tls *crt.TLS, _p *XBtree) (r0 uint32) {
 17411  	func() {
 17412  		if _sqlite3BtreeHoldsMutex(tls, _p) == 0 {
 17413  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61054), unsafe.Pointer(&_sqlite3BtreeLastPageØ00__func__Ø000), unsafe.Pointer(str(17442)))
 17414  			crt.X__builtin_abort(tls)
 17415  		}
 17416  	}()
 17417  	func() {
 17418  		if (((*XBtShared)(_p.XpBt).XnPage) & uint32(134217728)) != (0) {
 17419  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61055), unsafe.Pointer(&_sqlite3BtreeLastPageØ00__func__Ø000), unsafe.Pointer(str(17468)))
 17420  			crt.X__builtin_abort(tls)
 17421  		}
 17422  	}()
 17423  	return _btreePagecount(tls, (*XBtShared)(_p.XpBt))
 17424  }
 17425  
 17426  // C comment
 17427  //  /*
 17428  //  ** Return true if the BtShared mutex is held on the btree, or if the
 17429  //  ** B-Tree is not marked as sharable.
 17430  //  **
 17431  //  ** This routine is used only from within assert() statements.
 17432  //  */
 17433  func _sqlite3BtreeHoldsMutex(tls *crt.TLS, _p *XBtree) (r0 int32) {
 17434  	func() {
 17435  		if int32(_p.Xsharable) != int32(0) && int32(_p.Xlocked) != int32(0) && _p.XwantToLock <= int32(0) {
 17436  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58885), unsafe.Pointer(&_sqlite3BtreeHoldsMutexØ00__func__Ø000), unsafe.Pointer(str(17499)))
 17437  			crt.X__builtin_abort(tls)
 17438  		}
 17439  	}()
 17440  	func() {
 17441  		if int32(_p.Xsharable) != int32(0) && int32(_p.Xlocked) != int32(0) && (*Xsqlite3)(_p.Xdb) != (*Xsqlite3)((*XBtShared)(_p.XpBt).Xdb) {
 17442  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58886), unsafe.Pointer(&_sqlite3BtreeHoldsMutexØ00__func__Ø000), unsafe.Pointer(str(17549)))
 17443  			crt.X__builtin_abort(tls)
 17444  		}
 17445  	}()
 17446  	func() {
 17447  		if int32(_p.Xsharable) != int32(0) && int32(_p.Xlocked) != int32(0) && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_p.XpBt).Xmutex)) == 0 {
 17448  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58887), unsafe.Pointer(&_sqlite3BtreeHoldsMutexØ00__func__Ø000), unsafe.Pointer(str(17601)))
 17449  			crt.X__builtin_abort(tls)
 17450  		}
 17451  	}()
 17452  	func() {
 17453  		if int32(_p.Xsharable) != int32(0) && int32(_p.Xlocked) != int32(0) && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 17454  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58888), unsafe.Pointer(&_sqlite3BtreeHoldsMutexØ00__func__Ø000), unsafe.Pointer(str(17669)))
 17455  			crt.X__builtin_abort(tls)
 17456  		}
 17457  	}()
 17458  	return bool2int((int32(_p.Xsharable) == int32(0)) || (_p.Xlocked != 0))
 17459  }
 17460  
 17461  var _sqlite3BtreeHoldsMutexØ00__func__Ø000 [23]int8
 17462  
 17463  func init() {
 17464  	crt.Xstrncpy(nil, &_sqlite3BtreeHoldsMutexØ00__func__Ø000[0], str(17736), 23)
 17465  }
 17466  
 17467  var _sqlite3BtreeLastPageØ00__func__Ø000 [21]int8
 17468  
 17469  func init() {
 17470  	crt.Xstrncpy(nil, &_sqlite3BtreeLastPageØ00__func__Ø000[0], str(17759), 21)
 17471  }
 17472  
 17473  // C comment
 17474  //  /*
 17475  //  ** Return the size of the database file in pages. If there is any kind of
 17476  //  ** error, return ((unsigned int)-1).
 17477  //  */
 17478  func _btreePagecount(tls *crt.TLS, _pBt *XBtShared) (r0 uint32) {
 17479  	return _pBt.XnPage
 17480  }
 17481  
 17482  func _sqlite3PagerUnref(tls *crt.TLS, _pPg *XPgHdr) {
 17483  	if _pPg != nil {
 17484  		_sqlite3PagerUnrefNotNull(tls, _pPg)
 17485  	}
 17486  }
 17487  
 17488  // C comment
 17489  //  /*
 17490  //  ** The journal file must be open when this is called. A journal header file
 17491  //  ** (JOURNAL_HDR_SZ bytes) is read from the current location in the journal
 17492  //  ** file. The current location in the journal file is given by
 17493  //  ** pPager->journalOff. See comments above function writeJournalHdr() for
 17494  //  ** a description of the journal header format.
 17495  //  **
 17496  //  ** If the header is read successfully, *pNRec is set to the number of
 17497  //  ** page records following this header and *pDbSize is set to the size of the
 17498  //  ** database before the transaction began, in pages. Also, pPager->cksumInit
 17499  //  ** is set to the value read from the journal header. SQLITE_OK is returned
 17500  //  ** in this case.
 17501  //  **
 17502  //  ** If the journal header file appears to be corrupted, SQLITE_DONE is
 17503  //  ** returned and *pNRec and *PDbSize are undefined.  If JOURNAL_HDR_SZ bytes
 17504  //  ** cannot be read from the journal file an error code is returned.
 17505  //  */
 17506  func _readJournalHdr(tls *crt.TLS, _pPager *XPager, _isHot int32, _journalSize int64, _pNRec *uint32, _pDbSize *uint32) (r0 int32) {
 17507  	var _rc int32
 17508  	var _iHdrOff int64
 17509  	var _6_iPageSize, _6_iSectorSize uint32
 17510  	var _aMagic [8]uint8
 17511  	func() {
 17512  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil {
 17513  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48464), unsafe.Pointer(&_readJournalHdrØ00__func__Ø000), unsafe.Pointer(str(13581)))
 17514  			crt.X__builtin_abort(tls)
 17515  		}
 17516  	}()
 17517  	_pPager.XjournalOff = _journalHdrOffset(tls, _pPager)
 17518  	if (_pPager.XjournalOff + int64(_pPager.XsectorSize)) > _journalSize {
 17519  		return int32(101)
 17520  	}
 17521  	_iHdrOff = _pPager.XjournalOff
 17522  	if _isHot == 0 && _iHdrOff == _pPager.XjournalHdr {
 17523  		goto _4
 17524  	}
 17525  	_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.Xjfd), unsafe.Pointer(&_aMagic), int32(8), _iHdrOff)
 17526  	if _rc != 0 {
 17527  		return _rc
 17528  	}
 17529  	if crt.Xmemcmp(tls, unsafe.Pointer(&_aMagic), unsafe.Pointer(&_aJournalMagic), uint32(8)) != int32(0) {
 17530  		return int32(101)
 17531  	}
 17532  _4:
 17533  	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))) {
 17534  		return _rc
 17535  	}
 17536  	if _pPager.XjournalOff != (0) {
 17537  		goto _10
 17538  	}
 17539  	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))) {
 17540  		return _rc
 17541  	}
 17542  	if _6_iPageSize == (0) {
 17543  		_6_iPageSize = uint32(_pPager.XpageSize)
 17544  	}
 17545  	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)) {
 17546  		return int32(101)
 17547  	}
 17548  	_rc = _sqlite3PagerSetPagesize(tls, _pPager, &_6_iPageSize, int32(-1))
 17549  	_pPager.XsectorSize = _6_iSectorSize
 17550  _10:
 17551  	_pPager.XjournalOff += int64(_pPager.XsectorSize)
 17552  	return _rc
 17553  
 17554  	_ = _aMagic
 17555  	panic(0)
 17556  }
 17557  
 17558  var _readJournalHdrØ00__func__Ø000 [15]int8
 17559  
 17560  func init() {
 17561  	crt.Xstrncpy(nil, &_readJournalHdrØ00__func__Ø000[0], str(17780), 15)
 17562  }
 17563  
 17564  // C comment
 17565  //  /*
 17566  //  ** Change the page size used by the Pager object. The new page size
 17567  //  ** is passed in *pPageSize.
 17568  //  **
 17569  //  ** If the pager is in the error state when this function is called, it
 17570  //  ** is a no-op. The value returned is the error state error code (i.e.
 17571  //  ** one of SQLITE_IOERR, an SQLITE_IOERR_xxx sub-code or SQLITE_FULL).
 17572  //  **
 17573  //  ** Otherwise, if all of the following are true:
 17574  //  **
 17575  //  **   * the new page size (value of *pPageSize) is valid (a power
 17576  //  **     of two between 512 and SQLITE_MAX_PAGE_SIZE, inclusive), and
 17577  //  **
 17578  //  **   * there are no outstanding page references, and
 17579  //  **
 17580  //  **   * the database is either not an in-memory database or it is
 17581  //  **     an in-memory database that currently consists of zero pages.
 17582  //  **
 17583  //  ** then the pager object page size is set to *pPageSize.
 17584  //  **
 17585  //  ** If the page size is changed, then this function uses sqlite3PagerMalloc()
 17586  //  ** to obtain a new Pager.pTmpSpace buffer. If this allocation attempt
 17587  //  ** fails, SQLITE_NOMEM is returned and the page size remains unchanged.
 17588  //  ** In all other cases, SQLITE_OK is returned.
 17589  //  **
 17590  //  ** If the page size is not changed, either because one of the enumerated
 17591  //  ** conditions above is not true, the pager was in error state when this
 17592  //  ** function was called, or because the memory allocation attempt failed,
 17593  //  ** then *pPageSize is set to the old, retained page size before returning.
 17594  //  */
 17595  func _sqlite3PagerSetPagesize(tls *crt.TLS, _pPager *XPager, _pPageSize *uint32, _nReserve int32) (r0 int32) {
 17596  	var _rc int32
 17597  	var _1_nByte int64
 17598  	var _pageSize uint32
 17599  	var _1_pNew *int8
 17600  	_rc = int32(0)
 17601  	_pageSize = *_pPageSize
 17602  	func() {
 17603  		if _pageSize != (0) && (_pageSize < uint32(512) || _pageSize > uint32(65536)) {
 17604  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50655), unsafe.Pointer(&_sqlite3PagerSetPagesizeØ00__func__Ø000), unsafe.Pointer(str(17795)))
 17605  			crt.X__builtin_abort(tls)
 17606  		}
 17607  	}()
 17608  	if int32(_pPager.XmemDb) != int32(0) && _pPager.XdbSize != (0) || _sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.XpPCache)) != int32(0) || _pageSize == 0 || _pageSize == uint32(_pPager.XpageSize) {
 17609  		goto _8
 17610  	}
 17611  	_1_pNew = nil
 17612  	_1_nByte = int64(0)
 17613  	if (int32(_pPager.XeState) > int32(0)) && ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) != nil) {
 17614  		_rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.Xfd), &_1_nByte)
 17615  	}
 17616  	if _rc != int32(0) {
 17617  		goto _11
 17618  	}
 17619  	_1_pNew = (*int8)(_sqlite3PageMalloc(tls, int32(_pageSize)))
 17620  	if _1_pNew == nil {
 17621  		_rc = _sqlite3NomemError(tls, int32(50668))
 17622  	}
 17623  _11:
 17624  	if _rc == int32(0) {
 17625  		_pager_reset(tls, _pPager)
 17626  		_rc = _sqlite3PcacheSetPageSize(tls, (*XPCache)(_pPager.XpPCache), int32(_pageSize))
 17627  	}
 17628  	if _rc == int32(0) {
 17629  		_sqlite3PageFree(tls, unsafe.Pointer(_pPager.XpTmpSpace))
 17630  		_pPager.XpTmpSpace = _1_pNew
 17631  		_pPager.XdbSize = uint32(((_1_nByte + int64(_pageSize)) - int64(1)) / int64(_pageSize))
 17632  		_pPager.XpageSize = int32(_pageSize)
 17633  		goto _15
 17634  	}
 17635  	_sqlite3PageFree(tls, unsafe.Pointer(_1_pNew))
 17636  _15:
 17637  _8:
 17638  	*_pPageSize = uint32(_pPager.XpageSize)
 17639  	if _rc != int32(0) {
 17640  		goto _16
 17641  	}
 17642  	if _nReserve < int32(0) {
 17643  		_nReserve = int32(_pPager.XnReserve)
 17644  	}
 17645  	func() {
 17646  		if _nReserve < int32(0) || _nReserve >= int32(1000) {
 17647  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50688), unsafe.Pointer(&_sqlite3PagerSetPagesizeØ00__func__Ø000), unsafe.Pointer(str(17860)))
 17648  			crt.X__builtin_abort(tls)
 17649  		}
 17650  	}()
 17651  	_pPager.XnReserve = int16(_nReserve)
 17652  	_pagerFixMaplimit(tls, _pPager)
 17653  _16:
 17654  	return _rc
 17655  }
 17656  
 17657  var _sqlite3PagerSetPagesizeØ00__func__Ø000 [24]int8
 17658  
 17659  func init() {
 17660  	crt.Xstrncpy(nil, &_sqlite3PagerSetPagesizeØ00__func__Ø000[0], str(17889), 24)
 17661  }
 17662  
 17663  func _sqlite3OsFileSize(tls *crt.TLS, _id *Xsqlite3_file, _pSize *int64) (r0 int32) {
 17664  	return func() func(*crt.TLS, *Xsqlite3_file, *int64) int32 {
 17665  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxFileSize
 17666  		return *(*func(*crt.TLS, *Xsqlite3_file, *int64) int32)(unsafe.Pointer(&v))
 17667  	}()(tls, _id, _pSize)
 17668  }
 17669  
 17670  // C comment
 17671  //  /*
 17672  //  ** Malloc function used by SQLite to obtain space from the buffer configured
 17673  //  ** using sqlite3_config(SQLITE_CONFIG_PAGECACHE) option. If no such buffer
 17674  //  ** exists, this function falls back to sqlite3Malloc().
 17675  //  */
 17676  func _sqlite3PageMalloc(tls *crt.TLS, _sz int32) (r0 unsafe.Pointer) {
 17677  	return _pcache1Alloc(tls, _sz)
 17678  }
 17679  
 17680  // C comment
 17681  //  /*
 17682  //  ** Discard the entire contents of the in-memory page-cache.
 17683  //  */
 17684  func _pager_reset(tls *crt.TLS, _pPager *XPager) {
 17685  	_pPager.XiDataVersion += 1
 17686  	_sqlite3BackupRestart(tls, (*Xsqlite3_backup)(_pPager.XpBackup))
 17687  	_sqlite3PcacheClear(tls, (*XPCache)(_pPager.XpPCache))
 17688  }
 17689  
 17690  // C comment
 17691  //  /*
 17692  //  ** Discard the contents of the cache.
 17693  //  */
 17694  func _sqlite3PcacheClear(tls *crt.TLS, _pCache *XPCache) {
 17695  	_sqlite3PcacheTruncate(tls, _pCache, 0)
 17696  }
 17697  
 17698  // C comment
 17699  //  /*
 17700  //  ** Drop every cache entry whose page number is greater than "pgno". The
 17701  //  ** caller must ensure that there are no outstanding references to any pages
 17702  //  ** other than page 1 with a page number greater than pgno.
 17703  //  **
 17704  //  ** If there is a reference to page 1 and the pgno parameter passed to this
 17705  //  ** function is 0, then the data area associated with page 1 is zeroed, but
 17706  //  ** the page object is not dropped.
 17707  //  */
 17708  func _sqlite3PcacheTruncate(tls *crt.TLS, _pCache *XPCache, _pgno uint32) {
 17709  	var _1_p, _1_pNext *XPgHdr
 17710  	var _4_pPage1 *Xsqlite3_pcache_page
 17711  	if _pCache.XpCache == nil {
 17712  		goto _0
 17713  	}
 17714  	_1_p = (*XPgHdr)(_pCache.XpDirty)
 17715  _1:
 17716  	if _1_p == nil {
 17717  		goto _4
 17718  	}
 17719  	_1_pNext = (*XPgHdr)(_1_p.XpDirtyNext)
 17720  	func() {
 17721  		if _1_p.Xpgno <= (0) {
 17722  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44782), unsafe.Pointer(&_sqlite3PcacheTruncateØ00__func__Ø000), unsafe.Pointer(str(17913)))
 17723  			crt.X__builtin_abort(tls)
 17724  		}
 17725  	}()
 17726  	if _1_p.Xpgno > _pgno {
 17727  		func() {
 17728  			if (int32(_1_p.Xflags) & int32(2)) == 0 {
 17729  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44784), unsafe.Pointer(&_sqlite3PcacheTruncateØ00__func__Ø000), unsafe.Pointer(str(17923)))
 17730  				crt.X__builtin_abort(tls)
 17731  			}
 17732  		}()
 17733  		_sqlite3PcacheMakeClean(tls, _1_p)
 17734  	}
 17735  	_1_p = _1_pNext
 17736  	goto _1
 17737  _4:
 17738  	if _pgno != (0) || _pCache.XnRefSum == 0 {
 17739  		goto _11
 17740  	}
 17741  	_4_pPage1 = func() func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page {
 17742  		v := _sqlite3Config.Xpcache2.XxFetch
 17743  		return *(*func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page)(unsafe.Pointer(&v))
 17744  	}()(tls, _pCache.XpCache, uint32(1), int32(0))
 17745  	if func() int32 {
 17746  		if _4_pPage1 != nil {
 17747  			return int32(1)
 17748  		}
 17749  		return func() int32 {
 17750  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44791), unsafe.Pointer(&_sqlite3PcacheTruncateØ00__func__Ø000), unsafe.Pointer(str(4809)))
 17751  			crt.X__builtin_abort(tls)
 17752  			return int32(0)
 17753  		}()
 17754  	}() != 0 {
 17755  		crt.Xmemset(tls, _4_pPage1.XpBuf, int32(0), uint32(_pCache.XszPage))
 17756  		_pgno = uint32(1)
 17757  	}
 17758  _11:
 17759  	(_sqlite3Config.Xpcache2.XxTruncate)(tls, _pCache.XpCache, _pgno+uint32(1))
 17760  _0:
 17761  }
 17762  
 17763  var _sqlite3PcacheTruncateØ00__func__Ø000 [22]int8
 17764  
 17765  func init() {
 17766  	crt.Xstrncpy(nil, &_sqlite3PcacheTruncateØ00__func__Ø000[0], str(17944), 22)
 17767  }
 17768  
 17769  // C comment
 17770  //  /*
 17771  //  ** Make sure the page is marked as clean. If it isn't clean already,
 17772  //  ** make it so.
 17773  //  */
 17774  func _sqlite3PcacheMakeClean(tls *crt.TLS, _p *XPgHdr) {
 17775  	func() {
 17776  		if _sqlite3PcachePageSanity(tls, _p) == 0 {
 17777  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44698), unsafe.Pointer(&_sqlite3PcacheMakeCleanØ00__func__Ø000), unsafe.Pointer(str(13822)))
 17778  			crt.X__builtin_abort(tls)
 17779  		}
 17780  	}()
 17781  	if func() int32 {
 17782  		if (int32(_p.Xflags) & int32(2)) != int32(0) {
 17783  			return int32(1)
 17784  		}
 17785  		return func() int32 {
 17786  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44699), unsafe.Pointer(&_sqlite3PcacheMakeCleanØ00__func__Ø000), unsafe.Pointer(str(4809)))
 17787  			crt.X__builtin_abort(tls)
 17788  			return int32(0)
 17789  		}()
 17790  	}() == 0 {
 17791  		goto _4
 17792  	}
 17793  	func() {
 17794  		if (int32(_p.Xflags) & int32(1)) != int32(0) {
 17795  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44700), unsafe.Pointer(&_sqlite3PcacheMakeCleanØ00__func__Ø000), unsafe.Pointer(str(17966)))
 17796  			crt.X__builtin_abort(tls)
 17797  		}
 17798  	}()
 17799  	_pcacheManageDirtyList(tls, _p, uint8(1))
 17800  	{
 17801  		p := &_p.Xflags
 17802  		*p = uint16(int32(*p) & int32(-15))
 17803  	}
 17804  	{
 17805  		p := &_p.Xflags
 17806  		*p = uint16(int32(*p) | int32(1))
 17807  	}
 17808  	func() {
 17809  		if _sqlite3PcachePageSanity(tls, _p) == 0 {
 17810  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44705), unsafe.Pointer(&_sqlite3PcacheMakeCleanØ00__func__Ø000), unsafe.Pointer(str(13822)))
 17811  			crt.X__builtin_abort(tls)
 17812  		}
 17813  	}()
 17814  	if int32(_p.XnRef) == int32(0) {
 17815  		_pcacheUnpin(tls, _p)
 17816  	}
 17817  _4:
 17818  }
 17819  
 17820  var _sqlite3PcacheMakeCleanØ00__func__Ø000 [23]int8
 17821  
 17822  func init() {
 17823  	crt.Xstrncpy(nil, &_sqlite3PcacheMakeCleanØ00__func__Ø000[0], str(17994), 23)
 17824  }
 17825  
 17826  // C comment
 17827  //  /*
 17828  //  ** Change the page size for PCache object. The caller must ensure that there
 17829  //  ** are no outstanding page references when this function is called.
 17830  //  */
 17831  func _sqlite3PcacheSetPageSize(tls *crt.TLS, _pCache *XPCache, _szPage int32) (r0 int32) {
 17832  	var _1_pNew unsafe.Pointer
 17833  	func() {
 17834  		if _pCache.XnRefSum != int32(0) || (*XPgHdr)(_pCache.XpDirty) != nil {
 17835  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44444), unsafe.Pointer(&_sqlite3PcacheSetPageSizeØ00__func__Ø000), unsafe.Pointer(str(18017)))
 17836  			crt.X__builtin_abort(tls)
 17837  		}
 17838  	}()
 17839  	if _pCache.XszPage == 0 {
 17840  		goto _3
 17841  	}
 17842  	_1_pNew = (_sqlite3Config.Xpcache2.XxCreate)(tls, _szPage, int32(uint32(_pCache.XszExtra)+uint32(40)), int32(_pCache.XbPurgeable))
 17843  	if _1_pNew == nil {
 17844  		return _sqlite3NomemError(tls, int32(44451))
 17845  	}
 17846  	(_sqlite3Config.Xpcache2.XxCachesize)(tls, _1_pNew, _numberOfCachePages(tls, _pCache))
 17847  	if _pCache.XpCache != nil {
 17848  		(_sqlite3Config.Xpcache2.XxDestroy)(tls, _pCache.XpCache)
 17849  	}
 17850  	_pCache.XpCache = _1_pNew
 17851  	_pCache.XszPage = _szPage
 17852  _3:
 17853  	return int32(0)
 17854  }
 17855  
 17856  var _sqlite3PcacheSetPageSizeØ00__func__Ø000 [25]int8
 17857  
 17858  func init() {
 17859  	crt.Xstrncpy(nil, &_sqlite3PcacheSetPageSizeØ00__func__Ø000[0], str(18057), 25)
 17860  }
 17861  
 17862  // C comment
 17863  //  /*
 17864  //  ** Compute the number of pages of cache requested.   p->szCache is the
 17865  //  ** cache size requested by the "PRAGMA cache_size" statement.
 17866  //  */
 17867  func _numberOfCachePages(tls *crt.TLS, _p *XPCache) (r0 int32) {
 17868  	if _p.XszCache >= int32(0) {
 17869  		return _p.XszCache
 17870  	}
 17871  	return int32((int64(-1024) * int64(_p.XszCache)) / int64(_p.XszPage+_p.XszExtra))
 17872  }
 17873  
 17874  // C comment
 17875  //  /*
 17876  //  ** Free an allocated buffer obtained from sqlite3PageMalloc().
 17877  //  */
 17878  func _sqlite3PageFree(tls *crt.TLS, _p unsafe.Pointer) {
 17879  	_pcache1Free(tls, _p)
 17880  }
 17881  
 17882  // C comment
 17883  //  /*
 17884  //  ** Invoke SQLITE_FCNTL_MMAP_SIZE based on the current value of szMmap.
 17885  //  */
 17886  func _pagerFixMaplimit(tls *crt.TLS, _pPager *XPager) {
 17887  	var _1_sz int64
 17888  	var _fd *Xsqlite3_file
 17889  	_fd = (*Xsqlite3_file)(_pPager.Xfd)
 17890  	if ((*Xsqlite3_io_methods)(_fd.XpMethods) != nil) && (((*Xsqlite3_io_methods)(_fd.XpMethods).XiVersion) >= int32(3)) {
 17891  		_1_sz = _pPager.XszMmap
 17892  		_pPager.XbUseFetch = uint8(bool2int(_1_sz > (0)))
 17893  		_setGetterMethod(tls, _pPager)
 17894  		_sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pPager.Xfd), int32(18), unsafe.Pointer(&_1_sz))
 17895  	}
 17896  }
 17897  
 17898  // C comment
 17899  //  /*
 17900  //  ** Set the Pager.xGet method for the appropriate routine used to fetch
 17901  //  ** content from the pager.
 17902  //  */
 17903  func _setGetterMethod(tls *crt.TLS, _pPager *XPager) {
 17904  	if _pPager.XerrCode != 0 {
 17905  		*(*func(*crt.TLS, *XPager, uint32, **XPgHdr, int32) int32)(unsafe.Pointer(&_pPager.XxGet)) = _getPageError
 17906  		goto _3
 17907  	}
 17908  	if _pPager.XbUseFetch != 0 {
 17909  		*(*func(*crt.TLS, *XPager, uint32, **XPgHdr, int32) int32)(unsafe.Pointer(&_pPager.XxGet)) = _getPageMMap
 17910  		goto _3
 17911  	}
 17912  	*(*func(*crt.TLS, *XPager, uint32, **XPgHdr, int32) int32)(unsafe.Pointer(&_pPager.XxGet)) = _getPageNormal
 17913  _3:
 17914  }
 17915  
 17916  // C comment
 17917  //  /* The page getter method for when the pager is an error state */
 17918  func _getPageError(tls *crt.TLS, _pPager *XPager, _pgno uint32, _ppPage **XPgHdr, _flags int32) (r0 int32) {
 17919  	func() {
 17920  		if _pPager.XerrCode == int32(0) {
 17921  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52502), unsafe.Pointer(&_getPageErrorØ00__func__Ø000), unsafe.Pointer(str(12208)))
 17922  			crt.X__builtin_abort(tls)
 17923  		}
 17924  	}()
 17925  	*_ppPage = nil
 17926  	return _pPager.XerrCode
 17927  }
 17928  
 17929  var _getPageErrorØ00__func__Ø000 [13]int8
 17930  
 17931  func init() {
 17932  	crt.Xstrncpy(nil, &_getPageErrorØ00__func__Ø000[0], str(18082), 13)
 17933  }
 17934  
 17935  // C comment
 17936  //  /* The page getter for when memory-mapped I/O is enabled */
 17937  func _getPageMMap(tls *crt.TLS, _pPager *XPager, _pgno uint32, _ppPage **XPgHdr, _flags int32) (r0 int32) {
 17938  	var _rc, _bMmapOk int32
 17939  	var _iFrame uint32
 17940  	var _4_pData unsafe.Pointer
 17941  	var _pPg *XPgHdr
 17942  	_rc = int32(0)
 17943  	_pPg = nil
 17944  	_iFrame = uint32(0)
 17945  	_bMmapOk = bool2int((_pgno > uint32(1)) && ((int32(_pPager.XeState) == int32(1)) || (_flags&int32(2)) != 0))
 17946  	func() {
 17947  		if _pPager.XbUseFetch == 0 {
 17948  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52440), unsafe.Pointer(&_getPageMMapØ00__func__Ø000), unsafe.Pointer(str(18095)))
 17949  			crt.X__builtin_abort(tls)
 17950  		}
 17951  	}()
 17952  	if (_pgno <= uint32(1)) && (_pgno == (0)) {
 17953  		return _sqlite3CorruptError(tls, int32(52450))
 17954  	}
 17955  	func() {
 17956  		if int32(_pPager.XeState) < int32(1) {
 17957  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52452), unsafe.Pointer(&_getPageMMapØ00__func__Ø000), unsafe.Pointer(str(18112)))
 17958  			crt.X__builtin_abort(tls)
 17959  		}
 17960  	}()
 17961  	func() {
 17962  		if _assert_pager_state(tls, _pPager) == 0 {
 17963  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52453), unsafe.Pointer(&_getPageMMapØ00__func__Ø000), unsafe.Pointer(str(10971)))
 17964  			crt.X__builtin_abort(tls)
 17965  		}
 17966  	}()
 17967  	func() {
 17968  		if int32(_pPager.XhasHeldSharedLock) != int32(1) {
 17969  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52454), unsafe.Pointer(&_getPageMMapØ00__func__Ø000), unsafe.Pointer(str(18141)))
 17970  			crt.X__builtin_abort(tls)
 17971  		}
 17972  	}()
 17973  	func() {
 17974  		if _pPager.XerrCode != int32(0) {
 17975  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52455), unsafe.Pointer(&_getPageMMapØ00__func__Ø000), unsafe.Pointer(str(11709)))
 17976  			crt.X__builtin_abort(tls)
 17977  		}
 17978  	}()
 17979  	if _bMmapOk == 0 || (*XWal)(_pPager.XpWal) == nil {
 17980  		goto _15
 17981  	}
 17982  	_rc = _sqlite3WalFindFrame(tls, (*XWal)(_pPager.XpWal), _pgno, &_iFrame)
 17983  	if _rc != int32(0) {
 17984  		*_ppPage = nil
 17985  		return _rc
 17986  	}
 17987  _15:
 17988  	if _bMmapOk == 0 || _iFrame != (0) {
 17989  		goto _18
 17990  	}
 17991  	_4_pData = nil
 17992  	_rc = _sqlite3OsFetch(tls, (*Xsqlite3_file)(_pPager.Xfd), int64(_pgno-uint32(1))*int64(_pPager.XpageSize), _pPager.XpageSize, &_4_pData)
 17993  	if _rc != int32(0) || _4_pData == nil {
 17994  		goto _20
 17995  	}
 17996  	if (int32(_pPager.XeState) > int32(1)) || (_pPager.XtempFile != 0) {
 17997  		_pPg = _sqlite3PagerLookup(tls, _pPager, _pgno)
 17998  	}
 17999  	if _pPg == nil {
 18000  		_rc = _pagerAcquireMapPage(tls, _pPager, _pgno, _4_pData, &_pPg)
 18001  		goto _24
 18002  	}
 18003  	_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pPager.Xfd), int64(_pgno-uint32(1))*int64(_pPager.XpageSize), _4_pData)
 18004  _24:
 18005  	if _pPg != nil {
 18006  		func() {
 18007  			if _rc != int32(0) {
 18008  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52479), unsafe.Pointer(&_getPageMMapØ00__func__Ø000), unsafe.Pointer(str(14967)))
 18009  				crt.X__builtin_abort(tls)
 18010  			}
 18011  		}()
 18012  		*_ppPage = _pPg
 18013  		return int32(0)
 18014  	}
 18015  _20:
 18016  	if _rc != int32(0) {
 18017  		*_ppPage = nil
 18018  		return _rc
 18019  	}
 18020  _18:
 18021  	return _getPageNormal(tls, _pPager, _pgno, _ppPage, _flags)
 18022  }
 18023  
 18024  var _getPageMMapØ00__func__Ø000 [12]int8
 18025  
 18026  func init() {
 18027  	crt.Xstrncpy(nil, &_getPageMMapØ00__func__Ø000[0], str(18170), 12)
 18028  }
 18029  
 18030  // C comment
 18031  //  /* The real implementation of xFetch and xUnfetch */
 18032  func _sqlite3OsFetch(tls *crt.TLS, _id *Xsqlite3_file, _iOff int64, _iAmt int32, _pp *unsafe.Pointer) (r0 int32) {
 18033  	return func() func(*crt.TLS, *Xsqlite3_file, int64, int32, *unsafe.Pointer) int32 {
 18034  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxFetch
 18035  		return *(*func(*crt.TLS, *Xsqlite3_file, int64, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&v))
 18036  	}()(tls, _id, _iOff, _iAmt, _pp)
 18037  }
 18038  
 18039  // C comment
 18040  //  /*
 18041  //  ** Obtain a reference to a memory mapped page object for page number pgno.
 18042  //  ** The new object will use the pointer pData, obtained from xFetch().
 18043  //  ** If successful, set *ppPage to point to the new page reference
 18044  //  ** and return SQLITE_OK. Otherwise, return an SQLite error code and set
 18045  //  ** *ppPage to zero.
 18046  //  **
 18047  //  ** Page references obtained by calling this function should be released
 18048  //  ** by calling pagerReleaseMapPage().
 18049  //  */
 18050  func _pagerAcquireMapPage(tls *crt.TLS, _pPager *XPager, _pgno uint32, _pData unsafe.Pointer, _ppPage **XPgHdr) (r0 int32) {
 18051  	var _p *XPgHdr
 18052  	if _pPager.XpMmapFreelist != nil {
 18053  		*_ppPage = store34(&_p, (*XPgHdr)(_pPager.XpMmapFreelist))
 18054  		*(**XPgHdr)(unsafe.Pointer(&_pPager.XpMmapFreelist)) = (*XPgHdr)(_p.XpDirty)
 18055  		*(**XPgHdr)(unsafe.Pointer(&_p.XpDirty)) = nil
 18056  		func() {
 18057  			if int32(_pPager.XnExtra) < int32(8) {
 18058  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50940), unsafe.Pointer(&_pagerAcquireMapPageØ00__func__Ø000), unsafe.Pointer(str(18182)))
 18059  				crt.X__builtin_abort(tls)
 18060  			}
 18061  		}()
 18062  		crt.Xmemset(tls, _p.XpExtra, int32(0), uint32(8))
 18063  		goto _3
 18064  	}
 18065  	*_ppPage = store34(&_p, (*XPgHdr)(_sqlite3MallocZero(tls, uint64(uint32(40)+uint32(_pPager.XnExtra)))))
 18066  	if _p == nil {
 18067  		_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pPager.Xfd), int64(_pgno-uint32(1))*int64(_pPager.XpageSize), _pData)
 18068  		return _sqlite3NomemError(tls, int32(50946))
 18069  	}
 18070  	_p.XpExtra = unsafe.Pointer(elem34(_p, uintptr(1)))
 18071  	_p.Xflags = uint16(32)
 18072  	_p.XnRef = int16(1)
 18073  	*(**XPager)(unsafe.Pointer(&_p.XpPager)) = _pPager
 18074  _3:
 18075  	func() {
 18076  		if _p.XpExtra != unsafe.Pointer(elem34(_p, uintptr(1))) {
 18077  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50954), unsafe.Pointer(&_pagerAcquireMapPageØ00__func__Ø000), unsafe.Pointer(str(18200)))
 18078  			crt.X__builtin_abort(tls)
 18079  		}
 18080  	}()
 18081  	func() {
 18082  		if (*Xsqlite3_pcache_page)(_p.XpPage) != nil {
 18083  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50955), unsafe.Pointer(&_pagerAcquireMapPageØ00__func__Ø000), unsafe.Pointer(str(18225)))
 18084  			crt.X__builtin_abort(tls)
 18085  		}
 18086  	}()
 18087  	func() {
 18088  		if int32(_p.Xflags) != int32(32) {
 18089  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50956), unsafe.Pointer(&_pagerAcquireMapPageØ00__func__Ø000), unsafe.Pointer(str(18237)))
 18090  			crt.X__builtin_abort(tls)
 18091  		}
 18092  	}()
 18093  	func() {
 18094  		if (*XPager)(_p.XpPager) != _pPager {
 18095  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50957), unsafe.Pointer(&_pagerAcquireMapPageØ00__func__Ø000), unsafe.Pointer(str(18258)))
 18096  			crt.X__builtin_abort(tls)
 18097  		}
 18098  	}()
 18099  	func() {
 18100  		if int32(_p.XnRef) != int32(1) {
 18101  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50958), unsafe.Pointer(&_pagerAcquireMapPageØ00__func__Ø000), unsafe.Pointer(str(16295)))
 18102  			crt.X__builtin_abort(tls)
 18103  		}
 18104  	}()
 18105  	_p.Xpgno = _pgno
 18106  	_p.XpData = _pData
 18107  	_pPager.XnMmapOut += 1
 18108  	return int32(0)
 18109  }
 18110  
 18111  var _pagerAcquireMapPageØ00__func__Ø000 [20]int8
 18112  
 18113  func init() {
 18114  	crt.Xstrncpy(nil, &_pagerAcquireMapPageØ00__func__Ø000[0], str(18276), 20)
 18115  }
 18116  
 18117  // C comment
 18118  //  /*
 18119  //  ** The page getter methods each try to acquire a reference to a
 18120  //  ** page with page number pgno. If the requested reference is
 18121  //  ** successfully obtained, it is copied to *ppPage and SQLITE_OK returned.
 18122  //  **
 18123  //  ** There are different implementations of the getter method depending
 18124  //  ** on the current state of the pager.
 18125  //  **
 18126  //  **     getPageNormal()         --  The normal getter
 18127  //  **     getPageError()          --  Used if the pager is in an error state
 18128  //  **     getPageMmap()           --  Used if memory-mapped I/O is enabled
 18129  //  **
 18130  //  ** If the requested page is already in the cache, it is returned.
 18131  //  ** Otherwise, a new page object is allocated and populated with data
 18132  //  ** read from the database file. In some cases, the pcache module may
 18133  //  ** choose not to allocate a new page object and may reuse an existing
 18134  //  ** object with no outstanding references.
 18135  //  **
 18136  //  ** The extra data appended to a page is always initialized to zeros the
 18137  //  ** first time a page is loaded into memory. If the page requested is
 18138  //  ** already in the cache when this function is called, then the extra
 18139  //  ** data is left as it was when the page object was last used.
 18140  //  **
 18141  //  ** If the database image is smaller than the requested page or if
 18142  //  ** the flags parameter contains the PAGER_GET_NOCONTENT bit and the
 18143  //  ** requested page is not already stored in the cache, then no
 18144  //  ** actual disk read occurs. In this case the memory image of the
 18145  //  ** page is initialized to all zeros.
 18146  //  **
 18147  //  ** If PAGER_GET_NOCONTENT is true, it means that we do not care about
 18148  //  ** the contents of the page. This occurs in two scenarios:
 18149  //  **
 18150  //  **   a) When reading a free-list leaf page from the database, and
 18151  //  **
 18152  //  **   b) When a savepoint is being rolled back and we need to load
 18153  //  **      a new page into the cache to be filled with the data read
 18154  //  **      from the savepoint journal.
 18155  //  **
 18156  //  ** If PAGER_GET_NOCONTENT is true, then the data returned is zeroed instead
 18157  //  ** of being read from the database. Additionally, the bits corresponding
 18158  //  ** to pgno in Pager.pInJournal (bitvec of pages already written to the
 18159  //  ** journal file) and the PagerSavepoint.pInSavepoint bitvecs of any open
 18160  //  ** savepoints are set. This means if the page is made writable at any
 18161  //  ** point in the future, using a call to sqlite3PagerWrite(), its contents
 18162  //  ** will not be journaled. This saves IO.
 18163  //  **
 18164  //  ** The acquisition might fail for several reasons.  In all cases,
 18165  //  ** an appropriate error code is returned and *ppPage is set to NULL.
 18166  //  **
 18167  //  ** See also sqlite3PagerLookup().  Both this routine and Lookup() attempt
 18168  //  ** to find a page in the in-memory cache first.  If the page is not already
 18169  //  ** in memory, this routine goes to disk to read it in whereas Lookup()
 18170  //  ** just returns 0.  This routine acquires a read-lock the first time it
 18171  //  ** has to go to disk, and could also playback an old journal if necessary.
 18172  //  ** Since Lookup() never goes to disk, it never has to deal with locks
 18173  //  ** or journal files.
 18174  //  */
 18175  func _getPageNormal(tls *crt.TLS, _pPager *XPager, _pgno uint32, _ppPage **XPgHdr, _flags int32) (r0 int32) {
 18176  	var _rc int32
 18177  	var _10_iFrame uint32
 18178  	var _noContent uint8
 18179  	var _pPg *XPgHdr
 18180  	var _pBase *Xsqlite3_pcache_page
 18181  	_rc = int32(0)
 18182  	func() {
 18183  		if _pPager.XerrCode != int32(0) {
 18184  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52326), unsafe.Pointer(&_getPageNormalØ00__func__Ø000), unsafe.Pointer(str(11709)))
 18185  			crt.X__builtin_abort(tls)
 18186  		}
 18187  	}()
 18188  	func() {
 18189  		if int32(_pPager.XeState) < int32(1) {
 18190  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52327), unsafe.Pointer(&_getPageNormalØ00__func__Ø000), unsafe.Pointer(str(18112)))
 18191  			crt.X__builtin_abort(tls)
 18192  		}
 18193  	}()
 18194  	func() {
 18195  		if _assert_pager_state(tls, _pPager) == 0 {
 18196  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52328), unsafe.Pointer(&_getPageNormalØ00__func__Ø000), unsafe.Pointer(str(10971)))
 18197  			crt.X__builtin_abort(tls)
 18198  		}
 18199  	}()
 18200  	func() {
 18201  		if int32(_pPager.XhasHeldSharedLock) != int32(1) {
 18202  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52329), unsafe.Pointer(&_getPageNormalØ00__func__Ø000), unsafe.Pointer(str(18141)))
 18203  			crt.X__builtin_abort(tls)
 18204  		}
 18205  	}()
 18206  	if _pgno == (0) {
 18207  		return _sqlite3CorruptError(tls, int32(52331))
 18208  	}
 18209  	_pBase = _sqlite3PcacheFetch(tls, (*XPCache)(_pPager.XpPCache), _pgno, int32(3))
 18210  	if _pBase != nil {
 18211  		goto _9
 18212  	}
 18213  	_pPg = nil
 18214  	_rc = _sqlite3PcacheFetchStress(tls, (*XPCache)(_pPager.XpPCache), _pgno, &_pBase)
 18215  	if _rc != int32(0) {
 18216  		goto _pager_acquire_err
 18217  	}
 18218  	if _pBase == nil {
 18219  		_rc = _sqlite3NomemError(tls, int32(52338))
 18220  		goto _pager_acquire_err
 18221  	}
 18222  _9:
 18223  	_pPg = store34(_ppPage, _sqlite3PcacheFetchFinish(tls, (*XPCache)(_pPager.XpPCache), _pgno, _pBase))
 18224  	func() {
 18225  		if _pPg != (*_ppPage) {
 18226  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52343), unsafe.Pointer(&_getPageNormalØ00__func__Ø000), unsafe.Pointer(str(18296)))
 18227  			crt.X__builtin_abort(tls)
 18228  		}
 18229  	}()
 18230  	func() {
 18231  		if _pPg.Xpgno != _pgno {
 18232  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52344), unsafe.Pointer(&_getPageNormalØ00__func__Ø000), unsafe.Pointer(str(18311)))
 18233  			crt.X__builtin_abort(tls)
 18234  		}
 18235  	}()
 18236  	func() {
 18237  		if (*XPager)(_pPg.XpPager) != _pPager && (*XPager)(_pPg.XpPager) != nil {
 18238  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52345), unsafe.Pointer(&_getPageNormalØ00__func__Ø000), unsafe.Pointer(str(18327)))
 18239  			crt.X__builtin_abort(tls)
 18240  		}
 18241  	}()
 18242  	_noContent = uint8(bool2int((_flags & int32(1)) != int32(0)))
 18243  	if (_pPg.XpPager != nil) && (_noContent == 0) {
 18244  		func() {
 18245  			if _pgno > uint32(2147483647) || _pgno == uint32((_sqlite3PendingByte/_pPager.XpageSize)+int32(1)) {
 18246  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52351), unsafe.Pointer(&_getPageNormalØ00__func__Ø000), unsafe.Pointer(str(18365)))
 18247  				crt.X__builtin_abort(tls)
 18248  			}
 18249  		}()
 18250  		*elem8((*int32)(unsafe.Pointer(&_pPager.XaStat)), 0) += 1
 18251  		return int32(0)
 18252  	}
 18253  	if (_pgno > uint32(2147483647)) || (_pgno == uint32((_sqlite3PendingByte/_pPager.XpageSize)+int32(1))) {
 18254  		_rc = _sqlite3CorruptError(tls, int32(52363))
 18255  		goto _pager_acquire_err
 18256  	}
 18257  	*(**XPager)(unsafe.Pointer(&_pPg.XpPager)) = _pPager
 18258  	func() {
 18259  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) != nil && _pPager.XmemDb != 0 {
 18260  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52369), unsafe.Pointer(&_getPageNormalØ00__func__Ø000), unsafe.Pointer(str(18417)))
 18261  			crt.X__builtin_abort(tls)
 18262  		}
 18263  	}()
 18264  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) != nil && _pPager.XdbSize >= _pgno && _noContent == 0 {
 18265  		goto _32
 18266  	}
 18267  	if _pgno > _pPager.XmxPgno {
 18268  		_rc = int32(13)
 18269  		goto _pager_acquire_err
 18270  	}
 18271  	if _noContent == 0 {
 18272  		goto _34
 18273  	}
 18274  	_sqlite3BeginBenignMalloc(tls)
 18275  	if _pgno <= _pPager.XdbOrigSize {
 18276  		_rc = _sqlite3BitvecSet(tls, (*XBitvec)(_pPager.XpInJournal), _pgno)
 18277  	}
 18278  	_rc = _addToSavepointBitvecs(tls, _pPager, _pgno)
 18279  	_sqlite3EndBenignMalloc(tls)
 18280  _34:
 18281  	crt.Xmemset(tls, _pPg.XpData, int32(0), uint32(_pPager.XpageSize))
 18282  	goto _36
 18283  _32:
 18284  	_10_iFrame = uint32(0)
 18285  	if (*XWal)(_pPager.XpWal) == nil {
 18286  		goto _37
 18287  	}
 18288  	_rc = _sqlite3WalFindFrame(tls, (*XWal)(_pPager.XpWal), _pgno, &_10_iFrame)
 18289  	if _rc != int32(0) {
 18290  		goto _pager_acquire_err
 18291  	}
 18292  _37:
 18293  	func() {
 18294  		if (*XPager)(_pPg.XpPager) != _pPager {
 18295  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52399), unsafe.Pointer(&_getPageNormalØ00__func__Ø000), unsafe.Pointer(str(18447)))
 18296  			crt.X__builtin_abort(tls)
 18297  		}
 18298  	}()
 18299  	*elem8((*int32)(unsafe.Pointer(&_pPager.XaStat)), uintptr(1)) += 1
 18300  	_rc = _readDbPage(tls, _pPg, _10_iFrame)
 18301  	if _rc != int32(0) {
 18302  		goto _pager_acquire_err
 18303  	}
 18304  _36:
 18305  	return int32(0)
 18306  
 18307  _pager_acquire_err:
 18308  	func() {
 18309  		if _rc == int32(0) {
 18310  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52411), unsafe.Pointer(&_getPageNormalØ00__func__Ø000), unsafe.Pointer(str(18467)))
 18311  			crt.X__builtin_abort(tls)
 18312  		}
 18313  	}()
 18314  	if _pPg != nil {
 18315  		_sqlite3PcacheDrop(tls, _pPg)
 18316  	}
 18317  	_pagerUnlockIfUnused(tls, _pPager)
 18318  	*_ppPage = nil
 18319  	return _rc
 18320  }
 18321  
 18322  var _getPageNormalØ00__func__Ø000 [14]int8
 18323  
 18324  func init() {
 18325  	crt.Xstrncpy(nil, &_getPageNormalØ00__func__Ø000[0], str(18481), 14)
 18326  }
 18327  
 18328  // C comment
 18329  //  /*
 18330  //  ** If the sqlite3PcacheFetch() routine is unable to allocate a new
 18331  //  ** page because no clean pages are available for reuse and the cache
 18332  //  ** size limit has been reached, then this routine can be invoked to
 18333  //  ** try harder to allocate a page.  This routine might invoke the stress
 18334  //  ** callback to spill dirty pages to the journal.  It will then try to
 18335  //  ** allocate the new page and will only fail to allocate a new page on
 18336  //  ** an OOM error.
 18337  //  **
 18338  //  ** This routine should be invoked only after sqlite3PcacheFetch() fails.
 18339  //  */
 18340  func _sqlite3PcacheFetchStress(tls *crt.TLS, _pCache *XPCache, _pgno uint32, _ppPage **Xsqlite3_pcache_page) (r0 int32) {
 18341  	var _3_rc int32
 18342  	var _pPg *XPgHdr
 18343  	if int32(_pCache.XeCreate) == int32(2) {
 18344  		return int32(0)
 18345  	}
 18346  	if _sqlite3PcachePagecount(tls, _pCache) <= _pCache.XszSpill {
 18347  		goto _1
 18348  	}
 18349  	_pPg = (*XPgHdr)(_pCache.XpSynced)
 18350  _2:
 18351  	if _pPg == nil || _pPg.XnRef == 0 && (int32(_pPg.Xflags)&int32(8)) == 0 {
 18352  		goto _7
 18353  	}
 18354  	_pPg = (*XPgHdr)(_pPg.XpDirtyPrev)
 18355  	goto _2
 18356  _7:
 18357  	*(**XPgHdr)(unsafe.Pointer(&_pCache.XpSynced)) = _pPg
 18358  	if _pPg != nil {
 18359  		goto _8
 18360  	}
 18361  	_pPg = (*XPgHdr)(_pCache.XpDirtyTail)
 18362  _9:
 18363  	if _pPg == nil || _pPg.XnRef == 0 {
 18364  		goto _13
 18365  	}
 18366  	_pPg = (*XPgHdr)(_pPg.XpDirtyPrev)
 18367  	goto _9
 18368  _13:
 18369  _8:
 18370  	if _pPg == nil {
 18371  		goto _14
 18372  	}
 18373  	_3_rc = func() func(*crt.TLS, unsafe.Pointer, *XPgHdr) int32 {
 18374  		v := _pCache.XxStress
 18375  		return *(*func(*crt.TLS, unsafe.Pointer, *XPgHdr) int32)(unsafe.Pointer(&v))
 18376  	}()(tls, _pCache.XpStress, _pPg)
 18377  	if (_3_rc != int32(0)) && (_3_rc != int32(5)) {
 18378  		return _3_rc
 18379  	}
 18380  _14:
 18381  _1:
 18382  	*_ppPage = func() func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page {
 18383  		v := _sqlite3Config.Xpcache2.XxFetch
 18384  		return *(*func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page)(unsafe.Pointer(&v))
 18385  	}()(tls, _pCache.XpCache, _pgno, int32(2))
 18386  	return func() int32 {
 18387  		if (*_ppPage) == nil {
 18388  			return _sqlite3NomemError(tls, int32(44572))
 18389  		}
 18390  		return int32(0)
 18391  	}()
 18392  }
 18393  
 18394  // C comment
 18395  //  /*
 18396  //  ** Return the total number of pages in the cache.
 18397  //  */
 18398  func _sqlite3PcachePagecount(tls *crt.TLS, _pCache *XPCache) (r0 int32) {
 18399  	func() {
 18400  		if _pCache.XpCache == nil {
 18401  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44922), unsafe.Pointer(&_sqlite3PcachePagecountØ00__func__Ø000), unsafe.Pointer(str(15913)))
 18402  			crt.X__builtin_abort(tls)
 18403  		}
 18404  	}()
 18405  	return (_sqlite3Config.Xpcache2.XxPagecount)(tls, _pCache.XpCache)
 18406  }
 18407  
 18408  var _sqlite3PcachePagecountØ00__func__Ø000 [23]int8
 18409  
 18410  func init() {
 18411  	crt.Xstrncpy(nil, &_sqlite3PcachePagecountØ00__func__Ø000[0], str(18495), 23)
 18412  }
 18413  
 18414  func _sqlite3OsFileControlHint(tls *crt.TLS, _id *Xsqlite3_file, _op int32, _pArg unsafe.Pointer) {
 18415  	func() func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32 {
 18416  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxFileControl
 18417  		return *(*func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32)(unsafe.Pointer(&v))
 18418  	}()(tls, _id, _op, _pArg)
 18419  }
 18420  
 18421  // C comment
 18422  //  /*
 18423  //  ** Move the write position of the WAL back to the point identified by
 18424  //  ** the values in the aWalData[] array. aWalData must point to an array
 18425  //  ** of WAL_SAVEPOINT_NDATA u32 values that has been previously populated
 18426  //  ** by a call to WalSavepoint().
 18427  //  */
 18428  func _sqlite3WalSavepointUndo(tls *crt.TLS, _pWal *XWal, _aWalData *uint32) (r0 int32) {
 18429  	var _rc int32
 18430  	_rc = int32(0)
 18431  	func() {
 18432  		if _pWal.XwriteLock == 0 {
 18433  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57316), unsafe.Pointer(&_sqlite3WalSavepointUndoØ00__func__Ø000), unsafe.Pointer(str(15561)))
 18434  			crt.X__builtin_abort(tls)
 18435  		}
 18436  	}()
 18437  	func() {
 18438  		if (*elem7(_aWalData, uintptr(3))) == _pWal.XnCkpt && (*elem7(_aWalData, 0)) > (_pWal.Xhdr.XmxFrame) {
 18439  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57317), unsafe.Pointer(&_sqlite3WalSavepointUndoØ00__func__Ø000), unsafe.Pointer(str(18518)))
 18440  			crt.X__builtin_abort(tls)
 18441  		}
 18442  	}()
 18443  	if (*elem7(_aWalData, uintptr(3))) != _pWal.XnCkpt {
 18444  		*elem7(_aWalData, 0) = 0
 18445  		*elem7(_aWalData, uintptr(3)) = _pWal.XnCkpt
 18446  	}
 18447  	if (*elem7(_aWalData, 0)) < (_pWal.Xhdr.XmxFrame) {
 18448  		_pWal.Xhdr.XmxFrame = *elem7(_aWalData, 0)
 18449  		*elem7((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), 0) = *elem7(_aWalData, uintptr(1))
 18450  		*elem7((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), uintptr(1)) = *elem7(_aWalData, uintptr(2))
 18451  		_walCleanupHash(tls, _pWal)
 18452  	}
 18453  	return _rc
 18454  }
 18455  
 18456  var _sqlite3WalSavepointUndoØ00__func__Ø000 [24]int8
 18457  
 18458  func init() {
 18459  	crt.Xstrncpy(nil, &_sqlite3WalSavepointUndoØ00__func__Ø000[0], str(18577), 24)
 18460  }
 18461  
 18462  // C comment
 18463  //  /*
 18464  //  ** This routine ends a transaction. A transaction is usually ended by
 18465  //  ** either a COMMIT or a ROLLBACK operation. This routine may be called
 18466  //  ** after rollback of a hot-journal, or if an error occurs while opening
 18467  //  ** the journal file or writing the very first journal-header of a
 18468  //  ** database transaction.
 18469  //  **
 18470  //  ** This routine is never called in PAGER_ERROR state. If it is called
 18471  //  ** in PAGER_NONE or PAGER_SHARED state and the lock held is less
 18472  //  ** exclusive than a RESERVED lock, it is a no-op.
 18473  //  **
 18474  //  ** Otherwise, any active savepoints are released.
 18475  //  **
 18476  //  ** If the journal file is open, then it is "finalized". Once a journal
 18477  //  ** file has been finalized it is not possible to use it to roll back a
 18478  //  ** transaction. Nor will it be considered to be a hot-journal by this
 18479  //  ** or any other database connection. Exactly how a journal is finalized
 18480  //  ** depends on whether or not the pager is running in exclusive mode and
 18481  //  ** the current journal-mode (Pager.journalMode value), as follows:
 18482  //  **
 18483  //  **   journalMode==MEMORY
 18484  //  **     Journal file descriptor is simply closed. This destroys an
 18485  //  **     in-memory journal.
 18486  //  **
 18487  //  **   journalMode==TRUNCATE
 18488  //  **     Journal file is truncated to zero bytes in size.
 18489  //  **
 18490  //  **   journalMode==PERSIST
 18491  //  **     The first 28 bytes of the journal file are zeroed. This invalidates
 18492  //  **     the first journal header in the file, and hence the entire journal
 18493  //  **     file. An invalid journal file cannot be rolled back.
 18494  //  **
 18495  //  **   journalMode==DELETE
 18496  //  **     The journal file is closed and deleted using sqlite3OsDelete().
 18497  //  **
 18498  //  **     If the pager is running in exclusive mode, this method of finalizing
 18499  //  **     the journal file is never used. Instead, if the journalMode is
 18500  //  **     DELETE and the pager is in exclusive mode, the method described under
 18501  //  **     journalMode==PERSIST is used instead.
 18502  //  **
 18503  //  ** After the journal is finalized, the pager moves to PAGER_READER state.
 18504  //  ** If running in non-exclusive rollback mode, the lock on the file is
 18505  //  ** downgraded to a SHARED_LOCK.
 18506  //  **
 18507  //  ** SQLITE_OK is returned if no error occurs. If an error occurs during
 18508  //  ** any of the IO operations to finalize the journal file or unlock the
 18509  //  ** database then the IO error code is returned to the user. If the
 18510  //  ** operation to finalize the journal file fails, then the code still
 18511  //  ** tries to unlock the database file if not in exclusive mode. If the
 18512  //  ** unlock operation fails as well, then the first error code related
 18513  //  ** to the first error encountered (the journal finalization one) is
 18514  //  ** returned.
 18515  //  */
 18516  func _pager_end_transaction(tls *crt.TLS, _pPager *XPager, _hasMaster int32, _bCommit int32) (r0 int32) {
 18517  	var _rc, _rc2, _9_bDelete int32
 18518  	_rc = int32(0)
 18519  	_rc2 = int32(0)
 18520  	func() {
 18521  		if _assert_pager_state(tls, _pPager) == 0 {
 18522  			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)))
 18523  			crt.X__builtin_abort(tls)
 18524  		}
 18525  	}()
 18526  	func() {
 18527  		if int32(_pPager.XeState) == int32(6) {
 18528  			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)))
 18529  			crt.X__builtin_abort(tls)
 18530  		}
 18531  	}()
 18532  	if (int32(_pPager.XeState) < int32(2)) && (int32(_pPager.XeLock) < int32(2)) {
 18533  		return int32(0)
 18534  	}
 18535  	_releaseAllSavepoints(tls, _pPager)
 18536  	func() {
 18537  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil && (*XBitvec)(_pPager.XpInJournal) != nil {
 18538  			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)))
 18539  			crt.X__builtin_abort(tls)
 18540  		}
 18541  	}()
 18542  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil {
 18543  		goto _9
 18544  	}
 18545  	func() {
 18546  		if (*XWal)(_pPager.XpWal) != nil {
 18547  			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)))
 18548  			crt.X__builtin_abort(tls)
 18549  		}
 18550  	}()
 18551  	if _sqlite3JournalIsInMemory(tls, (*Xsqlite3_file)(_pPager.Xjfd)) != 0 {
 18552  		_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.Xjfd))
 18553  		goto _24
 18554  	}
 18555  	if int32(_pPager.XjournalMode) != int32(3) {
 18556  		goto _14
 18557  	}
 18558  	if _pPager.XjournalOff == (0) {
 18559  		_rc = int32(0)
 18560  		goto _16
 18561  	}
 18562  	_rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pPager.Xjfd), 0)
 18563  	if (_rc == int32(0)) && (_pPager.XfullSync != 0) {
 18564  		_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pPager.Xjfd), int32(_pPager.XsyncFlags))
 18565  	}
 18566  _16:
 18567  	_pPager.XjournalOff = 0
 18568  	goto _24
 18569  _14:
 18570  	if (int32(_pPager.XjournalMode) == int32(1)) || ((_pPager.XexclusiveMode != 0) && (int32(_pPager.XjournalMode) != int32(5))) {
 18571  		_rc = _zeroJournalHdr(tls, _pPager, bool2int(_hasMaster != 0 || (_pPager.XtempFile != 0)))
 18572  		_pPager.XjournalOff = 0
 18573  		goto _24
 18574  	}
 18575  	_9_bDelete = bool2int(_pPager.XtempFile == 0)
 18576  	func() {
 18577  		if _sqlite3JournalIsInMemory(tls, (*Xsqlite3_file)(_pPager.Xjfd)) != int32(0) {
 18578  			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)))
 18579  			crt.X__builtin_abort(tls)
 18580  		}
 18581  	}()
 18582  	func() {
 18583  		if int32(_pPager.XjournalMode) != int32(0) && int32(_pPager.XjournalMode) != int32(4) && int32(_pPager.XjournalMode) != int32(5) {
 18584  			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)))
 18585  			crt.X__builtin_abort(tls)
 18586  		}
 18587  	}()
 18588  	_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.Xjfd))
 18589  	if _9_bDelete != 0 {
 18590  		_rc = _sqlite3OsDelete(tls, (*Xsqlite3_vfs)(_pPager.XpVfs), _pPager.XzJournal, int32(_pPager.XextraSync))
 18591  	}
 18592  _24:
 18593  _9:
 18594  	_sqlite3BitvecDestroy(tls, (*XBitvec)(_pPager.XpInJournal))
 18595  	*(**XBitvec)(unsafe.Pointer(&_pPager.XpInJournal)) = nil
 18596  	_pPager.XnRec = int32(0)
 18597  	if _rc != int32(0) {
 18598  		goto _32
 18599  	}
 18600  	if (_pPager.XmemDb != 0) || _pagerFlushOnCommit(tls, _pPager, _bCommit) != 0 {
 18601  		_sqlite3PcacheCleanAll(tls, (*XPCache)(_pPager.XpPCache))
 18602  		goto _35
 18603  	}
 18604  	_sqlite3PcacheClearWritable(tls, (*XPCache)(_pPager.XpPCache))
 18605  _35:
 18606  	_sqlite3PcacheTruncate(tls, (*XPCache)(_pPager.XpPCache), _pPager.XdbSize)
 18607  _32:
 18608  	if (*XWal)(_pPager.XpWal) != nil {
 18609  		_rc2 = _sqlite3WalEndWriteTransaction(tls, (*XWal)(_pPager.XpWal))
 18610  		func() {
 18611  			if _rc2 != int32(0) {
 18612  				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)))
 18613  				crt.X__builtin_abort(tls)
 18614  			}
 18615  		}()
 18616  		goto _42
 18617  	}
 18618  	if ((_rc == int32(0)) && _bCommit != 0) && (_pPager.XdbFileSize > _pPager.XdbSize) {
 18619  		func() {
 18620  			if int32(_pPager.XeLock) != int32(4) {
 18621  				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)))
 18622  				crt.X__builtin_abort(tls)
 18623  			}
 18624  		}()
 18625  		_rc = _pager_truncate(tls, _pPager, _pPager.XdbSize)
 18626  	}
 18627  _42:
 18628  	if _rc != int32(0) || _bCommit == 0 || (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil {
 18629  		goto _47
 18630  	}
 18631  	_rc = _sqlite3OsFileControl(tls, (*Xsqlite3_file)(_pPager.Xfd), int32(22), nil)
 18632  	if _rc == int32(12) {
 18633  		_rc = int32(0)
 18634  	}
 18635  _47:
 18636  	if (_pPager.XexclusiveMode == 0) && (((*XWal)(_pPager.XpWal) == nil) || _sqlite3WalExclusiveMode(tls, (*XWal)(_pPager.XpWal), int32(0)) != 0) {
 18637  		_rc2 = _pagerUnlockDb(tls, _pPager, int32(1))
 18638  		_pPager.XchangeCountDone = 0
 18639  	}
 18640  	_pPager.XeState = uint8(1)
 18641  	_pPager.XsetMaster = 0
 18642  	return func() int32 {
 18643  		if _rc == int32(0) {
 18644  			return _rc2
 18645  		}
 18646  		return _rc
 18647  	}()
 18648  }
 18649  
 18650  var _pager_end_transactionØ00__func__Ø000 [22]int8
 18651  
 18652  func init() {
 18653  	crt.Xstrncpy(nil, &_pager_end_transactionØ00__func__Ø000[0], str(18873), 22)
 18654  }
 18655  
 18656  // C comment
 18657  //  /*
 18658  //  ** Free all structures in the Pager.aSavepoint[] array and set both
 18659  //  ** Pager.aSavepoint and Pager.nSavepoint to zero. Close the sub-journal
 18660  //  ** if it is open and the pager is not in exclusive mode.
 18661  //  */
 18662  func _releaseAllSavepoints(tls *crt.TLS, _pPager *XPager) {
 18663  	var _ii int32
 18664  	_ii = int32(0)
 18665  _0:
 18666  	if _ii >= _pPager.XnSavepoint {
 18667  		goto _3
 18668  	}
 18669  	_sqlite3BitvecDestroy(tls, (*XBitvec)(elem31((*XPagerSavepoint)(_pPager.XaSavepoint), uintptr(_ii)).XpInSavepoint))
 18670  	_ii += 1
 18671  	goto _0
 18672  _3:
 18673  	if (_pPager.XexclusiveMode == 0) || _sqlite3JournalIsInMemory(tls, (*Xsqlite3_file)(_pPager.Xsjfd)) != 0 {
 18674  		_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.Xsjfd))
 18675  	}
 18676  	Xsqlite3_free(tls, _pPager.XaSavepoint)
 18677  	*(**XPagerSavepoint)(unsafe.Pointer(&_pPager.XaSavepoint)) = nil
 18678  	_pPager.XnSavepoint = int32(0)
 18679  	_pPager.XnSubRec = 0
 18680  }
 18681  
 18682  func _sqlite3OsSync(tls *crt.TLS, _id *Xsqlite3_file, _flags int32) (r0 int32) {
 18683  	return func() func(*crt.TLS, *Xsqlite3_file, int32) int32 {
 18684  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxSync
 18685  		return *(*func(*crt.TLS, *Xsqlite3_file, int32) int32)(unsafe.Pointer(&v))
 18686  	}()(tls, _id, _flags)
 18687  }
 18688  
 18689  // C comment
 18690  //  /*
 18691  //  ** The journal file must be open when this function is called.
 18692  //  **
 18693  //  ** This function is a no-op if the journal file has not been written to
 18694  //  ** within the current transaction (i.e. if Pager.journalOff==0).
 18695  //  **
 18696  //  ** If doTruncate is non-zero or the Pager.journalSizeLimit variable is
 18697  //  ** set to 0, then truncate the journal file to zero bytes in size. Otherwise,
 18698  //  ** zero the 28-byte header at the start of the journal file. In either case,
 18699  //  ** if the pager is not in no-sync mode, sync the journal file immediately
 18700  //  ** after writing or truncating it.
 18701  //  **
 18702  //  ** If Pager.journalSizeLimit is set to a positive, non-zero value, and
 18703  //  ** following the truncation or zeroing described above the size of the
 18704  //  ** journal file in bytes is larger than this value, then truncate the
 18705  //  ** journal file to Pager.journalSizeLimit bytes. The journal file does
 18706  //  ** not need to be synced following this operation.
 18707  //  **
 18708  //  ** If an IO error occurs, abandon processing and return the IO error code.
 18709  //  ** Otherwise, return SQLITE_OK.
 18710  //  */
 18711  func _zeroJournalHdr(tls *crt.TLS, _pPager *XPager, _doTruncate int32) (r0 int32) {
 18712  	var _rc int32
 18713  	var _1_iLimit, _5_sz int64
 18714  	_rc = int32(0)
 18715  	func() {
 18716  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil {
 18717  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48287), unsafe.Pointer(&_zeroJournalHdrØ00__func__Ø000), unsafe.Pointer(str(13581)))
 18718  			crt.X__builtin_abort(tls)
 18719  		}
 18720  	}()
 18721  	func() {
 18722  		if _sqlite3JournalIsInMemory(tls, (*Xsqlite3_file)(_pPager.Xjfd)) != 0 {
 18723  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48288), unsafe.Pointer(&_zeroJournalHdrØ00__func__Ø000), unsafe.Pointer(str(18895)))
 18724  			crt.X__builtin_abort(tls)
 18725  		}
 18726  	}()
 18727  	if _pPager.XjournalOff == 0 {
 18728  		goto _4
 18729  	}
 18730  	_1_iLimit = _pPager.XjournalSizeLimit
 18731  	if _doTruncate != 0 || (_1_iLimit == (0)) {
 18732  		_rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pPager.Xjfd), 0)
 18733  		goto _7
 18734  	}
 18735  	_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.Xjfd), unsafe.Pointer(&_zeroJournalHdrØ00zeroHdrØ001), int32(28), 0)
 18736  _7:
 18737  	if (_rc == int32(0)) && (_pPager.XnoSync == 0) {
 18738  		_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pPager.Xjfd), int32(16)|int32(_pPager.XsyncFlags))
 18739  	}
 18740  	if _rc != int32(0) || _1_iLimit <= (0) {
 18741  		goto _11
 18742  	}
 18743  	_rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.Xjfd), &_5_sz)
 18744  	if (_rc == int32(0)) && (_5_sz > _1_iLimit) {
 18745  		_rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pPager.Xjfd), _1_iLimit)
 18746  	}
 18747  _11:
 18748  _4:
 18749  	return _rc
 18750  }
 18751  
 18752  var _zeroJournalHdrØ00__func__Ø000 [15]int8
 18753  
 18754  func init() {
 18755  	crt.Xstrncpy(nil, &_zeroJournalHdrØ00__func__Ø000[0], str(18934), 15)
 18756  }
 18757  
 18758  var _zeroJournalHdrØ00zeroHdrØ001 [28]int8
 18759  
 18760  func _sqlite3OsDelete(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _dirSync int32) (r0 int32) {
 18761  	func() {
 18762  		if _dirSync != int32(0) && _dirSync != int32(1) {
 18763  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(20297), unsafe.Pointer(&_sqlite3OsDeleteØ00__func__Ø000), unsafe.Pointer(str(18949)))
 18764  			crt.X__builtin_abort(tls)
 18765  		}
 18766  	}()
 18767  	return func() func(*crt.TLS, *Xsqlite3_vfs, *int8, int32) int32 {
 18768  		v := _pVfs.XxDelete
 18769  		return *(*func(*crt.TLS, *Xsqlite3_vfs, *int8, int32) int32)(unsafe.Pointer(&v))
 18770  	}()(tls, _pVfs, _zPath, _dirSync)
 18771  }
 18772  
 18773  var _sqlite3OsDeleteØ00__func__Ø000 [16]int8
 18774  
 18775  func init() {
 18776  	crt.Xstrncpy(nil, &_sqlite3OsDeleteØ00__func__Ø000[0], str(18974), 16)
 18777  }
 18778  
 18779  // C comment
 18780  //  /*
 18781  //  ** The write transaction open on pPager is being committed (bCommit==1)
 18782  //  ** or rolled back (bCommit==0).
 18783  //  **
 18784  //  ** Return TRUE if and only if all dirty pages should be flushed to disk.
 18785  //  **
 18786  //  ** Rules:
 18787  //  **
 18788  //  **   *  For non-TEMP databases, always sync to disk.  This is necessary
 18789  //  **      for transactions to be durable.
 18790  //  **
 18791  //  **   *  Sync TEMP database only on a COMMIT (not a ROLLBACK) when the backing
 18792  //  **      file has been created already (via a spill on pagerStress()) and
 18793  //  **      when the number of dirty pages in memory exceeds 25% of the total
 18794  //  **      cache size.
 18795  //  */
 18796  func _pagerFlushOnCommit(tls *crt.TLS, _pPager *XPager, _bCommit int32) (r0 int32) {
 18797  	if int32(_pPager.XtempFile) == int32(0) {
 18798  		return int32(1)
 18799  	}
 18800  	if _bCommit == 0 {
 18801  		return int32(0)
 18802  	}
 18803  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil {
 18804  		return int32(0)
 18805  	}
 18806  	return bool2int(_sqlite3PCachePercentDirty(tls, (*XPCache)(_pPager.XpPCache)) >= int32(25))
 18807  }
 18808  
 18809  // C comment
 18810  //  /*
 18811  //  ** Return the number of dirty pages currently in the cache, as a percentage
 18812  //  ** of the configured cache size.
 18813  //  */
 18814  func _sqlite3PCachePercentDirty(tls *crt.TLS, _pCache *XPCache) (r0 int32) {
 18815  	var _nDirty, _nCache int32
 18816  	var _pDirty *XPgHdr
 18817  	_nDirty = int32(0)
 18818  	_nCache = _numberOfCachePages(tls, _pCache)
 18819  	_pDirty = (*XPgHdr)(_pCache.XpDirty)
 18820  _0:
 18821  	if _pDirty == nil {
 18822  		goto _3
 18823  	}
 18824  	_nDirty += 1
 18825  	_pDirty = (*XPgHdr)(_pDirty.XpDirtyNext)
 18826  	goto _0
 18827  _3:
 18828  	return func() int32 {
 18829  		if _nCache != 0 {
 18830  			return int32((int64(_nDirty) * int64(100)) / int64(_nCache))
 18831  		}
 18832  		return int32(0)
 18833  	}()
 18834  }
 18835  
 18836  // C comment
 18837  //  /*
 18838  //  ** Make every page in the cache clean.
 18839  //  */
 18840  func _sqlite3PcacheCleanAll(tls *crt.TLS, _pCache *XPCache) {
 18841  	var _p *XPgHdr
 18842  _0:
 18843  	if store34(&_p, (*XPgHdr)(_pCache.XpDirty)) != nil {
 18844  		_sqlite3PcacheMakeClean(tls, _p)
 18845  		goto _0
 18846  	}
 18847  }
 18848  
 18849  // C comment
 18850  //  /*
 18851  //  ** Clear the PGHDR_NEED_SYNC and PGHDR_WRITEABLE flag from all dirty pages.
 18852  //  */
 18853  func _sqlite3PcacheClearWritable(tls *crt.TLS, _pCache *XPCache) {
 18854  	var _p *XPgHdr
 18855  	_p = (*XPgHdr)(_pCache.XpDirty)
 18856  _0:
 18857  	if _p == nil {
 18858  		goto _3
 18859  	}
 18860  	{
 18861  		p := &_p.Xflags
 18862  		*p = uint16(int32(*p) & int32(-13))
 18863  	}
 18864  	_p = (*XPgHdr)(_p.XpDirtyNext)
 18865  	goto _0
 18866  _3:
 18867  	*(**XPgHdr)(unsafe.Pointer(&_pCache.XpSynced)) = (*XPgHdr)(_pCache.XpDirtyTail)
 18868  }
 18869  
 18870  // C comment
 18871  //  /*
 18872  //  ** End a write transaction.  The commit has already been done.  This
 18873  //  ** routine merely releases the lock.
 18874  //  */
 18875  func _sqlite3WalEndWriteTransaction(tls *crt.TLS, _pWal *XWal) (r0 int32) {
 18876  	if _pWal.XwriteLock != 0 {
 18877  		_walUnlockExclusive(tls, _pWal, int32(0), int32(1))
 18878  		_pWal.XwriteLock = 0
 18879  		_pWal.XiReCksum = 0
 18880  		_pWal.XtruncateOnCommit = 0
 18881  	}
 18882  	return int32(0)
 18883  }
 18884  
 18885  func _walUnlockExclusive(tls *crt.TLS, _pWal *XWal, _lockIdx int32, _n int32) {
 18886  	if _pWal.XexclusiveMode != 0 {
 18887  		return
 18888  	}
 18889  	_sqlite3OsShmLock(tls, (*Xsqlite3_file)(_pWal.XpDbFd), _lockIdx, _n, int32(9))
 18890  }
 18891  
 18892  func _sqlite3OsShmLock(tls *crt.TLS, _id *Xsqlite3_file, _offset int32, _n int32, _flags int32) (r0 int32) {
 18893  	return func() func(*crt.TLS, *Xsqlite3_file, int32, int32, int32) int32 {
 18894  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxShmLock
 18895  		return *(*func(*crt.TLS, *Xsqlite3_file, int32, int32, int32) int32)(unsafe.Pointer(&v))
 18896  	}()(tls, _id, _offset, _n, _flags)
 18897  }
 18898  
 18899  // C comment
 18900  //  /*
 18901  //  ** This function is used to change the actual size of the database
 18902  //  ** file in the file-system. This only happens when committing a transaction,
 18903  //  ** or rolling back a transaction (including rolling back a hot-journal).
 18904  //  **
 18905  //  ** If the main database file is not open, or the pager is not in either
 18906  //  ** DBMOD or OPEN state, this function is a no-op. Otherwise, the size
 18907  //  ** of the file is changed to nPage pages (nPage*pPager->pageSize bytes).
 18908  //  ** If the file on disk is currently larger than nPage pages, then use the VFS
 18909  //  ** xTruncate() method to truncate it.
 18910  //  **
 18911  //  ** Or, it might be the case that the file on disk is smaller than
 18912  //  ** nPage pages. Some operating system implementations can get confused if
 18913  //  ** you try to truncate a file to some size that is larger than it
 18914  //  ** currently is, so detect this case and write a single zero byte to
 18915  //  ** the end of the new file instead.
 18916  //  **
 18917  //  ** If successful, return SQLITE_OK. If an IO error occurs while modifying
 18918  //  ** the database file, return the error code to the caller.
 18919  //  */
 18920  func _pager_truncate(tls *crt.TLS, _pPager *XPager, _nPage uint32) (r0 int32) {
 18921  	var _rc, _1_szPage int32
 18922  	var _1_currentSize, _1_newSize int64
 18923  	var _4_pTmp *int8
 18924  	_rc = int32(0)
 18925  	func() {
 18926  		if int32(_pPager.XeState) == int32(6) {
 18927  			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)))
 18928  			crt.X__builtin_abort(tls)
 18929  		}
 18930  	}()
 18931  	func() {
 18932  		if int32(_pPager.XeState) == int32(1) {
 18933  			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)))
 18934  			crt.X__builtin_abort(tls)
 18935  		}
 18936  	}()
 18937  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil || int32(_pPager.XeState) < int32(4) && int32(_pPager.XeState) != int32(0) {
 18938  		goto _6
 18939  	}
 18940  	_1_szPage = _pPager.XpageSize
 18941  	func() {
 18942  		if int32(_pPager.XeLock) != int32(4) {
 18943  			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)))
 18944  			crt.X__builtin_abort(tls)
 18945  		}
 18946  	}()
 18947  	_rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.Xfd), &_1_currentSize)
 18948  	_1_newSize = int64(_1_szPage) * int64(_nPage)
 18949  	if _rc != int32(0) || _1_currentSize == _1_newSize {
 18950  		goto _10
 18951  	}
 18952  	if _1_currentSize > _1_newSize {
 18953  		_rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pPager.Xfd), _1_newSize)
 18954  		goto _13
 18955  	}
 18956  	if (_1_currentSize + int64(_1_szPage)) <= _1_newSize {
 18957  		_4_pTmp = _pPager.XpTmpSpace
 18958  		crt.Xmemset(tls, unsafe.Pointer(_4_pTmp), int32(0), uint32(_1_szPage))
 18959  		_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.Xfd), unsafe.Pointer(_4_pTmp), _1_szPage, _1_newSize-int64(_1_szPage))
 18960  	}
 18961  _13:
 18962  	if _rc == int32(0) {
 18963  		_pPager.XdbFileSize = _nPage
 18964  	}
 18965  _10:
 18966  _6:
 18967  	return _rc
 18968  }
 18969  
 18970  var _pager_truncateØ00__func__Ø000 [15]int8
 18971  
 18972  func init() {
 18973  	crt.Xstrncpy(nil, &_pager_truncateØ00__func__Ø000[0], str(19019), 15)
 18974  }
 18975  
 18976  // C comment
 18977  //  /*
 18978  //  ** This function is called to change the WAL subsystem into or out
 18979  //  ** of locking_mode=EXCLUSIVE.
 18980  //  **
 18981  //  ** If op is zero, then attempt to change from locking_mode=EXCLUSIVE
 18982  //  ** into locking_mode=NORMAL.  This means that we must acquire a lock
 18983  //  ** on the pWal->readLock byte.  If the WAL is already in locking_mode=NORMAL
 18984  //  ** or if the acquisition of the lock fails, then return 0.  If the
 18985  //  ** transition out of exclusive-mode is successful, return 1.  This
 18986  //  ** operation must occur while the pager is still holding the exclusive
 18987  //  ** lock on the main database file.
 18988  //  **
 18989  //  ** If op is one, then change from locking_mode=NORMAL into
 18990  //  ** locking_mode=EXCLUSIVE.  This means that the pWal->readLock must
 18991  //  ** be released.  Return 1 if the transition is made and 0 if the
 18992  //  ** WAL is already in exclusive-locking mode - meaning that this
 18993  //  ** routine is a no-op.  The pager must already hold the exclusive lock
 18994  //  ** on the main database file before invoking this operation.
 18995  //  **
 18996  //  ** If op is negative, then do a dry-run of the op==1 case but do
 18997  //  ** not actually change anything. The pager uses this to see if it
 18998  //  ** should acquire the database exclusive lock prior to invoking
 18999  //  ** the op==1 case.
 19000  //  */
 19001  func _sqlite3WalExclusiveMode(tls *crt.TLS, _pWal *XWal, _op int32) (r0 int32) {
 19002  	var _rc int32
 19003  	func() {
 19004  		if int32(_pWal.XwriteLock) != int32(0) {
 19005  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57902), unsafe.Pointer(&_sqlite3WalExclusiveModeØ00__func__Ø000), unsafe.Pointer(str(19034)))
 19006  			crt.X__builtin_abort(tls)
 19007  		}
 19008  	}()
 19009  	func() {
 19010  		if int32(_pWal.XexclusiveMode) == int32(2) && _op != int32(-1) {
 19011  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57903), unsafe.Pointer(&_sqlite3WalExclusiveModeØ00__func__Ø000), unsafe.Pointer(str(19053)))
 19012  			crt.X__builtin_abort(tls)
 19013  		}
 19014  	}()
 19015  	func() {
 19016  		if int32(_pWal.XreadLock) < int32(0) && _pWal.XlockError == 0 {
 19017  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57911), unsafe.Pointer(&_sqlite3WalExclusiveModeØ00__func__Ø000), unsafe.Pointer(str(16324)))
 19018  			crt.X__builtin_abort(tls)
 19019  		}
 19020  	}()
 19021  	func() {
 19022  		if int32(_pWal.XreadLock) < int32(0) && (_op > int32(0) || int32(_pWal.XexclusiveMode) != int32(0)) {
 19023  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57912), unsafe.Pointer(&_sqlite3WalExclusiveModeØ00__func__Ø000), unsafe.Pointer(str(19104)))
 19024  			crt.X__builtin_abort(tls)
 19025  		}
 19026  	}()
 19027  	if _op != int32(0) {
 19028  		goto _12
 19029  	}
 19030  	if _pWal.XexclusiveMode == 0 {
 19031  		goto _13
 19032  	}
 19033  	_pWal.XexclusiveMode = 0
 19034  	if _walLockShared(tls, _pWal, int32(3)+int32(_pWal.XreadLock)) != int32(0) {
 19035  		_pWal.XexclusiveMode = uint8(1)
 19036  	}
 19037  	_rc = bool2int(int32(_pWal.XexclusiveMode) == int32(0))
 19038  	goto _15
 19039  _13:
 19040  	_rc = int32(0)
 19041  _15:
 19042  	goto _22
 19043  _12:
 19044  	if _op > int32(0) {
 19045  		func() {
 19046  			if int32(_pWal.XexclusiveMode) != int32(0) {
 19047  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57926), unsafe.Pointer(&_sqlite3WalExclusiveModeØ00__func__Ø000), unsafe.Pointer(str(19159)))
 19048  				crt.X__builtin_abort(tls)
 19049  			}
 19050  		}()
 19051  		func() {
 19052  			if int32(_pWal.XreadLock) < int32(0) {
 19053  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57927), unsafe.Pointer(&_sqlite3WalExclusiveModeØ00__func__Ø000), unsafe.Pointer(str(19182)))
 19054  				crt.X__builtin_abort(tls)
 19055  			}
 19056  		}()
 19057  		_walUnlockShared(tls, _pWal, int32(3)+int32(_pWal.XreadLock))
 19058  		_pWal.XexclusiveMode = uint8(1)
 19059  		_rc = int32(1)
 19060  		goto _22
 19061  	}
 19062  	_rc = bool2int(int32(_pWal.XexclusiveMode) == int32(0))
 19063  _22:
 19064  	return _rc
 19065  }
 19066  
 19067  var _sqlite3WalExclusiveModeØ00__func__Ø000 [24]int8
 19068  
 19069  func init() {
 19070  	crt.Xstrncpy(nil, &_sqlite3WalExclusiveModeØ00__func__Ø000[0], str(19200), 24)
 19071  }
 19072  
 19073  // C comment
 19074  //  /*
 19075  //  ** Set or release locks on the WAL.  Locks are either shared or exclusive.
 19076  //  ** A lock cannot be moved directly between shared and exclusive - it must go
 19077  //  ** through the unlocked state first.
 19078  //  **
 19079  //  ** In locking_mode=EXCLUSIVE, all of these routines become no-ops.
 19080  //  */
 19081  func _walLockShared(tls *crt.TLS, _pWal *XWal, _lockIdx int32) (r0 int32) {
 19082  	var _rc int32
 19083  	if _pWal.XexclusiveMode != 0 {
 19084  		return int32(0)
 19085  	}
 19086  	_rc = _sqlite3OsShmLock(tls, (*Xsqlite3_file)(_pWal.XpDbFd), _lockIdx, int32(1), int32(6))
 19087  	_pWal.XlockError = uint8(bool2int((_rc != int32(0)) && (_rc != int32(5))))
 19088  	return _rc
 19089  }
 19090  
 19091  func _walUnlockShared(tls *crt.TLS, _pWal *XWal, _lockIdx int32) {
 19092  	if _pWal.XexclusiveMode != 0 {
 19093  		return
 19094  	}
 19095  	_sqlite3OsShmLock(tls, (*Xsqlite3_file)(_pWal.XpDbFd), _lockIdx, int32(1), int32(5))
 19096  }
 19097  
 19098  // C comment
 19099  //  /*
 19100  //  ** Unlock the database file to level eLock, which must be either NO_LOCK
 19101  //  ** or SHARED_LOCK. Regardless of whether or not the call to xUnlock()
 19102  //  ** succeeds, set the Pager.eLock variable to match the (attempted) new lock.
 19103  //  **
 19104  //  ** Except, if Pager.eLock is set to UNKNOWN_LOCK when this function is
 19105  //  ** called, do not modify it. See the comment above the #define of
 19106  //  ** UNKNOWN_LOCK for an explanation of this.
 19107  //  */
 19108  func _pagerUnlockDb(tls *crt.TLS, _pPager *XPager, _eLock int32) (r0 int32) {
 19109  	var _rc int32
 19110  	_rc = int32(0)
 19111  	func() {
 19112  		if _pPager.XexclusiveMode != 0 && int32(_pPager.XeLock) != _eLock {
 19113  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48049), unsafe.Pointer(&_pagerUnlockDbØ00__func__Ø000), unsafe.Pointer(str(19224)))
 19114  			crt.X__builtin_abort(tls)
 19115  		}
 19116  	}()
 19117  	func() {
 19118  		if _eLock != int32(0) && _eLock != int32(1) {
 19119  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48050), unsafe.Pointer(&_pagerUnlockDbØ00__func__Ø000), unsafe.Pointer(str(19271)))
 19120  			crt.X__builtin_abort(tls)
 19121  		}
 19122  	}()
 19123  	func() {
 19124  		if _eLock == int32(0) && bool2int((*XWal)(_pPager.XpWal) != nil) != int32(0) {
 19125  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48051), unsafe.Pointer(&_pagerUnlockDbØ00__func__Ø000), unsafe.Pointer(str(19308)))
 19126  			crt.X__builtin_abort(tls)
 19127  		}
 19128  	}()
 19129  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil {
 19130  		goto _9
 19131  	}
 19132  	func() {
 19133  		if int32(_pPager.XeLock) < _eLock {
 19134  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48053), unsafe.Pointer(&_pagerUnlockDbØ00__func__Ø000), unsafe.Pointer(str(19349)))
 19135  			crt.X__builtin_abort(tls)
 19136  		}
 19137  	}()
 19138  	_rc = func() int32 {
 19139  		if _pPager.XnoLock != 0 {
 19140  			return int32(0)
 19141  		}
 19142  		return _sqlite3OsUnlock(tls, (*Xsqlite3_file)(_pPager.Xfd), _eLock)
 19143  	}()
 19144  	if int32(_pPager.XeLock) != int32(5) {
 19145  		_pPager.XeLock = uint8(_eLock)
 19146  	}
 19147  _9:
 19148  	return _rc
 19149  }
 19150  
 19151  var _pagerUnlockDbØ00__func__Ø000 [14]int8
 19152  
 19153  func init() {
 19154  	crt.Xstrncpy(nil, &_pagerUnlockDbØ00__func__Ø000[0], str(19370), 14)
 19155  }
 19156  
 19157  func _sqlite3OsUnlock(tls *crt.TLS, _id *Xsqlite3_file, _lockType int32) (r0 int32) {
 19158  	return func() func(*crt.TLS, *Xsqlite3_file, int32) int32 {
 19159  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxUnlock
 19160  		return *(*func(*crt.TLS, *Xsqlite3_file, int32) int32)(unsafe.Pointer(&v))
 19161  	}()(tls, _id, _lockType)
 19162  }
 19163  
 19164  // C comment
 19165  //  /*
 19166  //  ** Playback the journal and thus restore the database file to
 19167  //  ** the state it was in before we started making changes.
 19168  //  **
 19169  //  ** The journal file format is as follows:
 19170  //  **
 19171  //  **  (1)  8 byte prefix.  A copy of aJournalMagic[].
 19172  //  **  (2)  4 byte big-endian integer which is the number of valid page records
 19173  //  **       in the journal.  If this value is 0xffffffff, then compute the
 19174  //  **       number of page records from the journal size.
 19175  //  **  (3)  4 byte big-endian integer which is the initial value for the
 19176  //  **       sanity checksum.
 19177  //  **  (4)  4 byte integer which is the number of pages to truncate the
 19178  //  **       database to during a rollback.
 19179  //  **  (5)  4 byte big-endian integer which is the sector size.  The header
 19180  //  **       is this many bytes in size.
 19181  //  **  (6)  4 byte big-endian integer which is the page size.
 19182  //  **  (7)  zero padding out to the next sector size.
 19183  //  **  (8)  Zero or more pages instances, each as follows:
 19184  //  **        +  4 byte page number.
 19185  //  **        +  pPager->pageSize bytes of data.
 19186  //  **        +  4 byte checksum
 19187  //  **
 19188  //  ** When we speak of the journal header, we mean the first 7 items above.
 19189  //  ** Each entry in the journal is an instance of the 8th item.
 19190  //  **
 19191  //  ** Call the value from the second bullet "nRec".  nRec is the number of
 19192  //  ** valid page entries in the journal.  In most cases, you can compute the
 19193  //  ** value of nRec from the size of the journal file.  But if a power
 19194  //  ** failure occurred while the journal was being written, it could be the
 19195  //  ** case that the size of the journal file had already been increased but
 19196  //  ** the extra entries had not yet made it safely to disk.  In such a case,
 19197  //  ** the value of nRec computed from the file size would be too large.  For
 19198  //  ** that reason, we always use the nRec value in the header.
 19199  //  **
 19200  //  ** If the nRec value is 0xffffffff it means that nRec should be computed
 19201  //  ** from the file size.  This value is used when the user selects the
 19202  //  ** no-sync option for the journal.  A power failure could lead to corruption
 19203  //  ** in this case.  But for things like temporary table (which will be
 19204  //  ** deleted when the power is restored) we don't care.
 19205  //  **
 19206  //  ** If the file opened as the journal file is not a well-formed
 19207  //  ** journal file then all pages up to the first corrupted page are rolled
 19208  //  ** back (or no pages if the journal header is corrupted). The journal file
 19209  //  ** is then deleted and SQLITE_OK returned, just as if no corruption had
 19210  //  ** been encountered.
 19211  //  **
 19212  //  ** If an I/O or malloc() error occurs, the journal-file is not deleted
 19213  //  ** and an error code is returned.
 19214  //  **
 19215  //  ** The isHot parameter indicates that we are trying to rollback a journal
 19216  //  ** that might be a hot journal.  Or, it could be that the journal is
 19217  //  ** preserved because of JOURNALMODE_PERSIST or JOURNALMODE_TRUNCATE.
 19218  //  ** If the journal really is hot, reset the pager cache prior rolling
 19219  //  ** back any content.  If the journal is merely persistent, no reset is
 19220  //  ** needed.
 19221  //  */
 19222  func _pager_playback(tls *crt.TLS, _pPager *XPager, _isHot int32) (r0 int32) {
 19223  	var _rc, _res, _needPagerReset, _nPlayback int32
 19224  	var _szJ int64
 19225  	var _nRec, _u, _mxPg uint32
 19226  	var _zMaster *int8
 19227  	var _pVfs *Xsqlite3_vfs
 19228  	_pVfs = (*Xsqlite3_vfs)(_pPager.XpVfs)
 19229  	_mxPg = uint32(0)
 19230  	_res = int32(1)
 19231  	_zMaster = nil
 19232  	_nPlayback = int32(0)
 19233  	func() {
 19234  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil {
 19235  			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)))
 19236  			crt.X__builtin_abort(tls)
 19237  		}
 19238  	}()
 19239  	_rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.Xjfd), &_szJ)
 19240  	if _rc != int32(0) {
 19241  		goto _end_playback
 19242  	}
 19243  	_zMaster = _pPager.XpTmpSpace
 19244  	_rc = _readMasterJournal(tls, (*Xsqlite3_file)(_pPager.Xjfd), _zMaster, uint32(((*Xsqlite3_vfs)(_pPager.XpVfs).XmxPathname)+int32(1)))
 19245  	if (_rc == int32(0)) && ((*elem1(_zMaster, 0)) != 0) {
 19246  		_rc = _sqlite3OsAccess(tls, _pVfs, _zMaster, int32(0), &_res)
 19247  	}
 19248  	_zMaster = nil
 19249  	if (_rc != int32(0)) || (_res == 0) {
 19250  		goto _end_playback
 19251  	}
 19252  	_pPager.XjournalOff = 0
 19253  	_needPagerReset = _isHot
 19254  _7:
 19255  	_rc = _readJournalHdr(tls, _pPager, _isHot, _szJ, &_nRec, &_mxPg)
 19256  	if _rc == int32(0) {
 19257  		goto _9
 19258  	}
 19259  	if _rc == int32(101) {
 19260  		_rc = int32(0)
 19261  	}
 19262  	goto _end_playback
 19263  _9:
 19264  	if _nRec == uint32(4294967295) {
 19265  		func() {
 19266  			if _pPager.XjournalOff != int64(_pPager.XsectorSize) {
 19267  				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)))
 19268  				crt.X__builtin_abort(tls)
 19269  			}
 19270  		}()
 19271  		_nRec = uint32(int32((_szJ - int64(_pPager.XsectorSize)) / int64(_pPager.XpageSize+int32(8))))
 19272  	}
 19273  	if ((_nRec == (0)) && (_isHot == 0)) && ((_pPager.XjournalHdr + int64(_pPager.XsectorSize)) == _pPager.XjournalOff) {
 19274  		_nRec = uint32(int32((_szJ - _pPager.XjournalOff) / int64(_pPager.XpageSize+int32(8))))
 19275  	}
 19276  	if _pPager.XjournalOff != int64(_pPager.XsectorSize) {
 19277  		goto _17
 19278  	}
 19279  	_rc = _pager_truncate(tls, _pPager, _mxPg)
 19280  	if _rc != int32(0) {
 19281  		goto _end_playback
 19282  	}
 19283  	_pPager.XdbSize = _mxPg
 19284  _17:
 19285  	_u = 0
 19286  _19:
 19287  	if _u >= _nRec {
 19288  		goto _22
 19289  	}
 19290  	if _needPagerReset != 0 {
 19291  		_pager_reset(tls, _pPager)
 19292  		_needPagerReset = int32(0)
 19293  	}
 19294  	_rc = _pager_playback_one_page(tls, _pPager, &_pPager.XjournalOff, nil, int32(1), int32(0))
 19295  	if _rc == int32(0) {
 19296  		_nPlayback += 1
 19297  		goto _25
 19298  	}
 19299  	if _rc == int32(101) {
 19300  		_pPager.XjournalOff = _szJ
 19301  		goto _22
 19302  	}
 19303  	if _rc == int32(522) {
 19304  		_rc = int32(0)
 19305  		goto _end_playback
 19306  	}
 19307  	goto _end_playback
 19308  _25:
 19309  	_u += 1
 19310  	goto _19
 19311  _22:
 19312  	goto _7
 19313  _end_playback:
 19314  	if ((*Xsqlite3_file)(_pPager.Xfd).XpMethods) != nil {
 19315  		_sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pPager.Xfd), int32(-905363552), nil)
 19316  	}
 19317  	_pPager.XchangeCountDone = _pPager.XtempFile
 19318  	if _rc == int32(0) {
 19319  		_zMaster = _pPager.XpTmpSpace
 19320  		_rc = _readMasterJournal(tls, (*Xsqlite3_file)(_pPager.Xjfd), _zMaster, uint32(((*Xsqlite3_vfs)(_pPager.XpVfs).XmxPathname)+int32(1)))
 19321  	}
 19322  	if (_rc == int32(0)) && ((int32(_pPager.XeState) >= int32(4)) || (int32(_pPager.XeState) == int32(0))) {
 19323  		_rc = _sqlite3PagerSync(tls, _pPager, nil)
 19324  	}
 19325  	if _rc == int32(0) {
 19326  		_rc = _pager_end_transaction(tls, _pPager, bool2int(int32(*elem1(_zMaster, 0)) != int32(0)), int32(0))
 19327  	}
 19328  	if ((_rc == int32(0)) && ((*elem1(_zMaster, 0)) != 0)) && _res != 0 {
 19329  		_rc = _pager_delmaster(tls, _pPager, _zMaster)
 19330  	}
 19331  	if _isHot != 0 && _nPlayback != 0 {
 19332  		Xsqlite3_log(tls, int32(539), str(19427), _nPlayback, unsafe.Pointer(_pPager.XzJournal))
 19333  	}
 19334  	_setSectorSize(tls, _pPager)
 19335  	return _rc
 19336  }
 19337  
 19338  var _pager_playbackØ00__func__Ø000 [15]int8
 19339  
 19340  func init() {
 19341  	crt.Xstrncpy(nil, &_pager_playbackØ00__func__Ø000[0], str(19454), 15)
 19342  }
 19343  
 19344  // C comment
 19345  //  /*
 19346  //  ** When this is called the journal file for pager pPager must be open.
 19347  //  ** This function attempts to read a master journal file name from the
 19348  //  ** end of the file and, if successful, copies it into memory supplied
 19349  //  ** by the caller. See comments above writeMasterJournal() for the format
 19350  //  ** used to store a master journal file name at the end of a journal file.
 19351  //  **
 19352  //  ** zMaster must point to a buffer of at least nMaster bytes allocated by
 19353  //  ** the caller. This should be sqlite3_vfs.mxPathname+1 (to ensure there is
 19354  //  ** enough space to write the master journal name). If the master journal
 19355  //  ** name in the journal is longer than nMaster bytes (including a
 19356  //  ** nul-terminator), then this is handled as if no master journal name
 19357  //  ** were present in the journal.
 19358  //  **
 19359  //  ** If a master journal file name is present at the end of the journal
 19360  //  ** file, then it is copied into the buffer pointed to by zMaster. A
 19361  //  ** nul-terminator byte is appended to the buffer following the master
 19362  //  ** journal file name.
 19363  //  **
 19364  //  ** If it is determined that no master journal file name is present
 19365  //  ** zMaster[0] is set to 0 and SQLITE_OK returned.
 19366  //  **
 19367  //  ** If an error occurs while reading from the journal file, an SQLite
 19368  //  ** error code is returned.
 19369  //  */
 19370  func _readMasterJournal(tls *crt.TLS, _pJrnl *Xsqlite3_file, _zMaster *int8, _nMaster uint32) (r0 int32) {
 19371  	var _rc int32
 19372  	var _szJ int64
 19373  	var _len, _cksum, _u uint32
 19374  	var _aMagic [8]uint8
 19375  	*elem1(_zMaster, 0) = 0
 19376  	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), uint32(8)) != 0) || (int32(0) != store2(&_rc, _sqlite3OsRead(tls, _pJrnl, unsafe.Pointer(_zMaster), int32(_len), (_szJ-int64(16))-int64(_len)))) {
 19377  		return _rc
 19378  	}
 19379  	_u = 0
 19380  _9:
 19381  	if _u >= _len {
 19382  		goto _12
 19383  	}
 19384  	_cksum -= uint32(*elem1(_zMaster, uintptr(_u)))
 19385  	_u += 1
 19386  	goto _9
 19387  _12:
 19388  	if _cksum != 0 {
 19389  		_len = 0
 19390  	}
 19391  	*elem1(_zMaster, uintptr(_len)) = 0
 19392  	return int32(0)
 19393  
 19394  	_ = _aMagic
 19395  	panic(0)
 19396  }
 19397  
 19398  func _sqlite3OsAccess(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _flags int32, _pResOut *int32) (r0 int32) {
 19399  	return func() func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int32) int32 {
 19400  		v := _pVfs.XxAccess
 19401  		return *(*func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int32) int32)(unsafe.Pointer(&v))
 19402  	}()(tls, _pVfs, _zPath, _flags, _pResOut)
 19403  }
 19404  
 19405  // C comment
 19406  //  /*
 19407  //  ** Sync the database file to disk. This is a no-op for in-memory databases
 19408  //  ** or pages with the Pager.noSync flag set.
 19409  //  **
 19410  //  ** If successful, or if called on a pager for which it is a no-op, this
 19411  //  ** function returns SQLITE_OK. Otherwise, an IO error code is returned.
 19412  //  */
 19413  func _sqlite3PagerSync(tls *crt.TLS, _pPager *XPager, _zMaster *int8) (r0 int32) {
 19414  	var _rc int32
 19415  	var _1_pArg unsafe.Pointer
 19416  	_rc = int32(0)
 19417  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil {
 19418  		goto _0
 19419  	}
 19420  	_1_pArg = unsafe.Pointer(_zMaster)
 19421  	_rc = _sqlite3OsFileControl(tls, (*Xsqlite3_file)(_pPager.Xfd), int32(21), _1_pArg)
 19422  	if _rc == int32(12) {
 19423  		_rc = int32(0)
 19424  	}
 19425  _0:
 19426  	if (_rc == int32(0)) && (_pPager.XnoSync == 0) {
 19427  		func() {
 19428  			if _pPager.XmemDb != 0 {
 19429  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53162), unsafe.Pointer(&_sqlite3PagerSyncØ00__func__Ø000), unsafe.Pointer(str(11702)))
 19430  				crt.X__builtin_abort(tls)
 19431  			}
 19432  		}()
 19433  		_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pPager.Xfd), int32(_pPager.XsyncFlags))
 19434  	}
 19435  	return _rc
 19436  }
 19437  
 19438  var _sqlite3PagerSyncØ00__func__Ø000 [17]int8
 19439  
 19440  func init() {
 19441  	crt.Xstrncpy(nil, &_sqlite3PagerSyncØ00__func__Ø000[0], str(19469), 17)
 19442  }
 19443  
 19444  // C comment
 19445  //  /*
 19446  //  ** Parameter zMaster is the name of a master journal file. A single journal
 19447  //  ** file that referred to the master journal file has just been rolled back.
 19448  //  ** This routine checks if it is possible to delete the master journal file,
 19449  //  ** and does so if it is.
 19450  //  **
 19451  //  ** Argument zMaster may point to Pager.pTmpSpace. So that buffer is not
 19452  //  ** available for use within this function.
 19453  //  **
 19454  //  ** When a master journal file is created, it is populated with the names
 19455  //  ** of all of its child journals, one after another, formatted as utf-8
 19456  //  ** encoded text. The end of each child journal file is marked with a
 19457  //  ** nul-terminator byte (0x00). i.e. the entire contents of a master journal
 19458  //  ** file for a transaction involving two databases might be:
 19459  //  **
 19460  //  **   "/home/bill/a.db-journal\x00/home/bill/b.db-journal\x00"
 19461  //  **
 19462  //  ** A master journal file may only be deleted once all of its child
 19463  //  ** journals have been rolled back.
 19464  //  **
 19465  //  ** This function reads the contents of the master-journal file into
 19466  //  ** memory and loops through each of the child journal names. For
 19467  //  ** each child journal, it checks if:
 19468  //  **
 19469  //  **   * if the child journal exists, and if so
 19470  //  **   * if the child journal contains a reference to master journal
 19471  //  **     file zMaster
 19472  //  **
 19473  //  ** If a child journal can be found that matches both of the criteria
 19474  //  ** above, this function returns without doing anything. Otherwise, if
 19475  //  ** no such child journal can be found, file zMaster is deleted from
 19476  //  ** the file-system using sqlite3OsDelete().
 19477  //  **
 19478  //  ** If an IO error within this function, an error code is returned. This
 19479  //  ** function allocates memory by calling sqlite3Malloc(). If an allocation
 19480  //  ** fails, SQLITE_NOMEM is returned. Otherwise, if no IO or malloc errors
 19481  //  ** occur, SQLITE_OK is returned.
 19482  //  **
 19483  //  ** TODO: This function allocates a single block of memory to load
 19484  //  ** the entire contents of the master journal file. This could be
 19485  //  ** a couple of kilobytes or so - potentially larger than the page
 19486  //  ** size.
 19487  //  */
 19488  func _pager_delmaster(tls *crt.TLS, _pPager *XPager, _zMaster *int8) (r0 int32) {
 19489  	var _rc, _nMasterPtr, _2_flags, _4_exists, _6_c, _6_flags int32
 19490  	var _nMasterJournal int64
 19491  	var _zMasterJournal, _zJournal, _zMasterPtr *int8
 19492  	var _pMaster, _pJournal *Xsqlite3_file
 19493  	var _pVfs *Xsqlite3_vfs
 19494  	_pVfs = (*Xsqlite3_vfs)(_pPager.XpVfs)
 19495  	_zMasterJournal = nil
 19496  	_pMaster = (*Xsqlite3_file)(_sqlite3MallocZero(tls, uint64(_pVfs.XszOsFile*int32(2))))
 19497  	_pJournal = (*Xsqlite3_file)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMaster)) + uintptr(_pVfs.XszOsFile)))))
 19498  	if _pMaster == nil {
 19499  		_rc = _sqlite3NomemError(tls, int32(49453))
 19500  		goto _1
 19501  	}
 19502  	_2_flags = int32(16385)
 19503  	_rc = _sqlite3OsOpen(tls, _pVfs, _zMaster, _pMaster, _2_flags, nil)
 19504  _1:
 19505  	if _rc != int32(0) {
 19506  		goto _delmaster_out
 19507  	}
 19508  	_rc = _sqlite3OsFileSize(tls, _pMaster, &_nMasterJournal)
 19509  	if _rc != int32(0) {
 19510  		goto _delmaster_out
 19511  	}
 19512  	_nMasterPtr = _pVfs.XmxPathname + int32(1)
 19513  	_zMasterJournal = (*int8)(_sqlite3Malloc(tls, uint64((_nMasterJournal+int64(_nMasterPtr))+int64(1))))
 19514  	if _zMasterJournal == nil {
 19515  		_rc = _sqlite3NomemError(tls, int32(49470))
 19516  		goto _delmaster_out
 19517  	}
 19518  	_zMasterPtr = elem1(_zMasterJournal, uintptr(_nMasterJournal+int64(1)))
 19519  	_rc = _sqlite3OsRead(tls, _pMaster, unsafe.Pointer(_zMasterJournal), int32(_nMasterJournal), 0)
 19520  	if _rc != int32(0) {
 19521  		goto _delmaster_out
 19522  	}
 19523  	*elem1(_zMasterJournal, uintptr(_nMasterJournal)) = 0
 19524  	_zJournal = _zMasterJournal
 19525  _6:
 19526  	if int64(int32(uintptr(unsafe.Pointer(_zJournal))-uintptr(unsafe.Pointer(_zMasterJournal)))) >= _nMasterJournal {
 19527  		goto _7
 19528  	}
 19529  	_rc = _sqlite3OsAccess(tls, _pVfs, _zJournal, int32(0), &_4_exists)
 19530  	if _rc != int32(0) {
 19531  		goto _delmaster_out
 19532  	}
 19533  	if _4_exists == 0 {
 19534  		goto _9
 19535  	}
 19536  	_6_flags = int32(2049)
 19537  	_rc = _sqlite3OsOpen(tls, _pVfs, _zJournal, _pJournal, _6_flags, nil)
 19538  	if _rc != int32(0) {
 19539  		goto _delmaster_out
 19540  	}
 19541  	_rc = _readMasterJournal(tls, _pJournal, _zMasterPtr, uint32(_nMasterPtr))
 19542  	_sqlite3OsClose(tls, _pJournal)
 19543  	if _rc != int32(0) {
 19544  		goto _delmaster_out
 19545  	}
 19546  	_6_c = bool2int((int32(*elem1(_zMasterPtr, 0)) != int32(0)) && (crt.Xstrcmp(tls, _zMasterPtr, _zMaster) == int32(0)))
 19547  	if _6_c != 0 {
 19548  		goto _delmaster_out
 19549  	}
 19550  _9:
 19551  	*(*uintptr)(unsafe.Pointer(&_zJournal)) += uintptr(_sqlite3Strlen30(tls, _zJournal) + int32(1))
 19552  	goto _6
 19553  _7:
 19554  	_sqlite3OsClose(tls, _pMaster)
 19555  	_rc = _sqlite3OsDelete(tls, _pVfs, _zMaster, int32(0))
 19556  _delmaster_out:
 19557  	Xsqlite3_free(tls, unsafe.Pointer(_zMasterJournal))
 19558  	if _pMaster != nil {
 19559  		_sqlite3OsClose(tls, _pMaster)
 19560  		func() {
 19561  			if (*Xsqlite3_io_methods)(_pJournal.XpMethods) != nil {
 19562  				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)))
 19563  				crt.X__builtin_abort(tls)
 19564  			}
 19565  		}()
 19566  		Xsqlite3_free(tls, unsafe.Pointer(_pMaster))
 19567  	}
 19568  	return _rc
 19569  }
 19570  
 19571  var _pager_delmasterØ00__func__Ø000 [16]int8
 19572  
 19573  func init() {
 19574  	crt.Xstrncpy(nil, &_pager_delmasterØ00__func__Ø000[0], str(19504), 16)
 19575  }
 19576  
 19577  // C comment
 19578  //  /*
 19579  //  ** Set the value of the Pager.sectorSize variable for the given
 19580  //  ** pager based on the value returned by the xSectorSize method
 19581  //  ** of the open database file. The sector size will be used
 19582  //  ** to determine the size and alignment of journal header and
 19583  //  ** master journal pointers within created journal files.
 19584  //  **
 19585  //  ** For temporary files the effective sector size is always 512 bytes.
 19586  //  **
 19587  //  ** Otherwise, for non-temporary files, the effective sector size is
 19588  //  ** the value returned by the xSectorSize() method rounded up to 32 if
 19589  //  ** it is less than 32, or rounded down to MAX_SECTOR_SIZE if it
 19590  //  ** is greater than MAX_SECTOR_SIZE.
 19591  //  **
 19592  //  ** If the file has the SQLITE_IOCAP_POWERSAFE_OVERWRITE property, then set
 19593  //  ** the effective sector size to its minimum value (512).  The purpose of
 19594  //  ** pPager->sectorSize is to define the "blast radius" of bytes that
 19595  //  ** might change if a crash occurs while writing to a single byte in
 19596  //  ** that range.  But with POWERSAFE_OVERWRITE, the blast radius is zero
 19597  //  ** (that is what POWERSAFE_OVERWRITE means), so we minimize the sector
 19598  //  ** size.  For backwards compatibility of the rollback journal file format,
 19599  //  ** we cannot reduce the effective sector size below 512.
 19600  //  */
 19601  func _setSectorSize(tls *crt.TLS, _pPager *XPager) {
 19602  	func() {
 19603  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil && _pPager.XtempFile == 0 {
 19604  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(49617), unsafe.Pointer(&_setSectorSizeØ00__func__Ø000), unsafe.Pointer(str(19520)))
 19605  			crt.X__builtin_abort(tls)
 19606  		}
 19607  	}()
 19608  	if (_pPager.XtempFile != 0) || ((_sqlite3OsDeviceCharacteristics(tls, (*Xsqlite3_file)(_pPager.Xfd)) & int32(4096)) != int32(0)) {
 19609  		_pPager.XsectorSize = uint32(512)
 19610  		goto _5
 19611  	}
 19612  	_pPager.XsectorSize = uint32(_sqlite3SectorSize(tls, (*Xsqlite3_file)(_pPager.Xfd)))
 19613  _5:
 19614  }
 19615  
 19616  var _setSectorSizeØ00__func__Ø000 [14]int8
 19617  
 19618  func init() {
 19619  	crt.Xstrncpy(nil, &_setSectorSizeØ00__func__Ø000[0], str(19559), 14)
 19620  }
 19621  
 19622  // C comment
 19623  //  /*
 19624  //  ** Return a sanitized version of the sector-size of OS file pFile. The
 19625  //  ** return value is guaranteed to lie between 32 and MAX_SECTOR_SIZE.
 19626  //  */
 19627  func _sqlite3SectorSize(tls *crt.TLS, _pFile *Xsqlite3_file) (r0 int32) {
 19628  	var _iRet int32
 19629  	_iRet = _sqlite3OsSectorSize(tls, _pFile)
 19630  	if _iRet < int32(32) {
 19631  		_iRet = int32(512)
 19632  		goto _2
 19633  	}
 19634  	if _iRet > int32(65536) {
 19635  		_iRet = int32(65536)
 19636  	}
 19637  _2:
 19638  	return _iRet
 19639  }
 19640  
 19641  func _sqlite3OsSectorSize(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) {
 19642  	var _xSectorSize func(*crt.TLS, *Xsqlite3_file) int32
 19643  	_xSectorSize = func() func(*crt.TLS, *Xsqlite3_file) int32 {
 19644  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxSectorSize
 19645  		return *(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&v))
 19646  	}()
 19647  	return func() int32 {
 19648  		if _xSectorSize != nil {
 19649  			return _xSectorSize(tls, _id)
 19650  		}
 19651  		return int32(4096)
 19652  	}()
 19653  }
 19654  
 19655  // C comment
 19656  //  /*
 19657  //  ** This function is called whenever an IOERR or FULL error that requires
 19658  //  ** the pager to transition into the ERROR state may ahve occurred.
 19659  //  ** The first argument is a pointer to the pager structure, the second
 19660  //  ** the error-code about to be returned by a pager API function. The
 19661  //  ** value returned is a copy of the second argument to this function.
 19662  //  **
 19663  //  ** If the second argument is SQLITE_FULL, SQLITE_IOERR or one of the
 19664  //  ** IOERR sub-codes, the pager enters the ERROR state and the error code
 19665  //  ** is stored in Pager.errCode. While the pager remains in the ERROR state,
 19666  //  ** all major API calls on the Pager will immediately return Pager.errCode.
 19667  //  **
 19668  //  ** The ERROR state indicates that the contents of the pager-cache
 19669  //  ** cannot be trusted. This state can be cleared by completely discarding
 19670  //  ** the contents of the pager-cache. If a transaction was active when
 19671  //  ** the persistent error occurred, then the rollback journal may need
 19672  //  ** to be replayed to restore the contents of the database file (as if
 19673  //  ** it were a hot-journal).
 19674  //  */
 19675  func _pager_error(tls *crt.TLS, _pPager *XPager, _rc int32) (r0 int32) {
 19676  	var _rc2 int32
 19677  	_rc2 = _rc & int32(255)
 19678  	func() {
 19679  		if _rc != int32(0) && _pPager.XmemDb != 0 {
 19680  			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)))
 19681  			crt.X__builtin_abort(tls)
 19682  		}
 19683  	}()
 19684  	func() {
 19685  		if _pPager.XerrCode != int32(13) && _pPager.XerrCode != int32(0) && (_pPager.XerrCode&int32(255)) != int32(10) {
 19686  			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)))
 19687  			crt.X__builtin_abort(tls)
 19688  		}
 19689  	}()
 19690  	if (_rc2 == int32(13)) || (_rc2 == int32(10)) {
 19691  		_pPager.XerrCode = _rc
 19692  		_pPager.XeState = uint8(6)
 19693  		_setGetterMethod(tls, _pPager)
 19694  	}
 19695  	return _rc
 19696  }
 19697  
 19698  var _pager_errorØ00__func__Ø000 [12]int8
 19699  
 19700  func init() {
 19701  	crt.Xstrncpy(nil, &_pager_errorØ00__func__Ø000[0], str(19698), 12)
 19702  }
 19703  
 19704  // C comment
 19705  //  /*
 19706  //  ** This function is a no-op if the pager is in exclusive mode and not
 19707  //  ** in the ERROR state. Otherwise, it switches the pager to PAGER_OPEN
 19708  //  ** state.
 19709  //  **
 19710  //  ** If the pager is not in exclusive-access mode, the database file is
 19711  //  ** completely unlocked. If the file is unlocked and the file-system does
 19712  //  ** not exhibit the UNDELETABLE_WHEN_OPEN property, the journal file is
 19713  //  ** closed (if it is open).
 19714  //  **
 19715  //  ** If the pager is in ERROR state when this function is called, the
 19716  //  ** contents of the pager cache are discarded before switching back to
 19717  //  ** the OPEN state. Regardless of whether the pager is in exclusive-mode
 19718  //  ** or not, any journal file left in the file-system will be treated
 19719  //  ** as a hot-journal and rolled back the next time a read-transaction
 19720  //  ** is opened (by this or by any other connection).
 19721  //  */
 19722  func _pager_unlock(tls *crt.TLS, _pPager *XPager) {
 19723  	var _2_rc, _2_iDc int32
 19724  	func() {
 19725  		if int32(_pPager.XeState) != int32(1) && int32(_pPager.XeState) != int32(0) && int32(_pPager.XeState) != int32(6) {
 19726  			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)))
 19727  			crt.X__builtin_abort(tls)
 19728  		}
 19729  	}()
 19730  	_sqlite3BitvecDestroy(tls, (*XBitvec)(_pPager.XpInJournal))
 19731  	*(**XBitvec)(unsafe.Pointer(&_pPager.XpInJournal)) = nil
 19732  	_releaseAllSavepoints(tls, _pPager)
 19733  	if (*XWal)(_pPager.XpWal) != nil {
 19734  		func() {
 19735  			if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) != nil {
 19736  				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)))
 19737  				crt.X__builtin_abort(tls)
 19738  			}
 19739  		}()
 19740  		_sqlite3WalEndReadTransaction(tls, (*XWal)(_pPager.XpWal))
 19741  		_pPager.XeState = 0
 19742  		goto _8
 19743  	}
 19744  	if _pPager.XexclusiveMode != 0 {
 19745  		goto _8
 19746  	}
 19747  	_2_iDc = func() int32 {
 19748  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) != nil {
 19749  			return _sqlite3OsDeviceCharacteristics(tls, (*Xsqlite3_file)(_pPager.Xfd))
 19750  		}
 19751  		return int32(0)
 19752  	}()
 19753  
 19754  	if (int32(0) == (_2_iDc & int32(2048))) || (int32(1) != (int32(_pPager.XjournalMode) & int32(5))) {
 19755  		_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.Xjfd))
 19756  	}
 19757  	_2_rc = _pagerUnlockDb(tls, _pPager, int32(0))
 19758  	if (_2_rc != int32(0)) && (int32(_pPager.XeState) == int32(6)) {
 19759  		_pPager.XeLock = uint8(5)
 19760  	}
 19761  	func() {
 19762  		if _pPager.XerrCode == 0 && int32(_pPager.XeState) == int32(6) {
 19763  			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)))
 19764  			crt.X__builtin_abort(tls)
 19765  		}
 19766  	}()
 19767  	_pPager.XchangeCountDone = 0
 19768  	_pPager.XeState = 0
 19769  _8:
 19770  	func() {
 19771  		if _pPager.XerrCode != int32(0) && _pPager.XmemDb != 0 {
 19772  			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)))
 19773  			crt.X__builtin_abort(tls)
 19774  		}
 19775  	}()
 19776  	if _pPager.XerrCode == 0 {
 19777  		goto _21
 19778  	}
 19779  	if int32(_pPager.XtempFile) == int32(0) {
 19780  		_pager_reset(tls, _pPager)
 19781  		_pPager.XchangeCountDone = 0
 19782  		_pPager.XeState = 0
 19783  		goto _23
 19784  	}
 19785  	_pPager.XeState = uint8(func() int32 {
 19786  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) != nil {
 19787  			return int32(0)
 19788  		}
 19789  		return int32(1)
 19790  	}())
 19791  _23:
 19792  	if _pPager.XbUseFetch != 0 {
 19793  		_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pPager.Xfd), 0, nil)
 19794  	}
 19795  	_pPager.XerrCode = int32(0)
 19796  	_setGetterMethod(tls, _pPager)
 19797  _21:
 19798  	_pPager.XjournalOff = 0
 19799  	_pPager.XjournalHdr = 0
 19800  	_pPager.XsetMaster = 0
 19801  }
 19802  
 19803  var _pager_unlockØ00__func__Ø000 [13]int8
 19804  
 19805  func init() {
 19806  	crt.Xstrncpy(nil, &_pager_unlockØ00__func__Ø000[0], str(19905), 13)
 19807  }
 19808  
 19809  // C comment
 19810  //  /*
 19811  //  ** Finish with a read transaction.  All this does is release the
 19812  //  ** read-lock.
 19813  //  */
 19814  func _sqlite3WalEndReadTransaction(tls *crt.TLS, _pWal *XWal) {
 19815  	_sqlite3WalEndWriteTransaction(tls, _pWal)
 19816  	if int32(_pWal.XreadLock) >= int32(0) {
 19817  		_walUnlockShared(tls, _pWal, int32(3)+int32(_pWal.XreadLock))
 19818  		_pWal.XreadLock = int16(-1)
 19819  	}
 19820  }
 19821  
 19822  // C comment
 19823  //  /*
 19824  //  ** Change the size of an existing memory allocation
 19825  //  */
 19826  func _sqlite3Realloc(tls *crt.TLS, _pOld unsafe.Pointer, _nBytes uint64) (r0 unsafe.Pointer) {
 19827  	var _nOld, _nNew, _nDiff int32
 19828  	var _pNew unsafe.Pointer
 19829  
 19830  	if _pOld == nil {
 19831  		return _sqlite3Malloc(tls, _nBytes)
 19832  	}
 19833  	if _nBytes == (0) {
 19834  		Xsqlite3_free(tls, _pOld)
 19835  		return nil
 19836  	}
 19837  	if _nBytes >= uint64(2147483392) {
 19838  		return nil
 19839  	}
 19840  	_nOld = _sqlite3MallocSize(tls, _pOld)
 19841  	_nNew = (_sqlite3Config.Xm.XxRoundup)(tls, int32(_nBytes))
 19842  	if _nOld == _nNew {
 19843  		_pNew = _pOld
 19844  		goto _11
 19845  	}
 19846  	if _sqlite3Config.XbMemstat == 0 {
 19847  		goto _5
 19848  	}
 19849  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
 19850  	_sqlite3StatusHighwater(tls, int32(5), int32(_nBytes))
 19851  	_nDiff = _nNew - _nOld
 19852  	if (_nDiff > int32(0)) && (_sqlite3StatusValue(tls, int32(0)) >= (_mem0.XalarmThreshold - int64(_nDiff))) {
 19853  		_sqlite3MallocAlarm(tls, _nDiff)
 19854  	}
 19855  	_pNew = (_sqlite3Config.Xm.XxRealloc)(tls, _pOld, _nNew)
 19856  	if (_pNew == nil) && (_mem0.XalarmThreshold > (0)) {
 19857  		_sqlite3MallocAlarm(tls, int32(_nBytes))
 19858  		_pNew = (_sqlite3Config.Xm.XxRealloc)(tls, _pOld, _nNew)
 19859  	}
 19860  	if _pNew != nil {
 19861  		_nNew = _sqlite3MallocSize(tls, _pNew)
 19862  		_sqlite3StatusUp(tls, int32(0), _nNew-_nOld)
 19863  	}
 19864  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
 19865  	goto _11
 19866  _5:
 19867  	_pNew = (_sqlite3Config.Xm.XxRealloc)(tls, _pOld, _nNew)
 19868  _11:
 19869  	func() {
 19870  		if (int32(uintptr(_pNew)) & int32(7)) != int32(0) {
 19871  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24772), unsafe.Pointer(&_sqlite3ReallocØ00__func__Ø000), unsafe.Pointer(str(19918)))
 19872  			crt.X__builtin_abort(tls)
 19873  		}
 19874  	}()
 19875  	return _pNew
 19876  }
 19877  
 19878  var _sqlite3ReallocØ00__func__Ø000 [15]int8
 19879  
 19880  func init() {
 19881  	crt.Xstrncpy(nil, &_sqlite3ReallocØ00__func__Ø000[0], str(19945), 15)
 19882  }
 19883  
 19884  // C comment
 19885  //  /*
 19886  //  ** Given the page number of an overflow page in the database (parameter
 19887  //  ** ovfl), this function finds the page number of the next page in the
 19888  //  ** linked list of overflow pages. If possible, it uses the auto-vacuum
 19889  //  ** pointer-map data instead of reading the content of page ovfl to do so.
 19890  //  **
 19891  //  ** If an error occurs an SQLite error code is returned. Otherwise:
 19892  //  **
 19893  //  ** The page number of the next overflow page in the linked list is
 19894  //  ** written to *pPgnoNext. If page ovfl is the last page in its linked
 19895  //  ** list, *pPgnoNext is set to zero.
 19896  //  **
 19897  //  ** If ppPage is not NULL, and a reference to the MemPage object corresponding
 19898  //  ** to page number pOvfl was obtained, then *ppPage is set to point to that
 19899  //  ** reference. It is the responsibility of the caller to call releasePage()
 19900  //  ** on *ppPage to free the reference. In no reference was obtained (because
 19901  //  ** the pointer-map was used to obtain the value for *pPgnoNext), then
 19902  //  ** *ppPage is set to zero.
 19903  //  */
 19904  func _getOverflowPage(tls *crt.TLS, _pBt *XBtShared, _ovfl uint32, _ppPage **XMemPage, _pPgnoNext *uint32) (r0 int32) {
 19905  	var _rc int32
 19906  	var _next, _1_pgno, _1_iGuess uint32
 19907  	var _1_eType uint8
 19908  	var _pPage *XMemPage
 19909  	_next = uint32(0)
 19910  	_pPage = nil
 19911  	_rc = int32(0)
 19912  	func() {
 19913  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 19914  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63444), unsafe.Pointer(&_getOverflowPageØ00__func__Ø000), unsafe.Pointer(str(9235)))
 19915  			crt.X__builtin_abort(tls)
 19916  		}
 19917  	}()
 19918  	func() {
 19919  		if _pPgnoNext == nil {
 19920  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63445), unsafe.Pointer(&_getOverflowPageØ00__func__Ø000), unsafe.Pointer(str(19960)))
 19921  			crt.X__builtin_abort(tls)
 19922  		}
 19923  	}()
 19924  	if _pBt.XautoVacuum == 0 {
 19925  		goto _4
 19926  	}
 19927  	_1_iGuess = _ovfl + uint32(1)
 19928  _5:
 19929  	if (_ptrmapPageno(tls, _pBt, _1_iGuess) == _1_iGuess) || (_1_iGuess == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1))) {
 19930  		_1_iGuess += 1
 19931  		goto _5
 19932  	}
 19933  	if _1_iGuess > _btreePagecount(tls, _pBt) {
 19934  		goto _8
 19935  	}
 19936  	_rc = _ptrmapGet(tls, _pBt, _1_iGuess, &_1_eType, &_1_pgno)
 19937  	if ((_rc == int32(0)) && (int32(_1_eType) == int32(4))) && (_1_pgno == _ovfl) {
 19938  		_next = _1_iGuess
 19939  		_rc = int32(101)
 19940  	}
 19941  _8:
 19942  _4:
 19943  	func() {
 19944  		if _next != (0) && _rc != int32(101) {
 19945  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63473), unsafe.Pointer(&_getOverflowPageØ00__func__Ø000), unsafe.Pointer(str(19970)))
 19946  			crt.X__builtin_abort(tls)
 19947  		}
 19948  	}()
 19949  	if _rc != int32(0) {
 19950  		goto _15
 19951  	}
 19952  	_rc = _btreeGetPage(tls, _pBt, _ovfl, &_pPage, func() int32 {
 19953  		if _ppPage == nil {
 19954  			return int32(2)
 19955  		}
 19956  		return int32(0)
 19957  	}())
 19958  	func() {
 19959  		if _rc != int32(0) && _pPage != nil {
 19960  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63476), unsafe.Pointer(&_getOverflowPageØ00__func__Ø000), unsafe.Pointer(str(19997)))
 19961  			crt.X__builtin_abort(tls)
 19962  		}
 19963  	}()
 19964  	if _rc == int32(0) {
 19965  		_next = _sqlite3Get4byte(tls, _pPage.XaData)
 19966  	}
 19967  _15:
 19968  	*_pPgnoNext = _next
 19969  	if _ppPage != nil {
 19970  		*_ppPage = _pPage
 19971  		goto _23
 19972  	}
 19973  	_releasePage(tls, _pPage)
 19974  _23:
 19975  	return func() int32 {
 19976  		if _rc == int32(101) {
 19977  			return int32(0)
 19978  		}
 19979  		return _rc
 19980  	}()
 19981  }
 19982  
 19983  var _getOverflowPageØ00__func__Ø000 [16]int8
 19984  
 19985  func init() {
 19986  	crt.Xstrncpy(nil, &_getOverflowPageØ00__func__Ø000[0], str(20023), 16)
 19987  }
 19988  
 19989  // C comment
 19990  //  /*
 19991  //  ** Given a page number of a regular database page, return the page
 19992  //  ** number for the pointer-map page that contains the entry for the
 19993  //  ** input page number.
 19994  //  **
 19995  //  ** Return 0 (not a valid page) for pgno==1 since there is
 19996  //  ** no pointer map associated with page 1.  The integrity_check logic
 19997  //  ** requires that ptrmapPageno(*,1)!=1.
 19998  //  */
 19999  func _ptrmapPageno(tls *crt.TLS, _pBt *XBtShared, _pgno uint32) (r0 uint32) {
 20000  	var _nPagesPerMapPage int32
 20001  	var _iPtrMap, _ret uint32
 20002  	func() {
 20003  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 20004  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59937), unsafe.Pointer(&_ptrmapPagenoØ00__func__Ø000), unsafe.Pointer(str(9235)))
 20005  			crt.X__builtin_abort(tls)
 20006  		}
 20007  	}()
 20008  	if _pgno < uint32(2) {
 20009  		return 0
 20010  	}
 20011  	_nPagesPerMapPage = int32((_pBt.XusableSize / uint32(5)) + uint32(1))
 20012  	_iPtrMap = (_pgno - uint32(2)) / uint32(_nPagesPerMapPage)
 20013  	_ret = (_iPtrMap * uint32(_nPagesPerMapPage)) + uint32(2)
 20014  	if _ret == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1)) {
 20015  		_ret += 1
 20016  	}
 20017  	return _ret
 20018  }
 20019  
 20020  var _ptrmapPagenoØ00__func__Ø000 [13]int8
 20021  
 20022  func init() {
 20023  	crt.Xstrncpy(nil, &_ptrmapPagenoØ00__func__Ø000[0], str(20039), 13)
 20024  }
 20025  
 20026  // C comment
 20027  //  /*
 20028  //  ** Read an entry from the pointer map.
 20029  //  **
 20030  //  ** This routine retrieves the pointer map entry for page 'key', writing
 20031  //  ** the type and parent page number to *pEType and *pPgno respectively.
 20032  //  ** An error code is returned if something goes wrong, otherwise SQLITE_OK.
 20033  //  */
 20034  func _ptrmapGet(tls *crt.TLS, _pBt *XBtShared, _key uint32, _pEType *uint8, _pPgno *uint32) (r0 int32) {
 20035  	var _iPtrmap, _offset, _rc int32
 20036  	var _pPtrmap *uint8
 20037  	var _pDbPage *XPgHdr
 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(60017), unsafe.Pointer(&_ptrmapGetØ00__func__Ø000), unsafe.Pointer(str(9235)))
 20041  			crt.X__builtin_abort(tls)
 20042  		}
 20043  	}()
 20044  	_iPtrmap = int32(_ptrmapPageno(tls, _pBt, _key))
 20045  	_rc = _sqlite3PagerGet(tls, (*XPager)(_pBt.XpPager), uint32(_iPtrmap), &_pDbPage, int32(0))
 20046  	if _rc != int32(0) {
 20047  		return _rc
 20048  	}
 20049  	_pPtrmap = (*uint8)(_sqlite3PagerGetData(tls, _pDbPage))
 20050  	_offset = int32(uint32(5) * ((_key - uint32(_iPtrmap)) - uint32(1)))
 20051  	if _offset < int32(0) {
 20052  		_sqlite3PagerUnref(tls, _pDbPage)
 20053  		return _sqlite3CorruptError(tls, int32(60029))
 20054  	}
 20055  	func() {
 20056  		if _offset > (int32(_pBt.XusableSize) - int32(5)) {
 20057  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60031), unsafe.Pointer(&_ptrmapGetØ00__func__Ø000), unsafe.Pointer(str(20052)))
 20058  			crt.X__builtin_abort(tls)
 20059  		}
 20060  	}()
 20061  	func() {
 20062  		if _pEType == nil {
 20063  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60032), unsafe.Pointer(&_ptrmapGetØ00__func__Ø000), unsafe.Pointer(str(20085)))
 20064  			crt.X__builtin_abort(tls)
 20065  		}
 20066  	}()
 20067  	*_pEType = *elem15(_pPtrmap, uintptr(_offset))
 20068  	if _pPgno != nil {
 20069  		*_pPgno = _sqlite3Get4byte(tls, elem15(_pPtrmap, uintptr(_offset+int32(1))))
 20070  	}
 20071  	_sqlite3PagerUnref(tls, _pDbPage)
 20072  	if (int32(*_pEType) < int32(1)) || (int32(*_pEType) > int32(5)) {
 20073  		return _sqlite3CorruptError(tls, int32(60037))
 20074  	}
 20075  	return int32(0)
 20076  }
 20077  
 20078  var _ptrmapGetØ00__func__Ø000 [10]int8
 20079  
 20080  func init() {
 20081  	crt.Xstrncpy(nil, &_ptrmapGetØ00__func__Ø000[0], str(20095), 10)
 20082  }
 20083  
 20084  // C comment
 20085  //  /*
 20086  //  ** Get a page from the pager.  Initialize the MemPage.pBt and
 20087  //  ** MemPage.aData elements if needed.  See also: btreeGetUnusedPage().
 20088  //  **
 20089  //  ** If the PAGER_GET_NOCONTENT flag is set, it means that we do not care
 20090  //  ** about the content of the page at this time.  So do not go to the disk
 20091  //  ** to fetch the content.  Just fill in the content with zeros for now.
 20092  //  ** If in the future we call sqlite3PagerWrite() on this page, that
 20093  //  ** means we have started to be concerned about content and the disk
 20094  //  ** read should occur at that point.
 20095  //  */
 20096  func _btreeGetPage(tls *crt.TLS, _pBt *XBtShared, _pgno uint32, _ppPage **XMemPage, _flags int32) (r0 int32) {
 20097  	var _rc int32
 20098  	var _pDbPage *XPgHdr
 20099  	func() {
 20100  		if _flags != int32(0) && _flags != int32(1) && _flags != int32(2) {
 20101  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61023), unsafe.Pointer(&_btreeGetPageØ00__func__Ø000), unsafe.Pointer(str(20105)))
 20102  			crt.X__builtin_abort(tls)
 20103  		}
 20104  	}()
 20105  	func() {
 20106  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 20107  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61024), unsafe.Pointer(&_btreeGetPageØ00__func__Ø000), unsafe.Pointer(str(9235)))
 20108  			crt.X__builtin_abort(tls)
 20109  		}
 20110  	}()
 20111  	_rc = _sqlite3PagerGet(tls, (*XPager)(_pBt.XpPager), _pgno, &_pDbPage, _flags)
 20112  	if _rc != 0 {
 20113  		return _rc
 20114  	}
 20115  	*_ppPage = _btreePageFromDbPage(tls, _pDbPage, _pgno, _pBt)
 20116  	return int32(0)
 20117  }
 20118  
 20119  var _btreeGetPageØ00__func__Ø000 [13]int8
 20120  
 20121  func init() {
 20122  	crt.Xstrncpy(nil, &_btreeGetPageØ00__func__Ø000[0], str(20173), 13)
 20123  }
 20124  
 20125  // C comment
 20126  //  /*
 20127  //  ** Convert a DbPage obtained from the pager into a MemPage used by
 20128  //  ** the btree layer.
 20129  //  */
 20130  func _btreePageFromDbPage(tls *crt.TLS, _pDbPage *XPgHdr, _pgno uint32, _pBt *XBtShared) (r0 *XMemPage) {
 20131  	var _pPage *XMemPage
 20132  	_pPage = (*XMemPage)(_sqlite3PagerGetExtra(tls, _pDbPage))
 20133  	if _pgno != _pPage.Xpgno {
 20134  		_pPage.XaData = (*uint8)(_sqlite3PagerGetData(tls, _pDbPage))
 20135  		*(**XPgHdr)(unsafe.Pointer(&_pPage.XpDbPage)) = _pDbPage
 20136  		*(**XBtShared)(unsafe.Pointer(&_pPage.XpBt)) = _pBt
 20137  		_pPage.Xpgno = _pgno
 20138  		_pPage.XhdrOffset = uint8(func() int32 {
 20139  			if _pgno == uint32(1) {
 20140  				return int32(100)
 20141  			}
 20142  			return int32(0)
 20143  		}())
 20144  	}
 20145  	func() {
 20146  		if _pPage.XaData != (*uint8)(_sqlite3PagerGetData(tls, _pDbPage)) {
 20147  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60999), unsafe.Pointer(&_btreePageFromDbPageØ00__func__Ø000), unsafe.Pointer(str(20186)))
 20148  			crt.X__builtin_abort(tls)
 20149  		}
 20150  	}()
 20151  	return _pPage
 20152  }
 20153  
 20154  var _btreePageFromDbPageØ00__func__Ø000 [20]int8
 20155  
 20156  func init() {
 20157  	crt.Xstrncpy(nil, &_btreePageFromDbPageØ00__func__Ø000[0], str(20229), 20)
 20158  }
 20159  
 20160  func _releasePage(tls *crt.TLS, _pPage *XMemPage) {
 20161  	if _pPage != nil {
 20162  		_releasePageNotNull(tls, _pPage)
 20163  	}
 20164  }
 20165  
 20166  // C comment
 20167  //  /*
 20168  //  ** Release a MemPage.  This should be called once for each prior
 20169  //  ** call to btreeGetPage.
 20170  //  */
 20171  func _releasePageNotNull(tls *crt.TLS, _pPage *XMemPage) {
 20172  	func() {
 20173  		if _pPage.XaData == nil {
 20174  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61127), unsafe.Pointer(&_releasePageNotNullØ00__func__Ø000), unsafe.Pointer(str(20249)))
 20175  			crt.X__builtin_abort(tls)
 20176  		}
 20177  	}()
 20178  	func() {
 20179  		if _pPage.XpBt == nil {
 20180  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61128), unsafe.Pointer(&_releasePageNotNullØ00__func__Ø000), unsafe.Pointer(str(20262)))
 20181  			crt.X__builtin_abort(tls)
 20182  		}
 20183  	}()
 20184  	func() {
 20185  		if (*XPgHdr)(_pPage.XpDbPage) == nil {
 20186  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61129), unsafe.Pointer(&_releasePageNotNullØ00__func__Ø000), unsafe.Pointer(str(20273)))
 20187  			crt.X__builtin_abort(tls)
 20188  		}
 20189  	}()
 20190  	func() {
 20191  		if _sqlite3PagerGetExtra(tls, (*XPgHdr)(_pPage.XpDbPage)) != unsafe.Pointer(_pPage) {
 20192  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61130), unsafe.Pointer(&_releasePageNotNullØ00__func__Ø000), unsafe.Pointer(str(20291)))
 20193  			crt.X__builtin_abort(tls)
 20194  		}
 20195  	}()
 20196  	func() {
 20197  		if _sqlite3PagerGetData(tls, (*XPgHdr)(_pPage.XpDbPage)) != unsafe.Pointer(_pPage.XaData) {
 20198  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61131), unsafe.Pointer(&_releasePageNotNullØ00__func__Ø000), unsafe.Pointer(str(20344)))
 20199  			crt.X__builtin_abort(tls)
 20200  		}
 20201  	}()
 20202  	func() {
 20203  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 20204  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61132), unsafe.Pointer(&_releasePageNotNullØ00__func__Ø000), unsafe.Pointer(str(20394)))
 20205  			crt.X__builtin_abort(tls)
 20206  		}
 20207  	}()
 20208  	_sqlite3PagerUnrefNotNull(tls, (*XPgHdr)(_pPage.XpDbPage))
 20209  }
 20210  
 20211  var _releasePageNotNullØ00__func__Ø000 [19]int8
 20212  
 20213  func init() {
 20214  	crt.Xstrncpy(nil, &_releasePageNotNullØ00__func__Ø000[0], str(20432), 19)
 20215  }
 20216  
 20217  // C comment
 20218  //  /*
 20219  //  ** Release all of the apPage[] pages for a cursor.
 20220  //  */
 20221  func _btreeReleaseAllCursorPages(tls *crt.TLS, _pCur *XBtCursor) {
 20222  	var _i int32
 20223  	_i = int32(0)
 20224  _0:
 20225  	if _i > int32(_pCur.XiPage) {
 20226  		goto _3
 20227  	}
 20228  	_releasePage(tls, *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_i)))
 20229  	*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_i)) = nil
 20230  	_i += 1
 20231  	goto _0
 20232  _3:
 20233  	_pCur.XiPage = int8(-1)
 20234  }
 20235  
 20236  // C comment
 20237  //  /*
 20238  //  ** This routine sets the state to CURSOR_FAULT and the error
 20239  //  ** code to errCode for every cursor on any BtShared that pBtree
 20240  //  ** references.  Or if the writeOnly flag is set to 1, then only
 20241  //  ** trip write cursors and leave read cursors unchanged.
 20242  //  **
 20243  //  ** Every cursor is a candidate to be tripped, including cursors
 20244  //  ** that belong to other database connections that happen to be
 20245  //  ** sharing the cache with pBtree.
 20246  //  **
 20247  //  ** This routine gets called when a rollback occurs. If the writeOnly
 20248  //  ** flag is true, then only write-cursors need be tripped - read-only
 20249  //  ** cursors save their current positions so that they may continue
 20250  //  ** following the rollback. Or, if writeOnly is false, all cursors are
 20251  //  ** tripped. In general, writeOnly is false if the transaction being
 20252  //  ** rolled back modified the database schema. In this case b-tree root
 20253  //  ** pages may be moved or deleted from the database altogether, making
 20254  //  ** it unsafe for read cursors to continue.
 20255  //  **
 20256  //  ** If the writeOnly flag is true and an error is encountered while
 20257  //  ** saving the current position of a read-only cursor, all cursors,
 20258  //  ** including all read-cursors are tripped.
 20259  //  **
 20260  //  ** SQLITE_OK is returned if successful, or if an error occurs while
 20261  //  ** saving a cursor position, an SQLite error code.
 20262  //  */
 20263  func _sqlite3BtreeTripAllCursors(tls *crt.TLS, _pBtree *XBtree, _errCode int32, _writeOnly int32) (r0 int32) {
 20264  	var _rc, _2_i int32
 20265  	var _p *XBtCursor
 20266  	_rc = int32(0)
 20267  	func() {
 20268  		if _writeOnly != int32(0) && _writeOnly != int32(1) || int32(1) == 0 {
 20269  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62993), unsafe.Pointer(&_sqlite3BtreeTripAllCursorsØ00__func__Ø000), unsafe.Pointer(str(20451)))
 20270  			crt.X__builtin_abort(tls)
 20271  		}
 20272  	}()
 20273  	if _pBtree == nil {
 20274  		goto _4
 20275  	}
 20276  	_sqlite3BtreeEnter(tls, _pBtree)
 20277  	_p = (*XBtCursor)((*XBtShared)(_pBtree.XpBt).XpCursor)
 20278  _5:
 20279  	if _p == nil {
 20280  		goto _8
 20281  	}
 20282  	if _writeOnly == 0 || (int32(_p.XcurFlags)&int32(1)) != int32(0) {
 20283  		goto _10
 20284  	}
 20285  	if int32(_p.XeState) != int32(1) && int32(_p.XeState) != int32(2) {
 20286  		goto _12
 20287  	}
 20288  	_rc = _saveCursorPosition(tls, _p)
 20289  	if _rc != int32(0) {
 20290  		_sqlite3BtreeTripAllCursors(tls, _pBtree, _rc, int32(0))
 20291  		goto _8
 20292  	}
 20293  _12:
 20294  	goto _14
 20295  _10:
 20296  	_sqlite3BtreeClearCursor(tls, _p)
 20297  	_p.XeState = uint8(4)
 20298  	_p.XskipNext = _errCode
 20299  _14:
 20300  	_2_i = int32(0)
 20301  _15:
 20302  	if _2_i > int32(_p.XiPage) {
 20303  		goto _18
 20304  	}
 20305  	_releasePage(tls, *elem30((**XMemPage)(unsafe.Pointer(&_p.XapPage)), uintptr(_2_i)))
 20306  	*elem30((**XMemPage)(unsafe.Pointer(&_p.XapPage)), uintptr(_2_i)) = nil
 20307  	_2_i += 1
 20308  	goto _15
 20309  _18:
 20310  	_p = (*XBtCursor)(_p.XpNext)
 20311  	goto _5
 20312  _8:
 20313  	_sqlite3BtreeLeave(tls, _pBtree)
 20314  _4:
 20315  	return _rc
 20316  }
 20317  
 20318  var _sqlite3BtreeTripAllCursorsØ00__func__Ø000 [27]int8
 20319  
 20320  func init() {
 20321  	crt.Xstrncpy(nil, &_sqlite3BtreeTripAllCursorsØ00__func__Ø000[0], str(20503), 27)
 20322  }
 20323  
 20324  // C comment
 20325  //  /*
 20326  //  ** Clear the current cursor position.
 20327  //  */
 20328  func _sqlite3BtreeClearCursor(tls *crt.TLS, _pCur *XBtCursor) {
 20329  	func() {
 20330  		if _cursorHoldsMutex(tls, _pCur) == 0 {
 20331  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59781), unsafe.Pointer(&_sqlite3BtreeClearCursorØ00__func__Ø000), unsafe.Pointer(str(10230)))
 20332  			crt.X__builtin_abort(tls)
 20333  		}
 20334  	}()
 20335  	Xsqlite3_free(tls, _pCur.XpKey)
 20336  	_pCur.XpKey = nil
 20337  	_pCur.XeState = 0
 20338  }
 20339  
 20340  var _sqlite3BtreeClearCursorØ00__func__Ø000 [24]int8
 20341  
 20342  func init() {
 20343  	crt.Xstrncpy(nil, &_sqlite3BtreeClearCursorØ00__func__Ø000[0], str(20530), 24)
 20344  }
 20345  
 20346  // C comment
 20347  //  /*
 20348  //  ** This function may only be called when a read-transaction is open on
 20349  //  ** the pager. It returns the total number of pages in the database.
 20350  //  **
 20351  //  ** However, if the file is between 1 and <page-size> bytes in size, then
 20352  //  ** this is considered a 1 page file.
 20353  //  */
 20354  func _sqlite3PagerPagecount(tls *crt.TLS, _pPager *XPager, _pnPage *int32) {
 20355  	func() {
 20356  		if int32(_pPager.XeState) < int32(1) {
 20357  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50791), unsafe.Pointer(&_sqlite3PagerPagecountØ00__func__Ø000), unsafe.Pointer(str(18112)))
 20358  			crt.X__builtin_abort(tls)
 20359  		}
 20360  	}()
 20361  	func() {
 20362  		if int32(_pPager.XeState) == int32(5) {
 20363  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50792), unsafe.Pointer(&_sqlite3PagerPagecountØ00__func__Ø000), unsafe.Pointer(str(20554)))
 20364  			crt.X__builtin_abort(tls)
 20365  		}
 20366  	}()
 20367  	*_pnPage = int32(_pPager.XdbSize)
 20368  }
 20369  
 20370  var _sqlite3PagerPagecountØ00__func__Ø000 [22]int8
 20371  
 20372  func init() {
 20373  	crt.Xstrncpy(nil, &_sqlite3PagerPagecountØ00__func__Ø000[0], str(20592), 22)
 20374  }
 20375  
 20376  // C comment
 20377  //  /*
 20378  //  ** Return the number of cursors open on pBt. This is for use
 20379  //  ** in assert() expressions, so it is only compiled if NDEBUG is not
 20380  //  ** defined.
 20381  //  **
 20382  //  ** Only write cursors are counted if wrOnly is true.  If wrOnly is
 20383  //  ** false then all cursors are counted.
 20384  //  **
 20385  //  ** For the purposes of this routine, a cursor is any cursor that
 20386  //  ** is capable of reading or writing to the database.  Cursors that
 20387  //  ** have been tripped into the CURSOR_FAULT state are not counted.
 20388  //  */
 20389  func _countValidCursors(tls *crt.TLS, _pBt *XBtShared, _wrOnly int32) (r0 int32) {
 20390  	var _r int32
 20391  	var _pCur *XBtCursor
 20392  	_r = int32(0)
 20393  	_pCur = (*XBtCursor)(_pBt.XpCursor)
 20394  _0:
 20395  	if _pCur == nil {
 20396  		goto _3
 20397  	}
 20398  	if ((_wrOnly == int32(0)) || ((int32(_pCur.XcurFlags) & int32(1)) != int32(0))) && (int32(_pCur.XeState) != int32(4)) {
 20399  		_r += 1
 20400  	}
 20401  	_pCur = (*XBtCursor)(_pCur.XpNext)
 20402  	goto _0
 20403  _3:
 20404  	return _r
 20405  }
 20406  
 20407  // C comment
 20408  //  /*
 20409  //  ** Clear (destroy) the BtShared.pHasContent bitvec. This should be
 20410  //  ** invoked at the conclusion of each write-transaction.
 20411  //  */
 20412  func _btreeClearHasContent(tls *crt.TLS, _pBt *XBtShared) {
 20413  	_sqlite3BitvecDestroy(tls, (*XBitvec)(_pBt.XpHasContent))
 20414  	*(**XBitvec)(unsafe.Pointer(&_pBt.XpHasContent)) = nil
 20415  }
 20416  
 20417  // C comment
 20418  //  /*
 20419  //  ** This function is called from both BtreeCommitPhaseTwo() and BtreeRollback()
 20420  //  ** at the conclusion of a transaction.
 20421  //  */
 20422  func _btreeEndTransaction(tls *crt.TLS, _p *XBtree) {
 20423  	var _db *Xsqlite3
 20424  	var _pBt *XBtShared
 20425  	_pBt = (*XBtShared)(_p.XpBt)
 20426  	_db = (*Xsqlite3)(_p.Xdb)
 20427  	func() {
 20428  		if _sqlite3BtreeHoldsMutex(tls, _p) == 0 {
 20429  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62861), unsafe.Pointer(&_btreeEndTransactionØ00__func__Ø000), unsafe.Pointer(str(17442)))
 20430  			crt.X__builtin_abort(tls)
 20431  		}
 20432  	}()
 20433  	_pBt.XbDoTruncate = 0
 20434  	if (int32(_p.XinTrans) > int32(0)) && (_db.XnVdbeRead > int32(1)) {
 20435  		_downgradeAllSharedCacheTableLocks(tls, _p)
 20436  		_p.XinTrans = uint8(1)
 20437  		goto _4
 20438  	}
 20439  	if int32(_p.XinTrans) == int32(0) {
 20440  		goto _5
 20441  	}
 20442  	_clearAllSharedCacheTableLocks(tls, _p)
 20443  	_pBt.XnTransaction -= 1
 20444  	if int32(0) == _pBt.XnTransaction {
 20445  		_pBt.XinTransaction = 0
 20446  	}
 20447  _5:
 20448  	_p.XinTrans = 0
 20449  	_unlockBtreeIfUnused(tls, _pBt)
 20450  _4:
 20451  	func() {
 20452  		if int32((*XBtShared)(_p.XpBt).XinTransaction) == int32(0) && ((*XBtShared)(_p.XpBt).XnTransaction) != int32(0) {
 20453  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62891), unsafe.Pointer(&_btreeEndTransactionØ00__func__Ø000), unsafe.Pointer(str(9932)))
 20454  			crt.X__builtin_abort(tls)
 20455  		}
 20456  	}()
 20457  	func() {
 20458  		if int32((*XBtShared)(_p.XpBt).XinTransaction) < int32(_p.XinTrans) {
 20459  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62891), unsafe.Pointer(&_btreeEndTransactionØ00__func__Ø000), unsafe.Pointer(str(9993)))
 20460  			crt.X__builtin_abort(tls)
 20461  		}
 20462  	}()
 20463  }
 20464  
 20465  var _btreeEndTransactionØ00__func__Ø000 [20]int8
 20466  
 20467  func init() {
 20468  	crt.Xstrncpy(nil, &_btreeEndTransactionØ00__func__Ø000[0], str(20614), 20)
 20469  }
 20470  
 20471  // C comment
 20472  //  /*
 20473  //  ** This function changes all write-locks held by Btree p into read-locks.
 20474  //  */
 20475  func _downgradeAllSharedCacheTableLocks(tls *crt.TLS, _p *XBtree) {
 20476  	var _pBt *XBtShared
 20477  	var _1_pLock *XBtLock
 20478  	_pBt = (*XBtShared)(_p.XpBt)
 20479  	if (*XBtree)(_pBt.XpWriter) != _p {
 20480  		goto _0
 20481  	}
 20482  	*(**XBtree)(unsafe.Pointer(&_pBt.XpWriter)) = nil
 20483  	{
 20484  		p := &_pBt.XbtsFlags
 20485  		*p = uint16(int32(*p) & int32(-97))
 20486  	}
 20487  	_1_pLock = (*XBtLock)(_pBt.XpLock)
 20488  _1:
 20489  	if _1_pLock == nil {
 20490  		goto _4
 20491  	}
 20492  	func() {
 20493  		if int32(_1_pLock.XeLock) != int32(1) && (*XBtree)(_1_pLock.XpBtree) != _p {
 20494  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59468), unsafe.Pointer(&_downgradeAllSharedCacheTableLocksØ00__func__Ø000), unsafe.Pointer(str(20634)))
 20495  			crt.X__builtin_abort(tls)
 20496  		}
 20497  	}()
 20498  	_1_pLock.XeLock = uint8(1)
 20499  	_1_pLock = (*XBtLock)(_1_pLock.XpNext)
 20500  	goto _1
 20501  _4:
 20502  _0:
 20503  }
 20504  
 20505  var _downgradeAllSharedCacheTableLocksØ00__func__Ø000 [34]int8
 20506  
 20507  func init() {
 20508  	crt.Xstrncpy(nil, &_downgradeAllSharedCacheTableLocksØ00__func__Ø000[0], str(20678), 34)
 20509  }
 20510  
 20511  // C comment
 20512  //  /*
 20513  //  ** Release all the table locks (locks obtained via calls to
 20514  //  ** the setSharedCacheTableLock() procedure) held by Btree object p.
 20515  //  **
 20516  //  ** This function assumes that Btree p has an open read or write
 20517  //  ** transaction. If it does not, then the BTS_PENDING flag
 20518  //  ** may be incorrectly cleared.
 20519  //  */
 20520  func _clearAllSharedCacheTableLocks(tls *crt.TLS, _p *XBtree) {
 20521  	var _pBt *XBtShared
 20522  	var _1_pLock *XBtLock
 20523  	var _ppIter **XBtLock
 20524  	_pBt = (*XBtShared)(_p.XpBt)
 20525  	_ppIter = (**XBtLock)(unsafe.Pointer(&_pBt.XpLock))
 20526  	func() {
 20527  		if _sqlite3BtreeHoldsMutex(tls, _p) == 0 {
 20528  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59421), unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000), unsafe.Pointer(str(17442)))
 20529  			crt.X__builtin_abort(tls)
 20530  		}
 20531  	}()
 20532  	func() {
 20533  		if _p.Xsharable == 0 && nil != (*_ppIter) {
 20534  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59422), unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000), unsafe.Pointer(str(20712)))
 20535  			crt.X__builtin_abort(tls)
 20536  		}
 20537  	}()
 20538  	func() {
 20539  		if int32(_p.XinTrans) <= int32(0) {
 20540  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59423), unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000), unsafe.Pointer(str(20738)))
 20541  			crt.X__builtin_abort(tls)
 20542  		}
 20543  	}()
 20544  _7:
 20545  	if (*_ppIter) == nil {
 20546  		goto _8
 20547  	}
 20548  	_1_pLock = *_ppIter
 20549  	func() {
 20550  		if (int32(_pBt.XbtsFlags)&int32(32)) != int32(0) && (*XBtree)(_pBt.XpWriter) != (*XBtree)(_1_pLock.XpBtree) {
 20551  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59427), unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000), unsafe.Pointer(str(20751)))
 20552  			crt.X__builtin_abort(tls)
 20553  		}
 20554  	}()
 20555  	func() {
 20556  		if int32((*XBtree)(_1_pLock.XpBtree).XinTrans) < int32(_1_pLock.XeLock) {
 20557  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59428), unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000), unsafe.Pointer(str(20817)))
 20558  			crt.X__builtin_abort(tls)
 20559  		}
 20560  	}()
 20561  	if (*XBtree)(_1_pLock.XpBtree) != _p {
 20562  		goto _14
 20563  	}
 20564  	*_ppIter = (*XBtLock)(_1_pLock.XpNext)
 20565  	func() {
 20566  		if _1_pLock.XiTable == uint32(1) && _1_pLock != &_p.Xlock {
 20567  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59431), unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000), unsafe.Pointer(str(20854)))
 20568  			crt.X__builtin_abort(tls)
 20569  		}
 20570  	}()
 20571  	if _1_pLock.XiTable != uint32(1) {
 20572  		Xsqlite3_free(tls, unsafe.Pointer(_1_pLock))
 20573  	}
 20574  	goto _19
 20575  _14:
 20576  	_ppIter = (**XBtLock)(unsafe.Pointer(&_1_pLock.XpNext))
 20577  _19:
 20578  	goto _7
 20579  _8:
 20580  	func() {
 20581  		if (int32(_pBt.XbtsFlags)&int32(64)) != int32(0) && _pBt.XpWriter == nil {
 20582  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59440), unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000), unsafe.Pointer(str(20890)))
 20583  			crt.X__builtin_abort(tls)
 20584  		}
 20585  	}()
 20586  	if (*XBtree)(_pBt.XpWriter) == _p {
 20587  		*(**XBtree)(unsafe.Pointer(&_pBt.XpWriter)) = nil
 20588  		{
 20589  			p := &_pBt.XbtsFlags
 20590  			*p = uint16(int32(*p) & int32(-97))
 20591  		}
 20592  		goto _25
 20593  	}
 20594  	if _pBt.XnTransaction == int32(2) {
 20595  		{
 20596  			p := &_pBt.XbtsFlags
 20597  			*p = uint16(int32(*p) & int32(-65))
 20598  		}
 20599  	}
 20600  _25:
 20601  }
 20602  
 20603  var _clearAllSharedCacheTableLocksØ00__func__Ø000 [30]int8
 20604  
 20605  func init() {
 20606  	crt.Xstrncpy(nil, &_clearAllSharedCacheTableLocksØ00__func__Ø000[0], str(20939), 30)
 20607  }
 20608  
 20609  // C comment
 20610  //  /*
 20611  //  ** If there are no outstanding cursors and we are not in the middle
 20612  //  ** of a transaction but there is a read lock on the database, then
 20613  //  ** this routine unrefs the first page of the database file which
 20614  //  ** has the effect of releasing the read lock.
 20615  //  **
 20616  //  ** If there is a transaction in progress, this routine is a no-op.
 20617  //  */
 20618  func _unlockBtreeIfUnused(tls *crt.TLS, _pBt *XBtShared) {
 20619  	var _1_pPage1 *XMemPage
 20620  	func() {
 20621  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 20622  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62138), unsafe.Pointer(&_unlockBtreeIfUnusedØ00__func__Ø000), unsafe.Pointer(str(9235)))
 20623  			crt.X__builtin_abort(tls)
 20624  		}
 20625  	}()
 20626  	func() {
 20627  		if _countValidCursors(tls, _pBt, int32(0)) != int32(0) && int32(_pBt.XinTransaction) <= int32(0) {
 20628  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62139), unsafe.Pointer(&_unlockBtreeIfUnusedØ00__func__Ø000), unsafe.Pointer(str(20969)))
 20629  			crt.X__builtin_abort(tls)
 20630  		}
 20631  	}()
 20632  	if (int32(_pBt.XinTransaction) == int32(0)) && ((*XMemPage)(_pBt.XpPage1) != nil) {
 20633  		_1_pPage1 = (*XMemPage)(_pBt.XpPage1)
 20634  		func() {
 20635  			if _1_pPage1.XaData == nil {
 20636  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62142), unsafe.Pointer(&_unlockBtreeIfUnusedØ00__func__Ø000), unsafe.Pointer(str(21030)))
 20637  				crt.X__builtin_abort(tls)
 20638  			}
 20639  		}()
 20640  		func() {
 20641  			if _sqlite3PagerRefcount(tls, (*XPager)(_pBt.XpPager)) != int32(1) {
 20642  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62143), unsafe.Pointer(&_unlockBtreeIfUnusedØ00__func__Ø000), unsafe.Pointer(str(21044)))
 20643  				crt.X__builtin_abort(tls)
 20644  			}
 20645  		}()
 20646  		*(**XMemPage)(unsafe.Pointer(&_pBt.XpPage1)) = nil
 20647  		_releasePageNotNull(tls, _1_pPage1)
 20648  	}
 20649  }
 20650  
 20651  var _unlockBtreeIfUnusedØ00__func__Ø000 [20]int8
 20652  
 20653  func init() {
 20654  	crt.Xstrncpy(nil, &_unlockBtreeIfUnusedØ00__func__Ø000[0], str(21081), 20)
 20655  }
 20656  
 20657  // C comment
 20658  //  /*
 20659  //  ** Return the sum of the reference counts for all pages held by pPager.
 20660  //  */
 20661  func _sqlite3PagerRefcount(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 20662  	return _sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.XpPCache))
 20663  }
 20664  
 20665  // C comment
 20666  //  /*
 20667  //  ** Erase all schema information from all attached databases (including
 20668  //  ** "main" and "temp") for a single database connection.
 20669  //  */
 20670  func _sqlite3ResetAllSchemasOfConnection(tls *crt.TLS, _db *Xsqlite3) {
 20671  	var _i int32
 20672  	var _1_pDb *XDb
 20673  	_sqlite3BtreeEnterAll(tls, _db)
 20674  	_i = int32(0)
 20675  _0:
 20676  	if _i >= _db.XnDb {
 20677  		goto _3
 20678  	}
 20679  	_1_pDb = elem27((*XDb)(_db.XaDb), uintptr(_i))
 20680  	if _1_pDb.XpSchema != nil {
 20681  		_sqlite3SchemaClear(tls, _1_pDb.XpSchema)
 20682  	}
 20683  	_i += 1
 20684  	goto _0
 20685  _3:
 20686  	_db.Xflags &= int32(-3)
 20687  	_sqlite3VtabUnlockList(tls, _db)
 20688  	_sqlite3BtreeLeaveAll(tls, _db)
 20689  	_sqlite3CollapseDatabaseArray(tls, _db)
 20690  }
 20691  
 20692  // C comment
 20693  //  /*
 20694  //  ** Free all resources held by the schema structure. The void* argument points
 20695  //  ** at a Schema struct. This function does not call sqlite3DbFree(db, ) on the
 20696  //  ** pointer itself, it just cleans up subsidiary resources (i.e. the contents
 20697  //  ** of the schema hash tables).
 20698  //  **
 20699  //  ** The Schema.cache_size variable is not cleared.
 20700  //  */
 20701  func _sqlite3SchemaClear(tls *crt.TLS, _p unsafe.Pointer) {
 20702  	var _temp1, _temp2 XHash
 20703  	var _pSchema *XSchema
 20704  	var _pElem *XHashElem
 20705  	var _2_pTab *XTable
 20706  	_pSchema = (*XSchema)(_p)
 20707  	_temp1 = _pSchema.XtblHash
 20708  	_temp2 = _pSchema.XtrigHash
 20709  	_sqlite3HashInit(tls, &_pSchema.XtrigHash)
 20710  	_sqlite3HashClear(tls, &_pSchema.XidxHash)
 20711  	_pElem = (*XHashElem)(_temp2.Xfirst)
 20712  _0:
 20713  	if _pElem == nil {
 20714  		goto _3
 20715  	}
 20716  	_sqlite3DeleteTrigger(tls, nil, (*XTrigger)(_pElem.Xdata))
 20717  	_pElem = (*XHashElem)(_pElem.Xnext)
 20718  	goto _0
 20719  _3:
 20720  	_sqlite3HashClear(tls, &_temp2)
 20721  	_sqlite3HashInit(tls, &_pSchema.XtblHash)
 20722  	_pElem = (*XHashElem)(_temp1.Xfirst)
 20723  _4:
 20724  	if _pElem == nil {
 20725  		goto _7
 20726  	}
 20727  	_2_pTab = (*XTable)(_pElem.Xdata)
 20728  	_sqlite3DeleteTable(tls, nil, _2_pTab)
 20729  	_pElem = (*XHashElem)(_pElem.Xnext)
 20730  	goto _4
 20731  _7:
 20732  	_sqlite3HashClear(tls, &_temp1)
 20733  	_sqlite3HashClear(tls, &_pSchema.XfkeyHash)
 20734  	*(**XTable)(unsafe.Pointer(&_pSchema.XpSeqTab)) = nil
 20735  	if (int32(_pSchema.XschemaFlags) & int32(1)) != 0 {
 20736  		_pSchema.XiGeneration += 1
 20737  		{
 20738  			p := &_pSchema.XschemaFlags
 20739  			*p = uint16(int32(*p) & int32(-2))
 20740  		}
 20741  	}
 20742  }
 20743  
 20744  // C comment
 20745  //  /* Turn bulk memory into a hash table object by initializing the
 20746  //  ** fields of the Hash structure.
 20747  //  **
 20748  //  ** "pNew" is a pointer to the hash table that is to be initialized.
 20749  //  */
 20750  func _sqlite3HashInit(tls *crt.TLS, _pNew *XHash) {
 20751  	func() {
 20752  		if _pNew == nil {
 20753  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29250), unsafe.Pointer(&_sqlite3HashInitØ00__func__Ø000), unsafe.Pointer(str(21101)))
 20754  			crt.X__builtin_abort(tls)
 20755  		}
 20756  	}()
 20757  	*(**XHashElem)(unsafe.Pointer(&_pNew.Xfirst)) = nil
 20758  	_pNew.Xcount = 0
 20759  	_pNew.Xhtsize = 0
 20760  	*(**T_ht)(unsafe.Pointer(&_pNew.Xht)) = nil
 20761  }
 20762  
 20763  var _sqlite3HashInitØ00__func__Ø000 [16]int8
 20764  
 20765  func init() {
 20766  	crt.Xstrncpy(nil, &_sqlite3HashInitØ00__func__Ø000[0], str(21109), 16)
 20767  }
 20768  
 20769  // C comment
 20770  //  /* Remove all entries from a hash table.  Reclaim all memory.
 20771  //  ** Call this routine to delete a hash table or to reset a hash table
 20772  //  ** to the empty state.
 20773  //  */
 20774  func _sqlite3HashClear(tls *crt.TLS, _pH *XHash) {
 20775  	var _elem, _1_next_elem *XHashElem
 20776  	func() {
 20777  		if _pH == nil {
 20778  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29264), unsafe.Pointer(&_sqlite3HashClearØ00__func__Ø000), unsafe.Pointer(str(21125)))
 20779  			crt.X__builtin_abort(tls)
 20780  		}
 20781  	}()
 20782  	_elem = (*XHashElem)(_pH.Xfirst)
 20783  	*(**XHashElem)(unsafe.Pointer(&_pH.Xfirst)) = nil
 20784  	Xsqlite3_free(tls, _pH.Xht)
 20785  	*(**T_ht)(unsafe.Pointer(&_pH.Xht)) = nil
 20786  	_pH.Xhtsize = 0
 20787  _2:
 20788  	if _elem != nil {
 20789  		_1_next_elem = (*XHashElem)(_elem.Xnext)
 20790  		Xsqlite3_free(tls, unsafe.Pointer(_elem))
 20791  		_elem = _1_next_elem
 20792  		goto _2
 20793  	}
 20794  	_pH.Xcount = 0
 20795  }
 20796  
 20797  var _sqlite3HashClearØ00__func__Ø000 [17]int8
 20798  
 20799  func init() {
 20800  	crt.Xstrncpy(nil, &_sqlite3HashClearØ00__func__Ø000[0], str(21131), 17)
 20801  }
 20802  
 20803  // C comment
 20804  //  /*
 20805  //  ** Recursively delete a Trigger structure
 20806  //  */
 20807  func _sqlite3DeleteTrigger(tls *crt.TLS, _db *Xsqlite3, _pTrigger *XTrigger) {
 20808  	if _pTrigger == nil {
 20809  		return
 20810  	}
 20811  	_sqlite3DeleteTriggerStep(tls, _db, (*XTriggerStep)(_pTrigger.Xstep_list))
 20812  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pTrigger.XzName))
 20813  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pTrigger.Xtable))
 20814  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_pTrigger.XpWhen))
 20815  	_sqlite3IdListDelete(tls, _db, (*XIdList)(_pTrigger.XpColumns))
 20816  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pTrigger))
 20817  }
 20818  
 20819  // C comment
 20820  //  /*
 20821  //  ** Delete a linked list of TriggerStep structures.
 20822  //  */
 20823  func _sqlite3DeleteTriggerStep(tls *crt.TLS, _db *Xsqlite3, _pTriggerStep *XTriggerStep) {
 20824  	var _1_pTmp *XTriggerStep
 20825  _0:
 20826  	if _pTriggerStep != nil {
 20827  		_1_pTmp = _pTriggerStep
 20828  		_pTriggerStep = (*XTriggerStep)(_pTriggerStep.XpNext)
 20829  		_sqlite3ExprDelete(tls, _db, (*XExpr)(_1_pTmp.XpWhere))
 20830  		_sqlite3ExprListDelete(tls, _db, (*XExprList)(_1_pTmp.XpExprList))
 20831  		_sqlite3SelectDelete(tls, _db, (*XSelect)(_1_pTmp.XpSelect))
 20832  		_sqlite3IdListDelete(tls, _db, (*XIdList)(_1_pTmp.XpIdList))
 20833  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_1_pTmp))
 20834  		goto _0
 20835  	}
 20836  }
 20837  
 20838  func _sqlite3ExprDelete(tls *crt.TLS, _db *Xsqlite3, _p *XExpr) {
 20839  	if _p != nil {
 20840  		_sqlite3ExprDeleteNN(tls, _db, _p)
 20841  	}
 20842  }
 20843  
 20844  // C comment
 20845  //  /*
 20846  //  ** Recursively delete an expression tree.
 20847  //  */
 20848  func _sqlite3ExprDeleteNN(tls *crt.TLS, _db *Xsqlite3, _p *XExpr) {
 20849  	func() {
 20850  		if _p == nil {
 20851  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91912), unsafe.Pointer(&_sqlite3ExprDeleteNNØ00__func__Ø000), unsafe.Pointer(str(807)))
 20852  			crt.X__builtin_abort(tls)
 20853  		}
 20854  	}()
 20855  	func() {
 20856  		if (_p.Xflags&uint32(1024)) != (0) && (*(*int32)(unsafe.Pointer(&_p.Xu))) < int32(0) {
 20857  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91914), unsafe.Pointer(&_sqlite3ExprDeleteNNØ00__func__Ø000), unsafe.Pointer(str(21148)))
 20858  			crt.X__builtin_abort(tls)
 20859  		}
 20860  	}()
 20861  	if ((_p.Xflags & uint32(8388608)) != (0)) && ((_p.Xflags & uint32(16384)) == (0)) {
 20862  		func() {
 20863  			if (*XExpr)(_p.XpLeft) != nil {
 20864  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91917), unsafe.Pointer(&_sqlite3ExprDeleteNNØ00__func__Ø000), unsafe.Pointer(str(21199)))
 20865  				crt.X__builtin_abort(tls)
 20866  			}
 20867  		}()
 20868  		func() {
 20869  			if (*XExpr)(_p.XpRight) != nil {
 20870  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91918), unsafe.Pointer(&_sqlite3ExprDeleteNNØ00__func__Ø000), unsafe.Pointer(str(21211)))
 20871  				crt.X__builtin_abort(tls)
 20872  			}
 20873  		}()
 20874  		func() {
 20875  			if (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))) != nil {
 20876  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91919), unsafe.Pointer(&_sqlite3ExprDeleteNNØ00__func__Ø000), unsafe.Pointer(str(21224)))
 20877  				crt.X__builtin_abort(tls)
 20878  			}
 20879  		}()
 20880  	}
 20881  	if (_p.Xflags & uint32(8404992)) != (0) {
 20882  		goto _13
 20883  	}
 20884  	func() {
 20885  		if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))) != nil && (*XExpr)(_p.XpRight) != nil {
 20886  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91924), unsafe.Pointer(&_sqlite3ExprDeleteNNØ00__func__Ø000), unsafe.Pointer(str(21240)))
 20887  			crt.X__builtin_abort(tls)
 20888  		}
 20889  	}()
 20890  	if (_p.XpLeft != nil) && (int32(_p.Xop) != int32(159)) {
 20891  		_sqlite3ExprDeleteNN(tls, _db, (*XExpr)(_p.XpLeft))
 20892  	}
 20893  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.XpRight))
 20894  	if (_p.Xflags & uint32(2048)) != (0) {
 20895  		_sqlite3SelectDelete(tls, _db, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))))
 20896  		goto _20
 20897  	}
 20898  	_sqlite3ExprListDelete(tls, _db, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))))
 20899  _20:
 20900  _13:
 20901  	if (_p.Xflags & uint32(65536)) != (0) {
 20902  		_sqlite3DbFree(tls, _db, unsafe.Pointer(*(**int8)(unsafe.Pointer(&_p.Xu))))
 20903  	}
 20904  	if (_p.Xflags & uint32(32768)) == (0) {
 20905  		_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_p))
 20906  	}
 20907  }
 20908  
 20909  var _sqlite3ExprDeleteNNØ00__func__Ø000 [20]int8
 20910  
 20911  func init() {
 20912  	crt.Xstrncpy(nil, &_sqlite3ExprDeleteNNØ00__func__Ø000[0], str(21270), 20)
 20913  }
 20914  
 20915  // C comment
 20916  //  /*
 20917  //  ** Delete the given Select structure and all of its substructures.
 20918  //  */
 20919  func _sqlite3SelectDelete(tls *crt.TLS, _db *Xsqlite3, _p *XSelect) {
 20920  	if _p != nil {
 20921  		_clearSelect(tls, _db, _p, int32(1))
 20922  	}
 20923  }
 20924  
 20925  // C comment
 20926  //  /*
 20927  //  ** Delete all the content of a Select structure.  Deallocate the structure
 20928  //  ** itself only if bFree is true.
 20929  //  */
 20930  func _clearSelect(tls *crt.TLS, _db *Xsqlite3, _p *XSelect, _bFree int32) {
 20931  	var _1_pPrior *XSelect
 20932  _0:
 20933  	if _p == nil {
 20934  		goto _1
 20935  	}
 20936  	_1_pPrior = (*XSelect)(_p.XpPrior)
 20937  	_sqlite3ExprListDelete(tls, _db, (*XExprList)(_p.XpEList))
 20938  	_sqlite3SrcListDelete(tls, _db, (*XSrcList)(_p.XpSrc))
 20939  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.XpWhere))
 20940  	_sqlite3ExprListDelete(tls, _db, (*XExprList)(_p.XpGroupBy))
 20941  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.XpHaving))
 20942  	_sqlite3ExprListDelete(tls, _db, (*XExprList)(_p.XpOrderBy))
 20943  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.XpLimit))
 20944  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.XpOffset))
 20945  	if _p.XpWith != nil {
 20946  		_sqlite3WithDelete(tls, _db, (*XWith)(_p.XpWith))
 20947  	}
 20948  	if _bFree != 0 {
 20949  		_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_p))
 20950  	}
 20951  	_p = _1_pPrior
 20952  	_bFree = int32(1)
 20953  	goto _0
 20954  _1:
 20955  }
 20956  
 20957  func _sqlite3ExprListDelete(tls *crt.TLS, _db *Xsqlite3, _pList *XExprList) {
 20958  	if _pList != nil {
 20959  		_exprListDeleteNN(tls, _db, _pList)
 20960  	}
 20961  }
 20962  
 20963  // C comment
 20964  //  /*
 20965  //  ** Delete an entire expression list.
 20966  //  */
 20967  func _exprListDeleteNN(tls *crt.TLS, _db *Xsqlite3, _pList *XExprList) {
 20968  	var _i int32
 20969  	var _pItem *TExprList_item
 20970  	_i = _pList.XnExpr
 20971  	_pItem = (*TExprList_item)(unsafe.Pointer(&_pList.Xa))
 20972  	func() {
 20973  		if _pList.XnExpr <= int32(0) {
 20974  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92555), unsafe.Pointer(&_exprListDeleteNNØ00__func__Ø000), unsafe.Pointer(str(21290)))
 20975  			crt.X__builtin_abort(tls)
 20976  		}
 20977  	}()
 20978  _2:
 20979  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_pItem.XpExpr))
 20980  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pItem.XzName))
 20981  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pItem.XzSpan))
 20982  	*(*uintptr)(unsafe.Pointer(&_pItem)) += uintptr(20)
 20983  	if preInc2(&_i, -1) > int32(0) {
 20984  		goto _2
 20985  	}
 20986  	_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_pList))
 20987  	_ = _i
 20988  }
 20989  
 20990  var _exprListDeleteNNØ00__func__Ø000 [17]int8
 20991  
 20992  func init() {
 20993  	crt.Xstrncpy(nil, &_exprListDeleteNNØ00__func__Ø000[0], str(21305), 17)
 20994  }
 20995  
 20996  // C comment
 20997  //  /*
 20998  //  ** Delete an entire SrcList including all its substructure.
 20999  //  */
 21000  func _sqlite3SrcListDelete(tls *crt.TLS, _db *Xsqlite3, _pList *XSrcList) {
 21001  	var _i int32
 21002  	var _pItem *TSrcList_item
 21003  	if _pList == nil {
 21004  		return
 21005  	}
 21006  	*func() *int32 { _pItem = (*TSrcList_item)(unsafe.Pointer(&_pList.Xa)); return &_i }() = int32(0)
 21007  _1:
 21008  	if _i >= _pList.XnSrc {
 21009  		goto _4
 21010  	}
 21011  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pItem.XzDatabase))
 21012  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pItem.XzName))
 21013  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pItem.XzAlias))
 21014  	if ((uint32((_pItem.Xfg.XnotIndexed)>>1) << 31) >> 31) != 0 {
 21015  		_sqlite3DbFree(tls, _db, unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pItem.Xu1))))
 21016  	}
 21017  	if ((uint32((_pItem.Xfg.XnotIndexed)>>2) << 31) >> 31) != 0 {
 21018  		_sqlite3ExprListDelete(tls, _db, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pItem.Xu1))))
 21019  	}
 21020  	_sqlite3DeleteTable(tls, _db, (*XTable)(_pItem.XpTab))
 21021  	_sqlite3SelectDelete(tls, _db, (*XSelect)(_pItem.XpSelect))
 21022  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_pItem.XpOn))
 21023  	_sqlite3IdListDelete(tls, _db, (*XIdList)(_pItem.XpUsing))
 21024  	*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pItem }())) += uintptr(68)
 21025  	goto _1
 21026  _4:
 21027  	_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_pList))
 21028  }
 21029  
 21030  func _sqlite3DeleteTable(tls *crt.TLS, _db *Xsqlite3, _pTable *XTable) {
 21031  	if _pTable == nil {
 21032  		return
 21033  	}
 21034  	if ((_db == nil) || (_db.XpnBytesFreed == nil)) && (preInc23(&_pTable.XnTabRef, uint32(4294967295)) > (0)) {
 21035  		return
 21036  	}
 21037  	_deleteTable(tls, _db, _pTable)
 21038  }
 21039  
 21040  // C comment
 21041  //  /*
 21042  //  ** Remove the memory data structures associated with the given
 21043  //  ** Table.  No changes are made to disk by this routine.
 21044  //  **
 21045  //  ** This routine just deletes the data structure.  It does not unlink
 21046  //  ** the table data structure from the hash table.  But it does destroy
 21047  //  ** memory structures of the indices and foreign keys associated with
 21048  //  ** the table.
 21049  //  **
 21050  //  ** The db parameter is optional.  It is needed if the Table object
 21051  //  ** contains lookaside memory.  (Table objects in the schema do not use
 21052  //  ** lookaside memory, but some ephemeral Table objects do.)  Or the
 21053  //  ** db parameter can be used with db->pnBytesFreed to measure the memory
 21054  //  ** used by the Table object.
 21055  //  */
 21056  func _deleteTable(tls *crt.TLS, _db *Xsqlite3, _pTable *XTable) {
 21057  	var _nLookaside int32
 21058  	var _2_zName *int8
 21059  	var _pIndex, _pNext, _2_pOld *XIndex
 21060  	_nLookaside = func() int32 {
 21061  		if (_db != nil) && ((_pTable.XtabFlags & uint32(2)) == (0)) {
 21062  			return (_db.Xlookaside.XnOut)
 21063  		}
 21064  		return int32(0)
 21065  	}()
 21066  	_pIndex = (*XIndex)(_pTable.XpIndex)
 21067  _3:
 21068  	if _pIndex == nil {
 21069  		goto _6
 21070  	}
 21071  	_pNext = (*XIndex)(_pIndex.XpNext)
 21072  	func() {
 21073  		if (*XSchema)(_pIndex.XpSchema) != (*XSchema)(_pTable.XpSchema) && (_pTable.XnModuleArg == 0 || int32((uint32(_pIndex.XidxType)<<30)>>30) == int32(0)) {
 21074  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100309), unsafe.Pointer(&_deleteTableØ00__func__Ø000), unsafe.Pointer(str(21322)))
 21075  			crt.X__builtin_abort(tls)
 21076  		}
 21077  	}()
 21078  	if ((_db == nil) || (_db.XpnBytesFreed == nil)) && (_pTable.XnModuleArg == 0) {
 21079  		_2_zName = _pIndex.XzName
 21080  		_2_pOld = (*XIndex)(_sqlite3HashInsert(tls, &((*XSchema)(_pIndex.XpSchema).XidxHash), _2_zName, nil))
 21081  		func() {
 21082  			if _db != nil && _sqlite3SchemaMutexHeld(tls, _db, int32(0), (*XSchema)(_pIndex.XpSchema)) == 0 {
 21083  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100316), unsafe.Pointer(&_deleteTableØ00__func__Ø000), unsafe.Pointer(str(21420)))
 21084  				crt.X__builtin_abort(tls)
 21085  			}
 21086  		}()
 21087  		func() {
 21088  			if _2_pOld != _pIndex && _2_pOld != nil {
 21089  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100317), unsafe.Pointer(&_deleteTableØ00__func__Ø000), unsafe.Pointer(str(21476)))
 21090  				crt.X__builtin_abort(tls)
 21091  			}
 21092  		}()
 21093  	}
 21094  	_freeIndex(tls, _db, _pIndex)
 21095  	_pIndex = _pNext
 21096  	goto _3
 21097  _6:
 21098  	_sqlite3FkDelete(tls, _db, _pTable)
 21099  	_sqlite3DeleteColumnNames(tls, _db, _pTable)
 21100  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pTable.XzName))
 21101  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pTable.XzColAff))
 21102  	_sqlite3SelectDelete(tls, _db, (*XSelect)(_pTable.XpSelect))
 21103  	_sqlite3ExprListDelete(tls, _db, (*XExprList)(_pTable.XpCheck))
 21104  	_sqlite3VtabClear(tls, _db, _pTable)
 21105  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pTable))
 21106  	func() {
 21107  		if _nLookaside != int32(0) && _nLookaside != (_db.Xlookaside.XnOut) {
 21108  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100338), unsafe.Pointer(&_deleteTableØ00__func__Ø000), unsafe.Pointer(str(21500)))
 21109  			crt.X__builtin_abort(tls)
 21110  		}
 21111  	}()
 21112  }
 21113  
 21114  var _deleteTableØ00__func__Ø000 [12]int8
 21115  
 21116  func init() {
 21117  	crt.Xstrncpy(nil, &_deleteTableØ00__func__Ø000[0], str(21548), 12)
 21118  }
 21119  
 21120  // C comment
 21121  //  /* Insert an element into the hash table pH.  The key is pKey
 21122  //  ** and the data is "data".
 21123  //  **
 21124  //  ** If no element exists with a matching key, then a new
 21125  //  ** element is created and NULL is returned.
 21126  //  **
 21127  //  ** If another element already exists with the same key, then the
 21128  //  ** new data replaces the old data and the old data is returned.
 21129  //  ** The key is not copied in this instance.  If a malloc fails, then
 21130  //  ** the new data is returned and the hash table is unchanged.
 21131  //  **
 21132  //  ** If the "data" parameter to this function is NULL, then the
 21133  //  ** element corresponding to "key" is removed from the hash table.
 21134  //  */
 21135  func _sqlite3HashInsert(tls *crt.TLS, _pH *XHash, _pKey *int8, _data unsafe.Pointer) (r0 unsafe.Pointer) {
 21136  	var _h uint32
 21137  	var _1_old_data unsafe.Pointer
 21138  	var _elem, _new_elem *XHashElem
 21139  	func() {
 21140  		if _pH == nil {
 21141  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29470), unsafe.Pointer(&_sqlite3HashInsertØ00__func__Ø000), unsafe.Pointer(str(21125)))
 21142  			crt.X__builtin_abort(tls)
 21143  		}
 21144  	}()
 21145  	func() {
 21146  		if _pKey == nil {
 21147  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29471), unsafe.Pointer(&_sqlite3HashInsertØ00__func__Ø000), unsafe.Pointer(str(21560)))
 21148  			crt.X__builtin_abort(tls)
 21149  		}
 21150  	}()
 21151  	_elem = _findElementWithHash(tls, _pH, _pKey, &_h)
 21152  	if _elem == nil {
 21153  		goto _4
 21154  	}
 21155  	_1_old_data = _elem.Xdata
 21156  	if _data == nil {
 21157  		_removeElementGivenHash(tls, _pH, _elem, _h)
 21158  		goto _6
 21159  	}
 21160  	_elem.Xdata = _data
 21161  	_elem.XpKey = _pKey
 21162  _6:
 21163  	return _1_old_data
 21164  
 21165  _4:
 21166  	if _data == nil {
 21167  		return nil
 21168  	}
 21169  	_new_elem = (*XHashElem)(_sqlite3Malloc(tls, uint64(16)))
 21170  	if _new_elem == nil {
 21171  		return _data
 21172  	}
 21173  	_new_elem.XpKey = _pKey
 21174  	_new_elem.Xdata = _data
 21175  	_pH.Xcount += 1
 21176  	if _pH.Xcount < uint32(10) || _pH.Xcount <= (uint32(2)*_pH.Xhtsize) {
 21177  		goto _10
 21178  	}
 21179  	if _rehash(tls, _pH, _pH.Xcount*uint32(2)) != 0 {
 21180  		func() {
 21181  			if _pH.Xhtsize <= (0) {
 21182  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29491), unsafe.Pointer(&_sqlite3HashInsertØ00__func__Ø000), unsafe.Pointer(str(21568)))
 21183  				crt.X__builtin_abort(tls)
 21184  			}
 21185  		}()
 21186  		_h = _strHash(tls, _pKey) % _pH.Xhtsize
 21187  	}
 21188  _10:
 21189  	_insertElement(tls, _pH, func() *T_ht {
 21190  		if _pH.Xht != nil {
 21191  			return elem39((*T_ht)(_pH.Xht), uintptr(_h))
 21192  		}
 21193  		return nil
 21194  	}(), _new_elem)
 21195  	return nil
 21196  }
 21197  
 21198  var _sqlite3HashInsertØ00__func__Ø000 [18]int8
 21199  
 21200  func init() {
 21201  	crt.Xstrncpy(nil, &_sqlite3HashInsertØ00__func__Ø000[0], str(21581), 18)
 21202  }
 21203  
 21204  // C comment
 21205  //  /* This function (for internal use only) locates an element in an
 21206  //  ** hash table that matches the given key.  The hash for this key is
 21207  //  ** also computed and returned in the *pH parameter.
 21208  //  */
 21209  func _findElementWithHash(tls *crt.TLS, _pH *XHash, _pKey *int8, _pHash *uint32) (r0 *XHashElem) {
 21210  	var _count int32
 21211  	var _h uint32
 21212  	var _elem *XHashElem
 21213  	var _1_pEntry *T_ht
 21214  	if _pH.Xht != nil {
 21215  		_h = _strHash(tls, _pKey) % _pH.Xhtsize
 21216  		_1_pEntry = elem39((*T_ht)(_pH.Xht), uintptr(_h))
 21217  		_elem = (*XHashElem)(_1_pEntry.Xchain)
 21218  		_count = _1_pEntry.Xcount
 21219  		goto _1
 21220  	}
 21221  	_h = 0
 21222  	_elem = (*XHashElem)(_pH.Xfirst)
 21223  	_count = int32(_pH.Xcount)
 21224  _1:
 21225  	*_pHash = _h
 21226  _2:
 21227  	if postInc2(&_count, -1) == 0 {
 21228  		goto _3
 21229  	}
 21230  	func() {
 21231  		if _elem == nil {
 21232  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29394), unsafe.Pointer(&_findElementWithHashØ00__func__Ø000), unsafe.Pointer(str(21599)))
 21233  			crt.X__builtin_abort(tls)
 21234  		}
 21235  	}()
 21236  	if _sqlite3StrICmp(tls, _elem.XpKey, _pKey) == int32(0) {
 21237  		return _elem
 21238  	}
 21239  	_elem = (*XHashElem)(_elem.Xnext)
 21240  	goto _2
 21241  _3:
 21242  	return nil
 21243  
 21244  	_ = _count
 21245  	panic(0)
 21246  }
 21247  
 21248  // C comment
 21249  //  /*
 21250  //  ** The hashing function.
 21251  //  */
 21252  func _strHash(tls *crt.TLS, _z *int8) (r0 uint32) {
 21253  	var _h uint32
 21254  	var _c uint8
 21255  	_h = uint32(0)
 21256  _0:
 21257  	if int32(store3(&_c, uint8(*postInc1(&_z, 1)))) != int32(0) {
 21258  		_h += uint32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(_c)))
 21259  		_h *= uint32(2654435761)
 21260  		goto _0
 21261  	}
 21262  	return _h
 21263  }
 21264  
 21265  var _findElementWithHashØ00__func__Ø000 [20]int8
 21266  
 21267  func init() {
 21268  	crt.Xstrncpy(nil, &_findElementWithHashØ00__func__Ø000[0], str(21607), 20)
 21269  }
 21270  
 21271  // C comment
 21272  //  /* Remove a single entry from the hash table given a pointer to that
 21273  //  ** element and a hash on the element's key.
 21274  //  */
 21275  func _removeElementGivenHash(tls *crt.TLS, _pH *XHash, _elem *XHashElem, _h uint32) {
 21276  	var _pEntry *T_ht
 21277  	if _elem.Xprev != nil {
 21278  		*(**XHashElem)(unsafe.Pointer(&((*XHashElem)(_elem.Xprev).Xnext))) = (*XHashElem)(_elem.Xnext)
 21279  		goto _1
 21280  	}
 21281  	*(**XHashElem)(unsafe.Pointer(&_pH.Xfirst)) = (*XHashElem)(_elem.Xnext)
 21282  _1:
 21283  	if _elem.Xnext != nil {
 21284  		*(**XHashElem)(unsafe.Pointer(&((*XHashElem)(_elem.Xnext).Xprev))) = (*XHashElem)(_elem.Xprev)
 21285  	}
 21286  	if _pH.Xht == nil {
 21287  		goto _3
 21288  	}
 21289  	_pEntry = elem39((*T_ht)(_pH.Xht), uintptr(_h))
 21290  	if (*XHashElem)(_pEntry.Xchain) == _elem {
 21291  		*(**XHashElem)(unsafe.Pointer(&_pEntry.Xchain)) = (*XHashElem)(_elem.Xnext)
 21292  	}
 21293  	_pEntry.Xcount -= 1
 21294  	func() {
 21295  		if _pEntry.Xcount < int32(0) {
 21296  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29426), unsafe.Pointer(&_removeElementGivenHashØ00__func__Ø000), unsafe.Pointer(str(21627)))
 21297  			crt.X__builtin_abort(tls)
 21298  		}
 21299  	}()
 21300  _3:
 21301  	Xsqlite3_free(tls, unsafe.Pointer(_elem))
 21302  	_pH.Xcount -= 1
 21303  	if _pH.Xcount == (0) {
 21304  		func() {
 21305  			if (*XHashElem)(_pH.Xfirst) != nil {
 21306  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29431), unsafe.Pointer(&_removeElementGivenHashØ00__func__Ø000), unsafe.Pointer(str(21644)))
 21307  				crt.X__builtin_abort(tls)
 21308  			}
 21309  		}()
 21310  		func() {
 21311  			if _pH.Xcount != (0) {
 21312  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29432), unsafe.Pointer(&_removeElementGivenHashØ00__func__Ø000), unsafe.Pointer(str(21657)))
 21313  				crt.X__builtin_abort(tls)
 21314  			}
 21315  		}()
 21316  		_sqlite3HashClear(tls, _pH)
 21317  	}
 21318  }
 21319  
 21320  var _removeElementGivenHashØ00__func__Ø000 [23]int8
 21321  
 21322  func init() {
 21323  	crt.Xstrncpy(nil, &_removeElementGivenHashØ00__func__Ø000[0], str(21670), 23)
 21324  }
 21325  
 21326  // C comment
 21327  //  /* Resize the hash table so that it cantains "new_size" buckets.
 21328  //  **
 21329  //  ** The hash table might fail to resize if sqlite3_malloc() fails or
 21330  //  ** if the new size is the same as the prior size.
 21331  //  ** Return TRUE if the resize occurs and false if not.
 21332  //  */
 21333  func _rehash(tls *crt.TLS, _pH *XHash, _new_size uint32) (r0 int32) {
 21334  	var _2_h uint32
 21335  	var _elem, _next_elem *XHashElem
 21336  	var _new_ht *T_ht
 21337  	if (_new_size * uint32(8)) > uint32(1024) {
 21338  		_new_size = uint32(128)
 21339  	}
 21340  	if _new_size == _pH.Xhtsize {
 21341  		return int32(0)
 21342  	}
 21343  	_sqlite3BeginBenignMalloc(tls)
 21344  	_new_ht = (*T_ht)(_sqlite3Malloc(tls, uint64(_new_size*uint32(8))))
 21345  	_sqlite3EndBenignMalloc(tls)
 21346  	if _new_ht == nil {
 21347  		return int32(0)
 21348  	}
 21349  	Xsqlite3_free(tls, _pH.Xht)
 21350  	*(**T_ht)(unsafe.Pointer(&_pH.Xht)) = _new_ht
 21351  	_pH.Xhtsize = store23(&_new_size, uint32(_sqlite3MallocSize(tls, unsafe.Pointer(_new_ht)))/uint32(8))
 21352  	crt.Xmemset(tls, unsafe.Pointer(_new_ht), int32(0), _new_size*uint32(8))
 21353  	*(**XHashElem)(unsafe.Pointer(&(func() *XHash { _elem = (*XHashElem)(_pH.Xfirst); return _pH }().Xfirst))) = nil
 21354  _3:
 21355  	if _elem == nil {
 21356  		goto _6
 21357  	}
 21358  	_2_h = _strHash(tls, _elem.XpKey) % _new_size
 21359  	_next_elem = (*XHashElem)(_elem.Xnext)
 21360  	_insertElement(tls, _pH, elem39(_new_ht, uintptr(_2_h)), _elem)
 21361  	_elem = _next_elem
 21362  	goto _3
 21363  _6:
 21364  	return int32(1)
 21365  }
 21366  
 21367  // C comment
 21368  //  /* Link pNew element into the hash table pH.  If pEntry!=0 then also
 21369  //  ** insert pNew into the pEntry hash bucket.
 21370  //  */
 21371  func _insertElement(tls *crt.TLS, _pH *XHash, _pEntry *T_ht, _pNew *XHashElem) {
 21372  	var _pHead *XHashElem
 21373  	if _pEntry != nil {
 21374  		_pHead = func() *XHashElem {
 21375  			if _pEntry.Xcount != 0 {
 21376  				return (*XHashElem)(_pEntry.Xchain)
 21377  			}
 21378  			return nil
 21379  		}()
 21380  		_pEntry.Xcount += 1
 21381  		*(**XHashElem)(unsafe.Pointer(&_pEntry.Xchain)) = _pNew
 21382  		goto _3
 21383  	}
 21384  	_pHead = nil
 21385  _3:
 21386  	if _pHead == nil {
 21387  		goto _4
 21388  	}
 21389  	*(**XHashElem)(unsafe.Pointer(&_pNew.Xnext)) = _pHead
 21390  	*(**XHashElem)(unsafe.Pointer(&_pNew.Xprev)) = (*XHashElem)(_pHead.Xprev)
 21391  	if _pHead.Xprev != nil {
 21392  		*(**XHashElem)(unsafe.Pointer(&((*XHashElem)(_pHead.Xprev).Xnext))) = _pNew
 21393  		goto _6
 21394  	}
 21395  	*(**XHashElem)(unsafe.Pointer(&_pH.Xfirst)) = _pNew
 21396  _6:
 21397  	*(**XHashElem)(unsafe.Pointer(&_pHead.Xprev)) = _pNew
 21398  	goto _7
 21399  _4:
 21400  	*(**XHashElem)(unsafe.Pointer(&_pNew.Xnext)) = (*XHashElem)(_pH.Xfirst)
 21401  	if _pH.Xfirst != nil {
 21402  		*(**XHashElem)(unsafe.Pointer(&((*XHashElem)(_pH.Xfirst).Xprev))) = _pNew
 21403  	}
 21404  	*(**XHashElem)(unsafe.Pointer(&_pNew.Xprev)) = nil
 21405  	*(**XHashElem)(unsafe.Pointer(&_pH.Xfirst)) = _pNew
 21406  _7:
 21407  }
 21408  
 21409  // C comment
 21410  //  /*
 21411  //  ** Return true if the correct mutexes are held for accessing the
 21412  //  ** db->aDb[iDb].pSchema structure.  The mutexes required for schema
 21413  //  ** access are:
 21414  //  **
 21415  //  **   (1) The mutex on db
 21416  //  **   (2) if iDb!=1, then the mutex on db->aDb[iDb].pBt.
 21417  //  **
 21418  //  ** If pSchema is not NULL, then iDb is computed from pSchema and
 21419  //  ** db using sqlite3SchemaToIndex().
 21420  //  */
 21421  func _sqlite3SchemaMutexHeld(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _pSchema *XSchema) (r0 int32) {
 21422  	var _p *XBtree
 21423  	func() {
 21424  		if _db == nil {
 21425  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58977), unsafe.Pointer(&_sqlite3SchemaMutexHeldØ00__func__Ø000), unsafe.Pointer(str(1219)))
 21426  			crt.X__builtin_abort(tls)
 21427  		}
 21428  	}()
 21429  	if _pSchema != nil {
 21430  		_iDb = _sqlite3SchemaToIndex(tls, _db, _pSchema)
 21431  	}
 21432  	func() {
 21433  		if _iDb < int32(0) || _iDb >= _db.XnDb {
 21434  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58979), unsafe.Pointer(&_sqlite3SchemaMutexHeldØ00__func__Ø000), unsafe.Pointer(str(21693)))
 21435  			crt.X__builtin_abort(tls)
 21436  		}
 21437  	}()
 21438  	if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 21439  		return int32(0)
 21440  	}
 21441  	if _iDb == int32(1) {
 21442  		return int32(1)
 21443  	}
 21444  	_p = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpBt)
 21445  	func() {
 21446  		if _p == nil {
 21447  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(58983), unsafe.Pointer(&_sqlite3SchemaMutexHeldØ00__func__Ø000), unsafe.Pointer(str(807)))
 21448  			crt.X__builtin_abort(tls)
 21449  		}
 21450  	}()
 21451  	return bool2int((int32(_p.Xsharable) == int32(0)) || (int32(_p.Xlocked) == int32(1)))
 21452  }
 21453  
 21454  var _sqlite3SchemaMutexHeldØ00__func__Ø000 [23]int8
 21455  
 21456  func init() {
 21457  	crt.Xstrncpy(nil, &_sqlite3SchemaMutexHeldØ00__func__Ø000[0], str(21715), 23)
 21458  }
 21459  
 21460  // C comment
 21461  //  /*
 21462  //  ** Convert a schema pointer into the iDb index that indicates
 21463  //  ** which database file in db->aDb[] the schema refers to.
 21464  //  **
 21465  //  ** If the same database is attached more than once, the first
 21466  //  ** attached database is returned.
 21467  //  */
 21468  func _sqlite3SchemaToIndex(tls *crt.TLS, _db *Xsqlite3, _pSchema *XSchema) (r0 int32) {
 21469  	var _i int32
 21470  	_i = int32(-1000000)
 21471  	func() {
 21472  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 21473  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116147), unsafe.Pointer(&_sqlite3SchemaToIndexØ00__func__Ø000), unsafe.Pointer(str(881)))
 21474  			crt.X__builtin_abort(tls)
 21475  		}
 21476  	}()
 21477  	if _pSchema == nil {
 21478  		goto _2
 21479  	}
 21480  	_i = int32(0)
 21481  _3:
 21482  	if func() int32 {
 21483  		if _i < _db.XnDb {
 21484  			return int32(1)
 21485  		}
 21486  		return func() int32 {
 21487  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116149), unsafe.Pointer(&_sqlite3SchemaToIndexØ00__func__Ø000), unsafe.Pointer(str(4809)))
 21488  			crt.X__builtin_abort(tls)
 21489  			return int32(0)
 21490  		}()
 21491  	}() == 0 {
 21492  		goto _8
 21493  	}
 21494  	if (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpSchema) == _pSchema {
 21495  		goto _8
 21496  	}
 21497  	_i += 1
 21498  	goto _3
 21499  _8:
 21500  	func() {
 21501  		if _i < int32(0) || _i >= _db.XnDb {
 21502  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116154), unsafe.Pointer(&_sqlite3SchemaToIndexØ00__func__Ø000), unsafe.Pointer(str(21738)))
 21503  			crt.X__builtin_abort(tls)
 21504  		}
 21505  	}()
 21506  _2:
 21507  	return _i
 21508  }
 21509  
 21510  var _sqlite3SchemaToIndexØ00__func__Ø000 [21]int8
 21511  
 21512  func init() {
 21513  	crt.Xstrncpy(nil, &_sqlite3SchemaToIndexØ00__func__Ø000[0], str(21756), 21)
 21514  }
 21515  
 21516  // C comment
 21517  //  /*
 21518  //  ** Reclaim the memory used by an index
 21519  //  */
 21520  func _freeIndex(tls *crt.TLS, _db *Xsqlite3, _p *XIndex) {
 21521  	_sqlite3DeleteIndexSamples(tls, _db, _p)
 21522  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.XpPartIdxWhere))
 21523  	_sqlite3ExprListDelete(tls, _db, (*XExprList)(_p.XaColExpr))
 21524  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_p.XzColAff))
 21525  	if ((uint32(_p.XidxType>>4) << 31) >> 31) != 0 {
 21526  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_p.XazColl))
 21527  	}
 21528  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_p))
 21529  }
 21530  
 21531  // C comment
 21532  //  /*
 21533  //  ** If the Index.aSample variable is not NULL, delete the aSample[] array
 21534  //  ** and its contents.
 21535  //  */
 21536  func _sqlite3DeleteIndexSamples(tls *crt.TLS, _db *Xsqlite3, _pIdx *XIndex) {
 21537  }
 21538  
 21539  // C comment
 21540  //  /*
 21541  //  ** Free all memory associated with foreign key definitions attached to
 21542  //  ** table pTab. Remove the deleted foreign keys from the Schema.fkeyHash
 21543  //  ** hash table.
 21544  //  */
 21545  func _sqlite3FkDelete(tls *crt.TLS, _db *Xsqlite3, _pTab *XTable) {
 21546  	var _4_z *int8
 21547  	var _4_p unsafe.Pointer
 21548  	var _pFKey, _pNext *XFKey
 21549  	func() {
 21550  		if _db != nil && _pTab.XnModuleArg == 0 && _sqlite3SchemaMutexHeld(tls, _db, int32(0), (*XSchema)(_pTab.XpSchema)) == 0 {
 21551  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108799), unsafe.Pointer(&_sqlite3FkDeleteØ00__func__Ø000), unsafe.Pointer(str(21777)))
 21552  			crt.X__builtin_abort(tls)
 21553  		}
 21554  	}()
 21555  	_pFKey = (*XFKey)(_pTab.XpFKey)
 21556  _4:
 21557  	if _pFKey == nil {
 21558  		goto _7
 21559  	}
 21560  	if _db != nil && _db.XpnBytesFreed != nil {
 21561  		goto _9
 21562  	}
 21563  	if _pFKey.XpPrevTo != nil {
 21564  		*(**XFKey)(unsafe.Pointer(&((*XFKey)(_pFKey.XpPrevTo).XpNextTo))) = (*XFKey)(_pFKey.XpNextTo)
 21565  		goto _11
 21566  	}
 21567  	_4_p = _pFKey.XpNextTo
 21568  	_4_z = func() *int8 {
 21569  		if _4_p != nil {
 21570  			return ((*XFKey)(_pFKey.XpNextTo).XzTo)
 21571  		}
 21572  		return _pFKey.XzTo
 21573  	}()
 21574  	_sqlite3HashInsert(tls, &((*XSchema)(_pTab.XpSchema).XfkeyHash), _4_z, _4_p)
 21575  _11:
 21576  	if _pFKey.XpNextTo != nil {
 21577  		*(**XFKey)(unsafe.Pointer(&((*XFKey)(_pFKey.XpNextTo).XpPrevTo))) = (*XFKey)(_pFKey.XpPrevTo)
 21578  	}
 21579  _9:
 21580  	func() {
 21581  		if int32(_pFKey.XisDeferred) != int32(0) && int32(_pFKey.XisDeferred) != int32(1) {
 21582  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108820), unsafe.Pointer(&_sqlite3FkDeleteØ00__func__Ø000), unsafe.Pointer(str(21850)))
 21583  			crt.X__builtin_abort(tls)
 21584  		}
 21585  	}()
 21586  	_fkTriggerDelete(tls, _db, *elem40((**XTrigger)(unsafe.Pointer(&_pFKey.XapTrigger)), 0))
 21587  	_fkTriggerDelete(tls, _db, *elem40((**XTrigger)(unsafe.Pointer(&_pFKey.XapTrigger)), uintptr(1)))
 21588  	_pNext = (*XFKey)(_pFKey.XpNextFrom)
 21589  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pFKey))
 21590  	_pFKey = _pNext
 21591  	goto _4
 21592  _7:
 21593  }
 21594  
 21595  var _sqlite3FkDeleteØ00__func__Ø000 [16]int8
 21596  
 21597  func init() {
 21598  	crt.Xstrncpy(nil, &_sqlite3FkDeleteØ00__func__Ø000[0], str(21895), 16)
 21599  }
 21600  
 21601  // C comment
 21602  //  /*
 21603  //  ** The second argument is a Trigger structure allocated by the
 21604  //  ** fkActionTrigger() routine. This function deletes the Trigger structure
 21605  //  ** and all of its sub-components.
 21606  //  **
 21607  //  ** The Trigger structure or any of its sub-components may be allocated from
 21608  //  ** the lookaside buffer belonging to database handle dbMem.
 21609  //  */
 21610  func _fkTriggerDelete(tls *crt.TLS, _dbMem *Xsqlite3, _p *XTrigger) {
 21611  	var _1_pStep *XTriggerStep
 21612  	if _p != nil {
 21613  		_1_pStep = (*XTriggerStep)(_p.Xstep_list)
 21614  		_sqlite3ExprDelete(tls, _dbMem, (*XExpr)(_1_pStep.XpWhere))
 21615  		_sqlite3ExprListDelete(tls, _dbMem, (*XExprList)(_1_pStep.XpExprList))
 21616  		_sqlite3SelectDelete(tls, _dbMem, (*XSelect)(_1_pStep.XpSelect))
 21617  		_sqlite3ExprDelete(tls, _dbMem, (*XExpr)(_p.XpWhen))
 21618  		_sqlite3DbFree(tls, _dbMem, unsafe.Pointer(_p))
 21619  	}
 21620  }
 21621  
 21622  // C comment
 21623  //  /*
 21624  //  ** Delete memory allocated for the column names of a table or view (the
 21625  //  ** Table.aCol[] array).
 21626  //  */
 21627  func _sqlite3DeleteColumnNames(tls *crt.TLS, _db *Xsqlite3, _pTable *XTable) {
 21628  	var _i int32
 21629  	var _pCol *XColumn
 21630  	func() {
 21631  		if _pTable == nil {
 21632  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100270), unsafe.Pointer(&_sqlite3DeleteColumnNamesØ00__func__Ø000), unsafe.Pointer(str(21911)))
 21633  			crt.X__builtin_abort(tls)
 21634  		}
 21635  	}()
 21636  	if store41(&_pCol, (*XColumn)(_pTable.XaCol)) == nil {
 21637  		goto _2
 21638  	}
 21639  	_i = int32(0)
 21640  _3:
 21641  	if _i >= int32(_pTable.XnCol) {
 21642  		goto _6
 21643  	}
 21644  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pCol.XzName))
 21645  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_pCol.XpDflt))
 21646  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pCol.XzColl))
 21647  	*(*uintptr)(unsafe.Pointer(func() **XColumn { _i += 1; return &_pCol }())) += uintptr(16)
 21648  	goto _3
 21649  _6:
 21650  	_sqlite3DbFree(tls, _db, _pTable.XaCol)
 21651  _2:
 21652  }
 21653  
 21654  var _sqlite3DeleteColumnNamesØ00__func__Ø000 [25]int8
 21655  
 21656  func init() {
 21657  	crt.Xstrncpy(nil, &_sqlite3DeleteColumnNamesØ00__func__Ø000[0], str(21921), 25)
 21658  }
 21659  
 21660  // C comment
 21661  //  /*
 21662  //  ** Clear any and all virtual-table information from the Table record.
 21663  //  ** This routine is called, for example, just before deleting the Table
 21664  //  ** record.
 21665  //  **
 21666  //  ** Since it is a virtual-table, the Table structure contains a pointer
 21667  //  ** to the head of a linked list of VTable structures. Each VTable
 21668  //  ** structure is associated with a single sqlite3* user of the schema.
 21669  //  ** The reference count of the VTable structure associated with database
 21670  //  ** connection db is decremented immediately (which may lead to the
 21671  //  ** structure being xDisconnected and free). Any other VTable structures
 21672  //  ** in the list are moved to the sqlite3.pDisconnect list of the associated
 21673  //  ** database connection.
 21674  //  */
 21675  func _sqlite3VtabClear(tls *crt.TLS, _db *Xsqlite3, _p *XTable) {
 21676  	var _1_i int32
 21677  	if (_db == nil) || (_db.XpnBytesFreed == nil) {
 21678  		_vtabDisconnectAll(tls, nil, _p)
 21679  	}
 21680  	if _p.XazModuleArg == nil {
 21681  		goto _2
 21682  	}
 21683  	_1_i = int32(0)
 21684  _3:
 21685  	if _1_i >= _p.XnModuleArg {
 21686  		goto _6
 21687  	}
 21688  	if _1_i != int32(1) {
 21689  		_sqlite3DbFree(tls, _db, unsafe.Pointer(*elem0(_p.XazModuleArg, uintptr(_1_i))))
 21690  	}
 21691  	_1_i += 1
 21692  	goto _3
 21693  _6:
 21694  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_p.XazModuleArg))
 21695  _2:
 21696  }
 21697  
 21698  // C comment
 21699  //  /*
 21700  //  ** Table p is a virtual table. This function moves all elements in the
 21701  //  ** p->pVTable list to the sqlite3.pDisconnect lists of their associated
 21702  //  ** database connections to be disconnected at the next opportunity.
 21703  //  ** Except, if argument db is not NULL, then the entry associated with
 21704  //  ** connection db is left in the p->pVTable list.
 21705  //  */
 21706  func _vtabDisconnectAll(tls *crt.TLS, _db *Xsqlite3, _p *XTable) (r0 *XVTable) {
 21707  	var _1_db2 *Xsqlite3
 21708  	var _pRet, _pVTable, _1_pNext *XVTable
 21709  	_pRet = nil
 21710  	_pVTable = (*XVTable)(_p.XpVTable)
 21711  	*(**XVTable)(unsafe.Pointer(&_p.XpVTable)) = nil
 21712  	func() {
 21713  		if _db != nil && _sqlite3SchemaMutexHeld(tls, _db, int32(0), (*XSchema)(_p.XpSchema)) == 0 {
 21714  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125175), unsafe.Pointer(&_vtabDisconnectAllØ00__func__Ø000), unsafe.Pointer(str(21946)))
 21715  			crt.X__builtin_abort(tls)
 21716  		}
 21717  	}()
 21718  _3:
 21719  	if _pVTable == nil {
 21720  		goto _4
 21721  	}
 21722  	_1_db2 = (*Xsqlite3)(_pVTable.Xdb)
 21723  	_1_pNext = (*XVTable)(_pVTable.XpNext)
 21724  	func() {
 21725  		if _1_db2 == nil {
 21726  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125180), unsafe.Pointer(&_vtabDisconnectAllØ00__func__Ø000), unsafe.Pointer(str(21997)))
 21727  			crt.X__builtin_abort(tls)
 21728  		}
 21729  	}()
 21730  	if _1_db2 == _db {
 21731  		_pRet = _pVTable
 21732  		*(**XVTable)(unsafe.Pointer(&_p.XpVTable)) = _pRet
 21733  		*(**XVTable)(unsafe.Pointer(&_pRet.XpNext)) = nil
 21734  		goto _8
 21735  	}
 21736  	*(**XVTable)(unsafe.Pointer(&_pVTable.XpNext)) = (*XVTable)(_1_db2.XpDisconnect)
 21737  	*(**XVTable)(unsafe.Pointer(&_1_db2.XpDisconnect)) = _pVTable
 21738  _8:
 21739  	_pVTable = _1_pNext
 21740  	goto _3
 21741  _4:
 21742  	func() {
 21743  		if _db != nil && _pRet == nil {
 21744  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125192), unsafe.Pointer(&_vtabDisconnectAllØ00__func__Ø000), unsafe.Pointer(str(22001)))
 21745  			crt.X__builtin_abort(tls)
 21746  		}
 21747  	}()
 21748  	return _pRet
 21749  }
 21750  
 21751  var _vtabDisconnectAllØ00__func__Ø000 [18]int8
 21752  
 21753  func init() {
 21754  	crt.Xstrncpy(nil, &_vtabDisconnectAllØ00__func__Ø000[0], str(22013), 18)
 21755  }
 21756  
 21757  // C comment
 21758  //  /*
 21759  //  ** Delete an IdList.
 21760  //  */
 21761  func _sqlite3IdListDelete(tls *crt.TLS, _db *Xsqlite3, _pList *XIdList) {
 21762  	var _i int32
 21763  	if _pList == nil {
 21764  		return
 21765  	}
 21766  	_i = int32(0)
 21767  _1:
 21768  	if _i >= _pList.XnId {
 21769  		goto _4
 21770  	}
 21771  	_sqlite3DbFree(tls, _db, unsafe.Pointer(elem42((*TIdList_item)(_pList.Xa), uintptr(_i)).XzName))
 21772  	_i += 1
 21773  	goto _1
 21774  _4:
 21775  	_sqlite3DbFree(tls, _db, _pList.Xa)
 21776  	_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_pList))
 21777  }
 21778  
 21779  // C comment
 21780  //  /*
 21781  //  ** Free the contents of the With object passed as the second argument.
 21782  //  */
 21783  func _sqlite3WithDelete(tls *crt.TLS, _db *Xsqlite3, _pWith *XWith) {
 21784  	var _1_i int32
 21785  	var _2_pCte *TCte
 21786  	if _pWith == nil {
 21787  		goto _0
 21788  	}
 21789  	_1_i = int32(0)
 21790  _1:
 21791  	if _1_i >= _pWith.XnCte {
 21792  		goto _4
 21793  	}
 21794  	_2_pCte = elem43((*TCte)(unsafe.Pointer(&_pWith.Xa)), uintptr(_1_i))
 21795  	_sqlite3ExprListDelete(tls, _db, (*XExprList)(_2_pCte.XpCols))
 21796  	_sqlite3SelectDelete(tls, _db, (*XSelect)(_2_pCte.XpSelect))
 21797  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_2_pCte.XzName))
 21798  	_1_i += 1
 21799  	goto _1
 21800  _4:
 21801  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pWith))
 21802  _0:
 21803  }
 21804  
 21805  // C comment
 21806  //  /*
 21807  //  ** Look through the list of open database files in db->aDb[] and if
 21808  //  ** any have been closed, remove them from the list.  Reallocate the
 21809  //  ** db->aDb[] structure to a smaller size, if possible.
 21810  //  **
 21811  //  ** Entry 0 (the "main" database) and entry 1 (the "temp" database)
 21812  //  ** are never candidates for being collapsed.
 21813  //  */
 21814  func _sqlite3CollapseDatabaseArray(tls *crt.TLS, _db *Xsqlite3) {
 21815  	var _i, _j int32
 21816  	var _1_pDb *XDb
 21817  	_i = store2(&_j, int32(2))
 21818  _0:
 21819  	if _i >= _db.XnDb {
 21820  		goto _3
 21821  	}
 21822  	_1_pDb = elem27((*XDb)(_db.XaDb), uintptr(_i))
 21823  	if (*XBtree)(_1_pDb.XpBt) == nil {
 21824  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_1_pDb.XzDbSName))
 21825  		_1_pDb.XzDbSName = nil
 21826  		goto _1
 21827  	}
 21828  	if _j < _i {
 21829  		*elem27((*XDb)(_db.XaDb), uintptr(_j)) = *elem27((*XDb)(_db.XaDb), uintptr(_i))
 21830  	}
 21831  	_j += 1
 21832  _1:
 21833  	_i += 1
 21834  	goto _0
 21835  _3:
 21836  	_db.XnDb = _j
 21837  	if (_db.XnDb <= int32(2)) && ((*XDb)(_db.XaDb) != (*XDb)(unsafe.Pointer(&_db.XaDbStatic))) {
 21838  		crt.Xmemcpy(tls, unsafe.Pointer(&_db.XaDbStatic), _db.XaDb, uint32(32))
 21839  		_sqlite3DbFree(tls, _db, _db.XaDb)
 21840  		*(**XDb)(unsafe.Pointer(&_db.XaDb)) = (*XDb)(unsafe.Pointer(&_db.XaDbStatic))
 21841  	}
 21842  }
 21843  
 21844  // C comment
 21845  //  /*
 21846  //  ** Close all open savepoints. This function only manipulates fields of the
 21847  //  ** database handle object, it does not close any savepoints that may be open
 21848  //  ** at the b-tree/pager level.
 21849  //  */
 21850  func _sqlite3CloseSavepoints(tls *crt.TLS, _db *Xsqlite3) {
 21851  	var _1_pTmp *XSavepoint
 21852  _0:
 21853  	if _db.XpSavepoint != nil {
 21854  		_1_pTmp = (*XSavepoint)(_db.XpSavepoint)
 21855  		*(**XSavepoint)(unsafe.Pointer(&_db.XpSavepoint)) = (*XSavepoint)(_1_pTmp.XpNext)
 21856  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_1_pTmp))
 21857  		goto _0
 21858  	}
 21859  	_db.XnSavepoint = int32(0)
 21860  	_db.XnStatement = int32(0)
 21861  	_db.XisTransactionSavepoint = 0
 21862  }
 21863  
 21864  // C comment
 21865  //  /*
 21866  //  ** Close an open database and invalidate all cursors.
 21867  //  */
 21868  func _sqlite3BtreeClose(tls *crt.TLS, _p *XBtree) (r0 int32) {
 21869  	var _pBt *XBtShared
 21870  	var _pCur, _1_pTmp *XBtCursor
 21871  	_pBt = (*XBtShared)(_p.XpBt)
 21872  	func() {
 21873  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 21874  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61603), unsafe.Pointer(&_sqlite3BtreeCloseØ00__func__Ø000), unsafe.Pointer(str(8939)))
 21875  			crt.X__builtin_abort(tls)
 21876  		}
 21877  	}()
 21878  	_sqlite3BtreeEnter(tls, _p)
 21879  	_pCur = (*XBtCursor)(_pBt.XpCursor)
 21880  _2:
 21881  	if _pCur == nil {
 21882  		goto _3
 21883  	}
 21884  	_1_pTmp = _pCur
 21885  	_pCur = (*XBtCursor)(_pCur.XpNext)
 21886  	if (*XBtree)(_1_pTmp.XpBtree) == _p {
 21887  		_sqlite3BtreeCloseCursor(tls, _1_pTmp)
 21888  	}
 21889  	goto _2
 21890  _3:
 21891  	_sqlite3BtreeRollback(tls, _p, int32(0), int32(0))
 21892  	_sqlite3BtreeLeave(tls, _p)
 21893  	func() {
 21894  		if _p.XwantToLock != int32(0) || int32(_p.Xlocked) != int32(0) {
 21895  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61625), unsafe.Pointer(&_sqlite3BtreeCloseØ00__func__Ø000), unsafe.Pointer(str(22031)))
 21896  			crt.X__builtin_abort(tls)
 21897  		}
 21898  	}()
 21899  	if _p.Xsharable != 0 && _removeFromSharingList(tls, _pBt) == 0 {
 21900  		goto _9
 21901  	}
 21902  	func() {
 21903  		if _pBt.XpCursor != nil {
 21904  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61632), unsafe.Pointer(&_sqlite3BtreeCloseØ00__func__Ø000), unsafe.Pointer(str(22064)))
 21905  			crt.X__builtin_abort(tls)
 21906  		}
 21907  	}()
 21908  	_sqlite3PagerClose(tls, (*XPager)(_pBt.XpPager), (*Xsqlite3)(_p.Xdb))
 21909  	if (_pBt.XxFreeSchema != nil) && (_pBt.XpSchema != nil) {
 21910  		_pBt.XxFreeSchema(tls, _pBt.XpSchema)
 21911  	}
 21912  	_sqlite3DbFree(tls, nil, _pBt.XpSchema)
 21913  	_freeTempSpace(tls, _pBt)
 21914  	Xsqlite3_free(tls, unsafe.Pointer(_pBt))
 21915  _9:
 21916  	func() {
 21917  		if _p.XwantToLock != int32(0) {
 21918  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61643), unsafe.Pointer(&_sqlite3BtreeCloseØ00__func__Ø000), unsafe.Pointer(str(22078)))
 21919  			crt.X__builtin_abort(tls)
 21920  		}
 21921  	}()
 21922  	func() {
 21923  		if int32(_p.Xlocked) != int32(0) {
 21924  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61644), unsafe.Pointer(&_sqlite3BtreeCloseØ00__func__Ø000), unsafe.Pointer(str(9298)))
 21925  			crt.X__builtin_abort(tls)
 21926  		}
 21927  	}()
 21928  	if _p.XpPrev != nil {
 21929  		*(**XBtree)(unsafe.Pointer(&((*XBtree)(_p.XpPrev).XpNext))) = (*XBtree)(_p.XpNext)
 21930  	}
 21931  	if _p.XpNext != nil {
 21932  		*(**XBtree)(unsafe.Pointer(&((*XBtree)(_p.XpNext).XpPrev))) = (*XBtree)(_p.XpPrev)
 21933  	}
 21934  	Xsqlite3_free(tls, unsafe.Pointer(_p))
 21935  	return int32(0)
 21936  }
 21937  
 21938  var _sqlite3BtreeCloseØ00__func__Ø000 [18]int8
 21939  
 21940  func init() {
 21941  	crt.Xstrncpy(nil, &_sqlite3BtreeCloseØ00__func__Ø000[0], str(22095), 18)
 21942  }
 21943  
 21944  // C comment
 21945  //  /*
 21946  //  ** Close a cursor.  The read lock on the database file is released
 21947  //  ** when the last cursor is closed.
 21948  //  */
 21949  func _sqlite3BtreeCloseCursor(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 21950  	var _1_i int32
 21951  	var _pBtree *XBtree
 21952  	var _1_pBt *XBtShared
 21953  	var _3_pPrev *XBtCursor
 21954  	_pBtree = (*XBtree)(_pCur.XpBtree)
 21955  	if _pBtree == nil {
 21956  		goto _0
 21957  	}
 21958  	_1_pBt = (*XBtShared)(_pCur.XpBt)
 21959  	_sqlite3BtreeEnter(tls, _pBtree)
 21960  	_sqlite3BtreeClearCursor(tls, _pCur)
 21961  	func() {
 21962  		if (*XBtCursor)(_1_pBt.XpCursor) == nil {
 21963  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63317), unsafe.Pointer(&_sqlite3BtreeCloseCursorØ00__func__Ø000), unsafe.Pointer(str(22113)))
 21964  			crt.X__builtin_abort(tls)
 21965  		}
 21966  	}()
 21967  	if (*XBtCursor)(_1_pBt.XpCursor) == _pCur {
 21968  		*(**XBtCursor)(unsafe.Pointer(&_1_pBt.XpCursor)) = (*XBtCursor)(_pCur.XpNext)
 21969  		goto _4
 21970  	}
 21971  	_3_pPrev = (*XBtCursor)(_1_pBt.XpCursor)
 21972  _5:
 21973  	if (*XBtCursor)(_3_pPrev.XpNext) == _pCur {
 21974  		*(**XBtCursor)(unsafe.Pointer(&_3_pPrev.XpNext)) = (*XBtCursor)(_pCur.XpNext)
 21975  		goto _7
 21976  	}
 21977  	_3_pPrev = (*XBtCursor)(_3_pPrev.XpNext)
 21978  	if func() int32 {
 21979  		if _3_pPrev != nil {
 21980  			return int32(1)
 21981  		}
 21982  		return func() int32 {
 21983  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63328), unsafe.Pointer(&_sqlite3BtreeCloseCursorØ00__func__Ø000), unsafe.Pointer(str(4809)))
 21984  			crt.X__builtin_abort(tls)
 21985  			return int32(0)
 21986  		}()
 21987  	}() != 0 {
 21988  		goto _5
 21989  	}
 21990  _7:
 21991  _4:
 21992  	_1_i = int32(0)
 21993  _10:
 21994  	if _1_i > int32(_pCur.XiPage) {
 21995  		goto _13
 21996  	}
 21997  	_releasePage(tls, *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_1_i)))
 21998  	_1_i += 1
 21999  	goto _10
 22000  _13:
 22001  	_unlockBtreeIfUnused(tls, _1_pBt)
 22002  	Xsqlite3_free(tls, unsafe.Pointer(_pCur.XaOverflow))
 22003  	_sqlite3BtreeLeave(tls, _pBtree)
 22004  _0:
 22005  	return int32(0)
 22006  }
 22007  
 22008  var _sqlite3BtreeCloseCursorØ00__func__Ø000 [24]int8
 22009  
 22010  func init() {
 22011  	crt.Xstrncpy(nil, &_sqlite3BtreeCloseCursorØ00__func__Ø000[0], str(22129), 24)
 22012  }
 22013  
 22014  // C comment
 22015  //  /*
 22016  //  ** Decrement the BtShared.nRef counter.  When it reaches zero,
 22017  //  ** remove the BtShared structure from the sharing list.  Return
 22018  //  ** true if the BtShared.nRef counter reaches zero and return
 22019  //  ** false if it is still positive.
 22020  //  */
 22021  func _removeFromSharingList(tls *crt.TLS, _pBt *XBtShared) (r0 int32) {
 22022  	var _removed int32
 22023  	var _pMaster *Xsqlite3_mutex
 22024  	var _pList *XBtShared
 22025  	_removed = int32(0)
 22026  	func() {
 22027  		if Xsqlite3_mutex_notheld(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 22028  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61525), unsafe.Pointer(&_removeFromSharingListØ00__func__Ø000), unsafe.Pointer(str(22153)))
 22029  			crt.X__builtin_abort(tls)
 22030  		}
 22031  	}()
 22032  	_pMaster = _sqlite3MutexAlloc(tls, int32(2))
 22033  	Xsqlite3_mutex_enter(tls, _pMaster)
 22034  	_pBt.XnRef -= 1
 22035  	if _pBt.XnRef > int32(0) {
 22036  		goto _2
 22037  	}
 22038  	if _sqlite3SharedCacheList == _pBt {
 22039  		_sqlite3SharedCacheList = (*XBtShared)(_pBt.XpNext)
 22040  		bug20530(_sqlite3SharedCacheList)
 22041  		goto _4
 22042  	}
 22043  	_pList = _sqlite3SharedCacheList
 22044  _5:
 22045  	if func() int32 {
 22046  		if _pList != nil {
 22047  			return int32(1)
 22048  		}
 22049  		return func() int32 {
 22050  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61534), unsafe.Pointer(&_removeFromSharingListØ00__func__Ø000), unsafe.Pointer(str(4809)))
 22051  			crt.X__builtin_abort(tls)
 22052  			return int32(0)
 22053  		}()
 22054  	}() != 0 && ((*XBtShared)(_pList.XpNext) != _pBt) {
 22055  		_pList = (*XBtShared)(_pList.XpNext)
 22056  		goto _5
 22057  	}
 22058  	if func() int32 {
 22059  		if _pList != nil {
 22060  			return int32(1)
 22061  		}
 22062  		return func() int32 {
 22063  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61537), unsafe.Pointer(&_removeFromSharingListØ00__func__Ø000), unsafe.Pointer(str(4809)))
 22064  			crt.X__builtin_abort(tls)
 22065  			return int32(0)
 22066  		}()
 22067  	}() != 0 {
 22068  		*(**XBtShared)(unsafe.Pointer(&_pList.XpNext)) = (*XBtShared)(_pBt.XpNext)
 22069  	}
 22070  _4:
 22071  	Xsqlite3_mutex_free(tls, (*Xsqlite3_mutex)(_pBt.Xmutex))
 22072  	_removed = int32(1)
 22073  _2:
 22074  	Xsqlite3_mutex_leave(tls, _pMaster)
 22075  	return _removed
 22076  }
 22077  
 22078  var _removeFromSharingListØ00__func__Ø000 [22]int8
 22079  
 22080  func init() {
 22081  	crt.Xstrncpy(nil, &_removeFromSharingListØ00__func__Ø000[0], str(22187), 22)
 22082  }
 22083  
 22084  var _sqlite3SharedCacheList *XBtShared
 22085  
 22086  // C comment
 22087  //  /*
 22088  //  ** Free a dynamic mutex.
 22089  //  */
 22090  func Xsqlite3_mutex_free(tls *crt.TLS, _p *Xsqlite3_mutex) {
 22091  	if _p != nil {
 22092  		func() {
 22093  			if (_sqlite3Config.Xmutex.XxMutexFree) == nil {
 22094  				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)))
 22095  				crt.X__builtin_abort(tls)
 22096  			}
 22097  		}()
 22098  		func() func(*crt.TLS, *Xsqlite3_mutex) {
 22099  			v := _sqlite3Config.Xmutex.XxMutexFree
 22100  			return *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&v))
 22101  		}()(tls, _p)
 22102  	}
 22103  }
 22104  
 22105  var _sqlite3_mutex_freeØ00__func__Ø000 [19]int8
 22106  
 22107  func init() {
 22108  	crt.Xstrncpy(nil, &_sqlite3_mutex_freeØ00__func__Ø000[0], str(22246), 19)
 22109  }
 22110  
 22111  // C comment
 22112  //  /*
 22113  //  ** Shutdown the page cache.  Free all memory and close all files.
 22114  //  **
 22115  //  ** If a transaction was in progress when this routine is called, that
 22116  //  ** transaction is rolled back.  All outstanding pages are invalidated
 22117  //  ** and their memory is freed.  Any attempt to use a page associated
 22118  //  ** with this page cache after this function returns will likely
 22119  //  ** result in a coredump.
 22120  //  **
 22121  //  ** This function always succeeds. If a transaction is active an attempt
 22122  //  ** is made to roll it back. If an error occurs during the rollback
 22123  //  ** a hot journal may be left in the filesystem but no error is returned
 22124  //  ** to the caller.
 22125  //  */
 22126  func _sqlite3PagerClose(tls *crt.TLS, _pPager *XPager, _db *Xsqlite3) (r0 int32) {
 22127  	var _pTmp *uint8
 22128  	_pTmp = (*uint8)(unsafe.Pointer(_pPager.XpTmpSpace))
 22129  	func() {
 22130  		if _db == nil && bool2int((*XWal)(_pPager.XpWal) != nil) != int32(0) {
 22131  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51012), unsafe.Pointer(&_sqlite3PagerCloseØ00__func__Ø000), unsafe.Pointer(str(22265)))
 22132  			crt.X__builtin_abort(tls)
 22133  		}
 22134  	}()
 22135  	func() {
 22136  		if _assert_pager_state(tls, _pPager) == 0 {
 22137  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51013), unsafe.Pointer(&_sqlite3PagerCloseØ00__func__Ø000), unsafe.Pointer(str(10971)))
 22138  			crt.X__builtin_abort(tls)
 22139  		}
 22140  	}()
 22141  	_sqlite3BeginBenignMalloc(tls)
 22142  	_pagerFreeMapHdrs(tls, _pPager)
 22143  	_pPager.XexclusiveMode = 0
 22144  	func() {
 22145  		if _db == nil && (*XWal)(_pPager.XpWal) != nil {
 22146  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51020), unsafe.Pointer(&_sqlite3PagerCloseØ00__func__Ø000), unsafe.Pointer(str(22294)))
 22147  			crt.X__builtin_abort(tls)
 22148  		}
 22149  	}()
 22150  	_sqlite3WalClose(tls, (*XWal)(_pPager.XpWal), _db, int32(_pPager.XckptSyncFlags), _pPager.XpageSize, func() *uint8 {
 22151  		if (_db != nil) && ((uint32(_db.Xflags) & uint32(2147483648)) != 0) {
 22152  			return nil
 22153  		}
 22154  		return _pTmp
 22155  	}())
 22156  	*(**XWal)(unsafe.Pointer(&_pPager.XpWal)) = nil
 22157  	_pager_reset(tls, _pPager)
 22158  	if _pPager.XmemDb != 0 {
 22159  		_pager_unlock(tls, _pPager)
 22160  		goto _12
 22161  	}
 22162  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) != nil {
 22163  		_pager_error(tls, _pPager, _pagerSyncHotJournal(tls, _pPager))
 22164  	}
 22165  	_pagerUnlockAndRollback(tls, _pPager)
 22166  _12:
 22167  	_sqlite3EndBenignMalloc(tls)
 22168  	_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.Xjfd))
 22169  	_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.Xfd))
 22170  	_sqlite3PageFree(tls, unsafe.Pointer(_pTmp))
 22171  	_sqlite3PcacheClose(tls, (*XPCache)(_pPager.XpPCache))
 22172  	func() {
 22173  		if _pPager.XaSavepoint != nil || _pPager.XpInJournal != nil {
 22174  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51059), unsafe.Pointer(&_sqlite3PagerCloseØ00__func__Ø000), unsafe.Pointer(str(22316)))
 22175  			crt.X__builtin_abort(tls)
 22176  		}
 22177  	}()
 22178  	func() {
 22179  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) != nil || (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xsjfd).XpMethods) != nil {
 22180  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51060), unsafe.Pointer(&_sqlite3PagerCloseØ00__func__Ø000), unsafe.Pointer(str(22359)))
 22181  			crt.X__builtin_abort(tls)
 22182  		}
 22183  	}()
 22184  	Xsqlite3_free(tls, unsafe.Pointer(_pPager))
 22185  	return int32(0)
 22186  }
 22187  
 22188  var _sqlite3PagerCloseØ00__func__Ø000 [18]int8
 22189  
 22190  func init() {
 22191  	crt.Xstrncpy(nil, &_sqlite3PagerCloseØ00__func__Ø000[0], str(22405), 18)
 22192  }
 22193  
 22194  // C comment
 22195  //  /*
 22196  //  ** Free all PgHdr objects stored in the Pager.pMmapFreelist list.
 22197  //  */
 22198  func _pagerFreeMapHdrs(tls *crt.TLS, _pPager *XPager) {
 22199  	var _p, _pNext *XPgHdr
 22200  	_p = (*XPgHdr)(_pPager.XpMmapFreelist)
 22201  _0:
 22202  	if _p == nil {
 22203  		goto _3
 22204  	}
 22205  	_pNext = (*XPgHdr)(_p.XpDirty)
 22206  	Xsqlite3_free(tls, unsafe.Pointer(_p))
 22207  	_p = _pNext
 22208  	goto _0
 22209  _3:
 22210  }
 22211  
 22212  // C comment
 22213  //  /*
 22214  //  ** Close a connection to a log file.
 22215  //  */
 22216  func _sqlite3WalClose(tls *crt.TLS, _pWal *XWal, _db *Xsqlite3, _sync_flags int32, _nBuf int32, _zBuf *uint8) (r0 int32) {
 22217  	var _rc, _1_isDelete, _4_bPersist int32
 22218  	_rc = int32(0)
 22219  	if _pWal == nil {
 22220  		goto _0
 22221  	}
 22222  	_1_isDelete = int32(0)
 22223  	if _zBuf == nil || int32(0) != store2(&_rc, _sqlite3OsLock(tls, (*Xsqlite3_file)(_pWal.XpDbFd), int32(4))) {
 22224  		goto _2
 22225  	}
 22226  	if int32(_pWal.XexclusiveMode) == int32(0) {
 22227  		_pWal.XexclusiveMode = uint8(1)
 22228  	}
 22229  	_rc = _sqlite3WalCheckpoint(tls, _pWal, _db, int32(0), nil, nil, _sync_flags, _nBuf, _zBuf, nil, nil)
 22230  	if _rc != int32(0) {
 22231  		goto _4
 22232  	}
 22233  	_4_bPersist = int32(-1)
 22234  	_sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pWal.XpDbFd), int32(10), unsafe.Pointer(&_4_bPersist))
 22235  	if _4_bPersist != int32(1) {
 22236  		_1_isDelete = int32(1)
 22237  		goto _7
 22238  	}
 22239  	if _pWal.XmxWalSize >= (0) {
 22240  		_walLimitSize(tls, _pWal, 0)
 22241  	}
 22242  _7:
 22243  _4:
 22244  _2:
 22245  	_walIndexClose(tls, _pWal, _1_isDelete)
 22246  	_sqlite3OsClose(tls, (*Xsqlite3_file)(_pWal.XpWalFd))
 22247  	if _1_isDelete != 0 {
 22248  		_sqlite3BeginBenignMalloc(tls)
 22249  		_sqlite3OsDelete(tls, (*Xsqlite3_vfs)(_pWal.XpVfs), _pWal.XzWalName, int32(0))
 22250  		_sqlite3EndBenignMalloc(tls)
 22251  	}
 22252  	Xsqlite3_free(tls, unsafe.Pointer(_pWal.XapWiData))
 22253  	Xsqlite3_free(tls, unsafe.Pointer(_pWal))
 22254  _0:
 22255  	return _rc
 22256  }
 22257  
 22258  func _sqlite3OsLock(tls *crt.TLS, _id *Xsqlite3_file, _lockType int32) (r0 int32) {
 22259  	return func() func(*crt.TLS, *Xsqlite3_file, int32) int32 {
 22260  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxLock
 22261  		return *(*func(*crt.TLS, *Xsqlite3_file, int32) int32)(unsafe.Pointer(&v))
 22262  	}()(tls, _id, _lockType)
 22263  }
 22264  
 22265  // C comment
 22266  //  /*
 22267  //  ** This routine is called to implement sqlite3_wal_checkpoint() and
 22268  //  ** related interfaces.
 22269  //  **
 22270  //  ** Obtain a CHECKPOINT lock and then backfill as much information as
 22271  //  ** we can from WAL into the database.
 22272  //  **
 22273  //  ** If parameter xBusy is not NULL, it is a pointer to a busy-handler
 22274  //  ** callback. In this case this function runs a blocking checkpoint.
 22275  //  */
 22276  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) {
 22277  	var _rc, _isChanged, _eMode2 int32
 22278  	var _xBusy2 func(*crt.TLS, unsafe.Pointer) int32
 22279  	_isChanged = int32(0)
 22280  	_eMode2 = _eMode
 22281  	_xBusy2 = _xBusy
 22282  	func() {
 22283  		if int32(_pWal.XckptLock) != int32(0) {
 22284  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57774), unsafe.Pointer(&_sqlite3WalCheckpointØ00__func__Ø000), unsafe.Pointer(str(22423)))
 22285  			crt.X__builtin_abort(tls)
 22286  		}
 22287  	}()
 22288  	func() {
 22289  		if int32(_pWal.XwriteLock) != int32(0) {
 22290  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57775), unsafe.Pointer(&_sqlite3WalCheckpointØ00__func__Ø000), unsafe.Pointer(str(19034)))
 22291  			crt.X__builtin_abort(tls)
 22292  		}
 22293  	}()
 22294  	func() {
 22295  		if _eMode == int32(0) && _xBusy != nil {
 22296  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57779), unsafe.Pointer(&_sqlite3WalCheckpointØ00__func__Ø000), unsafe.Pointer(str(22441)))
 22297  			crt.X__builtin_abort(tls)
 22298  		}
 22299  	}()
 22300  	if _pWal.XreadOnly != 0 {
 22301  		return int32(8)
 22302  	}
 22303  	_rc = _walLockExclusive(tls, _pWal, int32(1), int32(1))
 22304  	if _rc != 0 {
 22305  		return _rc
 22306  	}
 22307  	_pWal.XckptLock = uint8(1)
 22308  	if _eMode == int32(0) {
 22309  		goto _9
 22310  	}
 22311  	_rc = _walBusyLock(tls, _pWal, _xBusy, _pBusyArg, int32(0), int32(1))
 22312  	if _rc == int32(0) {
 22313  		_pWal.XwriteLock = uint8(1)
 22314  		goto _12
 22315  	}
 22316  	if _rc == int32(5) {
 22317  		_eMode2 = int32(0)
 22318  		_xBusy2 = nil
 22319  		_rc = int32(0)
 22320  	}
 22321  _12:
 22322  _9:
 22323  	if _rc != int32(0) {
 22324  		goto _13
 22325  	}
 22326  	_rc = _walIndexReadHdr(tls, _pWal, &_isChanged)
 22327  	if _isChanged != 0 && (((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pWal.XpDbFd).XpMethods).XiVersion) >= int32(3)) {
 22328  		_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pWal.XpDbFd), 0, nil)
 22329  	}
 22330  _13:
 22331  	if _rc != int32(0) {
 22332  		goto _16
 22333  	}
 22334  	if ((_pWal.Xhdr.XmxFrame) != 0) && (_walPagesize(tls, _pWal) != _nBuf) {
 22335  		_rc = _sqlite3CorruptError(tls, int32(57832))
 22336  		goto _19
 22337  	}
 22338  	_rc = _walCheckpoint(tls, _pWal, _db, _eMode2, _xBusy2, _pBusyArg, _sync_flags, _zBuf)
 22339  _19:
 22340  	if _rc != int32(0) && _rc != int32(5) {
 22341  		goto _21
 22342  	}
 22343  	if _pnLog != nil {
 22344  		*_pnLog = int32(_pWal.Xhdr.XmxFrame)
 22345  	}
 22346  	if _pnCkpt != nil {
 22347  		*_pnCkpt = int32(_walCkptInfo(tls, _pWal).XnBackfill)
 22348  	}
 22349  _21:
 22350  _16:
 22351  	if _isChanged != 0 {
 22352  		crt.Xmemset(tls, unsafe.Pointer(&_pWal.Xhdr), int32(0), uint32(48))
 22353  	}
 22354  	_sqlite3WalEndWriteTransaction(tls, _pWal)
 22355  	_walUnlockExclusive(tls, _pWal, int32(1), int32(1))
 22356  	_pWal.XckptLock = 0
 22357  	return func() int32 {
 22358  		if (_rc == int32(0)) && (_eMode != _eMode2) {
 22359  			return int32(5)
 22360  		}
 22361  		return _rc
 22362  	}()
 22363  }
 22364  
 22365  var _sqlite3WalCheckpointØ00__func__Ø000 [21]int8
 22366  
 22367  func init() {
 22368  	crt.Xstrncpy(nil, &_sqlite3WalCheckpointØ00__func__Ø000[0], str(22486), 21)
 22369  }
 22370  
 22371  func _walLockExclusive(tls *crt.TLS, _pWal *XWal, _lockIdx int32, _n int32) (r0 int32) {
 22372  	var _rc int32
 22373  	if _pWal.XexclusiveMode != 0 {
 22374  		return int32(0)
 22375  	}
 22376  	_rc = _sqlite3OsShmLock(tls, (*Xsqlite3_file)(_pWal.XpDbFd), _lockIdx, _n, int32(10))
 22377  	_pWal.XlockError = uint8(bool2int((_rc != int32(0)) && (_rc != int32(5))))
 22378  	return _rc
 22379  }
 22380  
 22381  // C comment
 22382  //  /*
 22383  //  ** Attempt to obtain the exclusive WAL lock defined by parameters lockIdx and
 22384  //  ** n. If the attempt fails and parameter xBusy is not NULL, then it is a
 22385  //  ** busy-handler function. Invoke it and retry the lock until either the
 22386  //  ** lock is successfully obtained or the busy-handler returns 0.
 22387  //  */
 22388  func _walBusyLock(tls *crt.TLS, _pWal *XWal, _xBusy func(*crt.TLS, unsafe.Pointer) int32, _pBusyArg unsafe.Pointer, _lockIdx int32, _n int32) (r0 int32) {
 22389  	var _rc int32
 22390  _0:
 22391  	_rc = _walLockExclusive(tls, _pWal, _lockIdx, _n)
 22392  	if ((_xBusy != nil) && (_rc == int32(5))) && _xBusy(tls, _pBusyArg) != 0 {
 22393  		goto _0
 22394  	}
 22395  	return _rc
 22396  }
 22397  
 22398  // C comment
 22399  //  /*
 22400  //  ** Read the wal-index header from the wal-index and into pWal->hdr.
 22401  //  ** If the wal-header appears to be corrupt, try to reconstruct the
 22402  //  ** wal-index from the WAL before returning.
 22403  //  **
 22404  //  ** Set *pChanged to 1 if the wal-index header value in pWal->hdr is
 22405  //  ** changed by this operation.  If pWal->hdr is unchanged, set *pChanged
 22406  //  ** to 0.
 22407  //  **
 22408  //  ** If the wal-index header is successfully read, return SQLITE_OK.
 22409  //  ** Otherwise an SQLite error code.
 22410  //  */
 22411  func _walIndexReadHdr(tls *crt.TLS, _pWal *XWal, _pChanged *int32) (r0 int32) {
 22412  	var _rc, _badHdr int32
 22413  	var _page0 *uint32
 22414  	func() {
 22415  		if _pChanged == nil {
 22416  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56550), unsafe.Pointer(&_walIndexReadHdrØ00__func__Ø000), unsafe.Pointer(str(22507)))
 22417  			crt.X__builtin_abort(tls)
 22418  		}
 22419  	}()
 22420  	_rc = _walIndexPage(tls, _pWal, int32(0), &_page0)
 22421  	if _rc != int32(0) {
 22422  		return _rc
 22423  	}
 22424  	func() {
 22425  		if _page0 == nil && int32(_pWal.XwriteLock) != int32(0) {
 22426  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56555), unsafe.Pointer(&_walIndexReadHdrØ00__func__Ø000), unsafe.Pointer(str(22516)))
 22427  			crt.X__builtin_abort(tls)
 22428  		}
 22429  	}()
 22430  	_badHdr = func() int32 {
 22431  		if _page0 != nil {
 22432  			return _walIndexTryHdr(tls, _pWal, _pChanged)
 22433  		}
 22434  		return int32(1)
 22435  	}()
 22436  	func() {
 22437  		if _badHdr != int32(0) && int32(_pWal.XwriteLock) != int32(0) {
 22438  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56567), unsafe.Pointer(&_walIndexReadHdrØ00__func__Ø000), unsafe.Pointer(str(22544)))
 22439  			crt.X__builtin_abort(tls)
 22440  		}
 22441  	}()
 22442  	if _badHdr == 0 {
 22443  		goto _11
 22444  	}
 22445  	if (int32(_pWal.XreadOnly) & int32(2)) == 0 {
 22446  		goto _12
 22447  	}
 22448  	if int32(0) == store2(&_rc, _walLockShared(tls, _pWal, int32(0))) {
 22449  		_walUnlockShared(tls, _pWal, int32(0))
 22450  		_rc = int32(264)
 22451  	}
 22452  	goto _15
 22453  _12:
 22454  	if int32(0) != store2(&_rc, _walLockExclusive(tls, _pWal, int32(0), int32(1))) {
 22455  		goto _15
 22456  	}
 22457  	_pWal.XwriteLock = uint8(1)
 22458  	if int32(0) != store2(&_rc, _walIndexPage(tls, _pWal, int32(0), &_page0)) {
 22459  		goto _16
 22460  	}
 22461  	_badHdr = _walIndexTryHdr(tls, _pWal, _pChanged)
 22462  	if _badHdr != 0 {
 22463  		_rc = _walIndexRecover(tls, _pWal)
 22464  		*_pChanged = int32(1)
 22465  	}
 22466  _16:
 22467  	_pWal.XwriteLock = 0
 22468  	_walUnlockExclusive(tls, _pWal, int32(0), int32(1))
 22469  _15:
 22470  _11:
 22471  	if (_badHdr == int32(0)) && ((_pWal.Xhdr.XiVersion) != uint32(3007000)) {
 22472  		_rc = _sqlite3CantopenError(tls, int32(56597))
 22473  	}
 22474  	return _rc
 22475  }
 22476  
 22477  var _walIndexReadHdrØ00__func__Ø000 [16]int8
 22478  
 22479  func init() {
 22480  	crt.Xstrncpy(nil, &_walIndexReadHdrØ00__func__Ø000[0], str(22576), 16)
 22481  }
 22482  
 22483  // C comment
 22484  //  /*
 22485  //  ** Try to read the wal-index header.  Return 0 on success and 1 if
 22486  //  ** there is a problem.
 22487  //  **
 22488  //  ** The wal-index is in shared memory.  Another thread or process might
 22489  //  ** be writing the header at the same time this procedure is trying to
 22490  //  ** read it, which might result in inconsistency.  A dirty read is detected
 22491  //  ** by verifying that both copies of the header are the same and also by
 22492  //  ** a checksum on the header.
 22493  //  **
 22494  //  ** If and only if the read is consistent and the header is different from
 22495  //  ** pWal->hdr, then pWal->hdr is updated to the content of the new header
 22496  //  ** and *pChanged is set to 1.
 22497  //  **
 22498  //  ** If the checksum cannot be verified return non-zero. If the header
 22499  //  ** is read successfully and the checksum verified, return zero.
 22500  //  */
 22501  func _walIndexTryHdr(tls *crt.TLS, _pWal *XWal, _pChanged *int32) (r0 int32) {
 22502  	var _aCksum [2]uint32
 22503  	var _h1, _h2 XWalIndexHdr
 22504  	var _aHdr *XWalIndexHdr
 22505  	func() {
 22506  		if _pWal.XnWiData <= int32(0) || (*elem36(_pWal.XapWiData, 0)) == nil {
 22507  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56490), unsafe.Pointer(&_walIndexTryHdrØ00__func__Ø000), unsafe.Pointer(str(15226)))
 22508  			crt.X__builtin_abort(tls)
 22509  		}
 22510  	}()
 22511  	_aHdr = _walIndexHdr(tls, _pWal)
 22512  	crt.Xmemcpy(tls, unsafe.Pointer(&_h1), unsafe.Pointer(elem44(_aHdr, 0)), uint32(48))
 22513  	_walShmBarrier(tls, _pWal)
 22514  	crt.Xmemcpy(tls, unsafe.Pointer(&_h2), unsafe.Pointer(elem44(_aHdr, uintptr(1))), uint32(48))
 22515  	if crt.Xmemcmp(tls, unsafe.Pointer(&_h1), unsafe.Pointer(&_h2), uint32(48)) != int32(0) {
 22516  		return int32(1)
 22517  	}
 22518  	if int32(_h1.XisInit) == int32(0) {
 22519  		return int32(1)
 22520  	}
 22521  	_walChecksumBytes(tls, int32(1), (*uint8)(unsafe.Pointer(&_h1)), int32(40), nil, (*uint32)(unsafe.Pointer(&_aCksum)))
 22522  	if ((*elem7((*uint32)(unsafe.Pointer(&_aCksum)), 0)) != (*elem7((*uint32)(unsafe.Pointer(&_h1.XaCksum)), 0))) || ((*elem7((*uint32)(unsafe.Pointer(&_aCksum)), uintptr(1))) != (*elem7((*uint32)(unsafe.Pointer(&_h1.XaCksum)), uintptr(1)))) {
 22523  		return int32(1)
 22524  	}
 22525  	if crt.Xmemcmp(tls, unsafe.Pointer(&_pWal.Xhdr), unsafe.Pointer(&_h1), uint32(48)) != 0 {
 22526  		*_pChanged = int32(1)
 22527  		crt.Xmemcpy(tls, unsafe.Pointer(&_pWal.Xhdr), unsafe.Pointer(&_h1), uint32(48))
 22528  		_pWal.XszPage = uint32((int32(_pWal.Xhdr.XszPage) & int32(65024)) + ((int32(_pWal.Xhdr.XszPage) & int32(1)) << 16))
 22529  	}
 22530  	return int32(0)
 22531  
 22532  	_ = _aCksum
 22533  	_ = _h2
 22534  	panic(0)
 22535  }
 22536  
 22537  var _walIndexTryHdrØ00__func__Ø000 [15]int8
 22538  
 22539  func init() {
 22540  	crt.Xstrncpy(nil, &_walIndexTryHdrØ00__func__Ø000[0], str(22592), 15)
 22541  }
 22542  
 22543  func _walShmBarrier(tls *crt.TLS, _pWal *XWal) {
 22544  	if int32(_pWal.XexclusiveMode) != int32(2) {
 22545  		_sqlite3OsShmBarrier(tls, (*Xsqlite3_file)(_pWal.XpDbFd))
 22546  	}
 22547  }
 22548  
 22549  func _sqlite3OsShmBarrier(tls *crt.TLS, _id *Xsqlite3_file) {
 22550  	func() func(*crt.TLS, *Xsqlite3_file) {
 22551  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxShmBarrier
 22552  		return *(*func(*crt.TLS, *Xsqlite3_file))(unsafe.Pointer(&v))
 22553  	}()(tls, _id)
 22554  }
 22555  
 22556  // C comment
 22557  //  /*
 22558  //  ** Generate or extend an 8 byte checksum based on the data in
 22559  //  ** array aByte[] and the initial values of aIn[0] and aIn[1] (or
 22560  //  ** initial values of 0 and 0 if aIn==NULL).
 22561  //  **
 22562  //  ** The checksum is written back into aOut[] before returning.
 22563  //  **
 22564  //  ** nByte must be a positive multiple of 8.
 22565  //  */
 22566  func _walChecksumBytes(tls *crt.TLS, _nativeCksum int32, _a *uint8, _nByte int32, _aIn *uint32, _aOut *uint32) {
 22567  	var _s1, _s2 uint32
 22568  	var _aData, _aEnd *uint32
 22569  	_aData = (*uint32)(unsafe.Pointer(_a))
 22570  	_aEnd = (*uint32)(unsafe.Pointer(elem15(_a, uintptr(_nByte))))
 22571  	if _aIn != nil {
 22572  		_s1 = *elem7(_aIn, 0)
 22573  		_s2 = *elem7(_aIn, uintptr(1))
 22574  		goto _1
 22575  	}
 22576  	_s1 = store23(&_s2, 0)
 22577  _1:
 22578  	func() {
 22579  		if _nByte < int32(8) {
 22580  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55109), unsafe.Pointer(&_walChecksumBytesØ00__func__Ø000), unsafe.Pointer(str(22607)))
 22581  			crt.X__builtin_abort(tls)
 22582  		}
 22583  	}()
 22584  	func() {
 22585  		if (_nByte & int32(7)) != int32(0) {
 22586  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55110), unsafe.Pointer(&_walChecksumBytesØ00__func__Ø000), unsafe.Pointer(str(22616)))
 22587  			crt.X__builtin_abort(tls)
 22588  		}
 22589  	}()
 22590  	if _nativeCksum == 0 {
 22591  		goto _6
 22592  	}
 22593  _7:
 22594  	_s1 += (*postInc7(&_aData, 4)) + _s2
 22595  	_s2 += (*postInc7(&_aData, 4)) + _s1
 22596  	if crt.P2U(unsafe.Pointer(_aData)) < crt.P2U(unsafe.Pointer(_aEnd)) {
 22597  		goto _7
 22598  	}
 22599  	goto _8
 22600  _6:
 22601  _9:
 22602  	_s1 += ((((((*elem7(_aData, 0)) & uint32(255)) << 24) + (((*elem7(_aData, 0)) & uint32(65280)) << 8)) + (((*elem7(_aData, 0)) & uint32(16711680)) >> 8)) + (((*elem7(_aData, 0)) & uint32(4278190080)) >> 24)) + _s2
 22603  	_s2 += ((((((*elem7(_aData, uintptr(1))) & uint32(255)) << 24) + (((*elem7(_aData, uintptr(1))) & uint32(65280)) << 8)) + (((*elem7(_aData, uintptr(1))) & uint32(16711680)) >> 8)) + (((*elem7(_aData, uintptr(1))) & uint32(4278190080)) >> 24)) + _s1
 22604  	*(*uintptr)(unsafe.Pointer(&_aData)) += 4 * uintptr(int32(2))
 22605  	if crt.P2U(unsafe.Pointer(_aData)) < crt.P2U(unsafe.Pointer(_aEnd)) {
 22606  		goto _9
 22607  	}
 22608  _8:
 22609  	*elem7(_aOut, 0) = _s1
 22610  	*elem7(_aOut, uintptr(1)) = _s2
 22611  }
 22612  
 22613  var _walChecksumBytesØ00__func__Ø000 [17]int8
 22614  
 22615  func init() {
 22616  	crt.Xstrncpy(nil, &_walChecksumBytesØ00__func__Ø000[0], str(22638), 17)
 22617  }
 22618  
 22619  // C comment
 22620  //  /*
 22621  //  ** Recover the wal-index by reading the write-ahead log file.
 22622  //  **
 22623  //  ** This routine first tries to establish an exclusive lock on the
 22624  //  ** wal-index to prevent other threads/processes from doing anything
 22625  //  ** with the WAL or wal-index while recovery is running.  The
 22626  //  ** WAL_RECOVER_LOCK is also held so that other threads will know
 22627  //  ** that this thread is running recovery.  If unable to establish
 22628  //  ** the necessary locks, this routine returns SQLITE_BUSY.
 22629  //  */
 22630  func _walIndexRecover(tls *crt.TLS, _pWal *XWal) (r0 int32) {
 22631  	var _rc, _iLock, _nLock, _3_szFrame, _3_iFrame, _3_szPage, _3_isValid, _11_i int32
 22632  	var _nSize, _3_iOffset int64
 22633  	var _3_magic, _3_version, _9_pgno, _9_nTruncate uint32
 22634  	var _3_aFrame, _3_aData *uint8
 22635  	var _3_aBuf [32]uint8
 22636  	var _aFrameCksum [2]uint32
 22637  	var _11_pInfo *XWalCkptInfo
 22638  	_aFrameCksum = [2]uint32{}
 22639  	func() {
 22640  		if int32(_pWal.XckptLock) != int32(1) && int32(_pWal.XckptLock) != int32(0) {
 22641  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55574), unsafe.Pointer(&_walIndexRecoverØ00__func__Ø000), unsafe.Pointer(str(22655)))
 22642  			crt.X__builtin_abort(tls)
 22643  		}
 22644  	}()
 22645  
 22646  	func() {
 22647  		if _pWal.XwriteLock == 0 {
 22648  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55577), unsafe.Pointer(&_walIndexRecoverØ00__func__Ø000), unsafe.Pointer(str(15561)))
 22649  			crt.X__builtin_abort(tls)
 22650  		}
 22651  	}()
 22652  	_iLock = int32(1) + int32(_pWal.XckptLock)
 22653  	_nLock = int32(8) - _iLock
 22654  	_rc = _walLockExclusive(tls, _pWal, _iLock, _nLock)
 22655  	if _rc != 0 {
 22656  		return _rc
 22657  	}
 22658  	crt.Xmemset(tls, unsafe.Pointer(&_pWal.Xhdr), int32(0), uint32(48))
 22659  	_rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pWal.XpWalFd), &_nSize)
 22660  	if _rc != int32(0) {
 22661  		goto _recovery_error
 22662  	}
 22663  	if _nSize <= int64(32) {
 22664  		goto _finished
 22665  	}
 22666  	_3_aFrame = nil
 22667  	_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.XpWalFd), unsafe.Pointer(&_3_aBuf), int32(32), 0)
 22668  	if _rc != int32(0) {
 22669  		goto _recovery_error
 22670  	}
 22671  	_3_magic = _sqlite3Get4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_aBuf)), 0))
 22672  	_3_szPage = int32(_sqlite3Get4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_aBuf)), uintptr(8))))
 22673  	if ((((_3_magic & uint32(4294967294)) != uint32(931071618)) || (_3_szPage&(_3_szPage-int32(1))) != 0) || (_3_szPage > int32(65536))) || (_3_szPage < int32(512)) {
 22674  		goto _finished
 22675  	}
 22676  	_pWal.Xhdr.XbigEndCksum = uint8(_3_magic & uint32(1))
 22677  	_pWal.XszPage = uint32(_3_szPage)
 22678  	_pWal.XnCkpt = _sqlite3Get4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_aBuf)), uintptr(12)))
 22679  	crt.Xmemcpy(tls, unsafe.Pointer(&(_pWal.Xhdr.XaSalt)), unsafe.Pointer(elem15((*uint8)(unsafe.Pointer(&_3_aBuf)), uintptr(16))), uint32(8))
 22680  	_walChecksumBytes(tls, bool2int(int32(_pWal.Xhdr.XbigEndCksum) == int32(0)), (*uint8)(unsafe.Pointer(&_3_aBuf)), int32(24), nil, (*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))))
 22681  	if ((*elem7((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), 0)) != _sqlite3Get4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_aBuf)), uintptr(24)))) || ((*elem7((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), uintptr(1))) != _sqlite3Get4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_aBuf)), uintptr(28)))) {
 22682  		goto _finished
 22683  	}
 22684  	_3_version = _sqlite3Get4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_aBuf)), uintptr(4)))
 22685  	if _3_version != uint32(3007000) {
 22686  		_rc = _sqlite3CantopenError(tls, int32(55644))
 22687  		goto _finished
 22688  	}
 22689  	_3_szFrame = _3_szPage + int32(24)
 22690  	_3_aFrame = (*uint8)(Xsqlite3_malloc64(tls, uint64(_3_szFrame)))
 22691  	if _3_aFrame == nil {
 22692  		_rc = _sqlite3NomemError(tls, int32(55652))
 22693  		goto _recovery_error
 22694  	}
 22695  	_3_aData = elem15(_3_aFrame, uintptr(24))
 22696  	_3_iFrame = int32(0)
 22697  	_3_iOffset = int64(32)
 22698  _17:
 22699  	if (_3_iOffset + int64(_3_szFrame)) > _nSize {
 22700  		goto _20
 22701  	}
 22702  	_3_iFrame += 1
 22703  	_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.XpWalFd), unsafe.Pointer(_3_aFrame), _3_szFrame, _3_iOffset)
 22704  	if _rc != int32(0) {
 22705  		goto _20
 22706  	}
 22707  	_3_isValid = _walDecodeFrame(tls, _pWal, &_9_pgno, &_9_nTruncate, _3_aData, _3_aFrame)
 22708  	if _3_isValid == 0 {
 22709  		goto _20
 22710  	}
 22711  	_rc = _walIndexAppend(tls, _pWal, uint32(_3_iFrame), _9_pgno)
 22712  	if _rc != int32(0) {
 22713  		goto _20
 22714  	}
 22715  	if _9_nTruncate != 0 {
 22716  		_pWal.Xhdr.XmxFrame = uint32(_3_iFrame)
 22717  		_pWal.Xhdr.XnPage = _9_nTruncate
 22718  		_pWal.Xhdr.XszPage = uint16((_3_szPage & int32(65280)) | (_3_szPage >> 16))
 22719  		*elem7((*uint32)(unsafe.Pointer(&_aFrameCksum)), 0) = *elem7((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), 0)
 22720  		*elem7((*uint32)(unsafe.Pointer(&_aFrameCksum)), uintptr(1)) = *elem7((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), uintptr(1))
 22721  	}
 22722  	_3_iOffset += int64(_3_szFrame)
 22723  	goto _17
 22724  _20:
 22725  	Xsqlite3_free(tls, unsafe.Pointer(_3_aFrame))
 22726  _finished:
 22727  	if _rc != int32(0) {
 22728  		goto _recovery_error
 22729  	}
 22730  	*elem7((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), 0) = *elem7((*uint32)(unsafe.Pointer(&_aFrameCksum)), 0)
 22731  	*elem7((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), uintptr(1)) = *elem7((*uint32)(unsafe.Pointer(&_aFrameCksum)), uintptr(1))
 22732  	_walIndexWriteHdr(tls, _pWal)
 22733  	_11_pInfo = _walCkptInfo(tls, _pWal)
 22734  	_11_pInfo.XnBackfill = 0
 22735  	_11_pInfo.XnBackfillAttempted = _pWal.Xhdr.XmxFrame
 22736  	*elem7((*uint32)(unsafe.Pointer(&_11_pInfo.XaReadMark)), 0) = 0
 22737  	_11_i = int32(1)
 22738  _26:
 22739  	if _11_i >= int32(5) {
 22740  		goto _29
 22741  	}
 22742  	*elem7((*uint32)(unsafe.Pointer(&_11_pInfo.XaReadMark)), uintptr(_11_i)) = uint32(4294967295)
 22743  	_11_i += 1
 22744  	goto _26
 22745  _29:
 22746  	if (_pWal.Xhdr.XmxFrame) != 0 {
 22747  		*elem7((*uint32)(unsafe.Pointer(&_11_pInfo.XaReadMark)), uintptr(1)) = _pWal.Xhdr.XmxFrame
 22748  	}
 22749  	if (_pWal.Xhdr.XnPage) != 0 {
 22750  		Xsqlite3_log(tls, int32(283), str(22694), _pWal.Xhdr.XmxFrame, unsafe.Pointer(_pWal.XzWalName))
 22751  	}
 22752  _recovery_error:
 22753  	_walUnlockExclusive(tls, _pWal, _iLock, _nLock)
 22754  	return _rc
 22755  
 22756  	_ = _aFrameCksum
 22757  	_ = _3_aBuf
 22758  	panic(0)
 22759  }
 22760  
 22761  var _walIndexRecoverØ00__func__Ø000 [16]int8
 22762  
 22763  func init() {
 22764  	crt.Xstrncpy(nil, &_walIndexRecoverØ00__func__Ø000[0], str(22731), 16)
 22765  }
 22766  
 22767  func _sqlite3CantopenError(tls *crt.TLS, _lineno int32) (r0 int32) {
 22768  	return _reportError(tls, int32(14), _lineno, str(22747))
 22769  }
 22770  
 22771  // C comment
 22772  //  /*
 22773  //  ** Check to see if the frame with header in aFrame[] and content
 22774  //  ** in aData[] is valid.  If it is a valid frame, fill *piPage and
 22775  //  ** *pnTruncate and return true.  Return if the frame is not valid.
 22776  //  */
 22777  func _walDecodeFrame(tls *crt.TLS, _pWal *XWal, _piPage *uint32, _pnTruncate *uint32, _aData *uint8, _aFrame *uint8) (r0 int32) {
 22778  	var _nativeCksum int32
 22779  	var _pgno uint32
 22780  	var _aCksum *uint32
 22781  	_aCksum = (*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum)))
 22782  
 22783  	if crt.Xmemcmp(tls, unsafe.Pointer(&(_pWal.Xhdr.XaSalt)), unsafe.Pointer(elem15(_aFrame, uintptr(8))), uint32(8)) != int32(0) {
 22784  		return int32(0)
 22785  	}
 22786  	_pgno = _sqlite3Get4byte(tls, elem15(_aFrame, 0))
 22787  	if _pgno == (0) {
 22788  		return int32(0)
 22789  	}
 22790  	_nativeCksum = bool2int(int32(_pWal.Xhdr.XbigEndCksum) == int32(0))
 22791  	_walChecksumBytes(tls, _nativeCksum, _aFrame, int32(8), _aCksum, _aCksum)
 22792  	_walChecksumBytes(tls, _nativeCksum, _aData, int32(_pWal.XszPage), _aCksum, _aCksum)
 22793  	if ((*elem7(_aCksum, 0)) != _sqlite3Get4byte(tls, elem15(_aFrame, uintptr(16)))) || ((*elem7(_aCksum, uintptr(1))) != _sqlite3Get4byte(tls, elem15(_aFrame, uintptr(20)))) {
 22794  		return int32(0)
 22795  	}
 22796  	*_piPage = _pgno
 22797  	*_pnTruncate = _sqlite3Get4byte(tls, elem15(_aFrame, uintptr(4)))
 22798  	return int32(1)
 22799  }
 22800  
 22801  // C comment
 22802  //  /*
 22803  //  ** Set an entry in the wal-index that will map database page number
 22804  //  ** pPage into WAL frame iFrame.
 22805  //  */
 22806  func _walIndexAppend(tls *crt.TLS, _pWal *XWal, _iFrame uint32, _iPage uint32) (r0 int32) {
 22807  	var _rc, _1_iKey, _1_idx, _1_nCollide, _2_nByte int32
 22808  	var _iZero uint32
 22809  	var _aPgno *uint32
 22810  	var _aHash *uint16
 22811  	_iZero = uint32(0)
 22812  	_aPgno = nil
 22813  	_aHash = nil
 22814  	_rc = _walHashGet(tls, _pWal, _walFramePage(tls, _iFrame), &_aHash, &_aPgno, &_iZero)
 22815  	if _rc != int32(0) {
 22816  		goto _0
 22817  	}
 22818  	_1_idx = int32(_iFrame - _iZero)
 22819  	func() {
 22820  		if _1_idx > int32(4097) {
 22821  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55489), unsafe.Pointer(&_walIndexAppendØ00__func__Ø000), unsafe.Pointer(str(22764)))
 22822  			crt.X__builtin_abort(tls)
 22823  		}
 22824  	}()
 22825  	if _1_idx == int32(1) {
 22826  		_2_nByte = int32(uintptr(unsafe.Pointer(elem20(_aHash, uintptr(8192)))) - uintptr(unsafe.Pointer(elem7(_aPgno, uintptr(1)))))
 22827  		crt.Xmemset(tls, unsafe.Pointer(elem7(_aPgno, uintptr(1))), int32(0), uint32(_2_nByte))
 22828  	}
 22829  	if (*elem7(_aPgno, uintptr(_1_idx))) != 0 {
 22830  		_walCleanupHash(tls, _pWal)
 22831  		func() {
 22832  			if (*elem7(_aPgno, uintptr(_1_idx))) != 0 {
 22833  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55507), unsafe.Pointer(&_walIndexAppendØ00__func__Ø000), unsafe.Pointer(str(22793)))
 22834  				crt.X__builtin_abort(tls)
 22835  			}
 22836  		}()
 22837  	}
 22838  	_1_nCollide = _1_idx
 22839  	_1_iKey = _walHash(tls, _iPage)
 22840  _7:
 22841  	if (*elem20(_aHash, uintptr(_1_iKey))) == 0 {
 22842  		goto _10
 22843  	}
 22844  	if postInc2(&_1_nCollide, -1) == int32(0) {
 22845  		return _sqlite3CorruptError(tls, int32(55513))
 22846  	}
 22847  	_1_iKey = _walNextHash(tls, _1_iKey)
 22848  	goto _7
 22849  _10:
 22850  	*elem7(_aPgno, uintptr(_1_idx)) = _iPage
 22851  	*elem20(_aHash, uintptr(_1_iKey)) = uint16(_1_idx)
 22852  _0:
 22853  	return _rc
 22854  
 22855  	_ = _1_nCollide
 22856  	panic(0)
 22857  }
 22858  
 22859  var _walIndexAppendØ00__func__Ø000 [15]int8
 22860  
 22861  func init() {
 22862  	crt.Xstrncpy(nil, &_walIndexAppendØ00__func__Ø000[0], str(22805), 15)
 22863  }
 22864  
 22865  // C comment
 22866  //  /*
 22867  //  ** Write the header information in pWal->hdr into the wal-index.
 22868  //  **
 22869  //  ** The checksum on pWal->hdr is updated before it is written.
 22870  //  */
 22871  func _walIndexWriteHdr(tls *crt.TLS, _pWal *XWal) {
 22872  	var _nCksum int32
 22873  	var _aHdr *XWalIndexHdr
 22874  	_aHdr = _walIndexHdr(tls, _pWal)
 22875  	_nCksum = int32(40)
 22876  	func() {
 22877  		if _pWal.XwriteLock == 0 {
 22878  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55144), unsafe.Pointer(&_walIndexWriteHdrØ00__func__Ø000), unsafe.Pointer(str(15561)))
 22879  			crt.X__builtin_abort(tls)
 22880  		}
 22881  	}()
 22882  	_pWal.Xhdr.XisInit = uint8(1)
 22883  	_pWal.Xhdr.XiVersion = uint32(3007000)
 22884  	_walChecksumBytes(tls, int32(1), (*uint8)(unsafe.Pointer(&_pWal.Xhdr)), _nCksum, nil, (*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaCksum))))
 22885  	crt.Xmemcpy(tls, unsafe.Pointer(elem44(_aHdr, uintptr(1))), unsafe.Pointer(&_pWal.Xhdr), uint32(48))
 22886  	_walShmBarrier(tls, _pWal)
 22887  	crt.Xmemcpy(tls, unsafe.Pointer(elem44(_aHdr, 0)), unsafe.Pointer(&_pWal.Xhdr), uint32(48))
 22888  }
 22889  
 22890  var _walIndexWriteHdrØ00__func__Ø000 [17]int8
 22891  
 22892  func init() {
 22893  	crt.Xstrncpy(nil, &_walIndexWriteHdrØ00__func__Ø000[0], str(22820), 17)
 22894  }
 22895  
 22896  // C comment
 22897  //  /*
 22898  //  ** Return a pointer to the WalCkptInfo structure in the wal-index.
 22899  //  */
 22900  func _walCkptInfo(tls *crt.TLS, _pWal *XWal) (r0 *XWalCkptInfo) {
 22901  	func() {
 22902  		if _pWal.XnWiData <= int32(0) || (*elem36(_pWal.XapWiData, 0)) == nil {
 22903  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55058), unsafe.Pointer(&_walCkptInfoØ00__func__Ø000), unsafe.Pointer(str(15226)))
 22904  			crt.X__builtin_abort(tls)
 22905  		}
 22906  	}()
 22907  	return (*XWalCkptInfo)(unsafe.Pointer(elem7(*elem36(_pWal.XapWiData, 0), uintptr(24))))
 22908  }
 22909  
 22910  var _walCkptInfoØ00__func__Ø000 [12]int8
 22911  
 22912  func init() {
 22913  	crt.Xstrncpy(nil, &_walCkptInfoØ00__func__Ø000[0], str(22837), 12)
 22914  }
 22915  
 22916  // C comment
 22917  //  /*
 22918  //  ** The cache of the wal-index header must be valid to call this function.
 22919  //  ** Return the page-size in bytes used by the database.
 22920  //  */
 22921  func _walPagesize(tls *crt.TLS, _pWal *XWal) (r0 int32) {
 22922  	return (int32(_pWal.Xhdr.XszPage) & int32(65024)) + ((int32(_pWal.Xhdr.XszPage) & int32(1)) << 16)
 22923  }
 22924  
 22925  // C comment
 22926  //  /*
 22927  //  ** Copy as much content as we can from the WAL back into the database file
 22928  //  ** in response to an sqlite3_wal_checkpoint() request or the equivalent.
 22929  //  **
 22930  //  ** The amount of information copies from WAL to database might be limited
 22931  //  ** by active readers.  This routine will never overwrite a database page
 22932  //  ** that a concurrent reader might be using.
 22933  //  **
 22934  //  ** All I/O barrier operations (a.k.a fsyncs) occur in this routine when
 22935  //  ** SQLite is in WAL-mode in synchronous=NORMAL.  That means that if
 22936  //  ** checkpoints are always run by a background thread or background
 22937  //  ** process, foreground threads will never block on a lengthy fsync call.
 22938  //  **
 22939  //  ** Fsync is called on the WAL before writing content out of the WAL and
 22940  //  ** into the database.  This ensures that if the new content is persistent
 22941  //  ** in the WAL and can be recovered following a power-loss or hard reset.
 22942  //  **
 22943  //  ** Fsync is also called on the database file if (and only if) the entire
 22944  //  ** WAL content is copied into the database file.  This second fsync makes
 22945  //  ** it safe to delete the WAL since the new content will persist in the
 22946  //  ** database file.
 22947  //  **
 22948  //  ** This routine uses and updates the nBackfill field of the wal-index header.
 22949  //  ** This is the only routine that will increase the value of nBackfill.
 22950  //  ** (A WAL reset or recovery will revert nBackfill to zero, but not increase
 22951  //  ** its value.)
 22952  //  **
 22953  //  ** The caller must be holding sufficient locks to ensure that no other
 22954  //  ** checkpoint is running (in any other thread or process) at the same
 22955  //  ** time.
 22956  //  */
 22957  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) {
 22958  	var _rc, _szPage, _i int32
 22959  	var _8_nSize, _10_nReq, _12_iOffset, _16_szDb int64
 22960  	var _iDbpage, _iFrame, _mxSafeFrame, _mxPage, _3_y, _8_nBackfill, _22_salt1 uint32
 22961  	var _pInfo *XWalCkptInfo
 22962  	var _pIter *XWalIterator
 22963  	_rc = int32(0)
 22964  	_pIter = nil
 22965  	_iDbpage = uint32(0)
 22966  	_iFrame = uint32(0)
 22967  	_szPage = _walPagesize(tls, _pWal)
 22968  	_pInfo = _walCkptInfo(tls, _pWal)
 22969  	if _pInfo.XnBackfill >= (_pWal.Xhdr.XmxFrame) {
 22970  		goto _0
 22971  	}
 22972  	_rc = _walIteratorInit(tls, _pWal, &_pIter)
 22973  	if _rc != int32(0) {
 22974  		return _rc
 22975  	}
 22976  	func() {
 22977  		if _pIter == nil {
 22978  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56230), unsafe.Pointer(&_walCheckpointØ00__func__Ø000), unsafe.Pointer(str(22849)))
 22979  			crt.X__builtin_abort(tls)
 22980  		}
 22981  	}()
 22982  	func() {
 22983  		if _eMode == int32(0) && _xBusy != nil {
 22984  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56234), unsafe.Pointer(&_walCheckpointØ00__func__Ø000), unsafe.Pointer(str(22441)))
 22985  			crt.X__builtin_abort(tls)
 22986  		}
 22987  	}()
 22988  	_mxSafeFrame = _pWal.Xhdr.XmxFrame
 22989  	_mxPage = _pWal.Xhdr.XnPage
 22990  	_i = int32(1)
 22991  _7:
 22992  	if _i >= int32(5) {
 22993  		goto _10
 22994  	}
 22995  	_3_y = *elem7((*uint32)(unsafe.Pointer(&_pInfo.XaReadMark)), uintptr(_i))
 22996  	if _mxSafeFrame <= _3_y {
 22997  		goto _11
 22998  	}
 22999  	func() {
 23000  		if _3_y > (_pWal.Xhdr.XmxFrame) {
 23001  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56254), unsafe.Pointer(&_walCheckpointØ00__func__Ø000), unsafe.Pointer(str(22855)))
 23002  			crt.X__builtin_abort(tls)
 23003  		}
 23004  	}()
 23005  	_rc = _walBusyLock(tls, _pWal, _xBusy, _pBusyArg, int32(3)+_i, int32(1))
 23006  	if _rc == int32(0) {
 23007  		*elem7((*uint32)(unsafe.Pointer(&_pInfo.XaReadMark)), uintptr(_i)) = func() uint32 {
 23008  			if _i == int32(1) {
 23009  				return _mxSafeFrame
 23010  			}
 23011  			return uint32(4294967295)
 23012  		}()
 23013  		_walUnlockExclusive(tls, _pWal, int32(3)+_i, int32(1))
 23014  		goto _19
 23015  	}
 23016  	if _rc == int32(5) {
 23017  		_mxSafeFrame = _3_y
 23018  		_xBusy = nil
 23019  		goto _19
 23020  	}
 23021  	goto _walcheckpoint_out
 23022  _19:
 23023  _11:
 23024  	_i += 1
 23025  	goto _7
 23026  _10:
 23027  	if _pInfo.XnBackfill >= _mxSafeFrame || store2(&_rc, _walBusyLock(tls, _pWal, _xBusy, _pBusyArg, int32(3), int32(1))) != int32(0) {
 23028  		goto _21
 23029  	}
 23030  	_8_nBackfill = _pInfo.XnBackfill
 23031  	_pInfo.XnBackfillAttempted = _mxSafeFrame
 23032  	if _sync_flags != 0 {
 23033  		_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pWal.XpWalFd), _sync_flags)
 23034  	}
 23035  	if _rc != int32(0) {
 23036  		goto _23
 23037  	}
 23038  	_10_nReq = int64(_mxPage) * int64(_szPage)
 23039  	_rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pWal.XpDbFd), &_8_nSize)
 23040  	if (_rc == int32(0)) && (_8_nSize < _10_nReq) {
 23041  		_sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pWal.XpDbFd), int32(5), unsafe.Pointer(&_10_nReq))
 23042  	}
 23043  _23:
 23044  	if _rc != int32(0) || int32(0) != _walIteratorNext(tls, _pIter, &_iDbpage, &_iFrame) {
 23045  		goto _27
 23046  	}
 23047  	func() {
 23048  		if _walFramePgno(tls, _pWal, _iFrame) != _iDbpage {
 23049  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56296), unsafe.Pointer(&_walCheckpointØ00__func__Ø000), unsafe.Pointer(str(22876)))
 23050  			crt.X__builtin_abort(tls)
 23051  		}
 23052  	}()
 23053  	if (*(*int32)(unsafe.Pointer(&_db.Xu1))) != 0 {
 23054  		_rc = func() int32 {
 23055  			if _db.XmallocFailed != 0 {
 23056  				return _sqlite3NomemError(tls, int32(56298))
 23057  			}
 23058  			return int32(9)
 23059  		}()
 23060  		goto _27
 23061  	}
 23062  	if ((_iFrame <= _8_nBackfill) || (_iFrame > _mxSafeFrame)) || (_iDbpage > _mxPage) {
 23063  		goto _23
 23064  	}
 23065  	_12_iOffset = (int64(32) + (int64(_iFrame-uint32(1)) * int64(_szPage+int32(24)))) + int64(24)
 23066  	_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.XpWalFd), unsafe.Pointer(_zBuf), _szPage, _12_iOffset)
 23067  	if _rc != int32(0) {
 23068  		goto _27
 23069  	}
 23070  	_12_iOffset = int64(_iDbpage-uint32(1)) * int64(_szPage)
 23071  	_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pWal.XpDbFd), unsafe.Pointer(_zBuf), _szPage, _12_iOffset)
 23072  	if _rc != int32(0) {
 23073  		goto _27
 23074  	}
 23075  	goto _23
 23076  _27:
 23077  	if _rc != int32(0) {
 23078  		goto _39
 23079  	}
 23080  	if _mxSafeFrame != (_walIndexHdr(tls, _pWal).XmxFrame) {
 23081  		goto _40
 23082  	}
 23083  	_16_szDb = int64(_pWal.Xhdr.XnPage) * int64(_szPage)
 23084  	_rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pWal.XpDbFd), _16_szDb)
 23085  	if (_rc == int32(0)) && _sync_flags != 0 {
 23086  		_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pWal.XpDbFd), _sync_flags)
 23087  	}
 23088  _40:
 23089  	if _rc == int32(0) {
 23090  		_pInfo.XnBackfill = _mxSafeFrame
 23091  	}
 23092  _39:
 23093  	_walUnlockExclusive(tls, _pWal, int32(3), int32(1))
 23094  _21:
 23095  	if _rc == int32(5) {
 23096  		_rc = int32(0)
 23097  	}
 23098  _0:
 23099  	if _rc != int32(0) || _eMode == int32(0) {
 23100  		goto _walcheckpoint_out
 23101  	}
 23102  	func() {
 23103  		if _pWal.XwriteLock == 0 {
 23104  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56346), unsafe.Pointer(&_walCheckpointØ00__func__Ø000), unsafe.Pointer(str(15561)))
 23105  			crt.X__builtin_abort(tls)
 23106  		}
 23107  	}()
 23108  	if _pInfo.XnBackfill < (_pWal.Xhdr.XmxFrame) {
 23109  		_rc = int32(5)
 23110  		goto _51
 23111  	}
 23112  	if _eMode < int32(2) {
 23113  		goto _51
 23114  	}
 23115  	Xsqlite3_randomness(tls, int32(4), unsafe.Pointer(&_22_salt1))
 23116  	func() {
 23117  		if _pInfo.XnBackfill != (_pWal.Xhdr.XmxFrame) {
 23118  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56352), unsafe.Pointer(&_walCheckpointØ00__func__Ø000), unsafe.Pointer(str(22912)))
 23119  			crt.X__builtin_abort(tls)
 23120  		}
 23121  	}()
 23122  	_rc = _walBusyLock(tls, _pWal, _xBusy, _pBusyArg, int32(4), int32(4))
 23123  	if _rc != int32(0) {
 23124  		goto _54
 23125  	}
 23126  	if _eMode == int32(3) {
 23127  		_walRestartHdr(tls, _pWal, _22_salt1)
 23128  		_rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pWal.XpWalFd), 0)
 23129  	}
 23130  	_walUnlockExclusive(tls, _pWal, int32(4), int32(4))
 23131  _54:
 23132  _51:
 23133  _walcheckpoint_out:
 23134  	_walIteratorFree(tls, _pIter)
 23135  	return _rc
 23136  }
 23137  
 23138  // C comment
 23139  //  /*
 23140  //  ** Construct a WalInterator object that can be used to loop over all
 23141  //  ** pages in the WAL in ascending order. The caller must hold the checkpoint
 23142  //  ** lock.
 23143  //  **
 23144  //  ** On success, make *pp point to the newly allocated WalInterator object
 23145  //  ** return SQLITE_OK. Otherwise, return an error code. If this routine
 23146  //  ** returns an error, the value of *pp is undefined.
 23147  //  **
 23148  //  ** The calling routine should invoke walIteratorFree() to destroy the
 23149  //  ** WalIterator object when it has finished with it.
 23150  //  */
 23151  func _walIteratorInit(tls *crt.TLS, _pWal *XWal, _pp **XWalIterator) (r0 int32) {
 23152  	var _nSegment, _nByte, _i, _rc, _4_j, _4_nEntry int32
 23153  	var _iLast, _3_iZero uint32
 23154  	var _3_aPgno *uint32
 23155  	var _aTmp, _3_aHash, _4_aIndex *uint16
 23156  	var _p *XWalIterator
 23157  	_rc = int32(0)
 23158  	func() {
 23159  		if _pWal.XckptLock == 0 || (_pWal.Xhdr.XmxFrame) <= (0) {
 23160  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56044), unsafe.Pointer(&_walIteratorInitØ00__func__Ø000), unsafe.Pointer(str(22948)))
 23161  			crt.X__builtin_abort(tls)
 23162  		}
 23163  	}()
 23164  	_iLast = _pWal.Xhdr.XmxFrame
 23165  	_nSegment = _walFramePage(tls, _iLast) + int32(1)
 23166  	_nByte = int32((uint32(28) + (uint32(_nSegment-int32(1)) * uint32(20))) + (_iLast * uint32(2)))
 23167  	_p = (*XWalIterator)(Xsqlite3_malloc64(tls, uint64(_nByte)))
 23168  	if _p == nil {
 23169  		return _sqlite3NomemError(tls, int32(56054))
 23170  	}
 23171  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint32(_nByte))
 23172  	_p.XnSegment = _nSegment
 23173  	_aTmp = (*uint16)(Xsqlite3_malloc64(tls, uint64(uint32(2)*func() uint32 {
 23174  		if _iLast > uint32(4096) {
 23175  			return uint32(4096)
 23176  		}
 23177  		return _iLast
 23178  	}())))
 23179  	if _aTmp == nil {
 23180  		_rc = _sqlite3NomemError(tls, int32(56066))
 23181  	}
 23182  	_i = int32(0)
 23183  _7:
 23184  	if _rc != int32(0) || _i >= _nSegment {
 23185  		goto _11
 23186  	}
 23187  	_rc = _walHashGet(tls, _pWal, _i, &_3_aHash, &_3_aPgno, &_3_iZero)
 23188  	if _rc != int32(0) {
 23189  		goto _12
 23190  	}
 23191  	*(*uintptr)(unsafe.Pointer(&_3_aPgno)) += uintptr(4)
 23192  	if (_i + int32(1)) == _nSegment {
 23193  		_4_nEntry = int32(_iLast - _3_iZero)
 23194  		goto _14
 23195  	}
 23196  	_4_nEntry = int32((uintptr(unsafe.Pointer(_3_aHash)) - uintptr(unsafe.Pointer(_3_aPgno))) / 4)
 23197  _14:
 23198  	_4_aIndex = elem20((*uint16)(unsafe.Pointer(elem45((*TWalSegment)(unsafe.Pointer(&_p.XaSegment)), uintptr(_p.XnSegment)))), uintptr(_3_iZero))
 23199  	_3_iZero += 1
 23200  	_4_j = int32(0)
 23201  _15:
 23202  	if _4_j >= _4_nEntry {
 23203  		goto _18
 23204  	}
 23205  	*elem20(_4_aIndex, uintptr(_4_j)) = uint16(_4_j)
 23206  	_4_j += 1
 23207  	goto _15
 23208  _18:
 23209  	_walMergesort(tls, _3_aPgno, _aTmp, _4_aIndex, &_4_nEntry)
 23210  	elem45((*TWalSegment)(unsafe.Pointer(&_p.XaSegment)), uintptr(_i)).XiZero = int32(_3_iZero)
 23211  	elem45((*TWalSegment)(unsafe.Pointer(&_p.XaSegment)), uintptr(_i)).XnEntry = _4_nEntry
 23212  	elem45((*TWalSegment)(unsafe.Pointer(&_p.XaSegment)), uintptr(_i)).XaIndex = _4_aIndex
 23213  	elem45((*TWalSegment)(unsafe.Pointer(&_p.XaSegment)), uintptr(_i)).XaPgno = _3_aPgno
 23214  _12:
 23215  	_i += 1
 23216  	goto _7
 23217  _11:
 23218  	Xsqlite3_free(tls, unsafe.Pointer(_aTmp))
 23219  	if _rc != int32(0) {
 23220  		_walIteratorFree(tls, _p)
 23221  	}
 23222  	*_pp = _p
 23223  	return _rc
 23224  }
 23225  
 23226  var _walIteratorInitØ00__func__Ø000 [16]int8
 23227  
 23228  func init() {
 23229  	crt.Xstrncpy(nil, &_walIteratorInitØ00__func__Ø000[0], str(22986), 16)
 23230  }
 23231  
 23232  // C comment
 23233  //  /*
 23234  //  ** Sort the elements in list aList using aContent[] as the sort key.
 23235  //  ** Remove elements with duplicate keys, preferring to keep the
 23236  //  ** larger aList[] values.
 23237  //  **
 23238  //  ** The aList[] entries are indices into aContent[].  The values in
 23239  //  ** aList[] are to be sorted so that for all J<K:
 23240  //  **
 23241  //  **      aContent[aList[J]] < aContent[aList[K]]
 23242  //  **
 23243  //  ** For any X and Y such that
 23244  //  **
 23245  //  **      aContent[aList[X]] == aContent[aList[Y]]
 23246  //  **
 23247  //  ** Keep the larger of the two values aList[X] and aList[Y] and discard
 23248  //  ** the smaller.
 23249  //  */
 23250  func _walMergesort(tls *crt.TLS, _aContent *uint32, _aBuffer *uint16, _aList *uint16, _pnList *int32) {
 23251  	var _nList, _nMerge, _iList, _5_i int32
 23252  	var _iSub uint32
 23253  	var _aMerge *uint16
 23254  	var _aSub [13]TSublist
 23255  	var _2_p, _4_p *TSublist
 23256  	_nList = *_pnList
 23257  	_nMerge = int32(0)
 23258  	_aMerge = nil
 23259  	_iSub = uint32(0)
 23260  	crt.Xmemset(tls, unsafe.Pointer(&_aSub), int32(0), uint32(104))
 23261  	func() {
 23262  		if _nList > int32(4096) || _nList <= int32(0) {
 23263  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55972), unsafe.Pointer(&_walMergesortØ00__func__Ø000), unsafe.Pointer(str(23002)))
 23264  			crt.X__builtin_abort(tls)
 23265  		}
 23266  	}()
 23267  
 23268  	_iList = int32(0)
 23269  _3:
 23270  	if _iList >= _nList {
 23271  		goto _6
 23272  	}
 23273  	_nMerge = int32(1)
 23274  	_aMerge = elem20(_aList, uintptr(_iList))
 23275  	_iSub = 0
 23276  _7:
 23277  	if (_iList & (int32(1) << uint(int32(_iSub)))) == 0 {
 23278  		goto _10
 23279  	}
 23280  	func() {
 23281  		if _iSub >= uint32(13) {
 23282  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55980), unsafe.Pointer(&_walMergesortØ00__func__Ø000), unsafe.Pointer(str(23036)))
 23283  			crt.X__builtin_abort(tls)
 23284  		}
 23285  	}()
 23286  	_2_p = elem46((*TSublist)(unsafe.Pointer(&_aSub)), uintptr(_iSub))
 23287  	func() {
 23288  		if _2_p.XaList == nil || _2_p.XnList > (int32(1)<<uint(int32(_iSub))) {
 23289  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55982), unsafe.Pointer(&_walMergesortØ00__func__Ø000), unsafe.Pointer(str(23057)))
 23290  			crt.X__builtin_abort(tls)
 23291  		}
 23292  	}()
 23293  	func() {
 23294  		if _2_p.XaList != elem20(_aList, uintptr(_iList&(^((int32(2)<<uint(int32(_iSub)))-int32(1))))) {
 23295  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55983), unsafe.Pointer(&_walMergesortØ00__func__Ø000), unsafe.Pointer(str(23089)))
 23296  			crt.X__builtin_abort(tls)
 23297  		}
 23298  	}()
 23299  	_walMerge(tls, _aContent, _2_p.XaList, _2_p.XnList, &_aMerge, &_nMerge, _aBuffer)
 23300  	_iSub += 1
 23301  	goto _7
 23302  _10:
 23303  	elem46((*TSublist)(unsafe.Pointer(&_aSub)), uintptr(_iSub)).XaList = _aMerge
 23304  	elem46((*TSublist)(unsafe.Pointer(&_aSub)), uintptr(_iSub)).XnList = _nMerge
 23305  	_iList += 1
 23306  	goto _3
 23307  _6:
 23308  	_iSub += 1
 23309  _18:
 23310  	if _iSub >= uint32(13) {
 23311  		goto _21
 23312  	}
 23313  	if (_nList & (int32(1) << uint(int32(_iSub)))) != 0 {
 23314  		func() {
 23315  			if _iSub >= uint32(13) {
 23316  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55993), unsafe.Pointer(&_walMergesortØ00__func__Ø000), unsafe.Pointer(str(23036)))
 23317  				crt.X__builtin_abort(tls)
 23318  			}
 23319  		}()
 23320  		_4_p = elem46((*TSublist)(unsafe.Pointer(&_aSub)), uintptr(_iSub))
 23321  		func() {
 23322  			if _4_p.XnList > (int32(1) << uint(int32(_iSub))) {
 23323  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55995), unsafe.Pointer(&_walMergesortØ00__func__Ø000), unsafe.Pointer(str(23128)))
 23324  				crt.X__builtin_abort(tls)
 23325  			}
 23326  		}()
 23327  		func() {
 23328  			if _4_p.XaList != elem20(_aList, uintptr(_nList&(^((int32(2)<<uint(int32(_iSub)))-int32(1))))) {
 23329  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55996), unsafe.Pointer(&_walMergesortØ00__func__Ø000), unsafe.Pointer(str(23148)))
 23330  				crt.X__builtin_abort(tls)
 23331  			}
 23332  		}()
 23333  		_walMerge(tls, _aContent, _4_p.XaList, _4_p.XnList, &_aMerge, &_nMerge, _aBuffer)
 23334  	}
 23335  	_iSub += 1
 23336  	goto _18
 23337  _21:
 23338  	func() {
 23339  		if _aMerge != _aList {
 23340  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56000), unsafe.Pointer(&_walMergesortØ00__func__Ø000), unsafe.Pointer(str(23187)))
 23341  			crt.X__builtin_abort(tls)
 23342  		}
 23343  	}()
 23344  	*_pnList = _nMerge
 23345  	_5_i = int32(1)
 23346  _31:
 23347  	if _5_i >= (*_pnList) {
 23348  		goto _34
 23349  	}
 23350  	func() {
 23351  		if (*elem7(_aContent, uintptr(*elem20(_aList, uintptr(_5_i))))) <= (*elem7(_aContent, uintptr(*elem20(_aList, uintptr(_5_i-int32(1)))))) {
 23352  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56007), unsafe.Pointer(&_walMergesortØ00__func__Ø000), unsafe.Pointer(str(23201)))
 23353  			crt.X__builtin_abort(tls)
 23354  		}
 23355  	}()
 23356  	_5_i += 1
 23357  	goto _31
 23358  _34:
 23359  	_ = _aSub
 23360  }
 23361  
 23362  var _walMergesortØ00__func__Ø000 [13]int8
 23363  
 23364  func init() {
 23365  	crt.Xstrncpy(nil, &_walMergesortØ00__func__Ø000[0], str(23243), 13)
 23366  }
 23367  
 23368  // C comment
 23369  //  /*
 23370  //  ** This function merges two sorted lists into a single sorted list.
 23371  //  **
 23372  //  ** aLeft[] and aRight[] are arrays of indices.  The sort key is
 23373  //  ** aContent[aLeft[]] and aContent[aRight[]].  Upon entry, the following
 23374  //  ** is guaranteed for all J<K:
 23375  //  **
 23376  //  **        aContent[aLeft[J]] < aContent[aLeft[K]]
 23377  //  **        aContent[aRight[J]] < aContent[aRight[K]]
 23378  //  **
 23379  //  ** This routine overwrites aRight[] with a new (probably longer) sequence
 23380  //  ** of indices such that the aRight[] contains every index that appears in
 23381  //  ** either aLeft[] or the old aRight[] and such that the second condition
 23382  //  ** above is still met.
 23383  //  **
 23384  //  ** The aContent[aLeft[X]] values will be unique for all X.  And the
 23385  //  ** aContent[aRight[X]] values will be unique too.  But there might be
 23386  //  ** one or more combinations of X and Y such that
 23387  //  **
 23388  //  **      aLeft[X]!=aRight[Y]  &&  aContent[aLeft[X]] == aContent[aRight[Y]]
 23389  //  **
 23390  //  ** When that happens, omit the aLeft[X] and use the aRight[Y] index.
 23391  //  */
 23392  func _walMerge(tls *crt.TLS, _aContent *uint32, _aLeft *uint16, _nLeft int32, _paRight **uint16, _pnRight *int32, _aTmp *uint16) {
 23393  	var _iLeft, _iRight, _iOut, _nRight int32
 23394  	var _1_dbpage uint32
 23395  	var _1_logpage uint16
 23396  	var _aRight *uint16
 23397  	_iLeft = int32(0)
 23398  	_iRight = int32(0)
 23399  	_iOut = int32(0)
 23400  	_nRight = *_pnRight
 23401  	_aRight = *_paRight
 23402  	func() {
 23403  		if _nLeft <= int32(0) || _nRight <= int32(0) {
 23404  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55910), unsafe.Pointer(&_walMergeØ00__func__Ø000), unsafe.Pointer(str(23256)))
 23405  			crt.X__builtin_abort(tls)
 23406  		}
 23407  	}()
 23408  _3:
 23409  	if _iRight >= _nRight && _iLeft >= _nLeft {
 23410  		goto _4
 23411  	}
 23412  	if (_iLeft < _nLeft) && ((_iRight >= _nRight) || ((*elem7(_aContent, uintptr(*elem20(_aLeft, uintptr(_iLeft))))) < (*elem7(_aContent, uintptr(*elem20(_aRight, uintptr(_iRight))))))) {
 23413  		_1_logpage = *elem20(_aLeft, uintptr(postInc2(&_iLeft, 1)))
 23414  		goto _9
 23415  	}
 23416  	_1_logpage = *elem20(_aRight, uintptr(postInc2(&_iRight, 1)))
 23417  _9:
 23418  	_1_dbpage = *elem7(_aContent, uintptr(_1_logpage))
 23419  	*elem20(_aTmp, uintptr(postInc2(&_iOut, 1))) = _1_logpage
 23420  	if (_iLeft < _nLeft) && ((*elem7(_aContent, uintptr(*elem20(_aLeft, uintptr(_iLeft))))) == _1_dbpage) {
 23421  		_iLeft += 1
 23422  	}
 23423  	func() {
 23424  		if _iLeft < _nLeft && (*elem7(_aContent, uintptr(*elem20(_aLeft, uintptr(_iLeft))))) <= _1_dbpage {
 23425  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55927), unsafe.Pointer(&_walMergeØ00__func__Ø000), unsafe.Pointer(str(23276)))
 23426  			crt.X__builtin_abort(tls)
 23427  		}
 23428  	}()
 23429  	func() {
 23430  		if _iRight < _nRight && (*elem7(_aContent, uintptr(*elem20(_aRight, uintptr(_iRight))))) <= _1_dbpage {
 23431  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55928), unsafe.Pointer(&_walMergeØ00__func__Ø000), unsafe.Pointer(str(23322)))
 23432  			crt.X__builtin_abort(tls)
 23433  		}
 23434  	}()
 23435  	goto _3
 23436  _4:
 23437  	*_paRight = _aLeft
 23438  	*_pnRight = _iOut
 23439  	crt.Xmemcpy(tls, unsafe.Pointer(_aLeft), unsafe.Pointer(_aTmp), uint32(2)*uint32(_iOut))
 23440  }
 23441  
 23442  var _walMergeØ00__func__Ø000 [9]int8
 23443  
 23444  func init() {
 23445  	crt.Xstrncpy(nil, &_walMergeØ00__func__Ø000[0], str(23372), 9)
 23446  }
 23447  
 23448  // C comment
 23449  //  /*
 23450  //  ** Free an iterator allocated by walIteratorInit().
 23451  //  */
 23452  func _walIteratorFree(tls *crt.TLS, _p *XWalIterator) {
 23453  	Xsqlite3_free(tls, unsafe.Pointer(_p))
 23454  }
 23455  
 23456  var _walCheckpointØ00__func__Ø000 [14]int8
 23457  
 23458  func init() {
 23459  	crt.Xstrncpy(nil, &_walCheckpointØ00__func__Ø000[0], str(23381), 14)
 23460  }
 23461  
 23462  // C comment
 23463  //  /*
 23464  //  ** Find the smallest page number out of all pages held in the WAL that
 23465  //  ** has not been returned by any prior invocation of this method on the
 23466  //  ** same WalIterator object.   Write into *piFrame the frame index where
 23467  //  ** that page was last written into the WAL.  Write into *piPage the page
 23468  //  ** number.
 23469  //  **
 23470  //  ** Return 0 on success.  If there are no pages in the WAL with a page
 23471  //  ** number larger than *piPage, then return 1.
 23472  //  */
 23473  func _walIteratorNext(tls *crt.TLS, _p *XWalIterator, _piPage *uint32, _piFrame *uint32) (r0 int32) {
 23474  	var _i int32
 23475  	var _iMin, _iRet, _2_iPg uint32
 23476  	var _1_pSegment *TWalSegment
 23477  	_iRet = uint32(4294967295)
 23478  	_iMin = uint32(_p.XiPrior)
 23479  	func() {
 23480  		if _iMin >= uint32(4294967295) {
 23481  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55853), unsafe.Pointer(&_walIteratorNextØ00__func__Ø000), unsafe.Pointer(str(23395)))
 23482  			crt.X__builtin_abort(tls)
 23483  		}
 23484  	}()
 23485  	_i = _p.XnSegment - int32(1)
 23486  _2:
 23487  	if _i < int32(0) {
 23488  		goto _5
 23489  	}
 23490  	_1_pSegment = elem45((*TWalSegment)(unsafe.Pointer(&_p.XaSegment)), uintptr(_i))
 23491  _6:
 23492  	if _1_pSegment.XiNext >= _1_pSegment.XnEntry {
 23493  		goto _7
 23494  	}
 23495  	_2_iPg = *elem7(_1_pSegment.XaPgno, uintptr(*elem20(_1_pSegment.XaIndex, uintptr(_1_pSegment.XiNext))))
 23496  	if _2_iPg <= _iMin {
 23497  		goto _8
 23498  	}
 23499  	if _2_iPg < _iRet {
 23500  		_iRet = _2_iPg
 23501  		*_piFrame = uint32(_1_pSegment.XiZero + int32(*elem20(_1_pSegment.XaIndex, uintptr(_1_pSegment.XiNext))))
 23502  	}
 23503  	goto _7
 23504  _8:
 23505  	_1_pSegment.XiNext += 1
 23506  	goto _6
 23507  _7:
 23508  	_i -= 1
 23509  	goto _2
 23510  _5:
 23511  	*_piPage = uint32(store2(&_p.XiPrior, int32(_iRet)))
 23512  	return bool2int(_iRet == uint32(4294967295))
 23513  }
 23514  
 23515  var _walIteratorNextØ00__func__Ø000 [16]int8
 23516  
 23517  func init() {
 23518  	crt.Xstrncpy(nil, &_walIteratorNextØ00__func__Ø000[0], str(23411), 16)
 23519  }
 23520  
 23521  // C comment
 23522  //  /*
 23523  //  ** The following is guaranteed when this function is called:
 23524  //  **
 23525  //  **   a) the WRITER lock is held,
 23526  //  **   b) the entire log file has been checkpointed, and
 23527  //  **   c) any existing readers are reading exclusively from the database
 23528  //  **      file - there are no readers that may attempt to read a frame from
 23529  //  **      the log file.
 23530  //  **
 23531  //  ** This function updates the shared-memory structures so that the next
 23532  //  ** client to write to the database (which may be this one) does so by
 23533  //  ** writing frames into the start of the log file.
 23534  //  **
 23535  //  ** The value of parameter salt1 is used as the aSalt[1] value in the
 23536  //  ** new wal-index header. It should be passed a pseudo-random value (i.e.
 23537  //  ** one obtained from sqlite3_randomness()).
 23538  //  */
 23539  func _walRestartHdr(tls *crt.TLS, _pWal *XWal, _salt1 uint32) {
 23540  	var _i int32
 23541  	var _aSalt *uint32
 23542  	var _pInfo *XWalCkptInfo
 23543  	_pInfo = _walCkptInfo(tls, _pWal)
 23544  	_aSalt = (*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaSalt)))
 23545  	_pWal.XnCkpt += 1
 23546  	_pWal.Xhdr.XmxFrame = 0
 23547  	_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(elem7(_aSalt, 0))), uint32(1)+_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(elem7(_aSalt, 0)))))
 23548  	crt.Xmemcpy(tls, unsafe.Pointer(elem7((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaSalt))), uintptr(1))), unsafe.Pointer(&_salt1), uint32(4))
 23549  	_walIndexWriteHdr(tls, _pWal)
 23550  	_pInfo.XnBackfill = 0
 23551  	_pInfo.XnBackfillAttempted = 0
 23552  	*elem7((*uint32)(unsafe.Pointer(&_pInfo.XaReadMark)), uintptr(1)) = 0
 23553  	_i = int32(2)
 23554  _0:
 23555  	if _i >= int32(5) {
 23556  		goto _3
 23557  	}
 23558  	*elem7((*uint32)(unsafe.Pointer(&_pInfo.XaReadMark)), uintptr(_i)) = uint32(4294967295)
 23559  	_i += 1
 23560  	goto _0
 23561  _3:
 23562  	func() {
 23563  		if (*elem7((*uint32)(unsafe.Pointer(&_pInfo.XaReadMark)), 0)) != (0) {
 23564  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56166), unsafe.Pointer(&_walRestartHdrØ00__func__Ø000), unsafe.Pointer(str(23427)))
 23565  			crt.X__builtin_abort(tls)
 23566  		}
 23567  	}()
 23568  }
 23569  
 23570  var _walRestartHdrØ00__func__Ø000 [14]int8
 23571  
 23572  func init() {
 23573  	crt.Xstrncpy(nil, &_walRestartHdrØ00__func__Ø000[0], str(23450), 14)
 23574  }
 23575  
 23576  // C comment
 23577  //  /*
 23578  //  ** If the WAL file is currently larger than nMax bytes in size, truncate
 23579  //  ** it to exactly nMax bytes. If an error occurs while doing so, ignore it.
 23580  //  */
 23581  func _walLimitSize(tls *crt.TLS, _pWal *XWal, _nMax int64) {
 23582  	var _rx int32
 23583  	var _sz int64
 23584  	_sqlite3BeginBenignMalloc(tls)
 23585  	_rx = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pWal.XpWalFd), &_sz)
 23586  	if (_rx == int32(0)) && (_sz > _nMax) {
 23587  		_rx = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pWal.XpWalFd), _nMax)
 23588  	}
 23589  	_sqlite3EndBenignMalloc(tls)
 23590  	if _rx != 0 {
 23591  		Xsqlite3_log(tls, _rx, str(23464), unsafe.Pointer(_pWal.XzWalName))
 23592  	}
 23593  }
 23594  
 23595  // C comment
 23596  //  /*
 23597  //  ** Close an open wal-index.
 23598  //  */
 23599  func _walIndexClose(tls *crt.TLS, _pWal *XWal, _isDelete int32) {
 23600  	var _1_i int32
 23601  	if int32(_pWal.XexclusiveMode) != int32(2) {
 23602  		goto _0
 23603  	}
 23604  	_1_i = int32(0)
 23605  _1:
 23606  	if _1_i >= _pWal.XnWiData {
 23607  		goto _4
 23608  	}
 23609  	Xsqlite3_free(tls, unsafe.Pointer(*elem36(_pWal.XapWiData, uintptr(_1_i))))
 23610  	*elem36(_pWal.XapWiData, uintptr(_1_i)) = nil
 23611  	_1_i += 1
 23612  	goto _1
 23613  _4:
 23614  	goto _5
 23615  _0:
 23616  	_sqlite3OsShmUnmap(tls, (*Xsqlite3_file)(_pWal.XpDbFd), _isDelete)
 23617  _5:
 23618  }
 23619  
 23620  func _sqlite3OsShmUnmap(tls *crt.TLS, _id *Xsqlite3_file, _deleteFlag int32) (r0 int32) {
 23621  	return func() func(*crt.TLS, *Xsqlite3_file, int32) int32 {
 23622  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxShmUnmap
 23623  		return *(*func(*crt.TLS, *Xsqlite3_file, int32) int32)(unsafe.Pointer(&v))
 23624  	}()(tls, _id, _deleteFlag)
 23625  }
 23626  
 23627  // C comment
 23628  //  /*
 23629  //  ** This function is called before attempting a hot-journal rollback. It
 23630  //  ** syncs the journal file to disk, then sets pPager->journalHdr to the
 23631  //  ** size of the journal file so that the pager_playback() routine knows
 23632  //  ** that the entire journal file has been synced.
 23633  //  **
 23634  //  ** Syncing a hot-journal to disk before attempting to roll it back ensures
 23635  //  ** that if a power-failure occurs during the rollback, the process that
 23636  //  ** attempts rollback following system recovery sees the same journal
 23637  //  ** content as this process.
 23638  //  **
 23639  //  ** If everything goes as planned, SQLITE_OK is returned. Otherwise,
 23640  //  ** an SQLite error code.
 23641  //  */
 23642  func _pagerSyncHotJournal(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 23643  	var _rc int32
 23644  	_rc = int32(0)
 23645  	if _pPager.XnoSync == 0 {
 23646  		_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pPager.Xjfd), int32(2))
 23647  	}
 23648  	if _rc == int32(0) {
 23649  		_rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.Xjfd), &_pPager.XjournalHdr)
 23650  	}
 23651  	return _rc
 23652  }
 23653  
 23654  // C comment
 23655  //  /*
 23656  //  ** Close a cache.
 23657  //  */
 23658  func _sqlite3PcacheClose(tls *crt.TLS, _pCache *XPCache) {
 23659  	func() {
 23660  		if _pCache.XpCache == nil {
 23661  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44805), unsafe.Pointer(&_sqlite3PcacheCloseØ00__func__Ø000), unsafe.Pointer(str(15913)))
 23662  			crt.X__builtin_abort(tls)
 23663  		}
 23664  	}()
 23665  	(_sqlite3Config.Xpcache2.XxDestroy)(tls, _pCache.XpCache)
 23666  }
 23667  
 23668  var _sqlite3PcacheCloseØ00__func__Ø000 [19]int8
 23669  
 23670  func init() {
 23671  	crt.Xstrncpy(nil, &_sqlite3PcacheCloseØ00__func__Ø000[0], str(23490), 19)
 23672  }
 23673  
 23674  // C comment
 23675  //  /*
 23676  //  ** Free the pBt->pTmpSpace allocation
 23677  //  */
 23678  func _freeTempSpace(tls *crt.TLS, _pBt *XBtShared) {
 23679  	if _pBt.XpTmpSpace != nil {
 23680  		*(*uintptr)(unsafe.Pointer(&_pBt.XpTmpSpace)) -= uintptr(int32(4))
 23681  		_sqlite3PageFree(tls, unsafe.Pointer(_pBt.XpTmpSpace))
 23682  		_pBt.XpTmpSpace = nil
 23683  	}
 23684  }
 23685  
 23686  var _sqlite3LeaveMutexAndCloseZombieØ00__func__Ø000 [32]int8
 23687  
 23688  func init() {
 23689  	crt.Xstrncpy(nil, &_sqlite3LeaveMutexAndCloseZombieØ00__func__Ø000[0], str(23509), 32)
 23690  }
 23691  
 23692  // C comment
 23693  //  /*
 23694  //  ** Invoke the destructor function associated with FuncDef p, if any. Except,
 23695  //  ** if this is not the last copy of the function, do not invoke it. Multiple
 23696  //  ** copies of a single function are created when create_function() is called
 23697  //  ** with SQLITE_ANY as the encoding.
 23698  //  */
 23699  func _functionDestroy(tls *crt.TLS, _db *Xsqlite3, _p *XFuncDef) {
 23700  	var _pDestructor *XFuncDestructor
 23701  	_pDestructor = (*XFuncDestructor)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))
 23702  	if _pDestructor == nil {
 23703  		goto _0
 23704  	}
 23705  	_pDestructor.XnRef -= 1
 23706  	if _pDestructor.XnRef == int32(0) {
 23707  		_pDestructor.XxDestroy(tls, _pDestructor.XpUserData)
 23708  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_pDestructor))
 23709  	}
 23710  _0:
 23711  }
 23712  
 23713  // C comment
 23714  //  /*
 23715  //  ** Erase the eponymous virtual table instance associated with
 23716  //  ** virtual table module pMod, if it exists.
 23717  //  */
 23718  func _sqlite3VtabEponymousTableClear(tls *crt.TLS, _db *Xsqlite3, _pMod *XModule) {
 23719  	var _pTab *XTable
 23720  	_pTab = (*XTable)(_pMod.XpEpoTab)
 23721  	if _pTab != nil {
 23722  		_pTab.XtabFlags |= uint32(2)
 23723  		_sqlite3DeleteTable(tls, _db, _pTab)
 23724  		*(**XTable)(unsafe.Pointer(&_pMod.XpEpoTab)) = nil
 23725  	}
 23726  }
 23727  
 23728  // C comment
 23729  //  /*
 23730  //  ** Free an sqlite3_value object
 23731  //  */
 23732  func _sqlite3ValueFree(tls *crt.TLS, _v *XMem) {
 23733  	if _v == nil {
 23734  		return
 23735  	}
 23736  	_sqlite3VdbeMemRelease(tls, _v)
 23737  	_sqlite3DbFreeNN(tls, (*Xsqlite3)(_v.Xdb), unsafe.Pointer(_v))
 23738  }
 23739  
 23740  // C comment
 23741  //  /*
 23742  //  ** Call this routine when the database connection is closing in order
 23743  //  ** to clean up loaded extensions
 23744  //  */
 23745  func _sqlite3CloseExtensions(tls *crt.TLS, _db *Xsqlite3) {
 23746  	var _i int32
 23747  	func() {
 23748  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 23749  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(112416), unsafe.Pointer(&_sqlite3CloseExtensionsØ00__func__Ø000), unsafe.Pointer(str(881)))
 23750  			crt.X__builtin_abort(tls)
 23751  		}
 23752  	}()
 23753  	_i = int32(0)
 23754  _2:
 23755  	if _i >= _db.XnExtension {
 23756  		goto _5
 23757  	}
 23758  	_sqlite3OsDlClose(tls, (*Xsqlite3_vfs)(_db.XpVfs), *elem24(_db.XaExtension, uintptr(_i)))
 23759  	_i += 1
 23760  	goto _2
 23761  _5:
 23762  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_db.XaExtension))
 23763  }
 23764  
 23765  var _sqlite3CloseExtensionsØ00__func__Ø000 [23]int8
 23766  
 23767  func init() {
 23768  	crt.Xstrncpy(nil, &_sqlite3CloseExtensionsØ00__func__Ø000[0], str(23541), 23)
 23769  }
 23770  
 23771  // C comment
 23772  //  /*
 23773  //  ** Register a collation sequence factory callback with the database handle
 23774  //  ** db. Replace any previously installed collation sequence factory.
 23775  //  */
 23776  func Xsqlite3_collation_needed(tls *crt.TLS, _db *Xsqlite3, _pCollNeededArg unsafe.Pointer, _xCollNeeded func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8)) (r0 int32) {
 23777  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
 23778  		return _sqlite3MisuseError(tls, int32(143721))
 23779  	}
 23780  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 23781  	*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8))(unsafe.Pointer(&_db.XxCollNeeded)) = _xCollNeeded
 23782  	*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer))(unsafe.Pointer(&_db.XxCollNeeded16)) = nil
 23783  	_db.XpCollNeededArg = _pCollNeededArg
 23784  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 23785  	return int32(0)
 23786  }
 23787  
 23788  // C comment
 23789  //  /*
 23790  //  ** Register a collation sequence factory callback with the database handle
 23791  //  ** db. Replace any previously installed collation sequence factory.
 23792  //  */
 23793  func Xsqlite3_collation_needed16(tls *crt.TLS, _db *Xsqlite3, _pCollNeededArg unsafe.Pointer, _xCollNeeded16 func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer)) (r0 int32) {
 23794  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
 23795  		return _sqlite3MisuseError(tls, int32(143742))
 23796  	}
 23797  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 23798  	*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8))(unsafe.Pointer(&_db.XxCollNeeded)) = nil
 23799  	*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer))(unsafe.Pointer(&_db.XxCollNeeded16)) = _xCollNeeded16
 23800  	_db.XpCollNeededArg = _pCollNeededArg
 23801  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 23802  	return int32(0)
 23803  }
 23804  
 23805  // C comment
 23806  //  /**************************** sqlite3_column_  *******************************
 23807  //  ** The following routines are used to access elements of the current row
 23808  //  ** in the result set.
 23809  //  */
 23810  func Xsqlite3_column_blob(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 unsafe.Pointer) {
 23811  	var _val unsafe.Pointer
 23812  	_val = Xsqlite3_value_blob(tls, _columnMem(tls, _pStmt, _i))
 23813  	_columnMallocFailure(tls, _pStmt)
 23814  	return _val
 23815  }
 23816  
 23817  // C comment
 23818  //  /**************************** sqlite3_value_  *******************************
 23819  //  ** The following routines extract information from a Mem or sqlite3_value
 23820  //  ** structure.
 23821  //  */
 23822  func Xsqlite3_value_blob(tls *crt.TLS, _pVal *XMem) (r0 unsafe.Pointer) {
 23823  	var _p *XMem
 23824  	_p = _pVal
 23825  	if (int32(_p.Xflags) & int32(18)) == 0 {
 23826  		goto _0
 23827  	}
 23828  	if func() int32 {
 23829  		if (int32(_p.Xflags) & int32(16384)) != 0 {
 23830  			return _sqlite3VdbeMemExpandBlob(tls, _p)
 23831  		}
 23832  		return int32(0)
 23833  	}() != int32(0) {
 23834  		func() {
 23835  			if int32(_p.Xflags) != int32(1) || _p.Xz != nil {
 23836  				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)))
 23837  				crt.X__builtin_abort(tls)
 23838  			}
 23839  		}()
 23840  		return nil
 23841  	}
 23842  	{
 23843  		p := &_p.Xflags
 23844  		*p = uint16(int32(*p) | int32(16))
 23845  	}
 23846  	return unsafe.Pointer(func() *int8 {
 23847  		if _p.Xn != 0 {
 23848  			return _p.Xz
 23849  		}
 23850  		return nil
 23851  	}())
 23852  
 23853  _0:
 23854  	return unsafe.Pointer(Xsqlite3_value_text(tls, _pVal))
 23855  }
 23856  
 23857  var _sqlite3_value_blobØ00__func__Ø000 [19]int8
 23858  
 23859  func init() {
 23860  	crt.Xstrncpy(nil, &_sqlite3_value_blobØ00__func__Ø000[0], str(23594), 19)
 23861  }
 23862  
 23863  // C comment
 23864  //  /*
 23865  //  ** Check to see if column iCol of the given statement is valid.  If
 23866  //  ** it is, return a pointer to the Mem for the value of that column.
 23867  //  ** If iCol is not valid, return a pointer to a Mem which has a value
 23868  //  ** of NULL.
 23869  //  */
 23870  func _columnMem(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 *XMem) {
 23871  	var _pVm *TVdbe
 23872  	var _pOut *XMem
 23873  	_pVm = (*TVdbe)(_pStmt)
 23874  	if _pVm == nil {
 23875  		return _columnNullValue(tls)
 23876  	}
 23877  	func() {
 23878  		if _pVm.Xdb == nil {
 23879  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(77067), unsafe.Pointer(&_columnMemØ00__func__Ø000), unsafe.Pointer(str(23613)))
 23880  			crt.X__builtin_abort(tls)
 23881  		}
 23882  	}()
 23883  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pVm.Xdb).Xmutex))
 23884  	if (((*XMem)(_pVm.XpResultSet) != nil) && (_i < int32(_pVm.XnResColumn))) && (_i >= int32(0)) {
 23885  		_pOut = elem25((*XMem)(_pVm.XpResultSet), uintptr(_i))
 23886  		goto _6
 23887  	}
 23888  	_sqlite3Error(tls, (*Xsqlite3)(_pVm.Xdb), int32(25))
 23889  	_pOut = _columnNullValue(tls)
 23890  _6:
 23891  	return _pOut
 23892  }
 23893  
 23894  // C comment
 23895  //  /*
 23896  //  ** Return a pointer to static memory containing an SQL NULL value.
 23897  //  */
 23898  func _columnNullValue(tls *crt.TLS) (r0 *XMem) {
 23899  	return &_columnNullValueØ00nullMemØ001
 23900  }
 23901  
 23902  var _columnNullValueØ00nullMemØ001 XMem
 23903  
 23904  func init() {
 23905  	_columnNullValueØ00nullMemØ001 = XMem{Xflags: uint16(1)}
 23906  }
 23907  
 23908  var _columnMemØ00__func__Ø000 [10]int8
 23909  
 23910  func init() {
 23911  	crt.Xstrncpy(nil, &_columnMemØ00__func__Ø000[0], str(23621), 10)
 23912  }
 23913  
 23914  // C comment
 23915  //  /*
 23916  //  ** This function is called after invoking an sqlite3_value_XXX function on a
 23917  //  ** column value (i.e. a value returned by evaluating an SQL expression in the
 23918  //  ** select list of a SELECT statement) that may cause a malloc() failure. If
 23919  //  ** malloc() has failed, the threads mallocFailed flag is cleared and the result
 23920  //  ** code of statement pStmt set to SQLITE_NOMEM.
 23921  //  **
 23922  //  ** Specifically, this is called from within:
 23923  //  **
 23924  //  **     sqlite3_column_int()
 23925  //  **     sqlite3_column_int64()
 23926  //  **     sqlite3_column_text()
 23927  //  **     sqlite3_column_text16()
 23928  //  **     sqlite3_column_real()
 23929  //  **     sqlite3_column_bytes()
 23930  //  **     sqlite3_column_bytes16()
 23931  //  **     sqiite3_column_blob()
 23932  //  */
 23933  func _columnMallocFailure(tls *crt.TLS, _pStmt unsafe.Pointer) {
 23934  	var _p *TVdbe
 23935  	_p = (*TVdbe)(_pStmt)
 23936  	if _p != nil {
 23937  		func() {
 23938  			if (*Xsqlite3)(_p.Xdb) == nil {
 23939  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(77105), unsafe.Pointer(&_columnMallocFailureØ00__func__Ø000), unsafe.Pointer(str(23631)))
 23940  				crt.X__builtin_abort(tls)
 23941  			}
 23942  		}()
 23943  		func() {
 23944  			if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 23945  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(77106), unsafe.Pointer(&_columnMallocFailureØ00__func__Ø000), unsafe.Pointer(str(8939)))
 23946  				crt.X__builtin_abort(tls)
 23947  			}
 23948  		}()
 23949  		_p.Xrc = _sqlite3ApiExit(tls, (*Xsqlite3)(_p.Xdb), _p.Xrc)
 23950  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex))
 23951  	}
 23952  }
 23953  
 23954  var _columnMallocFailureØ00__func__Ø000 [20]int8
 23955  
 23956  func init() {
 23957  	crt.Xstrncpy(nil, &_columnMallocFailureØ00__func__Ø000[0], str(23640), 20)
 23958  }
 23959  
 23960  func Xsqlite3_column_bytes(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 int32) {
 23961  	var _val int32
 23962  	_val = Xsqlite3_value_bytes(tls, _columnMem(tls, _pStmt, _i))
 23963  	_columnMallocFailure(tls, _pStmt)
 23964  	return _val
 23965  }
 23966  
 23967  func Xsqlite3_column_bytes16(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 int32) {
 23968  	var _val int32
 23969  	_val = Xsqlite3_value_bytes16(tls, _columnMem(tls, _pStmt, _i))
 23970  	_columnMallocFailure(tls, _pStmt)
 23971  	return _val
 23972  }
 23973  
 23974  func Xsqlite3_value_bytes16(tls *crt.TLS, _pVal *XMem) (r0 int32) {
 23975  	return _sqlite3ValueBytes(tls, _pVal, uint8(2))
 23976  }
 23977  
 23978  // C comment
 23979  //  /*
 23980  //  ** Return the number of columns in the result set for the statement pStmt.
 23981  //  */
 23982  func Xsqlite3_column_count(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
 23983  	var _pVm *TVdbe
 23984  	_pVm = (*TVdbe)(_pStmt)
 23985  	return func() int32 {
 23986  		if _pVm != nil {
 23987  			return int32(_pVm.XnResColumn)
 23988  		}
 23989  		return int32(0)
 23990  	}()
 23991  }
 23992  
 23993  // C comment
 23994  //  /*
 23995  //  ** Return the column declaration type (if applicable) of the 'i'th column
 23996  //  ** of the result set of SQL statement pStmt.
 23997  //  */
 23998  func Xsqlite3_column_decltype(tls *crt.TLS, _pStmt unsafe.Pointer, _N int32) (r0 *int8) {
 23999  	return (*int8)(_columnName(tls, _pStmt, _N, func() func(*crt.TLS, *XMem) unsafe.Pointer {
 24000  		v := Xsqlite3_value_text
 24001  		return *(*func(*crt.TLS, *XMem) unsafe.Pointer)(unsafe.Pointer(&v))
 24002  	}(), int32(1)))
 24003  }
 24004  
 24005  // C comment
 24006  //  /*
 24007  //  ** Convert the N-th element of pStmt->pColName[] into a string using
 24008  //  ** xFunc() then return that string.  If N is out of range, return 0.
 24009  //  **
 24010  //  ** There are up to 5 names for each column.  useType determines which
 24011  //  ** name is returned.  Here are the names:
 24012  //  **
 24013  //  **    0      The column name as it should be displayed for output
 24014  //  **    1      The datatype name for the column
 24015  //  **    2      The name of the database that the column derives from
 24016  //  **    3      The name of the table that the column derives from
 24017  //  **    4      The name of the table column that the result column derives from
 24018  //  **
 24019  //  ** If the result is not a simple column reference (if it is an expression
 24020  //  ** or a constant) then useTypes 2, 3, and 4 return NULL.
 24021  //  */
 24022  func _columnName(tls *crt.TLS, _pStmt unsafe.Pointer, _N int32, _xFunc func(*crt.TLS, *XMem) unsafe.Pointer, _useType int32) (r0 unsafe.Pointer) {
 24023  	var _n int32
 24024  	var _ret unsafe.Pointer
 24025  	var _db *Xsqlite3
 24026  	var _p *TVdbe
 24027  	if _pStmt == nil {
 24028  		_sqlite3MisuseError(tls, int32(77206))
 24029  		return nil
 24030  	}
 24031  	_ret = nil
 24032  	_p = (*TVdbe)(_pStmt)
 24033  	_db = (*Xsqlite3)(_p.Xdb)
 24034  	func() {
 24035  		if _db == nil {
 24036  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(77213), unsafe.Pointer(&_columnNameØ00__func__Ø000), unsafe.Pointer(str(1219)))
 24037  			crt.X__builtin_abort(tls)
 24038  		}
 24039  	}()
 24040  	_n = Xsqlite3_column_count(tls, _pStmt)
 24041  	if _N >= _n || _N < int32(0) {
 24042  		goto _4
 24043  	}
 24044  	_N += _useType * _n
 24045  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 24046  	func() {
 24047  		if int32(_db.XmallocFailed) != int32(0) {
 24048  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(77218), unsafe.Pointer(&_columnNameØ00__func__Ø000), unsafe.Pointer(str(1262)))
 24049  			crt.X__builtin_abort(tls)
 24050  		}
 24051  	}()
 24052  	_ret = _xFunc(tls, elem25((*XMem)(_p.XaColName), uintptr(_N)))
 24053  	if _db.XmallocFailed != 0 {
 24054  		_sqlite3OomClear(tls, _db)
 24055  		_ret = nil
 24056  	}
 24057  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 24058  _4:
 24059  	return _ret
 24060  }
 24061  
 24062  var _columnNameØ00__func__Ø000 [11]int8
 24063  
 24064  func init() {
 24065  	crt.Xstrncpy(nil, &_columnNameØ00__func__Ø000[0], str(23660), 11)
 24066  }
 24067  
 24068  func Xsqlite3_column_decltype16(tls *crt.TLS, _pStmt unsafe.Pointer, _N int32) (r0 unsafe.Pointer) {
 24069  	return _columnName(tls, _pStmt, _N, Xsqlite3_value_text16, int32(1))
 24070  }
 24071  
 24072  func Xsqlite3_value_text16(tls *crt.TLS, _pVal *XMem) (r0 unsafe.Pointer) {
 24073  	return _sqlite3ValueText(tls, _pVal, uint8(2))
 24074  }
 24075  
 24076  func Xsqlite3_column_double(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 float64) {
 24077  	var _val float64
 24078  	_val = Xsqlite3_value_double(tls, _columnMem(tls, _pStmt, _i))
 24079  	_columnMallocFailure(tls, _pStmt)
 24080  	return _val
 24081  }
 24082  
 24083  func Xsqlite3_column_int(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 int32) {
 24084  	var _val int32
 24085  	_val = Xsqlite3_value_int(tls, _columnMem(tls, _pStmt, _i))
 24086  	_columnMallocFailure(tls, _pStmt)
 24087  	return _val
 24088  }
 24089  
 24090  func Xsqlite3_value_int(tls *crt.TLS, _pVal *XMem) (r0 int32) {
 24091  	return int32(_sqlite3VdbeIntValue(tls, _pVal))
 24092  }
 24093  
 24094  func _sqlite3VdbeIntValue(tls *crt.TLS, _pMem *XMem) (r0 int64) {
 24095  	var _flags int32
 24096  	func() {
 24097  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
 24098  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70169), unsafe.Pointer(&_sqlite3VdbeIntValueØ00__func__Ø000), unsafe.Pointer(str(4568)))
 24099  			crt.X__builtin_abort(tls)
 24100  		}
 24101  	}()
 24102  	func() {
 24103  		if (int32(uintptr(unsafe.Pointer(_pMem))) & int32(7)) != int32(0) {
 24104  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70170), unsafe.Pointer(&_sqlite3VdbeIntValueØ00__func__Ø000), unsafe.Pointer(str(6222)))
 24105  			crt.X__builtin_abort(tls)
 24106  		}
 24107  	}()
 24108  	_flags = int32(_pMem.Xflags)
 24109  	if (_flags & int32(4)) != 0 {
 24110  		return *(*int64)(unsafe.Pointer(&_pMem.Xu))
 24111  	}
 24112  	if (_flags & int32(8)) != 0 {
 24113  		return _doubleToInt64(tls, *(*float64)(unsafe.Pointer(&_pMem.Xu)))
 24114  	}
 24115  	if (_flags & int32(18)) != 0 {
 24116  		func() {
 24117  			if _pMem.Xz == nil && _pMem.Xn != int32(0) {
 24118  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70177), unsafe.Pointer(&_sqlite3VdbeIntValueØ00__func__Ø000), unsafe.Pointer(str(23671)))
 24119  				crt.X__builtin_abort(tls)
 24120  			}
 24121  		}()
 24122  		return _memIntValue(tls, _pMem)
 24123  	}
 24124  	return 0
 24125  }
 24126  
 24127  var _sqlite3VdbeIntValueØ00__func__Ø000 [20]int8
 24128  
 24129  func init() {
 24130  	crt.Xstrncpy(nil, &_sqlite3VdbeIntValueØ00__func__Ø000[0], str(23693), 20)
 24131  }
 24132  
 24133  // C comment
 24134  //  /*
 24135  //  ** Convert a 64-bit IEEE double into a 64-bit signed integer.
 24136  //  ** If the double is out of range of a 64-bit signed integer then
 24137  //  ** return the closest available 64-bit signed integer.
 24138  //  */
 24139  func _doubleToInt64(tls *crt.TLS, _r float64) (r0 int64) {
 24140  	if _r <= float64(_doubleToInt64Ø00minIntØ002) {
 24141  		return _doubleToInt64Ø00minIntØ002
 24142  	}
 24143  	if _r >= float64(_doubleToInt64Ø00maxIntØ001) {
 24144  		return _doubleToInt64Ø00maxIntØ001
 24145  	}
 24146  	return int64(_r)
 24147  }
 24148  
 24149  var _doubleToInt64Ø00minIntØ002 int64
 24150  
 24151  func init() {
 24152  	_doubleToInt64Ø00minIntØ002 = int64(-9223372036854775808)
 24153  }
 24154  
 24155  var _doubleToInt64Ø00maxIntØ001 int64
 24156  
 24157  func init() {
 24158  	_doubleToInt64Ø00maxIntØ001 = int64(9223372036854775807)
 24159  }
 24160  
 24161  // C comment
 24162  //  /*
 24163  //  ** Return some kind of integer value which is the best we can do
 24164  //  ** at representing the value that *pMem describes as an integer.
 24165  //  ** If pMem is an integer, then the value is exact.  If pMem is
 24166  //  ** a floating-point then the value returned is the integer part.
 24167  //  ** If pMem is a string or blob, then we make an attempt to convert
 24168  //  ** it into an integer and return that.  If pMem represents an
 24169  //  ** an SQL-NULL value, return 0.
 24170  //  **
 24171  //  ** If pMem represents a string value, its encoding might be changed.
 24172  //  */
 24173  func _memIntValue(tls *crt.TLS, _pMem *XMem) (r0 int64) {
 24174  	var _value int64
 24175  	_value = int64(0)
 24176  	_sqlite3Atoi64(tls, _pMem.Xz, &_value, _pMem.Xn, _pMem.Xenc)
 24177  	return _value
 24178  }
 24179  
 24180  // C comment
 24181  //  /*
 24182  //  ** Convert zNum to a 64-bit signed integer.  zNum must be decimal. This
 24183  //  ** routine does *not* accept hexadecimal notation.
 24184  //  **
 24185  //  ** If the zNum value is representable as a 64-bit twos-complement
 24186  //  ** integer, then write that value into *pNum and return 0.
 24187  //  **
 24188  //  ** If zNum is exactly 9223372036854775808, return 2.  This special
 24189  //  ** case is broken out because while 9223372036854775808 cannot be a
 24190  //  ** signed 64-bit integer, its negative -9223372036854775808 can be.
 24191  //  **
 24192  //  ** If zNum is too big for a 64-bit integer and is not
 24193  //  ** 9223372036854775808  or if zNum contains any non-numeric text,
 24194  //  ** then return 1.
 24195  //  **
 24196  //  ** length is the number of bytes in the string (bytes, not characters).
 24197  //  ** The string is not necessarily zero-terminated.  The encoding is
 24198  //  ** given by enc.
 24199  //  */
 24200  func _sqlite3Atoi64(tls *crt.TLS, _zNum *int8, _pNum *int64, _length int32, _enc uint8) (r0 int32) {
 24201  	var _incr, _neg, _i, _c, _nonNum int32
 24202  	var _u uint64
 24203  	var _zStart, _zEnd *int8
 24204  	_u = uint64(0)
 24205  	_neg = int32(0)
 24206  	_c = int32(0)
 24207  	_nonNum = int32(0)
 24208  	_zEnd = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNum)) + uintptr(_length)))
 24209  	func() {
 24210  		if int32(_enc) != int32(1) && int32(_enc) != int32(2) && int32(_enc) != int32(3) {
 24211  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(28236), unsafe.Pointer(&_sqlite3Atoi64Ø00__func__Ø000), unsafe.Pointer(str(6989)))
 24212  			crt.X__builtin_abort(tls)
 24213  		}
 24214  	}()
 24215  	if int32(_enc) == int32(1) {
 24216  		_incr = int32(1)
 24217  		goto _5
 24218  	}
 24219  	_incr = int32(2)
 24220  
 24221  	_i = int32(3) - int32(_enc)
 24222  _6:
 24223  	if _i >= _length || int32(*elem1(_zNum, uintptr(_i))) != int32(0) {
 24224  		goto _10
 24225  	}
 24226  	_i += int32(2)
 24227  	goto _6
 24228  _10:
 24229  	_nonNum = bool2int(_i < _length)
 24230  	_zEnd = elem1(_zNum, uintptr(_i^int32(1)))
 24231  	*(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(int32(_enc) & int32(1))
 24232  _5:
 24233  	if (crt.P2U(unsafe.Pointer(_zNum)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_zNum))))&int32(1)) != 0 {
 24234  		*(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(_incr)
 24235  		goto _5
 24236  	}
 24237  	if crt.P2U(unsafe.Pointer(_zNum)) >= crt.P2U(unsafe.Pointer(_zEnd)) {
 24238  		goto _14
 24239  	}
 24240  	if int32(*_zNum) == int32(45) {
 24241  		_neg = int32(1)
 24242  		*(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(_incr)
 24243  		goto _17
 24244  	}
 24245  	if int32(*_zNum) == int32(43) {
 24246  		*(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(_incr)
 24247  	}
 24248  _17:
 24249  _14:
 24250  	_zStart = _zNum
 24251  _18:
 24252  	if (crt.P2U(unsafe.Pointer(_zNum)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*elem1(_zNum, 0)) == int32(48)) {
 24253  		*(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(_incr)
 24254  		goto _18
 24255  	}
 24256  	_i = int32(0)
 24257  _21:
 24258  	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) {
 24259  		goto _26
 24260  	}
 24261  	_u = ((_u * uint64(10)) + uint64(_c)) - uint64(48)
 24262  	_i += _incr
 24263  	goto _21
 24264  _26:
 24265  	if _u > uint64(9223372036854775807) {
 24266  		*_pNum = func() int64 {
 24267  			if _neg != 0 {
 24268  				return int64(-9223372036854775808)
 24269  			}
 24270  			return int64(9223372036854775807)
 24271  		}()
 24272  		goto _32
 24273  	}
 24274  	if _neg != 0 {
 24275  		*_pNum = -int64(_u)
 24276  		goto _32
 24277  	}
 24278  	*_pNum = int64(_u)
 24279  _32:
 24280  	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 {
 24281  		return int32(1)
 24282  	}
 24283  	if _i < (int32(19) * _incr) {
 24284  		func() {
 24285  			if _u > uint64(9223372036854775807) {
 24286  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(28281), unsafe.Pointer(&_sqlite3Atoi64Ø00__func__Ø000), unsafe.Pointer(str(23713)))
 24287  				crt.X__builtin_abort(tls)
 24288  			}
 24289  		}()
 24290  		return int32(0)
 24291  	}
 24292  	_c = _compare2pow63(tls, _zNum, _incr)
 24293  	if _c < int32(0) {
 24294  		func() {
 24295  			if _u > uint64(9223372036854775807) {
 24296  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(28288), unsafe.Pointer(&_sqlite3Atoi64Ø00__func__Ø000), unsafe.Pointer(str(23713)))
 24297  				crt.X__builtin_abort(tls)
 24298  			}
 24299  		}()
 24300  		return int32(0)
 24301  	}
 24302  	if _c > int32(0) {
 24303  		return int32(1)
 24304  	}
 24305  	func() {
 24306  		if (_u - uint64(1)) != uint64(9223372036854775807) {
 24307  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(28296), unsafe.Pointer(&_sqlite3Atoi64Ø00__func__Ø000), unsafe.Pointer(str(23730)))
 24308  			crt.X__builtin_abort(tls)
 24309  		}
 24310  	}()
 24311  	return func() int32 {
 24312  		if _neg != 0 {
 24313  			return int32(0)
 24314  		}
 24315  		return int32(2)
 24316  	}()
 24317  }
 24318  
 24319  var _sqlite3Atoi64Ø00__func__Ø000 [14]int8
 24320  
 24321  func init() {
 24322  	crt.Xstrncpy(nil, &_sqlite3Atoi64Ø00__func__Ø000[0], str(23749), 14)
 24323  }
 24324  
 24325  // C comment
 24326  //  /*
 24327  //  ** Compare the 19-character string zNum against the text representation
 24328  //  ** value 2^63:  9223372036854775808.  Return negative, zero, or positive
 24329  //  ** if zNum is less than, equal to, or greater than the string.
 24330  //  ** Note that zNum must contain exactly 19 characters.
 24331  //  **
 24332  //  ** Unlike memcmp() this routine is guaranteed to return the difference
 24333  //  ** in the values of the last digit if the only difference is in the
 24334  //  ** last digit.  So, for example,
 24335  //  **
 24336  //  **      compare2pow63("9223372036854775800", 1)
 24337  //  **
 24338  //  ** will return -8.
 24339  //  */
 24340  func _compare2pow63(tls *crt.TLS, _zNum *int8, _incr int32) (r0 int32) {
 24341  	var _c, _i int32
 24342  	var _pow63 *int8
 24343  	_c = int32(0)
 24344  	_pow63 = str(23763)
 24345  	_i = int32(0)
 24346  _0:
 24347  	if _c != int32(0) || _i >= int32(18) {
 24348  		goto _4
 24349  	}
 24350  	_c = (int32(*elem1(_zNum, uintptr(_i*_incr))) - int32(*elem1(_pow63, uintptr(_i)))) * int32(10)
 24351  	_i += 1
 24352  	goto _0
 24353  _4:
 24354  	if _c == int32(0) {
 24355  		_c = int32(*elem1(_zNum, uintptr(int32(18)*_incr))) - int32(56)
 24356  	}
 24357  	return _c
 24358  }
 24359  
 24360  func Xsqlite3_column_int64(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 int64) {
 24361  	var _val int64
 24362  	_val = Xsqlite3_value_int64(tls, _columnMem(tls, _pStmt, _i))
 24363  	_columnMallocFailure(tls, _pStmt)
 24364  	return _val
 24365  }
 24366  
 24367  func Xsqlite3_value_int64(tls *crt.TLS, _pVal *XMem) (r0 int64) {
 24368  	return _sqlite3VdbeIntValue(tls, _pVal)
 24369  }
 24370  
 24371  // C comment
 24372  //  /*
 24373  //  ** Return the name of the Nth column of the result set returned by SQL
 24374  //  ** statement pStmt.
 24375  //  */
 24376  func Xsqlite3_column_name(tls *crt.TLS, _pStmt unsafe.Pointer, _N int32) (r0 *int8) {
 24377  	return (*int8)(_columnName(tls, _pStmt, _N, func() func(*crt.TLS, *XMem) unsafe.Pointer {
 24378  		v := Xsqlite3_value_text
 24379  		return *(*func(*crt.TLS, *XMem) unsafe.Pointer)(unsafe.Pointer(&v))
 24380  	}(), int32(0)))
 24381  }
 24382  
 24383  func Xsqlite3_column_name16(tls *crt.TLS, _pStmt unsafe.Pointer, _N int32) (r0 unsafe.Pointer) {
 24384  	return _columnName(tls, _pStmt, _N, Xsqlite3_value_text16, int32(0))
 24385  }
 24386  
 24387  func Xsqlite3_column_text(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 *uint8) {
 24388  	var _val *uint8
 24389  	_val = Xsqlite3_value_text(tls, _columnMem(tls, _pStmt, _i))
 24390  	_columnMallocFailure(tls, _pStmt)
 24391  	return _val
 24392  }
 24393  
 24394  func Xsqlite3_column_text16(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 unsafe.Pointer) {
 24395  	var _val unsafe.Pointer
 24396  	_val = Xsqlite3_value_text16(tls, _columnMem(tls, _pStmt, _i))
 24397  	_columnMallocFailure(tls, _pStmt)
 24398  	return _val
 24399  }
 24400  
 24401  // C comment
 24402  //  /* SQLITE_OMIT_UTF16 */
 24403  func Xsqlite3_column_type(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 int32) {
 24404  	var _iType int32
 24405  	_iType = Xsqlite3_value_type(tls, _columnMem(tls, _pStmt, _i))
 24406  	_columnMallocFailure(tls, _pStmt)
 24407  	return _iType
 24408  }
 24409  
 24410  func Xsqlite3_column_value(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 *XMem) {
 24411  	var _pOut *XMem
 24412  	_pOut = _columnMem(tls, _pStmt, _i)
 24413  	if (int32(_pOut.Xflags) & int32(2048)) != 0 {
 24414  		{
 24415  			p := &_pOut.Xflags
 24416  			*p = uint16(int32(*p) & int32(-2049))
 24417  		}
 24418  		{
 24419  			p := &_pOut.Xflags
 24420  			*p = uint16(int32(*p) | int32(4096))
 24421  		}
 24422  	}
 24423  	_columnMallocFailure(tls, _pStmt)
 24424  	return _pOut
 24425  }
 24426  
 24427  // C comment
 24428  //  /*
 24429  //  ** Register a function to be invoked when a transaction commits.
 24430  //  ** If the invoked function returns non-zero, then the commit becomes a
 24431  //  ** rollback.
 24432  //  */
 24433  func Xsqlite3_commit_hook(tls *crt.TLS, _db *Xsqlite3, _xCallback func(*crt.TLS, unsafe.Pointer) int32, _pArg unsafe.Pointer) (r0 unsafe.Pointer) {
 24434  	var _pOld unsafe.Pointer
 24435  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
 24436  		_sqlite3MisuseError(tls, int32(142385))
 24437  		return nil
 24438  	}
 24439  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 24440  	_pOld = _db.XpCommitArg
 24441  	_db.XxCommitCallback = _xCallback
 24442  	_db.XpCommitArg = _pArg
 24443  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 24444  	return _pOld
 24445  }
 24446  
 24447  // C comment
 24448  //  /*
 24449  //  ** Return TRUE if the given SQL string ends in a semicolon.
 24450  //  **
 24451  //  ** Special handling is require for CREATE TRIGGER statements.
 24452  //  ** Whenever the CREATE TRIGGER keywords are seen, the statement
 24453  //  ** must end with ";END;".
 24454  //  **
 24455  //  ** This implementation uses a state machine with 8 states:
 24456  //  **
 24457  //  **   (0) INVALID   We have not yet seen a non-whitespace character.
 24458  //  **
 24459  //  **   (1) START     At the beginning or end of an SQL statement.  This routine
 24460  //  **                 returns 1 if it ends in the START state and 0 if it ends
 24461  //  **                 in any other state.
 24462  //  **
 24463  //  **   (2) NORMAL    We are in the middle of statement which ends with a single
 24464  //  **                 semicolon.
 24465  //  **
 24466  //  **   (3) EXPLAIN   The keyword EXPLAIN has been seen at the beginning of
 24467  //  **                 a statement.
 24468  //  **
 24469  //  **   (4) CREATE    The keyword CREATE has been seen at the beginning of a
 24470  //  **                 statement, possibly preceded by EXPLAIN and/or followed by
 24471  //  **                 TEMP or TEMPORARY
 24472  //  **
 24473  //  **   (5) TRIGGER   We are in the middle of a trigger definition that must be
 24474  //  **                 ended by a semicolon, the keyword END, and another semicolon.
 24475  //  **
 24476  //  **   (6) SEMI      We've seen the first semicolon in the ";END;" that occurs at
 24477  //  **                 the end of a trigger definition.
 24478  //  **
 24479  //  **   (7) END       We've seen the ";END" of the ";END;" that occurs at the end
 24480  //  **                 of a trigger definition.
 24481  //  **
 24482  //  ** Transitions between states above are determined by tokens extracted
 24483  //  ** from the input.  The following tokens are significant:
 24484  //  **
 24485  //  **   (0) tkSEMI      A semicolon.
 24486  //  **   (1) tkWS        Whitespace.
 24487  //  **   (2) tkOTHER     Any other SQL token.
 24488  //  **   (3) tkEXPLAIN   The "explain" keyword.
 24489  //  **   (4) tkCREATE    The "create" keyword.
 24490  //  **   (5) tkTEMP      The "temp" or "temporary" keyword.
 24491  //  **   (6) tkTRIGGER   The "trigger" keyword.
 24492  //  **   (7) tkEND       The "end" keyword.
 24493  //  **
 24494  //  ** Whitespace never causes a state transition and is always ignored.
 24495  //  ** This means that a SQL string of all whitespace is invalid.
 24496  //  **
 24497  //  ** If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed
 24498  //  ** to recognize the end of a trigger can be omitted.  All we have to do
 24499  //  ** is look for a semicolon that is not part of an string or comment.
 24500  //  */
 24501  func Xsqlite3_complete(tls *crt.TLS, _zSql *int8) (r0 int32) {
 24502  	var _14_c, _17_nId int32
 24503  	var _state, _token uint8
 24504  	_state = uint8(0)
 24505  	if _zSql == nil {
 24506  		_sqlite3MisuseError(tls, int32(140223))
 24507  		return int32(0)
 24508  	}
 24509  _0:
 24510  	if (*_zSql) == 0 {
 24511  		goto _2
 24512  	}
 24513  	switch int32(*_zSql) {
 24514  	case int32(9):
 24515  		goto _5
 24516  	case int32(10):
 24517  		goto _5
 24518  	case int32(12):
 24519  		goto _5
 24520  	case int32(13):
 24521  		goto _5
 24522  	case int32(32):
 24523  		goto _5
 24524  	case int32(34):
 24525  		goto _13
 24526  	case int32(39):
 24527  		goto _13
 24528  	case int32(45):
 24529  		goto _11
 24530  	case int32(47):
 24531  		goto _10
 24532  	case int32(59):
 24533  		goto _4
 24534  	case int32(91):
 24535  		goto _12
 24536  	case int32(96):
 24537  		goto _13
 24538  	default:
 24539  		goto _16
 24540  	}
 24541  
 24542  _4:
 24543  	_token = 0
 24544  	goto _17
 24545  _5:
 24546  	_token = uint8(1)
 24547  	goto _17
 24548  _10:
 24549  	if int32(*elem1(_zSql, uintptr(1))) != int32(42) {
 24550  		_token = uint8(2)
 24551  		goto _17
 24552  	}
 24553  	*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(int32(2))
 24554  _19:
 24555  	if ((*elem1(_zSql, 0)) != 0) && ((int32(*elem1(_zSql, 0)) != int32(42)) || (int32(*elem1(_zSql, uintptr(1))) != int32(47))) {
 24556  		*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
 24557  		goto _19
 24558  	}
 24559  	if int32(*elem1(_zSql, 0)) == int32(0) {
 24560  		return int32(0)
 24561  	}
 24562  	*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
 24563  	_token = uint8(1)
 24564  	goto _17
 24565  _11:
 24566  	if int32(*elem1(_zSql, uintptr(1))) != int32(45) {
 24567  		_token = uint8(2)
 24568  		goto _17
 24569  	}
 24570  _24:
 24571  	if ((*_zSql) != 0) && (int32(*_zSql) != int32(10)) {
 24572  		*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
 24573  		goto _24
 24574  	}
 24575  	if int32(*_zSql) == int32(0) {
 24576  		return bool2int(int32(_state) == int32(1))
 24577  	}
 24578  	_token = uint8(1)
 24579  	goto _17
 24580  _12:
 24581  	*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
 24582  _29:
 24583  	if ((*_zSql) != 0) && (int32(*_zSql) != int32(93)) {
 24584  		*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
 24585  		goto _29
 24586  	}
 24587  	if int32(*_zSql) == int32(0) {
 24588  		return int32(0)
 24589  	}
 24590  	_token = uint8(2)
 24591  	goto _17
 24592  _13:
 24593  	_14_c = int32(*_zSql)
 24594  	*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
 24595  _33:
 24596  	if ((*_zSql) != 0) && (int32(*_zSql) != _14_c) {
 24597  		*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
 24598  		goto _33
 24599  	}
 24600  	if int32(*_zSql) == int32(0) {
 24601  		return int32(0)
 24602  	}
 24603  	_token = uint8(2)
 24604  	goto _17
 24605  _16:
 24606  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_zSql)))) & int32(70)) == int32(0) {
 24607  		goto _37
 24608  	}
 24609  	_17_nId = int32(1)
 24610  _38:
 24611  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_zSql, uintptr(_17_nId)))))) & int32(70)) == int32(0) {
 24612  		goto _41
 24613  	}
 24614  	_17_nId += 1
 24615  	goto _38
 24616  _41:
 24617  	switch int32(*_zSql) {
 24618  	case int32(67):
 24619  		goto _43
 24620  	case int32(69):
 24621  		goto _47
 24622  	case int32(84):
 24623  		goto _45
 24624  	case int32(99):
 24625  		goto _43
 24626  	case int32(101):
 24627  		goto _47
 24628  	case int32(116):
 24629  		goto _45
 24630  	default:
 24631  		goto _49
 24632  	}
 24633  
 24634  _43:
 24635  	if (_17_nId == int32(6)) && (Xsqlite3_strnicmp(tls, _zSql, str(23782), int32(6)) == int32(0)) {
 24636  		_token = uint8(4)
 24637  		goto _52
 24638  	}
 24639  	_token = uint8(2)
 24640  _52:
 24641  	goto _53
 24642  _45:
 24643  	if (_17_nId == int32(7)) && (Xsqlite3_strnicmp(tls, _zSql, str(23789), int32(7)) == int32(0)) {
 24644  		_token = uint8(6)
 24645  		goto _62
 24646  	}
 24647  	if (_17_nId == int32(4)) && (Xsqlite3_strnicmp(tls, _zSql, str(23797), int32(4)) == int32(0)) {
 24648  		_token = uint8(5)
 24649  		goto _62
 24650  	}
 24651  	if (_17_nId == int32(9)) && (Xsqlite3_strnicmp(tls, _zSql, str(23802), int32(9)) == int32(0)) {
 24652  		_token = uint8(5)
 24653  		goto _62
 24654  	}
 24655  	_token = uint8(2)
 24656  _62:
 24657  	goto _53
 24658  _47:
 24659  	if (_17_nId == int32(3)) && (Xsqlite3_strnicmp(tls, _zSql, str(23812), int32(3)) == int32(0)) {
 24660  		_token = uint8(7)
 24661  		goto _68
 24662  	}
 24663  	if (_17_nId == int32(7)) && (Xsqlite3_strnicmp(tls, _zSql, str(23816), int32(7)) == int32(0)) {
 24664  		_token = uint8(3)
 24665  		goto _68
 24666  	}
 24667  	_token = uint8(2)
 24668  _68:
 24669  	goto _53
 24670  _49:
 24671  	_token = uint8(2)
 24672  	goto _53
 24673  _53:
 24674  	*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(_17_nId - int32(1))
 24675  	goto _69
 24676  _37:
 24677  	_token = uint8(2)
 24678  _69:
 24679  	goto _17
 24680  _17:
 24681  	_state = *elem15((*uint8)(unsafe.Pointer(elem47((*[8]uint8)(unsafe.Pointer(&_sqlite3_completeØ00transØ001)), uintptr(_state)))), uintptr(_token))
 24682  	*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
 24683  	goto _0
 24684  _2:
 24685  	return bool2int(int32(_state) == int32(1))
 24686  }
 24687  
 24688  var _sqlite3_completeØ00transØ001 [8][8]uint8
 24689  
 24690  func init() {
 24691  	_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)}}
 24692  }
 24693  
 24694  // C comment
 24695  //  /*
 24696  //  ** This routine is the same as the sqlite3_complete() routine described
 24697  //  ** above, except that the parameter is required to be UTF-16 encoded, not
 24698  //  ** UTF-8.
 24699  //  */
 24700  func Xsqlite3_complete16(tls *crt.TLS, _zSql unsafe.Pointer) (r0 int32) {
 24701  	var _rc int32
 24702  	var _zSql8 *int8
 24703  	var _pVal *XMem
 24704  	_rc = Xsqlite3_initialize(tls)
 24705  	if _rc != 0 {
 24706  		return _rc
 24707  	}
 24708  	_pVal = _sqlite3ValueNew(tls, nil)
 24709  	_sqlite3ValueSetStr(tls, _pVal, int32(-1), _zSql, uint8(2), nil)
 24710  	_zSql8 = (*int8)(_sqlite3ValueText(tls, _pVal, uint8(1)))
 24711  	if _zSql8 != nil {
 24712  		_rc = Xsqlite3_complete(tls, _zSql8)
 24713  		goto _2
 24714  	}
 24715  	_rc = _sqlite3NomemError(tls, int32(140368))
 24716  _2:
 24717  	_sqlite3ValueFree(tls, _pVal)
 24718  	return _rc & int32(255)
 24719  }
 24720  
 24721  // C comment
 24722  //  /*
 24723  //  ** Register a new collation sequence with the database handle db.
 24724  //  */
 24725  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) {
 24726  	return Xsqlite3_create_collation_v2(tls, _db, _zName, _enc, _pCtx, _xCompare, nil)
 24727  }
 24728  
 24729  // C comment
 24730  //  /*
 24731  //  ** Register a new collation sequence with the database handle db.
 24732  //  */
 24733  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) {
 24734  	var _rc int32
 24735  	if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zName == nil) {
 24736  		return _sqlite3MisuseError(tls, int32(143671))
 24737  	}
 24738  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 24739  	func() {
 24740  		if _db.XmallocFailed != 0 {
 24741  			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)))
 24742  			crt.X__builtin_abort(tls)
 24743  		}
 24744  	}()
 24745  	_rc = _createCollation(tls, _db, _zName, uint8(_enc), _pCtx, _xCompare, _xDel)
 24746  	_rc = _sqlite3ApiExit(tls, _db, _rc)
 24747  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 24748  	return _rc
 24749  }
 24750  
 24751  var _sqlite3_create_collation_v2Ø00__func__Ø000 [28]int8
 24752  
 24753  func init() {
 24754  	crt.Xstrncpy(nil, &_sqlite3_create_collation_v2Ø00__func__Ø000[0], str(23842), 28)
 24755  }
 24756  
 24757  // C comment
 24758  //  /*
 24759  //  ** Create a new collating function for database "db".  The name is zName
 24760  //  ** and the encoding is enc.
 24761  //  */
 24762  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) {
 24763  	var _enc2, _5_j int32
 24764  	var _pColl, _5_aColl, _6_p *XCollSeq
 24765  	func() {
 24766  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 24767  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142821), unsafe.Pointer(&_createCollationØ00__func__Ø000), unsafe.Pointer(str(881)))
 24768  			crt.X__builtin_abort(tls)
 24769  		}
 24770  	}()
 24771  	_enc2 = int32(_enc)
 24772  	if (_enc2 == int32(4)) || (_enc2 == int32(8)) {
 24773  		_enc2 = int32(2)
 24774  	}
 24775  	if (_enc2 < int32(1)) || (_enc2 > int32(3)) {
 24776  		return _sqlite3MisuseError(tls, int32(142834))
 24777  	}
 24778  	_pColl = _sqlite3FindCollSeq(tls, _db, uint8(_enc2), _zName, int32(0))
 24779  	if _pColl == nil || _pColl.XxCmp == nil {
 24780  		goto _7
 24781  	}
 24782  	if _db.XnVdbeActive != 0 {
 24783  		_sqlite3ErrorWithMsg(tls, _db, int32(5), str(23870))
 24784  		return int32(5)
 24785  	}
 24786  	_sqlite3ExpirePreparedStatements(tls, _db)
 24787  	if (int32(_pColl.Xenc) & int32(-9)) != _enc2 {
 24788  		goto _9
 24789  	}
 24790  	_5_aColl = (*XCollSeq)(_sqlite3HashFind(tls, &_db.XaCollSeq, _zName))
 24791  	_5_j = int32(0)
 24792  _10:
 24793  	if _5_j >= int32(3) {
 24794  		goto _13
 24795  	}
 24796  	_6_p = elem29(_5_aColl, uintptr(_5_j))
 24797  	if int32(_6_p.Xenc) != int32(_pColl.Xenc) {
 24798  		goto _14
 24799  	}
 24800  	if _6_p.XxDel != nil {
 24801  		_6_p.XxDel(tls, _6_p.XpUser)
 24802  	}
 24803  	_6_p.XxCmp = nil
 24804  _14:
 24805  	_5_j += 1
 24806  	goto _10
 24807  _13:
 24808  _9:
 24809  _7:
 24810  	_pColl = _sqlite3FindCollSeq(tls, _db, uint8(_enc2), _zName, int32(1))
 24811  	if _pColl == nil {
 24812  		return _sqlite3NomemError(tls, int32(142872))
 24813  	}
 24814  	_pColl.XxCmp = _xCompare
 24815  	_pColl.XpUser = _pCtx
 24816  	_pColl.XxDel = _xDel
 24817  	_pColl.Xenc = uint8(_enc2 | (int32(_enc) & int32(8)))
 24818  	_sqlite3Error(tls, _db, int32(0))
 24819  	return int32(0)
 24820  }
 24821  
 24822  var _createCollationØ00__func__Ø000 [16]int8
 24823  
 24824  func init() {
 24825  	crt.Xstrncpy(nil, &_createCollationØ00__func__Ø000[0], str(23938), 16)
 24826  }
 24827  
 24828  // C comment
 24829  //  /*
 24830  //  ** Parameter zName points to a UTF-8 encoded string nName bytes long.
 24831  //  ** Return the CollSeq* pointer for the collation sequence named zName
 24832  //  ** for the encoding 'enc' from the database 'db'.
 24833  //  **
 24834  //  ** If the entry specified is not found and 'create' is true, then create a
 24835  //  ** new entry.  Otherwise return NULL.
 24836  //  **
 24837  //  ** A separate function sqlite3LocateCollSeq() is a wrapper around
 24838  //  ** this routine.  sqlite3LocateCollSeq() invokes the collation factory
 24839  //  ** if necessary and generates an error message if the collating sequence
 24840  //  ** cannot be found.
 24841  //  **
 24842  //  ** See also: sqlite3LocateCollSeq(), sqlite3GetCollSeq()
 24843  //  */
 24844  func _sqlite3FindCollSeq(tls *crt.TLS, _db *Xsqlite3, _enc uint8, _zName *int8, _create int32) (r0 *XCollSeq) {
 24845  	var _pColl *XCollSeq
 24846  	if _zName != nil {
 24847  		_pColl = _findCollSeqEntry(tls, _db, _zName, _create)
 24848  		goto _1
 24849  	}
 24850  	_pColl = (*XCollSeq)(_db.XpDfltColl)
 24851  _1:
 24852  
 24853  	func() {
 24854  		if int32(_enc) < int32(1) || int32(_enc) > int32(3) {
 24855  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104362), unsafe.Pointer(&_sqlite3FindCollSeqØ00__func__Ø000), unsafe.Pointer(str(23954)))
 24856  			crt.X__builtin_abort(tls)
 24857  		}
 24858  	}()
 24859  	if _pColl != nil {
 24860  		*(*uintptr)(unsafe.Pointer(&_pColl)) += 20 * uintptr(int32(_enc)-int32(1))
 24861  	}
 24862  	return _pColl
 24863  }
 24864  
 24865  // C comment
 24866  //  /*
 24867  //  ** Locate and return an entry from the db.aCollSeq hash table. If the entry
 24868  //  ** specified by zName and nName is not found and parameter 'create' is
 24869  //  ** true, then create a new entry. Otherwise return NULL.
 24870  //  **
 24871  //  ** Each pointer stored in the sqlite3.aCollSeq hash table contains an
 24872  //  ** array of three CollSeq structures. The first is the collation sequence
 24873  //  ** preferred for UTF-8, the second UTF-16le, and the third UTF-16be.
 24874  //  **
 24875  //  ** Stored immediately after the three collation sequences is a copy of
 24876  //  ** the collation sequence name. A pointer to this string is stored in
 24877  //  ** each collation sequence structure.
 24878  //  */
 24879  func _findCollSeqEntry(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _create int32) (r0 *XCollSeq) {
 24880  	var _1_nName int32
 24881  	var _pColl, _2_pDel *XCollSeq
 24882  	_pColl = (*XCollSeq)(_sqlite3HashFind(tls, &_db.XaCollSeq, _zName))
 24883  	if nil != _pColl || _create == 0 {
 24884  		goto _1
 24885  	}
 24886  	_1_nName = _sqlite3Strlen30(tls, _zName)
 24887  	_pColl = (*XCollSeq)(_sqlite3DbMallocZero(tls, _db, uint64((uint32(60)+uint32(_1_nName))+uint32(1))))
 24888  	if _pColl == nil {
 24889  		goto _2
 24890  	}
 24891  	_2_pDel = nil
 24892  	elem29(_pColl, 0).XzName = (*int8)(unsafe.Pointer(elem29(_pColl, uintptr(3))))
 24893  	elem29(_pColl, 0).Xenc = uint8(1)
 24894  	elem29(_pColl, uintptr(1)).XzName = (*int8)(unsafe.Pointer(elem29(_pColl, uintptr(3))))
 24895  	elem29(_pColl, uintptr(1)).Xenc = uint8(2)
 24896  	elem29(_pColl, uintptr(2)).XzName = (*int8)(unsafe.Pointer(elem29(_pColl, uintptr(3))))
 24897  	elem29(_pColl, uintptr(2)).Xenc = uint8(3)
 24898  	crt.Xmemcpy(tls, unsafe.Pointer(elem29(_pColl, 0).XzName), unsafe.Pointer(_zName), uint32(_1_nName))
 24899  	*elem1(elem29(_pColl, 0).XzName, uintptr(_1_nName)) = 0
 24900  	_2_pDel = (*XCollSeq)(_sqlite3HashInsert(tls, &_db.XaCollSeq, elem29(_pColl, 0).XzName, unsafe.Pointer(_pColl)))
 24901  	func() {
 24902  		if _2_pDel != nil && _2_pDel != _pColl {
 24903  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104323), unsafe.Pointer(&_findCollSeqEntryØ00__func__Ø000), unsafe.Pointer(str(23994)))
 24904  			crt.X__builtin_abort(tls)
 24905  		}
 24906  	}()
 24907  	if _2_pDel != nil {
 24908  		_sqlite3OomFault(tls, _db)
 24909  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_2_pDel))
 24910  		_pColl = nil
 24911  	}
 24912  _2:
 24913  _1:
 24914  	return _pColl
 24915  }
 24916  
 24917  // C comment
 24918  //  /* Attempt to locate an element of the hash table pH with a key
 24919  //  ** that matches pKey.  Return the data for this element if it is
 24920  //  ** found, or NULL if there is no match.
 24921  //  */
 24922  func _sqlite3HashFind(tls *crt.TLS, _pH *XHash, _pKey *int8) (r0 unsafe.Pointer) {
 24923  	var _h uint32
 24924  	var _elem *XHashElem
 24925  	func() {
 24926  		if _pH == nil {
 24927  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29445), unsafe.Pointer(&_sqlite3HashFindØ00__func__Ø000), unsafe.Pointer(str(21125)))
 24928  			crt.X__builtin_abort(tls)
 24929  		}
 24930  	}()
 24931  	func() {
 24932  		if _pKey == nil {
 24933  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29446), unsafe.Pointer(&_sqlite3HashFindØ00__func__Ø000), unsafe.Pointer(str(21560)))
 24934  			crt.X__builtin_abort(tls)
 24935  		}
 24936  	}()
 24937  	_elem = _findElementWithHash(tls, _pH, _pKey, &_h)
 24938  	return func() unsafe.Pointer {
 24939  		if _elem != nil {
 24940  			return _elem.Xdata
 24941  		}
 24942  		return nil
 24943  	}()
 24944  }
 24945  
 24946  var _sqlite3HashFindØ00__func__Ø000 [16]int8
 24947  
 24948  func init() {
 24949  	crt.Xstrncpy(nil, &_sqlite3HashFindØ00__func__Ø000[0], str(24017), 16)
 24950  }
 24951  
 24952  var _findCollSeqEntryØ00__func__Ø000 [17]int8
 24953  
 24954  func init() {
 24955  	crt.Xstrncpy(nil, &_findCollSeqEntryØ00__func__Ø000[0], str(24033), 17)
 24956  }
 24957  
 24958  var _sqlite3FindCollSeqØ00__func__Ø000 [19]int8
 24959  
 24960  func init() {
 24961  	crt.Xstrncpy(nil, &_sqlite3FindCollSeqØ00__func__Ø000[0], str(24050), 19)
 24962  }
 24963  
 24964  // C comment
 24965  //  /*
 24966  //  ** Register a new collation sequence with the database handle db.
 24967  //  */
 24968  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) {
 24969  	var _rc int32
 24970  	var _zName8 *int8
 24971  	_rc = int32(0)
 24972  	if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zName == nil) {
 24973  		return _sqlite3MisuseError(tls, int32(143696))
 24974  	}
 24975  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 24976  	func() {
 24977  		if _db.XmallocFailed != 0 {
 24978  			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)))
 24979  			crt.X__builtin_abort(tls)
 24980  		}
 24981  	}()
 24982  	_zName8 = _sqlite3Utf16to8(tls, _db, _zName, int32(-1), uint8(2))
 24983  	if _zName8 != nil {
 24984  		_rc = _createCollation(tls, _db, _zName8, uint8(_enc), _pCtx, _xCompare, nil)
 24985  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zName8))
 24986  	}
 24987  	_rc = _sqlite3ApiExit(tls, _db, _rc)
 24988  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 24989  	return _rc
 24990  }
 24991  
 24992  var _sqlite3_create_collation16Ø00__func__Ø000 [27]int8
 24993  
 24994  func init() {
 24995  	crt.Xstrncpy(nil, &_sqlite3_create_collation16Ø00__func__Ø000[0], str(24069), 27)
 24996  }
 24997  
 24998  // C comment
 24999  //  /*
 25000  //  ** Convert a UTF-16 string in the native encoding into a UTF-8 string.
 25001  //  ** Memory to hold the UTF-8 string is obtained from sqlite3_malloc and must
 25002  //  ** be freed by the calling function.
 25003  //  **
 25004  //  ** NULL is returned if there is an allocation error.
 25005  //  */
 25006  func _sqlite3Utf16to8(tls *crt.TLS, _db *Xsqlite3, _z unsafe.Pointer, _nByte int32, _enc uint8) (r0 *int8) {
 25007  	var _m XMem
 25008  	crt.Xmemset(tls, unsafe.Pointer(&_m), int32(0), uint32(48))
 25009  	*(**Xsqlite3)(unsafe.Pointer(&_m.Xdb)) = _db
 25010  	_sqlite3VdbeMemSetStr(tls, &_m, (*int8)(_z), _nByte, _enc, nil)
 25011  	_sqlite3VdbeChangeEncoding(tls, &_m, int32(1))
 25012  	if _db.XmallocFailed != 0 {
 25013  		_sqlite3VdbeMemRelease(tls, &_m)
 25014  		_m.Xz = nil
 25015  	}
 25016  	func() {
 25017  		if (int32(_m.Xflags)&int32(512)) == int32(0) && _db.XmallocFailed == 0 {
 25018  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27570), unsafe.Pointer(&_sqlite3Utf16to8Ø00__func__Ø000), unsafe.Pointer(str(24096)))
 25019  			crt.X__builtin_abort(tls)
 25020  		}
 25021  	}()
 25022  	func() {
 25023  		if (int32(_m.Xflags)&int32(2)) == int32(0) && _db.XmallocFailed == 0 {
 25024  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27571), unsafe.Pointer(&_sqlite3Utf16to8Ø00__func__Ø000), unsafe.Pointer(str(24140)))
 25025  			crt.X__builtin_abort(tls)
 25026  		}
 25027  	}()
 25028  	func() {
 25029  		if _m.Xz == nil && _db.XmallocFailed == 0 {
 25030  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27572), unsafe.Pointer(&_sqlite3Utf16to8Ø00__func__Ø000), unsafe.Pointer(str(24183)))
 25031  			crt.X__builtin_abort(tls)
 25032  		}
 25033  	}()
 25034  	return _m.Xz
 25035  }
 25036  
 25037  var _sqlite3Utf16to8Ø00__func__Ø000 [16]int8
 25038  
 25039  func init() {
 25040  	crt.Xstrncpy(nil, &_sqlite3Utf16to8Ø00__func__Ø000[0], str(24207), 16)
 25041  }
 25042  
 25043  // C comment
 25044  //  /*
 25045  //  ** Create new user functions.
 25046  //  */
 25047  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) {
 25048  	return Xsqlite3_create_function_v2(tls, _db, _zFunc, _nArg, _enc, _p, _xSFunc, _xStep, _xFinal, nil)
 25049  }
 25050  
 25051  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) {
 25052  	var _rc int32
 25053  	var _pArg *XFuncDestructor
 25054  	_rc = int32(1)
 25055  	_pArg = nil
 25056  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
 25057  		return _sqlite3MisuseError(tls, int32(142198))
 25058  	}
 25059  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 25060  	if _xDestroy == nil {
 25061  		goto _1
 25062  	}
 25063  	_pArg = (*XFuncDestructor)(_sqlite3DbMallocZero(tls, _db, uint64(12)))
 25064  	if _pArg == nil {
 25065  		_xDestroy(tls, _p)
 25066  		goto _out
 25067  	}
 25068  	_pArg.XxDestroy = _xDestroy
 25069  	_pArg.XpUserData = _p
 25070  _1:
 25071  	_rc = _sqlite3CreateFunc(tls, _db, _zFunc, _nArg, _enc, _p, _xSFunc, _xStep, _xFinal, _pArg)
 25072  	if (_pArg != nil) && (_pArg.XnRef == int32(0)) {
 25073  		func() {
 25074  			if _rc == int32(0) {
 25075  				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)))
 25076  				crt.X__builtin_abort(tls)
 25077  			}
 25078  		}()
 25079  		_xDestroy(tls, _p)
 25080  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_pArg))
 25081  	}
 25082  _out:
 25083  	_rc = _sqlite3ApiExit(tls, _db, _rc)
 25084  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 25085  	return _rc
 25086  }
 25087  
 25088  // C comment
 25089  //  /*
 25090  //  ** This function is exactly the same as sqlite3_create_function(), except
 25091  //  ** that it is designed to be called by internal code. The difference is
 25092  //  ** that if a malloc() fails in sqlite3_create_function(), an error code
 25093  //  ** is returned and the mallocFailed flag cleared.
 25094  //  */
 25095  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) {
 25096  	var _nName, _extraFlags, _3_rc int32
 25097  	var _p *XFuncDef
 25098  	func() {
 25099  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 25100  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142084), unsafe.Pointer(&_sqlite3CreateFuncØ00__func__Ø000), unsafe.Pointer(str(881)))
 25101  			crt.X__builtin_abort(tls)
 25102  		}
 25103  	}()
 25104  	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))) {
 25105  		return _sqlite3MisuseError(tls, int32(142091))
 25106  	}
 25107  
 25108  	_extraFlags = _enc & int32(2048)
 25109  	_enc &= int32(7)
 25110  	if _enc == int32(4) {
 25111  		_enc = int32(2)
 25112  		goto _17
 25113  	}
 25114  	if _enc != int32(5) {
 25115  		goto _17
 25116  	}
 25117  	_3_rc = _sqlite3CreateFunc(tls, _db, _zFunctionName, _nArg, int32(1)|_extraFlags, _pUserData, _xSFunc, _xStep, _xFinal, _pDestructor)
 25118  	if _3_rc == int32(0) {
 25119  		_3_rc = _sqlite3CreateFunc(tls, _db, _zFunctionName, _nArg, int32(2)|_extraFlags, _pUserData, _xSFunc, _xStep, _xFinal, _pDestructor)
 25120  	}
 25121  	if _3_rc != int32(0) {
 25122  		return _3_rc
 25123  	}
 25124  	_enc = int32(3)
 25125  _17:
 25126  	_p = _sqlite3FindFunction(tls, _db, _zFunctionName, _nArg, uint8(_enc), 0)
 25127  	if _p == nil || (int32(_p.XfuncFlags)&int32(3)) != _enc || int32(_p.XnArg) != _nArg {
 25128  		goto _22
 25129  	}
 25130  	if _db.XnVdbeActive != 0 {
 25131  		_sqlite3ErrorWithMsg(tls, _db, int32(5), str(24223))
 25132  		func() {
 25133  			if _db.XmallocFailed != 0 {
 25134  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142135), unsafe.Pointer(&_sqlite3CreateFuncØ00__func__Ø000), unsafe.Pointer(str(23824)))
 25135  				crt.X__builtin_abort(tls)
 25136  			}
 25137  		}()
 25138  		return int32(5)
 25139  	}
 25140  	_sqlite3ExpirePreparedStatements(tls, _db)
 25141  _22:
 25142  	_p = _sqlite3FindFunction(tls, _db, _zFunctionName, _nArg, uint8(_enc), uint8(1))
 25143  	func() {
 25144  		if _p == nil && _db.XmallocFailed == 0 {
 25145  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142143), unsafe.Pointer(&_sqlite3CreateFuncØ00__func__Ø000), unsafe.Pointer(str(24286)))
 25146  			crt.X__builtin_abort(tls)
 25147  		}
 25148  	}()
 25149  	if _p == nil {
 25150  		return _sqlite3NomemError(tls, int32(142145))
 25151  	}
 25152  	_functionDestroy(tls, _db, _p)
 25153  	if _pDestructor != nil {
 25154  		_pDestructor.XnRef += 1
 25155  	}
 25156  	*(**XFuncDestructor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))) = _pDestructor
 25157  	_p.XfuncFlags = uint16((int32(_p.XfuncFlags) & int32(3)) | _extraFlags)
 25158  	*(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer(&_p.XxSFunc)) = func() func(*crt.TLS, *Xsqlite3_context, int32, **XMem) {
 25159  		if _xSFunc != nil {
 25160  			return _xSFunc
 25161  		}
 25162  		return _xStep
 25163  	}()
 25164  	*(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer(&_p.XxFinalize)) = _xFinal
 25165  	_p.XpUserData = _pUserData
 25166  	_p.XnArg = int8(uint16(_nArg))
 25167  	return int32(0)
 25168  
 25169  	_ = _nName
 25170  	panic(0)
 25171  }
 25172  
 25173  var _sqlite3CreateFuncØ00__func__Ø000 [18]int8
 25174  
 25175  func init() {
 25176  	crt.Xstrncpy(nil, &_sqlite3CreateFuncØ00__func__Ø000[0], str(24308), 18)
 25177  }
 25178  
 25179  // C comment
 25180  //  /*
 25181  //  ** Locate a user function given a name, a number of arguments and a flag
 25182  //  ** indicating whether the function prefers UTF-16 over UTF-8.  Return a
 25183  //  ** pointer to the FuncDef structure that defines that function, or return
 25184  //  ** NULL if the function does not exist.
 25185  //  **
 25186  //  ** If the createFlag argument is true, then a new (blank) FuncDef
 25187  //  ** structure is created and liked into the "db" structure if a
 25188  //  ** no matching function previously existed.
 25189  //  **
 25190  //  ** If nArg is -2, then the first valid function found is returned.  A
 25191  //  ** function is valid if xSFunc is non-zero.  The nArg==(-2)
 25192  //  ** case is used to see if zName is a valid function name for some number
 25193  //  ** of arguments.  If nArg is -2, then createFlag must be 0.
 25194  //  **
 25195  //  ** If createFlag is false, then a function with the required name and
 25196  //  ** number of arguments may be returned even if the eTextRep flag does not
 25197  //  ** match that requested.
 25198  //  */
 25199  func _sqlite3FindFunction(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _nArg int32, _enc uint8, _createFlag uint8) (r0 *XFuncDef) {
 25200  	var _bestScore, _h, _nName, _1_score, _4_score int32
 25201  	var _p, _pBest, _6_pOther *XFuncDef
 25202  	_pBest = nil
 25203  	_bestScore = int32(0)
 25204  	func() {
 25205  		if _nArg < int32(-2) {
 25206  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104504), unsafe.Pointer(&_sqlite3FindFunctionØ00__func__Ø000), unsafe.Pointer(str(24326)))
 25207  			crt.X__builtin_abort(tls)
 25208  		}
 25209  	}()
 25210  	func() {
 25211  		if _nArg < int32(-1) && int32(_createFlag) != int32(0) {
 25212  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104505), unsafe.Pointer(&_sqlite3FindFunctionØ00__func__Ø000), unsafe.Pointer(str(24337)))
 25213  			crt.X__builtin_abort(tls)
 25214  		}
 25215  	}()
 25216  	_nName = _sqlite3Strlen30(tls, _zName)
 25217  	_p = (*XFuncDef)(_sqlite3HashFind(tls, &_db.XaFunc, _zName))
 25218  _5:
 25219  	if _p == nil {
 25220  		goto _6
 25221  	}
 25222  	_1_score = _matchQuality(tls, _p, _nArg, _enc)
 25223  	if _1_score > _bestScore {
 25224  		_pBest = _p
 25225  		_bestScore = _1_score
 25226  	}
 25227  	_p = (*XFuncDef)(_p.XpNext)
 25228  	goto _5
 25229  _6:
 25230  	if _createFlag != 0 || _pBest != nil && (_db.Xflags&int32(2097152)) == int32(0) {
 25231  		goto _10
 25232  	}
 25233  	_bestScore = int32(0)
 25234  	_h = (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(uint8(*elem1(_zName, 0))))) + _nName) % int32(23)
 25235  	_p = _functionSearch(tls, _h, _zName)
 25236  _11:
 25237  	if _p == nil {
 25238  		goto _12
 25239  	}
 25240  	_4_score = _matchQuality(tls, _p, _nArg, _enc)
 25241  	if _4_score > _bestScore {
 25242  		_pBest = _p
 25243  		_bestScore = _4_score
 25244  	}
 25245  	_p = (*XFuncDef)(_p.XpNext)
 25246  	goto _11
 25247  _12:
 25248  _10:
 25249  	if _createFlag == 0 || _bestScore >= int32(6) || store17(&_pBest, (*XFuncDef)(_sqlite3DbMallocZero(tls, _db, uint64((uint32(28)+uint32(_nName))+uint32(1))))) == nil {
 25250  		goto _16
 25251  	}
 25252  	_pBest.XzName = (*int8)(unsafe.Pointer(elem17(_pBest, uintptr(1))))
 25253  	_pBest.XnArg = int8(uint16(_nArg))
 25254  	_pBest.XfuncFlags = uint16(_enc)
 25255  	crt.Xmemcpy(tls, unsafe.Pointer(elem17(_pBest, uintptr(1))), unsafe.Pointer(_zName), uint32(_nName+int32(1)))
 25256  	_6_pOther = (*XFuncDef)(_sqlite3HashInsert(tls, &_db.XaFunc, _pBest.XzName, unsafe.Pointer(_pBest)))
 25257  	if _6_pOther == _pBest {
 25258  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_pBest))
 25259  		_sqlite3OomFault(tls, _db)
 25260  		return nil
 25261  	}
 25262  	*(**XFuncDef)(unsafe.Pointer(&_pBest.XpNext)) = _6_pOther
 25263  _16:
 25264  	if (_pBest != nil) && ((_pBest.XxSFunc != nil) || (_createFlag != 0)) {
 25265  		return _pBest
 25266  	}
 25267  	return nil
 25268  }
 25269  
 25270  var _sqlite3FindFunctionØ00__func__Ø000 [20]int8
 25271  
 25272  func init() {
 25273  	crt.Xstrncpy(nil, &_sqlite3FindFunctionØ00__func__Ø000[0], str(24365), 20)
 25274  }
 25275  
 25276  // C comment
 25277  //  /* The score for a perfect match */
 25278  func _matchQuality(tls *crt.TLS, _p *XFuncDef, _nArg int32, _enc uint8) (r0 int32) {
 25279  	var _match int32
 25280  	if _nArg == int32(-2) {
 25281  		return func() int32 {
 25282  			if func() func(*crt.TLS, *Xsqlite3_context, int32, **XMem) {
 25283  				v := _p.XxSFunc
 25284  				return *(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer(&v))
 25285  			}() == nil {
 25286  				return int32(0)
 25287  			}
 25288  			return int32(6)
 25289  		}()
 25290  	}
 25291  	if (int32(_p.XnArg) != _nArg) && (int32(_p.XnArg) >= int32(0)) {
 25292  		return int32(0)
 25293  	}
 25294  	if int32(_p.XnArg) == _nArg {
 25295  		_match = int32(4)
 25296  		goto _6
 25297  	}
 25298  	_match = int32(1)
 25299  _6:
 25300  	if int32(_enc) == (int32(_p.XfuncFlags) & int32(3)) {
 25301  		_match += int32(2)
 25302  		goto _9
 25303  	}
 25304  	if ((int32(_enc) & int32(_p.XfuncFlags)) & int32(2)) != int32(0) {
 25305  		_match += int32(1)
 25306  	}
 25307  _9:
 25308  	return _match
 25309  }
 25310  
 25311  var _sqlite3_create_function_v2Ø00__func__Ø000 [27]int8
 25312  
 25313  func init() {
 25314  	crt.Xstrncpy(nil, &_sqlite3_create_function_v2Ø00__func__Ø000[0], str(24385), 27)
 25315  }
 25316  
 25317  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) {
 25318  	var _rc int32
 25319  	var _zFunc8 *int8
 25320  	if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zFunctionName == nil) {
 25321  		return _sqlite3MisuseError(tls, int32(142239))
 25322  	}
 25323  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 25324  	func() {
 25325  		if _db.XmallocFailed != 0 {
 25326  			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)))
 25327  			crt.X__builtin_abort(tls)
 25328  		}
 25329  	}()
 25330  	_zFunc8 = _sqlite3Utf16to8(tls, _db, _zFunctionName, int32(-1), uint8(2))
 25331  	_rc = _sqlite3CreateFunc(tls, _db, _zFunc8, _nArg, _eTextRep, _p, _xSFunc, _xStep, _xFinal, nil)
 25332  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zFunc8))
 25333  	_rc = _sqlite3ApiExit(tls, _db, _rc)
 25334  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 25335  	return _rc
 25336  }
 25337  
 25338  var _sqlite3_create_function16Ø00__func__Ø000 [26]int8
 25339  
 25340  func init() {
 25341  	crt.Xstrncpy(nil, &_sqlite3_create_function16Ø00__func__Ø000[0], str(24412), 26)
 25342  }
 25343  
 25344  // C comment
 25345  //  /*
 25346  //  ** External API function used to create a new virtual-table module.
 25347  //  */
 25348  func Xsqlite3_create_module(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _pModule *Xsqlite3_module, _pAux unsafe.Pointer) (r0 int32) {
 25349  	if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zName == nil) {
 25350  		return _sqlite3MisuseError(tls, int32(125090))
 25351  	}
 25352  	return _createModule(tls, _db, _zName, _pModule, _pAux, nil)
 25353  }
 25354  
 25355  // C comment
 25356  //  /*
 25357  //  ** The actual function that does the work of creating a new module.
 25358  //  ** This function implements the sqlite3_create_module() and
 25359  //  ** sqlite3_create_module_v2() interfaces.
 25360  //  */
 25361  func _createModule(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _pModule *Xsqlite3_module, _pAux unsafe.Pointer, _xDestroy func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
 25362  	var _rc int32
 25363  	_rc = int32(0)
 25364  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 25365  	if _sqlite3HashFind(tls, &_db.XaModule, _zName) != nil {
 25366  		_rc = _sqlite3MisuseError(tls, int32(125069))
 25367  		goto _1
 25368  	}
 25369  	_sqlite3VtabCreateModule(tls, _db, _zName, _pModule, _pAux, _xDestroy)
 25370  _1:
 25371  	_rc = _sqlite3ApiExit(tls, _db, _rc)
 25372  	if (_rc != int32(0)) && (_xDestroy != nil) {
 25373  		_xDestroy(tls, _pAux)
 25374  	}
 25375  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 25376  	return _rc
 25377  }
 25378  
 25379  // C comment
 25380  //  /*
 25381  //  ** Construct and install a Module object for a virtual table.  When this
 25382  //  ** routine is called, it is guaranteed that all appropriate locks are held
 25383  //  ** and the module is not already part of the connection.
 25384  //  */
 25385  func _sqlite3VtabCreateModule(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _pModule *Xsqlite3_module, _pAux unsafe.Pointer, _xDestroy func(*crt.TLS, unsafe.Pointer)) (r0 *XModule) {
 25386  	var _nName int32
 25387  	var _1_zCopy *int8
 25388  	var _pMod, _1_pDel *XModule
 25389  	_nName = _sqlite3Strlen30(tls, _zName)
 25390  	_pMod = (*XModule)(_sqlite3DbMallocRawNN(tls, _db, uint64((uint32(20)+uint32(_nName))+uint32(1))))
 25391  	if _pMod == nil {
 25392  		goto _0
 25393  	}
 25394  	_1_zCopy = (*int8)(unsafe.Pointer(elem48(_pMod, uintptr(1))))
 25395  	crt.Xmemcpy(tls, unsafe.Pointer(_1_zCopy), unsafe.Pointer(_zName), uint32(_nName+int32(1)))
 25396  	_pMod.XzName = _1_zCopy
 25397  	*(**Xsqlite3_module)(unsafe.Pointer(&_pMod.XpModule)) = _pModule
 25398  	_pMod.XpAux = _pAux
 25399  	_pMod.XxDestroy = _xDestroy
 25400  	*(**XTable)(unsafe.Pointer(&_pMod.XpEpoTab)) = nil
 25401  	_1_pDel = (*XModule)(_sqlite3HashInsert(tls, &_db.XaModule, _1_zCopy, unsafe.Pointer(_pMod)))
 25402  	func() {
 25403  		if _1_pDel != nil && _1_pDel != _pMod {
 25404  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125043), unsafe.Pointer(&_sqlite3VtabCreateModuleØ00__func__Ø000), unsafe.Pointer(str(24438)))
 25405  			crt.X__builtin_abort(tls)
 25406  		}
 25407  	}()
 25408  	if _1_pDel != nil {
 25409  		_sqlite3OomFault(tls, _db)
 25410  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_1_pDel))
 25411  		_pMod = nil
 25412  	}
 25413  _0:
 25414  	return _pMod
 25415  }
 25416  
 25417  var _sqlite3VtabCreateModuleØ00__func__Ø000 [24]int8
 25418  
 25419  func init() {
 25420  	crt.Xstrncpy(nil, &_sqlite3VtabCreateModuleØ00__func__Ø000[0], str(24460), 24)
 25421  }
 25422  
 25423  // C comment
 25424  //  /*
 25425  //  ** Return the number of values available from the current row of the
 25426  //  ** currently executing statement pStmt.
 25427  //  */
 25428  func Xsqlite3_data_count(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
 25429  	var _pVm *TVdbe
 25430  	_pVm = (*TVdbe)(_pStmt)
 25431  	if (_pVm == nil) || ((*XMem)(_pVm.XpResultSet) == nil) {
 25432  		return int32(0)
 25433  	}
 25434  	return int32(_pVm.XnResColumn)
 25435  }
 25436  
 25437  // C comment
 25438  //  /*
 25439  //  ** Return the sqlite3* database handle to which the prepared statement given
 25440  //  ** in the argument belongs.  This is the same database handle that was
 25441  //  ** the first argument to the sqlite3_prepare() that was used to create
 25442  //  ** the statement in the first place.
 25443  //  */
 25444  func Xsqlite3_db_handle(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 *Xsqlite3) {
 25445  	return func() *Xsqlite3 {
 25446  		if _pStmt != nil {
 25447  			return (*Xsqlite3)((*TVdbe)(_pStmt).Xdb)
 25448  		}
 25449  		return nil
 25450  	}()
 25451  }
 25452  
 25453  // C comment
 25454  //  /*
 25455  //  ** This function is used to set the schema of a virtual table.  It is only
 25456  //  ** valid to call this function from within the xCreate() or xConnect() of a
 25457  //  ** virtual table module.
 25458  //  */
 25459  func Xsqlite3_declare_vtab(tls *crt.TLS, _db *Xsqlite3, _zCreateTable *int8) (r0 int32) {
 25460  	var _rc int32
 25461  	var _zErr *int8
 25462  	var _pTab, _6_pNew *XTable
 25463  	var _pParse *XParse
 25464  	var _6_pIdx *XIndex
 25465  	var _pCtx *XVtabCtx
 25466  	_rc = int32(0)
 25467  	_zErr = nil
 25468  	if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zCreateTable == nil) {
 25469  		return _sqlite3MisuseError(tls, int32(125730))
 25470  	}
 25471  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 25472  	_pCtx = (*XVtabCtx)(_db.XpVtabCtx)
 25473  	if (_pCtx == nil) || _pCtx.XbDeclared != 0 {
 25474  		_sqlite3Error(tls, _db, int32(21))
 25475  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 25476  		return _sqlite3MisuseError(tls, int32(125738))
 25477  	}
 25478  	_pTab = (*XTable)(_pCtx.XpTab)
 25479  	func() {
 25480  		if _pTab.XnModuleArg == 0 {
 25481  			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)))
 25482  			crt.X__builtin_abort(tls)
 25483  		}
 25484  	}()
 25485  	_pParse = (*XParse)(_sqlite3DbMallocZero(tls, _db, uint64(484)))
 25486  	if _pParse == nil {
 25487  		_rc = _sqlite3NomemError(tls, int32(125745))
 25488  		goto _7
 25489  	}
 25490  	_pParse.XdeclareVtab = uint8(1)
 25491  	*(**Xsqlite3)(unsafe.Pointer(&_pParse.Xdb)) = _db
 25492  	_pParse.XnQueryLoop = uint32(1)
 25493  	if int32(0) != _sqlite3RunParser(tls, _pParse, _zCreateTable, &_zErr) || _pParse.XpNewTable == nil || _db.XmallocFailed != 0 || ((*XTable)(_pParse.XpNewTable).XpSelect) != nil || ((*XTable)(_pParse.XpNewTable).XnModuleArg) != 0 {
 25494  		goto _12
 25495  	}
 25496  	if _pTab.XaCol != nil {
 25497  		goto _13
 25498  	}
 25499  	_6_pNew = (*XTable)(_pParse.XpNewTable)
 25500  	*(**XColumn)(unsafe.Pointer(&_pTab.XaCol)) = (*XColumn)(_6_pNew.XaCol)
 25501  	_pTab.XnCol = _6_pNew.XnCol
 25502  	_pTab.XtabFlags |= _6_pNew.XtabFlags & uint32(96)
 25503  	_6_pNew.XnCol = 0
 25504  	*(**XColumn)(unsafe.Pointer(&_6_pNew.XaCol)) = nil
 25505  	func() {
 25506  		if (*XIndex)(_pTab.XpIndex) != nil {
 25507  			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)))
 25508  			crt.X__builtin_abort(tls)
 25509  		}
 25510  	}()
 25511  	if ((_6_pNew.XtabFlags & uint32(32)) != (0)) && (func() func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32 {
 25512  		v := (*Xsqlite3_module)((*XModule)((*XVTable)(_pCtx.XpVTable).XpMod).XpModule).XxUpdate
 25513  		return *(*func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32)(unsafe.Pointer(&v))
 25514  	}() != nil) {
 25515  		_rc = int32(1)
 25516  	}
 25517  	_6_pIdx = (*XIndex)(_6_pNew.XpIndex)
 25518  	if _6_pIdx != nil {
 25519  		func() {
 25520  			if (*XIndex)(_6_pIdx.XpNext) != nil {
 25521  				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)))
 25522  				crt.X__builtin_abort(tls)
 25523  			}
 25524  		}()
 25525  		*(**XIndex)(unsafe.Pointer(&_pTab.XpIndex)) = _6_pIdx
 25526  		*(**XIndex)(unsafe.Pointer(&_6_pNew.XpIndex)) = nil
 25527  		*(**XTable)(unsafe.Pointer(&_6_pIdx.XpTable)) = _pTab
 25528  	}
 25529  _13:
 25530  	_pCtx.XbDeclared = int32(1)
 25531  	goto _21
 25532  _12:
 25533  	_sqlite3ErrorWithMsg(tls, _db, int32(1), func() *int8 {
 25534  		if _zErr != nil {
 25535  			return str(24531)
 25536  		}
 25537  		return nil
 25538  	}(), unsafe.Pointer(_zErr))
 25539  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErr))
 25540  	_rc = int32(1)
 25541  _21:
 25542  	_pParse.XdeclareVtab = 0
 25543  	if _pParse.XpVdbe != nil {
 25544  		_sqlite3VdbeFinalize(tls, (*TVdbe)(_pParse.XpVdbe))
 25545  	}
 25546  	_sqlite3DeleteTable(tls, _db, (*XTable)(_pParse.XpNewTable))
 25547  	_sqlite3ParserReset(tls, _pParse)
 25548  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pParse))
 25549  _7:
 25550  	func() {
 25551  		if (_rc & int32(255)) != _rc {
 25552  			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)))
 25553  			crt.X__builtin_abort(tls)
 25554  		}
 25555  	}()
 25556  	_rc = _sqlite3ApiExit(tls, _db, _rc)
 25557  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 25558  	return _rc
 25559  }
 25560  
 25561  var _sqlite3_declare_vtabØ00__func__Ø000 [21]int8
 25562  
 25563  func init() {
 25564  	crt.Xstrncpy(nil, &_sqlite3_declare_vtabØ00__func__Ø000[0], str(24548), 21)
 25565  }
 25566  
 25567  // C comment
 25568  //  /*
 25569  //  ** Run the parser on the given SQL string.  The parser structure is
 25570  //  ** passed in.  An SQLITE_ status code is returned.  If an error occurs
 25571  //  ** then an and attempt is made to write an error message into
 25572  //  ** memory obtained from sqlite3_malloc() and to make *pzErrMsg point to that
 25573  //  ** error message.
 25574  //  */
 25575  func _sqlite3RunParser(tls *crt.TLS, _pParse *XParse, _zSql *int8, _pzErrMsg **int8) (r0 int32) {
 25576  	var _nErr, _n, _tokenType, _lastTokenParsed, _mxSqlLen int32
 25577  	var _pEngine unsafe.Pointer
 25578  	var _db *Xsqlite3
 25579  	var _20_p *XTable
 25580  	var _19_p *XAutoincInfo
 25581  	var _sEngine XyyParser
 25582  	_nErr = int32(0)
 25583  	_n = int32(0)
 25584  	_lastTokenParsed = int32(-1)
 25585  	_db = (*Xsqlite3)(_pParse.Xdb)
 25586  	func() {
 25587  		if _zSql == nil {
 25588  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(139953), unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000), unsafe.Pointer(str(24569)))
 25589  			crt.X__builtin_abort(tls)
 25590  		}
 25591  	}()
 25592  	_mxSqlLen = *elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(1))
 25593  	if _db.XnVdbeActive == int32(0) {
 25594  		*(*int32)(unsafe.Pointer(&_db.Xu1)) = int32(0)
 25595  	}
 25596  	_pParse.Xrc = int32(0)
 25597  	_pParse.XzTail = _zSql
 25598  	func() {
 25599  		if _pzErrMsg == nil {
 25600  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(139960), unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000), unsafe.Pointer(str(24577)))
 25601  			crt.X__builtin_abort(tls)
 25602  		}
 25603  	}()
 25604  	_pEngine = unsafe.Pointer(&_sEngine)
 25605  	_sqlite3ParserInit(tls, _pEngine)
 25606  	func() {
 25607  		if (*XTable)(_pParse.XpNewTable) != nil {
 25608  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(139972), unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000), unsafe.Pointer(str(24589)))
 25609  			crt.X__builtin_abort(tls)
 25610  		}
 25611  	}()
 25612  	func() {
 25613  		if (*XTrigger)(_pParse.XpNewTrigger) != nil {
 25614  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(139973), unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000), unsafe.Pointer(str(24610)))
 25615  			crt.X__builtin_abort(tls)
 25616  		}
 25617  	}()
 25618  	func() {
 25619  		if int32(_pParse.XnVar) != int32(0) {
 25620  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(139974), unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000), unsafe.Pointer(str(24633)))
 25621  			crt.X__builtin_abort(tls)
 25622  		}
 25623  	}()
 25624  	func() {
 25625  		if _pParse.XpVList != nil {
 25626  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(139975), unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000), unsafe.Pointer(str(24649)))
 25627  			crt.X__builtin_abort(tls)
 25628  		}
 25629  	}()
 25630  _13:
 25631  	if int32(*elem1(_zSql, 0)) == int32(0) {
 25632  		goto _15
 25633  	}
 25634  	_n = _sqlite3GetToken(tls, (*uint8)(unsafe.Pointer(_zSql)), &_tokenType)
 25635  	_mxSqlLen -= _n
 25636  	if _mxSqlLen < int32(0) {
 25637  		_pParse.Xrc = int32(18)
 25638  		goto _14
 25639  	}
 25640  	goto _17
 25641  _15:
 25642  	if _lastTokenParsed == int32(1) {
 25643  		_tokenType = int32(0)
 25644  		goto _21
 25645  	}
 25646  	if _lastTokenParsed == int32(0) {
 25647  		goto _14
 25648  	}
 25649  	_tokenType = int32(1)
 25650  _21:
 25651  	*(*uintptr)(unsafe.Pointer(&_zSql)) -= uintptr(_n)
 25652  _17:
 25653  	if _tokenType < int32(163) {
 25654  		goto _22
 25655  	}
 25656  	func() {
 25657  		if _tokenType != int32(163) && _tokenType != int32(164) {
 25658  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(139997), unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000), unsafe.Pointer(str(24667)))
 25659  			crt.X__builtin_abort(tls)
 25660  		}
 25661  	}()
 25662  	if (*(*int32)(unsafe.Pointer(&_db.Xu1))) != 0 {
 25663  		_pParse.Xrc = int32(9)
 25664  		goto _14
 25665  	}
 25666  	if _tokenType == int32(164) {
 25667  		_sqlite3ErrorMsg(tls, _pParse, str(24712), _n, unsafe.Pointer(_zSql))
 25668  		goto _14
 25669  	}
 25670  	*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(_n)
 25671  	goto _28
 25672  _22:
 25673  	_pParse.XsLastToken.Xz = _zSql
 25674  	_pParse.XsLastToken.Xn = uint32(_n)
 25675  	_sqlite3Parser(tls, _pEngine, _tokenType, _pParse.XsLastToken, _pParse)
 25676  	_lastTokenParsed = _tokenType
 25677  	*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(_n)
 25678  	if (_pParse.Xrc != int32(0)) || (_db.XmallocFailed != 0) {
 25679  		goto _14
 25680  	}
 25681  _28:
 25682  	goto _13
 25683  _14:
 25684  	func() {
 25685  		if _nErr != int32(0) {
 25686  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(140016), unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000), unsafe.Pointer(str(24739)))
 25687  			crt.X__builtin_abort(tls)
 25688  		}
 25689  	}()
 25690  	_pParse.XzTail = _zSql
 25691  	_sqlite3ParserFinalize(tls, _pEngine)
 25692  	if _db.XmallocFailed != 0 {
 25693  		_pParse.Xrc = _sqlite3NomemError(tls, int32(140031))
 25694  	}
 25695  	if ((_pParse.Xrc != int32(0)) && (_pParse.Xrc != int32(101))) && (_pParse.XzErrMsg == nil) {
 25696  		_pParse.XzErrMsg = _sqlite3MPrintf(tls, _db, str(24531), unsafe.Pointer(_sqlite3ErrStr(tls, _pParse.Xrc)))
 25697  	}
 25698  	func() {
 25699  		if _pzErrMsg == nil {
 25700  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(140036), unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000), unsafe.Pointer(str(24577)))
 25701  			crt.X__builtin_abort(tls)
 25702  		}
 25703  	}()
 25704  	if _pParse.XzErrMsg != nil {
 25705  		*_pzErrMsg = _pParse.XzErrMsg
 25706  		Xsqlite3_log(tls, _pParse.Xrc, str(24531), unsafe.Pointer(*_pzErrMsg))
 25707  		_pParse.XzErrMsg = nil
 25708  		_nErr += 1
 25709  	}
 25710  	if ((_pParse.XpVdbe != nil) && (_pParse.XnErr > int32(0))) && (int32(_pParse.Xnested) == int32(0)) {
 25711  		_sqlite3VdbeDelete(tls, (*TVdbe)(_pParse.XpVdbe))
 25712  		*(**TVdbe)(unsafe.Pointer(&_pParse.XpVdbe)) = nil
 25713  	}
 25714  	if int32(_pParse.Xnested) == int32(0) {
 25715  		_sqlite3DbFree(tls, _db, _pParse.XaTableLock)
 25716  		*(**XTableLock)(unsafe.Pointer(&_pParse.XaTableLock)) = nil
 25717  		_pParse.XnTableLock = int32(0)
 25718  	}
 25719  	Xsqlite3_free(tls, unsafe.Pointer(_pParse.XapVtabLock))
 25720  	if _pParse.XdeclareVtab == 0 {
 25721  		_sqlite3DeleteTable(tls, _db, (*XTable)(_pParse.XpNewTable))
 25722  	}
 25723  	if _pParse.XpWithToFree != nil {
 25724  		_sqlite3WithDelete(tls, _db, (*XWith)(_pParse.XpWithToFree))
 25725  	}
 25726  	_sqlite3DeleteTrigger(tls, _db, (*XTrigger)(_pParse.XpNewTrigger))
 25727  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pParse.XpVList))
 25728  _46:
 25729  	if _pParse.XpAinc != nil {
 25730  		_19_p = (*XAutoincInfo)(_pParse.XpAinc)
 25731  		*(**XAutoincInfo)(unsafe.Pointer(&_pParse.XpAinc)) = (*XAutoincInfo)(_19_p.XpNext)
 25732  		_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_19_p))
 25733  		goto _46
 25734  	}
 25735  _47:
 25736  	if _pParse.XpZombieTab != nil {
 25737  		_20_p = (*XTable)(_pParse.XpZombieTab)
 25738  		*(**XTable)(unsafe.Pointer(&_pParse.XpZombieTab)) = (*XTable)(_20_p.XpNextZombie)
 25739  		_sqlite3DeleteTable(tls, _db, _20_p)
 25740  		goto _47
 25741  	}
 25742  	func() {
 25743  		if _nErr != int32(0) && _pParse.Xrc == int32(0) {
 25744  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(140079), unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000), unsafe.Pointer(str(24747)))
 25745  			crt.X__builtin_abort(tls)
 25746  		}
 25747  	}()
 25748  	return _nErr
 25749  
 25750  	_ = _sEngine
 25751  	panic(0)
 25752  }
 25753  
 25754  var _sqlite3RunParserØ00__func__Ø000 [17]int8
 25755  
 25756  func init() {
 25757  	crt.Xstrncpy(nil, &_sqlite3RunParserØ00__func__Ø000[0], str(24780), 17)
 25758  }
 25759  
 25760  // C comment
 25761  //  /* Initialize a new parser that has already been allocated.
 25762  //  */
 25763  func _sqlite3ParserInit(tls *crt.TLS, _yypParser unsafe.Pointer) {
 25764  	var _pParser *XyyParser
 25765  	_pParser = (*XyyParser)(_yypParser)
 25766  	*(**XyyStackEntry)(unsafe.Pointer(&_pParser.Xyytos)) = (*XyyStackEntry)(unsafe.Pointer(&_pParser.Xyystack))
 25767  	elem49((*XyyStackEntry)(unsafe.Pointer(&_pParser.Xyystack)), 0).Xstateno = 0
 25768  	elem49((*XyyStackEntry)(unsafe.Pointer(&_pParser.Xyystack)), 0).Xmajor = 0
 25769  }
 25770  
 25771  // C comment
 25772  //  /*
 25773  //  ** Add an error message to pParse->zErrMsg and increment pParse->nErr.
 25774  //  ** The following formatting characters are allowed:
 25775  //  **
 25776  //  **      %s      Insert a string
 25777  //  **      %z      A string that should be freed after use
 25778  //  **      %d      Insert an integer
 25779  //  **      %T      Insert a token
 25780  //  **      %S      Insert the first element of a SrcList
 25781  //  **
 25782  //  ** This function should be used to report any error that occurs while
 25783  //  ** compiling an SQL statement (i.e. within sqlite3_prepare()). The
 25784  //  ** last thing the sqlite3_prepare() function does is copy the error
 25785  //  ** stored by this function into the database handle using sqlite3Error().
 25786  //  ** Functions sqlite3Error() or sqlite3ErrorWithMsg() should be used
 25787  //  ** during statement execution (sqlite3_step() etc.).
 25788  //  */
 25789  func _sqlite3ErrorMsg(tls *crt.TLS, _pParse *XParse, _zFormat *int8, args ...interface{}) {
 25790  	var _zMsg *int8
 25791  	var _ap []interface{}
 25792  	var _db *Xsqlite3
 25793  	_db = (*Xsqlite3)(_pParse.Xdb)
 25794  	_ap = args
 25795  	_zMsg = _sqlite3VMPrintf(tls, _db, _zFormat, _ap)
 25796  	_ap = nil
 25797  	if _db.XsuppressErr != 0 {
 25798  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zMsg))
 25799  		goto _1
 25800  	}
 25801  	_pParse.XnErr += 1
 25802  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pParse.XzErrMsg))
 25803  	_pParse.XzErrMsg = _zMsg
 25804  	_pParse.Xrc = int32(1)
 25805  _1:
 25806  }
 25807  
 25808  // C comment
 25809  //  /* The main parser program.
 25810  //  ** The first argument is a pointer to a structure obtained from
 25811  //  ** "sqlite3ParserAlloc" which describes the current state of the parser.
 25812  //  ** The second argument is the major token number.  The third is
 25813  //  ** the minor token.  The fourth optional argument is whatever the
 25814  //  ** user wants (and specified in the grammar) and is available for
 25815  //  ** use by the action routines.
 25816  //  **
 25817  //  ** Inputs:
 25818  //  ** <ul>
 25819  //  ** <li> A pointer to the parser (an opaque structure.)
 25820  //  ** <li> The major token number.
 25821  //  ** <li> The minor token number.
 25822  //  ** <li> An option argument of a grammar-specified type.
 25823  //  ** </ul>
 25824  //  **
 25825  //  ** Outputs:
 25826  //  ** None.
 25827  //  */
 25828  func _sqlite3Parser(tls *crt.TLS, _yyp unsafe.Pointer, _yymajor int32, _yyminor XToken, _pParse *XParse) {
 25829  	var _7_cDiv int8
 25830  	var _yyact uint32
 25831  	var _yypParser *XyyParser
 25832  	var _yyminorunion XYYMINORTYPE
 25833  	var _7_i *XyyStackEntry
 25834  	_yypParser = (*XyyParser)(_yyp)
 25835  	func() {
 25836  		if (*XyyStackEntry)(_yypParser.Xyytos) == nil {
 25837  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(139035), unsafe.Pointer(&_sqlite3ParserØ00__func__Ø000), unsafe.Pointer(str(24797)))
 25838  			crt.X__builtin_abort(tls)
 25839  		}
 25840  	}()
 25841  	*(**XParse)(unsafe.Pointer(&_yypParser.XpParse)) = _pParse
 25842  	if _yyTraceFILE != nil {
 25843  		crt.Xfprintf(tls, _yyTraceFILE, str(24817), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_yyTokenName)), uintptr(_yymajor))))
 25844  	}
 25845  _2:
 25846  	_yyact = _yy_find_shift_action(tls, _yypParser, uint8(_yymajor))
 25847  	if _yyact <= uint32(999) {
 25848  		_yy_shift(tls, _yypParser, int32(_yyact), _yymajor, _yyminor)
 25849  		_yymajor = int32(252)
 25850  		goto _7
 25851  	}
 25852  	if _yyact <= uint32(1331) {
 25853  		_yy_reduce(tls, _yypParser, _yyact-uint32(1000))
 25854  		goto _7
 25855  	}
 25856  	func() {
 25857  		if _yyact != uint32(1332) {
 25858  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(139058), unsafe.Pointer(&_sqlite3ParserØ00__func__Ø000), unsafe.Pointer(str(24831)))
 25859  			crt.X__builtin_abort(tls)
 25860  		}
 25861  	}()
 25862  	*(*XToken)(unsafe.Pointer(&_yyminorunion)) = _yyminor
 25863  	if _yyTraceFILE != nil {
 25864  		crt.Xfprintf(tls, _yyTraceFILE, str(24856), unsafe.Pointer(_yyTracePrompt))
 25865  	}
 25866  	_yy_syntax_error(tls, _yypParser, _yymajor, _yyminor)
 25867  	_yy_destructor(tls, _yypParser, uint8(_yymajor), &_yyminorunion)
 25868  	_yymajor = int32(252)
 25869  _7:
 25870  	if (_yymajor != int32(252)) && (crt.P2U(_yypParser.Xyytos) > crt.P2U(unsafe.Pointer(&_yypParser.Xyystack))) {
 25871  		goto _2
 25872  	}
 25873  	if _yyTraceFILE == nil {
 25874  		goto _12
 25875  	}
 25876  	_7_cDiv = int8(91)
 25877  	crt.Xfprintf(tls, _yyTraceFILE, str(24873), unsafe.Pointer(_yyTracePrompt))
 25878  	_7_i = elem49((*XyyStackEntry)(unsafe.Pointer(&_yypParser.Xyystack)), uintptr(1))
 25879  _13:
 25880  	if crt.P2U(unsafe.Pointer(_7_i)) > crt.P2U(_yypParser.Xyytos) {
 25881  		goto _16
 25882  	}
 25883  	crt.Xfprintf(tls, _yyTraceFILE, str(24890), int32(_7_cDiv), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_yyTokenName)), uintptr(_7_i.Xmajor))))
 25884  	_7_cDiv = int8(32)
 25885  	*(*uintptr)(unsafe.Pointer(&_7_i)) += uintptr(16)
 25886  	goto _13
 25887  _16:
 25888  	crt.Xfprintf(tls, _yyTraceFILE, str(24895))
 25889  _12:
 25890  }
 25891  
 25892  var _sqlite3ParserØ00__func__Ø000 [14]int8
 25893  
 25894  func init() {
 25895  	crt.Xstrncpy(nil, &_sqlite3ParserØ00__func__Ø000[0], str(24898), 14)
 25896  }
 25897  
 25898  // C comment
 25899  //  /* #include <stdio.h> */
 25900  var _yyTraceFILE *crt.XFILE
 25901  
 25902  var _yyTracePrompt *int8
 25903  
 25904  // C comment
 25905  //  /* For tracing shifts, the names of all terminals and nonterminals
 25906  //  ** are required.  The following table supplies these names */
 25907  var _yyTokenName [251]*int8
 25908  
 25909  func init() {
 25910  	_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)}
 25911  }
 25912  
 25913  // C comment
 25914  //  /*
 25915  //  ** Find the appropriate action for a parser given the terminal
 25916  //  ** look-ahead token iLookAhead.
 25917  //  */
 25918  func _yy_find_shift_action(tls *crt.TLS, _pParser *XyyParser, _iLookAhead uint8) (r0 uint32) {
 25919  	var _i, _stateno, _5_j int32
 25920  	var _2_iFallback uint8
 25921  	_stateno = int32((*XyyStackEntry)(_pParser.Xyytos).Xstateno)
 25922  	if _stateno >= int32(1000) {
 25923  		return uint32(_stateno)
 25924  	}
 25925  	func() {
 25926  		if _stateno > int32(455) {
 25927  			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)))
 25928  			crt.X__builtin_abort(tls)
 25929  		}
 25930  	}()
 25931  _3:
 25932  	_i = int32(*elem50((*int16)(unsafe.Pointer(&_yy_shift_ofst)), uintptr(_stateno)))
 25933  	func() {
 25934  		if int32(_iLookAhead) == int32(252) {
 25935  			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)))
 25936  			crt.X__builtin_abort(tls)
 25937  		}
 25938  	}()
 25939  	_i += int32(_iLookAhead)
 25940  	if _i >= int32(0) && _i < int32(1566) && int32(*elem15((*uint8)(unsafe.Pointer(&_yy_lookahead)), uintptr(_i))) == int32(_iLookAhead) {
 25941  		goto _8
 25942  	}
 25943  	if uint32(_iLookAhead) >= uint32(69) || int32(store3(&_2_iFallback, *elem15((*uint8)(unsafe.Pointer(&_yyFallback)), uintptr(_iLookAhead)))) == int32(0) {
 25944  		goto _10
 25945  	}
 25946  	if _yyTraceFILE != nil {
 25947  		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))))
 25948  	}
 25949  	func() {
 25950  		if int32(*elem15((*uint8)(unsafe.Pointer(&_yyFallback)), uintptr(_2_iFallback))) != int32(0) {
 25951  			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)))
 25952  			crt.X__builtin_abort(tls)
 25953  		}
 25954  	}()
 25955  	_iLookAhead = _2_iFallback
 25956  	goto _3
 25957  _10:
 25958  	_5_j = (_i - int32(_iLookAhead)) + int32(69)
 25959  	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) {
 25960  		goto _17
 25961  	}
 25962  	if _yyTraceFILE != nil {
 25963  		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))))
 25964  	}
 25965  	return uint32(*elem20((*uint16)(unsafe.Pointer(&_yy_action)), uintptr(_5_j)))
 25966  
 25967  _17:
 25968  	return uint32(*elem20((*uint16)(unsafe.Pointer(&_yy_default)), uintptr(_stateno)))
 25969  
 25970  _8:
 25971  	return uint32(*elem20((*uint16)(unsafe.Pointer(&_yy_action)), uintptr(_i)))
 25972  }
 25973  
 25974  var _yy_find_shift_actionØ00__func__Ø000 [21]int8
 25975  
 25976  func init() {
 25977  	crt.Xstrncpy(nil, &_yy_find_shift_actionØ00__func__Ø000[0], str(26958), 21)
 25978  }
 25979  
 25980  var _yy_shift_ofst [456]int16
 25981  
 25982  func init() {
 25983  	_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)}
 25984  }
 25985  
 25986  var _yy_lookahead [1566]uint8
 25987  
 25988  func init() {
 25989  	_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}
 25990  }
 25991  
 25992  var _yyFallback [69]uint8
 25993  
 25994  func init() {
 25995  	_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}
 25996  }
 25997  
 25998  var _yy_action [1566]uint16
 25999  
 26000  func init() {
 26001  	_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)}
 26002  }
 26003  
 26004  var _yy_default [456]uint16
 26005  
 26006  func init() {
 26007  	_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)}
 26008  }
 26009  
 26010  // C comment
 26011  //  /*
 26012  //  ** Perform a shift action.
 26013  //  */
 26014  func _yy_shift(tls *crt.TLS, _yypParser *XyyParser, _yyNewState int32, _yyMajor int32, _yyMinor XToken) {
 26015  	var _yytos *XyyStackEntry
 26016  	*(*uintptr)(unsafe.Pointer(&_yypParser.Xyytos)) += uintptr(16)
 26017  	if crt.P2U(_yypParser.Xyytos) >= crt.P2U(unsafe.Pointer(elem49((*XyyStackEntry)(unsafe.Pointer(&_yypParser.Xyystack)), uintptr(100)))) {
 26018  		*(*uintptr)(unsafe.Pointer(&_yypParser.Xyytos)) += uintptr(4294967280)
 26019  		_yyStackOverflow(tls, _yypParser)
 26020  		return
 26021  	}
 26022  	if _yyNewState > int32(455) {
 26023  		_yyNewState += int32(332)
 26024  	}
 26025  	_yytos = (*XyyStackEntry)(_yypParser.Xyytos)
 26026  	_yytos.Xstateno = uint16(_yyNewState)
 26027  	_yytos.Xmajor = uint8(_yyMajor)
 26028  	*(*XToken)(unsafe.Pointer(&_yytos.Xminor)) = _yyMinor
 26029  	_yyTraceShift(tls, _yypParser, _yyNewState)
 26030  }
 26031  
 26032  // C comment
 26033  //  /*
 26034  //  ** The following routine is called if the stack overflows.
 26035  //  */
 26036  func _yyStackOverflow(tls *crt.TLS, _yypParser *XyyParser) {
 26037  	var _pParse *XParse
 26038  	_pParse = (*XParse)(_yypParser.XpParse)
 26039  	if _yyTraceFILE != nil {
 26040  		crt.Xfprintf(tls, _yyTraceFILE, str(26979), unsafe.Pointer(_yyTracePrompt))
 26041  	}
 26042  _0:
 26043  	if crt.P2U(_yypParser.Xyytos) > crt.P2U(unsafe.Pointer(&_yypParser.Xyystack)) {
 26044  		_yy_pop_parser_stack(tls, _yypParser)
 26045  		goto _0
 26046  	}
 26047  	_sqlite3ErrorMsg(tls, _pParse, str(26998))
 26048  	*(**XParse)(unsafe.Pointer(&_yypParser.XpParse)) = _pParse
 26049  }
 26050  
 26051  // C comment
 26052  //  /*
 26053  //  ** Pop the parser's stack once.
 26054  //  **
 26055  //  ** If there is a destructor routine associated with the token which
 26056  //  ** is popped from the stack, then call it.
 26057  //  */
 26058  func _yy_pop_parser_stack(tls *crt.TLS, _pParser *XyyParser) {
 26059  	var _yytos *XyyStackEntry
 26060  	func() {
 26061  		if (*XyyStackEntry)(_pParser.Xyytos) == nil {
 26062  			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)))
 26063  			crt.X__builtin_abort(tls)
 26064  		}
 26065  	}()
 26066  	func() {
 26067  		if crt.P2U(_pParser.Xyytos) <= crt.P2U(unsafe.Pointer(&_pParser.Xyystack)) {
 26068  			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)))
 26069  			crt.X__builtin_abort(tls)
 26070  		}
 26071  	}()
 26072  	_yytos = postInc49((**XyyStackEntry)(unsafe.Pointer(&_pParser.Xyytos)), -16)
 26073  	if _yyTraceFILE != nil {
 26074  		crt.Xfprintf(tls, _yyTraceFILE, str(27072), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_yyTokenName)), uintptr(_yytos.Xmajor))))
 26075  	}
 26076  	_yy_destructor(tls, _pParser, _yytos.Xmajor, &_yytos.Xminor)
 26077  }
 26078  
 26079  var _yy_pop_parser_stackØ00__func__Ø000 [20]int8
 26080  
 26081  func init() {
 26082  	crt.Xstrncpy(nil, &_yy_pop_parser_stackØ00__func__Ø000[0], str(27086), 20)
 26083  }
 26084  
 26085  // C comment
 26086  //  /* The following function deletes the "minor type" or semantic value
 26087  //  ** associated with a symbol.  The symbol can be either a terminal
 26088  //  ** or nonterminal. "yymajor" is the symbol code, and "yypminor" is
 26089  //  ** a pointer to the value to be deleted.  The code used to do the
 26090  //  ** deletions is derived from the %destructor and/or %token_destructor
 26091  //  ** directives of the input grammar.
 26092  //  */
 26093  func _yy_destructor(tls *crt.TLS, _yypParser *XyyParser, _yymajor uint8, _yypminor *XYYMINORTYPE) {
 26094  	var _pParse *XParse
 26095  	_pParse = (*XParse)(_yypParser.XpParse)
 26096  	switch int32(_yymajor) {
 26097  	case int32(163):
 26098  		goto _1
 26099  	case int32(172):
 26100  		goto _5
 26101  	case int32(173):
 26102  		goto _5
 26103  	case int32(177):
 26104  		goto _7
 26105  	case int32(186):
 26106  		goto _7
 26107  	case int32(187):
 26108  		goto _7
 26109  	case int32(193):
 26110  		goto _19
 26111  	case int32(194):
 26112  		goto _1
 26113  	case int32(195):
 26114  		goto _1
 26115  	case int32(196):
 26116  		goto _23
 26117  	case int32(199):
 26118  		goto _7
 26119  	case int32(200):
 26120  		goto _19
 26121  	case int32(201):
 26122  		goto _25
 26123  	case int32(202):
 26124  		goto _7
 26125  	case int32(203):
 26126  		goto _25
 26127  	case int32(204):
 26128  		goto _7
 26129  	case int32(206):
 26130  		goto _1
 26131  	case int32(207):
 26132  		goto _7
 26133  	case int32(208):
 26134  		goto _7
 26135  	case int32(209):
 26136  		goto _7
 26137  	case int32(211):
 26138  		goto _19
 26139  	case int32(212):
 26140  		goto _19
 26141  	case int32(215):
 26142  		goto _25
 26143  	case int32(216):
 26144  		goto _32
 26145  	case int32(217):
 26146  		goto _32
 26147  	case int32(218):
 26148  		goto _7
 26149  	case int32(220):
 26150  		goto _32
 26151  	case int32(224):
 26152  		goto _7
 26153  	case int32(225):
 26154  		goto _25
 26155  	case int32(226):
 26156  		goto _7
 26157  	case int32(227):
 26158  		goto _25
 26159  	case int32(232):
 26160  		goto _35
 26161  	case int32(234):
 26162  		goto _37
 26163  	case int32(236):
 26164  		goto _25
 26165  	case int32(237):
 26166  		goto _35
 26167  	case int32(241):
 26168  		goto _25
 26169  	case int32(250):
 26170  		goto _23
 26171  	default:
 26172  		goto _38
 26173  	}
 26174  
 26175  _1:
 26176  	_sqlite3SelectDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(_yypminor))))
 26177  	goto _39
 26178  _5:
 26179  	_sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XExpr)((*XExprSpan)(unsafe.Pointer(_yypminor)).XpExpr))
 26180  	goto _39
 26181  _7:
 26182  	_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(_yypminor))))
 26183  	goto _39
 26184  _19:
 26185  	_sqlite3SrcListDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(_yypminor))))
 26186  	goto _39
 26187  _23:
 26188  	_sqlite3WithDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer(_yypminor))))
 26189  	goto _39
 26190  _25:
 26191  	_sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(_yypminor))))
 26192  	goto _39
 26193  _32:
 26194  	_sqlite3IdListDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(_yypminor))))
 26195  	goto _39
 26196  _35:
 26197  	_sqlite3DeleteTriggerStep(tls, (*Xsqlite3)(_pParse.Xdb), (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer(_yypminor))))
 26198  	goto _39
 26199  _37:
 26200  	_sqlite3IdListDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XIdList)((*t51)(unsafe.Pointer(_yypminor)).Xb))
 26201  	goto _39
 26202  _38:
 26203  	goto _39
 26204  _39:
 26205  }
 26206  
 26207  func _yyTraceShift(tls *crt.TLS, _yypParser *XyyParser, _yyNewState int32) {
 26208  	if _yyTraceFILE == nil {
 26209  		goto _0
 26210  	}
 26211  	if _yyNewState < int32(456) {
 26212  		crt.Xfprintf(tls, _yyTraceFILE, str(27106), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_yyTokenName)), uintptr((*XyyStackEntry)(_yypParser.Xyytos).Xmajor))), _yyNewState)
 26213  		goto _2
 26214  	}
 26215  	crt.Xfprintf(tls, _yyTraceFILE, str(27136), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_yyTokenName)), uintptr((*XyyStackEntry)(_yypParser.Xyytos).Xmajor))))
 26216  _2:
 26217  _0:
 26218  }
 26219  
 26220  // C comment
 26221  //  /*
 26222  //  ** Perform a reduce action and the shift that must immediately
 26223  //  ** follow the reduce.
 26224  //  */
 26225  func _yy_reduce(tls *crt.TLS, _yypParser *XyyParser, _yyruleno uint32) {
 26226  	var _yygoto, _yyact, _yysize, _81_i, _163_bNot, _164_bNot int32
 26227  	var _147_n uint32
 26228  	var _81_z *int8
 26229  	var _75_x, _80_s, _148_t, _209_all XToken
 26230  	var _75_pFrom, _185_pSrc *XSrcList
 26231  	var _105_pNew, _105_pOld *TSrcList_item
 26232  	var _158_pList, _163_pList, _164_pList, _173_pList *XExprList
 26233  	var _71_p, _74_pRhs, _74_pLhs, _85_pRight, _85_pLeft, _106_pSubquery, _185_pSelect *XSelect
 26234  	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
 26235  	var _pParse *XParse
 26236  	var _34_v, _35_v XExprSpan
 26237  	var _70_dest XSelectDest
 26238  	var _4_yylhsminor XYYMINORTYPE
 26239  	var _yymsp *XyyStackEntry
 26240  	_pParse = (*XParse)(_yypParser.XpParse)
 26241  	_yymsp = (*XyyStackEntry)(_yypParser.Xyytos)
 26242  	if (_yyTraceFILE != nil) && (_yyruleno < uint32(332)) {
 26243  		_yysize = int32(elem52((*t53)(unsafe.Pointer(&_yyRuleInfo)), uintptr(_yyruleno)).Xnrhs)
 26244  		crt.Xfprintf(tls, _yyTraceFILE, str(27150), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_yyRuleName)), uintptr(_yyruleno))), int32(elem49(_yymsp, uintptr(-_yysize)).Xstateno))
 26245  	}
 26246  	if int32(elem52((*t53)(unsafe.Pointer(&_yyRuleInfo)), uintptr(_yyruleno)).Xnrhs) != int32(0) {
 26247  		goto _2
 26248  	}
 26249  	if crt.P2U(_yypParser.Xyytos) >= crt.P2U(unsafe.Pointer(elem49((*XyyStackEntry)(unsafe.Pointer(&_yypParser.Xyystack)), uintptr(99)))) {
 26250  		_yyStackOverflow(tls, _yypParser)
 26251  		return
 26252  	}
 26253  _2:
 26254  	switch _yyruleno {
 26255  	case uint32(0):
 26256  		goto _5
 26257  	case uint32(1):
 26258  		goto _6
 26259  	case uint32(2):
 26260  		goto _7
 26261  	case uint32(3):
 26262  		goto _8
 26263  	case uint32(4):
 26264  		goto _9
 26265  	case uint32(5):
 26266  		goto _10
 26267  	case uint32(6):
 26268  		goto _10
 26269  	case uint32(7):
 26270  		goto _10
 26271  	case uint32(8):
 26272  		goto _13
 26273  	case uint32(9):
 26274  		goto _13
 26275  	case uint32(10):
 26276  		goto _15
 26277  	case uint32(11):
 26278  		goto _16
 26279  	case uint32(12):
 26280  		goto _17
 26281  	case uint32(13):
 26282  		goto _18
 26283  	case uint32(14):
 26284  		goto _19
 26285  	case uint32(15):
 26286  		goto _20
 26287  	case uint32(16):
 26288  		goto _21
 26289  	case uint32(17):
 26290  		goto _30
 26291  	case uint32(18):
 26292  		goto _31
 26293  	case uint32(19):
 26294  		goto _21
 26295  	case uint32(20):
 26296  		goto _33
 26297  	case uint32(21):
 26298  		goto _34
 26299  	case uint32(22):
 26300  		goto _21
 26301  	case uint32(23):
 26302  		goto _35
 26303  	case uint32(24):
 26304  		goto _36
 26305  	case uint32(25):
 26306  		goto _37
 26307  	case uint32(26):
 26308  		goto _40
 26309  	case uint32(27):
 26310  		goto _41
 26311  	case uint32(28):
 26312  		goto _42
 26313  	case uint32(29):
 26314  		goto _43
 26315  	case uint32(30):
 26316  		goto _45
 26317  	case uint32(31):
 26318  		goto _47
 26319  	case uint32(32):
 26320  		goto _45
 26321  	case uint32(33):
 26322  		goto _48
 26323  	case uint32(34):
 26324  		goto _49
 26325  	case uint32(35):
 26326  		goto _50
 26327  	case uint32(36):
 26328  		goto _51
 26329  	case uint32(37):
 26330  		goto _52
 26331  	case uint32(38):
 26332  		goto _53
 26333  	case uint32(39):
 26334  		goto _54
 26335  	case uint32(40):
 26336  		goto _55
 26337  	case uint32(41):
 26338  		goto _56
 26339  	case uint32(42):
 26340  		goto _21
 26341  	case uint32(43):
 26342  		goto _31
 26343  	case uint32(44):
 26344  		goto _57
 26345  	case uint32(45):
 26346  		goto _58
 26347  	case uint32(46):
 26348  		goto _59
 26349  	case uint32(47):
 26350  		goto _60
 26351  	case uint32(48):
 26352  		goto _61
 26353  	case uint32(49):
 26354  		goto _62
 26355  	case uint32(50):
 26356  		goto _63
 26357  	case uint32(51):
 26358  		goto _64
 26359  	case uint32(52):
 26360  		goto _65
 26361  	case uint32(53):
 26362  		goto _66
 26363  	case uint32(54):
 26364  		goto _67
 26365  	case uint32(55):
 26366  		goto _68
 26367  	case uint32(56):
 26368  		goto _69
 26369  	case uint32(57):
 26370  		goto _21
 26371  	case uint32(58):
 26372  		goto _72
 26373  	case uint32(59):
 26374  		goto _77
 26375  	case uint32(60):
 26376  		goto _37
 26377  	case uint32(61):
 26378  		goto _78
 26379  	case uint32(62):
 26380  		goto _43
 26381  	case uint32(63):
 26382  		goto _79
 26383  	case uint32(64):
 26384  		goto _80
 26385  	case uint32(65):
 26386  		goto _81
 26387  	case uint32(66):
 26388  		goto _82
 26389  	case uint32(67):
 26390  		goto _21
 26391  	case uint32(68):
 26392  		goto _83
 26393  	case uint32(69):
 26394  		goto _85
 26395  	case uint32(70):
 26396  		goto _83
 26397  	case uint32(71):
 26398  		goto _69
 26399  	case uint32(72):
 26400  		goto _86
 26401  	case uint32(73):
 26402  		goto _87
 26403  	case uint32(74):
 26404  		goto _89
 26405  	case uint32(75):
 26406  		goto _72
 26407  	case uint32(76):
 26408  		goto _21
 26409  	case uint32(77):
 26410  		goto _90
 26411  	case uint32(78):
 26412  		goto _91
 26413  	case uint32(79):
 26414  		goto _92
 26415  	case uint32(80):
 26416  		goto _93
 26417  	case uint32(81):
 26418  		goto _94
 26419  	case uint32(82):
 26420  		goto _95
 26421  	case uint32(83):
 26422  		goto _97
 26423  	case uint32(84):
 26424  		goto _95
 26425  	case uint32(85):
 26426  		goto _98
 26427  	case uint32(86):
 26428  		goto _99
 26429  	case uint32(87):
 26430  		goto _100
 26431  	case uint32(88):
 26432  		goto _101
 26433  	case uint32(89):
 26434  		goto _102
 26435  	case uint32(90):
 26436  		goto _21
 26437  	case uint32(91):
 26438  		goto _103
 26439  	case uint32(92):
 26440  		goto _109
 26441  	case uint32(93):
 26442  		goto _110
 26443  	case uint32(94):
 26444  		goto _111
 26445  	case uint32(95):
 26446  		goto _112
 26447  	case uint32(96):
 26448  		goto _37
 26449  	case uint32(97):
 26450  		goto _116
 26451  	case uint32(98):
 26452  		goto _117
 26453  	case uint32(99):
 26454  		goto _118
 26455  	case uint32(100):
 26456  		goto _119
 26457  	case uint32(101):
 26458  		goto _120
 26459  	case uint32(102):
 26460  		goto _121
 26461  	case uint32(103):
 26462  		goto _122
 26463  	case uint32(104):
 26464  		goto _123
 26465  	case uint32(105):
 26466  		goto _124
 26467  	case uint32(106):
 26468  		goto _112
 26469  	case uint32(107):
 26470  		goto _126
 26471  	case uint32(108):
 26472  		goto _127
 26473  	case uint32(109):
 26474  		goto _128
 26475  	case uint32(110):
 26476  		goto _129
 26477  	case uint32(111):
 26478  		goto _130
 26479  	case uint32(112):
 26480  		goto _131
 26481  	case uint32(113):
 26482  		goto _135
 26483  	case uint32(114):
 26484  		goto _124
 26485  	case uint32(115):
 26486  		goto _140
 26487  	case uint32(116):
 26488  		goto _141
 26489  	case uint32(117):
 26490  		goto _142
 26491  	case uint32(118):
 26492  		goto _143
 26493  	case uint32(119):
 26494  		goto _103
 26495  	case uint32(120):
 26496  		goto _145
 26497  	case uint32(121):
 26498  		goto _147
 26499  	case uint32(122):
 26500  		goto _148
 26501  	case uint32(123):
 26502  		goto _149
 26503  	case uint32(124):
 26504  		goto _150
 26505  	case uint32(125):
 26506  		goto _151
 26507  	case uint32(126):
 26508  		goto _103
 26509  	case uint32(127):
 26510  		goto _145
 26511  	case uint32(128):
 26512  		goto _135
 26513  	case uint32(129):
 26514  		goto _131
 26515  	case uint32(130):
 26516  		goto _152
 26517  	case uint32(131):
 26518  		goto _153
 26519  	case uint32(132):
 26520  		goto _154
 26521  	case uint32(133):
 26522  		goto _155
 26523  	case uint32(134):
 26524  		goto _156
 26525  	case uint32(135):
 26526  		goto _135
 26527  	case uint32(136):
 26528  		goto _131
 26529  	case uint32(137):
 26530  		goto _157
 26531  	case uint32(138):
 26532  		goto _158
 26533  	case uint32(139):
 26534  		goto _159
 26535  	case uint32(140):
 26536  		goto _160
 26537  	case uint32(141):
 26538  		goto _161
 26539  	case uint32(142):
 26540  		goto _162
 26541  	case uint32(143):
 26542  		goto _163
 26543  	case uint32(144):
 26544  		goto _69
 26545  	case uint32(145):
 26546  		goto _87
 26547  	case uint32(146):
 26548  		goto _143
 26549  	case uint32(147):
 26550  		goto _164
 26551  	case uint32(148):
 26552  		goto _165
 26553  	case uint32(149):
 26554  		goto _166
 26555  	case uint32(150):
 26556  		goto _167
 26557  	case uint32(151):
 26558  		goto _168
 26559  	case uint32(152):
 26560  		goto _171
 26561  	case uint32(153):
 26562  		goto _171
 26563  	case uint32(154):
 26564  		goto _173
 26565  	case uint32(155):
 26566  		goto _174
 26567  	case uint32(156):
 26568  		goto _168
 26569  	case uint32(157):
 26570  		goto _168
 26571  	case uint32(158):
 26572  		goto _175
 26573  	case uint32(159):
 26574  		goto _176
 26575  	case uint32(160):
 26576  		goto _177
 26577  	case uint32(161):
 26578  		goto _178
 26579  	case uint32(162):
 26580  		goto _179
 26581  	case uint32(163):
 26582  		goto _180
 26583  	case uint32(164):
 26584  		goto _181
 26585  	case uint32(165):
 26586  		goto _182
 26587  	case uint32(166):
 26588  		goto _183
 26589  	case uint32(167):
 26590  		goto _183
 26591  	case uint32(168):
 26592  		goto _183
 26593  	case uint32(169):
 26594  		goto _183
 26595  	case uint32(170):
 26596  		goto _183
 26597  	case uint32(171):
 26598  		goto _183
 26599  	case uint32(172):
 26600  		goto _183
 26601  	case uint32(173):
 26602  		goto _183
 26603  	case uint32(174):
 26604  		goto _191
 26605  	case uint32(175):
 26606  		goto _192
 26607  	case uint32(176):
 26608  		goto _193
 26609  	case uint32(177):
 26610  		goto _194
 26611  	case uint32(178):
 26612  		goto _195
 26613  	case uint32(179):
 26614  		goto _196
 26615  	case uint32(180):
 26616  		goto _197
 26617  	case uint32(181):
 26618  		goto _198
 26619  	case uint32(182):
 26620  		goto _198
 26621  	case uint32(183):
 26622  		goto _200
 26623  	case uint32(184):
 26624  		goto _201
 26625  	case uint32(185):
 26626  		goto _202
 26627  	case uint32(186):
 26628  		goto _72
 26629  	case uint32(187):
 26630  		goto _204
 26631  	case uint32(188):
 26632  		goto _202
 26633  	case uint32(189):
 26634  		goto _72
 26635  	case uint32(190):
 26636  		goto _205
 26637  	case uint32(191):
 26638  		goto _206
 26639  	case uint32(192):
 26640  		goto _207
 26641  	case uint32(193):
 26642  		goto _208
 26643  	case uint32(194):
 26644  		goto _209
 26645  	case uint32(195):
 26646  		goto _210
 26647  	case uint32(196):
 26648  		goto _211
 26649  	case uint32(197):
 26650  		goto _212
 26651  	case uint32(198):
 26652  		goto _131
 26653  	case uint32(199):
 26654  		goto _135
 26655  	case uint32(200):
 26656  		goto _213
 26657  	case uint32(201):
 26658  		goto _135
 26659  	case uint32(202):
 26660  		goto _103
 26661  	case uint32(203):
 26662  		goto _214
 26663  	case uint32(204):
 26664  		goto _215
 26665  	case uint32(205):
 26666  		goto _103
 26667  	case uint32(206):
 26668  		goto _216
 26669  	case uint32(207):
 26670  		goto _218
 26671  	case uint32(208):
 26672  		goto _219
 26673  	case uint32(209):
 26674  		goto _221
 26675  	case uint32(210):
 26676  		goto _103
 26677  	case uint32(211):
 26678  		goto _216
 26679  	case uint32(212):
 26680  		goto _222
 26681  	case uint32(213):
 26682  		goto _223
 26683  	case uint32(214):
 26684  		goto _21
 26685  	case uint32(215):
 26686  		goto _72
 26687  	case uint32(216):
 26688  		goto _224
 26689  	case uint32(217):
 26690  		goto _225
 26691  	case uint32(218):
 26692  		goto _226
 26693  	case uint32(219):
 26694  		goto _227
 26695  	case uint32(220):
 26696  		goto _228
 26697  	case uint32(221):
 26698  		goto _229
 26699  	case uint32(222):
 26700  		goto _230
 26701  	case uint32(223):
 26702  		goto _231
 26703  	case uint32(224):
 26704  		goto _112
 26705  	case uint32(225):
 26706  		goto _112
 26707  	case uint32(226):
 26708  		goto _232
 26709  	case uint32(227):
 26710  		goto _233
 26711  	case uint32(228):
 26712  		goto _234
 26713  	case uint32(229):
 26714  		goto _235
 26715  	case uint32(230):
 26716  		goto _236
 26717  	case uint32(231):
 26718  		goto _237
 26719  	case uint32(232):
 26720  		goto _238
 26721  	case uint32(233):
 26722  		goto _238
 26723  	case uint32(234):
 26724  		goto _240
 26725  	case uint32(235):
 26726  		goto _241
 26727  	case uint32(236):
 26728  		goto _243
 26729  	case uint32(237):
 26730  		goto _245
 26731  	case uint32(238):
 26732  		goto _246
 26733  	case uint32(239):
 26734  		goto _247
 26735  	case uint32(240):
 26736  		goto _248
 26737  	case uint32(241):
 26738  		goto _249
 26739  	case uint32(242):
 26740  		goto _250
 26741  	case uint32(243):
 26742  		goto _251
 26743  	case uint32(244):
 26744  		goto _252
 26745  	case uint32(245):
 26746  		goto _253
 26747  	case uint32(246):
 26748  		goto _254
 26749  	case uint32(247):
 26750  		goto _255
 26751  	case uint32(248):
 26752  		goto _256
 26753  	case uint32(249):
 26754  		goto _219
 26755  	case uint32(250):
 26756  		goto _257
 26757  	case uint32(251):
 26758  		goto _258
 26759  	case uint32(252):
 26760  		goto _259
 26761  	case uint32(253):
 26762  		goto _260
 26763  	case uint32(254):
 26764  		goto _241
 26765  	case uint32(255):
 26766  		goto _243
 26767  	case uint32(256):
 26768  		goto _261
 26769  	case uint32(257):
 26770  		goto _262
 26771  	case uint32(258):
 26772  		goto _263
 26773  	case uint32(259):
 26774  		goto _264
 26775  	case uint32(260):
 26776  		goto _265
 26777  	case uint32(261):
 26778  		goto _266
 26779  	case uint32(262):
 26780  		goto _267
 26781  	case uint32(263):
 26782  		goto _268
 26783  	case uint32(264):
 26784  		goto _269
 26785  	case uint32(265):
 26786  		goto _270
 26787  	case uint32(266):
 26788  		goto _271
 26789  	case uint32(267):
 26790  		goto _272
 26791  	case uint32(268):
 26792  		goto _272
 26793  	case uint32(269):
 26794  		goto _272
 26795  	case uint32(270):
 26796  		goto _275
 26797  	case uint32(271):
 26798  		goto _276
 26799  	case uint32(272):
 26800  		goto _277
 26801  	case uint32(273):
 26802  		goto _278
 26803  	case uint32(274):
 26804  		goto _279
 26805  	default:
 26806  		goto _280
 26807  	}
 26808  
 26809  _5:
 26810  	_pParse.Xexplain = uint8(1)
 26811  	goto _281
 26812  _6:
 26813  	_pParse.Xexplain = uint8(2)
 26814  	goto _281
 26815  _7:
 26816  	_sqlite3FinishCoding(tls, _pParse)
 26817  	goto _281
 26818  _8:
 26819  	_sqlite3BeginTransaction(tls, _pParse, *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 26820  	goto _281
 26821  _9:
 26822  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(1)).Xminor))) = int32(7)
 26823  	goto _281
 26824  _10:
 26825  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))) = int32(elem49(_yymsp, 0).Xmajor)
 26826  	goto _281
 26827  _13:
 26828  	_sqlite3CommitTransaction(tls, _pParse)
 26829  	goto _281
 26830  _15:
 26831  	_sqlite3RollbackTransaction(tls, _pParse)
 26832  	goto _281
 26833  _16:
 26834  	_sqlite3Savepoint(tls, _pParse, int32(0), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 26835  	goto _281
 26836  _17:
 26837  	_sqlite3Savepoint(tls, _pParse, int32(1), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 26838  	goto _281
 26839  _18:
 26840  	_sqlite3Savepoint(tls, _pParse, int32(2), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 26841  	goto _281
 26842  _19:
 26843  	_sqlite3StartTable(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))), int32(0), int32(0), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))))
 26844  	goto _281
 26845  _20:
 26846  	_disableLookaside(tls, _pParse)
 26847  	goto _281
 26848  _21:
 26849  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(1)).Xminor))) = int32(0)
 26850  	goto _281
 26851  _30:
 26852  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))) = int32(1)
 26853  	goto _281
 26854  _31:
 26855  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))) = int32(1)
 26856  	goto _281
 26857  _33:
 26858  	_sqlite3EndTable(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))), uint8(*(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))), nil)
 26859  	goto _281
 26860  _34:
 26861  	_sqlite3EndTable(tls, _pParse, nil, nil, 0, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))))
 26862  	_sqlite3SelectDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))))
 26863  	goto _281
 26864  _35:
 26865  	if (((*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xn) == uint32(5)) && (Xsqlite3_strnicmp(tls, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xz, str(27182), int32(5)) == int32(0)) {
 26866  		*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))) = int32(96)
 26867  		goto _284
 26868  	}
 26869  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))) = int32(0)
 26870  	_sqlite3ErrorMsg(tls, _pParse, str(27188), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xn, unsafe.Pointer((*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xz))
 26871  _284:
 26872  	goto _281
 26873  _36:
 26874  	_sqlite3AddColumn(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 26875  	goto _281
 26876  _37:
 26877  	(*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(1)).Xminor))).Xn = 0
 26878  	(*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(1)).Xminor))).Xz = nil
 26879  	goto _281
 26880  _40:
 26881  	(*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))).Xn = uint32(int32(uintptr(unsafe.Pointer(elem1((*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xz, uintptr((*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xn)))) - uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))).Xz))))
 26882  	goto _281
 26883  _41:
 26884  	(*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967291)).Xminor))).Xn = uint32(int32(uintptr(unsafe.Pointer(elem1((*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xz, uintptr((*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xn)))) - uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967291)).Xminor))).Xz))))
 26885  	goto _281
 26886  _42:
 26887  	(*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))).Xn = ((*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xn) + uint32(int32(uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xz))-uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))).Xz))))
 26888  	goto _281
 26889  _43:
 26890  	_pParse.XconstraintName = *(*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))
 26891  	goto _281
 26892  _45:
 26893  	_sqlite3AddDefaultValue(tls, _pParse, (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 26894  	goto _281
 26895  _47:
 26896  	_sqlite3AddDefaultValue(tls, _pParse, (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 26897  	goto _281
 26898  _48:
 26899  	*(**XExpr)(unsafe.Pointer(&_34_v.XpExpr)) = _sqlite3PExpr(tls, _pParse, int32(155), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr), nil)
 26900  	_34_v.XzStart = (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))).Xz
 26901  	_34_v.XzEnd = (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XzEnd
 26902  	_sqlite3AddDefaultValue(tls, _pParse, &_34_v)
 26903  	goto _281
 26904  _49:
 26905  	_spanExpr(tls, &_35_v, _pParse, int32(97), *(*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 26906  	_sqlite3AddDefaultValue(tls, _pParse, &_35_v)
 26907  	goto _281
 26908  _50:
 26909  	_sqlite3AddNotNull(tls, _pParse, *(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 26910  	goto _281
 26911  _51:
 26912  	_sqlite3AddPrimaryKey(tls, _pParse, nil, *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))))
 26913  	goto _281
 26914  _52:
 26915  	_sqlite3CreateIndex(tls, _pParse, nil, nil, nil, nil, *(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))), nil, nil, int32(0), int32(0), uint8(1))
 26916  	goto _281
 26917  _53:
 26918  	_sqlite3AddCheckConstraint(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))).XpExpr))
 26919  	goto _281
 26920  _54:
 26921  	_sqlite3CreateForeignKey(tls, _pParse, nil, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 26922  	goto _281
 26923  _55:
 26924  	_sqlite3DeferForeignKey(tls, _pParse, *(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 26925  	goto _281
 26926  _56:
 26927  	_sqlite3AddCollateType(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 26928  	goto _281
 26929  _57:
 26930  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(1)).Xminor))) = int32(0)
 26931  	goto _281
 26932  _58:
 26933  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))) = ((*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))) & (^((*t54)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xmask))) | ((*t54)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xvalue)
 26934  	goto _281
 26935  _59:
 26936  	(*t54)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))).Xvalue = int32(0)
 26937  	(*t54)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))).Xmask = int32(0)
 26938  	goto _281
 26939  _60:
 26940  	(*t54)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).Xvalue = int32(0)
 26941  	(*t54)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).Xmask = int32(0)
 26942  	goto _281
 26943  _61:
 26944  	(*t54)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).Xvalue = *(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))
 26945  	(*t54)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).Xmask = int32(255)
 26946  	goto _281
 26947  _62:
 26948  	(*t54)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).Xvalue = (*(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))) << 8
 26949  	(*t54)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).Xmask = int32(65280)
 26950  	goto _281
 26951  _63:
 26952  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))) = int32(7)
 26953  	goto _281
 26954  _64:
 26955  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))) = int32(8)
 26956  	goto _281
 26957  _65:
 26958  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))) = int32(9)
 26959  	goto _281
 26960  _66:
 26961  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))) = int32(6)
 26962  	goto _281
 26963  _67:
 26964  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))) = int32(0)
 26965  	goto _281
 26966  _68:
 26967  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))) = int32(0)
 26968  	goto _281
 26969  _69:
 26970  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))) = *(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))
 26971  	goto _281
 26972  _72:
 26973  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))) = int32(1)
 26974  	goto _281
 26975  _77:
 26976  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))) = int32(0)
 26977  	goto _281
 26978  _78:
 26979  	_pParse.XconstraintName.Xn = 0
 26980  	goto _281
 26981  _79:
 26982  	_sqlite3AddPrimaryKey(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor)))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), int32(0))
 26983  	goto _281
 26984  _80:
 26985  	_sqlite3CreateIndex(tls, _pParse, nil, nil, nil, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor)))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))), nil, nil, int32(0), int32(0), uint8(1))
 26986  	goto _281
 26987  _81:
 26988  	_sqlite3AddCheckConstraint(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).XpExpr))
 26989  	goto _281
 26990  _82:
 26991  	_sqlite3CreateForeignKey(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor)))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 26992  	_sqlite3DeferForeignKey(tls, _pParse, *(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 26993  	goto _281
 26994  _83:
 26995  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(1)).Xminor))) = int32(10)
 26996  	goto _281
 26997  _85:
 26998  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))) = *(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))
 26999  	goto _281
 27000  _86:
 27001  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))) = int32(4)
 27002  	goto _281
 27003  _87:
 27004  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))) = int32(5)
 27005  	goto _281
 27006  _89:
 27007  	_sqlite3DropTable(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))), int32(0), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 27008  	goto _281
 27009  _90:
 27010  	_sqlite3CreateView(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967288)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor)))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967289)).Xminor))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967291)).Xminor))))
 27011  	goto _281
 27012  _91:
 27013  	_sqlite3DropTable(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))), int32(1), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 27014  	goto _281
 27015  _92:
 27016  	_70_dest = XSelectDest{XeDest: uint8(9)}
 27017  	_sqlite3Select(tls, _pParse, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))), &_70_dest)
 27018  	_sqlite3SelectDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))))
 27019  	goto _281
 27020  _93:
 27021  	_71_p = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27022  	if _71_p != nil {
 27023  		*(**XWith)(unsafe.Pointer(&_71_p.XpWith)) = (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 27024  		_parserDoubleLinkSelect(tls, _pParse, _71_p)
 27025  		goto _286
 27026  	}
 27027  	_sqlite3WithDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))))
 27028  _286:
 27029  	*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))) = _71_p
 27030  	goto _281
 27031  _94:
 27032  	_74_pRhs = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27033  	_74_pLhs = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))))
 27034  	if (_74_pRhs != nil) && (_74_pRhs.XpPrior != nil) {
 27035  		_75_x.Xn = 0
 27036  		_parserDoubleLinkSelect(tls, _pParse, _74_pRhs)
 27037  		_75_pFrom = _sqlite3SrcListAppendFromTerm(tls, _pParse, nil, nil, nil, &_75_x, _74_pRhs, nil, nil)
 27038  		_74_pRhs = _sqlite3SelectNew(tls, _pParse, nil, _75_pFrom, nil, nil, nil, nil, 0, nil, nil)
 27039  	}
 27040  	if _74_pRhs == nil {
 27041  		goto _289
 27042  	}
 27043  	_74_pRhs.Xop = uint8(*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 27044  	*(**XSelect)(unsafe.Pointer(&_74_pRhs.XpPrior)) = _74_pLhs
 27045  	if func() int32 {
 27046  		if _74_pLhs != nil {
 27047  			return int32(1)
 27048  		}
 27049  		return func() int32 {
 27050  			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)))
 27051  			crt.X__builtin_abort(tls)
 27052  			return int32(0)
 27053  		}()
 27054  	}() != 0 {
 27055  		_74_pLhs.XselFlags &= uint32(4294966271)
 27056  	}
 27057  	_74_pRhs.XselFlags &= uint32(4294966271)
 27058  	if (*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))) != int32(116) {
 27059  		_pParse.XhasCompound = uint8(1)
 27060  	}
 27061  	goto _294
 27062  _289:
 27063  	_sqlite3SelectDelete(tls, (*Xsqlite3)(_pParse.Xdb), _74_pLhs)
 27064  _294:
 27065  	*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))))) = _74_pRhs
 27066  	goto _281
 27067  _95:
 27068  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))) = int32(elem49(_yymsp, 0).Xmajor)
 27069  	goto _281
 27070  _97:
 27071  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))) = int32(116)
 27072  	goto _281
 27073  _98:
 27074  	_80_s = *(*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967288)).Xminor)))
 27075  	*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967288)).Xminor))))) = _sqlite3SelectNew(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor)))), (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967291)).Xminor)))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor)))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor)))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor)))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))), uint32(*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967289)).Xminor)))), (*XExpr)((*t55)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpLimit), (*XExpr)((*t55)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpOffset))
 27076  	if (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967288)).Xminor)))) == nil {
 27077  		goto _295
 27078  	}
 27079  	_81_z = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_80_s.Xz)) + uintptr(int32(6))))
 27080  	Xsqlite3_snprintf(tls, int32(12), (*int8)(unsafe.Pointer(&((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967288)).Xminor)))).XzSelName))), str(27215), preInc2(&_pParse.XnSelect, 1))
 27081  _296:
 27082  	if int32(*elem1(_81_z, 0)) == int32(32) {
 27083  		*(*uintptr)(unsafe.Pointer(&_81_z)) += uintptr(1)
 27084  		goto _296
 27085  	}
 27086  	if int32(*elem1(_81_z, 0)) != int32(47) || int32(*elem1(_81_z, uintptr(1))) != int32(42) {
 27087  		goto _299
 27088  	}
 27089  	*(*uintptr)(unsafe.Pointer(&_81_z)) += uintptr(int32(2))
 27090  _300:
 27091  	if int32(*elem1(_81_z, 0)) == int32(32) {
 27092  		*(*uintptr)(unsafe.Pointer(&_81_z)) += uintptr(1)
 27093  		goto _300
 27094  	}
 27095  	_81_i = int32(0)
 27096  _302:
 27097  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_81_z, uintptr(_81_i)))))) & int32(6)) == 0 {
 27098  		goto _305
 27099  	}
 27100  	_81_i += 1
 27101  	goto _302
 27102  _305:
 27103  	Xsqlite3_snprintf(tls, int32(12), (*int8)(unsafe.Pointer(&((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967288)).Xminor)))).XzSelName))), str(27219), _81_i, unsafe.Pointer(_81_z))
 27104  _299:
 27105  _295:
 27106  	goto _281
 27107  _99:
 27108  	*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))))) = _sqlite3SelectNew(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))), nil, nil, nil, nil, nil, uint32(512), nil, nil)
 27109  	goto _281
 27110  _100:
 27111  	_85_pLeft = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))))
 27112  	_85_pRight = _sqlite3SelectNew(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))), nil, nil, nil, nil, nil, uint32(1536), nil, nil)
 27113  	if func() int32 {
 27114  		if _85_pLeft != nil {
 27115  			return int32(1)
 27116  		}
 27117  		return func() int32 {
 27118  			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)))
 27119  			crt.X__builtin_abort(tls)
 27120  			return int32(0)
 27121  		}()
 27122  	}() != 0 {
 27123  		_85_pLeft.XselFlags &= uint32(4294966271)
 27124  	}
 27125  	if _85_pRight != nil {
 27126  		_85_pRight.Xop = uint8(116)
 27127  		*(**XSelect)(unsafe.Pointer(&_85_pRight.XpPrior)) = _85_pLeft
 27128  		*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))))) = _85_pRight
 27129  		goto _310
 27130  	}
 27131  	*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))))) = _85_pLeft
 27132  _310:
 27133  	goto _281
 27134  _101:
 27135  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))) = int32(1)
 27136  	goto _281
 27137  _102:
 27138  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))) = int32(2)
 27139  	goto _281
 27140  _103:
 27141  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(1)).Xminor))))) = nil
 27142  	goto _281
 27143  _109:
 27144  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor)))), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))).XpExpr))
 27145  	if ((*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xn) > (0) {
 27146  		_sqlite3ExprListSetName(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))), int32(1))
 27147  	}
 27148  	_sqlite3ExprListSetSpan(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor)))), (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 27149  	goto _281
 27150  _110:
 27151  	_92_p = _sqlite3Expr(tls, (*Xsqlite3)(_pParse.Xdb), int32(161), nil)
 27152  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))), _92_p)
 27153  	goto _281
 27154  _111:
 27155  	_93_pRight = _sqlite3PExpr(tls, _pParse, int32(161), nil, nil)
 27156  	_93_pLeft = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(27), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), int32(1))
 27157  	_93_pDot = _sqlite3PExpr(tls, _pParse, int32(122), _93_pLeft, _93_pRight)
 27158  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor)))), _93_pDot)
 27159  	goto _281
 27160  _112:
 27161  	*(*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))) = *(*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))
 27162  	goto _281
 27163  _116:
 27164  	*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(1)).Xminor))))) = (*XSrcList)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pParse.Xdb), uint64(76)))
 27165  	goto _281
 27166  _117:
 27167  	*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))) = (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27168  	_sqlite3SrcListShiftJoinType(tls, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))))
 27169  	goto _281
 27170  _118:
 27171  	if func() int32 {
 27172  		if ((*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))) != nil) && (((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))).XnSrc) > int32(0)) {
 27173  			return int32(1)
 27174  		}
 27175  		return func() int32 {
 27176  			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)))
 27177  			crt.X__builtin_abort(tls)
 27178  			return int32(0)
 27179  		}()
 27180  	}() != 0 {
 27181  		(elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))).Xa))), uintptr(((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))).XnSrc)-int32(1))).Xfg).Xjointype = uint8(*(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27182  	}
 27183  	goto _281
 27184  _119:
 27185  	*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(1)).Xminor))))) = nil
 27186  	goto _281
 27187  _120:
 27188  	*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967291)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))), nil, (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))))
 27189  	_sqlite3SrcListIndexedBy(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))))
 27190  	goto _281
 27191  _121:
 27192  	*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967288)).Xminor))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967288)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967289)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), nil, (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))))
 27193  	_sqlite3SrcListFuncArgs(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967288)).Xminor)))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor)))))
 27194  	goto _281
 27195  _122:
 27196  	*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor)))), nil, nil, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor)))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))))
 27197  	goto _281
 27198  _123:
 27199  	if ((((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor)))) == nil) && (((*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).Xn) == (0))) && ((*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))) == nil)) && ((*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))) == nil) {
 27200  		*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor))))) = (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))))
 27201  		goto _323
 27202  	}
 27203  	if ((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor)))).XnSrc) != int32(1) {
 27204  		goto _321
 27205  	}
 27206  	*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor)))), nil, nil, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), nil, (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))))
 27207  	if (*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor)))) != nil {
 27208  		_105_pNew = elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor)))).Xa))), uintptr(((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor)))).XnSrc)-int32(1)))
 27209  		_105_pOld = (*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor)))).Xa)))
 27210  		_105_pNew.XzName = _105_pOld.XzName
 27211  		_105_pNew.XzDatabase = _105_pOld.XzDatabase
 27212  		*(**XSelect)(unsafe.Pointer(&_105_pNew.XpSelect)) = (*XSelect)(_105_pOld.XpSelect)
 27213  		_105_pOld.XzName = store1(&_105_pOld.XzDatabase, nil)
 27214  		*(**XSelect)(unsafe.Pointer(&_105_pOld.XpSelect)) = nil
 27215  	}
 27216  	_sqlite3SrcListDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor)))))
 27217  	goto _323
 27218  _321:
 27219  	_sqlite3SrcListShiftJoinType(tls, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor)))))
 27220  	_106_pSubquery = _sqlite3SelectNew(tls, _pParse, nil, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor)))), nil, nil, nil, nil, uint32(2048), nil, nil)
 27221  	*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor)))), nil, nil, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), _106_pSubquery, (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))))
 27222  _323:
 27223  	goto _281
 27224  _124:
 27225  	(*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(1)).Xminor))).Xz = nil
 27226  	(*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(1)).Xminor))).Xn = 0
 27227  	goto _281
 27228  _126:
 27229  	*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))) = _sqlite3SrcListAppend(tls, (*Xsqlite3)(_pParse.Xdb), nil, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27230  	goto _281
 27231  _127:
 27232  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))) = int32(1)
 27233  	goto _281
 27234  _128:
 27235  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))) = _sqlite3JoinType(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))), nil, nil)
 27236  	goto _281
 27237  _129:
 27238  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))) = _sqlite3JoinType(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))), nil)
 27239  	goto _281
 27240  _130:
 27241  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))) = _sqlite3JoinType(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 27242  	goto _281
 27243  _131:
 27244  	*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr)
 27245  	goto _281
 27246  _135:
 27247  	*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(1)).Xminor))))) = nil
 27248  	goto _281
 27249  _140:
 27250  	*(*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))) = *(*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))
 27251  	goto _281
 27252  _141:
 27253  	(*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))).Xz = nil
 27254  	(*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))).Xn = uint32(1)
 27255  	goto _281
 27256  _142:
 27257  	*(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))))) = (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 27258  	goto _281
 27259  _143:
 27260  	*(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(1)).Xminor))))) = nil
 27261  	goto _281
 27262  _145:
 27263  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))))) = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27264  	goto _281
 27265  _147:
 27266  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor)))), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))).XpExpr))
 27267  	_sqlite3ExprListSetSortOrder(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor)))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27268  	goto _281
 27269  _148:
 27270  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))) = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))).XpExpr))
 27271  	_sqlite3ExprListSetSortOrder(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27272  	goto _281
 27273  _149:
 27274  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))) = int32(0)
 27275  	goto _281
 27276  _150:
 27277  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))) = int32(1)
 27278  	goto _281
 27279  _151:
 27280  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(1)).Xminor))) = int32(-1)
 27281  	goto _281
 27282  _152:
 27283  	*(**XExpr)(unsafe.Pointer(&((*t55)(unsafe.Pointer(&(elem49(_yymsp, uintptr(1)).Xminor))).XpLimit))) = nil
 27284  	*(**XExpr)(unsafe.Pointer(&((*t55)(unsafe.Pointer(&(elem49(_yymsp, uintptr(1)).Xminor))).XpOffset))) = nil
 27285  	goto _281
 27286  _153:
 27287  	*(**XExpr)(unsafe.Pointer(&((*t55)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))).XpLimit))) = (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr)
 27288  	*(**XExpr)(unsafe.Pointer(&((*t55)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))).XpOffset))) = nil
 27289  	goto _281
 27290  _154:
 27291  	*(**XExpr)(unsafe.Pointer(&((*t55)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))).XpLimit))) = (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).XpExpr)
 27292  	*(**XExpr)(unsafe.Pointer(&((*t55)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))).XpOffset))) = (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr)
 27293  	goto _281
 27294  _155:
 27295  	*(**XExpr)(unsafe.Pointer(&((*t55)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))).XpOffset))) = (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).XpExpr)
 27296  	*(**XExpr)(unsafe.Pointer(&((*t55)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))).XpLimit))) = (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr)
 27297  	goto _281
 27298  _156:
 27299  	_sqlite3WithPush(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967291)).Xminor)))), uint8(1))
 27300  	_sqlite3SrcListIndexedBy(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 27301  	_sqlite3DeleteFrom(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor)))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))))
 27302  	goto _281
 27303  _157:
 27304  	_sqlite3WithPush(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967289)).Xminor)))), uint8(1))
 27305  	_sqlite3SrcListIndexedBy(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))))
 27306  	_sqlite3ExprListCheckLength(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))), str(27224))
 27307  	_sqlite3Update(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor)))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967291)).Xminor))))
 27308  	goto _281
 27309  _158:
 27310  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor)))), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr))
 27311  	_sqlite3ExprListSetName(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), int32(1))
 27312  	goto _281
 27313  _159:
 27314  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor))))) = _sqlite3ExprListAppendVector(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor)))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor)))), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr))
 27315  	goto _281
 27316  _160:
 27317  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_4_yylhsminor)))) = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr))
 27318  	_sqlite3ExprListSetName(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_4_yylhsminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), int32(1))
 27319  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))))) = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_4_yylhsminor)))
 27320  	goto _281
 27321  _161:
 27322  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))))) = _sqlite3ExprListAppendVector(tls, _pParse, nil, (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor)))), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr))
 27323  	goto _281
 27324  _162:
 27325  	_sqlite3WithPush(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967291)).Xminor)))), uint8(1))
 27326  	_sqlite3Insert(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor)))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))))
 27327  	goto _281
 27328  _163:
 27329  	_sqlite3WithPush(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor)))), uint8(1))
 27330  	_sqlite3Insert(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor)))), nil, (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor)))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967291)).Xminor))))
 27331  	goto _281
 27332  _164:
 27333  	*(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))))) = (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 27334  	goto _281
 27335  _165:
 27336  	*(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))))) = _sqlite3IdListAppend(tls, (*Xsqlite3)(_pParse.Xdb), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27337  	goto _281
 27338  _166:
 27339  	*(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))) = _sqlite3IdListAppend(tls, (*Xsqlite3)(_pParse.Xdb), nil, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27340  	goto _281
 27341  _167:
 27342  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27343  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).XpExpr))) = (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))).XpExpr)
 27344  	goto _281
 27345  _168:
 27346  	_spanExpr(tls, (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))), _pParse, int32(elem49(_yymsp, 0).Xmajor), *(*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27347  	goto _281
 27348  _171:
 27349  	_spanExpr(tls, (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))), _pParse, int32(27), *(*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27350  	goto _281
 27351  _173:
 27352  	_143_temp1 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(27), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), int32(1))
 27353  	_143_temp2 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(27), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))), int32(1))
 27354  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27355  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).XpExpr))) = _sqlite3PExpr(tls, _pParse, int32(122), _143_temp1, _143_temp2)
 27356  	goto _281
 27357  _174:
 27358  	_144_temp1 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(27), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))), int32(1))
 27359  	_144_temp2 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(27), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), int32(1))
 27360  	_144_temp3 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(27), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))), int32(1))
 27361  	_144_temp4 = _sqlite3PExpr(tls, _pParse, int32(122), _144_temp2, _144_temp3)
 27362  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27363  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr))) = _sqlite3PExpr(tls, _pParse, int32(122), _144_temp1, _144_temp4)
 27364  	goto _281
 27365  _175:
 27366  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XpExpr))) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(134), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))), int32(1))
 27367  	(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XzStart = (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xz
 27368  	(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XzEnd = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xz)) + uintptr((*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xn)))
 27369  	if ((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XpExpr) != nil {
 27370  		(*XExpr)((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XpExpr).Xflags |= uint32(8388612)
 27371  	}
 27372  	*(*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor))
 27373  	goto _281
 27374  _176:
 27375  	if int32(*elem1((*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xz, 0)) != int32(35) || (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1((*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xz, uintptr(1))))))&int32(4)) == 0 {
 27376  		_147_n = (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xn
 27377  		_spanExpr(tls, (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))), _pParse, int32(135), *(*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27378  		_sqlite3ExprAssignVarNumber(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr), _147_n)
 27379  		goto _327
 27380  	}
 27381  	_148_t = *(*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))
 27382  	func() {
 27383  		if _148_t.Xn < uint32(2) {
 27384  			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)))
 27385  			crt.X__builtin_abort(tls)
 27386  		}
 27387  	}()
 27388  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))), &_148_t, &_148_t)
 27389  	if int32(_pParse.Xnested) == int32(0) {
 27390  		_sqlite3ErrorMsg(tls, _pParse, str(27240), unsafe.Pointer(&_148_t))
 27391  		*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr))) = nil
 27392  		goto _331
 27393  	}
 27394  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr))) = _sqlite3PExpr(tls, _pParse, int32(157), nil, nil)
 27395  	if ((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr) != nil {
 27396  		_sqlite3GetInt32(tls, elem1(_148_t.Xz, uintptr(1)), &((*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr).XiTable))
 27397  	}
 27398  _331:
 27399  _327:
 27400  	goto _281
 27401  _177:
 27402  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).XpExpr))) = _sqlite3ExprAddCollateToken(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).XpExpr), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))), int32(1))
 27403  	(*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).XzEnd = elem1((*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xz, uintptr((*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xn))
 27404  	goto _281
 27405  _178:
 27406  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967291)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967291)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27407  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967291)).Xminor))).XpExpr))) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(37), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))), int32(1))
 27408  	_sqlite3ExprAttachSubtrees(tls, (*Xsqlite3)(_pParse.Xdb), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967291)).Xminor))).XpExpr), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))).XpExpr), nil)
 27409  	goto _281
 27410  _179:
 27411  	if ((*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))) != nil) && (((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))).XnExpr) > (*elem8((*int32)(unsafe.Pointer(&((*Xsqlite3)(_pParse.Xdb).XaLimit))), uintptr(6)))) {
 27412  		_sqlite3ErrorMsg(tls, _pParse, str(27264), unsafe.Pointer((*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor)))))
 27413  	}
 27414  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XpExpr))) = _sqlite3ExprFunction(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))))
 27415  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27416  	if ((*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor)))) == int32(1)) && (((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XpExpr) != nil) {
 27417  		(*XExpr)((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XpExpr).Xflags |= uint32(16)
 27418  	}
 27419  	*(*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor))
 27420  	goto _281
 27421  _180:
 27422  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XpExpr))) = _sqlite3ExprFunction(tls, _pParse, nil, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))))
 27423  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27424  	*(*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor))
 27425  	goto _281
 27426  _181:
 27427  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XpExpr))) = _sqlite3ExprFunction(tls, _pParse, nil, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27428  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27429  	*(*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor))
 27430  	goto _281
 27431  _182:
 27432  	_158_pList = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor)))), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))).XpExpr))
 27433  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XpExpr))) = _sqlite3PExpr(tls, _pParse, int32(158), nil, nil)
 27434  	if ((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XpExpr) != nil {
 27435  		*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).XpExpr).Xx))))) = _158_pList
 27436  		_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27437  		goto _338
 27438  	}
 27439  	_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.Xdb), _158_pList)
 27440  _338:
 27441  	*(*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor))
 27442  	goto _281
 27443  _183:
 27444  	_spanBinaryExpr(tls, _pParse, int32(elem49(_yymsp, uintptr(4294967295)).Xmajor), (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27445  	goto _281
 27446  _191:
 27447  	*(*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))) = *(*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))
 27448  	(*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))).Xn |= uint32(2147483648)
 27449  	goto _281
 27450  _192:
 27451  	_163_bNot = int32(((*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))).Xn) & uint32(2147483648))
 27452  	(*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))).Xn &= uint32(2147483647)
 27453  	_163_pList = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr))
 27454  	_163_pList = _sqlite3ExprListAppend(tls, _pParse, _163_pList, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).XpExpr))
 27455  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).XpExpr))) = _sqlite3ExprFunction(tls, _pParse, _163_pList, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 27456  	_exprNot(tls, _pParse, _163_bNot, (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))))
 27457  	(*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).XzEnd = (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XzEnd
 27458  	if ((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).XpExpr) != nil {
 27459  		(*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).XpExpr).Xflags |= uint32(128)
 27460  	}
 27461  	goto _281
 27462  _193:
 27463  	_164_bNot = int32(((*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))).Xn) & uint32(2147483648))
 27464  	(*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))).Xn &= uint32(2147483647)
 27465  	_164_pList = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).XpExpr))
 27466  	_164_pList = _sqlite3ExprListAppend(tls, _pParse, _164_pList, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr))
 27467  	_164_pList = _sqlite3ExprListAppend(tls, _pParse, _164_pList, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr))
 27468  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr))) = _sqlite3ExprFunction(tls, _pParse, _164_pList, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))))
 27469  	_exprNot(tls, _pParse, _164_bNot, (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))))
 27470  	(*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XzEnd = (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XzEnd
 27471  	if ((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr) != nil {
 27472  		(*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr).Xflags |= uint32(128)
 27473  	}
 27474  	goto _281
 27475  _194:
 27476  	_spanUnaryPostfix(tls, _pParse, int32(elem49(_yymsp, 0).Xmajor), (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27477  	goto _281
 27478  _195:
 27479  	_spanUnaryPostfix(tls, _pParse, int32(76), (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27480  	goto _281
 27481  _196:
 27482  	_spanBinaryExpr(tls, _pParse, int32(72), (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27483  	_binaryToUnaryIfNull(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).XpExpr), int32(75))
 27484  	goto _281
 27485  _197:
 27486  	_spanBinaryExpr(tls, _pParse, int32(148), (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))), (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27487  	_binaryToUnaryIfNull(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))).XpExpr), int32(76))
 27488  	goto _281
 27489  _198:
 27490  	_spanUnaryPrefix(tls, (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))), _pParse, int32(elem49(_yymsp, uintptr(4294967295)).Xmajor), (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 27491  	goto _281
 27492  _200:
 27493  	_spanUnaryPrefix(tls, (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))), _pParse, int32(155), (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 27494  	goto _281
 27495  _201:
 27496  	_spanUnaryPrefix(tls, (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))), _pParse, int32(156), (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 27497  	goto _281
 27498  _202:
 27499  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))) = int32(0)
 27500  	goto _281
 27501  _204:
 27502  	_173_pList = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).XpExpr))
 27503  	_173_pList = _sqlite3ExprListAppend(tls, _pParse, _173_pList, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr))
 27504  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr))) = _sqlite3PExpr(tls, _pParse, int32(73), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr), nil)
 27505  	if ((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr) != nil {
 27506  		*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr).Xx))))) = _173_pList
 27507  		goto _342
 27508  	}
 27509  	_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.Xdb), _173_pList)
 27510  _342:
 27511  	_exprNot(tls, _pParse, *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))), (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))))
 27512  	(*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XzEnd = (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XzEnd
 27513  	goto _281
 27514  _205:
 27515  	if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))) == nil {
 27516  		_sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr))
 27517  		*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr))) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(134), elem56((*XToken)(unsafe.Pointer(&_sqlite3IntTokens)), uintptr(*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))))), int32(1))
 27518  		goto _351
 27519  	}
 27520  	if ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))).XnExpr) != int32(1) {
 27521  		goto _345
 27522  	}
 27523  	_178_pRHS = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))).Xa))), 0).XpExpr)
 27524  	*(**XExpr)(unsafe.Pointer(&(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))).Xa))), 0).XpExpr))) = nil
 27525  	_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))))
 27526  	if func() int32 {
 27527  		if _178_pRHS != nil {
 27528  			return int32(1)
 27529  		}
 27530  		return func() int32 {
 27531  			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)))
 27532  			crt.X__builtin_abort(tls)
 27533  			return int32(0)
 27534  		}()
 27535  	}() != 0 {
 27536  		_178_pRHS.Xflags &= uint32(4294967039)
 27537  		_178_pRHS.Xflags |= uint32(512)
 27538  	}
 27539  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr))) = _sqlite3PExpr(tls, _pParse, func() int32 {
 27540  		if (*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor)))) != 0 {
 27541  			return int32(77)
 27542  		}
 27543  		return int32(78)
 27544  	}(), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr), _178_pRHS)
 27545  	goto _351
 27546  _345:
 27547  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr))) = _sqlite3PExpr(tls, _pParse, int32(74), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr), nil)
 27548  	if ((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr) != nil {
 27549  		*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr).Xx))))) = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 27550  		_sqlite3ExprSetHeightAndFlags(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr))
 27551  		goto _353
 27552  	}
 27553  	_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))))
 27554  _353:
 27555  	_exprNot(tls, _pParse, *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))), (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))))
 27556  _351:
 27557  	(*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XzEnd = elem1((*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xz, uintptr((*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xn))
 27558  	goto _281
 27559  _206:
 27560  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27561  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).XpExpr))) = _sqlite3PExpr(tls, _pParse, int32(119), nil, nil)
 27562  	_sqlite3PExprAddSelect(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).XpExpr), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))))
 27563  	goto _281
 27564  _207:
 27565  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr))) = _sqlite3PExpr(tls, _pParse, int32(74), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr), nil)
 27566  	_sqlite3PExprAddSelect(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))))
 27567  	_exprNot(tls, _pParse, *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))), (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))))
 27568  	(*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XzEnd = elem1((*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xz, uintptr((*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xn))
 27569  	goto _281
 27570  _208:
 27571  	_185_pSrc = _sqlite3SrcListAppend(tls, (*Xsqlite3)(_pParse.Xdb), nil, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 27572  	_185_pSelect = _sqlite3SelectNew(tls, _pParse, nil, _185_pSrc, nil, nil, nil, nil, 0, nil, nil)
 27573  	if (*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))) != nil {
 27574  		_sqlite3SrcListFuncArgs(tls, _pParse, func() *XSrcList {
 27575  			if _185_pSelect != nil {
 27576  				return _185_pSrc
 27577  			}
 27578  			return nil
 27579  		}(), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))))
 27580  	}
 27581  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr))) = _sqlite3PExpr(tls, _pParse, int32(74), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr), nil)
 27582  	_sqlite3PExprAddSelect(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr), _185_pSelect)
 27583  	_exprNot(tls, _pParse, *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))), (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))))
 27584  	(*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XzEnd = func() *int8 {
 27585  		if ((*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))).Xz) != nil {
 27586  			return elem1((*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))).Xz, uintptr((*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))).Xn))
 27587  		}
 27588  		return elem1((*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).Xz, uintptr((*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).Xn))
 27589  	}()
 27590  	goto _281
 27591  _209:
 27592  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27593  	_186_p = store58((**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))).XpExpr))), _sqlite3PExpr(tls, _pParse, int32(20), nil, nil))
 27594  	_sqlite3PExprAddSelect(tls, _pParse, _186_p, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))))
 27595  	goto _281
 27596  _210:
 27597  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27598  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr))) = _sqlite3PExpr(tls, _pParse, int32(136), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor)))), nil)
 27599  	if ((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr) != nil {
 27600  		*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr).Xx))))) = func() *XExprList {
 27601  			if (*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))) != nil {
 27602  				return _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor)))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))))
 27603  			}
 27604  			return (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))))
 27605  		}()
 27606  		_sqlite3ExprSetHeightAndFlags(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).XpExpr))
 27607  		goto _362
 27608  	}
 27609  	_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor)))))
 27610  	_sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))))
 27611  _362:
 27612  	goto _281
 27613  _211:
 27614  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor)))), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).XpExpr))
 27615  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor)))), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr))
 27616  	goto _281
 27617  _212:
 27618  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))))) = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).XpExpr))
 27619  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor)))), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr))
 27620  	goto _281
 27621  _213:
 27622  	*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr)
 27623  	goto _281
 27624  _214:
 27625  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor)))), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr))
 27626  	goto _281
 27627  _215:
 27628  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))) = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr))
 27629  	goto _281
 27630  _216:
 27631  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))))) = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 27632  	goto _281
 27633  _218:
 27634  	_sqlite3CreateIndex(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967289)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor))), _sqlite3SrcListAppend(tls, (*Xsqlite3)(_pParse.Xdb), nil, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))), nil), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor)))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967286)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967285)).Xminor))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))), int32(0), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967288)).Xminor))), 0)
 27635  	goto _281
 27636  _219:
 27637  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))) = int32(2)
 27638  	goto _281
 27639  _221:
 27640  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(1)).Xminor))) = int32(0)
 27641  	goto _281
 27642  _222:
 27643  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))))) = _parserAddExprIdListTerm(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27644  	goto _281
 27645  _223:
 27646  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))))) = _parserAddExprIdListTerm(tls, _pParse, nil, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27647  	goto _281
 27648  _224:
 27649  	_sqlite3DropIndex(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 27650  	goto _281
 27651  _225:
 27652  	_sqlite3Vacuum(tls, _pParse, nil)
 27653  	goto _281
 27654  _226:
 27655  	_sqlite3Vacuum(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27656  	goto _281
 27657  _227:
 27658  	_sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))), nil, int32(0))
 27659  	goto _281
 27660  _228:
 27661  	_sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))), int32(0))
 27662  	goto _281
 27663  _229:
 27664  	_sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))), int32(0))
 27665  	goto _281
 27666  _230:
 27667  	_sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))), int32(1))
 27668  	goto _281
 27669  _231:
 27670  	_sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))), int32(1))
 27671  	goto _281
 27672  _232:
 27673  	_209_all.Xz = (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))).Xz
 27674  	_209_all.Xn = uint32(int32(uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xz))-uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))).Xz)))) + ((*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xn)
 27675  	_sqlite3FinishTrigger(tls, _pParse, (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))), &_209_all)
 27676  	goto _281
 27677  _233:
 27678  	_sqlite3BeginTrigger(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967289)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967291)).Xminor))), (*t51)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).Xa, (*XIdList)((*t51)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))).Xb), (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor)))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967286)).Xminor))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967288)).Xminor))))
 27679  	*(*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967286)).Xminor))) = func() XToken {
 27680  		if ((*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor))).Xn) == (0) {
 27681  			return (*(*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967289)).Xminor))))
 27682  		}
 27683  		return (*(*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor))))
 27684  	}()
 27685  	goto _281
 27686  _234:
 27687  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))) = int32(34)
 27688  	goto _281
 27689  _235:
 27690  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))) = int32(30)
 27691  	goto _281
 27692  _236:
 27693  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))) = int32(48)
 27694  	goto _281
 27695  _237:
 27696  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(1)).Xminor))) = int32(34)
 27697  	goto _281
 27698  _238:
 27699  	(*t51)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xa = int32(elem49(_yymsp, 0).Xmajor)
 27700  	*(**XIdList)(unsafe.Pointer(&((*t51)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).Xb))) = nil
 27701  	goto _281
 27702  _240:
 27703  	(*t51)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).Xa = int32(110)
 27704  	*(**XIdList)(unsafe.Pointer(&((*t51)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))).Xb))) = (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27705  	goto _281
 27706  _241:
 27707  	*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(1)).Xminor))))) = nil
 27708  	goto _281
 27709  _243:
 27710  	*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr)
 27711  	goto _281
 27712  _245:
 27713  	func() {
 27714  		if (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor)))) == nil {
 27715  			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)))
 27716  			crt.X__builtin_abort(tls)
 27717  		}
 27718  	}()
 27719  	*(**XTriggerStep)(unsafe.Pointer(&((*XTriggerStep)((*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor)))).XpLast).XpNext))) = (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 27720  	*(**XTriggerStep)(unsafe.Pointer(&((*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor)))).XpLast))) = (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 27721  	goto _281
 27722  _246:
 27723  	func() {
 27724  		if (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))) == nil {
 27725  			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)))
 27726  			crt.X__builtin_abort(tls)
 27727  		}
 27728  	}()
 27729  	*(**XTriggerStep)(unsafe.Pointer(&((*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))).XpLast))) = (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 27730  	goto _281
 27731  _247:
 27732  	*(*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))) = *(*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))
 27733  	_sqlite3ErrorMsg(tls, _pParse, str(27348))
 27734  	goto _281
 27735  _248:
 27736  	_sqlite3ErrorMsg(tls, _pParse, str(27443))
 27737  	goto _281
 27738  _249:
 27739  	_sqlite3ErrorMsg(tls, _pParse, str(27527))
 27740  	goto _281
 27741  _250:
 27742  	*(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967290)).Xminor))))) = _sqlite3TriggerUpdateStep(tls, (*Xsqlite3)(_pParse.Xdb), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))), uint8(*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967291)).Xminor)))))
 27743  	goto _281
 27744  _251:
 27745  	*(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))))) = _sqlite3TriggerInsertStep(tls, (*Xsqlite3)(_pParse.Xdb), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))), uint8(*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor)))))
 27746  	goto _281
 27747  _252:
 27748  	*(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))))) = _sqlite3TriggerDeleteStep(tls, (*Xsqlite3)(_pParse.Xdb), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))))
 27749  	goto _281
 27750  _253:
 27751  	*(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))) = _sqlite3TriggerSelectStep(tls, (*Xsqlite3)(_pParse.Xdb), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))))
 27752  	goto _281
 27753  _254:
 27754  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27755  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))).XpExpr))) = _sqlite3PExpr(tls, _pParse, int32(56), nil, nil)
 27756  	if ((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))).XpExpr) != nil {
 27757  		(*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))).XpExpr).Xaffinity = int8(4)
 27758  	}
 27759  	goto _281
 27760  _255:
 27761  	_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967291)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967291)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27762  	*(**XExpr)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967291)).Xminor))).XpExpr))) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(56), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))), int32(1))
 27763  	if ((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967291)).Xminor))).XpExpr) != nil {
 27764  		(*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967291)).Xminor))).XpExpr).Xaffinity = int8(*(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))))
 27765  	}
 27766  	goto _281
 27767  _256:
 27768  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))) = int32(1)
 27769  	goto _281
 27770  _257:
 27771  	*(*int32)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))) = int32(3)
 27772  	goto _281
 27773  _258:
 27774  	_sqlite3DropTrigger(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 27775  	goto _281
 27776  _259:
 27777  	_sqlite3Attach(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))).XpExpr), (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))).XpExpr), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))))
 27778  	goto _281
 27779  _260:
 27780  	_sqlite3Detach(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))).XpExpr))
 27781  	goto _281
 27782  _261:
 27783  	_sqlite3Reindex(tls, _pParse, nil, nil)
 27784  	goto _281
 27785  _262:
 27786  	_sqlite3Reindex(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27787  	goto _281
 27788  _263:
 27789  	_sqlite3Analyze(tls, _pParse, nil, nil)
 27790  	goto _281
 27791  _264:
 27792  	_sqlite3Analyze(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27793  	goto _281
 27794  _265:
 27795  	_sqlite3AlterRenameTable(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27796  	goto _281
 27797  _266:
 27798  	(*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))).Xn = uint32(int32(uintptr(unsafe.Pointer(_pParse.XsLastToken.Xz))-uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))).Xz)))) + (_pParse.XsLastToken.Xn)
 27799  	_sqlite3AlterFinishAddColumn(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))
 27800  	goto _281
 27801  _267:
 27802  	_disableLookaside(tls, _pParse)
 27803  	_sqlite3AlterBeginAddColumn(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor)))))
 27804  	goto _281
 27805  _268:
 27806  	_sqlite3VtabFinishParse(tls, _pParse, nil)
 27807  	goto _281
 27808  _269:
 27809  	_sqlite3VtabFinishParse(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27810  	goto _281
 27811  _270:
 27812  	_sqlite3VtabBeginParse(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967293)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))), *(*int32)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor))))
 27813  	goto _281
 27814  _271:
 27815  	_sqlite3VtabArgInit(tls, _pParse)
 27816  	goto _281
 27817  _272:
 27818  	_sqlite3VtabArgExtend(tls, _pParse, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27819  	goto _281
 27820  _275:
 27821  	*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(1)).Xminor))))) = nil
 27822  	goto _281
 27823  _276:
 27824  	*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor))))) = (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27825  	goto _281
 27826  _277:
 27827  	*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967294)).Xminor))))) = (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, 0).Xminor))))
 27828  	goto _281
 27829  _278:
 27830  	*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967291)).Xminor))))) = _sqlite3WithAdd(tls, _pParse, nil, (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967291)).Xminor))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor)))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))))
 27831  	goto _281
 27832  _279:
 27833  	*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967289)).Xminor))))) = _sqlite3WithAdd(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967289)).Xminor)))), (*XToken)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967291)).Xminor))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967292)).Xminor)))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&(elem49(_yymsp, uintptr(4294967295)).Xminor)))))
 27834  	goto _281
 27835  _280:
 27836  	func() {
 27837  		if _yyruleno == uint32(277) {
 27838  			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)))
 27839  			crt.X__builtin_abort(tls)
 27840  		}
 27841  	}()
 27842  	func() {
 27843  		if _yyruleno == uint32(294) {
 27844  			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)))
 27845  			crt.X__builtin_abort(tls)
 27846  		}
 27847  	}()
 27848  	func() {
 27849  		if _yyruleno == uint32(295) {
 27850  			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)))
 27851  			crt.X__builtin_abort(tls)
 27852  		}
 27853  	}()
 27854  	func() {
 27855  		if _yyruleno == uint32(301) {
 27856  			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)))
 27857  			crt.X__builtin_abort(tls)
 27858  		}
 27859  	}()
 27860  	func() {
 27861  		if _yyruleno == uint32(303) {
 27862  			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)))
 27863  			crt.X__builtin_abort(tls)
 27864  		}
 27865  	}()
 27866  	func() {
 27867  		if _yyruleno == uint32(304) {
 27868  			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)))
 27869  			crt.X__builtin_abort(tls)
 27870  		}
 27871  	}()
 27872  	func() {
 27873  		if _yyruleno == uint32(305) {
 27874  			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)))
 27875  			crt.X__builtin_abort(tls)
 27876  		}
 27877  	}()
 27878  	func() {
 27879  		if _yyruleno == uint32(309) {
 27880  			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)))
 27881  			crt.X__builtin_abort(tls)
 27882  		}
 27883  	}()
 27884  	func() {
 27885  		if _yyruleno == uint32(312) {
 27886  			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)))
 27887  			crt.X__builtin_abort(tls)
 27888  		}
 27889  	}()
 27890  	func() {
 27891  		if _yyruleno == uint32(313) {
 27892  			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)))
 27893  			crt.X__builtin_abort(tls)
 27894  		}
 27895  	}()
 27896  	goto _281
 27897  _281:
 27898  	func() {
 27899  		if _yyruleno >= uint32(332) {
 27900  			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)))
 27901  			crt.X__builtin_abort(tls)
 27902  		}
 27903  	}()
 27904  	_yygoto = int32(elem52((*t53)(unsafe.Pointer(&_yyRuleInfo)), uintptr(_yyruleno)).Xlhs)
 27905  	_yysize = int32(elem52((*t53)(unsafe.Pointer(&_yyRuleInfo)), uintptr(_yyruleno)).Xnrhs)
 27906  	_yyact = _yy_find_reduce_action(tls, int32(elem49(_yymsp, uintptr(-_yysize)).Xstateno), uint8(_yygoto))
 27907  	if _yyact > int32(999) {
 27908  		goto _393
 27909  	}
 27910  	if _yyact > int32(455) {
 27911  		_yyact += int32(332)
 27912  	}
 27913  	*(*uintptr)(unsafe.Pointer(&_yymsp)) -= 16 * uintptr(_yysize-int32(1))
 27914  	*(**XyyStackEntry)(unsafe.Pointer(&_yypParser.Xyytos)) = _yymsp
 27915  	_yymsp.Xstateno = uint16(_yyact)
 27916  	_yymsp.Xmajor = uint8(_yygoto)
 27917  	_yyTraceShift(tls, _yypParser, _yyact)
 27918  	goto _395
 27919  _393:
 27920  	func() {
 27921  		if _yyact != int32(1333) {
 27922  			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)))
 27923  			crt.X__builtin_abort(tls)
 27924  		}
 27925  	}()
 27926  	*(*uintptr)(unsafe.Pointer(&_yypParser.Xyytos)) -= 16 * uintptr(_yysize)
 27927  	_yy_accept(tls, _yypParser)
 27928  _395:
 27929  }
 27930  
 27931  // C comment
 27932  //  /* The following table contains information about every rule that
 27933  //  ** is used during the reduce.
 27934  //  */
 27935  var _yyRuleInfo [332]t53
 27936  
 27937  func init() {
 27938  	_yyRuleInfo = [332]t53{t53{Xlhs: uint8(147), Xnrhs: uint8(1)}, t53{Xlhs: uint8(147), Xnrhs: uint8(3)}, t53{Xlhs: uint8(148), Xnrhs: uint8(1)}, t53{Xlhs: uint8(149), Xnrhs: uint8(3)}, t53{Xlhs: uint8(150)}, t53{Xlhs: uint8(150), Xnrhs: uint8(1)}, t53{Xlhs: uint8(150), Xnrhs: uint8(1)}, t53{Xlhs: uint8(150), Xnrhs: uint8(1)}, t53{Xlhs: uint8(149), Xnrhs: uint8(2)}, t53{Xlhs: uint8(149), Xnrhs: uint8(2)}, t53{Xlhs: uint8(149), Xnrhs: uint8(2)}, t53{Xlhs: uint8(149), Xnrhs: uint8(2)}, t53{Xlhs: uint8(149), Xnrhs: uint8(3)}, t53{Xlhs: uint8(149), Xnrhs: uint8(5)}, t53{Xlhs: uint8(154), Xnrhs: uint8(6)}, t53{Xlhs: uint8(156), Xnrhs: uint8(1)}, t53{Xlhs: uint8(158)}, t53{Xlhs: uint8(158), Xnrhs: uint8(3)}, t53{Xlhs: uint8(157), Xnrhs: uint8(1)}, t53{Xlhs: uint8(157)}, t53{Xlhs: uint8(155), Xnrhs: uint8(5)}, t53{Xlhs: uint8(155), Xnrhs: uint8(2)}, t53{Xlhs: uint8(162)}, t53{Xlhs: uint8(162), Xnrhs: uint8(2)}, t53{Xlhs: uint8(164), Xnrhs: uint8(2)}, t53{Xlhs: uint8(166)}, t53{Xlhs: uint8(166), Xnrhs: uint8(4)}, t53{Xlhs: uint8(166), Xnrhs: uint8(6)}, t53{Xlhs: uint8(167), Xnrhs: uint8(2)}, t53{Xlhs: uint8(171), Xnrhs: uint8(2)}, t53{Xlhs: uint8(171), Xnrhs: uint8(2)}, t53{Xlhs: uint8(171), Xnrhs: uint8(4)}, t53{Xlhs: uint8(171), Xnrhs: uint8(3)}, t53{Xlhs: uint8(171), Xnrhs: uint8(3)}, t53{Xlhs: uint8(171), Xnrhs: uint8(2)}, t53{Xlhs: uint8(171), Xnrhs: uint8(3)}, t53{Xlhs: uint8(171), Xnrhs: uint8(5)}, t53{Xlhs: uint8(171), Xnrhs: uint8(2)}, t53{Xlhs: uint8(171), Xnrhs: uint8(4)}, t53{Xlhs: uint8(171), Xnrhs: uint8(4)}, t53{Xlhs: uint8(171), Xnrhs: uint8(1)}, t53{Xlhs: uint8(171), Xnrhs: uint8(2)}, t53{Xlhs: uint8(176)}, t53{Xlhs: uint8(176), Xnrhs: uint8(1)}, t53{Xlhs: uint8(178)}, t53{Xlhs: uint8(178), Xnrhs: uint8(2)}, t53{Xlhs: uint8(180), Xnrhs: uint8(2)}, t53{Xlhs: uint8(180), Xnrhs: uint8(3)}, t53{Xlhs: uint8(180), Xnrhs: uint8(3)}, t53{Xlhs: uint8(180), Xnrhs: uint8(3)}, t53{Xlhs: uint8(181), Xnrhs: uint8(2)}, t53{Xlhs: uint8(181), Xnrhs: uint8(2)}, t53{Xlhs: uint8(181), Xnrhs: uint8(1)}, t53{Xlhs: uint8(181), Xnrhs: uint8(1)}, t53{Xlhs: uint8(181), Xnrhs: uint8(2)}, t53{Xlhs: uint8(179), Xnrhs: uint8(3)}, t53{Xlhs: uint8(179), Xnrhs: uint8(2)}, t53{Xlhs: uint8(182)}, t53{Xlhs: uint8(182), Xnrhs: uint8(2)}, t53{Xlhs: uint8(182), Xnrhs: uint8(2)}, t53{Xlhs: uint8(161)}, t53{Xlhs: uint8(184), Xnrhs: uint8(1)}, t53{Xlhs: uint8(185), Xnrhs: uint8(2)}, t53{Xlhs: uint8(185), Xnrhs: uint8(7)}, t53{Xlhs: uint8(185), Xnrhs: uint8(5)}, t53{Xlhs: uint8(185), Xnrhs: uint8(5)}, t53{Xlhs: uint8(185), Xnrhs: uint8(10)}, t53{Xlhs: uint8(188)}, t53{Xlhs: uint8(174)}, t53{Xlhs: uint8(174), Xnrhs: uint8(3)}, t53{Xlhs: uint8(189)}, t53{Xlhs: uint8(189), Xnrhs: uint8(2)}, t53{Xlhs: uint8(190), Xnrhs: uint8(1)}, t53{Xlhs: uint8(190), Xnrhs: uint8(1)}, t53{Xlhs: uint8(149), Xnrhs: uint8(4)}, t53{Xlhs: uint8(192), Xnrhs: uint8(2)}, t53{Xlhs: uint8(192)}, t53{Xlhs: uint8(149), Xnrhs: uint8(9)}, t53{Xlhs: uint8(149), Xnrhs: uint8(4)}, t53{Xlhs: uint8(149), Xnrhs: uint8(1)}, t53{Xlhs: uint8(163), Xnrhs: uint8(2)}, t53{Xlhs: uint8(194), Xnrhs: uint8(3)}, t53{Xlhs: uint8(197), Xnrhs: uint8(1)}, t53{Xlhs: uint8(197), Xnrhs: uint8(2)}, t53{Xlhs: uint8(197), Xnrhs: uint8(1)}, t53{Xlhs: uint8(195), Xnrhs: uint8(9)}, t53{Xlhs: uint8(206), Xnrhs: uint8(4)}, t53{Xlhs: uint8(206), Xnrhs: uint8(5)}, t53{Xlhs: uint8(198), Xnrhs: uint8(1)}, t53{Xlhs: uint8(198), Xnrhs: uint8(1)}, t53{Xlhs: uint8(198)}, t53{Xlhs: uint8(209)}, t53{Xlhs: uint8(199), Xnrhs: uint8(3)}, t53{Xlhs: uint8(199), Xnrhs: uint8(2)}, t53{Xlhs: uint8(199), Xnrhs: uint8(4)}, t53{Xlhs: uint8(210), Xnrhs: uint8(2)}, t53{Xlhs: uint8(210)}, t53{Xlhs: uint8(200)}, t53{Xlhs: uint8(200), Xnrhs: uint8(2)}, t53{Xlhs: uint8(212), Xnrhs: uint8(2)}, t53{Xlhs: uint8(212)}, t53{Xlhs: uint8(211), Xnrhs: uint8(7)}, t53{Xlhs: uint8(211), Xnrhs: uint8(9)}, t53{Xlhs: uint8(211), Xnrhs: uint8(7)}, t53{Xlhs: uint8(211), Xnrhs: uint8(7)}, t53{Xlhs: uint8(159)}, t53{Xlhs: uint8(159), Xnrhs: uint8(2)}, t53{Xlhs: uint8(193), Xnrhs: uint8(2)}, t53{Xlhs: uint8(213), Xnrhs: uint8(1)}, t53{Xlhs: uint8(213), Xnrhs: uint8(2)}, t53{Xlhs: uint8(213), Xnrhs: uint8(3)}, t53{Xlhs: uint8(213), Xnrhs: uint8(4)}, t53{Xlhs: uint8(215), Xnrhs: uint8(2)}, t53{Xlhs: uint8(215)}, t53{Xlhs: uint8(214)}, t53{Xlhs: uint8(214), Xnrhs: uint8(3)}, t53{Xlhs: uint8(214), Xnrhs: uint8(2)}, t53{Xlhs: uint8(216), Xnrhs: uint8(4)}, t53{Xlhs: uint8(216)}, t53{Xlhs: uint8(204)}, t53{Xlhs: uint8(204), Xnrhs: uint8(3)}, t53{Xlhs: uint8(186), Xnrhs: uint8(4)}, t53{Xlhs: uint8(186), Xnrhs: uint8(2)}, t53{Xlhs: uint8(175), Xnrhs: uint8(1)}, t53{Xlhs: uint8(175), Xnrhs: uint8(1)}, t53{Xlhs: uint8(175)}, t53{Xlhs: uint8(202)}, t53{Xlhs: uint8(202), Xnrhs: uint8(3)}, t53{Xlhs: uint8(203)}, t53{Xlhs: uint8(203), Xnrhs: uint8(2)}, t53{Xlhs: uint8(205)}, t53{Xlhs: uint8(205), Xnrhs: uint8(2)}, t53{Xlhs: uint8(205), Xnrhs: uint8(4)}, t53{Xlhs: uint8(205), Xnrhs: uint8(4)}, t53{Xlhs: uint8(149), Xnrhs: uint8(6)}, t53{Xlhs: uint8(201)}, t53{Xlhs: uint8(201), Xnrhs: uint8(2)}, t53{Xlhs: uint8(149), Xnrhs: uint8(8)}, t53{Xlhs: uint8(218), Xnrhs: uint8(5)}, t53{Xlhs: uint8(218), Xnrhs: uint8(7)}, t53{Xlhs: uint8(218), Xnrhs: uint8(3)}, t53{Xlhs: uint8(218), Xnrhs: uint8(5)}, t53{Xlhs: uint8(149), Xnrhs: uint8(6)}, t53{Xlhs: uint8(149), Xnrhs: uint8(7)}, t53{Xlhs: uint8(219), Xnrhs: uint8(2)}, t53{Xlhs: uint8(219), Xnrhs: uint8(1)}, t53{Xlhs: uint8(220)}, t53{Xlhs: uint8(220), Xnrhs: uint8(3)}, t53{Xlhs: uint8(217), Xnrhs: uint8(3)}, t53{Xlhs: uint8(217), Xnrhs: uint8(1)}, t53{Xlhs: uint8(173), Xnrhs: uint8(3)}, t53{Xlhs: uint8(172), Xnrhs: uint8(1)}, t53{Xlhs: uint8(173), Xnrhs: uint8(1)}, t53{Xlhs: uint8(173), Xnrhs: uint8(1)}, t53{Xlhs: uint8(173), Xnrhs: uint8(3)}, t53{Xlhs: uint8(173), Xnrhs: uint8(5)}, t53{Xlhs: uint8(172), Xnrhs: uint8(1)}, t53{Xlhs: uint8(172), Xnrhs: uint8(1)}, t53{Xlhs: uint8(172), Xnrhs: uint8(1)}, t53{Xlhs: uint8(173), Xnrhs: uint8(1)}, t53{Xlhs: uint8(173), Xnrhs: uint8(3)}, t53{Xlhs: uint8(173), Xnrhs: uint8(6)}, t53{Xlhs: uint8(173), Xnrhs: uint8(5)}, t53{Xlhs: uint8(173), Xnrhs: uint8(4)}, t53{Xlhs: uint8(172), Xnrhs: uint8(1)}, t53{Xlhs: uint8(173), Xnrhs: uint8(5)}, t53{Xlhs: uint8(173), Xnrhs: uint8(3)}, t53{Xlhs: uint8(173), Xnrhs: uint8(3)}, t53{Xlhs: uint8(173), Xnrhs: uint8(3)}, t53{Xlhs: uint8(173), Xnrhs: uint8(3)}, t53{Xlhs: uint8(173), Xnrhs: uint8(3)}, t53{Xlhs: uint8(173), Xnrhs: uint8(3)}, t53{Xlhs: uint8(173), Xnrhs: uint8(3)}, t53{Xlhs: uint8(173), Xnrhs: uint8(3)}, t53{Xlhs: uint8(221), Xnrhs: uint8(2)}, t53{Xlhs: uint8(173), Xnrhs: uint8(3)}, t53{Xlhs: uint8(173), Xnrhs: uint8(5)}, t53{Xlhs: uint8(173), Xnrhs: uint8(2)}, t53{Xlhs: uint8(173), Xnrhs: uint8(3)}, t53{Xlhs: uint8(173), Xnrhs: uint8(3)}, t53{Xlhs: uint8(173), Xnrhs: uint8(4)}, t53{Xlhs: uint8(173), Xnrhs: uint8(2)}, t53{Xlhs: uint8(173), Xnrhs: uint8(2)}, t53{Xlhs: uint8(173), Xnrhs: uint8(2)}, t53{Xlhs: uint8(173), Xnrhs: uint8(2)}, t53{Xlhs: uint8(222), Xnrhs: uint8(1)}, t53{Xlhs: uint8(222), Xnrhs: uint8(2)}, t53{Xlhs: uint8(173), Xnrhs: uint8(5)}, t53{Xlhs: uint8(223), Xnrhs: uint8(1)}, t53{Xlhs: uint8(223), Xnrhs: uint8(2)}, t53{Xlhs: uint8(173), Xnrhs: uint8(5)}, t53{Xlhs: uint8(173), Xnrhs: uint8(3)}, t53{Xlhs: uint8(173), Xnrhs: uint8(5)}, t53{Xlhs: uint8(173), Xnrhs: uint8(5)}, t53{Xlhs: uint8(173), Xnrhs: uint8(4)}, t53{Xlhs: uint8(173), Xnrhs: uint8(5)}, t53{Xlhs: uint8(226), Xnrhs: uint8(5)}, t53{Xlhs: uint8(226), Xnrhs: uint8(4)}, t53{Xlhs: uint8(227), Xnrhs: uint8(2)}, t53{Xlhs: uint8(227)}, t53{Xlhs: uint8(225), Xnrhs: uint8(1)}, t53{Xlhs: uint8(225)}, t53{Xlhs: uint8(208)}, t53{Xlhs: uint8(207), Xnrhs: uint8(3)}, t53{Xlhs: uint8(207), Xnrhs: uint8(1)}, t53{Xlhs: uint8(224)}, t53{Xlhs: uint8(224), Xnrhs: uint8(3)}, t53{Xlhs: uint8(149), Xnrhs: uint8(12)}, t53{Xlhs: uint8(228), Xnrhs: uint8(1)}, t53{Xlhs: uint8(228)}, t53{Xlhs: uint8(177)}, t53{Xlhs: uint8(177), Xnrhs: uint8(3)}, t53{Xlhs: uint8(187), Xnrhs: uint8(5)}, t53{Xlhs: uint8(187), Xnrhs: uint8(3)}, t53{Xlhs: uint8(229)}, t53{Xlhs: uint8(229), Xnrhs: uint8(2)}, t53{Xlhs: uint8(149), Xnrhs: uint8(4)}, t53{Xlhs: uint8(149), Xnrhs: uint8(1)}, t53{Xlhs: uint8(149), Xnrhs: uint8(2)}, t53{Xlhs: uint8(149), Xnrhs: uint8(3)}, t53{Xlhs: uint8(149), Xnrhs: uint8(5)}, t53{Xlhs: uint8(149), Xnrhs: uint8(6)}, t53{Xlhs: uint8(149), Xnrhs: uint8(5)}, t53{Xlhs: uint8(149), Xnrhs: uint8(6)}, t53{Xlhs: uint8(169), Xnrhs: uint8(2)}, t53{Xlhs: uint8(170), Xnrhs: uint8(2)}, t53{Xlhs: uint8(149), Xnrhs: uint8(5)}, t53{Xlhs: uint8(231), Xnrhs: uint8(11)}, t53{Xlhs: uint8(233), Xnrhs: uint8(1)}, t53{Xlhs: uint8(233), Xnrhs: uint8(1)}, t53{Xlhs: uint8(233), Xnrhs: uint8(2)}, t53{Xlhs: uint8(233)}, t53{Xlhs: uint8(234), Xnrhs: uint8(1)}, t53{Xlhs: uint8(234), Xnrhs: uint8(1)}, t53{Xlhs: uint8(234), Xnrhs: uint8(3)}, t53{Xlhs: uint8(236)}, t53{Xlhs: uint8(236), Xnrhs: uint8(2)}, t53{Xlhs: uint8(232), Xnrhs: uint8(3)}, t53{Xlhs: uint8(232), Xnrhs: uint8(2)}, t53{Xlhs: uint8(238), Xnrhs: uint8(3)}, t53{Xlhs: uint8(239), Xnrhs: uint8(3)}, t53{Xlhs: uint8(239), Xnrhs: uint8(2)}, t53{Xlhs: uint8(237), Xnrhs: uint8(7)}, t53{Xlhs: uint8(237), Xnrhs: uint8(5)}, t53{Xlhs: uint8(237), Xnrhs: uint8(5)}, t53{Xlhs: uint8(237), Xnrhs: uint8(1)}, t53{Xlhs: uint8(173), Xnrhs: uint8(4)}, t53{Xlhs: uint8(173), Xnrhs: uint8(6)}, t53{Xlhs: uint8(191), Xnrhs: uint8(1)}, t53{Xlhs: uint8(191), Xnrhs: uint8(1)}, t53{Xlhs: uint8(191), Xnrhs: uint8(1)}, t53{Xlhs: uint8(149), Xnrhs: uint8(4)}, t53{Xlhs: uint8(149), Xnrhs: uint8(6)}, t53{Xlhs: uint8(149), Xnrhs: uint8(3)}, t53{Xlhs: uint8(241)}, t53{Xlhs: uint8(241), Xnrhs: uint8(2)}, t53{Xlhs: uint8(149), Xnrhs: uint8(1)}, t53{Xlhs: uint8(149), Xnrhs: uint8(3)}, t53{Xlhs: uint8(149), Xnrhs: uint8(1)}, t53{Xlhs: uint8(149), Xnrhs: uint8(3)}, t53{Xlhs: uint8(149), Xnrhs: uint8(6)}, t53{Xlhs: uint8(149), Xnrhs: uint8(7)}, t53{Xlhs: uint8(242), Xnrhs: uint8(1)}, t53{Xlhs: uint8(149), Xnrhs: uint8(1)}, t53{Xlhs: uint8(149), Xnrhs: uint8(4)}, t53{Xlhs: uint8(244), Xnrhs: uint8(8)}, t53{Xlhs: uint8(246)}, t53{Xlhs: uint8(247), Xnrhs: uint8(1)}, t53{Xlhs: uint8(247), Xnrhs: uint8(3)}, t53{Xlhs: uint8(248), Xnrhs: uint8(1)}, t53{Xlhs: uint8(196)}, t53{Xlhs: uint8(196), Xnrhs: uint8(2)}, t53{Xlhs: uint8(196), Xnrhs: uint8(3)}, t53{Xlhs: uint8(250), Xnrhs: uint8(6)}, t53{Xlhs: uint8(250), Xnrhs: uint8(8)}, t53{Xlhs: uint8(144), Xnrhs: uint8(1)}, t53{Xlhs: uint8(145), Xnrhs: uint8(2)}, t53{Xlhs: uint8(145), Xnrhs: uint8(1)}, t53{Xlhs: uint8(146), Xnrhs: uint8(1)}, t53{Xlhs: uint8(146), Xnrhs: uint8(3)}, t53{Xlhs: uint8(147)}, t53{Xlhs: uint8(151)}, t53{Xlhs: uint8(151), Xnrhs: uint8(1)}, t53{Xlhs: uint8(151), Xnrhs: uint8(2)}, t53{Xlhs: uint8(153), Xnrhs: uint8(1)}, t53{Xlhs: uint8(153)}, t53{Xlhs: uint8(149), Xnrhs: uint8(2)}, t53{Xlhs: uint8(160), Xnrhs: uint8(4)}, t53{Xlhs: uint8(160), Xnrhs: uint8(2)}, t53{Xlhs: uint8(152), Xnrhs: uint8(1)}, t53{Xlhs: uint8(152), Xnrhs: uint8(1)}, t53{Xlhs: uint8(152), Xnrhs: uint8(1)}, t53{Xlhs: uint8(166), Xnrhs: uint8(1)}, t53{Xlhs: uint8(167), Xnrhs: uint8(1)}, t53{Xlhs: uint8(168), Xnrhs: uint8(1)}, t53{Xlhs: uint8(168), Xnrhs: uint8(1)}, t53{Xlhs: uint8(165), Xnrhs: uint8(2)}, t53{Xlhs: uint8(165)}, t53{Xlhs: uint8(171), Xnrhs: uint8(2)}, t53{Xlhs: uint8(161), Xnrhs: uint8(2)}, t53{Xlhs: uint8(183), Xnrhs: uint8(3)}, t53{Xlhs: uint8(183), Xnrhs: uint8(1)}, t53{Xlhs: uint8(184)}, t53{Xlhs: uint8(188), Xnrhs: uint8(1)}, t53{Xlhs: uint8(190), Xnrhs: uint8(1)}, t53{Xlhs: uint8(194), Xnrhs: uint8(1)}, t53{Xlhs: uint8(195), Xnrhs: uint8(1)}, t53{Xlhs: uint8(209), Xnrhs: uint8(2)}, t53{Xlhs: uint8(210), Xnrhs: uint8(1)}, t53{Xlhs: uint8(173), Xnrhs: uint8(1)}, t53{Xlhs: uint8(221), Xnrhs: uint8(1)}, t53{Xlhs: uint8(208), Xnrhs: uint8(1)}, t53{Xlhs: uint8(230), Xnrhs: uint8(1)}, t53{Xlhs: uint8(230), Xnrhs: uint8(1)}, t53{Xlhs: uint8(230), Xnrhs: uint8(1)}, t53{Xlhs: uint8(230), Xnrhs: uint8(1)}, t53{Xlhs: uint8(230), Xnrhs: uint8(1)}, t53{Xlhs: uint8(169), Xnrhs: uint8(1)}, t53{Xlhs: uint8(235)}, t53{Xlhs: uint8(235), Xnrhs: uint8(3)}, t53{Xlhs: uint8(238), Xnrhs: uint8(1)}, t53{Xlhs: uint8(239)}, t53{Xlhs: uint8(240), Xnrhs: uint8(1)}, t53{Xlhs: uint8(240)}, t53{Xlhs: uint8(243)}, t53{Xlhs: uint8(243), Xnrhs: uint8(1)}, t53{Xlhs: uint8(245), Xnrhs: uint8(1)}, t53{Xlhs: uint8(245), Xnrhs: uint8(3)}, t53{Xlhs: uint8(246), Xnrhs: uint8(2)}, t53{Xlhs: uint8(249)}, t53{Xlhs: uint8(249), Xnrhs: uint8(4)}, t53{Xlhs: uint8(249), Xnrhs: uint8(2)}}
 27939  }
 27940  
 27941  // C comment
 27942  //  /* For tracing reduce actions, the names of all rules are required.
 27943  //  */
 27944  var _yyRuleName [332]*int8
 27945  
 27946  func init() {
 27947  	_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)}
 27948  }
 27949  
 27950  // C comment
 27951  //  /*
 27952  //  ** This routine is called after a single SQL statement has been
 27953  //  ** parsed and a VDBE program to execute that statement has been
 27954  //  ** prepared.  This routine puts the finishing touches on the
 27955  //  ** VDBE program and resets the pParse structure for the next
 27956  //  ** parse.
 27957  //  **
 27958  //  ** Note that if an error occurred, it might be the case that
 27959  //  ** no VDBE code was generated.
 27960  //  */
 27961  func _sqlite3FinishCoding(tls *crt.TLS, _pParse *XParse) {
 27962  	var _3_iDb, _3_i int32
 27963  	var _5_vtab *int8
 27964  	var _db *Xsqlite3
 27965  	var _4_pSchema *XSchema
 27966  	var _v *TVdbe
 27967  	var _6_pEL *XExprList
 27968  	func() {
 27969  		if (*XParse)(_pParse.XpToplevel) != nil {
 27970  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99832), unsafe.Pointer(&_sqlite3FinishCodingØ00__func__Ø000), unsafe.Pointer(str(37307)))
 27971  			crt.X__builtin_abort(tls)
 27972  		}
 27973  	}()
 27974  	_db = (*Xsqlite3)(_pParse.Xdb)
 27975  	if _pParse.Xnested != 0 {
 27976  		return
 27977  	}
 27978  	if _db.XmallocFailed == 0 && _pParse.XnErr == 0 {
 27979  		goto _4
 27980  	}
 27981  	if _pParse.Xrc == int32(0) {
 27982  		_pParse.Xrc = int32(1)
 27983  	}
 27984  	return
 27985  _4:
 27986  	_v = _sqlite3GetVdbe(tls, _pParse)
 27987  	func() {
 27988  		if _pParse.XisMultiWrite != 0 && _sqlite3VdbeAssertMayAbort(tls, _v, int32(_pParse.XmayAbort)) == 0 {
 27989  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99844), unsafe.Pointer(&_sqlite3FinishCodingØ00__func__Ø000), unsafe.Pointer(str(37328)))
 27990  			crt.X__builtin_abort(tls)
 27991  		}
 27992  	}()
 27993  	if _v == nil {
 27994  		goto _9
 27995  	}
 27996  	_sqlite3VdbeAddOp0(tls, _v, int32(55))
 27997  	if int32(_db.XmallocFailed) != int32(0) || _pParse.XcookieMask == (0) && _pParse.XpConstExpr == nil {
 27998  		goto _12
 27999  	}
 28000  	func() {
 28001  		if int32(_sqlite3VdbeGetOp(tls, _v, int32(0)).Xopcode) != int32(51) {
 28002  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99870), unsafe.Pointer(&_sqlite3FinishCodingØ00__func__Ø000), unsafe.Pointer(str(37400)))
 28003  			crt.X__builtin_abort(tls)
 28004  		}
 28005  	}()
 28006  	_sqlite3VdbeJumpHere(tls, _v, int32(0))
 28007  	_3_iDb = int32(0)
 28008  _15:
 28009  	if _3_iDb >= _db.XnDb {
 28010  		goto _18
 28011  	}
 28012  	if bool2int((_pParse.XcookieMask&(uint32(1)<<uint(_3_iDb))) != (0)) == int32(0) {
 28013  		goto _16
 28014  	}
 28015  	_sqlite3VdbeUsesBtree(tls, _v, _3_iDb)
 28016  	_4_pSchema = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_3_iDb)).XpSchema)
 28017  	_sqlite3VdbeAddOp4Int(tls, _v, int32(2), _3_iDb, bool2int((_pParse.XwriteMask&(uint32(1)<<uint(_3_iDb))) != (0)), _4_pSchema.Xschema_cookie, _4_pSchema.XiGeneration)
 28018  	if int32(_db.Xinit.Xbusy) == int32(0) {
 28019  		_sqlite3VdbeChangeP5(tls, _v, uint16(1))
 28020  	}
 28021  	_sqlite3VdbeComment(tls, _v, str(37440), bool2int((_pParse.XmayAbort != 0) && (_pParse.XisMultiWrite != 0)))
 28022  _16:
 28023  	_3_iDb += 1
 28024  	goto _15
 28025  _18:
 28026  	_3_i = int32(0)
 28027  _22:
 28028  	if _3_i >= _pParse.XnVtabLock {
 28029  		goto _25
 28030  	}
 28031  	_5_vtab = (*int8)(unsafe.Pointer(_sqlite3GetVTable(tls, _db, *elem59((**XTable)(unsafe.Pointer(_pParse.XapVtabLock)), uintptr(_3_i)))))
 28032  	_sqlite3VdbeAddOp4(tls, _v, int32(155), int32(0), int32(0), int32(0), _5_vtab, int32(-8))
 28033  	_3_i += 1
 28034  	goto _22
 28035  _25:
 28036  	_pParse.XnVtabLock = int32(0)
 28037  	_codeTableLocks(tls, _pParse)
 28038  	_sqlite3AutoincrementBegin(tls, _pParse)
 28039  	if _pParse.XpConstExpr == nil {
 28040  		goto _26
 28041  	}
 28042  	_6_pEL = (*XExprList)(_pParse.XpConstExpr)
 28043  	_pParse.XokConstFactor = 0
 28044  	_3_i = int32(0)
 28045  _27:
 28046  	if _3_i >= _6_pEL.XnExpr {
 28047  		goto _30
 28048  	}
 28049  	_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_6_pEL.Xa)), uintptr(_3_i)).XpExpr), *(*int32)(unsafe.Pointer(&(elem57((*TExprList_item)(unsafe.Pointer(&_6_pEL.Xa)), uintptr(_3_i)).Xu))))
 28050  	_3_i += 1
 28051  	goto _27
 28052  _30:
 28053  _26:
 28054  	_sqlite3VdbeGoto(tls, _v, int32(1))
 28055  _12:
 28056  _9:
 28057  	if _v == nil || _pParse.XnErr != int32(0) || _db.XmallocFailed != 0 {
 28058  		goto _33
 28059  	}
 28060  	func() {
 28061  		if _pParse.XiCacheLevel != int32(0) {
 28062  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99924), unsafe.Pointer(&_sqlite3FinishCodingØ00__func__Ø000), unsafe.Pointer(str(37459)))
 28063  			crt.X__builtin_abort(tls)
 28064  		}
 28065  	}()
 28066  	if ((*XAutoincInfo)(_pParse.XpAinc) != nil) && (_pParse.XnTab == int32(0)) {
 28067  		_pParse.XnTab = int32(1)
 28068  	}
 28069  	_sqlite3VdbeMakeReady(tls, _v, _pParse)
 28070  	_pParse.Xrc = int32(101)
 28071  	goto _38
 28072  _33:
 28073  	_pParse.Xrc = int32(1)
 28074  _38:
 28075  }
 28076  
 28077  var _sqlite3FinishCodingØ00__func__Ø000 [20]int8
 28078  
 28079  func init() {
 28080  	crt.Xstrncpy(nil, &_sqlite3FinishCodingØ00__func__Ø000[0], str(37482), 20)
 28081  }
 28082  
 28083  func _sqlite3GetVdbe(tls *crt.TLS, _pParse *XParse) (r0 *TVdbe) {
 28084  	var _v *TVdbe
 28085  	_v = (*TVdbe)(_pParse.XpVdbe)
 28086  	return func() *TVdbe {
 28087  		if _v != nil {
 28088  			return _v
 28089  		}
 28090  		return _allocVdbe(tls, _pParse)
 28091  	}()
 28092  }
 28093  
 28094  // C comment
 28095  //  /*
 28096  //  ** Get a VDBE for the given parser context.  Create a new one if necessary.
 28097  //  ** If an error occurs, return NULL and leave a message in pParse.
 28098  //  */
 28099  func _allocVdbe(tls *crt.TLS, _pParse *XParse) (r0 *TVdbe) {
 28100  	var _v *TVdbe
 28101  	_v = store60((**TVdbe)(unsafe.Pointer(&_pParse.XpVdbe)), _sqlite3VdbeCreate(tls, _pParse))
 28102  	if _v != nil {
 28103  		_sqlite3VdbeAddOp2(tls, _v, int32(51), int32(0), int32(1))
 28104  	}
 28105  	if ((*XParse)(_pParse.XpToplevel) == nil) && ((int32((*Xsqlite3)(_pParse.Xdb).XdbOptFlags) & int32(8)) == int32(0)) {
 28106  		_pParse.XokConstFactor = uint8(1)
 28107  	}
 28108  	return _v
 28109  }
 28110  
 28111  // C comment
 28112  //  /*
 28113  //  ** Create a new virtual database engine.
 28114  //  */
 28115  func _sqlite3VdbeCreate(tls *crt.TLS, _pParse *XParse) (r0 *TVdbe) {
 28116  	var _db *Xsqlite3
 28117  	var _p *TVdbe
 28118  	_db = (*Xsqlite3)(_pParse.Xdb)
 28119  	_p = (*TVdbe)(_sqlite3DbMallocRawNN(tls, _db, uint64(204)))
 28120  	if _p == nil {
 28121  		return nil
 28122  	}
 28123  	crt.Xmemset(tls, unsafe.Pointer(&_p.XaOp), int32(0), uint32(120))
 28124  	*(**Xsqlite3)(unsafe.Pointer(&_p.Xdb)) = _db
 28125  	if _db.XpVdbe != nil {
 28126  		*(**TVdbe)(unsafe.Pointer(&((*TVdbe)(_db.XpVdbe).XpPrev))) = _p
 28127  	}
 28128  	*(**TVdbe)(unsafe.Pointer(&_p.XpNext)) = (*TVdbe)(_db.XpVdbe)
 28129  	*(**TVdbe)(unsafe.Pointer(&_p.XpPrev)) = nil
 28130  	*(**TVdbe)(unsafe.Pointer(&_db.XpVdbe)) = _p
 28131  	_p.Xmagic = uint32(381479589)
 28132  	*(**XParse)(unsafe.Pointer(&_p.XpParse)) = _pParse
 28133  	func() {
 28134  		if _pParse.XaLabel != nil {
 28135  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71456), unsafe.Pointer(&_sqlite3VdbeCreateØ00__func__Ø000), unsafe.Pointer(str(37502)))
 28136  			crt.X__builtin_abort(tls)
 28137  		}
 28138  	}()
 28139  	func() {
 28140  		if _pParse.XnLabel != int32(0) {
 28141  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71457), unsafe.Pointer(&_sqlite3VdbeCreateØ00__func__Ø000), unsafe.Pointer(str(37520)))
 28142  			crt.X__builtin_abort(tls)
 28143  		}
 28144  	}()
 28145  	func() {
 28146  		if _pParse.XnOpAlloc != int32(0) {
 28147  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71458), unsafe.Pointer(&_sqlite3VdbeCreateØ00__func__Ø000), unsafe.Pointer(str(37538)))
 28148  			crt.X__builtin_abort(tls)
 28149  		}
 28150  	}()
 28151  	func() {
 28152  		if _pParse.XszOpAlloc != int32(0) {
 28153  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71459), unsafe.Pointer(&_sqlite3VdbeCreateØ00__func__Ø000), unsafe.Pointer(str(37558)))
 28154  			crt.X__builtin_abort(tls)
 28155  		}
 28156  	}()
 28157  	return _p
 28158  }
 28159  
 28160  var _sqlite3VdbeCreateØ00__func__Ø000 [18]int8
 28161  
 28162  func init() {
 28163  	crt.Xstrncpy(nil, &_sqlite3VdbeCreateØ00__func__Ø000[0], str(37579), 18)
 28164  }
 28165  
 28166  func _sqlite3VdbeAddOp2(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32) (r0 int32) {
 28167  	return _sqlite3VdbeAddOp3(tls, _p, _op, _p1, _p2, int32(0))
 28168  }
 28169  
 28170  func _sqlite3VdbeAddOp3(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32, _p3 int32) (r0 int32) {
 28171  	var _i, _2_jj, _2_kk int32
 28172  	var _2_pParse *XParse
 28173  	var _pOp *XVdbeOp
 28174  	var _3_x *TyColCache
 28175  	_i = _p.XnOp
 28176  	func() {
 28177  		if _p.Xmagic != uint32(381479589) {
 28178  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71595), unsafe.Pointer(&_sqlite3VdbeAddOp3Ø00__func__Ø000), unsafe.Pointer(str(37597)))
 28179  			crt.X__builtin_abort(tls)
 28180  		}
 28181  	}()
 28182  	func() {
 28183  		if _op < int32(0) || _op >= int32(255) {
 28184  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71596), unsafe.Pointer(&_sqlite3VdbeAddOp3Ø00__func__Ø000), unsafe.Pointer(str(37623)))
 28185  			crt.X__builtin_abort(tls)
 28186  		}
 28187  	}()
 28188  	if ((*XParse)(_p.XpParse).XnOpAlloc) <= _i {
 28189  		return _growOp3(tls, _p, _op, _p1, _p2, _p3)
 28190  	}
 28191  	_p.XnOp += 1
 28192  	_pOp = elem61((*XVdbeOp)(_p.XaOp), uintptr(_i))
 28193  	_pOp.Xopcode = uint8(_op)
 28194  	_pOp.Xp5 = 0
 28195  	_pOp.Xp1 = _p1
 28196  	_pOp.Xp2 = _p2
 28197  	_pOp.Xp3 = _p3
 28198  	*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)) = nil
 28199  	_pOp.Xp4type = 0
 28200  	_pOp.XzComment = nil
 28201  	if (((*Xsqlite3)(_p.Xdb).Xflags) & int32(4096)) == 0 {
 28202  		goto _6
 28203  	}
 28204  	_2_pParse = (*XParse)(_p.XpParse)
 28205  	_2_jj = store2(&_2_kk, int32(0))
 28206  _7:
 28207  	if _2_jj >= int32(_2_pParse.XnColCache) {
 28208  		goto _10
 28209  	}
 28210  	_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)))))))))))
 28211  	crt.Xprintf(tls, str(37640), _3_x.XiReg, _3_x.XiTable, int32(_3_x.XiColumn))
 28212  	_2_kk += 1
 28213  	_2_jj += 1
 28214  	goto _7
 28215  _10:
 28216  	if _2_kk != 0 {
 28217  		crt.Xprintf(tls, str(37655))
 28218  	}
 28219  	_sqlite3VdbePrintOp(tls, nil, _i, elem61((*XVdbeOp)(_p.XaOp), uintptr(_i)))
 28220  	_test_addop_breakpoint(tls)
 28221  _6:
 28222  	return _i
 28223  }
 28224  
 28225  var _sqlite3VdbeAddOp3Ø00__func__Ø000 [18]int8
 28226  
 28227  func init() {
 28228  	crt.Xstrncpy(nil, &_sqlite3VdbeAddOp3Ø00__func__Ø000[0], str(37657), 18)
 28229  }
 28230  
 28231  // C comment
 28232  //  /*
 28233  //  ** Add a new instruction to the list of instructions current in the
 28234  //  ** VDBE.  Return the address of the new instruction.
 28235  //  **
 28236  //  ** Parameters:
 28237  //  **
 28238  //  **    p               Pointer to the VDBE
 28239  //  **
 28240  //  **    op              The opcode for this instruction
 28241  //  **
 28242  //  **    p1, p2, p3      Operands
 28243  //  **
 28244  //  ** Use the sqlite3VdbeResolveLabel() function to fix an address and
 28245  //  ** the sqlite3VdbeChangeP4() function to change the value of the P4
 28246  //  ** operand.
 28247  //  */
 28248  func _growOp3(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32, _p3 int32) (r0 int32) {
 28249  	func() {
 28250  		if ((*XParse)(_p.XpParse).XnOpAlloc) > _p.XnOp {
 28251  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71585), unsafe.Pointer(&_growOp3Ø00__func__Ø000), unsafe.Pointer(str(37675)))
 28252  			crt.X__builtin_abort(tls)
 28253  		}
 28254  	}()
 28255  	if _growOpArray(tls, _p, int32(1)) != 0 {
 28256  		return int32(1)
 28257  	}
 28258  	func() {
 28259  		if ((*XParse)(_p.XpParse).XnOpAlloc) <= _p.XnOp {
 28260  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71587), unsafe.Pointer(&_growOp3Ø00__func__Ø000), unsafe.Pointer(str(37703)))
 28261  			crt.X__builtin_abort(tls)
 28262  		}
 28263  	}()
 28264  	return _sqlite3VdbeAddOp3(tls, _p, _op, _p1, _p2, _p3)
 28265  }
 28266  
 28267  var _growOp3Ø00__func__Ø000 [8]int8
 28268  
 28269  func init() {
 28270  	crt.Xstrncpy(nil, &_growOp3Ø00__func__Ø000[0], str(37730), 8)
 28271  }
 28272  
 28273  // C comment
 28274  //  /*
 28275  //  ** Resize the Vdbe.aOp array so that it is at least nOp elements larger
 28276  //  ** than its current size. nOp is guaranteed to be less than or equal
 28277  //  ** to 1024/sizeof(Op).
 28278  //  **
 28279  //  ** If an out-of-memory error occurs while resizing the array, return
 28280  //  ** SQLITE_NOMEM. In this case Vdbe.aOp and Parse.nOpAlloc remain
 28281  //  ** unchanged (this is so that any opcodes already allocated can be
 28282  //  ** correctly deallocated along with the rest of the Vdbe).
 28283  //  */
 28284  func _growOpArray(tls *crt.TLS, _v *TVdbe, _nOp int32) (r0 int32) {
 28285  	var _nNew int32
 28286  	var _p *XParse
 28287  	var _pNew *XVdbeOp
 28288  	_p = (*XParse)(_v.XpParse)
 28289  	_nNew = func() int32 {
 28290  		if _p.XnOpAlloc != 0 {
 28291  			return (_p.XnOpAlloc * int32(2))
 28292  		}
 28293  		return int32(42)
 28294  	}()
 28295  
 28296  	if _nNew > (*elem8((*int32)(unsafe.Pointer(&((*Xsqlite3)(_p.Xdb).XaLimit))), uintptr(5))) {
 28297  		_sqlite3OomFault(tls, (*Xsqlite3)(_p.Xdb))
 28298  		return int32(7)
 28299  	}
 28300  	func() {
 28301  		if uint32(_nOp) > uint32(42) {
 28302  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71546), unsafe.Pointer(&_growOpArrayØ00__func__Ø000), unsafe.Pointer(str(37738)))
 28303  			crt.X__builtin_abort(tls)
 28304  		}
 28305  	}()
 28306  	func() {
 28307  		if _nNew < (_p.XnOpAlloc + _nOp) {
 28308  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71547), unsafe.Pointer(&_growOpArrayØ00__func__Ø000), unsafe.Pointer(str(37761)))
 28309  			crt.X__builtin_abort(tls)
 28310  		}
 28311  	}()
 28312  	_pNew = (*XVdbeOp)(_sqlite3DbRealloc(tls, (*Xsqlite3)(_p.Xdb), _v.XaOp, uint64(uint32(_nNew)*uint32(24))))
 28313  	if _pNew != nil {
 28314  		_p.XszOpAlloc = _sqlite3DbMallocSize(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(_pNew))
 28315  		_p.XnOpAlloc = int32(uint32(_p.XszOpAlloc) / uint32(24))
 28316  		*(**XVdbeOp)(unsafe.Pointer(&_v.XaOp)) = _pNew
 28317  	}
 28318  	return func() int32 {
 28319  		if _pNew != nil {
 28320  			return int32(0)
 28321  		}
 28322  		return _sqlite3NomemError(tls, int32(71554))
 28323  	}()
 28324  }
 28325  
 28326  var _growOpArrayØ00__func__Ø000 [12]int8
 28327  
 28328  func init() {
 28329  	crt.Xstrncpy(nil, &_growOpArrayØ00__func__Ø000[0], str(37785), 12)
 28330  }
 28331  
 28332  // C comment
 28333  //  /*
 28334  //  ** Print a single opcode.  This routine is used for debugging only.
 28335  //  */
 28336  func _sqlite3VdbePrintOp(tls *crt.TLS, _pOut *crt.XFILE, _pc int32, _pOp *XVdbeOp) {
 28337  	var _zP4 *int8
 28338  	var _zCom [100]int8
 28339  	var _zPtr [50]int8
 28340  	if _pOut == nil {
 28341  		_pOut = (*crt.XFILE)(Xstdout)
 28342  	}
 28343  	_zP4 = _displayP4(tls, _pOp, (*int8)(unsafe.Pointer(&_zPtr)), int32(50))
 28344  	_displayComment(tls, _pOp, _zP4, (*int8)(unsafe.Pointer(&_zCom)), int32(100))
 28345  	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))
 28346  	crt.Xfflush(tls, _pOut)
 28347  	_ = _zPtr
 28348  	_ = _zCom
 28349  }
 28350  
 28351  // C comment
 28352  //  /*
 28353  //  ** Compute a string that describes the P4 parameter for an opcode.
 28354  //  ** Use zTemp for any required temporary buffer space.
 28355  //  */
 28356  func _displayP4(tls *crt.TLS, _pOp *XVdbeOp, _zTemp *int8, _nTemp int32) (r0 *int8) {
 28357  	var _2_j, _17_i, _17_n int32
 28358  	var _17_ai *int32
 28359  	var _zP4, _3_zColl *int8
 28360  	var _10_pMem *XMem
 28361  	var _5_pDef, _6_pDef *XFuncDef
 28362  	var _x XStrAccum
 28363  	var _2_pKeyInfo *XKeyInfo
 28364  	var _3_pColl, _4_pColl *XCollSeq
 28365  	var _16_pVtab *Xsqlite3_vtab
 28366  	_zP4 = _zTemp
 28367  	func() {
 28368  		if _nTemp < int32(20) {
 28369  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72711), unsafe.Pointer(&_displayP4Ø00__func__Ø000), unsafe.Pointer(str(37797)))
 28370  			crt.X__builtin_abort(tls)
 28371  		}
 28372  	}()
 28373  	_sqlite3StrAccumInit(tls, &_x, nil, _zTemp, _nTemp, int32(0))
 28374  	switch int32(_pOp.Xp4type) {
 28375  	case int32(-16):
 28376  		goto _6
 28377  	case int32(-15):
 28378  		goto _15
 28379  	case int32(-14):
 28380  		goto _14
 28381  	case int32(-13):
 28382  		goto _13
 28383  	case int32(-12):
 28384  		goto _12
 28385  	case int32(-11):
 28386  		goto _8
 28387  	case int32(-10):
 28388  		goto _7
 28389  	case int32(-9):
 28390  		goto _9
 28391  	case int32(-8):
 28392  		goto _11
 28393  	case int32(-7):
 28394  		goto _10
 28395  	case int32(-5):
 28396  		goto _3
 28397  	case int32(-4):
 28398  		goto _5
 28399  	case int32(-3):
 28400  		goto _4
 28401  	default:
 28402  		goto _16
 28403  	}
 28404  
 28405  _3:
 28406  	_2_pKeyInfo = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 28407  	func() {
 28408  		if _2_pKeyInfo.XaSortOrder == nil {
 28409  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72717), unsafe.Pointer(&_displayP4Ø00__func__Ø000), unsafe.Pointer(str(37807)))
 28410  			crt.X__builtin_abort(tls)
 28411  		}
 28412  	}()
 28413  	_sqlite3XPrintf(tls, &_x, str(37831), int32(_2_pKeyInfo.XnField))
 28414  	_2_j = int32(0)
 28415  _19:
 28416  	if _2_j >= int32(_2_pKeyInfo.XnField) {
 28417  		goto _22
 28418  	}
 28419  	_3_pColl = *elem62((**XCollSeq)(unsafe.Pointer(&_2_pKeyInfo.XaColl)), uintptr(_2_j))
 28420  	_3_zColl = func() *int8 {
 28421  		if _3_pColl != nil {
 28422  			return _3_pColl.XzName
 28423  		}
 28424  		return str(284)
 28425  	}()
 28426  	if crt.Xstrcmp(tls, _3_zColl, str(37836)) == int32(0) {
 28427  		_3_zColl = str(37843)
 28428  	}
 28429  	_sqlite3XPrintf(tls, &_x, str(37845), unsafe.Pointer(func() *int8 {
 28430  		if (*elem15(_2_pKeyInfo.XaSortOrder, uintptr(_2_j))) != 0 {
 28431  			return str(37851)
 28432  		}
 28433  		return str(284)
 28434  	}()), unsafe.Pointer(_3_zColl))
 28435  	_2_j += 1
 28436  	goto _19
 28437  _22:
 28438  	_sqlite3StrAccumAppend(tls, &_x, str(37853), int32(1))
 28439  	goto _28
 28440  _4:
 28441  	_4_pColl = (*XCollSeq)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 28442  	_sqlite3XPrintf(tls, &_x, str(37855), unsafe.Pointer(_4_pColl.XzName))
 28443  	goto _28
 28444  _5:
 28445  	_5_pDef = (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 28446  	_sqlite3XPrintf(tls, &_x, str(37863), unsafe.Pointer(_5_pDef.XzName), int32(_5_pDef.XnArg))
 28447  	goto _28
 28448  _6:
 28449  	_6_pDef = (*XFuncDef)((*Xsqlite3_context)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))).XpFunc)
 28450  	_sqlite3XPrintf(tls, &_x, str(37863), unsafe.Pointer(_6_pDef.XzName), int32(_6_pDef.XnArg))
 28451  	goto _28
 28452  _7:
 28453  	_sqlite3XPrintf(tls, &_x, str(6249), *(*(**int64)(unsafe.Pointer(&_pOp.Xp4))))
 28454  	goto _28
 28455  _8:
 28456  	_sqlite3XPrintf(tls, &_x, str(37870), *(*int32)(unsafe.Pointer(&_pOp.Xp4)))
 28457  	goto _28
 28458  _9:
 28459  	_sqlite3XPrintf(tls, &_x, str(7453), *(*(**float64)(unsafe.Pointer(&_pOp.Xp4))))
 28460  	goto _28
 28461  _10:
 28462  	_10_pMem = (*XMem)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 28463  	if (int32(_10_pMem.Xflags) & int32(2)) != 0 {
 28464  		_zP4 = _10_pMem.Xz
 28465  		goto _36
 28466  	}
 28467  	if (int32(_10_pMem.Xflags) & int32(4)) != 0 {
 28468  		_sqlite3XPrintf(tls, &_x, str(6249), *(*int64)(unsafe.Pointer(&_10_pMem.Xu)))
 28469  		goto _36
 28470  	}
 28471  	if (int32(_10_pMem.Xflags) & int32(8)) != 0 {
 28472  		_sqlite3XPrintf(tls, &_x, str(7453), *(*float64)(unsafe.Pointer(&_10_pMem.Xu)))
 28473  		goto _36
 28474  	}
 28475  	if (int32(_10_pMem.Xflags) & int32(1)) != 0 {
 28476  		_zP4 = str(285)
 28477  		goto _36
 28478  	}
 28479  	func() {
 28480  		if (int32(_10_pMem.Xflags) & int32(16)) == 0 {
 28481  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72774), unsafe.Pointer(&_displayP4Ø00__func__Ø000), unsafe.Pointer(str(37873)))
 28482  			crt.X__builtin_abort(tls)
 28483  		}
 28484  	}()
 28485  	_zP4 = str(37896)
 28486  _36:
 28487  	goto _28
 28488  _11:
 28489  	_16_pVtab = (*Xsqlite3_vtab)((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))).XpVtab)
 28490  	_sqlite3XPrintf(tls, &_x, str(37903), unsafe.Pointer(_16_pVtab))
 28491  	goto _28
 28492  _12:
 28493  	_17_ai = *(**int32)(unsafe.Pointer(&_pOp.Xp4))
 28494  	_17_n = *elem8(_17_ai, 0)
 28495  	_17_i = int32(1)
 28496  _39:
 28497  	if _17_i >= _17_n {
 28498  		goto _42
 28499  	}
 28500  	_sqlite3XPrintf(tls, &_x, str(37911), *elem8(_17_ai, uintptr(_17_i)))
 28501  	_17_i += 1
 28502  	goto _39
 28503  _42:
 28504  	*elem1(_zTemp, 0) = int8(91)
 28505  	_sqlite3StrAccumAppend(tls, &_x, str(37915), int32(1))
 28506  	goto _28
 28507  _13:
 28508  	_sqlite3XPrintf(tls, &_x, str(37917))
 28509  	goto _28
 28510  _14:
 28511  	*elem1(_zTemp, 0) = 0
 28512  	goto _28
 28513  _15:
 28514  	_sqlite3XPrintf(tls, &_x, str(24531), unsafe.Pointer((*XTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))).XzName))
 28515  	goto _28
 28516  _16:
 28517  	_zP4 = *(**int8)(unsafe.Pointer(&_pOp.Xp4))
 28518  	if _zP4 == nil {
 28519  		_zP4 = _zTemp
 28520  		*elem1(_zTemp, 0) = 0
 28521  	}
 28522  _28:
 28523  	_sqlite3StrAccumFinish(tls, &_x)
 28524  	func() {
 28525  		if _zP4 == nil {
 28526  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72819), unsafe.Pointer(&_displayP4Ø00__func__Ø000), unsafe.Pointer(str(37925)))
 28527  			crt.X__builtin_abort(tls)
 28528  		}
 28529  	}()
 28530  	return _zP4
 28531  }
 28532  
 28533  var _displayP4Ø00__func__Ø000 [10]int8
 28534  
 28535  func init() {
 28536  	crt.Xstrncpy(nil, &_displayP4Ø00__func__Ø000[0], str(37932), 10)
 28537  }
 28538  
 28539  // C comment
 28540  //  /*
 28541  //  ** variable-argument wrapper around sqlite3VXPrintf().  The bFlags argument
 28542  //  ** can contain the bit SQLITE_PRINTF_INTERNAL enable internal formats.
 28543  //  */
 28544  func _sqlite3XPrintf(tls *crt.TLS, _p *XStrAccum, _zFormat *int8, args ...interface{}) {
 28545  	var _ap []interface{}
 28546  	_ap = args
 28547  	_sqlite3VXPrintf(tls, _p, _zFormat, _ap)
 28548  	_ap = nil
 28549  }
 28550  
 28551  // C comment
 28552  //  /*
 28553  //  ** Compute a string for the "comment" field of a VDBE opcode listing.
 28554  //  **
 28555  //  ** The Synopsis: field in comments in the vdbe.c source file gets converted
 28556  //  ** to an extra string that is appended to the sqlite3OpcodeName().  In the
 28557  //  ** absence of other comments, this synopsis becomes the comment on the opcode.
 28558  //  ** Some translation occurs:
 28559  //  **
 28560  //  **       "PX"      ->  "r[X]"
 28561  //  **       "PX@PY"   ->  "r[X..X+Y-1]"  or "r[x]" if y is 0 or 1
 28562  //  **       "PX@PY+1" ->  "r[X..X+Y]"    or "r[x]" if y is 0
 28563  //  **       "PY..PY"  ->  "r[X..Y]"      or "r[x]" if y<=x
 28564  //  */
 28565  func _displayComment(tls *crt.TLS, _pOp *XVdbeOp, _zP4 *int8, _zTemp *int8, _nTemp int32) (r0 int32) {
 28566  	var _nOpName, _ii, _jj, _1_seenCom, _9_v1, _9_v2 int32
 28567  	var _1_c int8
 28568  	var _zOpName, _zSynopsis *int8
 28569  	var _zAlt [50]int8
 28570  	_zOpName = _sqlite3OpcodeName(tls, int32(_pOp.Xopcode))
 28571  	_nOpName = _sqlite3Strlen30(tls, _zOpName)
 28572  	if (*elem1(_zOpName, uintptr(_nOpName+int32(1)))) == 0 {
 28573  		goto _0
 28574  	}
 28575  	_1_seenCom = int32(0)
 28576  	_zSynopsis = store1(func() (**int8, *int8) { p := &_zOpName; return p, elem1(*p, uintptr(_nOpName+int32(1))) }())
 28577  	if crt.Xstrncmp(tls, _zSynopsis, str(37942), uint32(3)) != int32(0) {
 28578  		goto _1
 28579  	}
 28580  	if (int32(_pOp.Xp5) & int32(32)) != 0 {
 28581  		Xsqlite3_snprintf(tls, int32(50), (*int8)(unsafe.Pointer(&_zAlt)), str(37946), unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSynopsis))+uintptr(int32(3))))))
 28582  		goto _3
 28583  	}
 28584  	Xsqlite3_snprintf(tls, int32(50), (*int8)(unsafe.Pointer(&_zAlt)), str(37959), unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSynopsis))+uintptr(int32(3))))))
 28585  _3:
 28586  	_zSynopsis = (*int8)(unsafe.Pointer(&_zAlt))
 28587  _1:
 28588  	_ii = store2(&_jj, int32(0))
 28589  _4:
 28590  	if _jj >= (_nTemp-int32(1)) || int32(store5(&_1_c, *elem1(_zSynopsis, uintptr(_ii)))) == int32(0) {
 28591  		goto _8
 28592  	}
 28593  	if int32(_1_c) != int32(80) {
 28594  		goto _9
 28595  	}
 28596  	_1_c = *elem1(_zSynopsis, uintptr(preInc2(&_ii, 1)))
 28597  	if int32(_1_c) == int32(52) {
 28598  		Xsqlite3_snprintf(tls, _nTemp-_jj, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(_jj))), str(24531), unsafe.Pointer(_zP4))
 28599  		goto _13
 28600  	}
 28601  	if int32(_1_c) == int32(88) {
 28602  		Xsqlite3_snprintf(tls, _nTemp-_jj, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(_jj))), str(24531), unsafe.Pointer(_pOp.XzComment))
 28603  		_1_seenCom = int32(1)
 28604  		goto _13
 28605  	}
 28606  	_9_v1 = _translateP(tls, _1_c, _pOp)
 28607  	Xsqlite3_snprintf(tls, _nTemp-_jj, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(_jj))), str(37870), _9_v1)
 28608  	if crt.Xstrncmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSynopsis))+uintptr(_ii)))))+uintptr(int32(1)))), str(37973), uint32(2)) != int32(0) {
 28609  		goto _14
 28610  	}
 28611  	_ii += int32(3)
 28612  	_jj += _sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(_jj))))
 28613  	_9_v2 = _translateP(tls, *elem1(_zSynopsis, uintptr(_ii)), _pOp)
 28614  	if crt.Xstrncmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSynopsis))+uintptr(_ii)))))+uintptr(int32(1)))), str(37976), uint32(2)) == int32(0) {
 28615  		_ii += int32(2)
 28616  		_9_v2 += 1
 28617  	}
 28618  	if _9_v2 > int32(1) {
 28619  		Xsqlite3_snprintf(tls, _nTemp-_jj, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(_jj))), str(37979), (_9_v1+_9_v2)-int32(1))
 28620  	}
 28621  	goto _19
 28622  _14:
 28623  	if (crt.Xstrncmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSynopsis))+uintptr(_ii)))))+uintptr(int32(1)))), str(37984), uint32(4)) == int32(0)) && (_pOp.Xp3 == int32(0)) {
 28624  		_ii += int32(4)
 28625  	}
 28626  _19:
 28627  _13:
 28628  	_jj += _sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(_jj))))
 28629  	goto _20
 28630  _9:
 28631  	*elem1(_zTemp, uintptr(postInc2(&_jj, 1))) = _1_c
 28632  _20:
 28633  	_ii += 1
 28634  	goto _4
 28635  _8:
 28636  	if ((_1_seenCom == 0) && (_jj < (_nTemp - int32(5)))) && (_pOp.XzComment != nil) {
 28637  		Xsqlite3_snprintf(tls, _nTemp-_jj, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(_jj))), str(37989), unsafe.Pointer(_pOp.XzComment))
 28638  		_jj += _sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(_jj))))
 28639  	}
 28640  	if _jj < _nTemp {
 28641  		*elem1(_zTemp, uintptr(_jj)) = 0
 28642  	}
 28643  	goto _27
 28644  _0:
 28645  	if _pOp.XzComment != nil {
 28646  		Xsqlite3_snprintf(tls, _nTemp, _zTemp, str(24531), unsafe.Pointer(_pOp.XzComment))
 28647  		_jj = _sqlite3Strlen30(tls, _zTemp)
 28648  		goto _27
 28649  	}
 28650  	*elem1(_zTemp, 0) = 0
 28651  	_jj = int32(0)
 28652  _27:
 28653  	return _jj
 28654  
 28655  	_ = _zAlt
 28656  	panic(0)
 28657  }
 28658  
 28659  func _sqlite3OpcodeName(tls *crt.TLS, _i int32) (r0 *int8) {
 28660  	return *elem0((**int8)(unsafe.Pointer(&_sqlite3OpcodeNameØ00azNameØ001)), uintptr(_i))
 28661  }
 28662  
 28663  var _sqlite3OpcodeNameØ00azNameØ001 [166]*int8
 28664  
 28665  func init() {
 28666  	_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)}
 28667  }
 28668  
 28669  // C comment
 28670  //  /*
 28671  //  ** Return an integer value for one of the parameters to the opcode pOp
 28672  //  ** determined by character c.
 28673  //  */
 28674  func _translateP(tls *crt.TLS, _c int8, _pOp *XVdbeOp) (r0 int32) {
 28675  	if int32(_c) == int32(49) {
 28676  		return _pOp.Xp1
 28677  	}
 28678  	if int32(_c) == int32(50) {
 28679  		return _pOp.Xp2
 28680  	}
 28681  	if int32(_c) == int32(51) {
 28682  		return _pOp.Xp3
 28683  	}
 28684  	if int32(_c) == int32(52) {
 28685  		return *(*int32)(unsafe.Pointer(&_pOp.Xp4))
 28686  	}
 28687  	return int32(_pOp.Xp5)
 28688  }
 28689  
 28690  var _sqlite3VdbePrintOpØ00zFormat1Ø001 *int8
 28691  
 28692  func init() {
 28693  	_sqlite3VdbePrintOpØ00zFormat1Ø001 = str(41239)
 28694  }
 28695  
 28696  // C comment
 28697  //  /* This routine is just a convenient place to set a breakpoint that will
 28698  //  ** fire after each opcode is inserted and displayed using
 28699  //  ** "PRAGMA vdbe_addoptrace=on".
 28700  //  */
 28701  func _test_addop_breakpoint(tls *crt.TLS) {
 28702  	_test_addop_breakpointØ00nØ001 += 1
 28703  }
 28704  
 28705  var _test_addop_breakpointØ00nØ001 int32
 28706  
 28707  // C comment
 28708  //  /*
 28709  //  ** Check if the program stored in the VM associated with pParse may
 28710  //  ** throw an ABORT exception (causing the statement, but not entire transaction
 28711  //  ** to be rolled back). This condition is true if the main program or any
 28712  //  ** sub-programs contains any of the following:
 28713  //  **
 28714  //  **   *  OP_Halt with P1=SQLITE_CONSTRAINT and P2=OE_Abort.
 28715  //  **   *  OP_HaltIfNull with P1=SQLITE_CONSTRAINT and P2=OE_Abort.
 28716  //  **   *  OP_Destroy
 28717  //  **   *  OP_VUpdate
 28718  //  **   *  OP_VRename
 28719  //  **   *  OP_FkCounter with P2==0 (immediate foreign key constraint)
 28720  //  **   *  OP_CreateTable and OP_InitCoroutine (for CREATE TABLE AS SELECT ...)
 28721  //  **
 28722  //  ** Then check that the value of Parse.mayAbort is true if an
 28723  //  ** ABORT may be thrown, or false otherwise. Return true if it does
 28724  //  ** match, or false otherwise. This function is intended to be used as
 28725  //  ** part of an assert statement in the compiler. Similar to:
 28726  //  **
 28727  //  **   assert( sqlite3VdbeAssertMayAbort(pParse->pVdbe, pParse->mayAbort) );
 28728  //  */
 28729  func _sqlite3VdbeAssertMayAbort(tls *crt.TLS, _v *TVdbe, _mayAbort int32) (r0 int32) {
 28730  	var _hasAbort, _hasFkCounter, _hasCreateTable, _hasInitCoroutine, _1_opcode int32
 28731  	var _pOp *XVdbeOp
 28732  	var _sIter XVdbeOpIter
 28733  	_hasAbort = int32(0)
 28734  	_hasFkCounter = int32(0)
 28735  	_hasCreateTable = int32(0)
 28736  	_hasInitCoroutine = int32(0)
 28737  	crt.Xmemset(tls, unsafe.Pointer(&_sIter), int32(0), uint32(20))
 28738  	*(**TVdbe)(unsafe.Pointer(&_sIter.Xv)) = _v
 28739  _0:
 28740  	if store61(&_pOp, _opIterNext(tls, &_sIter)) == nil {
 28741  		goto _1
 28742  	}
 28743  	_1_opcode = int32(_pOp.Xopcode)
 28744  	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)))) {
 28745  		_hasAbort = int32(1)
 28746  		goto _1
 28747  	}
 28748  	if _1_opcode == int32(137) {
 28749  		_hasCreateTable = int32(1)
 28750  	}
 28751  	if _1_opcode == int32(15) {
 28752  		_hasInitCoroutine = int32(1)
 28753  	}
 28754  	if ((_1_opcode == int32(147)) && (_pOp.Xp1 == int32(0))) && (_pOp.Xp2 == int32(1)) {
 28755  		_hasFkCounter = int32(1)
 28756  	}
 28757  	goto _0
 28758  _1:
 28759  	_sqlite3DbFree(tls, (*Xsqlite3)(_v.Xdb), unsafe.Pointer(_sIter.XapSub))
 28760  	return bool2int((((((*Xsqlite3)(_v.Xdb).XmallocFailed) != 0) || (_hasAbort == _mayAbort)) || _hasFkCounter != 0) || (_hasCreateTable != 0 && _hasInitCoroutine != 0))
 28761  }
 28762  
 28763  func _opIterNext(tls *crt.TLS, _p *XVdbeOpIter) (r0 *XVdbeOp) {
 28764  	var _nOp, _5_nByte, _5_j int32
 28765  	var _v *TVdbe
 28766  	var _pRet, _aOp *XVdbeOp
 28767  	_v = (*TVdbe)(_p.Xv)
 28768  	_pRet = nil
 28769  	if _p.XiSub > _p.XnSub {
 28770  		goto _0
 28771  	}
 28772  	if _p.XiSub == int32(0) {
 28773  		_aOp = (*XVdbeOp)(_v.XaOp)
 28774  		_nOp = _v.XnOp
 28775  		goto _2
 28776  	}
 28777  	_aOp = (*XVdbeOp)((*elem63((**XSubProgram)(unsafe.Pointer(_p.XapSub)), uintptr(_p.XiSub-int32(1)))).XaOp)
 28778  	_nOp = (*elem63((**XSubProgram)(unsafe.Pointer(_p.XapSub)), uintptr(_p.XiSub-int32(1)))).XnOp
 28779  _2:
 28780  	func() {
 28781  		if _p.XiAddr >= _nOp {
 28782  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71866), unsafe.Pointer(&_opIterNextØ00__func__Ø000), unsafe.Pointer(str(41276)))
 28783  			crt.X__builtin_abort(tls)
 28784  		}
 28785  	}()
 28786  	_pRet = elem61(_aOp, uintptr(_p.XiAddr))
 28787  	_p.XiAddr += 1
 28788  	if _p.XiAddr == _nOp {
 28789  		_p.XiSub += 1
 28790  		_p.XiAddr = int32(0)
 28791  	}
 28792  	if int32(_pRet.Xp4type) != int32(-13) {
 28793  		goto _6
 28794  	}
 28795  	_5_nByte = int32(uint32(_p.XnSub+int32(1)) * uint32(4))
 28796  	_5_j = int32(0)
 28797  _7:
 28798  	if _5_j >= _p.XnSub {
 28799  		goto _10
 28800  	}
 28801  	if (*elem63((**XSubProgram)(unsafe.Pointer(_p.XapSub)), uintptr(_5_j))) == (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer(&_pRet.Xp4))) {
 28802  		goto _10
 28803  	}
 28804  	_5_j += 1
 28805  	goto _7
 28806  _10:
 28807  	if _5_j != _p.XnSub {
 28808  		goto _12
 28809  	}
 28810  	*(***XSubProgram)(unsafe.Pointer(&_p.XapSub)) = (**XSubProgram)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_v.Xdb), unsafe.Pointer(_p.XapSub), uint64(_5_nByte)))
 28811  	if _p.XapSub == nil {
 28812  		_pRet = nil
 28813  		goto _14
 28814  	}
 28815  	*elem63((**XSubProgram)(unsafe.Pointer(_p.XapSub)), uintptr(postInc2(&_p.XnSub, 1))) = (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer(&_pRet.Xp4)))
 28816  _14:
 28817  _12:
 28818  _6:
 28819  _0:
 28820  	return _pRet
 28821  }
 28822  
 28823  var _opIterNextØ00__func__Ø000 [11]int8
 28824  
 28825  func init() {
 28826  	crt.Xstrncpy(nil, &_opIterNextØ00__func__Ø000[0], str(41289), 11)
 28827  }
 28828  
 28829  func _sqlite3VdbeAddOp0(tls *crt.TLS, _p *TVdbe, _op int32) (r0 int32) {
 28830  	return _sqlite3VdbeAddOp3(tls, _p, _op, int32(0), int32(0), int32(0))
 28831  }
 28832  
 28833  // C comment
 28834  //  /*
 28835  //  ** Return the opcode for a given address.  If the address is -1, then
 28836  //  ** return the most recently inserted opcode.
 28837  //  **
 28838  //  ** If a memory allocation error has occurred prior to the calling of this
 28839  //  ** routine, then a pointer to a dummy VdbeOp will be returned.  That opcode
 28840  //  ** is readable but not writable, though it is cast to a writable value.
 28841  //  ** The return of a dummy opcode allows the call to continue functioning
 28842  //  ** after an OOM fault without having to check to see if the return from
 28843  //  ** this routine is a valid pointer.  But because the dummy.opcode is 0,
 28844  //  ** dummy will never be written to.  This is verified by code inspection and
 28845  //  ** by running with Valgrind.
 28846  //  */
 28847  func _sqlite3VdbeGetOp(tls *crt.TLS, _p *TVdbe, _addr int32) (r0 *XVdbeOp) {
 28848  	func() {
 28849  		if _p.Xmagic != uint32(381479589) {
 28850  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72518), unsafe.Pointer(&_sqlite3VdbeGetOpØ00__func__Ø000), unsafe.Pointer(str(37597)))
 28851  			crt.X__builtin_abort(tls)
 28852  		}
 28853  	}()
 28854  	if _addr < int32(0) {
 28855  		_addr = _p.XnOp - int32(1)
 28856  	}
 28857  	func() {
 28858  		if (_addr < int32(0) || _addr >= _p.XnOp) && ((*Xsqlite3)(_p.Xdb).XmallocFailed) == 0 {
 28859  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72522), unsafe.Pointer(&_sqlite3VdbeGetOpØ00__func__Ø000), unsafe.Pointer(str(41300)))
 28860  			crt.X__builtin_abort(tls)
 28861  		}
 28862  	}()
 28863  	if ((*Xsqlite3)(_p.Xdb).XmallocFailed) != 0 {
 28864  		return &_sqlite3VdbeGetOpØ00dummyØ001
 28865  	}
 28866  	return elem61((*XVdbeOp)(_p.XaOp), uintptr(_addr))
 28867  }
 28868  
 28869  var _sqlite3VdbeGetOpØ00__func__Ø000 [17]int8
 28870  
 28871  func init() {
 28872  	crt.Xstrncpy(nil, &_sqlite3VdbeGetOpØ00__func__Ø000[0], str(41348), 17)
 28873  }
 28874  
 28875  var _sqlite3VdbeGetOpØ00dummyØ001 XVdbeOp
 28876  
 28877  // C comment
 28878  //  /*
 28879  //  ** Change the P2 operand of instruction addr so that it points to
 28880  //  ** the address of the next instruction to be coded.
 28881  //  */
 28882  func _sqlite3VdbeJumpHere(tls *crt.TLS, _p *TVdbe, _addr int32) {
 28883  	_sqlite3VdbeChangeP2(tls, _p, uint32(_addr), _p.XnOp)
 28884  }
 28885  
 28886  func _sqlite3VdbeChangeP2(tls *crt.TLS, _p *TVdbe, _addr uint32, _val int32) {
 28887  	_sqlite3VdbeGetOp(tls, _p, int32(_addr)).Xp2 = _val
 28888  }
 28889  
 28890  // C comment
 28891  //  /*
 28892  //  ** Declare to the Vdbe that the BTree object at db->aDb[i] is used.
 28893  //  **
 28894  //  ** The prepared statements need to know in advance the complete set of
 28895  //  ** attached databases that will be use.  A mask of these databases
 28896  //  ** is maintained in p->btreeMask.  The p->lockMask value is the subset of
 28897  //  ** p->btreeMask of databases that will require a lock.
 28898  //  */
 28899  func _sqlite3VdbeUsesBtree(tls *crt.TLS, _p *TVdbe, _i int32) {
 28900  	func() {
 28901  		if _i < int32(0) || _i >= ((*Xsqlite3)(_p.Xdb).XnDb) || _i >= int32(32) {
 28902  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72833), unsafe.Pointer(&_sqlite3VdbeUsesBtreeØ00__func__Ø000), unsafe.Pointer(str(41365)))
 28903  			crt.X__builtin_abort(tls)
 28904  		}
 28905  	}()
 28906  	func() {
 28907  		if _i >= int32(32) {
 28908  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72834), unsafe.Pointer(&_sqlite3VdbeUsesBtreeØ00__func__Ø000), unsafe.Pointer(str(41414)))
 28909  			crt.X__builtin_abort(tls)
 28910  		}
 28911  	}()
 28912  	_p.XbtreeMask |= uint32(1) << uint(_i)
 28913  	if (_i != int32(1)) && _sqlite3BtreeSharable(tls, (*XBtree)(elem27((*XDb)((*Xsqlite3)(_p.Xdb).XaDb), uintptr(_i)).XpBt)) != 0 {
 28914  		_p.XlockMask |= uint32(1) << uint(_i)
 28915  	}
 28916  }
 28917  
 28918  var _sqlite3VdbeUsesBtreeØ00__func__Ø000 [21]int8
 28919  
 28920  func init() {
 28921  	crt.Xstrncpy(nil, &_sqlite3VdbeUsesBtreeØ00__func__Ø000[0], str(41444), 21)
 28922  }
 28923  
 28924  // C comment
 28925  //  /*
 28926  //  ** Return true if the Btree passed as the only argument is sharable.
 28927  //  */
 28928  func _sqlite3BtreeSharable(tls *crt.TLS, _p *XBtree) (r0 int32) {
 28929  	return int32(_p.Xsharable)
 28930  }
 28931  
 28932  // C comment
 28933  //  /*
 28934  //  ** Add an opcode that includes the p4 value as an integer.
 28935  //  */
 28936  func _sqlite3VdbeAddOp4Int(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32, _p3 int32, _p4 int32) (r0 int32) {
 28937  	var _addr int32
 28938  	var _1_pOp *XVdbeOp
 28939  	_addr = _sqlite3VdbeAddOp3(tls, _p, _op, _p1, _p2, _p3)
 28940  	if int32((*Xsqlite3)(_p.Xdb).XmallocFailed) == int32(0) {
 28941  		_1_pOp = elem61((*XVdbeOp)(_p.XaOp), uintptr(_addr))
 28942  		_1_pOp.Xp4type = int8(-11)
 28943  		*(*int32)(unsafe.Pointer(&_1_pOp.Xp4)) = _p4
 28944  	}
 28945  	return _addr
 28946  }
 28947  
 28948  func _sqlite3VdbeChangeP5(tls *crt.TLS, _p *TVdbe, _p5 uint16) {
 28949  	func() {
 28950  		if _p.XnOp <= int32(0) && ((*Xsqlite3)(_p.Xdb).XmallocFailed) == 0 {
 28951  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72215), unsafe.Pointer(&_sqlite3VdbeChangeP5Ø00__func__Ø000), unsafe.Pointer(str(41465)))
 28952  			crt.X__builtin_abort(tls)
 28953  		}
 28954  	}()
 28955  	if _p.XnOp > int32(0) {
 28956  		elem61((*XVdbeOp)(_p.XaOp), uintptr(_p.XnOp-int32(1))).Xp5 = _p5
 28957  	}
 28958  }
 28959  
 28960  var _sqlite3VdbeChangeP5Ø00__func__Ø000 [20]int8
 28961  
 28962  func init() {
 28963  	crt.Xstrncpy(nil, &_sqlite3VdbeChangeP5Ø00__func__Ø000[0], str(41497), 20)
 28964  }
 28965  
 28966  func _sqlite3VdbeComment(tls *crt.TLS, _p *TVdbe, _zFormat *int8, args ...interface{}) {
 28967  	var _ap []interface{}
 28968  	if _p != nil {
 28969  		_ap = args
 28970  		_vdbeVComment(tls, _p, _zFormat, _ap)
 28971  		_ap = nil
 28972  	}
 28973  }
 28974  
 28975  // C comment
 28976  //  /*
 28977  //  ** Change the comment on the most recently coded instruction.  Or
 28978  //  ** insert a No-op and add the comment to that new instruction.  This
 28979  //  ** makes the code easier to read during debugging.  None of this happens
 28980  //  ** in a production build.
 28981  //  */
 28982  func _vdbeVComment(tls *crt.TLS, _p *TVdbe, _zFormat *int8, _ap []interface{}) {
 28983  	func() {
 28984  		if _p.XnOp <= int32(0) && (*XVdbeOp)(_p.XaOp) != nil {
 28985  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72465), unsafe.Pointer(&_vdbeVCommentØ00__func__Ø000), unsafe.Pointer(str(41517)))
 28986  			crt.X__builtin_abort(tls)
 28987  		}
 28988  	}()
 28989  	func() {
 28990  		if (*XVdbeOp)(_p.XaOp) != nil && (elem61((*XVdbeOp)(_p.XaOp), uintptr(_p.XnOp-int32(1))).XzComment) != nil && ((*Xsqlite3)(_p.Xdb).XmallocFailed) == 0 {
 28991  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72466), unsafe.Pointer(&_vdbeVCommentØ00__func__Ø000), unsafe.Pointer(str(41539)))
 28992  			crt.X__builtin_abort(tls)
 28993  		}
 28994  	}()
 28995  	if _p.XnOp != 0 {
 28996  		func() {
 28997  			if _p.XaOp == nil {
 28998  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72468), unsafe.Pointer(&_vdbeVCommentØ00__func__Ø000), unsafe.Pointer(str(41604)))
 28999  				crt.X__builtin_abort(tls)
 29000  			}
 29001  		}()
 29002  		_sqlite3DbFree(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(elem61((*XVdbeOp)(_p.XaOp), uintptr(_p.XnOp-int32(1))).XzComment))
 29003  		elem61((*XVdbeOp)(_p.XaOp), uintptr(_p.XnOp-int32(1))).XzComment = _sqlite3VMPrintf(tls, (*Xsqlite3)(_p.Xdb), _zFormat, _ap)
 29004  	}
 29005  }
 29006  
 29007  var _vdbeVCommentØ00__func__Ø000 [13]int8
 29008  
 29009  func init() {
 29010  	crt.Xstrncpy(nil, &_vdbeVCommentØ00__func__Ø000[0], str(41611), 13)
 29011  }
 29012  
 29013  // C comment
 29014  //  /*
 29015  //  ** pTab is a pointer to a Table structure representing a virtual-table.
 29016  //  ** Return a pointer to the VTable object used by connection db to access
 29017  //  ** this virtual-table, if one has been created, or NULL otherwise.
 29018  //  */
 29019  func _sqlite3GetVTable(tls *crt.TLS, _db *Xsqlite3, _pTab *XTable) (r0 *XVTable) {
 29020  	var _pVtab *XVTable
 29021  	func() {
 29022  		if _pTab.XnModuleArg == 0 {
 29023  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125131), unsafe.Pointer(&_sqlite3GetVTableØ00__func__Ø000), unsafe.Pointer(str(24484)))
 29024  			crt.X__builtin_abort(tls)
 29025  		}
 29026  	}()
 29027  	_pVtab = (*XVTable)(_pTab.XpVTable)
 29028  _2:
 29029  	if _pVtab == nil || (*Xsqlite3)(_pVtab.Xdb) == _db {
 29030  		goto _6
 29031  	}
 29032  	_pVtab = (*XVTable)(_pVtab.XpNext)
 29033  	goto _2
 29034  _6:
 29035  	return _pVtab
 29036  }
 29037  
 29038  var _sqlite3GetVTableØ00__func__Ø000 [17]int8
 29039  
 29040  func init() {
 29041  	crt.Xstrncpy(nil, &_sqlite3GetVTableØ00__func__Ø000[0], str(41624), 17)
 29042  }
 29043  
 29044  // C comment
 29045  //  /*
 29046  //  ** Add an opcode that includes the p4 value as a pointer.
 29047  //  */
 29048  func _sqlite3VdbeAddOp4(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32, _p3 int32, _zP4 *int8, _p4type int32) (r0 int32) {
 29049  	var _addr int32
 29050  	_addr = _sqlite3VdbeAddOp3(tls, _p, _op, _p1, _p2, _p3)
 29051  	_sqlite3VdbeChangeP4(tls, _p, _addr, _zP4, _p4type)
 29052  	return _addr
 29053  }
 29054  
 29055  func _sqlite3VdbeChangeP4(tls *crt.TLS, _p *TVdbe, _addr int32, _zP4 *int8, _n int32) {
 29056  	var _db *Xsqlite3
 29057  	var _pOp *XVdbeOp
 29058  	func() {
 29059  		if _p == nil {
 29060  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72388), unsafe.Pointer(&_sqlite3VdbeChangeP4Ø00__func__Ø000), unsafe.Pointer(str(807)))
 29061  			crt.X__builtin_abort(tls)
 29062  		}
 29063  	}()
 29064  	_db = (*Xsqlite3)(_p.Xdb)
 29065  	func() {
 29066  		if _p.Xmagic != uint32(381479589) {
 29067  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72390), unsafe.Pointer(&_sqlite3VdbeChangeP4Ø00__func__Ø000), unsafe.Pointer(str(37597)))
 29068  			crt.X__builtin_abort(tls)
 29069  		}
 29070  	}()
 29071  	func() {
 29072  		if (*XVdbeOp)(_p.XaOp) == nil && _db.XmallocFailed == 0 {
 29073  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72391), unsafe.Pointer(&_sqlite3VdbeChangeP4Ø00__func__Ø000), unsafe.Pointer(str(41641)))
 29074  			crt.X__builtin_abort(tls)
 29075  		}
 29076  	}()
 29077  	if _db.XmallocFailed == 0 {
 29078  		goto _7
 29079  	}
 29080  	if _n != int32(-8) {
 29081  		_freeP4(tls, _db, _n, unsafe.Pointer(_zP4))
 29082  	}
 29083  	return
 29084  _7:
 29085  	func() {
 29086  		if _p.XnOp <= int32(0) {
 29087  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72396), unsafe.Pointer(&_sqlite3VdbeChangeP4Ø00__func__Ø000), unsafe.Pointer(str(41671)))
 29088  			crt.X__builtin_abort(tls)
 29089  		}
 29090  	}()
 29091  	func() {
 29092  		if _addr >= _p.XnOp {
 29093  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72397), unsafe.Pointer(&_sqlite3VdbeChangeP4Ø00__func__Ø000), unsafe.Pointer(str(41680)))
 29094  			crt.X__builtin_abort(tls)
 29095  		}
 29096  	}()
 29097  	if _addr < int32(0) {
 29098  		_addr = _p.XnOp - int32(1)
 29099  	}
 29100  	_pOp = elem61((*XVdbeOp)(_p.XaOp), uintptr(_addr))
 29101  	if (_n >= int32(0)) || (_pOp.Xp4type != 0) {
 29102  		_vdbeChangeP4Full(tls, _p, _pOp, _zP4, _n)
 29103  		return
 29104  	}
 29105  	if _n == int32(-11) {
 29106  		*(*int32)(unsafe.Pointer(&_pOp.Xp4)) = int32(crt.P2U(unsafe.Pointer(_zP4)))
 29107  		_pOp.Xp4type = int8(-11)
 29108  		goto _18
 29109  	}
 29110  	if _zP4 == nil {
 29111  		goto _18
 29112  	}
 29113  	func() {
 29114  		if _n >= int32(0) {
 29115  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72412), unsafe.Pointer(&_sqlite3VdbeChangeP4Ø00__func__Ø000), unsafe.Pointer(str(41692)))
 29116  			crt.X__builtin_abort(tls)
 29117  		}
 29118  	}()
 29119  	*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)) = unsafe.Pointer(_zP4)
 29120  	_pOp.Xp4type = int8(_n)
 29121  	if _n == int32(-8) {
 29122  		_sqlite3VtabLock(tls, (*XVTable)(unsafe.Pointer(_zP4)))
 29123  	}
 29124  _18:
 29125  }
 29126  
 29127  var _sqlite3VdbeChangeP4Ø00__func__Ø000 [20]int8
 29128  
 29129  func init() {
 29130  	crt.Xstrncpy(nil, &_sqlite3VdbeChangeP4Ø00__func__Ø000[0], str(41696), 20)
 29131  }
 29132  
 29133  func _freeP4(tls *crt.TLS, _db *Xsqlite3, _p4type int32, _p4 unsafe.Pointer) {
 29134  	func() {
 29135  		if _db == nil {
 29136  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72252), unsafe.Pointer(&_freeP4Ø00__func__Ø000), unsafe.Pointer(str(9430)))
 29137  			crt.X__builtin_abort(tls)
 29138  		}
 29139  	}()
 29140  	switch _p4type {
 29141  	case int32(-16):
 29142  		goto _3
 29143  	case int32(-12):
 29144  		goto _4
 29145  	case int32(-10):
 29146  		goto _4
 29147  	case int32(-9):
 29148  		goto _4
 29149  	case int32(-8):
 29150  		goto _11
 29151  	case int32(-7):
 29152  		goto _10
 29153  	case int32(-5):
 29154  		goto _8
 29155  	case int32(-4):
 29156  		goto _9
 29157  	case int32(-1):
 29158  		goto _4
 29159  	default:
 29160  		goto _12
 29161  	}
 29162  
 29163  _3:
 29164  	_freeP4FuncCtx(tls, _db, (*Xsqlite3_context)(_p4))
 29165  	goto _12
 29166  _4:
 29167  	_sqlite3DbFree(tls, _db, _p4)
 29168  	goto _12
 29169  _8:
 29170  	if _db.XpnBytesFreed == nil {
 29171  		_sqlite3KeyInfoUnref(tls, (*XKeyInfo)(_p4))
 29172  	}
 29173  	goto _12
 29174  _9:
 29175  	_freeEphemeralFunction(tls, _db, (*XFuncDef)(_p4))
 29176  	goto _12
 29177  _10:
 29178  	if _db.XpnBytesFreed == nil {
 29179  		_sqlite3ValueFree(tls, (*XMem)(_p4))
 29180  		goto _15
 29181  	}
 29182  	_freeP4Mem(tls, _db, (*XMem)(_p4))
 29183  _15:
 29184  	goto _12
 29185  _11:
 29186  	if _db.XpnBytesFreed == nil {
 29187  		_sqlite3VtabUnlock(tls, (*XVTable)(_p4))
 29188  	}
 29189  	goto _12
 29190  _12:
 29191  }
 29192  
 29193  var _freeP4Ø00__func__Ø000 [7]int8
 29194  
 29195  func init() {
 29196  	crt.Xstrncpy(nil, &_freeP4Ø00__func__Ø000[0], str(41716), 7)
 29197  }
 29198  
 29199  func _freeP4FuncCtx(tls *crt.TLS, _db *Xsqlite3, _p *Xsqlite3_context) {
 29200  	_freeEphemeralFunction(tls, _db, (*XFuncDef)(_p.XpFunc))
 29201  	_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_p))
 29202  }
 29203  
 29204  // C comment
 29205  //  /*
 29206  //  ** If the input FuncDef structure is ephemeral, then free it.  If
 29207  //  ** the FuncDef is not ephermal, then do nothing.
 29208  //  */
 29209  func _freeEphemeralFunction(tls *crt.TLS, _db *Xsqlite3, _pDef *XFuncDef) {
 29210  	if (int32(_pDef.XfuncFlags) & int32(16)) != int32(0) {
 29211  		_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_pDef))
 29212  	}
 29213  }
 29214  
 29215  // C comment
 29216  //  /*
 29217  //  ** Deallocate a KeyInfo object
 29218  //  */
 29219  func _sqlite3KeyInfoUnref(tls *crt.TLS, _p *XKeyInfo) {
 29220  	if _p == nil {
 29221  		goto _0
 29222  	}
 29223  	func() {
 29224  		if _p.XnRef <= (0) {
 29225  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117576), unsafe.Pointer(&_sqlite3KeyInfoUnrefØ00__func__Ø000), unsafe.Pointer(str(13812)))
 29226  			crt.X__builtin_abort(tls)
 29227  		}
 29228  	}()
 29229  	_p.XnRef -= 1
 29230  	if _p.XnRef == (0) {
 29231  		_sqlite3DbFreeNN(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(_p))
 29232  	}
 29233  _0:
 29234  }
 29235  
 29236  var _sqlite3KeyInfoUnrefØ00__func__Ø000 [20]int8
 29237  
 29238  func init() {
 29239  	crt.Xstrncpy(nil, &_sqlite3KeyInfoUnrefØ00__func__Ø000[0], str(41723), 20)
 29240  }
 29241  
 29242  // C comment
 29243  //  /*
 29244  //  ** Delete a P4 value if necessary.
 29245  //  */
 29246  func _freeP4Mem(tls *crt.TLS, _db *Xsqlite3, _p *XMem) {
 29247  	if _p.XszMalloc != 0 {
 29248  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_p.XzMalloc))
 29249  	}
 29250  	_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_p))
 29251  }
 29252  
 29253  // C comment
 29254  //  /*
 29255  //  ** Change the value of the P4 operand for a specific instruction.
 29256  //  ** This routine is useful when a large program is loaded from a
 29257  //  ** static array using sqlite3VdbeAddOpList but we want to make a
 29258  //  ** few minor changes to the program.
 29259  //  **
 29260  //  ** If n>=0 then the P4 operand is dynamic, meaning that a copy of
 29261  //  ** the string is made into memory obtained from sqlite3_malloc().
 29262  //  ** A value of n==0 means copy bytes of zP4 up to and including the
 29263  //  ** first null byte.  If n>0 then copy n+1 bytes of zP4.
 29264  //  **
 29265  //  ** Other values of n (P4_STATIC, P4_COLLSEQ etc.) indicate that zP4 points
 29266  //  ** to a string or structure that is guaranteed to exist for the lifetime of
 29267  //  ** the Vdbe. In these cases we can just copy the pointer.
 29268  //  **
 29269  //  ** If addr<0 then change P4 on the most recently inserted instruction.
 29270  //  */
 29271  func _vdbeChangeP4Full(tls *crt.TLS, _p *TVdbe, _pOp *XVdbeOp, _zP4 *int8, _n int32) {
 29272  	if _pOp.Xp4type != 0 {
 29273  		_freeP4(tls, (*Xsqlite3)(_p.Xdb), int32(_pOp.Xp4type), *(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 29274  		_pOp.Xp4type = 0
 29275  		*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)) = nil
 29276  	}
 29277  	if _n < int32(0) {
 29278  		_sqlite3VdbeChangeP4(tls, _p, int32((uintptr(unsafe.Pointer(_pOp))-uintptr(_p.XaOp))/24), _zP4, _n)
 29279  		goto _2
 29280  	}
 29281  	if _n == int32(0) {
 29282  		_n = _sqlite3Strlen30(tls, _zP4)
 29283  	}
 29284  	*(**int8)(unsafe.Pointer(&_pOp.Xp4)) = _sqlite3DbStrNDup(tls, (*Xsqlite3)(_p.Xdb), _zP4, uint64(_n))
 29285  	_pOp.Xp4type = int8(-1)
 29286  _2:
 29287  }
 29288  
 29289  // C comment
 29290  //  /*
 29291  //  ** Lock the virtual table so that it cannot be disconnected.
 29292  //  ** Locks nest.  Every lock should have a corresponding unlock.
 29293  //  ** If an unlock is omitted, resources leaks will occur.
 29294  //  **
 29295  //  ** If a disconnect is attempted while a virtual table is locked,
 29296  //  ** the disconnect is deferred until all locks have been removed.
 29297  //  */
 29298  func _sqlite3VtabLock(tls *crt.TLS, _pVTab *XVTable) {
 29299  	_pVTab.XnRef += 1
 29300  }
 29301  
 29302  // C comment
 29303  //  /*
 29304  //  ** Code an OP_TableLock instruction for each table locked by the
 29305  //  ** statement (configured by calls to sqlite3TableLock()).
 29306  //  */
 29307  func _codeTableLocks(tls *crt.TLS, _pParse *XParse) {
 29308  	var _i, _1_p1 int32
 29309  	var _pVdbe *TVdbe
 29310  	var _1_p *XTableLock
 29311  	_pVdbe = _sqlite3GetVdbe(tls, _pParse)
 29312  	func() {
 29313  		if _pVdbe == nil {
 29314  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99792), unsafe.Pointer(&_codeTableLocksØ00__func__Ø000), unsafe.Pointer(str(41743)))
 29315  			crt.X__builtin_abort(tls)
 29316  		}
 29317  	}()
 29318  	_i = int32(0)
 29319  _2:
 29320  	if _i >= _pParse.XnTableLock {
 29321  		goto _5
 29322  	}
 29323  	_1_p = elem64((*XTableLock)(_pParse.XaTableLock), uintptr(_i))
 29324  	_1_p1 = _1_p.XiDb
 29325  	_sqlite3VdbeAddOp4(tls, _pVdbe, int32(154), _1_p1, _1_p.XiTab, int32(_1_p.XisWriteLock), _1_p.XzLockName, int32(-2))
 29326  	_i += 1
 29327  	goto _2
 29328  _5:
 29329  }
 29330  
 29331  var _codeTableLocksØ00__func__Ø000 [15]int8
 29332  
 29333  func init() {
 29334  	crt.Xstrncpy(nil, &_codeTableLocksØ00__func__Ø000[0], str(41752), 15)
 29335  }
 29336  
 29337  // C comment
 29338  //  /*
 29339  //  ** This routine generates code that will initialize all of the
 29340  //  ** register used by the autoincrement tracker.
 29341  //  */
 29342  func _sqlite3AutoincrementBegin(tls *crt.TLS, _pParse *XParse) {
 29343  	var _memId int32
 29344  	var _db *Xsqlite3
 29345  	var _pDb *XDb
 29346  	var _v *TVdbe
 29347  	var _1_aOp *XVdbeOp
 29348  	var _p *XAutoincInfo
 29349  	_db = (*Xsqlite3)(_pParse.Xdb)
 29350  	_v = (*TVdbe)(_pParse.XpVdbe)
 29351  	func() {
 29352  		if (*XTable)(_pParse.XpTriggerTab) != nil {
 29353  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109100), unsafe.Pointer(&_sqlite3AutoincrementBeginØ00__func__Ø000), unsafe.Pointer(str(41767)))
 29354  			crt.X__builtin_abort(tls)
 29355  		}
 29356  	}()
 29357  	func() {
 29358  		if (*XParse)(_pParse.XpToplevel) != nil {
 29359  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109101), unsafe.Pointer(&_sqlite3AutoincrementBeginØ00__func__Ø000), unsafe.Pointer(str(41790)))
 29360  			crt.X__builtin_abort(tls)
 29361  		}
 29362  	}()
 29363  	func() {
 29364  		if _v == nil {
 29365  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109103), unsafe.Pointer(&_sqlite3AutoincrementBeginØ00__func__Ø000), unsafe.Pointer(str(41816)))
 29366  			crt.X__builtin_abort(tls)
 29367  		}
 29368  	}()
 29369  	_p = (*XAutoincInfo)(_pParse.XpAinc)
 29370  _6:
 29371  	if _p == nil {
 29372  		goto _9
 29373  	}
 29374  	_pDb = elem27((*XDb)(_db.XaDb), uintptr(_p.XiDb))
 29375  	_memId = _p.XregCtr
 29376  	func() {
 29377  		if _sqlite3SchemaMutexHeld(tls, _db, int32(0), (*XSchema)(_pDb.XpSchema)) == 0 {
 29378  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109121), unsafe.Pointer(&_sqlite3AutoincrementBeginØ00__func__Ø000), unsafe.Pointer(str(41818)))
 29379  			crt.X__builtin_abort(tls)
 29380  		}
 29381  	}()
 29382  	_sqlite3OpenTable(tls, _pParse, int32(0), _p.XiDb, (*XTable)((*XSchema)(_pDb.XpSchema).XpSeqTab), int32(106))
 29383  	_sqlite3VdbeLoadString(tls, _v, _memId-int32(1), (*XTable)(_p.XpTab).XzName)
 29384  	_1_aOp = _sqlite3VdbeAddOpList(tls, _v, int32(10), (*XVdbeOpList)(unsafe.Pointer(&_sqlite3AutoincrementBeginØ00autoIncØ002)), _sqlite3AutoincrementBeginØ00iLnØ001)
 29385  	if _1_aOp == nil {
 29386  		goto _9
 29387  	}
 29388  	elem61(_1_aOp, 0).Xp2 = _memId
 29389  	elem61(_1_aOp, 0).Xp3 = _memId + int32(1)
 29390  	elem61(_1_aOp, uintptr(2)).Xp3 = _memId
 29391  	elem61(_1_aOp, uintptr(3)).Xp1 = _memId - int32(1)
 29392  	elem61(_1_aOp, uintptr(3)).Xp3 = _memId
 29393  	elem61(_1_aOp, uintptr(3)).Xp5 = uint16(16)
 29394  	elem61(_1_aOp, uintptr(4)).Xp2 = _memId + int32(1)
 29395  	elem61(_1_aOp, uintptr(5)).Xp3 = _memId
 29396  	elem61(_1_aOp, uintptr(8)).Xp2 = _memId
 29397  	_p = (*XAutoincInfo)(_p.XpNext)
 29398  	goto _6
 29399  _9:
 29400  }
 29401  
 29402  var _sqlite3AutoincrementBeginØ00__func__Ø000 [26]int8
 29403  
 29404  func init() {
 29405  	crt.Xstrncpy(nil, &_sqlite3AutoincrementBeginØ00__func__Ø000[0], str(41862), 26)
 29406  }
 29407  
 29408  // C comment
 29409  //  /*
 29410  //  ** Generate code that will
 29411  //  **
 29412  //  **   (1) acquire a lock for table pTab then
 29413  //  **   (2) open pTab as cursor iCur.
 29414  //  **
 29415  //  ** If pTab is a WITHOUT ROWID table, then it is the PRIMARY KEY index
 29416  //  ** for that table that is actually opened.
 29417  //  */
 29418  func _sqlite3OpenTable(tls *crt.TLS, _pParse *XParse, _iCur int32, _iDb int32, _pTab *XTable, _opcode int32) {
 29419  	var _v *TVdbe
 29420  	var _2_pPk *XIndex
 29421  	func() {
 29422  		if _pTab.XnModuleArg != 0 {
 29423  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108869), unsafe.Pointer(&_sqlite3OpenTableØ00__func__Ø000), unsafe.Pointer(str(41888)))
 29424  			crt.X__builtin_abort(tls)
 29425  		}
 29426  	}()
 29427  	_v = _sqlite3GetVdbe(tls, _pParse)
 29428  	func() {
 29429  		if _opcode != int32(107) && _opcode != int32(106) {
 29430  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108871), unsafe.Pointer(&_sqlite3OpenTableØ00__func__Ø000), unsafe.Pointer(str(41905)))
 29431  			crt.X__builtin_abort(tls)
 29432  		}
 29433  	}()
 29434  	_sqlite3TableLock(tls, _pParse, _iDb, _pTab.Xtnum, uint8(func() int32 {
 29435  		if _opcode == int32(107) {
 29436  			return int32(1)
 29437  		}
 29438  		return int32(0)
 29439  	}()), _pTab.XzName)
 29440  	if (_pTab.XtabFlags & uint32(32)) == (0) {
 29441  		_sqlite3VdbeAddOp4Int(tls, _v, _opcode, _iCur, _pTab.Xtnum, _iDb, int32(_pTab.XnCol))
 29442  		_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(_pTab.XzName))
 29443  		goto _8
 29444  	}
 29445  	_2_pPk = _sqlite3PrimaryKeyIndex(tls, _pTab)
 29446  	func() {
 29447  		if _2_pPk == nil {
 29448  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108879), unsafe.Pointer(&_sqlite3OpenTableØ00__func__Ø000), unsafe.Pointer(str(41949)))
 29449  			crt.X__builtin_abort(tls)
 29450  		}
 29451  	}()
 29452  	func() {
 29453  		if _2_pPk.Xtnum != _pTab.Xtnum {
 29454  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108880), unsafe.Pointer(&_sqlite3OpenTableØ00__func__Ø000), unsafe.Pointer(str(41956)))
 29455  			crt.X__builtin_abort(tls)
 29456  		}
 29457  	}()
 29458  	_sqlite3VdbeAddOp3(tls, _v, _opcode, _iCur, _2_pPk.Xtnum, _iDb)
 29459  	_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _2_pPk)
 29460  	_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(_pTab.XzName))
 29461  _8:
 29462  }
 29463  
 29464  var _sqlite3OpenTableØ00__func__Ø000 [17]int8
 29465  
 29466  func init() {
 29467  	crt.Xstrncpy(nil, &_sqlite3OpenTableØ00__func__Ø000[0], str(41978), 17)
 29468  }
 29469  
 29470  // C comment
 29471  //  /*
 29472  //  ** Record the fact that we want to lock a table at run-time.
 29473  //  **
 29474  //  ** The table to be locked has root page iTab and is found in database iDb.
 29475  //  ** A read or a write lock can be taken depending on isWritelock.
 29476  //  **
 29477  //  ** This routine just records the fact that the lock is desired.  The
 29478  //  ** code to make the lock occur is generated by a later call to
 29479  //  ** codeTableLocks() which occurs during sqlite3FinishCoding().
 29480  //  */
 29481  func _sqlite3TableLock(tls *crt.TLS, _pParse *XParse, _iDb int32, _iTab int32, _isWriteLock uint8, _zName *int8) {
 29482  	var _i, _nBytes int32
 29483  	var _pToplevel *XParse
 29484  	var _p *XTableLock
 29485  	_pToplevel = func() *XParse {
 29486  		if _pParse.XpToplevel != nil {
 29487  			return (*XParse)(_pParse.XpToplevel)
 29488  		}
 29489  		return _pParse
 29490  	}()
 29491  	func() {
 29492  		if _iDb < int32(0) {
 29493  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99756), unsafe.Pointer(&_sqlite3TableLockØ00__func__Ø000), unsafe.Pointer(str(41995)))
 29494  			crt.X__builtin_abort(tls)
 29495  		}
 29496  	}()
 29497  	if _iDb == int32(1) {
 29498  		return
 29499  	}
 29500  	if _sqlite3BtreeSharable(tls, (*XBtree)(elem27((*XDb)((*Xsqlite3)(_pParse.Xdb).XaDb), uintptr(_iDb)).XpBt)) == 0 {
 29501  		return
 29502  	}
 29503  	_i = int32(0)
 29504  _6:
 29505  	if _i >= _pToplevel.XnTableLock {
 29506  		goto _9
 29507  	}
 29508  	_p = elem64((*XTableLock)(_pToplevel.XaTableLock), uintptr(_i))
 29509  	if (_p.XiDb == _iDb) && (_p.XiTab == _iTab) {
 29510  		_p.XisWriteLock = uint8(bool2int((_p.XisWriteLock != 0) || (_isWriteLock != 0)))
 29511  		return
 29512  	}
 29513  	_i += 1
 29514  	goto _6
 29515  _9:
 29516  	_nBytes = int32(uint32(16) * uint32(_pToplevel.XnTableLock+int32(1)))
 29517  	*(**XTableLock)(unsafe.Pointer(&_pToplevel.XaTableLock)) = (*XTableLock)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_pToplevel.Xdb), _pToplevel.XaTableLock, uint64(_nBytes)))
 29518  	if _pToplevel.XaTableLock != nil {
 29519  		_p = elem64((*XTableLock)(_pToplevel.XaTableLock), uintptr(postInc2(&_pToplevel.XnTableLock, 1)))
 29520  		_p.XiDb = _iDb
 29521  		_p.XiTab = _iTab
 29522  		_p.XisWriteLock = _isWriteLock
 29523  		_p.XzLockName = _zName
 29524  		goto _14
 29525  	}
 29526  	_pToplevel.XnTableLock = int32(0)
 29527  	_sqlite3OomFault(tls, (*Xsqlite3)(_pToplevel.Xdb))
 29528  _14:
 29529  }
 29530  
 29531  var _sqlite3TableLockØ00__func__Ø000 [17]int8
 29532  
 29533  func init() {
 29534  	crt.Xstrncpy(nil, &_sqlite3TableLockØ00__func__Ø000[0], str(42002), 17)
 29535  }
 29536  
 29537  // C comment
 29538  //  /*
 29539  //  ** Return the PRIMARY KEY index of a table
 29540  //  */
 29541  func _sqlite3PrimaryKeyIndex(tls *crt.TLS, _pTab *XTable) (r0 *XIndex) {
 29542  	var _p *XIndex
 29543  	_p = (*XIndex)(_pTab.XpIndex)
 29544  _0:
 29545  	if _p == nil || int32((uint32(_p.XidxType)<<30)>>30) == int32(2) {
 29546  		goto _4
 29547  	}
 29548  	_p = (*XIndex)(_p.XpNext)
 29549  	goto _0
 29550  _4:
 29551  	return _p
 29552  }
 29553  
 29554  // C comment
 29555  //  /*
 29556  //  ** Set the P4 on the most recently added opcode to the KeyInfo for the
 29557  //  ** index given.
 29558  //  */
 29559  func _sqlite3VdbeSetP4KeyInfo(tls *crt.TLS, _pParse *XParse, _pIdx *XIndex) {
 29560  	var _v *TVdbe
 29561  	var _pKeyInfo *XKeyInfo
 29562  	_v = (*TVdbe)(_pParse.XpVdbe)
 29563  	func() {
 29564  		if _v == nil {
 29565  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72451), unsafe.Pointer(&_sqlite3VdbeSetP4KeyInfoØ00__func__Ø000), unsafe.Pointer(str(42019)))
 29566  			crt.X__builtin_abort(tls)
 29567  		}
 29568  	}()
 29569  	func() {
 29570  		if _pIdx == nil {
 29571  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72452), unsafe.Pointer(&_sqlite3VdbeSetP4KeyInfoØ00__func__Ø000), unsafe.Pointer(str(42024)))
 29572  			crt.X__builtin_abort(tls)
 29573  		}
 29574  	}()
 29575  	_pKeyInfo = _sqlite3KeyInfoOfIndex(tls, _pParse, _pIdx)
 29576  	if _pKeyInfo != nil {
 29577  		_sqlite3VdbeAppendP4(tls, _v, unsafe.Pointer(_pKeyInfo), int32(-5))
 29578  	}
 29579  }
 29580  
 29581  var _sqlite3VdbeSetP4KeyInfoØ00__func__Ø000 [24]int8
 29582  
 29583  func init() {
 29584  	crt.Xstrncpy(nil, &_sqlite3VdbeSetP4KeyInfoØ00__func__Ø000[0], str(42032), 24)
 29585  }
 29586  
 29587  // C comment
 29588  //  /*
 29589  //  ** Return a KeyInfo structure that is appropriate for the given Index.
 29590  //  **
 29591  //  ** The caller should invoke sqlite3KeyInfoUnref() on the returned object
 29592  //  ** when it has finished using it.
 29593  //  */
 29594  func _sqlite3KeyInfoOfIndex(tls *crt.TLS, _pParse *XParse, _pIdx *XIndex) (r0 *XKeyInfo) {
 29595  	var _i, _nCol, _nKey int32
 29596  	var _4_zColl *int8
 29597  	var _pKey *XKeyInfo
 29598  	_nCol = int32(_pIdx.XnColumn)
 29599  	_nKey = int32(_pIdx.XnKeyCol)
 29600  	if _pParse.XnErr != 0 {
 29601  		return nil
 29602  	}
 29603  	if ((uint32(_pIdx.XidxType>>3) << 31) >> 31) != 0 {
 29604  		_pKey = _sqlite3KeyInfoAlloc(tls, (*Xsqlite3)(_pParse.Xdb), _nKey, _nCol-_nKey)
 29605  		goto _2
 29606  	}
 29607  	_pKey = _sqlite3KeyInfoAlloc(tls, (*Xsqlite3)(_pParse.Xdb), _nCol, int32(0))
 29608  _2:
 29609  	if _pKey == nil {
 29610  		goto _3
 29611  	}
 29612  	func() {
 29613  		if _sqlite3KeyInfoIsWriteable(tls, _pKey) == 0 {
 29614  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104060), unsafe.Pointer(&_sqlite3KeyInfoOfIndexØ00__func__Ø000), unsafe.Pointer(str(42056)))
 29615  			crt.X__builtin_abort(tls)
 29616  		}
 29617  	}()
 29618  	_i = int32(0)
 29619  _6:
 29620  	if _i >= _nCol {
 29621  		goto _9
 29622  	}
 29623  	_4_zColl = *elem0(_pIdx.XazColl, uintptr(_i))
 29624  	*elem62((**XCollSeq)(unsafe.Pointer(&_pKey.XaColl)), uintptr(_i)) = func() *XCollSeq {
 29625  		if _4_zColl == (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)) {
 29626  			return nil
 29627  		}
 29628  		return _sqlite3LocateCollSeq(tls, _pParse, _4_zColl)
 29629  	}()
 29630  	*elem15(_pKey.XaSortOrder, uintptr(_i)) = *elem15(_pIdx.XaSortOrder, uintptr(_i))
 29631  	_i += 1
 29632  	goto _6
 29633  _9:
 29634  	if _pParse.XnErr != 0 {
 29635  		_sqlite3KeyInfoUnref(tls, _pKey)
 29636  		_pKey = nil
 29637  	}
 29638  _3:
 29639  	return _pKey
 29640  }
 29641  
 29642  // C comment
 29643  //  /*
 29644  //  ** Allocate a KeyInfo object sufficient for an index of N key columns and
 29645  //  ** X extra columns.
 29646  //  */
 29647  func _sqlite3KeyInfoAlloc(tls *crt.TLS, _db *Xsqlite3, _N int32, _X int32) (r0 *XKeyInfo) {
 29648  	var _nExtra int32
 29649  	var _p *XKeyInfo
 29650  	_nExtra = int32(uint32(_N+_X) * uint32(5))
 29651  	_p = (*XKeyInfo)(_sqlite3DbMallocRawNN(tls, _db, uint64(uint32(24)+uint32(_nExtra))))
 29652  	if _p != nil {
 29653  		_p.XaSortOrder = (*uint8)(unsafe.Pointer(elem62((**XCollSeq)(unsafe.Pointer(&_p.XaColl)), uintptr(_N+_X))))
 29654  		_p.XnField = uint16(_N)
 29655  		_p.XnXField = uint16(_X)
 29656  		_p.Xenc = _db.Xenc
 29657  		*(**Xsqlite3)(unsafe.Pointer(&_p.Xdb)) = _db
 29658  		_p.XnRef = uint32(1)
 29659  		crt.Xmemset(tls, unsafe.Pointer(elem65(_p, uintptr(1))), int32(0), uint32(_nExtra))
 29660  		goto _1
 29661  	}
 29662  	_sqlite3OomFault(tls, _db)
 29663  _1:
 29664  	return _p
 29665  }
 29666  
 29667  // C comment
 29668  //  /*
 29669  //  ** Return TRUE if a KeyInfo object can be change.  The KeyInfo object
 29670  //  ** can only be changed if this is just a single reference to the object.
 29671  //  **
 29672  //  ** This routine is used only inside of assert() statements.
 29673  //  */
 29674  func _sqlite3KeyInfoIsWriteable(tls *crt.TLS, _p *XKeyInfo) (r0 int32) {
 29675  	return bool2int(_p.XnRef == uint32(1))
 29676  }
 29677  
 29678  var _sqlite3KeyInfoOfIndexØ00__func__Ø000 [22]int8
 29679  
 29680  func init() {
 29681  	crt.Xstrncpy(nil, &_sqlite3KeyInfoOfIndexØ00__func__Ø000[0], str(42088), 22)
 29682  }
 29683  
 29684  // C comment
 29685  //  /*
 29686  //  ** Name of the default collating sequence
 29687  //  */
 29688  var _sqlite3StrBINARY [7]int8
 29689  
 29690  func init() {
 29691  	crt.Xstrncpy(nil, &_sqlite3StrBINARY[0], str(37836), 7)
 29692  }
 29693  
 29694  // C comment
 29695  //  /*
 29696  //  ** This function returns the collation sequence for database native text
 29697  //  ** encoding identified by the string zName, length nName.
 29698  //  **
 29699  //  ** If the requested collation sequence is not available, or not available
 29700  //  ** in the database native encoding, the collation factory is invoked to
 29701  //  ** request it. If the collation factory does not supply such a sequence,
 29702  //  ** and the sequence is available in another text encoding, then that is
 29703  //  ** returned instead.
 29704  //  **
 29705  //  ** If no versions of the requested collations sequence are available, or
 29706  //  ** another error occurs, NULL is returned and an error message written into
 29707  //  ** pParse.
 29708  //  **
 29709  //  ** This routine is a wrapper around sqlite3FindCollSeq().  This routine
 29710  //  ** invokes the collation factory if the named collation cannot be found
 29711  //  ** and generates an error message.
 29712  //  **
 29713  //  ** See also: sqlite3FindCollSeq(), sqlite3GetCollSeq()
 29714  //  */
 29715  func _sqlite3LocateCollSeq(tls *crt.TLS, _pParse *XParse, _zName *int8) (r0 *XCollSeq) {
 29716  	var _enc, _initbusy uint8
 29717  	var _db *Xsqlite3
 29718  	var _pColl *XCollSeq
 29719  	_db = (*Xsqlite3)(_pParse.Xdb)
 29720  	_enc = _db.Xenc
 29721  	_initbusy = _db.Xinit.Xbusy
 29722  	_pColl = _sqlite3FindCollSeq(tls, _db, _enc, _zName, int32(_initbusy))
 29723  	if (_initbusy == 0) && ((_pColl == nil) || (_pColl.XxCmp == nil)) {
 29724  		_pColl = _sqlite3GetCollSeq(tls, _pParse, _enc, _pColl, _zName)
 29725  	}
 29726  	return _pColl
 29727  }
 29728  
 29729  // C comment
 29730  //  /*
 29731  //  ** This function is responsible for invoking the collation factory callback
 29732  //  ** or substituting a collation sequence of a different encoding when the
 29733  //  ** requested collation sequence is not available in the desired encoding.
 29734  //  **
 29735  //  ** If it is not NULL, then pColl must point to the database native encoding
 29736  //  ** collation sequence with name zName, length nName.
 29737  //  **
 29738  //  ** The return value is either the collation sequence to be used in database
 29739  //  ** db for collation type name zName, length nName, or NULL, if no collation
 29740  //  ** sequence can be found.  If no collation is found, leave an error message.
 29741  //  **
 29742  //  ** See also: sqlite3LocateCollSeq(), sqlite3FindCollSeq()
 29743  //  */
 29744  func _sqlite3GetCollSeq(tls *crt.TLS, _pParse *XParse, _enc uint8, _pColl *XCollSeq, _zName *int8) (r0 *XCollSeq) {
 29745  	var _db *Xsqlite3
 29746  	var _p *XCollSeq
 29747  	_db = (*Xsqlite3)(_pParse.Xdb)
 29748  	_p = _pColl
 29749  	if _p == nil {
 29750  		_p = _sqlite3FindCollSeq(tls, _db, _enc, _zName, int32(0))
 29751  	}
 29752  	if (_p == nil) || (_p.XxCmp == nil) {
 29753  		_callCollNeeded(tls, _db, int32(_enc), _zName)
 29754  		_p = _sqlite3FindCollSeq(tls, _db, _enc, _zName, int32(0))
 29755  	}
 29756  	if ((_p != nil) && (_p.XxCmp == nil)) && _synthCollSeq(tls, _db, _p) != 0 {
 29757  		_p = nil
 29758  	}
 29759  	func() {
 29760  		if _p != nil && _p.XxCmp == nil {
 29761  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104250), unsafe.Pointer(&_sqlite3GetCollSeqØ00__func__Ø000), unsafe.Pointer(str(42110)))
 29762  			crt.X__builtin_abort(tls)
 29763  		}
 29764  	}()
 29765  	if _p == nil {
 29766  		_sqlite3ErrorMsg(tls, _pParse, str(42124), unsafe.Pointer(_zName))
 29767  	}
 29768  	return _p
 29769  }
 29770  
 29771  // C comment
 29772  //  /*
 29773  //  ** Invoke the 'collation needed' callback to request a collation sequence
 29774  //  ** in the encoding enc of name zName, length nName.
 29775  //  */
 29776  func _callCollNeeded(tls *crt.TLS, _db *Xsqlite3, _enc int32, _zName *int8) {
 29777  	var _1_zExternal, _2_zExternal *int8
 29778  	var _2_pTmp *XMem
 29779  	func() {
 29780  		if _db.XxCollNeeded != nil && _db.XxCollNeeded16 != nil {
 29781  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104169), unsafe.Pointer(&_callCollNeededØ00__func__Ø000), unsafe.Pointer(str(42155)))
 29782  			crt.X__builtin_abort(tls)
 29783  		}
 29784  	}()
 29785  	if _db.XxCollNeeded == nil {
 29786  		goto _3
 29787  	}
 29788  	_1_zExternal = _sqlite3DbStrDup(tls, _db, _zName)
 29789  	if _1_zExternal == nil {
 29790  		return
 29791  	}
 29792  	func() func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8) {
 29793  		v := _db.XxCollNeeded
 29794  		return *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8))(unsafe.Pointer(&v))
 29795  	}()(tls, _db.XpCollNeededArg, _db, _enc, _1_zExternal)
 29796  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_1_zExternal))
 29797  _3:
 29798  	if _db.XxCollNeeded16 == nil {
 29799  		goto _5
 29800  	}
 29801  	_2_pTmp = _sqlite3ValueNew(tls, _db)
 29802  	_sqlite3ValueSetStr(tls, _2_pTmp, int32(-1), unsafe.Pointer(_zName), uint8(1), nil)
 29803  	_2_zExternal = (*int8)(_sqlite3ValueText(tls, _2_pTmp, uint8(2)))
 29804  	if _2_zExternal != nil {
 29805  		func() func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer) {
 29806  			v := _db.XxCollNeeded16
 29807  			return *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer))(unsafe.Pointer(&v))
 29808  		}()(tls, _db.XpCollNeededArg, _db, int32(_db.Xenc), unsafe.Pointer(_2_zExternal))
 29809  	}
 29810  	_sqlite3ValueFree(tls, _2_pTmp)
 29811  _5:
 29812  }
 29813  
 29814  var _callCollNeededØ00__func__Ø000 [15]int8
 29815  
 29816  func init() {
 29817  	crt.Xstrncpy(nil, &_callCollNeededØ00__func__Ø000[0], str(42194), 15)
 29818  }
 29819  
 29820  // C comment
 29821  //  /*
 29822  //  ** Make a copy of a string in memory obtained from sqliteMalloc(). These
 29823  //  ** functions call sqlite3MallocRaw() directly instead of sqliteMalloc(). This
 29824  //  ** is because when memory debugging is turned on, these two functions are
 29825  //  ** called via macros that record the current file and line number in the
 29826  //  ** ThreadData structure.
 29827  //  */
 29828  func _sqlite3DbStrDup(tls *crt.TLS, _db *Xsqlite3, _z *int8) (r0 *int8) {
 29829  	var _n uint32
 29830  	var _zNew *int8
 29831  	if _z == nil {
 29832  		return nil
 29833  	}
 29834  	_n = crt.Xstrlen(tls, _z) + uint32(1)
 29835  	_zNew = (*int8)(_sqlite3DbMallocRaw(tls, _db, uint64(_n)))
 29836  	if _zNew != nil {
 29837  		crt.Xmemcpy(tls, unsafe.Pointer(_zNew), unsafe.Pointer(_z), _n)
 29838  	}
 29839  	return _zNew
 29840  }
 29841  
 29842  // C comment
 29843  //  /*
 29844  //  ** This routine is called if the collation factory fails to deliver a
 29845  //  ** collation function in the best encoding but there may be other versions
 29846  //  ** of this collation function (for other text encodings) available. Use one
 29847  //  ** of these instead if they exist. Avoid a UTF-8 <-> UTF-16 conversion if
 29848  //  ** possible.
 29849  //  */
 29850  func _synthCollSeq(tls *crt.TLS, _db *Xsqlite3, _pColl *XCollSeq) (r0 int32) {
 29851  	var _i int32
 29852  	var _z *int8
 29853  	var _pColl2 *XCollSeq
 29854  	_z = _pColl.XzName
 29855  	_i = int32(0)
 29856  _0:
 29857  	if _i >= int32(3) {
 29858  		goto _3
 29859  	}
 29860  	_pColl2 = _sqlite3FindCollSeq(tls, _db, *elem15((*uint8)(unsafe.Pointer(&_synthCollSeqØ00aEncØ001)), uintptr(_i)), _z, int32(0))
 29861  	if _pColl2.XxCmp != nil {
 29862  		crt.Xmemcpy(tls, unsafe.Pointer(_pColl), unsafe.Pointer(_pColl2), uint32(20))
 29863  		_pColl.XxDel = nil
 29864  		return int32(0)
 29865  	}
 29866  	_i += 1
 29867  	goto _0
 29868  _3:
 29869  	return int32(1)
 29870  }
 29871  
 29872  var _synthCollSeqØ00aEncØ001 [3]uint8
 29873  
 29874  func init() {
 29875  	_synthCollSeqØ00aEncØ001 = [3]uint8{3, 2, 1}
 29876  }
 29877  
 29878  var _sqlite3GetCollSeqØ00__func__Ø000 [18]int8
 29879  
 29880  func init() {
 29881  	crt.Xstrncpy(nil, &_sqlite3GetCollSeqØ00__func__Ø000[0], str(42209), 18)
 29882  }
 29883  
 29884  // C comment
 29885  //  /*
 29886  //  ** Change the P4 operand of the most recently coded instruction
 29887  //  ** to the value defined by the arguments.  This is a high-speed
 29888  //  ** version of sqlite3VdbeChangeP4().
 29889  //  **
 29890  //  ** The P4 operand must not have been previously defined.  And the new
 29891  //  ** P4 must not be P4_INT32.  Use sqlite3VdbeChangeP4() in either of
 29892  //  ** those cases.
 29893  //  */
 29894  func _sqlite3VdbeAppendP4(tls *crt.TLS, _p *TVdbe, _pP4 unsafe.Pointer, _n int32) {
 29895  	var _pOp *XVdbeOp
 29896  	func() {
 29897  		if _n == int32(-11) || _n == int32(-8) {
 29898  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72430), unsafe.Pointer(&_sqlite3VdbeAppendP4Ø00__func__Ø000), unsafe.Pointer(str(42227)))
 29899  			crt.X__builtin_abort(tls)
 29900  		}
 29901  	}()
 29902  	func() {
 29903  		if _n > int32(0) {
 29904  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72431), unsafe.Pointer(&_sqlite3VdbeAppendP4Ø00__func__Ø000), unsafe.Pointer(str(42253)))
 29905  			crt.X__builtin_abort(tls)
 29906  		}
 29907  	}()
 29908  	if ((*Xsqlite3)(_p.Xdb).XmallocFailed) != 0 {
 29909  		_freeP4(tls, (*Xsqlite3)(_p.Xdb), _n, _pP4)
 29910  		goto _6
 29911  	}
 29912  	func() {
 29913  		if _pP4 == nil {
 29914  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72435), unsafe.Pointer(&_sqlite3VdbeAppendP4Ø00__func__Ø000), unsafe.Pointer(str(42258)))
 29915  			crt.X__builtin_abort(tls)
 29916  		}
 29917  	}()
 29918  	func() {
 29919  		if _p.XnOp <= int32(0) {
 29920  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72436), unsafe.Pointer(&_sqlite3VdbeAppendP4Ø00__func__Ø000), unsafe.Pointer(str(41671)))
 29921  			crt.X__builtin_abort(tls)
 29922  		}
 29923  	}()
 29924  	_pOp = elem61((*XVdbeOp)(_p.XaOp), uintptr(_p.XnOp-int32(1)))
 29925  	func() {
 29926  		if int32(_pOp.Xp4type) != int32(0) {
 29927  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72438), unsafe.Pointer(&_sqlite3VdbeAppendP4Ø00__func__Ø000), unsafe.Pointer(str(42265)))
 29928  			crt.X__builtin_abort(tls)
 29929  		}
 29930  	}()
 29931  	_pOp.Xp4type = int8(_n)
 29932  	*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)) = _pP4
 29933  _6:
 29934  }
 29935  
 29936  var _sqlite3VdbeAppendP4Ø00__func__Ø000 [20]int8
 29937  
 29938  func init() {
 29939  	crt.Xstrncpy(nil, &_sqlite3VdbeAppendP4Ø00__func__Ø000[0], str(42289), 20)
 29940  }
 29941  
 29942  // C comment
 29943  //  /* Generate code to cause the string zStr to be loaded into
 29944  //  ** register iDest
 29945  //  */
 29946  func _sqlite3VdbeLoadString(tls *crt.TLS, _p *TVdbe, _iDest int32, _zStr *int8) (r0 int32) {
 29947  	return _sqlite3VdbeAddOp4(tls, _p, int32(97), int32(0), _iDest, int32(0), _zStr, int32(0))
 29948  }
 29949  
 29950  // C comment
 29951  //  /*
 29952  //  ** Add a whole list of operations to the operation stack.  Return a
 29953  //  ** pointer to the first operation inserted.
 29954  //  **
 29955  //  ** Non-zero P2 arguments to jump instructions are automatically adjusted
 29956  //  ** so that the jump target is relative to the first operation inserted.
 29957  //  */
 29958  func _sqlite3VdbeAddOpList(tls *crt.TLS, _p *TVdbe, _nOp int32, _aOp *XVdbeOpList, _iLineno int32) (r0 *XVdbeOp) {
 29959  	var _i int32
 29960  	var _pOut, _pFirst *XVdbeOp
 29961  	func() {
 29962  		if _nOp <= int32(0) {
 29963  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72134), unsafe.Pointer(&_sqlite3VdbeAddOpListØ00__func__Ø000), unsafe.Pointer(str(42309)))
 29964  			crt.X__builtin_abort(tls)
 29965  		}
 29966  	}()
 29967  	func() {
 29968  		if _p.Xmagic != uint32(381479589) {
 29969  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72135), unsafe.Pointer(&_sqlite3VdbeAddOpListØ00__func__Ø000), unsafe.Pointer(str(37597)))
 29970  			crt.X__builtin_abort(tls)
 29971  		}
 29972  	}()
 29973  	if ((_p.XnOp + _nOp) > ((*XParse)(_p.XpParse).XnOpAlloc)) && _growOpArray(tls, _p, _nOp) != 0 {
 29974  		return nil
 29975  	}
 29976  	_pFirst = store61(&_pOut, elem61((*XVdbeOp)(_p.XaOp), uintptr(_p.XnOp)))
 29977  	_i = int32(0)
 29978  _6:
 29979  	if _i >= _nOp {
 29980  		goto _9
 29981  	}
 29982  	_pOut.Xopcode = _aOp.Xopcode
 29983  	_pOut.Xp1 = int32(_aOp.Xp1)
 29984  	_pOut.Xp2 = int32(_aOp.Xp2)
 29985  	func() {
 29986  		if int32(_aOp.Xp2) < int32(0) {
 29987  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72144), unsafe.Pointer(&_sqlite3VdbeAddOpListØ00__func__Ø000), unsafe.Pointer(str(42315)))
 29988  			crt.X__builtin_abort(tls)
 29989  		}
 29990  	}()
 29991  	if ((int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3OpcodeProperty)), uintptr(_aOp.Xopcode))) & int32(1)) != int32(0)) && (int32(_aOp.Xp2) > int32(0)) {
 29992  		_pOut.Xp2 += _p.XnOp
 29993  	}
 29994  	_pOut.Xp3 = int32(_aOp.Xp3)
 29995  	_pOut.Xp4type = 0
 29996  	*(*unsafe.Pointer)(unsafe.Pointer(&_pOut.Xp4)) = nil
 29997  	_pOut.Xp5 = 0
 29998  	_pOut.XzComment = nil
 29999  
 30000  	if (((*Xsqlite3)(_p.Xdb).Xflags) & int32(4096)) != 0 {
 30001  		_sqlite3VdbePrintOp(tls, nil, _i+_p.XnOp, elem61((*XVdbeOp)(_p.XaOp), uintptr(_i+_p.XnOp)))
 30002  	}
 30003  	*(*uintptr)(unsafe.Pointer(func() **XVdbeOp {
 30004  		*(*uintptr)(unsafe.Pointer(func() **XVdbeOpList { _i += 1; return &_aOp }())) += uintptr(4)
 30005  		return &_pOut
 30006  	}())) += uintptr(24)
 30007  	goto _6
 30008  _9:
 30009  	_p.XnOp += _nOp
 30010  	return _pFirst
 30011  }
 30012  
 30013  var _sqlite3VdbeAddOpListØ00__func__Ø000 [21]int8
 30014  
 30015  func init() {
 30016  	crt.Xstrncpy(nil, &_sqlite3VdbeAddOpListØ00__func__Ø000[0], str(42326), 21)
 30017  }
 30018  
 30019  // C comment
 30020  //  /* #include "opcodes.h" */
 30021  //  /*
 30022  //  ** Properties of opcodes.  The OPFLG_INITIALIZER macro is
 30023  //  ** created by mkopcodeh.awk during compilation.  Data is obtained
 30024  //  ** from the comments following the "case OP_xxxx:" statements in
 30025  //  ** the vdbe.c file.
 30026  //  */
 30027  var _sqlite3OpcodeProperty [166]uint8
 30028  
 30029  func init() {
 30030  	_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}
 30031  }
 30032  
 30033  var _sqlite3AutoincrementBeginØ00autoIncØ002 [10]XVdbeOpList
 30034  
 30035  func init() {
 30036  	_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)}}
 30037  }
 30038  
 30039  var _sqlite3AutoincrementBeginØ00iLnØ001 int32
 30040  
 30041  // C comment
 30042  //  /*
 30043  //  ** Generate code that will evaluate expression pExpr and store the
 30044  //  ** results in register target.  The results are guaranteed to appear
 30045  //  ** in register target.
 30046  //  */
 30047  func _sqlite3ExprCode(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _target int32) {
 30048  	var _inReg int32
 30049  	func() {
 30050  		if _target <= int32(0) || _target > _pParse.XnMem {
 30051  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95060), unsafe.Pointer(&_sqlite3ExprCodeØ00__func__Ø000), unsafe.Pointer(str(42347)))
 30052  			crt.X__builtin_abort(tls)
 30053  		}
 30054  	}()
 30055  	if (_pExpr != nil) && (int32(_pExpr.Xop) == int32(157)) {
 30056  		_sqlite3VdbeAddOp2(tls, (*TVdbe)(_pParse.XpVdbe), int32(64), _pExpr.XiTable, _target)
 30057  		goto _5
 30058  	}
 30059  	_inReg = _sqlite3ExprCodeTarget(tls, _pParse, _pExpr, _target)
 30060  	func() {
 30061  		if (*TVdbe)(_pParse.XpVdbe) == nil && ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == 0 {
 30062  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95065), unsafe.Pointer(&_sqlite3ExprCodeØ00__func__Ø000), unsafe.Pointer(str(42380)))
 30063  			crt.X__builtin_abort(tls)
 30064  		}
 30065  	}()
 30066  	if (_inReg != _target) && (_pParse.XpVdbe != nil) {
 30067  		_sqlite3VdbeAddOp2(tls, (*TVdbe)(_pParse.XpVdbe), int32(65), _inReg, _target)
 30068  	}
 30069  _5:
 30070  }
 30071  
 30072  var _sqlite3ExprCodeØ00__func__Ø000 [16]int8
 30073  
 30074  func init() {
 30075  	crt.Xstrncpy(nil, &_sqlite3ExprCodeØ00__func__Ø000[0], str(42425), 16)
 30076  }
 30077  
 30078  // C comment
 30079  //  /*
 30080  //  ** Generate code into the current Vdbe to evaluate the given
 30081  //  ** expression.  Attempt to store the results in register "target".
 30082  //  ** Return the register where results are stored.
 30083  //  **
 30084  //  ** With this routine, there is no guarantee that results will
 30085  //  ** be stored in target.  The result might be stored in some other
 30086  //  ** register if it is convenient to do so.  The calling function
 30087  //  ** must check the return code and move the results to the desired
 30088  //  ** register.
 30089  //  */
 30090  func _sqlite3ExprCodeTarget(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _target int32) (r0 int32) {
 30091  	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
 30092  	var _43_aff int8
 30093  	var _35_constMask uint32
 30094  	var _16_z, _16_zBlob, _18_z, _35_zId *int8
 30095  	var _35_enc, _50_exprOp uint8
 30096  	var _35_db *Xsqlite3
 30097  	var _66_pTab *XTable
 30098  	var _v *TVdbe
 30099  	var _35_pDef *XFuncDef
 30100  	var _35_pFarg, _70_pEList *XExprList
 30101  	var _70_aListelem *TExprList_item
 30102  	var _22_pLeft, _26_pLeft, _70_pX, _70_pTest *XExpr
 30103  	var _tempX, _70_opCompare XExpr
 30104  	var _35_pColl *XCollSeq
 30105  	var _5_pAggInfo, _32_pInfo *XAggInfo
 30106  	var _5_pCol *TAggInfo_col
 30107  	var _43_azAff [5]*int8
 30108  	_v = (*TVdbe)(_pParse.XpVdbe)
 30109  	_inReg = _target
 30110  	_regFree1 = int32(0)
 30111  	_regFree2 = int32(0)
 30112  	_p5 = int32(0)
 30113  	func() {
 30114  		if _target <= int32(0) || _target > _pParse.XnMem {
 30115  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94349), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42347)))
 30116  			crt.X__builtin_abort(tls)
 30117  		}
 30118  	}()
 30119  	if _v == nil {
 30120  		func() {
 30121  			if ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == 0 {
 30122  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94351), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42441)))
 30123  				crt.X__builtin_abort(tls)
 30124  			}
 30125  		}()
 30126  		return int32(0)
 30127  	}
 30128  	if _pExpr == nil {
 30129  		_op = int32(101)
 30130  		goto _7
 30131  	}
 30132  	_op = int32(_pExpr.Xop)
 30133  _7:
 30134  	switch _op {
 30135  	case int32(19):
 30136  		goto _40
 30137  	case int32(20):
 30138  		goto _46
 30139  	case int32(37):
 30140  		goto _18
 30141  	case int32(56):
 30142  		goto _58
 30143  	case int32(61):
 30144  		goto _54
 30145  	case int32(70):
 30146  		goto _27
 30147  	case int32(71):
 30148  		goto _27
 30149  	case int32(72):
 30150  		goto _19
 30151  	case int32(73):
 30152  		goto _50
 30153  	case int32(74):
 30154  		goto _49
 30155  	case int32(75):
 30156  		goto _42
 30157  	case int32(76):
 30158  		goto _42
 30159  	case int32(77):
 30160  		goto _21
 30161  	case int32(78):
 30162  		goto _21
 30163  	case int32(79):
 30164  		goto _21
 30165  	case int32(80):
 30166  		goto _21
 30167  	case int32(81):
 30168  		goto _21
 30169  	case int32(82):
 30170  		goto _21
 30171  	case int32(84):
 30172  		goto _27
 30173  	case int32(85):
 30174  		goto _27
 30175  	case int32(86):
 30176  		goto _27
 30177  	case int32(87):
 30178  		goto _27
 30179  	case int32(88):
 30180  		goto _27
 30181  	case int32(89):
 30182  		goto _27
 30183  	case int32(90):
 30184  		goto _27
 30185  	case int32(91):
 30186  		goto _27
 30187  	case int32(92):
 30188  		goto _27
 30189  	case int32(93):
 30190  		goto _27
 30191  	case int32(94):
 30192  		goto _51
 30193  	case int32(95):
 30194  		goto _40
 30195  	case int32(97):
 30196  		goto _13
 30197  	case int32(101):
 30198  		goto _14
 30199  	case int32(119):
 30200  		goto _46
 30201  	case int32(132):
 30202  		goto _12
 30203  	case int32(133):
 30204  		goto _15
 30205  	case int32(134):
 30206  		goto _11
 30207  	case int32(135):
 30208  		goto _16
 30209  	case int32(148):
 30210  		goto _19
 30211  	case int32(151):
 30212  		goto _45
 30213  	case int32(152):
 30214  		goto _10
 30215  	case int32(153):
 30216  		goto _44
 30217  	case int32(154):
 30218  		goto _9
 30219  	case int32(155):
 30220  		goto _39
 30221  	case int32(156):
 30222  		goto _51
 30223  	case int32(157):
 30224  		goto _17
 30225  	case int32(158):
 30226  		goto _55
 30227  	case int32(159):
 30228  		goto _48
 30229  	case int32(160):
 30230  		goto _56
 30231  	case int32(162):
 30232  		goto _51
 30233  	default:
 30234  		goto _57
 30235  	}
 30236  
 30237  _9:
 30238  	_5_pAggInfo = (*XAggInfo)(_pExpr.XpAggInfo)
 30239  	_5_pCol = elem66((*TAggInfo_col)(_5_pAggInfo.XaCol), uintptr(_pExpr.XiAgg))
 30240  	if _5_pAggInfo.XdirectMode == 0 {
 30241  		func() {
 30242  			if _5_pCol.XiMem <= int32(0) {
 30243  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94365), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42466)))
 30244  				crt.X__builtin_abort(tls)
 30245  			}
 30246  		}()
 30247  		return _5_pCol.XiMem
 30248  	}
 30249  	if _5_pAggInfo.XuseSortingIdx != 0 {
 30250  		_sqlite3VdbeAddOp3(tls, _v, int32(99), _5_pAggInfo.XsortingIdxPTab, _5_pCol.XiSorterColumn, _target)
 30251  		return _target
 30252  	}
 30253  _10:
 30254  	_8_iTab = _pExpr.XiTable
 30255  	if _8_iTab >= int32(0) {
 30256  		goto _64
 30257  	}
 30258  	if _pParse.XckBase > int32(0) {
 30259  		return int32(_pExpr.XiColumn) + _pParse.XckBase
 30260  	}
 30261  	_8_iTab = _pParse.XiSelfTab
 30262  _64:
 30263  	return _sqlite3ExprCodeGetColumn(tls, _pParse, (*XTable)(_pExpr.XpTab), int32(_pExpr.XiColumn), _8_iTab, _target, _pExpr.Xop2)
 30264  
 30265  _11:
 30266  	_codeInteger(tls, _pParse, _pExpr, int32(0), _target)
 30267  	return _target
 30268  
 30269  _12:
 30270  	func() {
 30271  		if (_pExpr.Xflags & uint32(1024)) != (0) {
 30272  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94396), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42479)))
 30273  			crt.X__builtin_abort(tls)
 30274  		}
 30275  	}()
 30276  	_codeReal(tls, _v, *(**int8)(unsafe.Pointer(&_pExpr.Xu)), int32(0), _target)
 30277  	return _target
 30278  
 30279  _13:
 30280  	func() {
 30281  		if (_pExpr.Xflags & uint32(1024)) != (0) {
 30282  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94402), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42479)))
 30283  			crt.X__builtin_abort(tls)
 30284  		}
 30285  	}()
 30286  	_sqlite3VdbeLoadString(tls, _v, _target, *(**int8)(unsafe.Pointer(&_pExpr.Xu)))
 30287  	return _target
 30288  
 30289  _14:
 30290  	_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _target)
 30291  	return _target
 30292  
 30293  _15:
 30294  	func() {
 30295  		if (_pExpr.Xflags & uint32(1024)) != (0) {
 30296  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94415), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42479)))
 30297  			crt.X__builtin_abort(tls)
 30298  		}
 30299  	}()
 30300  	func() {
 30301  		if int32(*elem1(*(**int8)(unsafe.Pointer(&_pExpr.Xu)), 0)) != int32(120) && int32(*elem1(*(**int8)(unsafe.Pointer(&_pExpr.Xu)), 0)) != int32(88) {
 30302  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94416), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42516)))
 30303  			crt.X__builtin_abort(tls)
 30304  		}
 30305  	}()
 30306  	func() {
 30307  		if int32(*elem1(*(**int8)(unsafe.Pointer(&_pExpr.Xu)), uintptr(1))) != int32(39) {
 30308  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94417), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42567)))
 30309  			crt.X__builtin_abort(tls)
 30310  		}
 30311  	}()
 30312  	_16_z = elem1(*(**int8)(unsafe.Pointer(&_pExpr.Xu)), uintptr(2))
 30313  	_16_n = _sqlite3Strlen30(tls, _16_z) - int32(1)
 30314  	func() {
 30315  		if int32(*elem1(_16_z, uintptr(_16_n))) != int32(39) {
 30316  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94420), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42592)))
 30317  			crt.X__builtin_abort(tls)
 30318  		}
 30319  	}()
 30320  	_16_zBlob = (*int8)(_sqlite3HexToBlob(tls, _sqlite3VdbeDb(tls, _v), _16_z, _16_n))
 30321  	_sqlite3VdbeAddOp4(tls, _v, int32(61), _16_n/int32(2), _target, int32(0), _16_zBlob, int32(-1))
 30322  	return _target
 30323  
 30324  _16:
 30325  	func() {
 30326  		if (_pExpr.Xflags & uint32(1024)) != (0) {
 30327  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94427), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42479)))
 30328  			crt.X__builtin_abort(tls)
 30329  		}
 30330  	}()
 30331  	func() {
 30332  		if (*(**int8)(unsafe.Pointer(&_pExpr.Xu))) == nil {
 30333  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94428), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42603)))
 30334  			crt.X__builtin_abort(tls)
 30335  		}
 30336  	}()
 30337  	func() {
 30338  		if int32(*elem1(*(**int8)(unsafe.Pointer(&_pExpr.Xu)), 0)) == int32(0) {
 30339  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94429), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42622)))
 30340  			crt.X__builtin_abort(tls)
 30341  		}
 30342  	}()
 30343  	_sqlite3VdbeAddOp2(tls, _v, int32(62), int32(_pExpr.XiColumn), _target)
 30344  	if int32(*elem1(*(**int8)(unsafe.Pointer(&_pExpr.Xu)), uintptr(1))) != int32(0) {
 30345  		_18_z = _sqlite3VListNumToName(tls, _pParse.XpVList, int32(_pExpr.XiColumn))
 30346  		func() {
 30347  			if int32(*elem1(*(**int8)(unsafe.Pointer(&_pExpr.Xu)), 0)) != int32(63) && crt.Xstrcmp(tls, *(**int8)(unsafe.Pointer(&_pExpr.Xu)), _18_z) != int32(0) {
 30348  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94433), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42644)))
 30349  				crt.X__builtin_abort(tls)
 30350  			}
 30351  		}()
 30352  		*elem8(_pParse.XpVList, 0) = int32(0)
 30353  		_sqlite3VdbeAppendP4(tls, _v, unsafe.Pointer(_18_z), int32(-2))
 30354  	}
 30355  	return _target
 30356  
 30357  _17:
 30358  	return _pExpr.XiTable
 30359  
 30360  _18:
 30361  	_inReg = _sqlite3ExprCodeTarget(tls, _pParse, (*XExpr)(_pExpr.XpLeft), _target)
 30362  	if _inReg != _target {
 30363  		_sqlite3VdbeAddOp2(tls, _v, int32(65), _inReg, _target)
 30364  		_inReg = _target
 30365  	}
 30366  	_sqlite3VdbeAddOp2(tls, _v, int32(94), _target, int32(_sqlite3AffinityType(tls, *(**int8)(unsafe.Pointer(&_pExpr.Xu)), nil)))
 30367  	_sqlite3ExprCacheAffinityChange(tls, _pParse, _inReg, int32(1))
 30368  	return _inReg
 30369  
 30370  _19:
 30371  	_op = func() int32 {
 30372  		if _op == int32(72) {
 30373  			return int32(78)
 30374  		}
 30375  		return int32(77)
 30376  	}()
 30377  	_p5 = int32(128)
 30378  _21:
 30379  	_22_pLeft = (*XExpr)(_pExpr.XpLeft)
 30380  	if _sqlite3ExprIsVector(tls, _22_pLeft) != 0 {
 30381  		_codeVectorCompare(tls, _pParse, _pExpr, _target, uint8(_op), uint8(_p5))
 30382  		goto _94
 30383  	}
 30384  	_r1 = _sqlite3ExprCodeTemp(tls, _pParse, _22_pLeft, &_regFree1)
 30385  	_r2 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.XpRight), &_regFree2)
 30386  	_codeCompare(tls, _pParse, _22_pLeft, (*XExpr)(_pExpr.XpRight), _op, _r1, _r2, _inReg, int32(32)|_p5)
 30387  
 30388  _94:
 30389  	goto _95
 30390  _27:
 30391  
 30392  	_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.XpLeft), &_regFree1)
 30393  	_r2 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.XpRight), &_regFree2)
 30394  	_sqlite3VdbeAddOp3(tls, _v, _op, _r2, _r1, _target)
 30395  	goto _95
 30396  _39:
 30397  	_26_pLeft = (*XExpr)(_pExpr.XpLeft)
 30398  	func() {
 30399  		if _26_pLeft == nil {
 30400  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94519), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42701)))
 30401  			crt.X__builtin_abort(tls)
 30402  		}
 30403  	}()
 30404  	if int32(_26_pLeft.Xop) == int32(134) {
 30405  		_codeInteger(tls, _pParse, _26_pLeft, int32(1), _target)
 30406  		return _target
 30407  	}
 30408  	if int32(_26_pLeft.Xop) == int32(132) {
 30409  		func() {
 30410  			if (_pExpr.Xflags & uint32(1024)) != (0) {
 30411  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94525), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42479)))
 30412  				crt.X__builtin_abort(tls)
 30413  			}
 30414  		}()
 30415  		_codeReal(tls, _v, *(**int8)(unsafe.Pointer(&_26_pLeft.Xu)), int32(1), _target)
 30416  		return _target
 30417  	}
 30418  	_tempX.Xop = uint8(134)
 30419  	_tempX.Xflags = uint32(17408)
 30420  	*(*int32)(unsafe.Pointer(&_tempX.Xu)) = int32(0)
 30421  	_r1 = _sqlite3ExprCodeTemp(tls, _pParse, &_tempX, &_regFree1)
 30422  	_r2 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.XpLeft), &_regFree2)
 30423  	_sqlite3VdbeAddOp3(tls, _v, int32(89), _r2, _r1, _target)
 30424  	goto _95
 30425  _40:
 30426  
 30427  	_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.XpLeft), &_regFree1)
 30428  	_sqlite3VdbeAddOp2(tls, _v, _op, _r1, _inReg)
 30429  	goto _95
 30430  _42:
 30431  
 30432  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(1), _target)
 30433  	_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.XpLeft), &_regFree1)
 30434  	_31_addr = _sqlite3VdbeAddOp1(tls, _v, _op, _r1)
 30435  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _target)
 30436  	_sqlite3VdbeJumpHere(tls, _v, _31_addr)
 30437  	goto _95
 30438  _44:
 30439  	_32_pInfo = (*XAggInfo)(_pExpr.XpAggInfo)
 30440  	if _32_pInfo == nil {
 30441  		func() {
 30442  			if (_pExpr.Xflags & uint32(1024)) != (0) {
 30443  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94567), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42479)))
 30444  				crt.X__builtin_abort(tls)
 30445  			}
 30446  		}()
 30447  		_sqlite3ErrorMsg(tls, _pParse, str(42707), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 30448  		goto _107
 30449  	}
 30450  	return elem67((*TAggInfo_func)(_32_pInfo.XaFunc), uintptr(_pExpr.XiAgg)).XiMem
 30451  
 30452  _107:
 30453  	goto _95
 30454  _45:
 30455  	_35_constMask = uint32(0)
 30456  	_35_db = (*Xsqlite3)(_pParse.Xdb)
 30457  	_35_enc = _35_db.Xenc
 30458  	_35_pColl = nil
 30459  	if (_pParse.XokConstFactor != 0) && _sqlite3ExprIsConstantNotJoin(tls, _pExpr) != 0 {
 30460  		return _sqlite3ExprCodeAtInit(tls, _pParse, _pExpr, int32(-1))
 30461  	}
 30462  	func() {
 30463  		if (_pExpr.Xflags & uint32(2048)) != (0) {
 30464  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94590), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42733)))
 30465  			crt.X__builtin_abort(tls)
 30466  		}
 30467  	}()
 30468  	if (_pExpr.Xflags & uint32(16384)) != (0) {
 30469  		_35_pFarg = nil
 30470  		goto _113
 30471  	}
 30472  	_35_pFarg = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 30473  _113:
 30474  	_35_nFarg = func() int32 {
 30475  		if _35_pFarg != nil {
 30476  			return _35_pFarg.XnExpr
 30477  		}
 30478  		return int32(0)
 30479  	}()
 30480  	func() {
 30481  		if (_pExpr.Xflags & uint32(1024)) != (0) {
 30482  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94597), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42479)))
 30483  			crt.X__builtin_abort(tls)
 30484  		}
 30485  	}()
 30486  	_35_zId = *(**int8)(unsafe.Pointer(&_pExpr.Xu))
 30487  	_35_pDef = _sqlite3FindFunction(tls, _35_db, _35_zId, _35_nFarg, _35_enc, 0)
 30488  	if (_35_pDef == nil) || (func() func(*crt.TLS, *Xsqlite3_context) {
 30489  		v := _35_pDef.XxFinalize
 30490  		return *(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer(&v))
 30491  	}() != nil) {
 30492  		_sqlite3ErrorMsg(tls, _pParse, str(42771), unsafe.Pointer(_35_zId))
 30493  		goto _95
 30494  	}
 30495  	if (int32(_35_pDef.XfuncFlags) & int32(512)) == 0 {
 30496  		goto _120
 30497  	}
 30498  	_40_endCoalesce = _sqlite3VdbeMakeLabel(tls, _v)
 30499  	func() {
 30500  		if _35_nFarg < int32(2) {
 30501  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94616), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42794)))
 30502  			crt.X__builtin_abort(tls)
 30503  		}
 30504  	}()
 30505  	_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_35_pFarg.Xa)), 0).XpExpr), _target)
 30506  	_35_i = int32(1)
 30507  _123:
 30508  	if _35_i >= _35_nFarg {
 30509  		goto _126
 30510  	}
 30511  	_sqlite3VdbeAddOp2(tls, _v, int32(76), _target, _40_endCoalesce)
 30512  	_sqlite3ExprCacheRemove(tls, _pParse, _target, int32(1))
 30513  	_sqlite3ExprCachePush(tls, _pParse)
 30514  	_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_35_pFarg.Xa)), uintptr(_35_i)).XpExpr), _target)
 30515  	_sqlite3ExprCachePop(tls, _pParse)
 30516  	_35_i += 1
 30517  	goto _123
 30518  _126:
 30519  	_sqlite3VdbeResolveLabel(tls, _v, _40_endCoalesce)
 30520  	goto _95
 30521  _120:
 30522  	if (int32(_35_pDef.XfuncFlags) & int32(1024)) != 0 {
 30523  		func() {
 30524  			if _35_nFarg < int32(1) {
 30525  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94634), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42803)))
 30526  				crt.X__builtin_abort(tls)
 30527  			}
 30528  		}()
 30529  		return _sqlite3ExprCodeTarget(tls, _pParse, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_35_pFarg.Xa)), 0).XpExpr), _target)
 30530  	}
 30531  	if (int32(_35_pDef.XfuncFlags) & int32(16384)) != 0 {
 30532  		_43_azAff = [5]*int8{}
 30533  		*elem0((**int8)(unsafe.Pointer(&_43_azAff)), 0) = str(42812)
 30534  		*elem0((**int8)(unsafe.Pointer(&_43_azAff)), uintptr(1)) = str(42817)
 30535  		*elem0((**int8)(unsafe.Pointer(&_43_azAff)), uintptr(2)) = str(42822)
 30536  		*elem0((**int8)(unsafe.Pointer(&_43_azAff)), uintptr(3)) = str(42830)
 30537  		*elem0((**int8)(unsafe.Pointer(&_43_azAff)), uintptr(4)) = str(42838)
 30538  		func() {
 30539  			if _35_nFarg != int32(1) {
 30540  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94646), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42843)))
 30541  				crt.X__builtin_abort(tls)
 30542  			}
 30543  		}()
 30544  		_43_aff = _sqlite3ExprAffinity(tls, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_35_pFarg.Xa)), 0).XpExpr))
 30545  		_sqlite3VdbeLoadString(tls, _v, _target, func() *int8 {
 30546  			if _43_aff != 0 {
 30547  				return (*elem0((**int8)(unsafe.Pointer(&_43_azAff)), uintptr(int32(_43_aff)-int32(65))))
 30548  			}
 30549  			return str(42852)
 30550  		}())
 30551  		return _target
 30552  	}
 30553  	_35_i = int32(0)
 30554  _135:
 30555  	if _35_i >= _35_nFarg {
 30556  		goto _138
 30557  	}
 30558  	if (_35_i < int32(32)) && _sqlite3ExprIsConstant(tls, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_35_pFarg.Xa)), uintptr(_35_i)).XpExpr)) != 0 {
 30559  		_35_constMask |= uint32(1) << uint(_35_i)
 30560  	}
 30561  	if ((int32(_35_pDef.XfuncFlags) & int32(32)) != int32(0)) && (_35_pColl == nil) {
 30562  		_35_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_35_pFarg.Xa)), uintptr(_35_i)).XpExpr))
 30563  	}
 30564  	_35_i += 1
 30565  	goto _135
 30566  _138:
 30567  	if _35_pFarg == nil {
 30568  		goto _143
 30569  	}
 30570  	if _35_constMask != 0 {
 30571  		_r1 = _pParse.XnMem + int32(1)
 30572  		_pParse.XnMem += _35_nFarg
 30573  		goto _145
 30574  	}
 30575  	_r1 = _sqlite3GetTempRange(tls, _pParse, _35_nFarg)
 30576  _145:
 30577  	if (int32(_35_pDef.XfuncFlags) & int32(192)) == int32(0) {
 30578  		goto _146
 30579  	}
 30580  	func() {
 30581  		if _35_nFarg != int32(1) {
 30582  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94678), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42843)))
 30583  			crt.X__builtin_abort(tls)
 30584  		}
 30585  	}()
 30586  	func() {
 30587  		if (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_35_pFarg.Xa)), 0).XpExpr) == nil {
 30588  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94679), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42857)))
 30589  			crt.X__builtin_abort(tls)
 30590  		}
 30591  	}()
 30592  	_50_exprOp = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_35_pFarg.Xa)), 0).XpExpr).Xop
 30593  	if (int32(_50_exprOp) == int32(152)) || (int32(_50_exprOp) == int32(154)) {
 30594  		(*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_35_pFarg.Xa)), 0).XpExpr).Xop2 = uint8(int32(_35_pDef.XfuncFlags) & int32(192))
 30595  	}
 30596  _146:
 30597  	_sqlite3ExprCachePush(tls, _pParse)
 30598  	_sqlite3ExprCodeExprList(tls, _pParse, _35_pFarg, _r1, int32(0), uint8(3))
 30599  	_sqlite3ExprCachePop(tls, _pParse)
 30600  	goto _153
 30601  _143:
 30602  	_r1 = int32(0)
 30603  _153:
 30604  	if (_35_nFarg >= int32(2)) && ((_pExpr.Xflags & uint32(128)) != 0) {
 30605  		_35_pDef = _sqlite3VtabOverloadFunction(tls, _35_db, _35_pDef, _35_nFarg, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_35_pFarg.Xa)), uintptr(1)).XpExpr))
 30606  		goto _157
 30607  	}
 30608  	if _35_nFarg > int32(0) {
 30609  		_35_pDef = _sqlite3VtabOverloadFunction(tls, _35_db, _35_pDef, _35_nFarg, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_35_pFarg.Xa)), 0).XpExpr))
 30610  	}
 30611  _157:
 30612  	if (int32(_35_pDef.XfuncFlags) & int32(32)) == 0 {
 30613  		goto _158
 30614  	}
 30615  	if _35_pColl == nil {
 30616  		_35_pColl = (*XCollSeq)(_35_db.XpDfltColl)
 30617  	}
 30618  	_sqlite3VdbeAddOp4(tls, _v, int32(68), int32(0), int32(0), int32(0), (*int8)(unsafe.Pointer(_35_pColl)), int32(-3))
 30619  _158:
 30620  	_sqlite3VdbeAddOp4(tls, _v, int32(69), int32(_35_constMask), _r1, _target, (*int8)(unsafe.Pointer(_35_pDef)), int32(-4))
 30621  	_sqlite3VdbeChangeP5(tls, _v, uint16(uint8(_35_nFarg)))
 30622  	if _35_nFarg != 0 && (_35_constMask == (0)) {
 30623  		_sqlite3ReleaseTempRange(tls, _pParse, _r1, _35_nFarg)
 30624  	}
 30625  	return _target
 30626  
 30627  _46:
 30628  	if (_op == int32(119)) && (store2(&_57_nCol, (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).XpEList).XnExpr) != int32(1)) {
 30629  		_sqlite3SubselectError(tls, _pParse, _57_nCol, int32(1))
 30630  		goto _164
 30631  	}
 30632  	return _sqlite3CodeSubselect(tls, _pParse, _pExpr, int32(0), int32(0))
 30633  
 30634  _164:
 30635  	goto _95
 30636  _48:
 30637  	if ((*XExpr)(_pExpr.XpLeft).XiTable) == int32(0) {
 30638  		(*XExpr)(_pExpr.XpLeft).XiTable = _sqlite3CodeSubselect(tls, _pParse, (*XExpr)(_pExpr.XpLeft), int32(0), int32(0))
 30639  	}
 30640  	func() {
 30641  		if _pExpr.XiTable != int32(0) && int32((*XExpr)(_pExpr.XpLeft).Xop) != int32(119) {
 30642  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94746), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42878)))
 30643  			crt.X__builtin_abort(tls)
 30644  		}
 30645  	}()
 30646  	if _pExpr.XiTable != 0 && (_pExpr.XiTable != store2(&_60_n, _sqlite3ExprVectorSize(tls, (*XExpr)(_pExpr.XpLeft)))) {
 30647  		_sqlite3ErrorMsg(tls, _pParse, str(42926), _pExpr.XiTable, _60_n)
 30648  	}
 30649  	return ((*XExpr)(_pExpr.XpLeft).XiTable) + int32(_pExpr.XiColumn)
 30650  
 30651  _49:
 30652  	_63_destIfFalse = _sqlite3VdbeMakeLabel(tls, _v)
 30653  	_63_destIfNull = _sqlite3VdbeMakeLabel(tls, _v)
 30654  	_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _target)
 30655  	_sqlite3ExprCodeIN(tls, _pParse, _pExpr, _63_destIfFalse, _63_destIfNull)
 30656  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(1), _target)
 30657  	_sqlite3VdbeResolveLabel(tls, _v, _63_destIfFalse)
 30658  	_sqlite3VdbeAddOp2(tls, _v, int32(73), _target, int32(0))
 30659  	_sqlite3VdbeResolveLabel(tls, _v, _63_destIfNull)
 30660  	return _target
 30661  
 30662  _50:
 30663  	_exprCodeBetween(tls, _pParse, _pExpr, _target, nil, int32(0))
 30664  	return _target
 30665  
 30666  _51:
 30667  	return _sqlite3ExprCodeTarget(tls, _pParse, (*XExpr)(_pExpr.XpLeft), _target)
 30668  
 30669  _54:
 30670  	_66_pTab = (*XTable)(_pExpr.XpTab)
 30671  	_66_p1 = ((_pExpr.XiTable * (int32(_66_pTab.XnCol) + int32(1))) + int32(1)) + int32(_pExpr.XiColumn)
 30672  	func() {
 30673  		if _pExpr.XiTable != int32(0) && _pExpr.XiTable != int32(1) {
 30674  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94819), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42956)))
 30675  			crt.X__builtin_abort(tls)
 30676  		}
 30677  	}()
 30678  	func() {
 30679  		if int32(_pExpr.XiColumn) < int32(-1) || int32(_pExpr.XiColumn) >= int32(_66_pTab.XnCol) {
 30680  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94820), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42993)))
 30681  			crt.X__builtin_abort(tls)
 30682  		}
 30683  	}()
 30684  	func() {
 30685  		if int32(_66_pTab.XiPKey) >= int32(0) && int32(_pExpr.XiColumn) == int32(_66_pTab.XiPKey) {
 30686  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94821), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(43041)))
 30687  			crt.X__builtin_abort(tls)
 30688  		}
 30689  	}()
 30690  	func() {
 30691  		if _66_p1 < int32(0) || _66_p1 >= ((int32(_66_pTab.XnCol)*int32(2))+int32(2)) {
 30692  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94822), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(43086)))
 30693  			crt.X__builtin_abort(tls)
 30694  		}
 30695  	}()
 30696  	_sqlite3VdbeAddOp2(tls, _v, int32(146), _66_p1, _target)
 30697  	_sqlite3VdbeComment(tls, _v, str(43115), unsafe.Pointer(func() *int8 {
 30698  		if _pExpr.XiTable != 0 {
 30699  			return str(43128)
 30700  		}
 30701  		return str(43132)
 30702  	}()), unsafe.Pointer(func() *int8 {
 30703  		if int32(_pExpr.XiColumn) < int32(0) {
 30704  			return str(27182)
 30705  		}
 30706  		return (elem41((*XColumn)((*XTable)(_pExpr.XpTab).XaCol), uintptr(_pExpr.XiColumn)).XzName)
 30707  	}()), _target)
 30708  	if (int32(_pExpr.XiColumn) >= int32(0)) && (int32(elem41((*XColumn)(_66_pTab.XaCol), uintptr(_pExpr.XiColumn)).Xaffinity) == int32(69)) {
 30709  		_sqlite3VdbeAddOp1(tls, _v, int32(74), _target)
 30710  	}
 30711  	goto _95
 30712  _55:
 30713  	_sqlite3ErrorMsg(tls, _pParse, str(43136))
 30714  	goto _95
 30715  _56:
 30716  	_69_addrINR = _sqlite3VdbeAddOp1(tls, _v, int32(23), _pExpr.XiTable)
 30717  	_sqlite3ExprCachePush(tls, _pParse)
 30718  	_inReg = _sqlite3ExprCodeTarget(tls, _pParse, (*XExpr)(_pExpr.XpLeft), _target)
 30719  	_sqlite3ExprCachePop(tls, _pParse)
 30720  	_sqlite3VdbeJumpHere(tls, _v, _69_addrINR)
 30721  	_sqlite3VdbeChangeP3(tls, _v, uint32(_69_addrINR), _inReg)
 30722  	goto _95
 30723  _57:
 30724  	func() {
 30725  		if _op != int32(136) {
 30726  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94883), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(43154)))
 30727  			crt.X__builtin_abort(tls)
 30728  		}
 30729  	}()
 30730  	_70_pTest = nil
 30731  	_70_iCacheLevel = _pParse.XiCacheLevel
 30732  	func() {
 30733  		if (_pExpr.Xflags&uint32(2048)) != (0) || (*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))) == nil {
 30734  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94895), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(43166)))
 30735  			crt.X__builtin_abort(tls)
 30736  		}
 30737  	}()
 30738  	func() {
 30739  		if ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).XnExpr) <= int32(0) {
 30740  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94896), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(43222)))
 30741  			crt.X__builtin_abort(tls)
 30742  		}
 30743  	}()
 30744  	_70_pEList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 30745  	_70_aListelem = (*TExprList_item)(unsafe.Pointer(&_70_pEList.Xa))
 30746  	_70_nExpr = _70_pEList.XnExpr
 30747  	_70_endLabel = _sqlite3VdbeMakeLabel(tls, _v)
 30748  	if store58(&_70_pX, (*XExpr)(_pExpr.XpLeft)) != nil {
 30749  		_tempX = *_70_pX
 30750  		_exprToRegister(tls, &_tempX, _exprCodeVector(tls, _pParse, &_tempX, &_regFree1))
 30751  		crt.Xmemset(tls, unsafe.Pointer(&_70_opCompare), int32(0), uint32(48))
 30752  		_70_opCompare.Xop = uint8(78)
 30753  		*(**XExpr)(unsafe.Pointer(&_70_opCompare.XpLeft)) = &_tempX
 30754  		_70_pTest = &_70_opCompare
 30755  		_regFree1 = int32(0)
 30756  	}
 30757  	_70_i = int32(0)
 30758  _197:
 30759  	if _70_i >= (_70_nExpr - int32(1)) {
 30760  		goto _200
 30761  	}
 30762  	_sqlite3ExprCachePush(tls, _pParse)
 30763  	if _70_pX != nil {
 30764  		func() {
 30765  			if _70_pTest == nil {
 30766  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94919), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(43248)))
 30767  				crt.X__builtin_abort(tls)
 30768  			}
 30769  		}()
 30770  		*(**XExpr)(unsafe.Pointer(&_70_opCompare.XpRight)) = (*XExpr)(elem57(_70_aListelem, uintptr(_70_i)).XpExpr)
 30771  		goto _204
 30772  	}
 30773  	_70_pTest = (*XExpr)(elem57(_70_aListelem, uintptr(_70_i)).XpExpr)
 30774  _204:
 30775  	_70_nextCase = _sqlite3VdbeMakeLabel(tls, _v)
 30776  	_sqlite3ExprIfFalse(tls, _pParse, _70_pTest, _70_nextCase, int32(16))
 30777  	_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem57(_70_aListelem, uintptr(_70_i+int32(1))).XpExpr), _target)
 30778  	_sqlite3VdbeGoto(tls, _v, _70_endLabel)
 30779  	_sqlite3ExprCachePop(tls, _pParse)
 30780  	_sqlite3VdbeResolveLabel(tls, _v, _70_nextCase)
 30781  	_70_i = _70_i + int32(2)
 30782  	goto _197
 30783  _200:
 30784  	if (_70_nExpr & int32(1)) != int32(0) {
 30785  		_sqlite3ExprCachePush(tls, _pParse)
 30786  		_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_70_pEList.Xa)), uintptr(_70_nExpr-int32(1))).XpExpr), _target)
 30787  		_sqlite3ExprCachePop(tls, _pParse)
 30788  		goto _206
 30789  	}
 30790  	_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _target)
 30791  _206:
 30792  	func() {
 30793  		if ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == 0 && _pParse.XnErr <= int32(0) && _pParse.XiCacheLevel != _70_iCacheLevel {
 30794  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94940), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(43257)))
 30795  			crt.X__builtin_abort(tls)
 30796  		}
 30797  	}()
 30798  	_sqlite3VdbeResolveLabel(tls, _v, _70_endLabel)
 30799  	goto _95
 30800  _58:
 30801  	func() {
 30802  		if int32(_pExpr.Xaffinity) != int32(1) && int32(_pExpr.Xaffinity) != int32(2) && int32(_pExpr.Xaffinity) != int32(3) && int32(_pExpr.Xaffinity) != int32(4) {
 30803  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94947), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(43336)))
 30804  			crt.X__builtin_abort(tls)
 30805  		}
 30806  	}()
 30807  	if _pParse.XpTriggerTab == nil {
 30808  		_sqlite3ErrorMsg(tls, _pParse, str(43452))
 30809  		return int32(0)
 30810  	}
 30811  	if int32(_pExpr.Xaffinity) == int32(2) {
 30812  		_sqlite3MayAbort(tls, _pParse)
 30813  	}
 30814  	func() {
 30815  		if (_pExpr.Xflags & uint32(1024)) != (0) {
 30816  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94960), unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000), unsafe.Pointer(str(42479)))
 30817  			crt.X__builtin_abort(tls)
 30818  		}
 30819  	}()
 30820  	if int32(_pExpr.Xaffinity) == int32(4) {
 30821  		_sqlite3VdbeAddOp4(tls, _v, int32(55), int32(0), int32(4), int32(0), *(**int8)(unsafe.Pointer(&_pExpr.Xu)), int32(0))
 30822  		goto _221
 30823  	}
 30824  	_sqlite3HaltConstraint(tls, _pParse, int32(1811), int32(_pExpr.Xaffinity), *(**int8)(unsafe.Pointer(&_pExpr.Xu)), 0, 0)
 30825  _221:
 30826  	goto _95
 30827  _95:
 30828  	_sqlite3ReleaseTempReg(tls, _pParse, _regFree1)
 30829  	_sqlite3ReleaseTempReg(tls, _pParse, _regFree2)
 30830  	return _inReg
 30831  
 30832  	_ = _43_azAff
 30833  	panic(0)
 30834  }
 30835  
 30836  var _sqlite3ExprCodeTargetØ00__func__Ø000 [22]int8
 30837  
 30838  func init() {
 30839  	crt.Xstrncpy(nil, &_sqlite3ExprCodeTargetØ00__func__Ø000[0], str(43502), 22)
 30840  }
 30841  
 30842  // C comment
 30843  //  /*
 30844  //  ** Generate code that will extract the iColumn-th column from
 30845  //  ** table pTab and store the column value in a register.
 30846  //  **
 30847  //  ** An effort is made to store the column value in register iReg.  This
 30848  //  ** is not garanteeed for GetColumn() - the result can be stored in
 30849  //  ** any register.  But the result is guaranteed to land in register iReg
 30850  //  ** for GetColumnToReg().
 30851  //  **
 30852  //  ** There must be an open cursor to pTab in iTable when this routine
 30853  //  ** is called.  If iColumn<0 then code is generated that extracts the rowid.
 30854  //  */
 30855  func _sqlite3ExprCodeGetColumn(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _iColumn int32, _iTable int32, _iReg int32, _p5 uint8) (r0 int32) {
 30856  	var _i int32
 30857  	var _v *TVdbe
 30858  	var _p *TyColCache
 30859  	_v = (*TVdbe)(_pParse.XpVdbe)
 30860  	*func() **TyColCache { _i = int32(0); return &_p }() = (*TyColCache)(unsafe.Pointer(&_pParse.XaColCache))
 30861  _0:
 30862  	if _i >= int32(_pParse.XnColCache) {
 30863  		goto _3
 30864  	}
 30865  	if (_p.XiTable == _iTable) && (int32(_p.XiColumn) == _iColumn) {
 30866  		_p.Xlru = postInc2(&_pParse.XiCacheCnt, 1)
 30867  		_sqlite3ExprCachePinRegister(tls, _pParse, _p.XiReg)
 30868  		return _p.XiReg
 30869  	}
 30870  	*(*uintptr)(unsafe.Pointer(func() **TyColCache { _i += 1; return &_p }())) += uintptr(20)
 30871  	goto _0
 30872  _3:
 30873  	func() {
 30874  		if _v == nil {
 30875  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94200), unsafe.Pointer(&_sqlite3ExprCodeGetColumnØ00__func__Ø000), unsafe.Pointer(str(42019)))
 30876  			crt.X__builtin_abort(tls)
 30877  		}
 30878  	}()
 30879  	_sqlite3ExprCodeGetColumnOfTable(tls, _v, _pTab, _iTable, _iColumn, _iReg)
 30880  	if _p5 != 0 {
 30881  		_sqlite3VdbeChangeP5(tls, _v, uint16(_p5))
 30882  		goto _9
 30883  	}
 30884  	_sqlite3ExprCacheStore(tls, _pParse, _iTable, _iColumn, _iReg)
 30885  _9:
 30886  	return _iReg
 30887  }
 30888  
 30889  // C comment
 30890  //  /*
 30891  //  ** When a cached column is reused, make sure that its register is
 30892  //  ** no longer available as a temp register.  ticket #3879:  that same
 30893  //  ** register might be in the cache in multiple places, so be sure to
 30894  //  ** get them all.
 30895  //  */
 30896  func _sqlite3ExprCachePinRegister(tls *crt.TLS, _pParse *XParse, _iReg int32) {
 30897  	var _i int32
 30898  	var _p *TyColCache
 30899  	*func() **TyColCache { _i = int32(0); return &_p }() = (*TyColCache)(unsafe.Pointer(&_pParse.XaColCache))
 30900  _0:
 30901  	if _i >= int32(_pParse.XnColCache) {
 30902  		goto _3
 30903  	}
 30904  	if _p.XiReg == _iReg {
 30905  		_p.XtempReg = 0
 30906  	}
 30907  	*(*uintptr)(unsafe.Pointer(func() **TyColCache { _i += 1; return &_p }())) += uintptr(20)
 30908  	goto _0
 30909  _3:
 30910  }
 30911  
 30912  var _sqlite3ExprCodeGetColumnØ00__func__Ø000 [25]int8
 30913  
 30914  func init() {
 30915  	crt.Xstrncpy(nil, &_sqlite3ExprCodeGetColumnØ00__func__Ø000[0], str(43524), 25)
 30916  }
 30917  
 30918  // C comment
 30919  //  /*
 30920  //  ** Generate code to extract the value of the iCol-th column of a table.
 30921  //  */
 30922  func _sqlite3ExprCodeGetColumnOfTable(tls *crt.TLS, _v *TVdbe, _pTab *XTable, _iTabCur int32, _iCol int32, _regOut int32) {
 30923  	var _3_op, _3_x int32
 30924  	if _pTab == nil {
 30925  		_sqlite3VdbeAddOp3(tls, _v, int32(99), _iTabCur, _iCol, _regOut)
 30926  		return
 30927  	}
 30928  	if (_iCol < int32(0)) || (_iCol == int32(_pTab.XiPKey)) {
 30929  		_sqlite3VdbeAddOp2(tls, _v, int32(125), _iTabCur, _regOut)
 30930  		goto _3
 30931  	}
 30932  	_3_op = func() int32 {
 30933  		if _pTab.XnModuleArg != 0 {
 30934  			return int32(159)
 30935  		}
 30936  		return int32(99)
 30937  	}()
 30938  	_3_x = _iCol
 30939  	if ((_pTab.XtabFlags & uint32(32)) != (0)) && (_pTab.XnModuleArg == 0) {
 30940  		_3_x = int32(_sqlite3ColumnOfIndex(tls, _sqlite3PrimaryKeyIndex(tls, _pTab), int16(_iCol)))
 30941  	}
 30942  	_sqlite3VdbeAddOp3(tls, _v, _3_op, _iTabCur, _3_x, _regOut)
 30943  _3:
 30944  	if _iCol >= int32(0) {
 30945  		_sqlite3ColumnDefault(tls, _v, _pTab, _iCol, _regOut)
 30946  	}
 30947  }
 30948  
 30949  // C comment
 30950  //  /*
 30951  //  ** Return the column of index pIdx that corresponds to table
 30952  //  ** column iCol.  Return -1 if not found.
 30953  //  */
 30954  func _sqlite3ColumnOfIndex(tls *crt.TLS, _pIdx *XIndex, _iCol int16) (r0 int16) {
 30955  	var _i int32
 30956  	_i = int32(0)
 30957  _0:
 30958  	if _i >= int32(_pIdx.XnColumn) {
 30959  		goto _3
 30960  	}
 30961  	if int32(_iCol) == int32(*elem50(_pIdx.XaiColumn, uintptr(_i))) {
 30962  		return int16(_i)
 30963  	}
 30964  	_i += 1
 30965  	goto _0
 30966  _3:
 30967  	return int16(-1)
 30968  }
 30969  
 30970  // C comment
 30971  //  /*
 30972  //  ** The most recently coded instruction was an OP_Column to retrieve the
 30973  //  ** i-th column of table pTab. This routine sets the P4 parameter of the
 30974  //  ** OP_Column to the default value, if any.
 30975  //  **
 30976  //  ** The default value of a column is specified by a DEFAULT clause in the
 30977  //  ** column definition. This was either supplied by the user when the table
 30978  //  ** was created, or added later to the table definition by an ALTER TABLE
 30979  //  ** command. If the latter, then the row-records in the table btree on disk
 30980  //  ** may not contain a value for the column and the default value, taken
 30981  //  ** from the P4 parameter of the OP_Column instruction, is returned instead.
 30982  //  ** If the former, then all row-records are guaranteed to include a value
 30983  //  ** for the column and the P4 value is not required.
 30984  //  **
 30985  //  ** Column definitions created by an ALTER TABLE command may only have
 30986  //  ** literal default values specified: a number, null or a string. (If a more
 30987  //  ** complicated default expression value was provided, it is evaluated
 30988  //  ** when the ALTER TABLE is executed and one of the literal values written
 30989  //  ** into the sqlite_master table.)
 30990  //  **
 30991  //  ** Therefore, the P4 parameter is only required if the default value for
 30992  //  ** the column is a literal number, string or null. The sqlite3ValueFromExpr()
 30993  //  ** function is capable of transforming these types of expressions into
 30994  //  ** sqlite3_value objects.
 30995  //  **
 30996  //  ** If parameter iReg is not negative, code an OP_RealAffinity instruction
 30997  //  ** on register iReg. This is used when an equivalent integer value is
 30998  //  ** stored in place of an 8-byte floating point value in order to save
 30999  //  ** space.
 31000  //  */
 31001  func _sqlite3ColumnDefault(tls *crt.TLS, _v *TVdbe, _pTab *XTable, _i int32, _iReg int32) {
 31002  	var _1_enc uint8
 31003  	var _1_pValue *XMem
 31004  	var _1_pCol *XColumn
 31005  	func() {
 31006  		if _pTab == nil {
 31007  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123808), unsafe.Pointer(&_sqlite3ColumnDefaultØ00__func__Ø000), unsafe.Pointer(str(43549)))
 31008  			crt.X__builtin_abort(tls)
 31009  		}
 31010  	}()
 31011  	if _pTab.XpSelect != nil {
 31012  		goto _2
 31013  	}
 31014  	_1_pValue = nil
 31015  	_1_enc = _sqlite3VdbeDb(tls, _v).Xenc
 31016  	_1_pCol = elem41((*XColumn)(_pTab.XaCol), uintptr(_i))
 31017  	_sqlite3VdbeComment(tls, _v, str(7919), unsafe.Pointer(_pTab.XzName), unsafe.Pointer(_1_pCol.XzName))
 31018  	func() {
 31019  		if _i >= int32(_pTab.XnCol) {
 31020  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123814), unsafe.Pointer(&_sqlite3ColumnDefaultØ00__func__Ø000), unsafe.Pointer(str(43557)))
 31021  			crt.X__builtin_abort(tls)
 31022  		}
 31023  	}()
 31024  	_sqlite3ValueFromExpr(tls, _sqlite3VdbeDb(tls, _v), (*XExpr)(_1_pCol.XpDflt), _1_enc, uint8(_1_pCol.Xaffinity), &_1_pValue)
 31025  	if _1_pValue != nil {
 31026  		_sqlite3VdbeAppendP4(tls, _v, unsafe.Pointer(_1_pValue), int32(-7))
 31027  	}
 31028  _2:
 31029  	if int32(elem41((*XColumn)(_pTab.XaCol), uintptr(_i)).Xaffinity) == int32(69) {
 31030  		_sqlite3VdbeAddOp1(tls, _v, int32(74), _iReg)
 31031  	}
 31032  }
 31033  
 31034  var _sqlite3ColumnDefaultØ00__func__Ø000 [21]int8
 31035  
 31036  func init() {
 31037  	crt.Xstrncpy(nil, &_sqlite3ColumnDefaultØ00__func__Ø000[0], str(43570), 21)
 31038  }
 31039  
 31040  // C comment
 31041  //  /*
 31042  //  ** Return the database associated with the Vdbe.
 31043  //  */
 31044  func _sqlite3VdbeDb(tls *crt.TLS, _v *TVdbe) (r0 *Xsqlite3) {
 31045  	return (*Xsqlite3)(_v.Xdb)
 31046  }
 31047  
 31048  // C comment
 31049  //  /*
 31050  //  ** Create a new sqlite3_value object, containing the value of pExpr.
 31051  //  **
 31052  //  ** This only works for very simple expressions that consist of one constant
 31053  //  ** token (i.e. "5", "5.1", "'a string'"). If the expression can
 31054  //  ** be converted directly into a value, then the value is allocated and
 31055  //  ** a pointer written to *ppVal. The caller is responsible for deallocating
 31056  //  ** the value by passing it to sqlite3ValueFree() later on. If the expression
 31057  //  ** cannot be converted to a value, then *ppVal is set to NULL.
 31058  //  */
 31059  func _sqlite3ValueFromExpr(tls *crt.TLS, _db *Xsqlite3, _pExpr *XExpr, _enc uint8, _affinity uint8, _ppVal **XMem) (r0 int32) {
 31060  	return func() int32 {
 31061  		if _pExpr != nil {
 31062  			return _valueFromExpr(tls, _db, _pExpr, _enc, _affinity, _ppVal, nil)
 31063  		}
 31064  		return int32(0)
 31065  	}()
 31066  }
 31067  
 31068  // C comment
 31069  //  /*
 31070  //  ** Extract a value from the supplied expression in the manner described
 31071  //  ** above sqlite3ValueFromExpr(). Allocate the sqlite3_value object
 31072  //  ** using valueNew().
 31073  //  **
 31074  //  ** If pCtx is NULL and an error occurs after the sqlite3_value object
 31075  //  ** has been allocated, it is freed before returning. Or, if pCtx is not
 31076  //  ** NULL, it is assumed that the caller will free any allocated object
 31077  //  ** in all cases.
 31078  //  */
 31079  func _valueFromExpr(tls *crt.TLS, _db *Xsqlite3, _pExpr *XExpr, _enc uint8, _affinity uint8, _ppVal **XMem, _pCtx *t68) (r0 int32) {
 31080  	var _op, _negInt, _rc, _16_nVal int32
 31081  	var _zVal, _zNeg *int8
 31082  	var _1_aff uint8
 31083  	var _pVal *XMem
 31084  	_zVal = nil
 31085  	_pVal = nil
 31086  	_negInt = int32(1)
 31087  	_zNeg = str(284)
 31088  	_rc = int32(0)
 31089  	func() {
 31090  		if _pExpr == nil {
 31091  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70976), unsafe.Pointer(&_valueFromExprØ00__func__Ø000), unsafe.Pointer(str(43591)))
 31092  			crt.X__builtin_abort(tls)
 31093  		}
 31094  	}()
 31095  _2:
 31096  	if (store2(&_op, int32(_pExpr.Xop)) == int32(156)) || (_op == int32(162)) {
 31097  		_pExpr = (*XExpr)(_pExpr.XpLeft)
 31098  		goto _2
 31099  	}
 31100  	if func() int32 {
 31101  		if _op == int32(157) {
 31102  			return func() int32 {
 31103  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70978), unsafe.Pointer(&_valueFromExprØ00__func__Ø000), unsafe.Pointer(str(4809)))
 31104  				crt.X__builtin_abort(tls)
 31105  				return int32(1)
 31106  			}()
 31107  		}
 31108  		return int32(0)
 31109  	}() != 0 {
 31110  		_op = int32(_pExpr.Xop2)
 31111  	}
 31112  	func() {
 31113  		if (_pExpr.Xflags&uint32(16384)) != (0) && _pCtx != nil {
 31114  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70984), unsafe.Pointer(&_valueFromExprØ00__func__Ø000), unsafe.Pointer(str(43600)))
 31115  			crt.X__builtin_abort(tls)
 31116  		}
 31117  	}()
 31118  	if _op != int32(37) {
 31119  		goto _11
 31120  	}
 31121  	_1_aff = uint8(_sqlite3AffinityType(tls, *(**int8)(unsafe.Pointer(&_pExpr.Xu)), nil))
 31122  	_rc = _valueFromExpr(tls, _db, (*XExpr)(_pExpr.XpLeft), _enc, _1_aff, _ppVal, _pCtx)
 31123  	if (*_ppVal) != nil {
 31124  		_sqlite3VdbeMemCast(tls, *_ppVal, _1_aff, uint8(1))
 31125  		_sqlite3ValueApplyAffinity(tls, *_ppVal, _affinity, uint8(1))
 31126  	}
 31127  	return _rc
 31128  
 31129  _11:
 31130  	if (_op == int32(155)) && ((int32((*XExpr)(_pExpr.XpLeft).Xop) == int32(134)) || (int32((*XExpr)(_pExpr.XpLeft).Xop) == int32(132))) {
 31131  		_pExpr = (*XExpr)(_pExpr.XpLeft)
 31132  		_op = int32(_pExpr.Xop)
 31133  		_negInt = int32(-1)
 31134  		_zNeg = str(37851)
 31135  	}
 31136  	if _op != int32(97) && _op != int32(132) && _op != int32(134) {
 31137  		goto _18
 31138  	}
 31139  	_pVal = _valueNew(tls, _db, _pCtx)
 31140  	if _pVal == nil {
 31141  		goto _no_mem
 31142  	}
 31143  	if (_pExpr.Xflags & uint32(1024)) != (0) {
 31144  		_sqlite3VdbeMemSetInt64(tls, _pVal, int64(*(*int32)(unsafe.Pointer(&_pExpr.Xu)))*int64(_negInt))
 31145  		goto _21
 31146  	}
 31147  	_zVal = _sqlite3MPrintf(tls, _db, str(6791), unsafe.Pointer(_zNeg), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 31148  	if _zVal == nil {
 31149  		goto _no_mem
 31150  	}
 31151  	_sqlite3ValueSetStr(tls, _pVal, int32(-1), unsafe.Pointer(_zVal), uint8(1), func() func(*crt.TLS, unsafe.Pointer) {
 31152  		v := _sqlite3MallocSize
 31153  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
 31154  	}())
 31155  _21:
 31156  	if ((_op == int32(134)) || (_op == int32(132))) && (int32(_affinity) == int32(65)) {
 31157  		_sqlite3ValueApplyAffinity(tls, _pVal, uint8(67), uint8(1))
 31158  		goto _26
 31159  	}
 31160  	_sqlite3ValueApplyAffinity(tls, _pVal, _affinity, uint8(1))
 31161  _26:
 31162  	if (int32(_pVal.Xflags) & int32(12)) != 0 {
 31163  		{
 31164  			p := &_pVal.Xflags
 31165  			*p = uint16(int32(*p) & int32(-3))
 31166  		}
 31167  	}
 31168  	if int32(_enc) != int32(1) {
 31169  		_rc = _sqlite3VdbeChangeEncoding(tls, _pVal, int32(_enc))
 31170  	}
 31171  	goto _41
 31172  _18:
 31173  	if _op != int32(155) {
 31174  		goto _30
 31175  	}
 31176  	if int32(0) != _sqlite3ValueFromExpr(tls, _db, (*XExpr)(_pExpr.XpLeft), _enc, _affinity, &_pVal) || _pVal == nil {
 31177  		goto _32
 31178  	}
 31179  	_sqlite3VdbeMemNumerify(tls, _pVal)
 31180  	if (int32(_pVal.Xflags) & int32(8)) != 0 {
 31181  		*(*float64)(unsafe.Pointer(&_pVal.Xu)) = -(*(*float64)(unsafe.Pointer(&_pVal.Xu)))
 31182  		goto _36
 31183  	}
 31184  	if (*(*int64)(unsafe.Pointer(&_pVal.Xu))) == int64(-9223372036854775808) {
 31185  		*(*float64)(unsafe.Pointer(&_pVal.Xu)) = 9.223372036854776e+18
 31186  		_pVal.Xflags = uint16((int32(_pVal.Xflags) & int32(-49664)) | int32(8))
 31187  		goto _36
 31188  	}
 31189  	*(*int64)(unsafe.Pointer(&_pVal.Xu)) = -(*(*int64)(unsafe.Pointer(&_pVal.Xu)))
 31190  _36:
 31191  	_sqlite3ValueApplyAffinity(tls, _pVal, _affinity, _enc)
 31192  _32:
 31193  	goto _41
 31194  _30:
 31195  	if _op != int32(101) {
 31196  		goto _38
 31197  	}
 31198  	_pVal = _valueNew(tls, _db, _pCtx)
 31199  	if _pVal == nil {
 31200  		goto _no_mem
 31201  	}
 31202  	_sqlite3VdbeMemNumerify(tls, _pVal)
 31203  	goto _41
 31204  _38:
 31205  	if _op != int32(133) {
 31206  		goto _41
 31207  	}
 31208  	func() {
 31209  		if int32(*elem1(*(**int8)(unsafe.Pointer(&_pExpr.Xu)), 0)) != int32(120) && int32(*elem1(*(**int8)(unsafe.Pointer(&_pExpr.Xu)), 0)) != int32(88) {
 31210  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71051), unsafe.Pointer(&_valueFromExprØ00__func__Ø000), unsafe.Pointer(str(42516)))
 31211  			crt.X__builtin_abort(tls)
 31212  		}
 31213  	}()
 31214  	func() {
 31215  		if int32(*elem1(*(**int8)(unsafe.Pointer(&_pExpr.Xu)), uintptr(1))) != int32(39) {
 31216  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71052), unsafe.Pointer(&_valueFromExprØ00__func__Ø000), unsafe.Pointer(str(42567)))
 31217  			crt.X__builtin_abort(tls)
 31218  		}
 31219  	}()
 31220  	_pVal = _valueNew(tls, _db, _pCtx)
 31221  	if _pVal == nil {
 31222  		goto _no_mem
 31223  	}
 31224  	_zVal = elem1(*(**int8)(unsafe.Pointer(&_pExpr.Xu)), uintptr(2))
 31225  	_16_nVal = _sqlite3Strlen30(tls, _zVal) - int32(1)
 31226  	func() {
 31227  		if int32(*elem1(_zVal, uintptr(_16_nVal))) != int32(39) {
 31228  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71057), unsafe.Pointer(&_valueFromExprØ00__func__Ø000), unsafe.Pointer(str(43644)))
 31229  			crt.X__builtin_abort(tls)
 31230  		}
 31231  	}()
 31232  	_sqlite3VdbeMemSetStr(tls, _pVal, (*int8)(_sqlite3HexToBlob(tls, _db, _zVal, _16_nVal)), _16_nVal/int32(2), 0, func() func(*crt.TLS, unsafe.Pointer) {
 31233  		v := _sqlite3MallocSize
 31234  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
 31235  	}())
 31236  _41:
 31237  	*_ppVal = _pVal
 31238  	return _rc
 31239  
 31240  _no_mem:
 31241  	_sqlite3OomFault(tls, _db)
 31242  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zVal))
 31243  	func() {
 31244  		if (*_ppVal) != nil {
 31245  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71075), unsafe.Pointer(&_valueFromExprØ00__func__Ø000), unsafe.Pointer(str(43661)))
 31246  			crt.X__builtin_abort(tls)
 31247  		}
 31248  	}()
 31249  	func() {
 31250  		if _pCtx != nil {
 31251  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71079), unsafe.Pointer(&_valueFromExprØ00__func__Ø000), unsafe.Pointer(str(43671)))
 31252  			crt.X__builtin_abort(tls)
 31253  		}
 31254  	}()
 31255  	_sqlite3ValueFree(tls, _pVal)
 31256  	return _sqlite3NomemError(tls, int32(71081))
 31257  }
 31258  
 31259  var _valueFromExprØ00__func__Ø000 [14]int8
 31260  
 31261  func init() {
 31262  	crt.Xstrncpy(nil, &_valueFromExprØ00__func__Ø000[0], str(43679), 14)
 31263  }
 31264  
 31265  // C comment
 31266  //  /*
 31267  //  ** Scan the column type name zType (length nType) and return the
 31268  //  ** associated affinity type.
 31269  //  **
 31270  //  ** This routine does a case-independent search of zType for the
 31271  //  ** substrings in the following table. If one of the substrings is
 31272  //  ** found, the corresponding affinity is returned. If zType contains
 31273  //  ** more than one of the substrings, entries toward the top of
 31274  //  ** the table take priority. For example, if zType is 'BLOBINT',
 31275  //  ** SQLITE_AFF_INTEGER is returned.
 31276  //  **
 31277  //  ** Substring     | Affinity
 31278  //  ** --------------------------------
 31279  //  ** 'INT'         | SQLITE_AFF_INTEGER
 31280  //  ** 'CHAR'        | SQLITE_AFF_TEXT
 31281  //  ** 'CLOB'        | SQLITE_AFF_TEXT
 31282  //  ** 'TEXT'        | SQLITE_AFF_TEXT
 31283  //  ** 'BLOB'        | SQLITE_AFF_BLOB
 31284  //  ** 'REAL'        | SQLITE_AFF_REAL
 31285  //  ** 'FLOA'        | SQLITE_AFF_REAL
 31286  //  ** 'DOUB'        | SQLITE_AFF_REAL
 31287  //  **
 31288  //  ** If none of the substrings in the above table are found,
 31289  //  ** SQLITE_AFF_NUMERIC is returned.
 31290  //  */
 31291  func _sqlite3AffinityType(tls *crt.TLS, _zIn *int8, _pszEst *uint8) (r0 int8) {
 31292  	var _14_v int32
 31293  	var _aff int8
 31294  	var _h uint32
 31295  	var _zChar *int8
 31296  	_h = uint32(0)
 31297  	_aff = int8(67)
 31298  	_zChar = nil
 31299  	func() {
 31300  		if _zIn == nil {
 31301  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100847), unsafe.Pointer(&_sqlite3AffinityTypeØ00__func__Ø000), unsafe.Pointer(str(43693)))
 31302  			crt.X__builtin_abort(tls)
 31303  		}
 31304  	}()
 31305  _2:
 31306  	if (*elem1(_zIn, 0)) == 0 {
 31307  		goto _3
 31308  	}
 31309  	_h = (_h << 8) + uint32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(int32(*_zIn)&int32(255))))
 31310  	*(*uintptr)(unsafe.Pointer(&_zIn)) += uintptr(1)
 31311  	if _h == uint32(1667785074) {
 31312  		_aff = int8(66)
 31313  		_zChar = _zIn
 31314  		goto _24
 31315  	}
 31316  	if _h == uint32(1668050786) {
 31317  		_aff = int8(66)
 31318  		goto _24
 31319  	}
 31320  	if _h == uint32(1952807028) {
 31321  		_aff = int8(66)
 31322  		goto _24
 31323  	}
 31324  	if _h != uint32(1651273570) || int32(_aff) != int32(67) && int32(_aff) != int32(69) {
 31325  		goto _12
 31326  	}
 31327  	_aff = int8(65)
 31328  	if int32(*elem1(_zIn, 0)) == int32(40) {
 31329  		_zChar = _zIn
 31330  	}
 31331  	goto _24
 31332  _12:
 31333  	if (_h == uint32(1919246700)) && (int32(_aff) == int32(67)) {
 31334  		_aff = int8(69)
 31335  		goto _24
 31336  	}
 31337  	if (_h == uint32(1718382433)) && (int32(_aff) == int32(67)) {
 31338  		_aff = int8(69)
 31339  		goto _24
 31340  	}
 31341  	if (_h == uint32(1685026146)) && (int32(_aff) == int32(67)) {
 31342  		_aff = int8(69)
 31343  		goto _24
 31344  	}
 31345  	if (_h & uint32(16777215)) == uint32(6909556) {
 31346  		_aff = int8(68)
 31347  		goto _3
 31348  	}
 31349  _24:
 31350  	goto _2
 31351  _3:
 31352  	if _pszEst == nil {
 31353  		goto _25
 31354  	}
 31355  	*_pszEst = uint8(1)
 31356  	if int32(_aff) >= int32(67) {
 31357  		goto _26
 31358  	}
 31359  	if _zChar == nil {
 31360  		goto _27
 31361  	}
 31362  _28:
 31363  	if (*elem1(_zChar, 0)) == 0 {
 31364  		goto _29
 31365  	}
 31366  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_zChar, 0))))) & int32(4)) == 0 {
 31367  		goto _30
 31368  	}
 31369  	_14_v = int32(0)
 31370  	_sqlite3GetInt32(tls, _zChar, &_14_v)
 31371  	_14_v = (_14_v / int32(4)) + int32(1)
 31372  	if _14_v > int32(255) {
 31373  		_14_v = int32(255)
 31374  	}
 31375  	*_pszEst = uint8(_14_v)
 31376  	goto _29
 31377  _30:
 31378  	*(*uintptr)(unsafe.Pointer(&_zChar)) += uintptr(1)
 31379  	goto _28
 31380  _29:
 31381  	goto _32
 31382  _27:
 31383  	*_pszEst = uint8(5)
 31384  _32:
 31385  _26:
 31386  _25:
 31387  	return _aff
 31388  }
 31389  
 31390  var _sqlite3AffinityTypeØ00__func__Ø000 [20]int8
 31391  
 31392  func init() {
 31393  	crt.Xstrncpy(nil, &_sqlite3AffinityTypeØ00__func__Ø000[0], str(43700), 20)
 31394  }
 31395  
 31396  // C comment
 31397  //  /*
 31398  //  ** If zNum represents an integer that will fit in 32-bits, then set
 31399  //  ** *pValue to that integer and return true.  Otherwise return false.
 31400  //  **
 31401  //  ** This routine accepts both decimal and hexadecimal notation for integers.
 31402  //  **
 31403  //  ** Any non-numeric characters that following zNum are ignored.
 31404  //  ** This is different from sqlite3Atoi64() which requires the
 31405  //  ** input number to be zero-terminated.
 31406  //  */
 31407  func _sqlite3GetInt32(tls *crt.TLS, _zNum *int8, _pValue *int32) (r0 int32) {
 31408  	var _i, _c, _neg int32
 31409  	var _v int64
 31410  	var _3_u uint32
 31411  	_v = int64(0)
 31412  	_neg = int32(0)
 31413  	if int32(*elem1(_zNum, 0)) == int32(45) {
 31414  		_neg = int32(1)
 31415  		*(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(1)
 31416  		goto _7
 31417  	}
 31418  	if int32(*elem1(_zNum, 0)) == int32(43) {
 31419  		*(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(1)
 31420  		goto _7
 31421  	}
 31422  	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 {
 31423  		goto _7
 31424  	}
 31425  	_3_u = uint32(0)
 31426  	*(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(int32(2))
 31427  _8:
 31428  	if int32(*elem1(_zNum, 0)) == int32(48) {
 31429  		*(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(1)
 31430  		goto _8
 31431  	}
 31432  	_i = int32(0)
 31433  _10:
 31434  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_zNum, uintptr(_i))))))&int32(8)) == 0 || _i >= int32(8) {
 31435  		goto _14
 31436  	}
 31437  	_3_u = (_3_u * uint32(16)) + uint32(_sqlite3HexToInt(tls, int32(*elem1(_zNum, uintptr(_i)))))
 31438  	_i += 1
 31439  	goto _10
 31440  _14:
 31441  	if ((_3_u & uint32(2147483648)) == (0)) && ((int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_zNum, uintptr(_i)))))) & int32(8)) == int32(0)) {
 31442  		crt.Xmemcpy(tls, unsafe.Pointer(_pValue), unsafe.Pointer(&_3_u), uint32(4))
 31443  		return int32(1)
 31444  	}
 31445  	return int32(0)
 31446  
 31447  _7:
 31448  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_zNum, 0))))) & int32(4)) == 0 {
 31449  		return int32(0)
 31450  	}
 31451  _18:
 31452  	if int32(*elem1(_zNum, 0)) == int32(48) {
 31453  		*(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(1)
 31454  		goto _18
 31455  	}
 31456  	_i = int32(0)
 31457  _21:
 31458  	if _i >= int32(11) || store2(&_c, int32(*elem1(_zNum, uintptr(_i)))-int32(48)) < int32(0) || _c > int32(9) {
 31459  		goto _26
 31460  	}
 31461  	_v = (_v * int64(10)) + int64(_c)
 31462  	_i += 1
 31463  	goto _21
 31464  _26:
 31465  	if _i > int32(10) {
 31466  		return int32(0)
 31467  	}
 31468  	if (_v - int64(_neg)) > int64(2147483647) {
 31469  		return int32(0)
 31470  	}
 31471  	if _neg != 0 {
 31472  		_v = -_v
 31473  	}
 31474  	*_pValue = int32(_v)
 31475  	return int32(1)
 31476  }
 31477  
 31478  // C comment
 31479  //  /*
 31480  //  ** Translate a single byte of Hex into an integer.
 31481  //  ** This routine only works if h really is a valid hexadecimal
 31482  //  ** character:  0..9a..fA..F
 31483  //  */
 31484  func _sqlite3HexToInt(tls *crt.TLS, _h int32) (r0 uint8) {
 31485  	func() {
 31486  		if (_h < int32(48) || _h > int32(57)) && (_h < int32(97) || _h > int32(102)) && (_h < int32(65) || _h > int32(70)) {
 31487  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(28838), unsafe.Pointer(&_sqlite3HexToIntØ00__func__Ø000), unsafe.Pointer(str(43720)))
 31488  			crt.X__builtin_abort(tls)
 31489  		}
 31490  	}()
 31491  	_h += int32(9) * (int32(1) & (_h >> 6))
 31492  	return uint8(_h & int32(15))
 31493  }
 31494  
 31495  var _sqlite3HexToIntØ00__func__Ø000 [16]int8
 31496  
 31497  func init() {
 31498  	crt.Xstrncpy(nil, &_sqlite3HexToIntØ00__func__Ø000[0], str(43783), 16)
 31499  }
 31500  
 31501  // C comment
 31502  //  /*
 31503  //  ** Cast the datatype of the value in pMem according to the affinity
 31504  //  ** "aff".  Casting is different from applying affinity in that a cast
 31505  //  ** is forced.  In other words, the value is converted into the desired
 31506  //  ** affinity even if that results in loss of data.  This routine is
 31507  //  ** used (for example) to implement the SQL "cast()" operator.
 31508  //  */
 31509  func _sqlite3VdbeMemCast(tls *crt.TLS, _pMem *XMem, _aff uint8, _encoding uint8) {
 31510  	if (int32(_pMem.Xflags) & int32(1)) != 0 {
 31511  		return
 31512  	}
 31513  	switch int32(_aff) {
 31514  	case int32(65):
 31515  		goto _2
 31516  	case int32(67):
 31517  		goto _3
 31518  	case int32(68):
 31519  		goto _4
 31520  	case int32(69):
 31521  		goto _5
 31522  	default:
 31523  		goto _6
 31524  	}
 31525  
 31526  _2:
 31527  	if (int32(_pMem.Xflags) & int32(16)) != int32(0) {
 31528  		goto _7
 31529  	}
 31530  	_sqlite3ValueApplyAffinity(tls, _pMem, uint8(66), _encoding)
 31531  	func() {
 31532  		if (int32(_pMem.Xflags)&int32(2)) == 0 && ((*Xsqlite3)(_pMem.Xdb).XmallocFailed) == 0 {
 31533  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70304), unsafe.Pointer(&_sqlite3VdbeMemCastØ00__func__Ø000), unsafe.Pointer(str(43799)))
 31534  			crt.X__builtin_abort(tls)
 31535  		}
 31536  	}()
 31537  	if (int32(_pMem.Xflags) & int32(2)) != 0 {
 31538  		_pMem.Xflags = uint16((int32(_pMem.Xflags) & int32(-49664)) | int32(16))
 31539  	}
 31540  	goto _12
 31541  _7:
 31542  	{
 31543  		p := &_pMem.Xflags
 31544  		*p = uint16(int32(*p) & int32(-33264))
 31545  	}
 31546  _12:
 31547  	goto _13
 31548  _3:
 31549  	_sqlite3VdbeMemNumerify(tls, _pMem)
 31550  	goto _13
 31551  _4:
 31552  	_sqlite3VdbeMemIntegerify(tls, _pMem)
 31553  	goto _13
 31554  _5:
 31555  	_sqlite3VdbeMemRealify(tls, _pMem)
 31556  	goto _13
 31557  _6:
 31558  	func() {
 31559  		if int32(_aff) != int32(66) {
 31560  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70324), unsafe.Pointer(&_sqlite3VdbeMemCastØ00__func__Ø000), unsafe.Pointer(str(43847)))
 31561  			crt.X__builtin_abort(tls)
 31562  		}
 31563  	}()
 31564  
 31565  	{
 31566  		p := &_pMem.Xflags
 31567  		*p = uint16(int32(*p) | ((int32(_pMem.Xflags) & int32(16)) >> 3))
 31568  	}
 31569  	_sqlite3ValueApplyAffinity(tls, _pMem, uint8(66), _encoding)
 31570  	func() {
 31571  		if (int32(_pMem.Xflags)&int32(2)) == 0 && ((*Xsqlite3)(_pMem.Xdb).XmallocFailed) == 0 {
 31572  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70328), unsafe.Pointer(&_sqlite3VdbeMemCastØ00__func__Ø000), unsafe.Pointer(str(43799)))
 31573  			crt.X__builtin_abort(tls)
 31574  		}
 31575  	}()
 31576  	{
 31577  		p := &_pMem.Xflags
 31578  		*p = uint16(int32(*p) & int32(-16413))
 31579  	}
 31580  	goto _13
 31581  _13:
 31582  }
 31583  
 31584  // C comment
 31585  //  /*
 31586  //  ** Exported version of applyAffinity(). This one works on sqlite3_value*,
 31587  //  ** not the internal Mem* type.
 31588  //  */
 31589  func _sqlite3ValueApplyAffinity(tls *crt.TLS, _pVal *XMem, _affinity uint8, _enc uint8) {
 31590  	_applyAffinity(tls, _pVal, int8(_affinity), _enc)
 31591  }
 31592  
 31593  // C comment
 31594  //  /*
 31595  //  ** Processing is determine by the affinity parameter:
 31596  //  **
 31597  //  ** SQLITE_AFF_INTEGER:
 31598  //  ** SQLITE_AFF_REAL:
 31599  //  ** SQLITE_AFF_NUMERIC:
 31600  //  **    Try to convert pRec to an integer representation or a
 31601  //  **    floating-point representation if an integer representation
 31602  //  **    is not possible.  Note that the integer representation is
 31603  //  **    always preferred, even if the affinity is REAL, because
 31604  //  **    an integer representation is more space efficient on disk.
 31605  //  **
 31606  //  ** SQLITE_AFF_TEXT:
 31607  //  **    Convert pRec to a text representation.
 31608  //  **
 31609  //  ** SQLITE_AFF_BLOB:
 31610  //  **    No-op.  pRec is unchanged.
 31611  //  */
 31612  func _applyAffinity(tls *crt.TLS, _pRec *XMem, _affinity int8, _enc uint8) {
 31613  	if int32(_affinity) < int32(67) {
 31614  		goto _0
 31615  	}
 31616  	func() {
 31617  		if int32(_affinity) != int32(68) && int32(_affinity) != int32(69) && int32(_affinity) != int32(67) {
 31618  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78494), unsafe.Pointer(&_applyAffinityØ00__func__Ø000), unsafe.Pointer(str(43868)))
 31619  			crt.X__builtin_abort(tls)
 31620  		}
 31621  	}()
 31622  	if (int32(_pRec.Xflags) & int32(4)) != int32(0) {
 31623  		goto _5
 31624  	}
 31625  	if (int32(_pRec.Xflags) & int32(8)) != int32(0) {
 31626  		goto _6
 31627  	}
 31628  	if (int32(_pRec.Xflags) & int32(2)) != 0 {
 31629  		_applyNumericAffinity(tls, _pRec, int32(1))
 31630  	}
 31631  	goto _8
 31632  _6:
 31633  	_sqlite3VdbeIntegerAffinity(tls, _pRec)
 31634  _8:
 31635  _5:
 31636  	goto _10
 31637  _0:
 31638  	if int32(_affinity) != int32(66) {
 31639  		goto _10
 31640  	}
 31641  	if int32(0) != (int32(_pRec.Xflags) & int32(2)) {
 31642  		goto _11
 31643  	}
 31644  	if (int32(_pRec.Xflags) & int32(12)) != 0 {
 31645  		_sqlite3VdbeMemStringify(tls, _pRec, _enc, uint8(1))
 31646  	}
 31647  _11:
 31648  	{
 31649  		p := &_pRec.Xflags
 31650  		*p = uint16(int32(*p) & int32(-13))
 31651  	}
 31652  _10:
 31653  }
 31654  
 31655  var _applyAffinityØ00__func__Ø000 [14]int8
 31656  
 31657  func init() {
 31658  	crt.Xstrncpy(nil, &_applyAffinityØ00__func__Ø000[0], str(43958), 14)
 31659  }
 31660  
 31661  // C comment
 31662  //  /*
 31663  //  ** Try to convert a value into a numeric representation if we can
 31664  //  ** do so without loss of information.  In other words, if the string
 31665  //  ** looks like a number, convert it into a number.  If it does not
 31666  //  ** look like a number, leave it alone.
 31667  //  **
 31668  //  ** If the bTryForInt flag is true, then extra effort is made to give
 31669  //  ** an integer representation.  Strings that look like floating point
 31670  //  ** values but which have no fractional component (example: '48.00')
 31671  //  ** will have a MEM_Int representation when bTryForInt is true.
 31672  //  **
 31673  //  ** If bTryForInt is false, then if the input string contains a decimal
 31674  //  ** point or exponential notation, the result is only MEM_Real, even
 31675  //  ** if there is an exact integer representation of the quantity.
 31676  //  */
 31677  func _applyNumericAffinity(tls *crt.TLS, _pRec *XMem, _bTryForInt int32) {
 31678  	var _iValue int64
 31679  	var _rValue float64
 31680  	var _enc uint8
 31681  	_enc = _pRec.Xenc
 31682  	func() {
 31683  		if (int32(_pRec.Xflags) & int32(14)) != int32(2) {
 31684  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78458), unsafe.Pointer(&_applyNumericAffinityØ00__func__Ø000), unsafe.Pointer(str(43972)))
 31685  			crt.X__builtin_abort(tls)
 31686  		}
 31687  	}()
 31688  	if _sqlite3AtoF(tls, _pRec.Xz, &_rValue, _pRec.Xn, _enc) == int32(0) {
 31689  		return
 31690  	}
 31691  	if int32(0) == _sqlite3Atoi64(tls, _pRec.Xz, &_iValue, _pRec.Xn, _enc) {
 31692  		*(*int64)(unsafe.Pointer(&_pRec.Xu)) = _iValue
 31693  		{
 31694  			p := &_pRec.Xflags
 31695  			*p = uint16(int32(*p) | int32(4))
 31696  		}
 31697  		goto _4
 31698  	}
 31699  	*(*float64)(unsafe.Pointer(&_pRec.Xu)) = _rValue
 31700  	{
 31701  		p := &_pRec.Xflags
 31702  		*p = uint16(int32(*p) | int32(8))
 31703  	}
 31704  	if _bTryForInt != 0 {
 31705  		_sqlite3VdbeIntegerAffinity(tls, _pRec)
 31706  	}
 31707  _4:
 31708  }
 31709  
 31710  var _applyNumericAffinityØ00__func__Ø000 [21]int8
 31711  
 31712  func init() {
 31713  	crt.Xstrncpy(nil, &_applyNumericAffinityØ00__func__Ø000[0], str(44024), 21)
 31714  }
 31715  
 31716  // C comment
 31717  //  /*
 31718  //  ** The MEM structure is already a MEM_Real.  Try to also make it a
 31719  //  ** MEM_Int if we can.
 31720  //  */
 31721  func _sqlite3VdbeIntegerAffinity(tls *crt.TLS, _pMem *XMem) {
 31722  	var _ix int64
 31723  	func() {
 31724  		if (int32(_pMem.Xflags) & int32(8)) == 0 {
 31725  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70217), unsafe.Pointer(&_sqlite3VdbeIntegerAffinityØ00__func__Ø000), unsafe.Pointer(str(44045)))
 31726  			crt.X__builtin_abort(tls)
 31727  		}
 31728  	}()
 31729  	func() {
 31730  		if (int32(_pMem.Xflags) & int32(32)) != int32(0) {
 31731  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70218), unsafe.Pointer(&_sqlite3VdbeIntegerAffinityØ00__func__Ø000), unsafe.Pointer(str(6629)))
 31732  			crt.X__builtin_abort(tls)
 31733  		}
 31734  	}()
 31735  	func() {
 31736  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
 31737  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70219), unsafe.Pointer(&_sqlite3VdbeIntegerAffinityØ00__func__Ø000), unsafe.Pointer(str(4568)))
 31738  			crt.X__builtin_abort(tls)
 31739  		}
 31740  	}()
 31741  	func() {
 31742  		if (int32(uintptr(unsafe.Pointer(_pMem))) & int32(7)) != int32(0) {
 31743  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70220), unsafe.Pointer(&_sqlite3VdbeIntegerAffinityØ00__func__Ø000), unsafe.Pointer(str(6222)))
 31744  			crt.X__builtin_abort(tls)
 31745  		}
 31746  	}()
 31747  	_ix = _doubleToInt64(tls, *(*float64)(unsafe.Pointer(&_pMem.Xu)))
 31748  	if (((*(*float64)(unsafe.Pointer(&_pMem.Xu))) == float64(_ix)) && (_ix > int64(-9223372036854775808))) && (_ix < int64(9223372036854775807)) {
 31749  		*(*int64)(unsafe.Pointer(&_pMem.Xu)) = _ix
 31750  		_pMem.Xflags = uint16((int32(_pMem.Xflags) & int32(-49664)) | int32(4))
 31751  	}
 31752  }
 31753  
 31754  var _sqlite3VdbeIntegerAffinityØ00__func__Ø000 [27]int8
 31755  
 31756  func init() {
 31757  	crt.Xstrncpy(nil, &_sqlite3VdbeIntegerAffinityØ00__func__Ø000[0], str(44068), 27)
 31758  }
 31759  
 31760  var _sqlite3VdbeMemCastØ00__func__Ø000 [19]int8
 31761  
 31762  func init() {
 31763  	crt.Xstrncpy(nil, &_sqlite3VdbeMemCastØ00__func__Ø000[0], str(44095), 19)
 31764  }
 31765  
 31766  // C comment
 31767  //  /*
 31768  //  ** Convert pMem so that it has types MEM_Real or MEM_Int or both.
 31769  //  ** Invalidate any prior representations.
 31770  //  **
 31771  //  ** Every effort is made to force the conversion, even if the input
 31772  //  ** is a string that does not look completely like a number.  Convert
 31773  //  ** as much of the string as we can and ignore the rest.
 31774  //  */
 31775  func _sqlite3VdbeMemNumerify(tls *crt.TLS, _pMem *XMem) (r0 int32) {
 31776  	if (int32(_pMem.Xflags) & int32(13)) != int32(0) {
 31777  		goto _0
 31778  	}
 31779  	func() {
 31780  		if (int32(_pMem.Xflags) & int32(18)) == int32(0) {
 31781  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70276), unsafe.Pointer(&_sqlite3VdbeMemNumerifyØ00__func__Ø000), unsafe.Pointer(str(44114)))
 31782  			crt.X__builtin_abort(tls)
 31783  		}
 31784  	}()
 31785  	func() {
 31786  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
 31787  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70277), unsafe.Pointer(&_sqlite3VdbeMemNumerifyØ00__func__Ø000), unsafe.Pointer(str(4568)))
 31788  			crt.X__builtin_abort(tls)
 31789  		}
 31790  	}()
 31791  	if int32(0) == _sqlite3Atoi64(tls, _pMem.Xz, (*int64)(unsafe.Pointer(&_pMem.Xu)), _pMem.Xn, _pMem.Xenc) {
 31792  		_pMem.Xflags = uint16((int32(_pMem.Xflags) & int32(-49664)) | int32(4))
 31793  		goto _7
 31794  	}
 31795  	*(*float64)(unsafe.Pointer(&_pMem.Xu)) = _sqlite3VdbeRealValue(tls, _pMem)
 31796  	_pMem.Xflags = uint16((int32(_pMem.Xflags) & int32(-49664)) | int32(8))
 31797  	_sqlite3VdbeIntegerAffinity(tls, _pMem)
 31798  _7:
 31799  _0:
 31800  	func() {
 31801  		if (int32(_pMem.Xflags) & int32(13)) == int32(0) {
 31802  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70286), unsafe.Pointer(&_sqlite3VdbeMemNumerifyØ00__func__Ø000), unsafe.Pointer(str(44152)))
 31803  			crt.X__builtin_abort(tls)
 31804  		}
 31805  	}()
 31806  	{
 31807  		p := &_pMem.Xflags
 31808  		*p = uint16(int32(*p) & int32(-16403))
 31809  	}
 31810  	return int32(0)
 31811  }
 31812  
 31813  var _sqlite3VdbeMemNumerifyØ00__func__Ø000 [23]int8
 31814  
 31815  func init() {
 31816  	crt.Xstrncpy(nil, &_sqlite3VdbeMemNumerifyØ00__func__Ø000[0], str(44199), 23)
 31817  }
 31818  
 31819  // C comment
 31820  //  /*
 31821  //  ** Convert pMem to type integer.  Invalidate any prior representations.
 31822  //  */
 31823  func _sqlite3VdbeMemIntegerify(tls *crt.TLS, _pMem *XMem) (r0 int32) {
 31824  	func() {
 31825  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
 31826  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70244), unsafe.Pointer(&_sqlite3VdbeMemIntegerifyØ00__func__Ø000), unsafe.Pointer(str(4568)))
 31827  			crt.X__builtin_abort(tls)
 31828  		}
 31829  	}()
 31830  	func() {
 31831  		if (int32(_pMem.Xflags) & int32(32)) != int32(0) {
 31832  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70245), unsafe.Pointer(&_sqlite3VdbeMemIntegerifyØ00__func__Ø000), unsafe.Pointer(str(6629)))
 31833  			crt.X__builtin_abort(tls)
 31834  		}
 31835  	}()
 31836  	func() {
 31837  		if (int32(uintptr(unsafe.Pointer(_pMem))) & int32(7)) != int32(0) {
 31838  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70246), unsafe.Pointer(&_sqlite3VdbeMemIntegerifyØ00__func__Ø000), unsafe.Pointer(str(6222)))
 31839  			crt.X__builtin_abort(tls)
 31840  		}
 31841  	}()
 31842  	*(*int64)(unsafe.Pointer(&_pMem.Xu)) = _sqlite3VdbeIntValue(tls, _pMem)
 31843  	_pMem.Xflags = uint16((int32(_pMem.Xflags) & int32(-49664)) | int32(4))
 31844  	return int32(0)
 31845  }
 31846  
 31847  var _sqlite3VdbeMemIntegerifyØ00__func__Ø000 [25]int8
 31848  
 31849  func init() {
 31850  	crt.Xstrncpy(nil, &_sqlite3VdbeMemIntegerifyØ00__func__Ø000[0], str(44222), 25)
 31851  }
 31852  
 31853  // C comment
 31854  //  /*
 31855  //  ** Convert pMem so that it is of type MEM_Real.
 31856  //  ** Invalidate any prior representations.
 31857  //  */
 31858  func _sqlite3VdbeMemRealify(tls *crt.TLS, _pMem *XMem) (r0 int32) {
 31859  	func() {
 31860  		if (*Xsqlite3)(_pMem.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.Xdb).Xmutex)) == 0 {
 31861  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70258), unsafe.Pointer(&_sqlite3VdbeMemRealifyØ00__func__Ø000), unsafe.Pointer(str(4568)))
 31862  			crt.X__builtin_abort(tls)
 31863  		}
 31864  	}()
 31865  	func() {
 31866  		if (int32(uintptr(unsafe.Pointer(_pMem))) & int32(7)) != int32(0) {
 31867  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70259), unsafe.Pointer(&_sqlite3VdbeMemRealifyØ00__func__Ø000), unsafe.Pointer(str(6222)))
 31868  			crt.X__builtin_abort(tls)
 31869  		}
 31870  	}()
 31871  	*(*float64)(unsafe.Pointer(&_pMem.Xu)) = _sqlite3VdbeRealValue(tls, _pMem)
 31872  	_pMem.Xflags = uint16((int32(_pMem.Xflags) & int32(-49664)) | int32(8))
 31873  	return int32(0)
 31874  }
 31875  
 31876  var _sqlite3VdbeMemRealifyØ00__func__Ø000 [22]int8
 31877  
 31878  func init() {
 31879  	crt.Xstrncpy(nil, &_sqlite3VdbeMemRealifyØ00__func__Ø000[0], str(44247), 22)
 31880  }
 31881  
 31882  // C comment
 31883  //  /*
 31884  //  ** Allocate and return a pointer to a new sqlite3_value object. If
 31885  //  ** the second argument to this function is NULL, the object is allocated
 31886  //  ** by calling sqlite3ValueNew().
 31887  //  **
 31888  //  ** Otherwise, if the second argument is non-zero, then this function is
 31889  //  ** being called indirectly by sqlite3Stat4ProbeSetValue(). If it has not
 31890  //  ** already been allocated, allocate the UnpackedRecord structure that
 31891  //  ** that function will return to its caller here. Then return a pointer to
 31892  //  ** an sqlite3_value within the UnpackedRecord.a[] array.
 31893  //  */
 31894  func _valueNew(tls *crt.TLS, _db *Xsqlite3, _p *t68) (r0 *XMem) {
 31895  	return _sqlite3ValueNew(tls, _db)
 31896  }
 31897  
 31898  // C comment
 31899  //  /*
 31900  //  ** Convert a BLOB literal of the form "x'hhhhhh'" into its binary
 31901  //  ** value.  Return a pointer to its binary value.  Space to hold the
 31902  //  ** binary value has been obtained from malloc and must be freed by
 31903  //  ** the calling routine.
 31904  //  */
 31905  func _sqlite3HexToBlob(tls *crt.TLS, _db *Xsqlite3, _z *int8, _n int32) (r0 unsafe.Pointer) {
 31906  	var _i int32
 31907  	var _zBlob *int8
 31908  	_zBlob = (*int8)(_sqlite3DbMallocRawNN(tls, _db, uint64((_n/int32(2))+int32(1))))
 31909  	_n -= 1
 31910  	if _zBlob == nil {
 31911  		goto _0
 31912  	}
 31913  	_i = int32(0)
 31914  _1:
 31915  	if _i >= _n {
 31916  		goto _4
 31917  	}
 31918  	*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)))))))
 31919  	_i += int32(2)
 31920  	goto _1
 31921  _4:
 31922  	*elem1(_zBlob, uintptr(_i/int32(2))) = 0
 31923  _0:
 31924  	return unsafe.Pointer(_zBlob)
 31925  }
 31926  
 31927  func _sqlite3VdbeAddOp1(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32) (r0 int32) {
 31928  	return _sqlite3VdbeAddOp3(tls, _p, _op, _p1, int32(0), int32(0))
 31929  }
 31930  
 31931  // C comment
 31932  //  /*
 31933  //  ** Record in the column cache that a particular column from a
 31934  //  ** particular table is stored in a particular register.
 31935  //  */
 31936  func _sqlite3ExprCacheStore(tls *crt.TLS, _pParse *XParse, _iTab int32, _iCol int32, _iReg int32) {
 31937  	var _i, _minLru, _idxLru int32
 31938  	var _p *TyColCache
 31939  	func() {
 31940  		if _iReg <= int32(0) && _pParse.XnErr == 0 && ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == 0 {
 31941  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94005), unsafe.Pointer(&_sqlite3ExprCacheStoreØ00__func__Ø000), unsafe.Pointer(str(44269)))
 31942  			crt.X__builtin_abort(tls)
 31943  		}
 31944  	}()
 31945  	func() {
 31946  		if _iCol < int32(-1) || _iCol >= int32(32768) {
 31947  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94006), unsafe.Pointer(&_sqlite3ExprCacheStoreØ00__func__Ø000), unsafe.Pointer(str(44320)))
 31948  			crt.X__builtin_abort(tls)
 31949  		}
 31950  	}()
 31951  	if (int32((*Xsqlite3)(_pParse.Xdb).XdbOptFlags) & int32(2)) != int32(0) {
 31952  		return
 31953  	}
 31954  	*func() **TyColCache { _i = int32(0); return &_p }() = (*TyColCache)(unsafe.Pointer(&_pParse.XaColCache))
 31955  _8:
 31956  	if _i >= int32(_pParse.XnColCache) {
 31957  		goto _11
 31958  	}
 31959  	func() {
 31960  		if _p.XiTable == _iTab && int32(_p.XiColumn) == _iCol {
 31961  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94021), unsafe.Pointer(&_sqlite3ExprCacheStoreØ00__func__Ø000), unsafe.Pointer(str(44343)))
 31962  			crt.X__builtin_abort(tls)
 31963  		}
 31964  	}()
 31965  	*(*uintptr)(unsafe.Pointer(func() **TyColCache { _i += 1; return &_p }())) += uintptr(20)
 31966  	goto _8
 31967  _11:
 31968  	if int32(_pParse.XnColCache) < int32(10) {
 31969  		goto _15
 31970  	}
 31971  	_minLru = int32(2147483647)
 31972  	_idxLru = int32(-1)
 31973  	*func() **TyColCache { _i = int32(0); return &_p }() = (*TyColCache)(unsafe.Pointer(&_pParse.XaColCache))
 31974  _16:
 31975  	if _i >= int32(10) {
 31976  		goto _19
 31977  	}
 31978  	if _p.Xlru < _minLru {
 31979  		_idxLru = _i
 31980  		_minLru = _p.Xlru
 31981  	}
 31982  	*(*uintptr)(unsafe.Pointer(func() **TyColCache { _i += 1; return &_p }())) += uintptr(20)
 31983  	goto _16
 31984  _19:
 31985  	_p = elem69((*TyColCache)(unsafe.Pointer(&_pParse.XaColCache)), uintptr(_idxLru))
 31986  	goto _21
 31987  _15:
 31988  	_p = elem69((*TyColCache)(unsafe.Pointer(&_pParse.XaColCache)), uintptr(postInc3(&_pParse.XnColCache, byte(1))))
 31989  _21:
 31990  	_p.XiLevel = _pParse.XiCacheLevel
 31991  	_p.XiTable = _iTab
 31992  	_p.XiColumn = int16(_iCol)
 31993  	_p.XiReg = _iReg
 31994  	_p.XtempReg = 0
 31995  	_p.Xlru = postInc2(&_pParse.XiCacheCnt, 1)
 31996  }
 31997  
 31998  var _sqlite3ExprCacheStoreØ00__func__Ø000 [22]int8
 31999  
 32000  func init() {
 32001  	crt.Xstrncpy(nil, &_sqlite3ExprCacheStoreØ00__func__Ø000[0], str(44379), 22)
 32002  }
 32003  
 32004  // C comment
 32005  //  /*
 32006  //  ** Generate an instruction that will put the integer describe by
 32007  //  ** text z[0..n-1] into register iMem.
 32008  //  **
 32009  //  ** Expr.u.zToken is always UTF8 and zero-terminated.
 32010  //  */
 32011  func _codeInteger(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _negFlag int32, _iMem int32) {
 32012  	var _1_i, _2_c int32
 32013  	var _2_value int64
 32014  	var _2_z *int8
 32015  	var _v *TVdbe
 32016  	_v = (*TVdbe)(_pParse.XpVdbe)
 32017  	if (_pExpr.Xflags & uint32(1024)) == 0 {
 32018  		goto _0
 32019  	}
 32020  	_1_i = *(*int32)(unsafe.Pointer(&_pExpr.Xu))
 32021  	func() {
 32022  		if _1_i < int32(0) {
 32023  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93949), unsafe.Pointer(&_codeIntegerØ00__func__Ø000), unsafe.Pointer(str(44401)))
 32024  			crt.X__builtin_abort(tls)
 32025  		}
 32026  	}()
 32027  	if _negFlag != 0 {
 32028  		_1_i = -_1_i
 32029  	}
 32030  	_sqlite3VdbeAddOp2(tls, _v, int32(56), _1_i, _iMem)
 32031  	goto _4
 32032  _0:
 32033  	_2_z = *(**int8)(unsafe.Pointer(&_pExpr.Xu))
 32034  	func() {
 32035  		if _2_z == nil {
 32036  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93956), unsafe.Pointer(&_codeIntegerØ00__func__Ø000), unsafe.Pointer(str(44406)))
 32037  			crt.X__builtin_abort(tls)
 32038  		}
 32039  	}()
 32040  	_2_c = _sqlite3DecOrHexToI64(tls, _2_z, &_2_value)
 32041  	if _2_c != int32(1) && (_2_c != int32(2) || _negFlag != 0) && (_negFlag == 0 || _2_value != int64(-9223372036854775808)) {
 32042  		goto _11
 32043  	}
 32044  	if Xsqlite3_strnicmp(tls, _2_z, str(44411), int32(2)) == int32(0) {
 32045  		_sqlite3ErrorMsg(tls, _pParse, str(44414), unsafe.Pointer(func() *int8 {
 32046  			if _negFlag != 0 {
 32047  				return str(37851)
 32048  			}
 32049  			return str(284)
 32050  		}()), unsafe.Pointer(_2_z))
 32051  		goto _15
 32052  	}
 32053  	_codeReal(tls, _v, _2_z, _negFlag, _iMem)
 32054  _15:
 32055  	goto _16
 32056  _11:
 32057  	if _negFlag != 0 {
 32058  		_2_value = func() int64 {
 32059  			if _2_c == int32(2) {
 32060  				return int64(-9223372036854775808)
 32061  			}
 32062  			return (-_2_value)
 32063  		}()
 32064  	}
 32065  	_sqlite3VdbeAddOp4Dup8(tls, _v, int32(57), int32(0), _iMem, int32(0), (*uint8)(unsafe.Pointer(&_2_value)), int32(-10))
 32066  _16:
 32067  _4:
 32068  }
 32069  
 32070  var _codeIntegerØ00__func__Ø000 [12]int8
 32071  
 32072  func init() {
 32073  	crt.Xstrncpy(nil, &_codeIntegerØ00__func__Ø000[0], str(44440), 12)
 32074  }
 32075  
 32076  // C comment
 32077  //  /*
 32078  //  ** Transform a UTF-8 integer literal, in either decimal or hexadecimal,
 32079  //  ** into a 64-bit signed integer.  This routine accepts hexadecimal literals,
 32080  //  ** whereas sqlite3Atoi64() does not.
 32081  //  **
 32082  //  ** Returns:
 32083  //  **
 32084  //  **     0    Successful transformation.  Fits in a 64-bit signed integer.
 32085  //  **     1    Integer too large for a 64-bit signed integer or is malformed
 32086  //  **     2    Special case of 9223372036854775808
 32087  //  */
 32088  func _sqlite3DecOrHexToI64(tls *crt.TLS, _z *int8, _pOut *int64) (r0 int32) {
 32089  	var _1_i, _1_k int32
 32090  	var _1_u uint64
 32091  	if int32(*elem1(_z, 0)) != int32(48) || int32(*elem1(_z, uintptr(1))) != int32(120) && int32(*elem1(_z, uintptr(1))) != int32(88) {
 32092  		goto _2
 32093  	}
 32094  	_1_u = uint64(0)
 32095  	_1_i = int32(2)
 32096  _3:
 32097  	if int32(*elem1(_z, uintptr(_1_i))) != int32(48) {
 32098  		goto _6
 32099  	}
 32100  	_1_i += 1
 32101  	goto _3
 32102  _6:
 32103  	_1_k = _1_i
 32104  _7:
 32105  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_z, uintptr(_1_k)))))) & int32(8)) == 0 {
 32106  		goto _10
 32107  	}
 32108  	_1_u = (_1_u * uint64(16)) + uint64(_sqlite3HexToInt(tls, int32(*elem1(_z, uintptr(_1_k)))))
 32109  	_1_k += 1
 32110  	goto _7
 32111  _10:
 32112  	crt.Xmemcpy(tls, unsafe.Pointer(_pOut), unsafe.Pointer(&_1_u), uint32(8))
 32113  	return func() int32 {
 32114  		if (int32(*elem1(_z, uintptr(_1_k))) == int32(0)) && ((_1_k - _1_i) <= int32(16)) {
 32115  			return int32(0)
 32116  		}
 32117  		return int32(1)
 32118  	}()
 32119  
 32120  _2:
 32121  	return _sqlite3Atoi64(tls, _z, _pOut, _sqlite3Strlen30(tls, _z), uint8(1))
 32122  }
 32123  
 32124  // C comment
 32125  //  /*
 32126  //  ** Generate an instruction that will put the floating point
 32127  //  ** value described by z[0..n-1] into register iMem.
 32128  //  **
 32129  //  ** The z[] string will probably not be zero-terminated.  But the
 32130  //  ** z[n] character is guaranteed to be something that does not look
 32131  //  ** like the continuation of the number.
 32132  //  */
 32133  func _codeReal(tls *crt.TLS, _v *TVdbe, _z *int8, _negateFlag int32, _iMem int32) {
 32134  	var _1_value float64
 32135  	if func() int32 {
 32136  		if _z != nil {
 32137  			return int32(1)
 32138  		}
 32139  		return func() int32 {
 32140  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93928), unsafe.Pointer(&_codeRealØ00__func__Ø000), unsafe.Pointer(str(4809)))
 32141  			crt.X__builtin_abort(tls)
 32142  			return int32(0)
 32143  		}()
 32144  	}() == 0 {
 32145  		goto _2
 32146  	}
 32147  	_sqlite3AtoF(tls, _z, &_1_value, _sqlite3Strlen30(tls, _z), uint8(1))
 32148  	func() {
 32149  		if _sqlite3IsNaN(tls, _1_value) != 0 {
 32150  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93931), unsafe.Pointer(&_codeRealØ00__func__Ø000), unsafe.Pointer(str(44452)))
 32151  			crt.X__builtin_abort(tls)
 32152  		}
 32153  	}()
 32154  	if _negateFlag != 0 {
 32155  		_1_value = -_1_value
 32156  	}
 32157  	_sqlite3VdbeAddOp4Dup8(tls, _v, int32(132), int32(0), _iMem, int32(0), (*uint8)(unsafe.Pointer(&_1_value)), int32(-9))
 32158  _2:
 32159  }
 32160  
 32161  var _codeRealØ00__func__Ø000 [9]int8
 32162  
 32163  func init() {
 32164  	crt.Xstrncpy(nil, &_codeRealØ00__func__Ø000[0], str(44473), 9)
 32165  }
 32166  
 32167  // C comment
 32168  //  /*
 32169  //  ** Add an opcode that includes the p4 value with a P4_INT64 or
 32170  //  ** P4_REAL type.
 32171  //  */
 32172  func _sqlite3VdbeAddOp4Dup8(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32, _p3 int32, _zP4 *uint8, _p4type int32) (r0 int32) {
 32173  	var _p4copy *int8
 32174  	_p4copy = (*int8)(_sqlite3DbMallocRawNN(tls, _sqlite3VdbeDb(tls, _p), uint64(8)))
 32175  	if _p4copy != nil {
 32176  		crt.Xmemcpy(tls, unsafe.Pointer(_p4copy), unsafe.Pointer(_zP4), uint32(8))
 32177  	}
 32178  	return _sqlite3VdbeAddOp4(tls, _p, _op, _p1, _p2, _p3, _p4copy, _p4type)
 32179  }
 32180  
 32181  // C comment
 32182  //  /*
 32183  //  ** Record the fact that an affinity change has occurred on iCount
 32184  //  ** registers starting with iStart.
 32185  //  */
 32186  func _sqlite3ExprCacheAffinityChange(tls *crt.TLS, _pParse *XParse, _iStart int32, _iCount int32) {
 32187  	_sqlite3ExprCacheRemove(tls, _pParse, _iStart, _iCount)
 32188  }
 32189  
 32190  // C comment
 32191  //  /*
 32192  //  ** Indicate that registers between iReg..iReg+nReg-1 are being overwritten.
 32193  //  ** Purge the range of registers from the column cache.
 32194  //  */
 32195  func _sqlite3ExprCacheRemove(tls *crt.TLS, _pParse *XParse, _iReg int32, _nReg int32) {
 32196  	var _i int32
 32197  	var _1_p *TyColCache
 32198  	_i = int32(0)
 32199  _0:
 32200  	if _i >= int32(_pParse.XnColCache) {
 32201  		goto _1
 32202  	}
 32203  	_1_p = elem69((*TyColCache)(unsafe.Pointer(&_pParse.XaColCache)), uintptr(_i))
 32204  	if (_1_p.XiReg >= _iReg) && (_1_p.XiReg < (_iReg + _nReg)) {
 32205  		_cacheEntryClear(tls, _pParse, _i)
 32206  		goto _4
 32207  	}
 32208  	_i += 1
 32209  _4:
 32210  	goto _0
 32211  _1:
 32212  }
 32213  
 32214  // C comment
 32215  //  /*
 32216  //  ** Erase column-cache entry number i
 32217  //  */
 32218  func _cacheEntryClear(tls *crt.TLS, _pParse *XParse, _i int32) {
 32219  	if (elem69((*TyColCache)(unsafe.Pointer(&_pParse.XaColCache)), uintptr(_i)).XtempReg) == 0 {
 32220  		goto _0
 32221  	}
 32222  	if int32(_pParse.XnTempReg) < int32(8) {
 32223  		*elem8((*int32)(unsafe.Pointer(&_pParse.XaTempReg)), uintptr(postInc3(&_pParse.XnTempReg, byte(1)))) = elem69((*TyColCache)(unsafe.Pointer(&_pParse.XaColCache)), uintptr(_i)).XiReg
 32224  	}
 32225  _0:
 32226  	_pParse.XnColCache -= 1
 32227  	if _i < int32(_pParse.XnColCache) {
 32228  		*elem69((*TyColCache)(unsafe.Pointer(&_pParse.XaColCache)), uintptr(_i)) = *elem69((*TyColCache)(unsafe.Pointer(&_pParse.XaColCache)), uintptr(_pParse.XnColCache))
 32229  	}
 32230  }
 32231  
 32232  // C comment
 32233  //  /*
 32234  //  ** Return true if expression pExpr is a vector, or false otherwise.
 32235  //  **
 32236  //  ** A vector is defined as any expression that results in two or more
 32237  //  ** columns of result.  Every TK_VECTOR node is an vector because the
 32238  //  ** parser will not generate a TK_VECTOR with fewer than two entries.
 32239  //  ** But a TK_SELECT might be either a vector or a scalar. It is only
 32240  //  ** considered a vector if it has two or more result columns.
 32241  //  */
 32242  func _sqlite3ExprIsVector(tls *crt.TLS, _pExpr *XExpr) (r0 int32) {
 32243  	return bool2int(_sqlite3ExprVectorSize(tls, _pExpr) > int32(1))
 32244  }
 32245  
 32246  // C comment
 32247  //  /*
 32248  //  ** If the expression passed as the only argument is of type TK_VECTOR
 32249  //  ** return the number of expressions in the vector. Or, if the expression
 32250  //  ** is a sub-select, return the number of columns in the sub-select. For
 32251  //  ** any other type of expression, return 1.
 32252  //  */
 32253  func _sqlite3ExprVectorSize(tls *crt.TLS, _pExpr *XExpr) (r0 int32) {
 32254  	var _op uint8
 32255  	_op = _pExpr.Xop
 32256  	if int32(_op) == int32(157) {
 32257  		_op = _pExpr.Xop2
 32258  	}
 32259  	if int32(_op) == int32(158) {
 32260  		return (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).XnExpr
 32261  	}
 32262  	if int32(_op) == int32(119) {
 32263  		return (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).XpEList).XnExpr
 32264  	}
 32265  	return int32(1)
 32266  }
 32267  
 32268  // C comment
 32269  //  /*
 32270  //  ** Expression pExpr is a comparison between two vector values. Compute
 32271  //  ** the result of the comparison (1, 0, or NULL) and write that
 32272  //  ** result into register dest.
 32273  //  **
 32274  //  ** The caller must satisfy the following preconditions:
 32275  //  **
 32276  //  **    if pExpr->op==TK_IS:      op==TK_EQ and p5==SQLITE_NULLEQ
 32277  //  **    if pExpr->op==TK_ISNOT:   op==TK_NE and p5==SQLITE_NULLEQ
 32278  //  **    otherwise:                op==pExpr->op and p5==0
 32279  //  */
 32280  func _codeVectorCompare(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _dest int32, _op uint8, _p5 uint8) {
 32281  	var _nLeft, _i, _regLeft, _regRight, _addrDone, _2_regFree1, _2_regFree2, _2_r1, _2_r2 int32
 32282  	var _opx uint8
 32283  	var _v *TVdbe
 32284  	var _pLeft, _pRight, _2_pL, _2_pR *XExpr
 32285  	_v = (*TVdbe)(_pParse.XpVdbe)
 32286  	_pLeft = (*XExpr)(_pExpr.XpLeft)
 32287  	_pRight = (*XExpr)(_pExpr.XpRight)
 32288  	_nLeft = _sqlite3ExprVectorSize(tls, _pLeft)
 32289  	_regLeft = int32(0)
 32290  	_regRight = int32(0)
 32291  	_opx = _op
 32292  	_addrDone = _sqlite3VdbeMakeLabel(tls, _v)
 32293  	if _nLeft != _sqlite3ExprVectorSize(tls, _pRight) {
 32294  		_sqlite3ErrorMsg(tls, _pParse, str(43136))
 32295  		return
 32296  	}
 32297  	func() {
 32298  		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) {
 32299  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91429), unsafe.Pointer(&_codeVectorCompareØ00__func__Ø000), unsafe.Pointer(str(44482)))
 32300  			crt.X__builtin_abort(tls)
 32301  		}
 32302  	}()
 32303  	func() {
 32304  		if int32(_pExpr.Xop) != int32(_op) && (int32(_pExpr.Xop) != int32(72) || int32(_op) != int32(78)) && (int32(_pExpr.Xop) != int32(148) || int32(_op) != int32(77)) {
 32305  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91434), unsafe.Pointer(&_codeVectorCompareØ00__func__Ø000), unsafe.Pointer(str(44642)))
 32306  			crt.X__builtin_abort(tls)
 32307  		}
 32308  	}()
 32309  	func() {
 32310  		if int32(_p5) != int32(0) && int32(_pExpr.Xop) == int32(_op) {
 32311  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91436), unsafe.Pointer(&_codeVectorCompareØ00__func__Ø000), unsafe.Pointer(str(44729)))
 32312  			crt.X__builtin_abort(tls)
 32313  		}
 32314  	}()
 32315  	func() {
 32316  		if int32(_p5) != int32(128) && int32(_pExpr.Xop) != int32(_op) {
 32317  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91437), unsafe.Pointer(&_codeVectorCompareØ00__func__Ø000), unsafe.Pointer(str(44752)))
 32318  			crt.X__builtin_abort(tls)
 32319  		}
 32320  	}()
 32321  	{
 32322  		p := &_p5
 32323  		*p = uint8(int32(*p) | int32(32))
 32324  	}
 32325  	if int32(_opx) == int32(80) {
 32326  		_opx = uint8(81)
 32327  	}
 32328  	if int32(_opx) == int32(82) {
 32329  		_opx = uint8(79)
 32330  	}
 32331  	_regLeft = _exprCodeSubselect(tls, _pParse, _pLeft)
 32332  	_regRight = _exprCodeSubselect(tls, _pParse, _pRight)
 32333  	_i = int32(0)
 32334  _24:
 32335  	_2_regFree1 = int32(0)
 32336  	_2_regFree2 = int32(0)
 32337  	func() {
 32338  		if _i < int32(0) || _i >= _nLeft {
 32339  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91450), unsafe.Pointer(&_codeVectorCompareØ00__func__Ø000), unsafe.Pointer(str(44787)))
 32340  			crt.X__builtin_abort(tls)
 32341  		}
 32342  	}()
 32343  	if _i > int32(0) {
 32344  		_sqlite3ExprCachePush(tls, _pParse)
 32345  	}
 32346  	_2_r1 = _exprVectorRegister(tls, _pParse, _pLeft, _i, _regLeft, &_2_pL, &_2_regFree1)
 32347  	_2_r2 = _exprVectorRegister(tls, _pParse, _pRight, _i, _regRight, &_2_pR, &_2_regFree2)
 32348  	_codeCompare(tls, _pParse, _2_pL, _2_pR, int32(_opx), _2_r1, _2_r2, _dest, int32(_p5))
 32349  	_sqlite3ReleaseTempReg(tls, _pParse, _2_regFree1)
 32350  	_sqlite3ReleaseTempReg(tls, _pParse, _2_regFree2)
 32351  	if _i > int32(0) {
 32352  		_sqlite3ExprCachePop(tls, _pParse)
 32353  	}
 32354  	if _i == (_nLeft - int32(1)) {
 32355  		goto _27
 32356  	}
 32357  	if int32(_opx) == int32(78) {
 32358  		_sqlite3VdbeAddOp2(tls, _v, int32(22), _dest, _addrDone)
 32359  		{
 32360  			p := &_p5
 32361  			*p = uint8(int32(*p) | int32(8))
 32362  		}
 32363  		goto _37
 32364  	}
 32365  	if int32(_opx) == int32(77) {
 32366  		_sqlite3VdbeAddOp2(tls, _v, int32(21), _dest, _addrDone)
 32367  		{
 32368  			p := &_p5
 32369  			*p = uint8(int32(*p) | int32(8))
 32370  		}
 32371  		goto _37
 32372  	}
 32373  	func() {
 32374  		if int32(_op) != int32(81) && int32(_op) != int32(79) && int32(_op) != int32(80) && int32(_op) != int32(82) {
 32375  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91474), unsafe.Pointer(&_codeVectorCompareØ00__func__Ø000), unsafe.Pointer(str(44803)))
 32376  			crt.X__builtin_abort(tls)
 32377  		}
 32378  	}()
 32379  	_sqlite3VdbeAddOp2(tls, _v, int32(83), int32(0), _addrDone)
 32380  	if _i == (_nLeft - int32(2)) {
 32381  		_opx = _op
 32382  	}
 32383  _37:
 32384  	_i += 1
 32385  	goto _24
 32386  _27:
 32387  	_sqlite3VdbeResolveLabel(tls, _v, _addrDone)
 32388  }
 32389  
 32390  // C comment
 32391  //  /*
 32392  //  ** Create a new symbolic label for an instruction that has yet to be
 32393  //  ** coded.  The symbolic label is really just a negative number.  The
 32394  //  ** label can be used as the P2 value of an operation.  Later, when
 32395  //  ** the label is resolved to a specific address, the VDBE will scan
 32396  //  ** through its operation list and change all values of P2 which match
 32397  //  ** the label into the resolved address.
 32398  //  **
 32399  //  ** The VDBE knows that a P2 value is a label because labels are
 32400  //  ** always negative and P2 values are suppose to be non-negative.
 32401  //  ** Hence, a negative P2 value is a label that has yet to be resolved.
 32402  //  **
 32403  //  ** Zero is returned if a malloc() fails.
 32404  //  */
 32405  func _sqlite3VdbeMakeLabel(tls *crt.TLS, _v *TVdbe) (r0 int32) {
 32406  	var _i int32
 32407  	var _p *XParse
 32408  	_p = (*XParse)(_v.XpParse)
 32409  	_i = postInc2(&_p.XnLabel, 1)
 32410  	func() {
 32411  		if _v.Xmagic != uint32(381479589) {
 32412  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71784), unsafe.Pointer(&_sqlite3VdbeMakeLabelØ00__func__Ø000), unsafe.Pointer(str(44852)))
 32413  			crt.X__builtin_abort(tls)
 32414  		}
 32415  	}()
 32416  	if (_i & (_i - int32(1))) == int32(0) {
 32417  		_p.XaLabel = (*int32)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(_p.XaLabel), uint64(uint32((_i*int32(2))+int32(1))*uint32(4))))
 32418  	}
 32419  	if _p.XaLabel != nil {
 32420  		*elem8(_p.XaLabel, uintptr(_i)) = int32(-1)
 32421  	}
 32422  	return int32(-1) - _i
 32423  }
 32424  
 32425  var _sqlite3VdbeMakeLabelØ00__func__Ø000 [21]int8
 32426  
 32427  func init() {
 32428  	crt.Xstrncpy(nil, &_sqlite3VdbeMakeLabelØ00__func__Ø000[0], str(44878), 21)
 32429  }
 32430  
 32431  var _codeVectorCompareØ00__func__Ø000 [18]int8
 32432  
 32433  func init() {
 32434  	crt.Xstrncpy(nil, &_codeVectorCompareØ00__func__Ø000[0], str(44899), 18)
 32435  }
 32436  
 32437  // C comment
 32438  //  /*
 32439  //  ** If expression pExpr is of type TK_SELECT, generate code to evaluate
 32440  //  ** it. Return the register in which the result is stored (or, if the
 32441  //  ** sub-select returns more than one column, the first in an array
 32442  //  ** of registers in which the result is stored).
 32443  //  **
 32444  //  ** If pExpr is not a TK_SELECT expression, return 0.
 32445  //  */
 32446  func _exprCodeSubselect(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) (r0 int32) {
 32447  	var _reg int32
 32448  	_reg = int32(0)
 32449  	if int32(_pExpr.Xop) == int32(119) {
 32450  		_reg = _sqlite3CodeSubselect(tls, _pParse, _pExpr, int32(0), int32(0))
 32451  	}
 32452  	return _reg
 32453  }
 32454  
 32455  func _sqlite3CodeSubselect(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _rHasNullFlag int32, _isRowid int32) (r0 int32) {
 32456  	var _jmpIfDynamic, _rReg, _4_addr, _4_nVal, _6_i, _9_i, _9_r1, _9_r2, _9_r3, _12_iValToIns, _19_nReg int32
 32457  	var _9_affinity int8
 32458  	var _2_zMsg *int8
 32459  	var _v *TVdbe
 32460  	var _5_pEList, _9_pList *XExprList
 32461  	var _9_pItem *TExprList_item
 32462  	var _5_pSelect, _19_pSel *XSelect
 32463  	var _4_pLeft, _8_p, _12_pE2 *XExpr
 32464  	var _4_pKeyInfo *XKeyInfo
 32465  	var _6_dest, _19_dest XSelectDest
 32466  	_jmpIfDynamic = int32(-1)
 32467  	_rReg = int32(0)
 32468  	_v = _sqlite3GetVdbe(tls, _pParse)
 32469  	if func() int32 {
 32470  		if _v == nil {
 32471  			return func() int32 {
 32472  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93411), unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000), unsafe.Pointer(str(4809)))
 32473  				crt.X__builtin_abort(tls)
 32474  				return int32(1)
 32475  			}()
 32476  		}
 32477  		return int32(0)
 32478  	}() != 0 {
 32479  		return int32(0)
 32480  	}
 32481  	_sqlite3ExprCachePush(tls, _pParse)
 32482  	if (_pExpr.Xflags & uint32(32)) == (0) {
 32483  		_jmpIfDynamic = _sqlite3VdbeAddOp0(tls, _v, int32(20))
 32484  	}
 32485  	if int32(_pParse.Xexplain) == int32(2) {
 32486  		_2_zMsg = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.Xdb), str(44917), unsafe.Pointer(func() *int8 {
 32487  			if _jmpIfDynamic >= int32(0) {
 32488  				return str(284)
 32489  			}
 32490  			return str(44942)
 32491  		}()), unsafe.Pointer(func() *int8 {
 32492  			if int32(_pExpr.Xop) == int32(74) {
 32493  				return str(44954)
 32494  			}
 32495  			return str(44959)
 32496  		}()), _pParse.XiNextSelectId)
 32497  		_sqlite3VdbeAddOp4(tls, _v, int32(165), _pParse.XiSelectId, int32(0), int32(0), _2_zMsg, int32(-1))
 32498  	}
 32499  	switch int32(_pExpr.Xop) {
 32500  	case int32(20):
 32501  		goto _11
 32502  	case int32(74):
 32503  		goto _10
 32504  	case int32(119):
 32505  		goto _11
 32506  	default:
 32507  		goto _11
 32508  	}
 32509  
 32510  _10:
 32511  	_4_pLeft = (*XExpr)(_pExpr.XpLeft)
 32512  	_4_pKeyInfo = nil
 32513  	_4_nVal = _sqlite3ExprVectorSize(tls, _4_pLeft)
 32514  	func() {
 32515  		if _isRowid != 0 && _4_nVal != int32(1) {
 32516  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93447), unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000), unsafe.Pointer(str(44966)))
 32517  			crt.X__builtin_abort(tls)
 32518  		}
 32519  	}()
 32520  	_pExpr.XiTable = postInc2(&_pParse.XnTab, 1)
 32521  	_4_addr = _sqlite3VdbeAddOp2(tls, _v, int32(110), _pExpr.XiTable, func() int32 {
 32522  		if _isRowid != 0 {
 32523  			return int32(0)
 32524  		}
 32525  		return _4_nVal
 32526  	}())
 32527  	_4_pKeyInfo = func() *XKeyInfo {
 32528  		if _isRowid != 0 {
 32529  			return nil
 32530  		}
 32531  		return _sqlite3KeyInfoAlloc(tls, (*Xsqlite3)(_pParse.Xdb), _4_nVal, int32(1))
 32532  	}()
 32533  	if (_pExpr.Xflags & uint32(2048)) == (0) {
 32534  		goto _21
 32535  	}
 32536  	_5_pSelect = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 32537  	_5_pEList = (*XExprList)(_5_pSelect.XpEList)
 32538  	func() {
 32539  		if _isRowid != 0 {
 32540  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93476), unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000), unsafe.Pointer(str(44986)))
 32541  			crt.X__builtin_abort(tls)
 32542  		}
 32543  	}()
 32544  	if func() int32 {
 32545  		if _5_pEList.XnExpr == _4_nVal {
 32546  			return int32(1)
 32547  		}
 32548  		return func() int32 {
 32549  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93479), unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000), unsafe.Pointer(str(4809)))
 32550  			crt.X__builtin_abort(tls)
 32551  			return int32(0)
 32552  		}()
 32553  	}() == 0 {
 32554  		goto _26
 32555  	}
 32556  	_sqlite3SelectDestInit(tls, &_6_dest, int32(11), _pExpr.XiTable)
 32557  	_6_dest.XzAffSdst = _exprINAffinity(tls, _pParse, _pExpr)
 32558  	_5_pSelect.XiLimit = int32(0)
 32559  	if _sqlite3Select(tls, _pParse, _5_pSelect, &_6_dest) != 0 {
 32560  		_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.Xdb), unsafe.Pointer(_6_dest.XzAffSdst))
 32561  		_sqlite3KeyInfoUnref(tls, _4_pKeyInfo)
 32562  		return int32(0)
 32563  	}
 32564  	_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.Xdb), unsafe.Pointer(_6_dest.XzAffSdst))
 32565  	func() {
 32566  		if _4_pKeyInfo == nil {
 32567  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93493), unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000), unsafe.Pointer(str(44995)))
 32568  			crt.X__builtin_abort(tls)
 32569  		}
 32570  	}()
 32571  	func() {
 32572  		if _5_pEList == nil {
 32573  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93494), unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000), unsafe.Pointer(str(45007)))
 32574  			crt.X__builtin_abort(tls)
 32575  		}
 32576  	}()
 32577  	func() {
 32578  		if _5_pEList.XnExpr <= int32(0) {
 32579  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93495), unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000), unsafe.Pointer(str(45017)))
 32580  			crt.X__builtin_abort(tls)
 32581  		}
 32582  	}()
 32583  	func() {
 32584  		if _sqlite3KeyInfoIsWriteable(tls, _4_pKeyInfo) == 0 {
 32585  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93496), unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000), unsafe.Pointer(str(45033)))
 32586  			crt.X__builtin_abort(tls)
 32587  		}
 32588  	}()
 32589  	_6_i = int32(0)
 32590  _36:
 32591  	if _6_i >= _4_nVal {
 32592  		goto _39
 32593  	}
 32594  	_8_p = _sqlite3VectorFieldSubexpr(tls, _4_pLeft, _6_i)
 32595  	*elem62((**XCollSeq)(unsafe.Pointer(&_4_pKeyInfo.XaColl)), uintptr(_6_i)) = _sqlite3BinaryCompareCollSeq(tls, _pParse, _8_p, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_5_pEList.Xa)), uintptr(_6_i)).XpExpr))
 32596  	_6_i += 1
 32597  	goto _36
 32598  _39:
 32599  _26:
 32600  	goto _43
 32601  _21:
 32602  	if func() int32 {
 32603  		if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))) != nil {
 32604  			return int32(1)
 32605  		}
 32606  		return func() int32 {
 32607  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93504), unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000), unsafe.Pointer(str(4809)))
 32608  			crt.X__builtin_abort(tls)
 32609  			return int32(0)
 32610  		}()
 32611  	}() == 0 {
 32612  		goto _43
 32613  	}
 32614  	_9_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 32615  	_9_affinity = _sqlite3ExprAffinity(tls, _4_pLeft)
 32616  	if _9_affinity == 0 {
 32617  		_9_affinity = int8(65)
 32618  	}
 32619  	if _4_pKeyInfo != nil {
 32620  		func() {
 32621  			if _sqlite3KeyInfoIsWriteable(tls, _4_pKeyInfo) == 0 {
 32622  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93523), unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000), unsafe.Pointer(str(45033)))
 32623  				crt.X__builtin_abort(tls)
 32624  			}
 32625  		}()
 32626  		*elem62((**XCollSeq)(unsafe.Pointer(&_4_pKeyInfo.XaColl)), 0) = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_pExpr.XpLeft))
 32627  	}
 32628  	_9_r1 = _sqlite3GetTempReg(tls, _pParse)
 32629  	_9_r2 = _sqlite3GetTempReg(tls, _pParse)
 32630  	if _isRowid != 0 {
 32631  		_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _9_r2)
 32632  	}
 32633  	*func() **TExprList_item { _9_i = _9_pList.XnExpr; return &_9_pItem }() = (*TExprList_item)(unsafe.Pointer(&_9_pList.Xa))
 32634  _49:
 32635  	if _9_i <= int32(0) {
 32636  		goto _52
 32637  	}
 32638  	_12_pE2 = (*XExpr)(_9_pItem.XpExpr)
 32639  	if (_jmpIfDynamic >= int32(0)) && (_sqlite3ExprIsConstant(tls, _12_pE2) == 0) {
 32640  		_sqlite3VdbeChangeToNoop(tls, _v, _jmpIfDynamic)
 32641  		_jmpIfDynamic = int32(-1)
 32642  	}
 32643  	if _isRowid != 0 && _sqlite3ExprIsInteger(tls, _12_pE2, &_12_iValToIns) != 0 {
 32644  		_sqlite3VdbeAddOp3(tls, _v, int32(119), _pExpr.XiTable, _9_r2, _12_iValToIns)
 32645  		goto _57
 32646  	}
 32647  	_9_r3 = _sqlite3ExprCodeTarget(tls, _pParse, _12_pE2, _9_r1)
 32648  	if _isRowid != 0 {
 32649  		_sqlite3VdbeAddOp2(tls, _v, int32(17), _9_r3, _sqlite3VdbeCurrentAddr(tls, _v)+int32(2))
 32650  		_sqlite3VdbeAddOp3(tls, _v, int32(118), _pExpr.XiTable, _9_r2, _9_r3)
 32651  		goto _59
 32652  	}
 32653  	_sqlite3VdbeAddOp4(tls, _v, int32(101), _9_r3, int32(1), _9_r2, &_9_affinity, int32(1))
 32654  	_sqlite3ExprCacheAffinityChange(tls, _pParse, _9_r3, int32(1))
 32655  	_sqlite3VdbeAddOp4Int(tls, _v, int32(128), _pExpr.XiTable, _9_r2, _9_r3, int32(1))
 32656  _59:
 32657  _57:
 32658  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _9_i -= 1; return &_9_pItem }())) += uintptr(20)
 32659  	goto _49
 32660  _52:
 32661  	_sqlite3ReleaseTempReg(tls, _pParse, _9_r1)
 32662  	_sqlite3ReleaseTempReg(tls, _pParse, _9_r2)
 32663  _43:
 32664  	if _4_pKeyInfo != nil {
 32665  		_sqlite3VdbeChangeP4(tls, _v, _4_addr, (*int8)(unsafe.Pointer(_4_pKeyInfo)), int32(-5))
 32666  	}
 32667  	goto _61
 32668  _11:
 32669  	func() {
 32670  		if int32(_pExpr.Xop) != int32(20) && int32(_pExpr.Xop) != int32(119) {
 32671  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93593), unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000), unsafe.Pointer(str(45069)))
 32672  			crt.X__builtin_abort(tls)
 32673  		}
 32674  	}()
 32675  	func() {
 32676  		if (_pExpr.Xflags & uint32(2048)) == (0) {
 32677  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93594), unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000), unsafe.Pointer(str(45114)))
 32678  			crt.X__builtin_abort(tls)
 32679  		}
 32680  	}()
 32681  	_19_pSel = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 32682  	_19_nReg = func() int32 {
 32683  		if int32(_pExpr.Xop) == int32(119) {
 32684  			return ((*XExprList)(_19_pSel.XpEList).XnExpr)
 32685  		}
 32686  		return int32(1)
 32687  	}()
 32688  	_sqlite3SelectDestInit(tls, &_19_dest, int32(0), _pParse.XnMem+int32(1))
 32689  	_pParse.XnMem += _19_nReg
 32690  	if int32(_pExpr.Xop) == int32(119) {
 32691  		_19_dest.XeDest = uint8(10)
 32692  		_19_dest.XiSdst = _19_dest.XiSDParm
 32693  		_19_dest.XnSdst = _19_nReg
 32694  		_sqlite3VdbeAddOp3(tls, _v, int32(59), int32(0), _19_dest.XiSDParm, (_19_dest.XiSDParm+_19_nReg)-int32(1))
 32695  		_sqlite3VdbeComment(tls, _v, str(45151))
 32696  		goto _70
 32697  	}
 32698  	_19_dest.XeDest = uint8(3)
 32699  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _19_dest.XiSDParm)
 32700  	_sqlite3VdbeComment(tls, _v, str(45172))
 32701  _70:
 32702  	_sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XExpr)(_19_pSel.XpLimit))
 32703  	*(**XExpr)(unsafe.Pointer(&_19_pSel.XpLimit)) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(134), elem56((*XToken)(unsafe.Pointer(&_sqlite3IntTokens)), uintptr(1)), int32(0))
 32704  	_19_pSel.XiLimit = int32(0)
 32705  	_19_pSel.XselFlags &= uint32(4294966271)
 32706  	if _sqlite3Select(tls, _pParse, _19_pSel, &_19_dest) != 0 {
 32707  		return int32(0)
 32708  	}
 32709  	_rReg = _19_dest.XiSDParm
 32710  	_pExpr.Xflags |= uint32(131072)
 32711  	goto _61
 32712  _61:
 32713  	if _rHasNullFlag != 0 {
 32714  		_sqlite3SetHasNullFlag(tls, _v, _pExpr.XiTable, _rHasNullFlag)
 32715  	}
 32716  	if _jmpIfDynamic >= int32(0) {
 32717  		_sqlite3VdbeJumpHere(tls, _v, _jmpIfDynamic)
 32718  	}
 32719  	_sqlite3ExprCachePop(tls, _pParse)
 32720  	return _rReg
 32721  }
 32722  
 32723  var _sqlite3CodeSubselectØ00__func__Ø000 [21]int8
 32724  
 32725  func init() {
 32726  	crt.Xstrncpy(nil, &_sqlite3CodeSubselectØ00__func__Ø000[0], str(45191), 21)
 32727  }
 32728  
 32729  // C comment
 32730  //  /*
 32731  //  ** Remember the current column cache context.  Any new entries added
 32732  //  ** added to the column cache after this call are removed when the
 32733  //  ** corresponding pop occurs.
 32734  //  */
 32735  func _sqlite3ExprCachePush(tls *crt.TLS, _pParse *XParse) {
 32736  	_pParse.XiCacheLevel += 1
 32737  	if (((*Xsqlite3)(_pParse.Xdb).Xflags) & int32(4096)) != 0 {
 32738  		crt.Xprintf(tls, str(45212), _pParse.XiCacheLevel)
 32739  	}
 32740  }
 32741  
 32742  // C comment
 32743  //  /*
 32744  //  ** Initialize a SelectDest structure.
 32745  //  */
 32746  func _sqlite3SelectDestInit(tls *crt.TLS, _pDest *XSelectDest, _eDest int32, _iParm int32) {
 32747  	_pDest.XeDest = uint8(_eDest)
 32748  	_pDest.XiSDParm = _iParm
 32749  	_pDest.XzAffSdst = nil
 32750  	_pDest.XiSdst = int32(0)
 32751  	_pDest.XnSdst = int32(0)
 32752  }
 32753  
 32754  // C comment
 32755  //  /*
 32756  //  ** Argument pExpr is an (?, ?...) IN(...) expression. This
 32757  //  ** function allocates and returns a nul-terminated string containing
 32758  //  ** the affinities to be used for each column of the comparison.
 32759  //  **
 32760  //  ** It is the responsibility of the caller to ensure that the returned
 32761  //  ** string is eventually freed using sqlite3DbFree().
 32762  //  */
 32763  func _exprINAffinity(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) (r0 *int8) {
 32764  	var _nVal, _1_i int32
 32765  	var _2_a int8
 32766  	var _zRet *int8
 32767  	var _pSelect *XSelect
 32768  	var _pLeft, _2_pA *XExpr
 32769  	_pLeft = (*XExpr)(_pExpr.XpLeft)
 32770  	_nVal = _sqlite3ExprVectorSize(tls, _pLeft)
 32771  	_pSelect = func() *XSelect {
 32772  		if (_pExpr.Xflags & uint32(2048)) != 0 {
 32773  			return (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 32774  		}
 32775  		return nil
 32776  	}()
 32777  	func() {
 32778  		if int32(_pExpr.Xop) != int32(74) {
 32779  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93318), unsafe.Pointer(&_exprINAffinityØ00__func__Ø000), unsafe.Pointer(str(45224)))
 32780  			crt.X__builtin_abort(tls)
 32781  		}
 32782  	}()
 32783  	_zRet = (*int8)(_sqlite3DbMallocRaw(tls, (*Xsqlite3)(_pParse.Xdb), uint64(_nVal+int32(1))))
 32784  	if _zRet == nil {
 32785  		goto _4
 32786  	}
 32787  	_1_i = int32(0)
 32788  _5:
 32789  	if _1_i >= _nVal {
 32790  		goto _8
 32791  	}
 32792  	_2_pA = _sqlite3VectorFieldSubexpr(tls, _pLeft, _1_i)
 32793  	_2_a = _sqlite3ExprAffinity(tls, _2_pA)
 32794  	if _pSelect != nil {
 32795  		*elem1(_zRet, uintptr(_1_i)) = _sqlite3CompareAffinity(tls, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSelect.XpEList).Xa))), uintptr(_1_i)).XpExpr), _2_a)
 32796  		goto _10
 32797  	}
 32798  	*elem1(_zRet, uintptr(_1_i)) = _2_a
 32799  _10:
 32800  	_1_i += 1
 32801  	goto _5
 32802  _8:
 32803  	*elem1(_zRet, uintptr(_nVal)) = 0
 32804  _4:
 32805  	return _zRet
 32806  }
 32807  
 32808  var _exprINAffinityØ00__func__Ø000 [15]int8
 32809  
 32810  func init() {
 32811  	crt.Xstrncpy(nil, &_exprINAffinityØ00__func__Ø000[0], str(45241), 15)
 32812  }
 32813  
 32814  // C comment
 32815  //  /*
 32816  //  ** Return a pointer to a subexpression of pVector that is the i-th
 32817  //  ** column of the vector (numbered starting with 0).  The caller must
 32818  //  ** ensure that i is within range.
 32819  //  **
 32820  //  ** If pVector is really a scalar (and "scalar" here includes subqueries
 32821  //  ** that return a single column!) then return pVector unmodified.
 32822  //  **
 32823  //  ** pVector retains ownership of the returned subexpression.
 32824  //  **
 32825  //  ** If the vector is a (SELECT ...) then the expression returned is
 32826  //  ** just the expression for the i-th term of the result set, and may
 32827  //  ** not be ready for evaluation because the table cursor has not yet
 32828  //  ** been positioned.
 32829  //  */
 32830  func _sqlite3VectorFieldSubexpr(tls *crt.TLS, _pVector *XExpr, _i int32) (r0 *XExpr) {
 32831  	func() {
 32832  		if _i >= _sqlite3ExprVectorSize(tls, _pVector) {
 32833  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91269), unsafe.Pointer(&_sqlite3VectorFieldSubexprØ00__func__Ø000), unsafe.Pointer(str(45256)))
 32834  			crt.X__builtin_abort(tls)
 32835  		}
 32836  	}()
 32837  	if _sqlite3ExprIsVector(tls, _pVector) == 0 {
 32838  		goto _2
 32839  	}
 32840  	func() {
 32841  		if int32(_pVector.Xop2) != int32(0) && int32(_pVector.Xop) != int32(157) {
 32842  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91271), unsafe.Pointer(&_sqlite3VectorFieldSubexprØ00__func__Ø000), unsafe.Pointer(str(45289)))
 32843  			crt.X__builtin_abort(tls)
 32844  		}
 32845  	}()
 32846  	if (int32(_pVector.Xop) == int32(119)) || (int32(_pVector.Xop2) == int32(119)) {
 32847  		return (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pVector.Xx))).XpEList).Xa))), uintptr(_i)).XpExpr)
 32848  	}
 32849  	return (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pVector.Xx))).Xa))), uintptr(_i)).XpExpr)
 32850  
 32851  _2:
 32852  	return _pVector
 32853  }
 32854  
 32855  var _sqlite3VectorFieldSubexprØ00__func__Ø000 [26]int8
 32856  
 32857  func init() {
 32858  	crt.Xstrncpy(nil, &_sqlite3VectorFieldSubexprØ00__func__Ø000[0], str(45333), 26)
 32859  }
 32860  
 32861  // C comment
 32862  //  /*
 32863  //  ** Return the 'affinity' of the expression pExpr if any.
 32864  //  **
 32865  //  ** If pExpr is a column, a reference to a column via an 'AS' alias,
 32866  //  ** or a sub-select with a column as the return value, then the
 32867  //  ** affinity of that column is returned. Otherwise, 0x00 is returned,
 32868  //  ** indicating no affinity for the expression.
 32869  //  **
 32870  //  ** i.e. the WHERE clause expressions in the following statements all
 32871  //  ** have an affinity:
 32872  //  **
 32873  //  ** CREATE TABLE t1(a);
 32874  //  ** SELECT * FROM t1 WHERE a;
 32875  //  ** SELECT a AS b FROM t1 WHERE b;
 32876  //  ** SELECT * FROM t1 WHERE (select a from t1);
 32877  //  */
 32878  func _sqlite3ExprAffinity(tls *crt.TLS, _pExpr *XExpr) (r0 int8) {
 32879  	var _op int32
 32880  	_pExpr = _sqlite3ExprSkipCollate(tls, _pExpr)
 32881  	if (_pExpr.Xflags & uint32(512)) != 0 {
 32882  		return 0
 32883  	}
 32884  	_op = int32(_pExpr.Xop)
 32885  	if _op == int32(119) {
 32886  		func() {
 32887  			if (_pExpr.Xflags & uint32(2048)) == 0 {
 32888  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90949), unsafe.Pointer(&_sqlite3ExprAffinityØ00__func__Ø000), unsafe.Pointer(str(45359)))
 32889  				crt.X__builtin_abort(tls)
 32890  			}
 32891  		}()
 32892  		return _sqlite3ExprAffinity(tls, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).XpEList).Xa))), 0).XpExpr))
 32893  	}
 32894  	if _op == int32(157) {
 32895  		_op = int32(_pExpr.Xop2)
 32896  	}
 32897  	if _op == int32(37) {
 32898  		func() {
 32899  			if (_pExpr.Xflags & uint32(1024)) != (0) {
 32900  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90955), unsafe.Pointer(&_sqlite3ExprAffinityØ00__func__Ø000), unsafe.Pointer(str(42479)))
 32901  				crt.X__builtin_abort(tls)
 32902  			}
 32903  		}()
 32904  		return _sqlite3AffinityType(tls, *(**int8)(unsafe.Pointer(&_pExpr.Xu)), nil)
 32905  	}
 32906  	if ((_op == int32(154)) || (_op == int32(152))) && (_pExpr.XpTab != nil) {
 32907  		return _sqlite3TableColumnAffinity(tls, (*XTable)(_pExpr.XpTab), int32(_pExpr.XiColumn))
 32908  	}
 32909  	if _op == int32(159) {
 32910  		func() {
 32911  			if (((*XExpr)(_pExpr.XpLeft).Xflags) & uint32(2048)) == 0 {
 32912  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90963), unsafe.Pointer(&_sqlite3ExprAffinityØ00__func__Ø000), unsafe.Pointer(str(45385)))
 32913  				crt.X__builtin_abort(tls)
 32914  			}
 32915  		}()
 32916  		return _sqlite3ExprAffinity(tls, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&((*XExpr)(_pExpr.XpLeft).Xx)))).XpEList).Xa))), uintptr(_pExpr.XiColumn)).XpExpr))
 32917  	}
 32918  	return _pExpr.Xaffinity
 32919  }
 32920  
 32921  // C comment
 32922  //  /*
 32923  //  ** Skip over any TK_COLLATE operators and any unlikely()
 32924  //  ** or likelihood() function at the root of an expression.
 32925  //  */
 32926  func _sqlite3ExprSkipCollate(tls *crt.TLS, _pExpr *XExpr) (r0 *XExpr) {
 32927  _0:
 32928  	if _pExpr == nil || (_pExpr.Xflags&uint32(4096)) == (0) {
 32929  		goto _1
 32930  	}
 32931  	if (_pExpr.Xflags & uint32(262144)) != (0) {
 32932  		func() {
 32933  			if (_pExpr.Xflags & uint32(2048)) != (0) {
 32934  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91009), unsafe.Pointer(&_sqlite3ExprSkipCollateØ00__func__Ø000), unsafe.Pointer(str(42733)))
 32935  				crt.X__builtin_abort(tls)
 32936  			}
 32937  		}()
 32938  		func() {
 32939  			if ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).XnExpr) <= int32(0) {
 32940  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91010), unsafe.Pointer(&_sqlite3ExprSkipCollateØ00__func__Ø000), unsafe.Pointer(str(45418)))
 32941  				crt.X__builtin_abort(tls)
 32942  			}
 32943  		}()
 32944  		func() {
 32945  			if int32(_pExpr.Xop) != int32(151) {
 32946  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91011), unsafe.Pointer(&_sqlite3ExprSkipCollateØ00__func__Ø000), unsafe.Pointer(str(45442)))
 32947  				crt.X__builtin_abort(tls)
 32948  			}
 32949  		}()
 32950  		_pExpr = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).Xa))), 0).XpExpr)
 32951  		goto _10
 32952  	}
 32953  	func() {
 32954  		if int32(_pExpr.Xop) != int32(94) {
 32955  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91014), unsafe.Pointer(&_sqlite3ExprSkipCollateØ00__func__Ø000), unsafe.Pointer(str(45465)))
 32956  			crt.X__builtin_abort(tls)
 32957  		}
 32958  	}()
 32959  	_pExpr = (*XExpr)(_pExpr.XpLeft)
 32960  _10:
 32961  	goto _0
 32962  _1:
 32963  	return _pExpr
 32964  }
 32965  
 32966  var _sqlite3ExprSkipCollateØ00__func__Ø000 [23]int8
 32967  
 32968  func init() {
 32969  	crt.Xstrncpy(nil, &_sqlite3ExprSkipCollateØ00__func__Ø000[0], str(45487), 23)
 32970  }
 32971  
 32972  var _sqlite3ExprAffinityØ00__func__Ø000 [20]int8
 32973  
 32974  func init() {
 32975  	crt.Xstrncpy(nil, &_sqlite3ExprAffinityØ00__func__Ø000[0], str(45510), 20)
 32976  }
 32977  
 32978  // C comment
 32979  //  /*
 32980  //  ** Return the affinity character for a single column of a table.
 32981  //  */
 32982  func _sqlite3TableColumnAffinity(tls *crt.TLS, _pTab *XTable, _iCol int32) (r0 int8) {
 32983  	func() {
 32984  		if _iCol >= int32(_pTab.XnCol) {
 32985  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90923), unsafe.Pointer(&_sqlite3TableColumnAffinityØ00__func__Ø000), unsafe.Pointer(str(45530)))
 32986  			crt.X__builtin_abort(tls)
 32987  		}
 32988  	}()
 32989  	return int8(func() int32 {
 32990  		if _iCol >= int32(0) {
 32991  			return int32(elem41((*XColumn)(_pTab.XaCol), uintptr(_iCol)).Xaffinity)
 32992  		}
 32993  		return int32(68)
 32994  	}())
 32995  }
 32996  
 32997  var _sqlite3TableColumnAffinityØ00__func__Ø000 [27]int8
 32998  
 32999  func init() {
 33000  	crt.Xstrncpy(nil, &_sqlite3TableColumnAffinityØ00__func__Ø000[0], str(45546), 27)
 33001  }
 33002  
 33003  // C comment
 33004  //  /*
 33005  //  ** pExpr is an operand of a comparison operator.  aff2 is the
 33006  //  ** type affinity of the other operand.  This routine returns the
 33007  //  ** type affinity that should be used for the comparison operator.
 33008  //  */
 33009  func _sqlite3CompareAffinity(tls *crt.TLS, _pExpr *XExpr, _aff2 int8) (r0 int8) {
 33010  	var _aff1 int8
 33011  	_aff1 = _sqlite3ExprAffinity(tls, _pExpr)
 33012  	if _aff1 == 0 || _aff2 == 0 {
 33013  		goto _1
 33014  	}
 33015  	if (int32(_aff1) >= int32(67)) || (int32(_aff2) >= int32(67)) {
 33016  		return int8(67)
 33017  	}
 33018  	return int8(65)
 33019  
 33020  _1:
 33021  	if (_aff1 == 0) && (_aff2 == 0) {
 33022  		return int8(65)
 33023  	}
 33024  	func() {
 33025  		if int32(_aff1) != int32(0) && int32(_aff2) != int32(0) {
 33026  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91112), unsafe.Pointer(&_sqlite3CompareAffinityØ00__func__Ø000), unsafe.Pointer(str(45573)))
 33027  			crt.X__builtin_abort(tls)
 33028  		}
 33029  	}()
 33030  	return int8(int32(_aff1) + int32(_aff2))
 33031  }
 33032  
 33033  var _sqlite3CompareAffinityØ00__func__Ø000 [23]int8
 33034  
 33035  func init() {
 33036  	crt.Xstrncpy(nil, &_sqlite3CompareAffinityØ00__func__Ø000[0], str(45592), 23)
 33037  }
 33038  
 33039  // C comment
 33040  //  /*
 33041  //  ** Generate code for the SELECT statement given in the p argument.
 33042  //  **
 33043  //  ** The results are returned according to the SelectDest structure.
 33044  //  ** See comments in sqliteInt.h for further information.
 33045  //  **
 33046  //  ** This routine returns the number of errors.  If any errors are
 33047  //  ** encountered, then an appropriate error message is left in
 33048  //  ** pParse->zErrMsg.
 33049  //  **
 33050  //  ** This routine does NOT free the Select structure passed in.  The
 33051  //  ** calling function needs to do that.
 33052  //  */
 33053  func _sqlite3Select(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectDest) (r0 int32) {
 33054  	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
 33055  	var _34_wctrlFlags uint16
 33056  	var _69_flag uint8
 33057  	var _db *Xsqlite3
 33058  	var _6_pTab, _63_pTab *XTable
 33059  	var _v *TVdbe
 33060  	var _pTabList *XSrcList
 33061  	var _6_pItem, _12_pItem, _19_pPrior *TSrcList_item
 33062  	var _pEList, _pGroupBy, _63_pDel, _69_pMinMax *XExprList
 33063  	var _41_pItem *TExprList_item
 33064  	var _6_pSub, _12_pSub *XSelect
 33065  	var _pWhere, _pHaving *XExpr
 33066  	var _64_pIdx, _64_pBest *XIndex
 33067  	var _27_pKeyInfo, _49_pKeyInfo, _64_pKeyInfo *XKeyInfo
 33068  	var _40_sNC XNameContext
 33069  	var _12_dest XSelectDest
 33070  	var _sAggInfo XAggInfo
 33071  	var _54_pCol *TAggInfo_col
 33072  	var _pWInfo *XWhereInfo
 33073  	var _sSort XSortCtx
 33074  	var _sDistinct XDistinctCtx
 33075  	_pEList = nil
 33076  	_rc = int32(1)
 33077  	_iRestoreSelectId = _pParse.XiSelectId
 33078  	_pParse.XiSelectId = postInc2(&_pParse.XiNextSelectId, 1)
 33079  	_db = (*Xsqlite3)(_pParse.Xdb)
 33080  	if ((_p == nil) || (_db.XmallocFailed != 0)) || _pParse.XnErr != 0 {
 33081  		return int32(1)
 33082  	}
 33083  	if _sqlite3AuthCheck(tls, _pParse, int32(21), nil, nil, nil) != 0 {
 33084  		return int32(1)
 33085  	}
 33086  	crt.Xmemset(tls, unsafe.Pointer(&_sAggInfo), int32(0), uint32(48))
 33087  	_pParse.XnSelectIndent += 1
 33088  	if (Xsqlite3SelectTrace & int32(1)) != 0 {
 33089  		_sqlite3DebugPrintf(tls, func() *int8 {
 33090  			_sqlite3DebugPrintf(tls, str(45615), (_pParse.XnSelectIndent*int32(2))-int32(2), unsafe.Pointer(str(284)), unsafe.Pointer(&_p.XzSelName), unsafe.Pointer(_p))
 33091  			return str(45626)
 33092  		}())
 33093  	}
 33094  	if (Xsqlite3SelectTrace & int32(256)) != 0 {
 33095  		_sqlite3TreeViewSelect(tls, nil, _p, 0)
 33096  	}
 33097  	func() {
 33098  		if (*XExprList)(_p.XpOrderBy) != nil && int32(_pDest.XeDest) == int32(6) {
 33099  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121570), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(45645)))
 33100  			crt.X__builtin_abort(tls)
 33101  		}
 33102  	}()
 33103  	func() {
 33104  		if (*XExprList)(_p.XpOrderBy) != nil && int32(_pDest.XeDest) == int32(5) {
 33105  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121571), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(45690)))
 33106  			crt.X__builtin_abort(tls)
 33107  		}
 33108  	}()
 33109  	func() {
 33110  		if (*XExprList)(_p.XpOrderBy) != nil && int32(_pDest.XeDest) == int32(8) {
 33111  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121572), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(45731)))
 33112  			crt.X__builtin_abort(tls)
 33113  		}
 33114  	}()
 33115  	func() {
 33116  		if (*XExprList)(_p.XpOrderBy) != nil && int32(_pDest.XeDest) == int32(7) {
 33117  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121573), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(45777)))
 33118  			crt.X__builtin_abort(tls)
 33119  		}
 33120  	}()
 33121  	if int32(_pDest.XeDest) <= int32(8) {
 33122  		func() {
 33123  			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) {
 33124  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121575), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(45819)))
 33125  				crt.X__builtin_abort(tls)
 33126  			}
 33127  		}()
 33128  		_sqlite3ExprListDelete(tls, _db, (*XExprList)(_p.XpOrderBy))
 33129  		*(**XExprList)(unsafe.Pointer(&_p.XpOrderBy)) = nil
 33130  		_p.XselFlags &= uint32(4294967294)
 33131  	}
 33132  	_sqlite3SelectPrep(tls, _pParse, _p, nil)
 33133  	crt.Xmemset(tls, unsafe.Pointer(&_sSort), int32(0), uint32(32))
 33134  	*(**XExprList)(unsafe.Pointer(&_sSort.XpOrderBy)) = (*XExprList)(_p.XpOrderBy)
 33135  	_pTabList = (*XSrcList)(_p.XpSrc)
 33136  	if _pParse.XnErr != 0 || (_db.XmallocFailed != 0) {
 33137  		goto _select_end
 33138  	}
 33139  	func() {
 33140  		if (*XExprList)(_p.XpEList) == nil {
 33141  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121592), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(46042)))
 33142  			crt.X__builtin_abort(tls)
 33143  		}
 33144  	}()
 33145  	_isAgg = bool2int((_p.XselFlags & uint32(8)) != (0))
 33146  	if (Xsqlite3SelectTrace & int32(256)) == 0 {
 33147  		goto _32
 33148  	}
 33149  	if (Xsqlite3SelectTrace & int32(256)) != 0 {
 33150  		_sqlite3DebugPrintf(tls, func() *int8 {
 33151  			_sqlite3DebugPrintf(tls, str(45615), (_pParse.XnSelectIndent*int32(2))-int32(2), unsafe.Pointer(str(284)), unsafe.Pointer(&_p.XzSelName), unsafe.Pointer(_p))
 33152  			return str(46055)
 33153  		}())
 33154  	}
 33155  	_sqlite3TreeViewSelect(tls, nil, _p, 0)
 33156  _32:
 33157  	_i = int32(0)
 33158  _34:
 33159  	if _p.XpPrior != nil || _i >= _pTabList.XnSrc {
 33160  		goto _38
 33161  	}
 33162  	_6_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_i))
 33163  	_6_pSub = (*XSelect)(_6_pItem.XpSelect)
 33164  	_6_pTab = (*XTable)(_6_pItem.XpTab)
 33165  	if _6_pSub == nil {
 33166  		goto _35
 33167  	}
 33168  	if int32(_6_pTab.XnCol) != ((*XExprList)(_6_pSub.XpEList).XnExpr) {
 33169  		_sqlite3ErrorMsg(tls, _pParse, str(46079), int32(_6_pTab.XnCol), unsafe.Pointer(_6_pTab.XzName), (*XExprList)(_6_pSub.XpEList).XnExpr)
 33170  		goto _select_end
 33171  	}
 33172  	_6_isAggSub = bool2int((_6_pSub.XselFlags & uint32(8)) != (0))
 33173  	if _flattenSubquery(tls, _pParse, _p, _i, _isAgg, _6_isAggSub) == 0 {
 33174  		goto _41
 33175  	}
 33176  	if _6_isAggSub != 0 {
 33177  		_isAgg = int32(1)
 33178  		_p.XselFlags |= uint32(8)
 33179  	}
 33180  	_i = int32(-1)
 33181  _41:
 33182  	_pTabList = (*XSrcList)(_p.XpSrc)
 33183  	if _db.XmallocFailed != 0 {
 33184  		goto _select_end
 33185  	}
 33186  	if int32(_pDest.XeDest) > int32(8) {
 33187  		*(**XExprList)(unsafe.Pointer(&_sSort.XpOrderBy)) = (*XExprList)(_p.XpOrderBy)
 33188  	}
 33189  _35:
 33190  	_i += 1
 33191  	goto _34
 33192  _38:
 33193  	_v = _sqlite3GetVdbe(tls, _pParse)
 33194  	if _v == nil {
 33195  		goto _select_end
 33196  	}
 33197  	if _p.XpPrior == nil {
 33198  		goto _46
 33199  	}
 33200  	_rc = _multiSelect(tls, _pParse, _p, _pDest)
 33201  	_pParse.XiSelectId = _iRestoreSelectId
 33202  	if (Xsqlite3SelectTrace & int32(1)) != 0 {
 33203  		_sqlite3DebugPrintf(tls, func() *int8 {
 33204  			_sqlite3DebugPrintf(tls, str(45615), (_pParse.XnSelectIndent*int32(2))-int32(2), unsafe.Pointer(str(284)), unsafe.Pointer(&_p.XzSelName), unsafe.Pointer(_p))
 33205  			return str(46119)
 33206  		}())
 33207  	}
 33208  	_pParse.XnSelectIndent -= 1
 33209  	return _rc
 33210  
 33211  _46:
 33212  	_i = int32(0)
 33213  _48:
 33214  	if _i >= _pTabList.XnSrc {
 33215  		goto _51
 33216  	}
 33217  	_12_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_i))
 33218  	if _12_pItem.XcolUsed == (0) {
 33219  		_sqlite3AuthCheck(tls, _pParse, int32(20), _12_pItem.XzName, str(284), _12_pItem.XzDatabase)
 33220  	}
 33221  	_12_pSub = (*XSelect)(_12_pItem.XpSelect)
 33222  	if _12_pSub == nil {
 33223  		goto _49
 33224  	}
 33225  	if _12_pItem.XaddrFillSub == 0 {
 33226  		goto _54
 33227  	}
 33228  	if int32((uint32((_12_pItem.Xfg.XnotIndexed)>>4)<<31)>>31) == int32(0) {
 33229  		_sqlite3VdbeAddOp2(tls, _v, int32(14), _12_pItem.XregReturn, _12_pItem.XaddrFillSub)
 33230  	}
 33231  	goto _49
 33232  _54:
 33233  	_pParse.XnHeight += _sqlite3SelectExprHeight(tls, _p)
 33234  	if (int32(_12_pItem.Xfg.Xjointype)&int32(32)) != int32(0) || _pushDownWhereTerms(tls, _pParse, _12_pSub, (*XExpr)(_p.XpWhere), _12_pItem.XiCursor) == 0 {
 33235  		goto _57
 33236  	}
 33237  	if (Xsqlite3SelectTrace & int32(256)) == 0 {
 33238  		goto _58
 33239  	}
 33240  	if (Xsqlite3SelectTrace & int32(256)) != 0 {
 33241  		_sqlite3DebugPrintf(tls, func() *int8 {
 33242  			_sqlite3DebugPrintf(tls, str(45615), (_pParse.XnSelectIndent*int32(2))-int32(2), unsafe.Pointer(str(284)), unsafe.Pointer(&_p.XzSelName), unsafe.Pointer(_p))
 33243  			return str(46151)
 33244  		}())
 33245  	}
 33246  	_sqlite3TreeViewSelect(tls, nil, _p, 0)
 33247  _58:
 33248  _57:
 33249  	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)) {
 33250  		_18_addrTop = _sqlite3VdbeCurrentAddr(tls, _v) + int32(1)
 33251  		_12_pItem.XregReturn = preInc2(&_pParse.XnMem, 1)
 33252  		_sqlite3VdbeAddOp3(tls, _v, int32(15), _12_pItem.XregReturn, int32(0), _18_addrTop)
 33253  		_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer((*XTable)(_12_pItem.XpTab).XzName))
 33254  		_12_pItem.XaddrFillSub = _18_addrTop
 33255  		_sqlite3SelectDestInit(tls, &_12_dest, int32(13), _12_pItem.XregReturn)
 33256  		_12_pItem.XiSelectId = uint8(_pParse.XiNextSelectId)
 33257  		_sqlite3Select(tls, _pParse, _12_pSub, &_12_dest)
 33258  		(*XTable)(_12_pItem.XpTab).XnRowLogEst = _12_pSub.XnSelectRow
 33259  		storebits5(&(_12_pItem.Xfg.XnotIndexed), int8(1), 16, 4)
 33260  		_12_pItem.XregResult = _12_dest.XiSdst
 33261  		_sqlite3VdbeEndCoroutine(tls, _v, _12_pItem.XregReturn)
 33262  		_sqlite3VdbeJumpHere(tls, _v, _18_addrTop-int32(1))
 33263  		_sqlite3ClearTempRegCache(tls, _pParse)
 33264  		goto _65
 33265  	}
 33266  	_19_onceAddr = int32(0)
 33267  	func() {
 33268  		if _12_pItem.XaddrFillSub != int32(0) {
 33269  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121778), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(46182)))
 33270  			crt.X__builtin_abort(tls)
 33271  		}
 33272  	}()
 33273  	_12_pItem.XregReturn = preInc2(&_pParse.XnMem, 1)
 33274  	_19_topAddr = _sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _12_pItem.XregReturn)
 33275  	_12_pItem.XaddrFillSub = _19_topAddr + int32(1)
 33276  	if int32((uint32((_12_pItem.Xfg.XnotIndexed)>>3)<<31)>>31) == int32(0) {
 33277  		_19_onceAddr = _sqlite3VdbeAddOp0(tls, _v, int32(20))
 33278  		_sqlite3VdbeComment(tls, _v, str(46204), unsafe.Pointer((*XTable)(_12_pItem.XpTab).XzName))
 33279  		goto _69
 33280  	}
 33281  	_sqlite3VdbeNoopComment(tls, _v, str(46204), unsafe.Pointer((*XTable)(_12_pItem.XpTab).XzName))
 33282  _69:
 33283  	_19_pPrior = _isSelfJoinView(tls, _pTabList, _12_pItem)
 33284  	if _19_pPrior != nil {
 33285  		_sqlite3VdbeAddOp2(tls, _v, int32(108), _12_pItem.XiCursor, _19_pPrior.XiCursor)
 33286  		goto _71
 33287  	}
 33288  	_sqlite3SelectDestInit(tls, &_12_dest, int32(12), _12_pItem.XiCursor)
 33289  	_12_pItem.XiSelectId = uint8(_pParse.XiNextSelectId)
 33290  	_sqlite3Select(tls, _pParse, _12_pSub, &_12_dest)
 33291  _71:
 33292  	(*XTable)(_12_pItem.XpTab).XnRowLogEst = _12_pSub.XnSelectRow
 33293  	if _19_onceAddr != 0 {
 33294  		_sqlite3VdbeJumpHere(tls, _v, _19_onceAddr)
 33295  	}
 33296  	_19_retAddr = _sqlite3VdbeAddOp1(tls, _v, int32(52), _12_pItem.XregReturn)
 33297  	_sqlite3VdbeComment(tls, _v, str(46221), unsafe.Pointer((*XTable)(_12_pItem.XpTab).XzName))
 33298  	_sqlite3VdbeChangeP1(tls, _v, uint32(_19_topAddr), _19_retAddr)
 33299  	_sqlite3ClearTempRegCache(tls, _pParse)
 33300  _65:
 33301  	if _db.XmallocFailed != 0 {
 33302  		goto _select_end
 33303  	}
 33304  	_pParse.XnHeight -= _sqlite3SelectExprHeight(tls, _p)
 33305  _49:
 33306  	_i += 1
 33307  	goto _48
 33308  _51:
 33309  	_pEList = (*XExprList)(_p.XpEList)
 33310  	_pWhere = (*XExpr)(_p.XpWhere)
 33311  	_pGroupBy = (*XExprList)(_p.XpGroupBy)
 33312  	_pHaving = (*XExpr)(_p.XpHaving)
 33313  	_sDistinct.XisTnct = uint8(bool2int((_p.XselFlags & uint32(1)) != (0)))
 33314  	if (Xsqlite3SelectTrace & int32(1024)) == 0 {
 33315  		goto _74
 33316  	}
 33317  	if (Xsqlite3SelectTrace & int32(1024)) != 0 {
 33318  		_sqlite3DebugPrintf(tls, func() *int8 {
 33319  			_sqlite3DebugPrintf(tls, str(45615), (_pParse.XnSelectIndent*int32(2))-int32(2), unsafe.Pointer(str(284)), unsafe.Pointer(&_p.XzSelName), unsafe.Pointer(_p))
 33320  			return str(46228)
 33321  		}())
 33322  	}
 33323  	_sqlite3TreeViewSelect(tls, nil, _p, 0)
 33324  _74:
 33325  	if (_p.XselFlags&uint32(9)) != uint32(1) || _sqlite3ExprListCompare(tls, (*XExprList)(_sSort.XpOrderBy), _pEList, int32(-1)) != int32(0) {
 33326  		goto _77
 33327  	}
 33328  	_p.XselFlags &= uint32(4294967294)
 33329  	_pGroupBy = store70((**XExprList)(unsafe.Pointer(&_p.XpGroupBy)), _sqlite3ExprListDup(tls, _db, _pEList, int32(0)))
 33330  	func() {
 33331  		if _sDistinct.XisTnct == 0 {
 33332  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121849), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(46261)))
 33333  			crt.X__builtin_abort(tls)
 33334  		}
 33335  	}()
 33336  	if (Xsqlite3SelectTrace & int32(1024)) == 0 {
 33337  		goto _80
 33338  	}
 33339  	if (Xsqlite3SelectTrace & int32(1024)) != 0 {
 33340  		_sqlite3DebugPrintf(tls, func() *int8 {
 33341  			_sqlite3DebugPrintf(tls, str(45615), (_pParse.XnSelectIndent*int32(2))-int32(2), unsafe.Pointer(str(284)), unsafe.Pointer(&_p.XzSelName), unsafe.Pointer(_p))
 33342  			return str(46278)
 33343  		}())
 33344  	}
 33345  	_sqlite3TreeViewSelect(tls, nil, _p, 0)
 33346  _80:
 33347  _77:
 33348  	if _sSort.XpOrderBy != nil {
 33349  		_27_pKeyInfo = _keyInfoFromExprList(tls, _pParse, (*XExprList)(_sSort.XpOrderBy), int32(0), _pEList.XnExpr)
 33350  		_sSort.XiECursor = postInc2(&_pParse.XnTab, 1)
 33351  		_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))
 33352  		goto _83
 33353  	}
 33354  	_sSort.XaddrSortIndex = int32(-1)
 33355  _83:
 33356  	if int32(_pDest.XeDest) == int32(12) {
 33357  		_sqlite3VdbeAddOp2(tls, _v, int32(110), _pDest.XiSDParm, _pEList.XnExpr)
 33358  	}
 33359  	_iEnd = _sqlite3VdbeMakeLabel(tls, _v)
 33360  	if (_p.XselFlags & uint32(16384)) == (0) {
 33361  		_p.XnSelectRow = int16(320)
 33362  	}
 33363  	_computeLimitRegisters(tls, _pParse, _p, _iEnd)
 33364  	if (_p.XiLimit == int32(0)) && (_sSort.XaddrSortIndex >= int32(0)) {
 33365  		_sqlite3VdbeChangeOpcode(tls, _v, uint32(_sSort.XaddrSortIndex), uint8(111))
 33366  		{
 33367  			p := &_sSort.XsortFlags
 33368  			*p = uint8(int32(*p) | int32(1))
 33369  		}
 33370  	}
 33371  	if (_p.XselFlags & uint32(1)) != 0 {
 33372  		_sDistinct.XtabTnct = postInc2(&_pParse.XnTab, 1)
 33373  		_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))
 33374  		_sqlite3VdbeChangeP5(tls, _v, uint16(8))
 33375  		_sDistinct.XeTnctType = uint8(3)
 33376  		goto _89
 33377  	}
 33378  	_sDistinct.XeTnctType = 0
 33379  _89:
 33380  	if _isAgg != 0 || _pGroupBy != nil {
 33381  		goto _91
 33382  	}
 33383  	_34_wctrlFlags = uint16(func() int32 {
 33384  		if _sDistinct.XisTnct != 0 {
 33385  			return int32(256)
 33386  		}
 33387  		return int32(0)
 33388  	}())
 33389  
 33390  	{
 33391  		p := &_34_wctrlFlags
 33392  		*p = uint16(uint32(*p) | (_p.XselFlags & uint32(16384)))
 33393  	}
 33394  	_pWInfo = _sqlite3WhereBegin(tls, _pParse, _pTabList, _pWhere, (*XExprList)(_sSort.XpOrderBy), (*XExprList)(_p.XpEList), _34_wctrlFlags, int32(_p.XnSelectRow))
 33395  	if _pWInfo == nil {
 33396  		goto _select_end
 33397  	}
 33398  	if int32(_sqlite3WhereOutputRowCount(tls, _pWInfo)) < int32(_p.XnSelectRow) {
 33399  		_p.XnSelectRow = _sqlite3WhereOutputRowCount(tls, _pWInfo)
 33400  	}
 33401  	if (_sDistinct.XisTnct != 0) && _sqlite3WhereIsDistinct(tls, _pWInfo) != 0 {
 33402  		_sDistinct.XeTnctType = uint8(_sqlite3WhereIsDistinct(tls, _pWInfo))
 33403  	}
 33404  	if _sSort.XpOrderBy == nil {
 33405  		goto _98
 33406  	}
 33407  	_sSort.XnOBSat = _sqlite3WhereIsOrdered(tls, _pWInfo)
 33408  	_sSort.XbOrderedInnerLoop = uint8(_sqlite3WhereOrderedInnerLoop(tls, _pWInfo))
 33409  	if _sSort.XnOBSat == ((*XExprList)(_sSort.XpOrderBy).XnExpr) {
 33410  		*(**XExprList)(unsafe.Pointer(&_sSort.XpOrderBy)) = nil
 33411  	}
 33412  _98:
 33413  	if (_sSort.XaddrSortIndex >= int32(0)) && ((*XExprList)(_sSort.XpOrderBy) == nil) {
 33414  		_sqlite3VdbeChangeToNoop(tls, _v, _sSort.XaddrSortIndex)
 33415  	}
 33416  	_selectInnerLoop(tls, _pParse, _p, _pEList, int32(-1), &_sSort, &_sDistinct, _pDest, _sqlite3WhereContinueLabel(tls, _pWInfo), _sqlite3WhereBreakLabel(tls, _pWInfo))
 33417  	_sqlite3WhereEnd(tls, _pWInfo)
 33418  	goto _102
 33419  _91:
 33420  	_40_sortPTab = int32(0)
 33421  	_40_sortOut = int32(0)
 33422  	_40_orderByGrp = int32(0)
 33423  	if _pGroupBy == nil {
 33424  		goto _103
 33425  	}
 33426  	*func() **TExprList_item { _41_k = (*XExprList)(_p.XpEList).XnExpr; return &_41_pItem }() = (*TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.XpEList).Xa)))
 33427  _104:
 33428  	if _41_k <= int32(0) {
 33429  		goto _107
 33430  	}
 33431  	(*t71)(unsafe.Pointer(&_41_pItem.Xu)).XiAlias = 0
 33432  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _41_k -= 1; return &_41_pItem }())) += uintptr(20)
 33433  	goto _104
 33434  _107:
 33435  	*func() **TExprList_item { _41_k = _pGroupBy.XnExpr; return &_41_pItem }() = (*TExprList_item)(unsafe.Pointer(&_pGroupBy.Xa))
 33436  _108:
 33437  	if _41_k <= int32(0) {
 33438  		goto _111
 33439  	}
 33440  	(*t71)(unsafe.Pointer(&_41_pItem.Xu)).XiAlias = 0
 33441  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _41_k -= 1; return &_41_pItem }())) += uintptr(20)
 33442  	goto _108
 33443  _111:
 33444  	func() {
 33445  		if int32(66) != int32(_sqlite3LogEst(tls, uint64(100))) {
 33446  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121981), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(46313)))
 33447  			crt.X__builtin_abort(tls)
 33448  		}
 33449  	}()
 33450  	if int32(_p.XnSelectRow) > int32(66) {
 33451  		_p.XnSelectRow = int16(66)
 33452  	}
 33453  	goto _115
 33454  _103:
 33455  	func() {
 33456  		if int32(0) != int32(_sqlite3LogEst(tls, uint64(1))) {
 33457  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121984), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(46336)))
 33458  			crt.X__builtin_abort(tls)
 33459  		}
 33460  	}()
 33461  	_p.XnSelectRow = 0
 33462  _115:
 33463  	if _sqlite3ExprListCompare(tls, _pGroupBy, (*XExprList)(_sSort.XpOrderBy), int32(-1)) == int32(0) {
 33464  		_40_orderByGrp = int32(1)
 33465  	}
 33466  	_40_addrEnd = _sqlite3VdbeMakeLabel(tls, _v)
 33467  	crt.Xmemset(tls, unsafe.Pointer(&_40_sNC), int32(0), uint32(32))
 33468  	*(**XParse)(unsafe.Pointer(&_40_sNC.XpParse)) = _pParse
 33469  	*(**XSrcList)(unsafe.Pointer(&_40_sNC.XpSrcList)) = _pTabList
 33470  	*(**XAggInfo)(unsafe.Pointer(&_40_sNC.XpAggInfo)) = &_sAggInfo
 33471  	_sAggInfo.XmnReg = _pParse.XnMem + int32(1)
 33472  	_sAggInfo.XnSortingColumn = func() int32 {
 33473  		if _pGroupBy != nil {
 33474  			return _pGroupBy.XnExpr
 33475  		}
 33476  		return int32(0)
 33477  	}()
 33478  	*(**XExprList)(unsafe.Pointer(&_sAggInfo.XpGroupBy)) = _pGroupBy
 33479  	_sqlite3ExprAnalyzeAggList(tls, &_40_sNC, _pEList)
 33480  	_sqlite3ExprAnalyzeAggList(tls, &_40_sNC, (*XExprList)(_sSort.XpOrderBy))
 33481  	if _pHaving == nil {
 33482  		goto _121
 33483  	}
 33484  	if _pGroupBy != nil {
 33485  		func() {
 33486  			if _pWhere != (*XExpr)(_p.XpWhere) {
 33487  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122018), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(46356)))
 33488  				crt.X__builtin_abort(tls)
 33489  			}
 33490  		}()
 33491  		_havingToWhere(tls, _pParse, _pGroupBy, _pHaving, (**XExpr)(unsafe.Pointer(&_p.XpWhere)))
 33492  		_pWhere = (*XExpr)(_p.XpWhere)
 33493  	}
 33494  	_sqlite3ExprAnalyzeAggregates(tls, &_40_sNC, _pHaving)
 33495  _121:
 33496  	_sAggInfo.XnAccumulator = _sAggInfo.XnColumn
 33497  	_i = int32(0)
 33498  _125:
 33499  	if _i >= _sAggInfo.XnFunc {
 33500  		goto _128
 33501  	}
 33502  	func() {
 33503  		if (((*XExpr)(elem67((*TAggInfo_func)(_sAggInfo.XaFunc), uintptr(_i)).XpExpr).Xflags) & uint32(2048)) != (0) {
 33504  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122026), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(46374)))
 33505  			crt.X__builtin_abort(tls)
 33506  		}
 33507  	}()
 33508  	{
 33509  		p := &_40_sNC.XncFlags
 33510  		*p = uint16(int32(*p) | int32(8))
 33511  	}
 33512  	_sqlite3ExprAnalyzeAggList(tls, &_40_sNC, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&((*XExpr)(elem67((*TAggInfo_func)(_sAggInfo.XaFunc), uintptr(_i)).XpExpr).Xx)))))
 33513  	{
 33514  		p := &_40_sNC.XncFlags
 33515  		*p = uint16(int32(*p) & int32(-9))
 33516  	}
 33517  	_i += 1
 33518  	goto _125
 33519  _128:
 33520  	_sAggInfo.XmxReg = _pParse.XnMem
 33521  	if _db.XmallocFailed != 0 {
 33522  		goto _select_end
 33523  	}
 33524  	if _pGroupBy == nil {
 33525  		goto _132
 33526  	}
 33527  	_sAggInfo.XsortingIdx = postInc2(&_pParse.XnTab, 1)
 33528  	_49_pKeyInfo = _keyInfoFromExprList(tls, _pParse, _pGroupBy, int32(0), _sAggInfo.XnColumn)
 33529  	_49_addrSortingIdx = _sqlite3VdbeAddOp4(tls, _v, int32(111), _sAggInfo.XsortingIdx, _sAggInfo.XnSortingColumn, int32(0), (*int8)(unsafe.Pointer(_49_pKeyInfo)), int32(-5))
 33530  	_40_iUseFlag = preInc2(&_pParse.XnMem, 1)
 33531  	_40_iAbortFlag = preInc2(&_pParse.XnMem, 1)
 33532  	_49_regOutputRow = preInc2(&_pParse.XnMem, 1)
 33533  	_49_addrOutputRow = _sqlite3VdbeMakeLabel(tls, _v)
 33534  	_49_regReset = preInc2(&_pParse.XnMem, 1)
 33535  	_49_addrReset = _sqlite3VdbeMakeLabel(tls, _v)
 33536  	_40_iAMem = _pParse.XnMem + int32(1)
 33537  	_pParse.XnMem += _pGroupBy.XnExpr
 33538  	_40_iBMem = _pParse.XnMem + int32(1)
 33539  	_pParse.XnMem += _pGroupBy.XnExpr
 33540  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _40_iAbortFlag)
 33541  	_sqlite3VdbeComment(tls, _v, str(46430))
 33542  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _40_iUseFlag)
 33543  	_sqlite3VdbeComment(tls, _v, str(46447))
 33544  	_sqlite3VdbeAddOp3(tls, _v, int32(59), int32(0), _40_iAMem, (_40_iAMem+_pGroupBy.XnExpr)-int32(1))
 33545  	_sqlite3VdbeAddOp2(tls, _v, int32(14), _49_regReset, _49_addrReset)
 33546  	_pWInfo = _sqlite3WhereBegin(tls, _pParse, _pTabList, _pWhere, _pGroupBy, nil, uint16(int32(64)|func() int32 {
 33547  		if _40_orderByGrp != 0 {
 33548  			return int32(512)
 33549  		}
 33550  		return int32(0)
 33551  	}()), int32(0))
 33552  	if _pWInfo == nil {
 33553  		goto _select_end
 33554  	}
 33555  	if _sqlite3WhereIsOrdered(tls, _pWInfo) == _pGroupBy.XnExpr {
 33556  		_40_groupBySort = int32(0)
 33557  		goto _137
 33558  	}
 33559  	_explainTempTable(tls, _pParse, func() *int8 {
 33560  		if (_sDistinct.XisTnct != 0) && ((_p.XselFlags & uint32(1)) == (0)) {
 33561  			return str(25671)
 33562  		}
 33563  		return str(46474)
 33564  	}())
 33565  	_40_groupBySort = int32(1)
 33566  	_51_nGroupBy = _pGroupBy.XnExpr
 33567  	_51_nCol = _51_nGroupBy
 33568  	_j = _51_nGroupBy
 33569  	_i = int32(0)
 33570  _141:
 33571  	if _i >= _sAggInfo.XnColumn {
 33572  		goto _144
 33573  	}
 33574  	if (elem66((*TAggInfo_col)(_sAggInfo.XaCol), uintptr(_i)).XiSorterColumn) >= _j {
 33575  		_51_nCol += 1
 33576  		_j += 1
 33577  	}
 33578  	_i += 1
 33579  	goto _141
 33580  _144:
 33581  	_51_regBase = _sqlite3GetTempRange(tls, _pParse, _51_nCol)
 33582  	_sqlite3ExprCacheClear(tls, _pParse)
 33583  	_sqlite3ExprCodeExprList(tls, _pParse, _pGroupBy, _51_regBase, int32(0), 0)
 33584  	_j = _51_nGroupBy
 33585  	_i = int32(0)
 33586  _146:
 33587  	if _i >= _sAggInfo.XnColumn {
 33588  		goto _149
 33589  	}
 33590  	_54_pCol = elem66((*TAggInfo_col)(_sAggInfo.XaCol), uintptr(_i))
 33591  	if _54_pCol.XiSorterColumn >= _j {
 33592  		_55_r1 = _j + _51_regBase
 33593  		_sqlite3ExprCodeGetColumnToReg(tls, _pParse, (*XTable)(_54_pCol.XpTab), _54_pCol.XiColumn, _54_pCol.XiTable, _55_r1)
 33594  		_j += 1
 33595  	}
 33596  	_i += 1
 33597  	goto _146
 33598  _149:
 33599  	_51_regRecord = _sqlite3GetTempReg(tls, _pParse)
 33600  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _51_regBase, _51_nCol, _51_regRecord)
 33601  	_sqlite3VdbeAddOp2(tls, _v, int32(127), _sAggInfo.XsortingIdx, _51_regRecord)
 33602  	_sqlite3ReleaseTempReg(tls, _pParse, _51_regRecord)
 33603  	_sqlite3ReleaseTempRange(tls, _pParse, _51_regBase, _51_nCol)
 33604  	_sqlite3WhereEnd(tls, _pWInfo)
 33605  	_sAggInfo.XsortingIdxPTab = store2(&_40_sortPTab, postInc2(&_pParse.XnTab, 1))
 33606  	_40_sortOut = _sqlite3GetTempReg(tls, _pParse)
 33607  	_sqlite3VdbeAddOp3(tls, _v, int32(113), _40_sortPTab, _40_sortOut, _51_nCol)
 33608  	_sqlite3VdbeAddOp2(tls, _v, int32(35), _sAggInfo.XsortingIdx, _40_addrEnd)
 33609  	_sqlite3VdbeComment(tls, _v, str(46483))
 33610  	_sAggInfo.XuseSortingIdx = uint8(1)
 33611  	_sqlite3ExprCacheClear(tls, _pParse)
 33612  _137:
 33613  	if (_40_orderByGrp != 0 && ((int32(_db.XdbOptFlags) & int32(4)) == int32(0))) && (_40_groupBySort != 0 || _sqlite3WhereIsSorted(tls, _pWInfo) != 0) {
 33614  		*(**XExprList)(unsafe.Pointer(&_sSort.XpOrderBy)) = nil
 33615  		_sqlite3VdbeChangeToNoop(tls, _v, _sSort.XaddrSortIndex)
 33616  	}
 33617  	_49_addrTopOfLoop = _sqlite3VdbeCurrentAddr(tls, _v)
 33618  	_sqlite3ExprCacheClear(tls, _pParse)
 33619  	if _40_groupBySort != 0 {
 33620  		_sqlite3VdbeAddOp3(tls, _v, int32(123), _sAggInfo.XsortingIdx, _40_sortOut, _40_sortPTab)
 33621  	}
 33622  	_j = int32(0)
 33623  _156:
 33624  	if _j >= _pGroupBy.XnExpr {
 33625  		goto _159
 33626  	}
 33627  	if _40_groupBySort != 0 {
 33628  		_sqlite3VdbeAddOp3(tls, _v, int32(99), _40_sortPTab, _j, _40_iBMem+_j)
 33629  		goto _161
 33630  	}
 33631  	_sAggInfo.XdirectMode = uint8(1)
 33632  	_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pGroupBy.Xa)), uintptr(_j)).XpExpr), _40_iBMem+_j)
 33633  _161:
 33634  	_j += 1
 33635  	goto _156
 33636  _159:
 33637  	_sqlite3VdbeAddOp4(tls, _v, int32(98), _40_iAMem, _40_iBMem, _pGroupBy.XnExpr, (*int8)(unsafe.Pointer(_sqlite3KeyInfoRef(tls, _49_pKeyInfo))), int32(-5))
 33638  	_49_addr1 = _sqlite3VdbeCurrentAddr(tls, _v)
 33639  	_sqlite3VdbeAddOp3(tls, _v, int32(18), _49_addr1+int32(1), int32(0), _49_addr1+int32(1))
 33640  	_sqlite3ExprCodeMove(tls, _pParse, _40_iBMem, _40_iAMem, _pGroupBy.XnExpr)
 33641  	_sqlite3VdbeAddOp2(tls, _v, int32(14), _49_regOutputRow, _49_addrOutputRow)
 33642  	_sqlite3VdbeComment(tls, _v, str(46497))
 33643  	_sqlite3VdbeAddOp2(tls, _v, int32(46), _40_iAbortFlag, _40_addrEnd)
 33644  	_sqlite3VdbeComment(tls, _v, str(46512))
 33645  	_sqlite3VdbeAddOp2(tls, _v, int32(14), _49_regReset, _49_addrReset)
 33646  	_sqlite3VdbeComment(tls, _v, str(46529))
 33647  	_sqlite3VdbeJumpHere(tls, _v, _49_addr1)
 33648  	_updateAccumulator(tls, _pParse, &_sAggInfo)
 33649  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(1), _40_iUseFlag)
 33650  	_sqlite3VdbeComment(tls, _v, str(46547))
 33651  	if _40_groupBySort != 0 {
 33652  		_sqlite3VdbeAddOp2(tls, _v, int32(3), _sAggInfo.XsortingIdx, _49_addrTopOfLoop)
 33653  		goto _163
 33654  	}
 33655  	_sqlite3WhereEnd(tls, _pWInfo)
 33656  	_sqlite3VdbeChangeToNoop(tls, _v, _49_addrSortingIdx)
 33657  _163:
 33658  	_sqlite3VdbeAddOp2(tls, _v, int32(14), _49_regOutputRow, _49_addrOutputRow)
 33659  	_sqlite3VdbeComment(tls, _v, str(46576))
 33660  	_sqlite3VdbeGoto(tls, _v, _40_addrEnd)
 33661  	_49_addrSetAbort = _sqlite3VdbeCurrentAddr(tls, _v)
 33662  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(1), _40_iAbortFlag)
 33663  	_sqlite3VdbeComment(tls, _v, str(46593))
 33664  	_sqlite3VdbeAddOp1(tls, _v, int32(52), _49_regOutputRow)
 33665  	_sqlite3VdbeResolveLabel(tls, _v, _49_addrOutputRow)
 33666  	_49_addrOutputRow = _sqlite3VdbeCurrentAddr(tls, _v)
 33667  	_sqlite3VdbeAddOp2(tls, _v, int32(46), _40_iUseFlag, _49_addrOutputRow+int32(2))
 33668  	_sqlite3VdbeComment(tls, _v, str(46608))
 33669  	_sqlite3VdbeAddOp1(tls, _v, int32(52), _49_regOutputRow)
 33670  	_finalizeAggFunctions(tls, _pParse, &_sAggInfo)
 33671  	_sqlite3ExprIfFalse(tls, _pParse, _pHaving, _49_addrOutputRow+int32(1), int32(16))
 33672  	_selectInnerLoop(tls, _pParse, _p, (*XExprList)(_p.XpEList), int32(-1), &_sSort, &_sDistinct, _pDest, _49_addrOutputRow+int32(1), _49_addrSetAbort)
 33673  	_sqlite3VdbeAddOp1(tls, _v, int32(52), _49_regOutputRow)
 33674  	_sqlite3VdbeComment(tls, _v, str(46645))
 33675  	_sqlite3VdbeResolveLabel(tls, _v, _49_addrReset)
 33676  	_resetAccumulator(tls, _pParse, &_sAggInfo)
 33677  	_sqlite3VdbeAddOp1(tls, _v, int32(52), _49_regReset)
 33678  	goto _164
 33679  _132:
 33680  	_63_pDel = nil
 33681  	if store72(&_63_pTab, _isSimpleCount(tls, _p, &_sAggInfo)) == nil {
 33682  		goto _165
 33683  	}
 33684  	_64_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), (*XSchema)(_63_pTab.XpSchema))
 33685  	_64_iCsr = postInc2(&_pParse.XnTab, 1)
 33686  	_64_pKeyInfo = nil
 33687  	_64_pBest = nil
 33688  	_64_iRoot = _63_pTab.Xtnum
 33689  	_sqlite3CodeVerifySchema(tls, _pParse, _64_iDb)
 33690  	_sqlite3TableLock(tls, _pParse, _64_iDb, _63_pTab.Xtnum, 0, _63_pTab.XzName)
 33691  	if (_63_pTab.XtabFlags & uint32(32)) != (0) {
 33692  		_64_pBest = _sqlite3PrimaryKeyIndex(tls, _63_pTab)
 33693  	}
 33694  	_64_pIdx = (*XIndex)(_63_pTab.XpIndex)
 33695  _167:
 33696  	if _64_pIdx == nil {
 33697  		goto _170
 33698  	}
 33699  	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))) {
 33700  		_64_pBest = _64_pIdx
 33701  	}
 33702  	_64_pIdx = (*XIndex)(_64_pIdx.XpNext)
 33703  	goto _167
 33704  _170:
 33705  	if _64_pBest != nil {
 33706  		_64_iRoot = _64_pBest.Xtnum
 33707  		_64_pKeyInfo = _sqlite3KeyInfoOfIndex(tls, _pParse, _64_pBest)
 33708  	}
 33709  	_sqlite3VdbeAddOp4Int(tls, _v, int32(106), _64_iCsr, _64_iRoot, _64_iDb, int32(1))
 33710  	if _64_pKeyInfo != nil {
 33711  		_sqlite3VdbeChangeP4(tls, _v, int32(-1), (*int8)(unsafe.Pointer(_64_pKeyInfo)), int32(-5))
 33712  	}
 33713  	_sqlite3VdbeAddOp2(tls, _v, int32(102), _64_iCsr, elem67((*TAggInfo_func)(_sAggInfo.XaFunc), 0).XiMem)
 33714  	_sqlite3VdbeAddOp1(tls, _v, int32(114), _64_iCsr)
 33715  	_explainSimpleCount(tls, _pParse, _63_pTab, _64_pBest)
 33716  	goto _178
 33717  _165:
 33718  	_69_pMinMax = nil
 33719  	_69_flag = uint8(0)
 33720  	func() {
 33721  		if (*XExprList)(_p.XpGroupBy) != nil {
 33722  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122352), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(46674)))
 33723  			crt.X__builtin_abort(tls)
 33724  		}
 33725  	}()
 33726  	func() {
 33727  		if int32(_69_flag) != int32(0) {
 33728  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122353), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(46689)))
 33729  			crt.X__builtin_abort(tls)
 33730  		}
 33731  	}()
 33732  	if (*XExpr)(_p.XpHaving) == nil {
 33733  		_69_flag = _minMaxQuery(tls, &_sAggInfo, &_69_pMinMax)
 33734  	}
 33735  	func() {
 33736  		if int32(_69_flag) != int32(0) && (_69_pMinMax == nil || _69_pMinMax.XnExpr != int32(1)) {
 33737  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122357), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(46697)))
 33738  			crt.X__builtin_abort(tls)
 33739  		}
 33740  	}()
 33741  	if _69_flag == 0 {
 33742  		goto _188
 33743  	}
 33744  	_69_pMinMax = _sqlite3ExprListDup(tls, _db, _69_pMinMax, int32(0))
 33745  	_63_pDel = _69_pMinMax
 33746  	func() {
 33747  		if _db.XmallocFailed == 0 && _69_pMinMax == nil {
 33748  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122362), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(46742)))
 33749  			crt.X__builtin_abort(tls)
 33750  		}
 33751  	}()
 33752  	if _db.XmallocFailed == 0 {
 33753  		elem57((*TExprList_item)(unsafe.Pointer(&_69_pMinMax.Xa)), 0).XsortOrder = uint8(func() int32 {
 33754  			if int32(_69_flag) != int32(1) {
 33755  				return int32(1)
 33756  			}
 33757  			return int32(0)
 33758  		}())
 33759  		(*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_69_pMinMax.Xa)), 0).XpExpr).Xop = uint8(152)
 33760  	}
 33761  _188:
 33762  	_resetAccumulator(tls, _pParse, &_sAggInfo)
 33763  	_pWInfo = _sqlite3WhereBegin(tls, _pParse, _pTabList, _pWhere, _69_pMinMax, nil, uint16(_69_flag), int32(0))
 33764  	if _pWInfo == nil {
 33765  		_sqlite3ExprListDelete(tls, _db, _63_pDel)
 33766  		goto _select_end
 33767  	}
 33768  	_updateAccumulator(tls, _pParse, &_sAggInfo)
 33769  	func() {
 33770  		if _69_pMinMax != nil && _69_pMinMax.XnExpr != int32(1) {
 33771  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122380), unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000), unsafe.Pointer(str(46773)))
 33772  			crt.X__builtin_abort(tls)
 33773  		}
 33774  	}()
 33775  	if _sqlite3WhereIsOrdered(tls, _pWInfo) > int32(0) {
 33776  		_sqlite3VdbeGoto(tls, _v, _sqlite3WhereBreakLabel(tls, _pWInfo))
 33777  		_sqlite3VdbeComment(tls, _v, str(46805), unsafe.Pointer(func() *int8 {
 33778  			if int32(_69_flag) == int32(1) {
 33779  				return str(7610)
 33780  			}
 33781  			return str(7614)
 33782  		}()))
 33783  	}
 33784  	_sqlite3WhereEnd(tls, _pWInfo)
 33785  	_finalizeAggFunctions(tls, _pParse, &_sAggInfo)
 33786  _178:
 33787  	*(**XExprList)(unsafe.Pointer(&_sSort.XpOrderBy)) = nil
 33788  	_sqlite3ExprIfFalse(tls, _pParse, _pHaving, _40_addrEnd, int32(16))
 33789  	_selectInnerLoop(tls, _pParse, _p, (*XExprList)(_p.XpEList), int32(-1), nil, nil, _pDest, _40_addrEnd, _40_addrEnd)
 33790  	_sqlite3ExprListDelete(tls, _db, _63_pDel)
 33791  _164:
 33792  	_sqlite3VdbeResolveLabel(tls, _v, _40_addrEnd)
 33793  _102:
 33794  	if int32(_sDistinct.XeTnctType) == int32(3) {
 33795  		_explainTempTable(tls, _pParse, str(25671))
 33796  	}
 33797  	if _sSort.XpOrderBy != nil {
 33798  		_explainTempTable(tls, _pParse, func() *int8 {
 33799  			if _sSort.XnOBSat > int32(0) {
 33800  				return str(46819)
 33801  			}
 33802  			return str(46842)
 33803  		}())
 33804  		_generateSortTail(tls, _pParse, _p, &_sSort, _pEList.XnExpr, _pDest)
 33805  	}
 33806  	_sqlite3VdbeResolveLabel(tls, _v, _iEnd)
 33807  	_rc = bool2int(_pParse.XnErr > int32(0))
 33808  _select_end:
 33809  	_pParse.XiSelectId = _iRestoreSelectId
 33810  	if (_rc == int32(0)) && (int32(_pDest.XeDest) == int32(9)) {
 33811  		_generateColumnNames(tls, _pParse, _pTabList, _pEList)
 33812  	}
 33813  	_sqlite3DbFree(tls, _db, _sAggInfo.XaCol)
 33814  	_sqlite3DbFree(tls, _db, _sAggInfo.XaFunc)
 33815  	if (Xsqlite3SelectTrace & int32(1)) != 0 {
 33816  		_sqlite3DebugPrintf(tls, func() *int8 {
 33817  			_sqlite3DebugPrintf(tls, str(45615), (_pParse.XnSelectIndent*int32(2))-int32(2), unsafe.Pointer(str(284)), unsafe.Pointer(&_p.XzSelName), unsafe.Pointer(_p))
 33818  			return str(46851)
 33819  		}())
 33820  	}
 33821  	_pParse.XnSelectIndent -= 1
 33822  	return _rc
 33823  }
 33824  
 33825  // C comment
 33826  //  /*
 33827  //  ** Do an authorization check using the code and arguments given.  Return
 33828  //  ** either SQLITE_OK (zero) or SQLITE_IGNORE or SQLITE_DENY.  If SQLITE_DENY
 33829  //  ** is returned, then the error count and error message in pParse are
 33830  //  ** modified appropriately.
 33831  //  */
 33832  func _sqlite3AuthCheck(tls *crt.TLS, _pParse *XParse, _code int32, _zArg1 *int8, _zArg2 *int8, _zArg3 *int8) (r0 int32) {
 33833  	var _rc int32
 33834  	var _db *Xsqlite3
 33835  	_db = (*Xsqlite3)(_pParse.Xdb)
 33836  	if ((_db.Xinit.Xbusy) != 0) || (_pParse.XdeclareVtab != 0) {
 33837  		return int32(0)
 33838  	}
 33839  	if _db.XxAuth == nil {
 33840  		return int32(0)
 33841  	}
 33842  	_rc = _db.XxAuth(tls, _db.XpAuthArg, _code, _zArg1, _zArg2, _zArg3, _pParse.XzAuthContext)
 33843  	if _rc == int32(1) {
 33844  		_sqlite3ErrorMsg(tls, _pParse, str(7881))
 33845  		_pParse.Xrc = int32(23)
 33846  		goto _6
 33847  	}
 33848  	if (_rc != int32(0)) && (_rc != int32(2)) {
 33849  		_rc = int32(1)
 33850  		_sqliteAuthBadReturnCode(tls, _pParse)
 33851  	}
 33852  _6:
 33853  	return _rc
 33854  }
 33855  
 33856  // C comment
 33857  //  /*
 33858  //  ** Write an error message into pParse->zErrMsg that explains that the
 33859  //  ** user-supplied authorization function returned an illegal value.
 33860  //  */
 33861  func _sqliteAuthBadReturnCode(tls *crt.TLS, _pParse *XParse) {
 33862  	_sqlite3ErrorMsg(tls, _pParse, str(46867))
 33863  	_pParse.Xrc = int32(1)
 33864  }
 33865  
 33866  var Xsqlite3SelectTrace int32
 33867  
 33868  // C comment
 33869  //  /*
 33870  //  ** A version of printf() that understands %lld.  Used for debugging.
 33871  //  ** The printf() built into some versions of windows does not understand %lld
 33872  //  ** and segfaults if you give it a long long int.
 33873  //  */
 33874  func _sqlite3DebugPrintf(tls *crt.TLS, _zFormat *int8, args ...interface{}) {
 33875  	var _ap []interface{}
 33876  	var _acc XStrAccum
 33877  	var _zBuf [500]int8
 33878  	_sqlite3StrAccumInit(tls, &_acc, nil, (*int8)(unsafe.Pointer(&_zBuf)), int32(500), int32(0))
 33879  	_ap = args
 33880  	_sqlite3VXPrintf(tls, &_acc, _zFormat, _ap)
 33881  	_ap = nil
 33882  	_sqlite3StrAccumFinish(tls, &_acc)
 33883  	crt.Xfprintf(tls, (*crt.XFILE)(Xstdout), str(24531), unsafe.Pointer(&_zBuf))
 33884  	crt.Xfflush(tls, (*crt.XFILE)(Xstdout))
 33885  	_ = _zBuf
 33886  }
 33887  
 33888  // C comment
 33889  //  /*
 33890  //  ** Generate a human-readable description of a Select object.
 33891  //  */
 33892  func _sqlite3TreeViewSelect(tls *crt.TLS, _pView *t73, _p *XSelect, _moreToFollow uint8) {
 33893  	var _n, _cnt, _6_i int32
 33894  	var _21_zOp *int8
 33895  	var _7_zLine [100]int8
 33896  	var _7_x XStrAccum
 33897  	var _7_pItem *TSrcList_item
 33898  	_n = int32(0)
 33899  	_cnt = int32(0)
 33900  	if _p == nil {
 33901  		_sqlite3TreeViewLine(tls, _pView, str(46890))
 33902  		return
 33903  	}
 33904  	_pView = _sqlite3TreeViewPush(tls, _pView, _moreToFollow)
 33905  	if _p.XpWith != nil {
 33906  		_sqlite3TreeViewWith(tls, _pView, (*XWith)(_p.XpWith), uint8(1))
 33907  		_cnt = int32(1)
 33908  		_sqlite3TreeViewPush(tls, _pView, uint8(1))
 33909  	}
 33910  _1:
 33911  	_sqlite3TreeViewLine(tls, _pView, str(46901), unsafe.Pointer(func() *int8 {
 33912  		if (_p.XselFlags & uint32(1)) != 0 {
 33913  			return str(46947)
 33914  		}
 33915  		return str(284)
 33916  	}()), unsafe.Pointer(func() *int8 {
 33917  		if (_p.XselFlags & uint32(8)) != 0 {
 33918  			return str(46957)
 33919  		}
 33920  		return str(284)
 33921  	}()), unsafe.Pointer(_p), _p.XselFlags, int32(_p.XnSelectRow))
 33922  	if postInc2(&_cnt, 1) != 0 {
 33923  		_sqlite3TreeViewPop(tls, _pView)
 33924  	}
 33925  	if _p.XpPrior != nil {
 33926  		_n = int32(1000)
 33927  		goto _9
 33928  	}
 33929  	_n = int32(0)
 33930  	if (_p.XpSrc != nil) && ((*XSrcList)(_p.XpSrc).XnSrc) != 0 {
 33931  		_n += 1
 33932  	}
 33933  	if _p.XpWhere != nil {
 33934  		_n += 1
 33935  	}
 33936  	if _p.XpGroupBy != nil {
 33937  		_n += 1
 33938  	}
 33939  	if _p.XpHaving != nil {
 33940  		_n += 1
 33941  	}
 33942  	if _p.XpOrderBy != nil {
 33943  		_n += 1
 33944  	}
 33945  	if _p.XpLimit != nil {
 33946  		_n += 1
 33947  	}
 33948  	if _p.XpOffset != nil {
 33949  		_n += 1
 33950  	}
 33951  _9:
 33952  	_sqlite3TreeViewExprList(tls, _pView, (*XExprList)(_p.XpEList), uint8(bool2int(postInc2(&_n, -1) > int32(0))), str(46967))
 33953  	if _p.XpSrc == nil || ((*XSrcList)(_p.XpSrc).XnSrc) == 0 {
 33954  		goto _19
 33955  	}
 33956  	_pView = _sqlite3TreeViewPush(tls, _pView, uint8(bool2int(postInc2(&_n, -1) > int32(0))))
 33957  	_sqlite3TreeViewLine(tls, _pView, str(25684))
 33958  	_6_i = int32(0)
 33959  _20:
 33960  	if _6_i >= ((*XSrcList)(_p.XpSrc).XnSrc) {
 33961  		goto _23
 33962  	}
 33963  	_7_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.XpSrc).Xa))), uintptr(_6_i))
 33964  	_sqlite3StrAccumInit(tls, &_7_x, nil, (*int8)(unsafe.Pointer(&_7_zLine)), int32(100), int32(0))
 33965  	_sqlite3XPrintf(tls, &_7_x, str(46978), _7_pItem.XiCursor)
 33966  	if _7_pItem.XzDatabase != nil {
 33967  		_sqlite3XPrintf(tls, &_7_x, str(46985), unsafe.Pointer(_7_pItem.XzDatabase), unsafe.Pointer(_7_pItem.XzName))
 33968  		goto _26
 33969  	}
 33970  	if _7_pItem.XzName != nil {
 33971  		_sqlite3XPrintf(tls, &_7_x, str(46992), unsafe.Pointer(_7_pItem.XzName))
 33972  	}
 33973  _26:
 33974  	if _7_pItem.XpTab != nil {
 33975  		_sqlite3XPrintf(tls, &_7_x, str(46996), unsafe.Pointer((*XTable)(_7_pItem.XpTab).XzName))
 33976  	}
 33977  	if _7_pItem.XzAlias != nil {
 33978  		_sqlite3XPrintf(tls, &_7_x, str(47008), unsafe.Pointer(_7_pItem.XzAlias))
 33979  	}
 33980  	if (int32(_7_pItem.Xfg.Xjointype) & int32(8)) != 0 {
 33981  		_sqlite3XPrintf(tls, &_7_x, str(47017))
 33982  	}
 33983  	_sqlite3StrAccumFinish(tls, &_7_x)
 33984  	_sqlite3TreeViewItem(tls, _pView, (*int8)(unsafe.Pointer(&_7_zLine)), uint8(bool2int(_6_i < (((*XSrcList)(_p.XpSrc).XnSrc)-int32(1)))))
 33985  	if _7_pItem.XpSelect != nil {
 33986  		_sqlite3TreeViewSelect(tls, _pView, (*XSelect)(_7_pItem.XpSelect), 0)
 33987  	}
 33988  	if ((uint32((_7_pItem.Xfg.XnotIndexed)>>2) << 31) >> 31) != 0 {
 33989  		_sqlite3TreeViewExprList(tls, _pView, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_7_pItem.Xu1))), 0, str(47028))
 33990  	}
 33991  	_sqlite3TreeViewPop(tls, _pView)
 33992  	_6_i += 1
 33993  	goto _20
 33994  _23:
 33995  	_sqlite3TreeViewPop(tls, _pView)
 33996  _19:
 33997  	if _p.XpWhere != nil {
 33998  		_sqlite3TreeViewItem(tls, _pView, str(25725), uint8(bool2int(postInc2(&_n, -1) > int32(0))))
 33999  		_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_p.XpWhere), 0)
 34000  		_sqlite3TreeViewPop(tls, _pView)
 34001  	}
 34002  	if _p.XpGroupBy != nil {
 34003  		_sqlite3TreeViewExprList(tls, _pView, (*XExprList)(_p.XpGroupBy), uint8(bool2int(postInc2(&_n, -1) > int32(0))), str(47039))
 34004  	}
 34005  	if _p.XpHaving != nil {
 34006  		_sqlite3TreeViewItem(tls, _pView, str(25712), uint8(bool2int(postInc2(&_n, -1) > int32(0))))
 34007  		_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_p.XpHaving), 0)
 34008  		_sqlite3TreeViewPop(tls, _pView)
 34009  	}
 34010  	if _p.XpOrderBy != nil {
 34011  		_sqlite3TreeViewExprList(tls, _pView, (*XExprList)(_p.XpOrderBy), uint8(bool2int(postInc2(&_n, -1) > int32(0))), str(47047))
 34012  	}
 34013  	if _p.XpLimit != nil {
 34014  		_sqlite3TreeViewItem(tls, _pView, str(25719), uint8(bool2int(postInc2(&_n, -1) > int32(0))))
 34015  		_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_p.XpLimit), 0)
 34016  		_sqlite3TreeViewPop(tls, _pView)
 34017  	}
 34018  	if _p.XpOffset != nil {
 34019  		_sqlite3TreeViewItem(tls, _pView, str(25247), uint8(bool2int(postInc2(&_n, -1) > int32(0))))
 34020  		_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_p.XpOffset), 0)
 34021  		_sqlite3TreeViewPop(tls, _pView)
 34022  	}
 34023  	if _p.XpPrior == nil {
 34024  		goto _38
 34025  	}
 34026  	_21_zOp = str(25630)
 34027  	switch int32(_p.Xop) {
 34028  	case int32(116):
 34029  		goto _40
 34030  	case int32(117):
 34031  		goto _42
 34032  	case int32(118):
 34033  		goto _41
 34034  	default:
 34035  		goto _43
 34036  	}
 34037  
 34038  _40:
 34039  	_21_zOp = str(47055)
 34040  	goto _43
 34041  _41:
 34042  	_21_zOp = str(25647)
 34043  	goto _43
 34044  _42:
 34045  	_21_zOp = str(25640)
 34046  	goto _43
 34047  _43:
 34048  	_sqlite3TreeViewItem(tls, _pView, _21_zOp, uint8(1))
 34049  _38:
 34050  	_p = (*XSelect)(_p.XpPrior)
 34051  	if _p != nil {
 34052  		goto _1
 34053  	}
 34054  	_sqlite3TreeViewPop(tls, _pView)
 34055  	_ = _n
 34056  	_ = _cnt
 34057  	_ = _7_zLine
 34058  }
 34059  
 34060  // C comment
 34061  //  /*
 34062  //  ** Generate a single line of output for the tree, with a prefix that contains
 34063  //  ** all the appropriate tree lines
 34064  //  */
 34065  func _sqlite3TreeViewLine(tls *crt.TLS, _p *t73, _zFormat *int8, args ...interface{}) {
 34066  	var _i int32
 34067  	var _ap []interface{}
 34068  	var _acc XStrAccum
 34069  	var _zBuf [500]int8
 34070  	_sqlite3StrAccumInit(tls, &_acc, nil, (*int8)(unsafe.Pointer(&_zBuf)), int32(500), int32(0))
 34071  	if _p == nil {
 34072  		goto _0
 34073  	}
 34074  	_i = int32(0)
 34075  _1:
 34076  	if _i >= _p.XiLevel || uint32(_i) >= uint32(99) {
 34077  		goto _5
 34078  	}
 34079  	_sqlite3StrAccumAppend(tls, &_acc, func() *int8 {
 34080  		if (*elem15((*uint8)(unsafe.Pointer(&_p.XbLine)), uintptr(_i))) != 0 {
 34081  			return str(47065)
 34082  		}
 34083  		return str(47070)
 34084  	}(), int32(4))
 34085  	_i += 1
 34086  	goto _1
 34087  _5:
 34088  	_sqlite3StrAccumAppend(tls, &_acc, func() *int8 {
 34089  		if (*elem15((*uint8)(unsafe.Pointer(&_p.XbLine)), uintptr(_i))) != 0 {
 34090  			return str(47075)
 34091  		}
 34092  		return str(47080)
 34093  	}(), int32(4))
 34094  _0:
 34095  	_ap = args
 34096  	_sqlite3VXPrintf(tls, &_acc, _zFormat, _ap)
 34097  	_ap = nil
 34098  	func() {
 34099  		if _acc.XnChar <= (0) {
 34100  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(26243), unsafe.Pointer(&_sqlite3TreeViewLineØ00__func__Ø000), unsafe.Pointer(str(47085)))
 34101  			crt.X__builtin_abort(tls)
 34102  		}
 34103  	}()
 34104  	if int32(*elem1((*int8)(unsafe.Pointer(&_zBuf)), uintptr(_acc.XnChar-uint32(1)))) != int32(10) {
 34105  		_sqlite3StrAccumAppend(tls, &_acc, str(37655), int32(1))
 34106  	}
 34107  	_sqlite3StrAccumFinish(tls, &_acc)
 34108  	crt.Xfprintf(tls, (*crt.XFILE)(Xstdout), str(24531), unsafe.Pointer(&_zBuf))
 34109  	crt.Xfflush(tls, (*crt.XFILE)(Xstdout))
 34110  	_ = _zBuf
 34111  }
 34112  
 34113  var _sqlite3TreeViewLineØ00__func__Ø000 [20]int8
 34114  
 34115  func init() {
 34116  	crt.Xstrncpy(nil, &_sqlite3TreeViewLineØ00__func__Ø000[0], str(47097), 20)
 34117  }
 34118  
 34119  // C comment
 34120  //  /*
 34121  //  ** Add a new subitem to the tree.  The moreToFollow flag indicates that this
 34122  //  ** is not the last item in the tree.
 34123  //  */
 34124  func _sqlite3TreeViewPush(tls *crt.TLS, _p *t73, _moreToFollow uint8) (r0 *t73) {
 34125  	if _p != nil {
 34126  		goto _0
 34127  	}
 34128  	_p = (*t73)(Xsqlite3_malloc64(tls, uint64(104)))
 34129  	if _p == nil {
 34130  		return nil
 34131  	}
 34132  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint32(104))
 34133  	goto _2
 34134  _0:
 34135  	_p.XiLevel += 1
 34136  _2:
 34137  	func() {
 34138  		if int32(_moreToFollow) != int32(0) && int32(_moreToFollow) != int32(1) {
 34139  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(26210), unsafe.Pointer(&_sqlite3TreeViewPushØ00__func__Ø000), unsafe.Pointer(str(47117)))
 34140  			crt.X__builtin_abort(tls)
 34141  		}
 34142  	}()
 34143  	if uint32(_p.XiLevel) < uint32(100) {
 34144  		*elem15((*uint8)(unsafe.Pointer(&_p.XbLine)), uintptr(_p.XiLevel)) = _moreToFollow
 34145  	}
 34146  	return _p
 34147  }
 34148  
 34149  var _sqlite3TreeViewPushØ00__func__Ø000 [20]int8
 34150  
 34151  func init() {
 34152  	crt.Xstrncpy(nil, &_sqlite3TreeViewPushØ00__func__Ø000[0], str(47152), 20)
 34153  }
 34154  
 34155  // C comment
 34156  //  /*
 34157  //  ** Generate a human-readable description of a WITH clause.
 34158  //  */
 34159  func _sqlite3TreeViewWith(tls *crt.TLS, _pView *t73, _pWith *XWith, _moreToFollow uint8) {
 34160  	var _i, _5_j int32
 34161  	var _5_cSep int8
 34162  	var _4_x XStrAccum
 34163  	var _4_zLine [1000]int8
 34164  	var _4_pCte *TCte
 34165  	if _pWith == nil {
 34166  		return
 34167  	}
 34168  	if _pWith.XnCte == int32(0) {
 34169  		return
 34170  	}
 34171  	if _pWith.XpOuter != nil {
 34172  		_sqlite3TreeViewLine(tls, _pView, str(47172), unsafe.Pointer(_pWith), _pWith.XpOuter)
 34173  		goto _3
 34174  	}
 34175  	_sqlite3TreeViewLine(tls, _pView, str(47197), unsafe.Pointer(_pWith))
 34176  _3:
 34177  	if _pWith.XnCte <= int32(0) {
 34178  		goto _4
 34179  	}
 34180  	_pView = _sqlite3TreeViewPush(tls, _pView, uint8(1))
 34181  	_i = int32(0)
 34182  _5:
 34183  	if _i >= _pWith.XnCte {
 34184  		goto _8
 34185  	}
 34186  	_4_pCte = elem43((*TCte)(unsafe.Pointer(&_pWith.Xa)), uintptr(_i))
 34187  	_sqlite3StrAccumInit(tls, &_4_x, nil, (*int8)(unsafe.Pointer(&_4_zLine)), int32(1000), int32(0))
 34188  	_sqlite3XPrintf(tls, &_4_x, str(24531), unsafe.Pointer(_4_pCte.XzName))
 34189  	if _4_pCte.XpCols == nil || ((*XExprList)(_4_pCte.XpCols).XnExpr) <= int32(0) {
 34190  		goto _10
 34191  	}
 34192  	_5_cSep = int8(40)
 34193  	_5_j = int32(0)
 34194  _11:
 34195  	if _5_j >= ((*XExprList)(_4_pCte.XpCols).XnExpr) {
 34196  		goto _14
 34197  	}
 34198  	_sqlite3XPrintf(tls, &_4_x, str(24890), int32(_5_cSep), unsafe.Pointer(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_4_pCte.XpCols).Xa))), uintptr(_5_j)).XzName))
 34199  	_5_cSep = int8(44)
 34200  	_5_j += 1
 34201  	goto _11
 34202  _14:
 34203  	_sqlite3XPrintf(tls, &_4_x, str(37853))
 34204  _10:
 34205  	_sqlite3XPrintf(tls, &_4_x, str(47209))
 34206  	_sqlite3StrAccumFinish(tls, &_4_x)
 34207  	_sqlite3TreeViewItem(tls, _pView, (*int8)(unsafe.Pointer(&_4_zLine)), uint8(bool2int(_i < (_pWith.XnCte-int32(1)))))
 34208  	_sqlite3TreeViewSelect(tls, _pView, (*XSelect)(_4_pCte.XpSelect), 0)
 34209  	_sqlite3TreeViewPop(tls, _pView)
 34210  	_i += 1
 34211  	goto _5
 34212  _8:
 34213  	_sqlite3TreeViewPop(tls, _pView)
 34214  _4:
 34215  	_ = _4_zLine
 34216  }
 34217  
 34218  // C comment
 34219  //  /*
 34220  //  ** Shorthand for starting a new tree item that consists of a single label
 34221  //  */
 34222  func _sqlite3TreeViewItem(tls *crt.TLS, _p *t73, _zLabel *int8, _moreFollows uint8) {
 34223  	_p = _sqlite3TreeViewPush(tls, _p, _moreFollows)
 34224  	_sqlite3TreeViewLine(tls, _p, str(24531), unsafe.Pointer(_zLabel))
 34225  }
 34226  
 34227  // C comment
 34228  //  /*
 34229  //  ** Finished with one layer of the tree
 34230  //  */
 34231  func _sqlite3TreeViewPop(tls *crt.TLS, _p *t73) {
 34232  	if _p == nil {
 34233  		return
 34234  	}
 34235  	_p.XiLevel -= 1
 34236  	if _p.XiLevel < int32(0) {
 34237  		Xsqlite3_free(tls, unsafe.Pointer(_p))
 34238  	}
 34239  }
 34240  
 34241  func _sqlite3TreeViewExprList(tls *crt.TLS, _pView *t73, _pList *XExprList, _moreToFollow uint8, _zLabel *int8) {
 34242  	_pView = _sqlite3TreeViewPush(tls, _pView, _moreToFollow)
 34243  	_sqlite3TreeViewBareExprList(tls, _pView, _pList, _zLabel)
 34244  	_sqlite3TreeViewPop(tls, _pView)
 34245  }
 34246  
 34247  // C comment
 34248  //  /*
 34249  //  ** Generate a human-readable explanation of an expression list.
 34250  //  */
 34251  func _sqlite3TreeViewBareExprList(tls *crt.TLS, _pView *t73, _pList *XExprList, _zLabel *int8) {
 34252  	var _2_i, _3_j int32
 34253  	if (_zLabel == nil) || (int32(*elem1(_zLabel, 0)) == int32(0)) {
 34254  		_zLabel = str(44954)
 34255  	}
 34256  	if _pList == nil {
 34257  		_sqlite3TreeViewLine(tls, _pView, str(47213), unsafe.Pointer(_zLabel))
 34258  		goto _3
 34259  	}
 34260  	_sqlite3TreeViewLine(tls, _pView, str(24531), unsafe.Pointer(_zLabel))
 34261  	_2_i = int32(0)
 34262  _4:
 34263  	if _2_i >= _pList.XnExpr {
 34264  		goto _7
 34265  	}
 34266  	_3_j = int32((*t71)(unsafe.Pointer(&(elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_2_i)).Xu))).XiOrderByCol)
 34267  	if _3_j != 0 {
 34268  		_sqlite3TreeViewPush(tls, _pView, 0)
 34269  		_sqlite3TreeViewLine(tls, _pView, str(47224), _3_j)
 34270  	}
 34271  	_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_2_i)).XpExpr), uint8(bool2int(_2_i < (_pList.XnExpr-int32(1)))))
 34272  	if _3_j != 0 {
 34273  		_sqlite3TreeViewPop(tls, _pView)
 34274  	}
 34275  	_2_i += 1
 34276  	goto _4
 34277  _7:
 34278  _3:
 34279  }
 34280  
 34281  // C comment
 34282  //  /*
 34283  //  ** Generate a human-readable explanation of an expression tree.
 34284  //  */
 34285  func _sqlite3TreeViewExpr(tls *crt.TLS, _pView *t73, _pExpr *XExpr, _moreToFollow uint8) {
 34286  	var _zBinOp, _zUniOp, _38_zType *int8
 34287  	var _24_pFarg *XExprList
 34288  	var _35_pX, _35_pY, _35_pZ *XExpr
 34289  	var _zFlgs [60]int8
 34290  	_zBinOp = nil
 34291  	_zUniOp = nil
 34292  	_pView = _sqlite3TreeViewPush(tls, _pView, _moreToFollow)
 34293  	if _pExpr == nil {
 34294  		_sqlite3TreeViewLine(tls, _pView, str(47239))
 34295  		_sqlite3TreeViewPop(tls, _pView)
 34296  		return
 34297  	}
 34298  	if _pExpr.Xflags == 0 {
 34299  		goto _1
 34300  	}
 34301  	if (_pExpr.Xflags & uint32(1)) != (0) {
 34302  		Xsqlite3_snprintf(tls, int32(60), (*int8)(unsafe.Pointer(&_zFlgs)), str(47243), _pExpr.Xflags, int32(_pExpr.XiRightJoinTable))
 34303  		goto _3
 34304  	}
 34305  	Xsqlite3_snprintf(tls, int32(60), (*int8)(unsafe.Pointer(&_zFlgs)), str(47264), _pExpr.Xflags)
 34306  _3:
 34307  	goto _4
 34308  _1:
 34309  	*elem1((*int8)(unsafe.Pointer(&_zFlgs)), 0) = 0
 34310  _4:
 34311  	switch int32(_pExpr.Xop) {
 34312  	case int32(19):
 34313  		goto _41
 34314  	case int32(20):
 34315  		goto _48
 34316  	case int32(27):
 34317  		goto _15
 34318  	case int32(37):
 34319  		goto _16
 34320  	case int32(50):
 34321  		goto _55
 34322  	case int32(56):
 34323  		goto _54
 34324  	case int32(61):
 34325  		goto _52
 34326  	case int32(70):
 34327  		goto _26
 34328  	case int32(71):
 34329  		goto _25
 34330  	case int32(72):
 34331  		goto _23
 34332  	case int32(73):
 34333  		goto _51
 34334  	case int32(74):
 34335  		goto _50
 34336  	case int32(75):
 34337  		goto _42
 34338  	case int32(76):
 34339  		goto _43
 34340  	case int32(77):
 34341  		goto _21
 34342  	case int32(78):
 34343  		goto _22
 34344  	case int32(79):
 34345  		goto _19
 34346  	case int32(80):
 34347  		goto _18
 34348  	case int32(81):
 34349  		goto _17
 34350  	case int32(82):
 34351  		goto _20
 34352  	case int32(84):
 34353  		goto _31
 34354  	case int32(85):
 34355  		goto _32
 34356  	case int32(86):
 34357  		goto _34
 34358  	case int32(87):
 34359  		goto _35
 34360  	case int32(88):
 34361  		goto _27
 34362  	case int32(89):
 34363  		goto _29
 34364  	case int32(90):
 34365  		goto _28
 34366  	case int32(91):
 34367  		goto _33
 34368  	case int32(92):
 34369  		goto _30
 34370  	case int32(93):
 34371  		goto _36
 34372  	case int32(94):
 34373  		goto _45
 34374  	case int32(95):
 34375  		goto _40
 34376  	case int32(97):
 34377  		goto _10
 34378  	case int32(101):
 34379  		goto _11
 34380  	case int32(119):
 34381  		goto _49
 34382  	case int32(122):
 34383  		goto _37
 34384  	case int32(132):
 34385  		goto _9
 34386  	case int32(133):
 34387  		goto _12
 34388  	case int32(134):
 34389  		goto _8
 34390  	case int32(135):
 34391  		goto _13
 34392  	case int32(136):
 34393  		goto _53
 34394  	case int32(148):
 34395  		goto _24
 34396  	case int32(151):
 34397  		goto _46
 34398  	case int32(152):
 34399  		goto _7
 34400  	case int32(153):
 34401  		goto _46
 34402  	case int32(154):
 34403  		goto _6
 34404  	case int32(155):
 34405  		goto _38
 34406  	case int32(156):
 34407  		goto _39
 34408  	case int32(157):
 34409  		goto _14
 34410  	case int32(158):
 34411  		goto _56
 34412  	case int32(159):
 34413  		goto _57
 34414  	case int32(160):
 34415  		goto _58
 34416  	case int32(162):
 34417  		goto _44
 34418  	default:
 34419  		goto _59
 34420  	}
 34421  
 34422  _6:
 34423  	_sqlite3TreeViewLine(tls, _pView, str(47277), _pExpr.XiTable, int32(_pExpr.XiColumn), unsafe.Pointer(&_zFlgs))
 34424  	goto _60
 34425  _7:
 34426  	if _pExpr.XiTable < int32(0) {
 34427  		_sqlite3TreeViewLine(tls, _pView, str(47290), int32(_pExpr.XiColumn), unsafe.Pointer(&_zFlgs))
 34428  		goto _62
 34429  	}
 34430  	_sqlite3TreeViewLine(tls, _pView, str(47303), _pExpr.XiTable, int32(_pExpr.XiColumn), unsafe.Pointer(&_zFlgs))
 34431  _62:
 34432  	goto _60
 34433  _8:
 34434  	if (_pExpr.Xflags & uint32(1024)) != 0 {
 34435  		_sqlite3TreeViewLine(tls, _pView, str(37870), *(*int32)(unsafe.Pointer(&_pExpr.Xu)))
 34436  		goto _64
 34437  	}
 34438  	_sqlite3TreeViewLine(tls, _pView, str(24531), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 34439  _64:
 34440  	goto _60
 34441  _9:
 34442  	_sqlite3TreeViewLine(tls, _pView, str(24531), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 34443  	goto _60
 34444  _10:
 34445  	_sqlite3TreeViewLine(tls, _pView, str(47313), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 34446  	goto _60
 34447  _11:
 34448  	_sqlite3TreeViewLine(tls, _pView, str(285))
 34449  	goto _60
 34450  _12:
 34451  	_sqlite3TreeViewLine(tls, _pView, str(24531), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 34452  	goto _60
 34453  _13:
 34454  	_sqlite3TreeViewLine(tls, _pView, str(47316), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))), int32(_pExpr.XiColumn))
 34455  	goto _60
 34456  _14:
 34457  	_sqlite3TreeViewLine(tls, _pView, str(47332), _pExpr.XiTable)
 34458  	goto _60
 34459  _15:
 34460  	_sqlite3TreeViewLine(tls, _pView, str(47345), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 34461  	goto _60
 34462  _16:
 34463  	_sqlite3TreeViewLine(tls, _pView, str(47353), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 34464  	_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.XpLeft), 0)
 34465  	goto _60
 34466  _17:
 34467  	_zBinOp = str(25407)
 34468  	goto _60
 34469  _18:
 34470  	_zBinOp = str(25404)
 34471  	goto _60
 34472  _19:
 34473  	_zBinOp = str(25401)
 34474  	goto _60
 34475  _20:
 34476  	_zBinOp = str(25410)
 34477  	goto _60
 34478  _21:
 34479  	_zBinOp = str(25395)
 34480  	goto _60
 34481  _22:
 34482  	_zBinOp = str(25398)
 34483  	goto _60
 34484  _23:
 34485  	_zBinOp = str(25366)
 34486  	goto _60
 34487  _24:
 34488  	_zBinOp = str(47361)
 34489  	goto _60
 34490  _25:
 34491  	_zBinOp = str(25362)
 34492  	goto _60
 34493  _26:
 34494  	_zBinOp = str(25359)
 34495  	goto _60
 34496  _27:
 34497  	_zBinOp = str(25796)
 34498  	goto _60
 34499  _28:
 34500  	_zBinOp = str(47367)
 34501  	goto _60
 34502  _29:
 34503  	_zBinOp = str(47371)
 34504  	goto _60
 34505  _30:
 34506  	_zBinOp = str(25469)
 34507  	goto _60
 34508  _31:
 34509  	_zBinOp = str(25420)
 34510  	goto _60
 34511  _32:
 34512  	_zBinOp = str(25427)
 34513  	goto _60
 34514  _33:
 34515  	_zBinOp = str(47375)
 34516  	goto _60
 34517  _34:
 34518  	_zBinOp = str(25433)
 34519  	goto _60
 34520  _35:
 34521  	_zBinOp = str(25440)
 34522  	goto _60
 34523  _36:
 34524  	_zBinOp = str(25473)
 34525  	goto _60
 34526  _37:
 34527  	_zBinOp = str(25680)
 34528  	goto _60
 34529  _38:
 34530  	_zUniOp = str(47379)
 34531  	goto _60
 34532  _39:
 34533  	_zUniOp = str(47386)
 34534  	goto _60
 34535  _40:
 34536  	_zUniOp = str(25488)
 34537  	goto _60
 34538  _41:
 34539  	_zUniOp = str(25042)
 34540  	goto _60
 34541  _42:
 34542  	_zUniOp = str(25380)
 34543  	goto _60
 34544  _43:
 34545  	_zUniOp = str(25387)
 34546  	goto _60
 34547  _44:
 34548  	_sqlite3TreeViewLine(tls, _pView, str(47392), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 34549  	_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.XpLeft), 0)
 34550  	goto _60
 34551  _45:
 34552  	_sqlite3TreeViewLine(tls, _pView, str(47400), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 34553  	_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.XpLeft), 0)
 34554  	goto _60
 34555  _46:
 34556  	if (_pExpr.Xflags & uint32(16384)) != (0) {
 34557  		_24_pFarg = nil
 34558  		goto _66
 34559  	}
 34560  	_24_pFarg = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 34561  _66:
 34562  	if int32(_pExpr.Xop) == int32(153) {
 34563  		_sqlite3TreeViewLine(tls, _pView, str(47411), int32(_pExpr.Xop2), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 34564  		goto _68
 34565  	}
 34566  	_sqlite3TreeViewLine(tls, _pView, str(47429), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 34567  _68:
 34568  	if _24_pFarg != nil {
 34569  		_sqlite3TreeViewExprList(tls, _pView, _24_pFarg, 0, nil)
 34570  	}
 34571  	goto _60
 34572  _48:
 34573  	_sqlite3TreeViewLine(tls, _pView, str(47441))
 34574  	_sqlite3TreeViewSelect(tls, _pView, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))), 0)
 34575  	goto _60
 34576  _49:
 34577  	_sqlite3TreeViewLine(tls, _pView, str(47453))
 34578  	_sqlite3TreeViewSelect(tls, _pView, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))), 0)
 34579  	goto _60
 34580  _50:
 34581  	_sqlite3TreeViewLine(tls, _pView, str(25377))
 34582  	_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.XpLeft), uint8(1))
 34583  	if (_pExpr.Xflags & uint32(2048)) != (0) {
 34584  		_sqlite3TreeViewSelect(tls, _pView, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))), 0)
 34585  		goto _71
 34586  	}
 34587  	_sqlite3TreeViewExprList(tls, _pView, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))), 0, nil)
 34588  _71:
 34589  	goto _60
 34590  _51:
 34591  	_35_pX = (*XExpr)(_pExpr.XpLeft)
 34592  	_35_pY = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).Xa))), 0).XpExpr)
 34593  	_35_pZ = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).Xa))), uintptr(1)).XpExpr)
 34594  	_sqlite3TreeViewLine(tls, _pView, str(25369))
 34595  	_sqlite3TreeViewExpr(tls, _pView, _35_pX, uint8(1))
 34596  	_sqlite3TreeViewExpr(tls, _pView, _35_pY, uint8(1))
 34597  	_sqlite3TreeViewExpr(tls, _pView, _35_pZ, 0)
 34598  	goto _60
 34599  _52:
 34600  	_sqlite3TreeViewLine(tls, _pView, str(37863), unsafe.Pointer(func() *int8 {
 34601  		if _pExpr.XiTable != 0 {
 34602  			return str(47465)
 34603  		}
 34604  		return str(47469)
 34605  	}()), int32(_pExpr.XiColumn))
 34606  	goto _60
 34607  _53:
 34608  	_sqlite3TreeViewLine(tls, _pView, str(25764))
 34609  	_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.XpLeft), uint8(1))
 34610  	_sqlite3TreeViewExprList(tls, _pView, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))), 0, nil)
 34611  	goto _60
 34612  _54:
 34613  	_38_zType = str(47473)
 34614  	switch int32(_pExpr.Xaffinity) {
 34615  	case int32(1):
 34616  		goto _75
 34617  	case int32(2):
 34618  		goto _76
 34619  	case int32(3):
 34620  		goto _77
 34621  	case int32(4):
 34622  		goto _78
 34623  	default:
 34624  		goto _79
 34625  	}
 34626  
 34627  _75:
 34628  	_38_zType = str(47477)
 34629  	goto _79
 34630  _76:
 34631  	_38_zType = str(47486)
 34632  	goto _79
 34633  _77:
 34634  	_38_zType = str(47492)
 34635  	goto _79
 34636  _78:
 34637  	_38_zType = str(47497)
 34638  	goto _79
 34639  _79:
 34640  	_sqlite3TreeViewLine(tls, _pView, str(47504), unsafe.Pointer(_38_zType), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pExpr.Xu))))
 34641  	goto _60
 34642  _55:
 34643  	_sqlite3TreeViewLine(tls, _pView, str(47517), _pExpr.XiTable, int32(_pExpr.XiColumn), unsafe.Pointer(&_zFlgs))
 34644  	_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.XpRight), 0)
 34645  	goto _60
 34646  _56:
 34647  	_sqlite3TreeViewBareExprList(tls, _pView, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))), str(47533))
 34648  	goto _60
 34649  _57:
 34650  	_sqlite3TreeViewLine(tls, _pView, str(47540), int32(_pExpr.XiColumn))
 34651  	_sqlite3TreeViewSelect(tls, _pView, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&((*XExpr)(_pExpr.XpLeft).Xx)))), 0)
 34652  	goto _60
 34653  _58:
 34654  	_sqlite3TreeViewLine(tls, _pView, str(47557), _pExpr.XiTable)
 34655  	_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.XpLeft), 0)
 34656  	goto _60
 34657  _59:
 34658  	_sqlite3TreeViewLine(tls, _pView, str(47572), int32(_pExpr.Xop))
 34659  	goto _60
 34660  _60:
 34661  	if _zBinOp != nil {
 34662  		_sqlite3TreeViewLine(tls, _pView, str(6791), unsafe.Pointer(_zBinOp), unsafe.Pointer(&_zFlgs))
 34663  		_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.XpLeft), uint8(1))
 34664  		_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.XpRight), 0)
 34665  		goto _82
 34666  	}
 34667  	if _zUniOp != nil {
 34668  		_sqlite3TreeViewLine(tls, _pView, str(6791), unsafe.Pointer(_zUniOp), unsafe.Pointer(&_zFlgs))
 34669  		_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.XpLeft), 0)
 34670  	}
 34671  _82:
 34672  	_sqlite3TreeViewPop(tls, _pView)
 34673  	_ = _zFlgs
 34674  }
 34675  
 34676  var _sqlite3SelectØ00__func__Ø000 [14]int8
 34677  
 34678  func init() {
 34679  	crt.Xstrncpy(nil, &_sqlite3SelectØ00__func__Ø000[0], str(47578), 14)
 34680  }
 34681  
 34682  // C comment
 34683  //  /*
 34684  //  ** This routine sets up a SELECT statement for processing.  The
 34685  //  ** following is accomplished:
 34686  //  **
 34687  //  **     *  VDBE Cursor numbers are assigned to all FROM-clause terms.
 34688  //  **     *  Ephemeral Table objects are created for all FROM-clause subqueries.
 34689  //  **     *  ON and USING clauses are shifted into WHERE statements
 34690  //  **     *  Wildcards "*" and "TABLE.*" in result sets are expanded.
 34691  //  **     *  Identifiers in expression are matched to tables.
 34692  //  **
 34693  //  ** This routine acts recursively on all subqueries within the SELECT.
 34694  //  */
 34695  func _sqlite3SelectPrep(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pOuterNC *XNameContext) {
 34696  	var _db *Xsqlite3
 34697  	if func() int32 {
 34698  		if _p == nil {
 34699  			return func() int32 {
 34700  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121240), unsafe.Pointer(&_sqlite3SelectPrepØ00__func__Ø000), unsafe.Pointer(str(4809)))
 34701  				crt.X__builtin_abort(tls)
 34702  				return int32(1)
 34703  			}()
 34704  		}
 34705  		return int32(0)
 34706  	}() != 0 {
 34707  		return
 34708  	}
 34709  	_db = (*Xsqlite3)(_pParse.Xdb)
 34710  	if _db.XmallocFailed != 0 {
 34711  		return
 34712  	}
 34713  	if (_p.XselFlags & uint32(128)) != 0 {
 34714  		return
 34715  	}
 34716  	_sqlite3SelectExpand(tls, _pParse, _p)
 34717  	if _pParse.XnErr != 0 || (_db.XmallocFailed != 0) {
 34718  		return
 34719  	}
 34720  	_sqlite3ResolveSelectNames(tls, _pParse, _p, _pOuterNC)
 34721  	if _pParse.XnErr != 0 || (_db.XmallocFailed != 0) {
 34722  		return
 34723  	}
 34724  	_sqlite3SelectAddTypeInfo(tls, _pParse, _p)
 34725  }
 34726  
 34727  var _sqlite3SelectPrepØ00__func__Ø000 [18]int8
 34728  
 34729  func init() {
 34730  	crt.Xstrncpy(nil, &_sqlite3SelectPrepØ00__func__Ø000[0], str(47592), 18)
 34731  }
 34732  
 34733  // C comment
 34734  //  /*
 34735  //  ** This routine "expands" a SELECT statement and all of its subqueries.
 34736  //  ** For additional information on what it means to "expand" a SELECT
 34737  //  ** statement, see the comment on the selectExpand worker callback above.
 34738  //  **
 34739  //  ** Expanding a SELECT statement is the first step in processing a
 34740  //  ** SELECT statement.  The SELECT statement must be expanded before
 34741  //  ** name resolution is performed.
 34742  //  **
 34743  //  ** If anything goes wrong, an error message is written into pParse.
 34744  //  ** The calling function can detect the problem by looking at pParse->nErr
 34745  //  ** and/or pParse->db->mallocFailed.
 34746  //  */
 34747  func _sqlite3SelectExpand(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect) {
 34748  	var _w XWalker
 34749  	crt.Xmemset(tls, unsafe.Pointer(&_w), int32(0), uint32(28))
 34750  	*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_w.XxExprCallback)) = _sqlite3ExprWalkNoop
 34751  	*(**XParse)(unsafe.Pointer(&_w.XpParse)) = _pParse
 34752  	if _pParse.XhasCompound != 0 {
 34753  		*(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer(&_w.XxSelectCallback)) = _convertCompoundSelectToSubquery
 34754  		_sqlite3WalkSelect(tls, &_w, _pSelect)
 34755  	}
 34756  	*(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer(&_w.XxSelectCallback)) = _selectExpander
 34757  	*(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer(&_w.XxSelectCallback2)) = _selectPopWith
 34758  	_sqlite3WalkSelect(tls, &_w, _pSelect)
 34759  }
 34760  
 34761  // C comment
 34762  //  /*
 34763  //  ** No-op routine for the parse-tree walker.
 34764  //  **
 34765  //  ** When this routine is the Walker.xExprCallback then expression trees
 34766  //  ** are walked without any actions being taken at each node.  Presumably,
 34767  //  ** when this routine is used for Walker.xExprCallback then
 34768  //  ** Walker.xSelectCallback is set to do something useful for every
 34769  //  ** subquery in the parser tree.
 34770  //  */
 34771  func _sqlite3ExprWalkNoop(tls *crt.TLS, _NotUsed *XWalker, _NotUsed2 *XExpr) (r0 int32) {
 34772  	_ = _NotUsed2
 34773  	return int32(0)
 34774  }
 34775  
 34776  // C comment
 34777  //  /*
 34778  //  ** Detect compound SELECT statements that use an ORDER BY clause with
 34779  //  ** an alternative collating sequence.
 34780  //  **
 34781  //  **    SELECT ... FROM t1 EXCEPT SELECT ... FROM t2 ORDER BY .. COLLATE ...
 34782  //  **
 34783  //  ** These are rewritten as a subquery:
 34784  //  **
 34785  //  **    SELECT * FROM (SELECT ... FROM t1 EXCEPT SELECT ... FROM t2)
 34786  //  **     ORDER BY ... COLLATE ...
 34787  //  **
 34788  //  ** This transformation is necessary because the multiSelectOrderBy() routine
 34789  //  ** above that generates the code for a compound SELECT with an ORDER BY clause
 34790  //  ** uses a merge algorithm that requires the same collating sequence on the
 34791  //  ** result columns as on the ORDER BY clause.  See ticket
 34792  //  ** http://www.sqlite.org/src/info/6709574d2a
 34793  //  **
 34794  //  ** This transformation is only needed for EXCEPT, INTERSECT, and UNION.
 34795  //  ** The UNION ALL operator works fine with multiSelectOrderBy() even when
 34796  //  ** there are COLLATE terms in the ORDER BY.
 34797  //  */
 34798  func _convertCompoundSelectToSubquery(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) {
 34799  	var _i int32
 34800  	var _dummy XToken
 34801  	var _db *Xsqlite3
 34802  	var _pNewSrc *XSrcList
 34803  	var _a *TExprList_item
 34804  	var _pNew, _pX *XSelect
 34805  	var _pParse *XParse
 34806  	if (*XSelect)(_p.XpPrior) == nil {
 34807  		return int32(0)
 34808  	}
 34809  	if (*XExprList)(_p.XpOrderBy) == nil {
 34810  		return int32(0)
 34811  	}
 34812  	_pX = _p
 34813  _2:
 34814  	if _pX == nil || int32(_pX.Xop) != int32(116) && int32(_pX.Xop) != int32(119) {
 34815  		goto _7
 34816  	}
 34817  	_pX = (*XSelect)(_pX.XpPrior)
 34818  	goto _2
 34819  _7:
 34820  	if _pX == nil {
 34821  		return int32(0)
 34822  	}
 34823  	_a = (*TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.XpOrderBy).Xa)))
 34824  	_i = ((*XExprList)(_p.XpOrderBy).XnExpr) - int32(1)
 34825  _9:
 34826  	if _i < int32(0) {
 34827  		goto _12
 34828  	}
 34829  	if (((*XExpr)(elem57(_a, uintptr(_i)).XpExpr).Xflags) & uint32(256)) != 0 {
 34830  		goto _12
 34831  	}
 34832  	_i -= 1
 34833  	goto _9
 34834  _12:
 34835  	if _i < int32(0) {
 34836  		return int32(0)
 34837  	}
 34838  	_pParse = (*XParse)(_pWalker.XpParse)
 34839  	_db = (*Xsqlite3)(_pParse.Xdb)
 34840  	_pNew = (*XSelect)(_sqlite3DbMallocZero(tls, _db, uint64(80)))
 34841  	if _pNew == nil {
 34842  		return int32(2)
 34843  	}
 34844  	crt.Xmemset(tls, unsafe.Pointer(&_dummy), int32(0), uint32(8))
 34845  	_pNewSrc = _sqlite3SrcListAppendFromTerm(tls, _pParse, nil, nil, nil, &_dummy, _pNew, nil, nil)
 34846  	if _pNewSrc == nil {
 34847  		return int32(2)
 34848  	}
 34849  	*_pNew = *_p
 34850  	*(**XSrcList)(unsafe.Pointer(&_p.XpSrc)) = _pNewSrc
 34851  	*(**XExprList)(unsafe.Pointer(&_p.XpEList)) = _sqlite3ExprListAppend(tls, _pParse, nil, _sqlite3Expr(tls, _db, int32(161), nil))
 34852  	_p.Xop = uint8(119)
 34853  	*(**XExpr)(unsafe.Pointer(&_p.XpWhere)) = nil
 34854  	*(**XExprList)(unsafe.Pointer(&_pNew.XpGroupBy)) = nil
 34855  	*(**XExpr)(unsafe.Pointer(&_pNew.XpHaving)) = nil
 34856  	*(**XExprList)(unsafe.Pointer(&_pNew.XpOrderBy)) = nil
 34857  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = nil
 34858  	*(**XSelect)(unsafe.Pointer(&_p.XpNext)) = nil
 34859  	*(**XWith)(unsafe.Pointer(&_p.XpWith)) = nil
 34860  	_p.XselFlags &= uint32(4294967039)
 34861  	func() {
 34862  		if (_p.XselFlags & uint32(65536)) != (0) {
 34863  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120599), unsafe.Pointer(&_convertCompoundSelectToSubqueryØ00__func__Ø000), unsafe.Pointer(str(47610)))
 34864  			crt.X__builtin_abort(tls)
 34865  		}
 34866  	}()
 34867  	_p.XselFlags |= uint32(65536)
 34868  	func() {
 34869  		if (*XSelect)(_pNew.XpPrior) == nil {
 34870  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120601), unsafe.Pointer(&_convertCompoundSelectToSubqueryØ00__func__Ø000), unsafe.Pointer(str(47642)))
 34871  			crt.X__builtin_abort(tls)
 34872  		}
 34873  	}()
 34874  	*(**XSelect)(unsafe.Pointer(&((*XSelect)(_pNew.XpPrior).XpNext))) = _pNew
 34875  	*(**XExpr)(unsafe.Pointer(&_pNew.XpLimit)) = nil
 34876  	*(**XExpr)(unsafe.Pointer(&_pNew.XpOffset)) = nil
 34877  	return int32(0)
 34878  }
 34879  
 34880  // C comment
 34881  //  /*
 34882  //  ** This routine is called by the parser to add a new term to the
 34883  //  ** end of a growing FROM clause.  The "p" parameter is the part of
 34884  //  ** the FROM clause that has already been constructed.  "p" is NULL
 34885  //  ** if this is the first term of the FROM clause.  pTable and pDatabase
 34886  //  ** are the name of the table and database named in the FROM clause term.
 34887  //  ** pDatabase is NULL if the database name qualifier is missing - the
 34888  //  ** usual case.  If the term has an alias, then pAlias points to the
 34889  //  ** alias token.  If the term is a subquery, then pSubquery is the
 34890  //  ** SELECT statement that the subquery encodes.  The pTable and
 34891  //  ** pDatabase parameters are NULL for subqueries.  The pOn and pUsing
 34892  //  ** parameters are the content of the ON and USING clauses.
 34893  //  **
 34894  //  ** Return a new SrcList which encodes is the FROM with the new
 34895  //  ** term added.
 34896  //  */
 34897  func _sqlite3SrcListAppendFromTerm(tls *crt.TLS, _pParse *XParse, _p *XSrcList, _pTable *XToken, _pDatabase *XToken, _pAlias *XToken, _pSubquery *XSelect, _pOn *XExpr, _pUsing *XIdList) (r0 *XSrcList) {
 34898  	var _db *Xsqlite3
 34899  	var _pItem *TSrcList_item
 34900  	_db = (*Xsqlite3)(_pParse.Xdb)
 34901  	if (_p == nil) && ((_pOn != nil) || (_pUsing != nil)) {
 34902  		_sqlite3ErrorMsg(tls, _pParse, str(47658), unsafe.Pointer(func() *int8 {
 34903  			if _pOn != nil {
 34904  				return str(25578)
 34905  			}
 34906  			return str(25694)
 34907  		}()))
 34908  		goto _append_from_error
 34909  	}
 34910  	_p = _sqlite3SrcListAppend(tls, _db, _p, _pTable, _pDatabase)
 34911  	if (_p == nil) || func() int32 {
 34912  		if _p.XnSrc == int32(0) {
 34913  			return func() int32 {
 34914  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103550), unsafe.Pointer(&_sqlite3SrcListAppendFromTermØ00__func__Ø000), unsafe.Pointer(str(4809)))
 34915  				crt.X__builtin_abort(tls)
 34916  				return int32(1)
 34917  			}()
 34918  		}
 34919  		return int32(0)
 34920  	}() != 0 {
 34921  		goto _append_from_error
 34922  	}
 34923  	_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&_p.Xa)), uintptr(_p.XnSrc-int32(1)))
 34924  	func() {
 34925  		if _pAlias == nil {
 34926  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103554), unsafe.Pointer(&_sqlite3SrcListAppendFromTermØ00__func__Ø000), unsafe.Pointer(str(47694)))
 34927  			crt.X__builtin_abort(tls)
 34928  		}
 34929  	}()
 34930  	if _pAlias.Xn != 0 {
 34931  		_pItem.XzAlias = _sqlite3NameFromToken(tls, _db, _pAlias)
 34932  	}
 34933  	*(**XSelect)(unsafe.Pointer(&_pItem.XpSelect)) = _pSubquery
 34934  	*(**XExpr)(unsafe.Pointer(&_pItem.XpOn)) = _pOn
 34935  	*(**XIdList)(unsafe.Pointer(&_pItem.XpUsing)) = _pUsing
 34936  	return _p
 34937  
 34938  _append_from_error:
 34939  	func() {
 34940  		if _p != nil {
 34941  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103564), unsafe.Pointer(&_sqlite3SrcListAppendFromTermØ00__func__Ø000), unsafe.Pointer(str(47704)))
 34942  			crt.X__builtin_abort(tls)
 34943  		}
 34944  	}()
 34945  	_sqlite3ExprDelete(tls, _db, _pOn)
 34946  	_sqlite3IdListDelete(tls, _db, _pUsing)
 34947  	_sqlite3SelectDelete(tls, _db, _pSubquery)
 34948  	return nil
 34949  }
 34950  
 34951  // C comment
 34952  //  /*
 34953  //  ** Append a new table name to the given SrcList.  Create a new SrcList if
 34954  //  ** need be.  A new entry is created in the SrcList even if pTable is NULL.
 34955  //  **
 34956  //  ** A SrcList is returned, or NULL if there is an OOM error.  The returned
 34957  //  ** SrcList might be the same as the SrcList that was input or it might be
 34958  //  ** a new one.  If an OOM error does occurs, then the prior value of pList
 34959  //  ** that is input to this routine is automatically freed.
 34960  //  **
 34961  //  ** If pDatabase is not null, it means that the table has an optional
 34962  //  ** database name prefix.  Like this:  "database.table".  The pDatabase
 34963  //  ** points to the table name and the pTable points to the database name.
 34964  //  ** The SrcList.a[].zName field is filled with the table name which might
 34965  //  ** come from pTable (if pDatabase is NULL) or from pDatabase.
 34966  //  ** SrcList.a[].zDatabase is filled with the database name from pTable,
 34967  //  ** or with NULL if no database is specified.
 34968  //  **
 34969  //  ** In other words, if call like this:
 34970  //  **
 34971  //  **         sqlite3SrcListAppend(D,A,B,0);
 34972  //  **
 34973  //  ** Then B is a table name and the database name is unspecified.  If called
 34974  //  ** like this:
 34975  //  **
 34976  //  **         sqlite3SrcListAppend(D,A,B,C);
 34977  //  **
 34978  //  ** Then C is the table name and B is the database name.  If C is defined
 34979  //  ** then so is B.  In other words, we never have a case where:
 34980  //  **
 34981  //  **         sqlite3SrcListAppend(D,A,0,C);
 34982  //  **
 34983  //  ** Both pTable and pDatabase are assumed to be quoted.  They are dequoted
 34984  //  ** before being added to the SrcList.
 34985  //  */
 34986  func _sqlite3SrcListAppend(tls *crt.TLS, _db *Xsqlite3, _pList *XSrcList, _pTable *XToken, _pDatabase *XToken) (r0 *XSrcList) {
 34987  	var _5_pTemp *XToken
 34988  	var _pItem *TSrcList_item
 34989  	func() {
 34990  		if _pDatabase != nil && _pTable == nil {
 34991  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103446), unsafe.Pointer(&_sqlite3SrcListAppendØ00__func__Ø000), unsafe.Pointer(str(47709)))
 34992  			crt.X__builtin_abort(tls)
 34993  		}
 34994  	}()
 34995  	func() {
 34996  		if _db == nil {
 34997  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103447), unsafe.Pointer(&_sqlite3SrcListAppendØ00__func__Ø000), unsafe.Pointer(str(1219)))
 34998  			crt.X__builtin_abort(tls)
 34999  		}
 35000  	}()
 35001  	if _pList != nil {
 35002  		goto _5
 35003  	}
 35004  	_pList = (*XSrcList)(_sqlite3DbMallocRawNN(tls, _db, uint64(76)))
 35005  	if _pList == nil {
 35006  		return nil
 35007  	}
 35008  	_pList.XnAlloc = uint32(1)
 35009  	_pList.XnSrc = int32(1)
 35010  	crt.Xmemset(tls, unsafe.Pointer(elem6((*TSrcList_item)(unsafe.Pointer(&_pList.Xa)), 0)), int32(0), uint32(68))
 35011  	elem6((*TSrcList_item)(unsafe.Pointer(&_pList.Xa)), 0).XiCursor = int32(-1)
 35012  	goto _7
 35013  _5:
 35014  	_pList = _sqlite3SrcListEnlarge(tls, _db, _pList, int32(1), _pList.XnSrc)
 35015  _7:
 35016  	if _db.XmallocFailed != 0 {
 35017  		_sqlite3SrcListDelete(tls, _db, _pList)
 35018  		return nil
 35019  	}
 35020  	_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_pList.XnSrc-int32(1)))
 35021  	if (_pDatabase != nil) && (_pDatabase.Xz == nil) {
 35022  		_pDatabase = nil
 35023  	}
 35024  	if _pDatabase != nil {
 35025  		_5_pTemp = _pDatabase
 35026  		_pDatabase = _pTable
 35027  		_pTable = _5_pTemp
 35028  	}
 35029  	_pItem.XzName = _sqlite3NameFromToken(tls, _db, _pTable)
 35030  	_pItem.XzDatabase = _sqlite3NameFromToken(tls, _db, _pDatabase)
 35031  	return _pList
 35032  }
 35033  
 35034  var _sqlite3SrcListAppendØ00__func__Ø000 [21]int8
 35035  
 35036  func init() {
 35037  	crt.Xstrncpy(nil, &_sqlite3SrcListAppendØ00__func__Ø000[0], str(47735), 21)
 35038  }
 35039  
 35040  // C comment
 35041  //  /*
 35042  //  ** Expand the space allocated for the given SrcList object by
 35043  //  ** creating nExtra new slots beginning at iStart.  iStart is zero based.
 35044  //  ** New slots are zeroed.
 35045  //  **
 35046  //  ** For example, suppose a SrcList initially contains two entries: A,B.
 35047  //  ** To append 3 new entries onto the end, do this:
 35048  //  **
 35049  //  **    sqlite3SrcListEnlarge(db, pSrclist, 3, 2);
 35050  //  **
 35051  //  ** After the call above it would contain:  A, B, nil, nil, nil.
 35052  //  ** If the iStart argument had been 1 instead of 2, then the result
 35053  //  ** would have been:  A, nil, nil, nil, B.  To prepend the new slots,
 35054  //  ** the iStart value would be 0.  The result then would
 35055  //  ** be: nil, nil, nil, A, B.
 35056  //  **
 35057  //  ** If a memory allocation fails the SrcList is unchanged.  The
 35058  //  ** db->mallocFailed flag will be set to true.
 35059  //  */
 35060  func _sqlite3SrcListEnlarge(tls *crt.TLS, _db *Xsqlite3, _pSrc *XSrcList, _nExtra int32, _iStart int32) (r0 *XSrcList) {
 35061  	var _i, _1_nAlloc, _1_nGot int32
 35062  	var _1_pNew *XSrcList
 35063  	func() {
 35064  		if _iStart < int32(0) {
 35065  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103366), unsafe.Pointer(&_sqlite3SrcListEnlargeØ00__func__Ø000), unsafe.Pointer(str(47756)))
 35066  			crt.X__builtin_abort(tls)
 35067  		}
 35068  	}()
 35069  	func() {
 35070  		if _nExtra < int32(1) {
 35071  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103367), unsafe.Pointer(&_sqlite3SrcListEnlargeØ00__func__Ø000), unsafe.Pointer(str(47766)))
 35072  			crt.X__builtin_abort(tls)
 35073  		}
 35074  	}()
 35075  	func() {
 35076  		if _pSrc == nil {
 35077  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103368), unsafe.Pointer(&_sqlite3SrcListEnlargeØ00__func__Ø000), unsafe.Pointer(str(47776)))
 35078  			crt.X__builtin_abort(tls)
 35079  		}
 35080  	}()
 35081  	func() {
 35082  		if _iStart > _pSrc.XnSrc {
 35083  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103369), unsafe.Pointer(&_sqlite3SrcListEnlargeØ00__func__Ø000), unsafe.Pointer(str(47784)))
 35084  			crt.X__builtin_abort(tls)
 35085  		}
 35086  	}()
 35087  	if (uint32(_pSrc.XnSrc) + uint32(_nExtra)) <= _pSrc.XnAlloc {
 35088  		goto _8
 35089  	}
 35090  	_1_nAlloc = (_pSrc.XnSrc * int32(2)) + _nExtra
 35091  	_1_pNew = (*XSrcList)(_sqlite3DbRealloc(tls, _db, unsafe.Pointer(_pSrc), uint64(uint32(76)+(uint32(_1_nAlloc-int32(1))*uint32(68)))))
 35092  	if _1_pNew == nil {
 35093  		func() {
 35094  			if _db.XmallocFailed == 0 {
 35095  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103379), unsafe.Pointer(&_sqlite3SrcListEnlargeØ00__func__Ø000), unsafe.Pointer(str(47803)))
 35096  				crt.X__builtin_abort(tls)
 35097  			}
 35098  		}()
 35099  		return _pSrc
 35100  	}
 35101  	_pSrc = _1_pNew
 35102  	_1_nGot = int32(((uint32(_sqlite3DbMallocSize(tls, _db, unsafe.Pointer(_1_pNew))) - uint32(76)) / uint32(68)) + uint32(1))
 35103  	_pSrc.XnAlloc = uint32(_1_nGot)
 35104  _8:
 35105  	_i = _pSrc.XnSrc - int32(1)
 35106  _12:
 35107  	if _i < _iStart {
 35108  		goto _15
 35109  	}
 35110  	*elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_i+_nExtra)) = *elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_i))
 35111  	_i -= 1
 35112  	goto _12
 35113  _15:
 35114  	_pSrc.XnSrc += _nExtra
 35115  	crt.Xmemset(tls, unsafe.Pointer(elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_iStart))), int32(0), uint32(68)*uint32(_nExtra))
 35116  	_i = _iStart
 35117  _16:
 35118  	if _i >= (_iStart + _nExtra) {
 35119  		goto _19
 35120  	}
 35121  	elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_i)).XiCursor = int32(-1)
 35122  	_i += 1
 35123  	goto _16
 35124  _19:
 35125  	return _pSrc
 35126  }
 35127  
 35128  var _sqlite3SrcListEnlargeØ00__func__Ø000 [22]int8
 35129  
 35130  func init() {
 35131  	crt.Xstrncpy(nil, &_sqlite3SrcListEnlargeØ00__func__Ø000[0], str(47820), 22)
 35132  }
 35133  
 35134  // C comment
 35135  //  /*
 35136  //  ** Given a token, return a string that consists of the text of that
 35137  //  ** token.  Space to hold the returned string
 35138  //  ** is obtained from sqliteMalloc() and must be freed by the calling
 35139  //  ** function.
 35140  //  **
 35141  //  ** Any quotation marks (ex:  "name", 'name', [name], or `name`) that
 35142  //  ** surround the body of the token are removed.
 35143  //  **
 35144  //  ** Tokens are often just pointers into the original SQL text and so
 35145  //  ** are not \000 terminated and are not persistent.  The returned string
 35146  //  ** is \000 terminated and is persistent.
 35147  //  */
 35148  func _sqlite3NameFromToken(tls *crt.TLS, _db *Xsqlite3, _pName *XToken) (r0 *int8) {
 35149  	var _zName *int8
 35150  	if _pName != nil {
 35151  		_zName = _sqlite3DbStrNDup(tls, _db, _pName.Xz, uint64(_pName.Xn))
 35152  		_sqlite3Dequote(tls, _zName)
 35153  		goto _1
 35154  	}
 35155  	_zName = nil
 35156  _1:
 35157  	return _zName
 35158  }
 35159  
 35160  var _sqlite3SrcListAppendFromTermØ00__func__Ø000 [29]int8
 35161  
 35162  func init() {
 35163  	crt.Xstrncpy(nil, &_sqlite3SrcListAppendFromTermØ00__func__Ø000[0], str(47842), 29)
 35164  }
 35165  
 35166  // C comment
 35167  //  /*
 35168  //  ** Add a new element to the end of an expression list.  If pList is
 35169  //  ** initially NULL, then create a new expression list.
 35170  //  **
 35171  //  ** If a memory allocation error occurs, the entire list is freed and
 35172  //  ** NULL is returned.  If non-NULL is returned, then it is guaranteed
 35173  //  ** that the new entry was successfully appended.
 35174  //  */
 35175  func _sqlite3ExprListAppend(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _pExpr *XExpr) (r0 *XExprList) {
 35176  	var _db *Xsqlite3
 35177  	var _3_pNew *XExprList
 35178  	var _pItem *TExprList_item
 35179  	_db = (*Xsqlite3)(_pParse.Xdb)
 35180  	func() {
 35181  		if _db == nil {
 35182  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92370), unsafe.Pointer(&_sqlite3ExprListAppendØ00__func__Ø000), unsafe.Pointer(str(1219)))
 35183  			crt.X__builtin_abort(tls)
 35184  		}
 35185  	}()
 35186  	if _pList != nil {
 35187  		goto _2
 35188  	}
 35189  	_pList = (*XExprList)(_sqlite3DbMallocRawNN(tls, _db, uint64(28)))
 35190  	if _pList == nil {
 35191  		goto _no_mem
 35192  	}
 35193  	_pList.XnExpr = int32(0)
 35194  	_pList.XnAlloc = int32(1)
 35195  	goto _5
 35196  _2:
 35197  	if _pList.XnExpr != _pList.XnAlloc {
 35198  		goto _5
 35199  	}
 35200  	_3_pNew = (*XExprList)(_sqlite3DbRealloc(tls, _db, unsafe.Pointer(_pList), uint64(uint32(28)+(uint32((int32(2)*_pList.XnAlloc)-int32(1))*uint32(20)))))
 35201  	if _3_pNew == nil {
 35202  		goto _no_mem
 35203  	}
 35204  	_pList = _3_pNew
 35205  	_pList.XnAlloc *= int32(2)
 35206  _5:
 35207  	_pItem = elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(postInc2(&_pList.XnExpr, 1)))
 35208  	crt.Xmemset(tls, unsafe.Pointer(_pItem), int32(0), uint32(20))
 35209  	*(**XExpr)(unsafe.Pointer(&_pItem.XpExpr)) = _pExpr
 35210  	return _pList
 35211  
 35212  _no_mem:
 35213  	_sqlite3ExprDelete(tls, _db, _pExpr)
 35214  	_sqlite3ExprListDelete(tls, _db, _pList)
 35215  	return nil
 35216  }
 35217  
 35218  var _sqlite3ExprListAppendØ00__func__Ø000 [22]int8
 35219  
 35220  func init() {
 35221  	crt.Xstrncpy(nil, &_sqlite3ExprListAppendØ00__func__Ø000[0], str(47871), 22)
 35222  }
 35223  
 35224  // C comment
 35225  //  /*
 35226  //  ** Allocate a new expression node from a zero-terminated token that has
 35227  //  ** already been dequoted.
 35228  //  */
 35229  func _sqlite3Expr(tls *crt.TLS, _db *Xsqlite3, _op int32, _zToken *int8) (r0 *XExpr) {
 35230  	var _x XToken
 35231  	_x.Xz = _zToken
 35232  	_x.Xn = uint32(func() int32 {
 35233  		if _zToken != nil {
 35234  			return _sqlite3Strlen30(tls, _zToken)
 35235  		}
 35236  		return int32(0)
 35237  	}())
 35238  	return _sqlite3ExprAlloc(tls, _db, _op, &_x, int32(0))
 35239  }
 35240  
 35241  // C comment
 35242  //  /*
 35243  //  ** This routine is the core allocator for Expr nodes.
 35244  //  **
 35245  //  ** Construct a new expression node and return a pointer to it.  Memory
 35246  //  ** for this node and for the pToken argument is a single allocation
 35247  //  ** obtained from sqlite3DbMalloc().  The calling function
 35248  //  ** is responsible for making sure the node eventually gets freed.
 35249  //  **
 35250  //  ** If dequote is true, then the token (if it exists) is dequoted.
 35251  //  ** If dequote is false, no dequoting is performed.  The deQuote
 35252  //  ** parameter is ignored if pToken is NULL or if the token does not
 35253  //  ** appear to be quoted.  If the quotes were of the form "..." (double-quotes)
 35254  //  ** then the EP_DblQuoted flag is set on the expression node.
 35255  //  **
 35256  //  ** Special case:  If op==TK_INTEGER and pToken points to a string that
 35257  //  ** can be translated into a 32-bit integer, then the token is not
 35258  //  ** stored in u.zToken.  Instead, the integer values is written
 35259  //  ** into u.iValue and the EP_IntValue flag is set.  No extra storage
 35260  //  ** is allocated to hold the integer text and the dequote flag is ignored.
 35261  //  */
 35262  func _sqlite3ExprAlloc(tls *crt.TLS, _db *Xsqlite3, _op int32, _pToken *XToken, _dequote int32) (r0 *XExpr) {
 35263  	var _nExtra, _iValue int32
 35264  	var _pNew *XExpr
 35265  	_nExtra = int32(0)
 35266  	_iValue = int32(0)
 35267  	func() {
 35268  		if _db == nil {
 35269  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91630), unsafe.Pointer(&_sqlite3ExprAllocØ00__func__Ø000), unsafe.Pointer(str(1219)))
 35270  			crt.X__builtin_abort(tls)
 35271  		}
 35272  	}()
 35273  	if _pToken == nil {
 35274  		goto _2
 35275  	}
 35276  	if ((_op != int32(134)) || (_pToken.Xz == nil)) || (_sqlite3GetInt32(tls, _pToken.Xz, &_iValue) == int32(0)) {
 35277  		_nExtra = int32(_pToken.Xn + uint32(1))
 35278  		func() {
 35279  			if _iValue < int32(0) {
 35280  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91635), unsafe.Pointer(&_sqlite3ExprAllocØ00__func__Ø000), unsafe.Pointer(str(47893)))
 35281  				crt.X__builtin_abort(tls)
 35282  			}
 35283  		}()
 35284  	}
 35285  _2:
 35286  	_pNew = (*XExpr)(_sqlite3DbMallocRawNN(tls, _db, uint64(uint32(48)+uint32(_nExtra))))
 35287  	if _pNew == nil {
 35288  		goto _8
 35289  	}
 35290  	crt.Xmemset(tls, unsafe.Pointer(_pNew), int32(0), uint32(48))
 35291  	_pNew.Xop = uint8(_op)
 35292  	_pNew.XiAgg = int16(-1)
 35293  	if _pToken == nil {
 35294  		goto _9
 35295  	}
 35296  	if _nExtra == int32(0) {
 35297  		_pNew.Xflags |= uint32(1024)
 35298  		*(*int32)(unsafe.Pointer(&_pNew.Xu)) = _iValue
 35299  		goto _11
 35300  	}
 35301  	*(**int8)(unsafe.Pointer(&_pNew.Xu)) = (*int8)(unsafe.Pointer(elem58(_pNew, uintptr(1))))
 35302  	func() {
 35303  		if _pToken.Xz == nil && _pToken.Xn != (0) {
 35304  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91649), unsafe.Pointer(&_sqlite3ExprAllocØ00__func__Ø000), unsafe.Pointer(str(47903)))
 35305  			crt.X__builtin_abort(tls)
 35306  		}
 35307  	}()
 35308  	if _pToken.Xn != 0 {
 35309  		crt.Xmemcpy(tls, unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pNew.Xu))), unsafe.Pointer(_pToken.Xz), _pToken.Xn)
 35310  	}
 35311  	*elem1(*(**int8)(unsafe.Pointer(&_pNew.Xu)), uintptr(_pToken.Xn)) = 0
 35312  	if _dequote == 0 || (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(*(**int8)(unsafe.Pointer(&_pNew.Xu)), 0)))))&int32(128)) == 0 {
 35313  		goto _17
 35314  	}
 35315  	if int32(*elem1(*(**int8)(unsafe.Pointer(&_pNew.Xu)), 0)) == int32(34) {
 35316  		_pNew.Xflags |= uint32(64)
 35317  	}
 35318  	_sqlite3Dequote(tls, *(**int8)(unsafe.Pointer(&_pNew.Xu)))
 35319  _17:
 35320  _11:
 35321  _9:
 35322  	_pNew.XnHeight = int32(1)
 35323  _8:
 35324  	return _pNew
 35325  }
 35326  
 35327  var _sqlite3ExprAllocØ00__func__Ø000 [17]int8
 35328  
 35329  func init() {
 35330  	crt.Xstrncpy(nil, &_sqlite3ExprAllocØ00__func__Ø000[0], str(47932), 17)
 35331  }
 35332  
 35333  var _convertCompoundSelectToSubqueryØ00__func__Ø000 [32]int8
 35334  
 35335  func init() {
 35336  	crt.Xstrncpy(nil, &_convertCompoundSelectToSubqueryØ00__func__Ø000[0], str(47949), 32)
 35337  }
 35338  
 35339  // C comment
 35340  //  /*
 35341  //  ** Call sqlite3WalkExpr() for every expression in Select statement p.
 35342  //  ** Invoke sqlite3WalkSelect() for subqueries in the FROM clause and
 35343  //  ** on the compound select chain, p->pPrior.
 35344  //  **
 35345  //  ** If it is not NULL, the xSelectCallback() callback is invoked before
 35346  //  ** the walk of the expressions and FROM clause. The xSelectCallback2()
 35347  //  ** method, if it is not NULL, is invoked following the walk of the
 35348  //  ** expressions and FROM clause.
 35349  //  **
 35350  //  ** Return WRC_Continue under normal conditions.  Return WRC_Abort if
 35351  //  ** there is an abort request.
 35352  //  **
 35353  //  ** If the Walker does not have an xSelectCallback() then this routine
 35354  //  ** is a no-op returning WRC_Continue.
 35355  //  */
 35356  func _sqlite3WalkSelect(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) {
 35357  	var _rc int32
 35358  	if (_p == nil) || ((func() func(*crt.TLS, *XWalker, *XSelect) int32 {
 35359  		v := _pWalker.XxSelectCallback
 35360  		return *(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer(&v))
 35361  	}() == nil) && (func() func(*crt.TLS, *XWalker, *XSelect) {
 35362  		v := _pWalker.XxSelectCallback2
 35363  		return *(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer(&v))
 35364  	}() == nil)) {
 35365  		return int32(0)
 35366  	}
 35367  	_rc = int32(0)
 35368  	_pWalker.XwalkerDepth += 1
 35369  _3:
 35370  	if _p == nil {
 35371  		goto _4
 35372  	}
 35373  	if _pWalker.XxSelectCallback == nil {
 35374  		goto _5
 35375  	}
 35376  	_rc = func() func(*crt.TLS, *XWalker, *XSelect) int32 {
 35377  		v := _pWalker.XxSelectCallback
 35378  		return *(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer(&v))
 35379  	}()(tls, _pWalker, _p)
 35380  	if _rc != 0 {
 35381  		goto _4
 35382  	}
 35383  _5:
 35384  	if _sqlite3WalkSelectExpr(tls, _pWalker, _p) != 0 || _sqlite3WalkSelectFrom(tls, _pWalker, _p) != 0 {
 35385  		_pWalker.XwalkerDepth -= 1
 35386  		return int32(2)
 35387  	}
 35388  	if _pWalker.XxSelectCallback2 != nil {
 35389  		func() func(*crt.TLS, *XWalker, *XSelect) {
 35390  			v := _pWalker.XxSelectCallback2
 35391  			return *(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer(&v))
 35392  		}()(tls, _pWalker, _p)
 35393  	}
 35394  	_p = (*XSelect)(_p.XpPrior)
 35395  	goto _3
 35396  _4:
 35397  	_pWalker.XwalkerDepth -= 1
 35398  	return _rc & int32(2)
 35399  }
 35400  
 35401  // C comment
 35402  //  /*
 35403  //  ** Walk all expressions associated with SELECT statement p.  Do
 35404  //  ** not invoke the SELECT callback on p, but do (of course) invoke
 35405  //  ** any expr callbacks and SELECT callbacks that come from subqueries.
 35406  //  ** Return WRC_Abort or WRC_Continue.
 35407  //  */
 35408  func _sqlite3WalkSelectExpr(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) {
 35409  	if _sqlite3WalkExprList(tls, _pWalker, (*XExprList)(_p.XpEList)) != 0 {
 35410  		return int32(2)
 35411  	}
 35412  	if _sqlite3WalkExpr(tls, _pWalker, (*XExpr)(_p.XpWhere)) != 0 {
 35413  		return int32(2)
 35414  	}
 35415  	if _sqlite3WalkExprList(tls, _pWalker, (*XExprList)(_p.XpGroupBy)) != 0 {
 35416  		return int32(2)
 35417  	}
 35418  	if _sqlite3WalkExpr(tls, _pWalker, (*XExpr)(_p.XpHaving)) != 0 {
 35419  		return int32(2)
 35420  	}
 35421  	if _sqlite3WalkExprList(tls, _pWalker, (*XExprList)(_p.XpOrderBy)) != 0 {
 35422  		return int32(2)
 35423  	}
 35424  	if _sqlite3WalkExpr(tls, _pWalker, (*XExpr)(_p.XpLimit)) != 0 {
 35425  		return int32(2)
 35426  	}
 35427  	if _sqlite3WalkExpr(tls, _pWalker, (*XExpr)(_p.XpOffset)) != 0 {
 35428  		return int32(2)
 35429  	}
 35430  	return int32(0)
 35431  }
 35432  
 35433  // C comment
 35434  //  /*
 35435  //  ** Call sqlite3WalkExpr() for every expression in list p or until
 35436  //  ** an abort request is seen.
 35437  //  */
 35438  func _sqlite3WalkExprList(tls *crt.TLS, _pWalker *XWalker, _p *XExprList) (r0 int32) {
 35439  	var _i int32
 35440  	var _pItem *TExprList_item
 35441  	if _p == nil {
 35442  		goto _0
 35443  	}
 35444  	*func() **TExprList_item { _i = _p.XnExpr; return &_pItem }() = (*TExprList_item)(unsafe.Pointer(&_p.Xa))
 35445  _1:
 35446  	if _i <= int32(0) {
 35447  		goto _4
 35448  	}
 35449  	if _sqlite3WalkExpr(tls, _pWalker, (*XExpr)(_pItem.XpExpr)) != 0 {
 35450  		return int32(2)
 35451  	}
 35452  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i -= 1; return &_pItem }())) += uintptr(20)
 35453  	goto _1
 35454  _4:
 35455  _0:
 35456  	return int32(0)
 35457  }
 35458  
 35459  // C comment
 35460  //  /* Forward declarations */
 35461  func _sqlite3WalkExpr(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
 35462  	return func() int32 {
 35463  		if _pExpr != nil {
 35464  			return _walkExpr(tls, _pWalker, _pExpr)
 35465  		}
 35466  		return int32(0)
 35467  	}()
 35468  }
 35469  
 35470  // C comment
 35471  //  /*
 35472  //  ** Walk an expression tree.  Invoke the callback once for each node
 35473  //  ** of the expression, while descending.  (In other words, the callback
 35474  //  ** is invoked before visiting children.)
 35475  //  **
 35476  //  ** The return value from the callback should be one of the WRC_*
 35477  //  ** constants to specify how to proceed with the walk.
 35478  //  **
 35479  //  **    WRC_Continue      Continue descending down the tree.
 35480  //  **
 35481  //  **    WRC_Prune         Do not descend into child nodes, but allow
 35482  //  **                      the walk to continue with sibling nodes.
 35483  //  **
 35484  //  **    WRC_Abort         Do no more callbacks.  Unwind the stack and
 35485  //  **                      return from the top-level walk call.
 35486  //  **
 35487  //  ** The return value from this routine is WRC_Abort to abandon the tree walk
 35488  //  ** and WRC_Continue to continue.
 35489  //  */
 35490  func _walkExpr(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
 35491  	var _rc int32
 35492  	_rc = func() func(*crt.TLS, *XWalker, *XExpr) int32 {
 35493  		v := _pWalker.XxExprCallback
 35494  		return *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&v))
 35495  	}()(tls, _pWalker, _pExpr)
 35496  	if _rc != 0 || ((_pExpr.Xflags & uint32(8404992)) != (0)) {
 35497  		return _rc & int32(2)
 35498  	}
 35499  	if (_pExpr.XpLeft != nil) && _walkExpr(tls, _pWalker, (*XExpr)(_pExpr.XpLeft)) != 0 {
 35500  		return int32(2)
 35501  	}
 35502  	if (_pExpr.XpRight != nil) && _walkExpr(tls, _pWalker, (*XExpr)(_pExpr.XpRight)) != 0 {
 35503  		return int32(2)
 35504  	}
 35505  	if (_pExpr.Xflags & uint32(2048)) == (0) {
 35506  		goto _6
 35507  	}
 35508  	if _sqlite3WalkSelect(tls, _pWalker, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))) != 0 {
 35509  		return int32(2)
 35510  	}
 35511  	goto _9
 35512  _6:
 35513  	if (*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))) == nil {
 35514  		goto _9
 35515  	}
 35516  	if _sqlite3WalkExprList(tls, _pWalker, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))) != 0 {
 35517  		return int32(2)
 35518  	}
 35519  _9:
 35520  	return int32(0)
 35521  }
 35522  
 35523  // C comment
 35524  //  /*
 35525  //  ** Walk the parse trees associated with all subqueries in the
 35526  //  ** FROM clause of SELECT statement p.  Do not invoke the select
 35527  //  ** callback on p, but do invoke it on each FROM clause subquery
 35528  //  ** and on any subqueries further down in the tree.  Return
 35529  //  ** WRC_Abort or WRC_Continue;
 35530  //  */
 35531  func _sqlite3WalkSelectFrom(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) {
 35532  	var _i int32
 35533  	var _pSrc *XSrcList
 35534  	var _pItem *TSrcList_item
 35535  	_pSrc = (*XSrcList)(_p.XpSrc)
 35536  	if func() int32 {
 35537  		if _pSrc != nil {
 35538  			return int32(1)
 35539  		}
 35540  		return func() int32 {
 35541  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89291), unsafe.Pointer(&_sqlite3WalkSelectFromØ00__func__Ø000), unsafe.Pointer(str(4809)))
 35542  			crt.X__builtin_abort(tls)
 35543  			return int32(0)
 35544  		}()
 35545  	}() == 0 {
 35546  		goto _2
 35547  	}
 35548  	*func() **TSrcList_item { _i = _pSrc.XnSrc; return &_pItem }() = (*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa))
 35549  _3:
 35550  	if _i <= int32(0) {
 35551  		goto _6
 35552  	}
 35553  	if _sqlite3WalkSelect(tls, _pWalker, (*XSelect)(_pItem.XpSelect)) != 0 {
 35554  		return int32(2)
 35555  	}
 35556  	if (((uint32((_pItem.Xfg.XnotIndexed)>>2) << 31) >> 31) != 0) && _sqlite3WalkExprList(tls, _pWalker, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pItem.Xu1)))) != 0 {
 35557  		return int32(2)
 35558  	}
 35559  	*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i -= 1; return &_pItem }())) += uintptr(68)
 35560  	goto _3
 35561  _6:
 35562  _2:
 35563  	return int32(0)
 35564  }
 35565  
 35566  var _sqlite3WalkSelectFromØ00__func__Ø000 [22]int8
 35567  
 35568  func init() {
 35569  	crt.Xstrncpy(nil, &_sqlite3WalkSelectFromØ00__func__Ø000[0], str(47981), 22)
 35570  }
 35571  
 35572  // C comment
 35573  //  /*
 35574  //  ** This routine is a Walker callback for "expanding" a SELECT statement.
 35575  //  ** "Expanding" means to do the following:
 35576  //  **
 35577  //  **    (1)  Make sure VDBE cursor numbers have been assigned to every
 35578  //  **         element of the FROM clause.
 35579  //  **
 35580  //  **    (2)  Fill in the pTabList->a[].pTab fields in the SrcList that
 35581  //  **         defines FROM clause.  When views appear in the FROM clause,
 35582  //  **         fill pTabList->a[].pSelect with a copy of the SELECT statement
 35583  //  **         that implements the view.  A copy is made of the view's SELECT
 35584  //  **         statement so that we can freely modify or delete that statement
 35585  //  **         without worrying about messing up the persistent representation
 35586  //  **         of the view.
 35587  //  **
 35588  //  **    (3)  Add terms to the WHERE clause to accommodate the NATURAL keyword
 35589  //  **         on joins and the ON and USING clause of joins.
 35590  //  **
 35591  //  **    (4)  Scan the list of columns in the result set (pEList) looking
 35592  //  **         for instances of the "*" operator or the TABLE.* operator.
 35593  //  **         If found, expand each "*" to be every column in every table
 35594  //  **         and TABLE.* to be every column in TABLE.
 35595  //  **
 35596  //  */
 35597  func _selectExpander(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) {
 35598  	var _11_nCol int16
 35599  	var _i, _j, _k, _15_flags, _15_longNames, _19_tableSeen, _21_iDb int32
 35600  	var _19_zTName, _21_zTabName, _21_zSchemaName, _25_zName, _25_zColname, _25_zToFree *int8
 35601  	var _selFlags uint16
 35602  	var _25_sColname XToken
 35603  	var _db *Xsqlite3
 35604  	var _4_pTab, _21_pTab *XTable
 35605  	var _pTabList *XSrcList
 35606  	var _pFrom *TSrcList_item
 35607  	var _pEList, _15_pNew *XExprList
 35608  	var _15_a, _35_pX *TExprList_item
 35609  	var _6_pSel, _21_pSub *XSelect
 35610  	var _pE, _pRight, _pExpr, _31_pLeft *XExpr
 35611  	var _pParse *XParse
 35612  	_pParse = (*XParse)(_pWalker.XpParse)
 35613  	_db = (*Xsqlite3)(_pParse.Xdb)
 35614  	_selFlags = uint16(_p.XselFlags)
 35615  	_p.XselFlags |= uint32(64)
 35616  	if _db.XmallocFailed != 0 {
 35617  		return int32(2)
 35618  	}
 35619  	if func() int32 {
 35620  		if (*XSrcList)(_p.XpSrc) == nil {
 35621  			return func() int32 {
 35622  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120864), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(4809)))
 35623  				crt.X__builtin_abort(tls)
 35624  				return int32(1)
 35625  			}()
 35626  		}
 35627  		return int32(0)
 35628  	}() != 0 || ((int32(_selFlags) & int32(64)) != int32(0)) {
 35629  		return int32(1)
 35630  	}
 35631  	_pTabList = (*XSrcList)(_p.XpSrc)
 35632  	_pEList = (*XExprList)(_p.XpEList)
 35633  	if _p.XpWith != nil {
 35634  		_sqlite3WithPush(tls, _pParse, (*XWith)(_p.XpWith), 0)
 35635  	}
 35636  	_sqlite3SrcListAssignCursors(tls, _pParse, _pTabList)
 35637  	*func() **TSrcList_item { _i = int32(0); return &_pFrom }() = (*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa))
 35638  _6:
 35639  	if _i >= _pTabList.XnSrc {
 35640  		goto _9
 35641  	}
 35642  	func() {
 35643  		if int32((uint32((_pFrom.Xfg.XnotIndexed)>>5)<<31)>>31) != int32(0) && (*XTable)(_pFrom.XpTab) == nil {
 35644  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120884), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48003)))
 35645  			crt.X__builtin_abort(tls)
 35646  		}
 35647  	}()
 35648  	if ((uint32((_pFrom.Xfg.XnotIndexed)>>5) << 31) >> 31) != 0 {
 35649  		goto _7
 35650  	}
 35651  	func() {
 35652  		if (*XTable)(_pFrom.XpTab) != nil {
 35653  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120886), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48046)))
 35654  			crt.X__builtin_abort(tls)
 35655  		}
 35656  	}()
 35657  	if _withExpand(tls, _pWalker, _pFrom) != 0 {
 35658  		return int32(2)
 35659  	}
 35660  	if _pFrom.XpTab != nil {
 35661  		goto _30
 35662  	}
 35663  	if _pFrom.XzName != nil {
 35664  		goto _19
 35665  	}
 35666  	_6_pSel = (*XSelect)(_pFrom.XpSelect)
 35667  	func() {
 35668  		if _6_pSel == nil {
 35669  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120895), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48061)))
 35670  			crt.X__builtin_abort(tls)
 35671  		}
 35672  	}()
 35673  	func() {
 35674  		if (*XTable)(_pFrom.XpTab) != nil {
 35675  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120896), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48046)))
 35676  			crt.X__builtin_abort(tls)
 35677  		}
 35678  	}()
 35679  	if _sqlite3WalkSelect(tls, _pWalker, _6_pSel) != 0 {
 35680  		return int32(2)
 35681  	}
 35682  	*(**XTable)(unsafe.Pointer(&_pFrom.XpTab)) = store72(&_4_pTab, (*XTable)(_sqlite3DbMallocZero(tls, _db, uint64(80))))
 35683  	if _4_pTab == nil {
 35684  		return int32(2)
 35685  	}
 35686  	_4_pTab.XnTabRef = uint32(1)
 35687  	_4_pTab.XzName = _sqlite3MPrintf(tls, _db, str(48069), unsafe.Pointer(_4_pTab))
 35688  _26:
 35689  	if _6_pSel.XpPrior != nil {
 35690  		_6_pSel = (*XSelect)(_6_pSel.XpPrior)
 35691  		goto _26
 35692  	}
 35693  	_sqlite3ColumnsFromExprList(tls, _pParse, (*XExprList)(_6_pSel.XpEList), &_4_pTab.XnCol, (**XColumn)(unsafe.Pointer(&_4_pTab.XaCol)))
 35694  	_4_pTab.XiPKey = int16(-1)
 35695  	_4_pTab.XnRowLogEst = int16(200)
 35696  	func() {
 35697  		if int32(200) != int32(_sqlite3LogEst(tls, uint64(1048576))) {
 35698  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120905), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48082)))
 35699  			crt.X__builtin_abort(tls)
 35700  		}
 35701  	}()
 35702  	_4_pTab.XtabFlags |= uint32(2)
 35703  	goto _30
 35704  _19:
 35705  	func() {
 35706  		if (*XTable)(_pFrom.XpTab) != nil {
 35707  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120910), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48046)))
 35708  			crt.X__builtin_abort(tls)
 35709  		}
 35710  	}()
 35711  	*(**XTable)(unsafe.Pointer(&_pFrom.XpTab)) = store72(&_4_pTab, _sqlite3LocateTableItem(tls, _pParse, 0, _pFrom))
 35712  	if _4_pTab == nil {
 35713  		return int32(2)
 35714  	}
 35715  	if _4_pTab.XnTabRef >= uint32(65535) {
 35716  		_sqlite3ErrorMsg(tls, _pParse, str(48110), unsafe.Pointer(_4_pTab.XzName))
 35717  		*(**XTable)(unsafe.Pointer(&_pFrom.XpTab)) = nil
 35718  		return int32(2)
 35719  	}
 35720  	_4_pTab.XnTabRef += 1
 35721  	if (_4_pTab.XnModuleArg == 0) && _cannotBeFunction(tls, _pParse, _pFrom) != 0 {
 35722  		return int32(2)
 35723  	}
 35724  	if _4_pTab.XnModuleArg == 0 && _4_pTab.XpSelect == nil {
 35725  		goto _38
 35726  	}
 35727  	if _sqlite3ViewGetColumnNames(tls, _pParse, _4_pTab) != 0 {
 35728  		return int32(2)
 35729  	}
 35730  	func() {
 35731  		if (*XSelect)(_pFrom.XpSelect) != nil {
 35732  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120927), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48149)))
 35733  			crt.X__builtin_abort(tls)
 35734  		}
 35735  	}()
 35736  	*(**XSelect)(unsafe.Pointer(&_pFrom.XpSelect)) = _sqlite3SelectDup(tls, _db, (*XSelect)(_4_pTab.XpSelect), int32(0))
 35737  	_sqlite3SelectSetName(tls, (*XSelect)(_pFrom.XpSelect), _4_pTab.XzName)
 35738  	_11_nCol = _4_pTab.XnCol
 35739  	_4_pTab.XnCol = int16(-1)
 35740  	_sqlite3WalkSelect(tls, _pWalker, (*XSelect)(_pFrom.XpSelect))
 35741  	_4_pTab.XnCol = _11_nCol
 35742  _38:
 35743  _30:
 35744  	if _sqlite3IndexedByLookup(tls, _pParse, _pFrom) != 0 {
 35745  		return int32(2)
 35746  	}
 35747  _7:
 35748  	*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pFrom }())) += uintptr(68)
 35749  	goto _6
 35750  _9:
 35751  	if (_db.XmallocFailed != 0) || _sqliteProcessJoin(tls, _pParse, _p) != 0 {
 35752  		return int32(2)
 35753  	}
 35754  	_k = int32(0)
 35755  _45:
 35756  	if _k >= _pEList.XnExpr {
 35757  		goto _48
 35758  	}
 35759  	_pE = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_k)).XpExpr)
 35760  	if int32(_pE.Xop) == int32(161) {
 35761  		goto _48
 35762  	}
 35763  	func() {
 35764  		if int32(_pE.Xop) == int32(122) && (*XExpr)(_pE.XpRight) == nil {
 35765  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120964), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48167)))
 35766  			crt.X__builtin_abort(tls)
 35767  		}
 35768  	}()
 35769  	func() {
 35770  		if int32(_pE.Xop) == int32(122) && ((*XExpr)(_pE.XpLeft) == nil || int32((*XExpr)(_pE.XpLeft).Xop) != int32(27)) {
 35771  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120965), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48199)))
 35772  			crt.X__builtin_abort(tls)
 35773  		}
 35774  	}()
 35775  	if (int32(_pE.Xop) == int32(122)) && (int32((*XExpr)(_pE.XpRight).Xop) == int32(161)) {
 35776  		goto _48
 35777  	}
 35778  	_k += 1
 35779  	goto _45
 35780  _48:
 35781  	if _k >= _pEList.XnExpr {
 35782  		goto _59
 35783  	}
 35784  	_15_a = (*TExprList_item)(unsafe.Pointer(&_pEList.Xa))
 35785  	_15_pNew = nil
 35786  	_15_flags = (*Xsqlite3)(_pParse.Xdb).Xflags
 35787  	_15_longNames = bool2int(((_15_flags & int32(4)) != int32(0)) && ((_15_flags & int32(64)) == int32(0)))
 35788  	_k = int32(0)
 35789  _61:
 35790  	if _k >= _pEList.XnExpr {
 35791  		goto _64
 35792  	}
 35793  	_pE = (*XExpr)(elem57(_15_a, uintptr(_k)).XpExpr)
 35794  	_pRight = (*XExpr)(_pE.XpRight)
 35795  	func() {
 35796  		if int32(_pE.Xop) == int32(122) && _pRight == nil {
 35797  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120983), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48256)))
 35798  			crt.X__builtin_abort(tls)
 35799  		}
 35800  	}()
 35801  	if int32(_pE.Xop) == int32(161) || int32(_pE.Xop) == int32(122) && int32(_pRight.Xop) == int32(161) {
 35802  		goto _70
 35803  	}
 35804  	_15_pNew = _sqlite3ExprListAppend(tls, _pParse, _15_pNew, (*XExpr)(elem57(_15_a, uintptr(_k)).XpExpr))
 35805  	if _15_pNew != nil {
 35806  		elem57((*TExprList_item)(unsafe.Pointer(&_15_pNew.Xa)), uintptr(_15_pNew.XnExpr-int32(1))).XzName = elem57(_15_a, uintptr(_k)).XzName
 35807  		elem57((*TExprList_item)(unsafe.Pointer(&_15_pNew.Xa)), uintptr(_15_pNew.XnExpr-int32(1))).XzSpan = elem57(_15_a, uintptr(_k)).XzSpan
 35808  		elem57(_15_a, uintptr(_k)).XzName = nil
 35809  		elem57(_15_a, uintptr(_k)).XzSpan = nil
 35810  	}
 35811  	*(**XExpr)(unsafe.Pointer(&(elem57(_15_a, uintptr(_k)).XpExpr))) = nil
 35812  	goto _72
 35813  _70:
 35814  	_19_tableSeen = int32(0)
 35815  	_19_zTName = nil
 35816  	if int32(_pE.Xop) == int32(122) {
 35817  		func() {
 35818  			if (*XExpr)(_pE.XpLeft) == nil {
 35819  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121003), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48284)))
 35820  				crt.X__builtin_abort(tls)
 35821  			}
 35822  		}()
 35823  		func() {
 35824  			if (((*XExpr)(_pE.XpLeft).Xflags) & uint32(1024)) != (0) {
 35825  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121004), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48297)))
 35826  				crt.X__builtin_abort(tls)
 35827  			}
 35828  		}()
 35829  		_19_zTName = *(**int8)(unsafe.Pointer(&((*XExpr)(_pE.XpLeft).Xu)))
 35830  	}
 35831  	*func() **TSrcList_item { _i = int32(0); return &_pFrom }() = (*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa))
 35832  _78:
 35833  	if _i >= _pTabList.XnSrc {
 35834  		goto _81
 35835  	}
 35836  	_21_pTab = (*XTable)(_pFrom.XpTab)
 35837  	_21_pSub = (*XSelect)(_pFrom.XpSelect)
 35838  	_21_zTabName = _pFrom.XzAlias
 35839  	_21_zSchemaName = nil
 35840  	if _21_zTabName == nil {
 35841  		_21_zTabName = _21_pTab.XzName
 35842  	}
 35843  	if _db.XmallocFailed != 0 {
 35844  		goto _81
 35845  	}
 35846  	if _21_pSub != nil && (_21_pSub.XselFlags&uint32(2048)) != (0) {
 35847  		goto _85
 35848  	}
 35849  	_21_pSub = nil
 35850  	if (_19_zTName != nil) && (_sqlite3StrICmp(tls, _19_zTName, _21_zTabName) != int32(0)) {
 35851  		goto _79
 35852  	}
 35853  	_21_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_21_pTab.XpSchema))
 35854  	_21_zSchemaName = func() *int8 {
 35855  		if _21_iDb >= int32(0) {
 35856  			return (elem27((*XDb)(_db.XaDb), uintptr(_21_iDb)).XzDbSName)
 35857  		}
 35858  		return str(48338)
 35859  	}()
 35860  _85:
 35861  	_j = int32(0)
 35862  _90:
 35863  	if _j >= int32(_21_pTab.XnCol) {
 35864  		goto _93
 35865  	}
 35866  	_25_zName = elem41((*XColumn)(_21_pTab.XaCol), uintptr(_j)).XzName
 35867  	func() {
 35868  		if _25_zName == nil {
 35869  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121031), unsafe.Pointer(&_selectExpanderØ00__func__Ø000), unsafe.Pointer(str(48340)))
 35870  			crt.X__builtin_abort(tls)
 35871  		}
 35872  	}()
 35873  	if ((_19_zTName != nil) && (_21_pSub != nil)) && (_sqlite3MatchSpanName(tls, elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_21_pSub.XpEList).Xa))), uintptr(_j)).XzSpan, nil, _19_zTName, nil) == int32(0)) {
 35874  		goto _91
 35875  	}
 35876  	if ((_p.XselFlags & uint32(131072)) == (0)) && ((int32(elem41((*XColumn)(_21_pTab.XaCol), uintptr(_j)).XcolFlags) & int32(2)) != int32(0)) {
 35877  		goto _91
 35878  	}
 35879  	_19_tableSeen = int32(1)
 35880  	if _i <= int32(0) || _19_zTName != nil {
 35881  		goto _102
 35882  	}
 35883  	if ((int32(_pFrom.Xfg.Xjointype) & int32(4)) != int32(0)) && _tableAndColumnIndex(tls, _pTabList, _i, _25_zName, nil, nil) != 0 {
 35884  		goto _91
 35885  	}
 35886  	if _sqlite3IdListIndex(tls, (*XIdList)(_pFrom.XpUsing), _25_zName) >= int32(0) {
 35887  		goto _91
 35888  	}
 35889  _102:
 35890  	_pRight = _sqlite3Expr(tls, _db, int32(27), _25_zName)
 35891  	_25_zColname = _25_zName
 35892  	_25_zToFree = nil
 35893  	if _15_longNames == 0 && _pTabList.XnSrc <= int32(1) {
 35894  		goto _107
 35895  	}
 35896  	_31_pLeft = _sqlite3Expr(tls, _db, int32(27), _21_zTabName)
 35897  	_pExpr = _sqlite3PExpr(tls, _pParse, int32(122), _31_pLeft, _pRight)
 35898  	if _21_zSchemaName != nil {
 35899  		_31_pLeft = _sqlite3Expr(tls, _db, int32(27), _21_zSchemaName)
 35900  		_pExpr = _sqlite3PExpr(tls, _pParse, int32(122), _31_pLeft, _pExpr)
 35901  	}
 35902  	if _15_longNames != 0 {
 35903  		_25_zColname = _sqlite3MPrintf(tls, _db, str(7919), unsafe.Pointer(_21_zTabName), unsafe.Pointer(_25_zName))
 35904  		_25_zToFree = _25_zColname
 35905  	}
 35906  	goto _110
 35907  _107:
 35908  	_pExpr = _pRight
 35909  _110:
 35910  	_15_pNew = _sqlite3ExprListAppend(tls, _pParse, _15_pNew, _pExpr)
 35911  	_sqlite3TokenInit(tls, &_25_sColname, _25_zColname)
 35912  	_sqlite3ExprListSetName(tls, _pParse, _15_pNew, &_25_sColname, int32(0))
 35913  	if _15_pNew == nil || (_p.XselFlags&uint32(2048)) == (0) {
 35914  		goto _112
 35915  	}
 35916  	_35_pX = elem57((*TExprList_item)(unsafe.Pointer(&_15_pNew.Xa)), uintptr(_15_pNew.XnExpr-int32(1)))
 35917  	if _21_pSub != nil {
 35918  		_35_pX.XzSpan = _sqlite3DbStrDup(tls, _db, elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_21_pSub.XpEList).Xa))), uintptr(_j)).XzSpan)
 35919  		goto _114
 35920  	}
 35921  	_35_pX.XzSpan = _sqlite3MPrintf(tls, _db, str(48346), unsafe.Pointer(_21_zSchemaName), unsafe.Pointer(_21_zTabName), unsafe.Pointer(_25_zColname))
 35922  _114:
 35923  	storebits5(&_35_pX.Xdone, int8(1), 2, 1)
 35924  _112:
 35925  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_25_zToFree))
 35926  _91:
 35927  	_j += 1
 35928  	goto _90
 35929  _93:
 35930  _79:
 35931  	*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pFrom }())) += uintptr(68)
 35932  	goto _78
 35933  _81:
 35934  	if _19_tableSeen != 0 {
 35935  		goto _115
 35936  	}
 35937  	if _19_zTName != nil {
 35938  		_sqlite3ErrorMsg(tls, _pParse, str(48355), unsafe.Pointer(_19_zTName))
 35939  		goto _117
 35940  	}
 35941  	_sqlite3ErrorMsg(tls, _pParse, str(48373))
 35942  _117:
 35943  _115:
 35944  _72:
 35945  	_k += 1
 35946  	goto _61
 35947  _64:
 35948  	_sqlite3ExprListDelete(tls, _db, _pEList)
 35949  	*(**XExprList)(unsafe.Pointer(&_p.XpEList)) = _15_pNew
 35950  _59:
 35951  	if (_p.XpEList != nil) && (((*XExprList)(_p.XpEList).XnExpr) > (*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(2)))) {
 35952  		_sqlite3ErrorMsg(tls, _pParse, str(48393))
 35953  		return int32(2)
 35954  	}
 35955  	return int32(0)
 35956  }
 35957  
 35958  var _selectExpanderØ00__func__Ø000 [15]int8
 35959  
 35960  func init() {
 35961  	crt.Xstrncpy(nil, &_selectExpanderØ00__func__Ø000[0], str(48424), 15)
 35962  }
 35963  
 35964  // C comment
 35965  //  /* The code generator maintains a stack of active WITH clauses
 35966  //  ** with the inner-most WITH clause being at the top of the stack.
 35967  //  **
 35968  //  ** This routine pushes the WITH clause passed as the second argument
 35969  //  ** onto the top of the stack. If argument bFree is true, then this
 35970  //  ** WITH clause will never be popped from the stack. In this case it
 35971  //  ** should be freed along with the Parse object. In other cases, when
 35972  //  ** bFree==0, the With object will be freed along with the SELECT
 35973  //  ** statement with which it is associated.
 35974  //  */
 35975  func _sqlite3WithPush(tls *crt.TLS, _pParse *XParse, _pWith *XWith, _bFree uint8) {
 35976  	func() {
 35977  		if int32(_bFree) != int32(0) && ((*XWith)(_pParse.XpWith) != nil || (*XWith)(_pParse.XpWithToFree) != nil) {
 35978  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120664), unsafe.Pointer(&_sqlite3WithPushØ00__func__Ø000), unsafe.Pointer(str(48439)))
 35979  			crt.X__builtin_abort(tls)
 35980  		}
 35981  	}()
 35982  	if _pWith == nil {
 35983  		goto _4
 35984  	}
 35985  	func() {
 35986  		if (*XWith)(_pParse.XpWith) == _pWith {
 35987  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120666), unsafe.Pointer(&_sqlite3WithPushØ00__func__Ø000), unsafe.Pointer(str(48496)))
 35988  			crt.X__builtin_abort(tls)
 35989  		}
 35990  	}()
 35991  	*(**XWith)(unsafe.Pointer(&_pWith.XpOuter)) = (*XWith)(_pParse.XpWith)
 35992  	*(**XWith)(unsafe.Pointer(&_pParse.XpWith)) = _pWith
 35993  	if _bFree != 0 {
 35994  		*(**XWith)(unsafe.Pointer(&_pParse.XpWithToFree)) = _pWith
 35995  	}
 35996  _4:
 35997  }
 35998  
 35999  var _sqlite3WithPushØ00__func__Ø000 [16]int8
 36000  
 36001  func init() {
 36002  	crt.Xstrncpy(nil, &_sqlite3WithPushØ00__func__Ø000[0], str(48517), 16)
 36003  }
 36004  
 36005  // C comment
 36006  //  /*
 36007  //  ** Assign VdbeCursor index numbers to all tables in a SrcList
 36008  //  */
 36009  func _sqlite3SrcListAssignCursors(tls *crt.TLS, _pParse *XParse, _pList *XSrcList) {
 36010  	var _i int32
 36011  	var _pItem *TSrcList_item
 36012  	func() {
 36013  		if _pList == nil && ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == 0 {
 36014  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103482), unsafe.Pointer(&_sqlite3SrcListAssignCursorsØ00__func__Ø000), unsafe.Pointer(str(48533)))
 36015  			crt.X__builtin_abort(tls)
 36016  		}
 36017  	}()
 36018  	if _pList == nil {
 36019  		goto _3
 36020  	}
 36021  	*func() **TSrcList_item { _i = int32(0); return &_pItem }() = (*TSrcList_item)(unsafe.Pointer(&_pList.Xa))
 36022  _4:
 36023  	if _i >= _pList.XnSrc {
 36024  		goto _7
 36025  	}
 36026  	if _pItem.XiCursor >= int32(0) {
 36027  		goto _7
 36028  	}
 36029  	_pItem.XiCursor = postInc2(&_pParse.XnTab, 1)
 36030  	if _pItem.XpSelect != nil {
 36031  		_sqlite3SrcListAssignCursors(tls, _pParse, (*XSrcList)((*XSelect)(_pItem.XpSelect).XpSrc))
 36032  	}
 36033  	*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pItem }())) += uintptr(68)
 36034  	goto _4
 36035  _7:
 36036  _3:
 36037  }
 36038  
 36039  var _sqlite3SrcListAssignCursorsØ00__func__Ø000 [28]int8
 36040  
 36041  func init() {
 36042  	crt.Xstrncpy(nil, &_sqlite3SrcListAssignCursorsØ00__func__Ø000[0], str(48567), 28)
 36043  }
 36044  
 36045  // C comment
 36046  //  /*
 36047  //  ** This function checks if argument pFrom refers to a CTE declared by
 36048  //  ** a WITH clause on the stack currently maintained by the parser. And,
 36049  //  ** if currently processing a CTE expression, if it is a recursive
 36050  //  ** reference to the current CTE.
 36051  //  **
 36052  //  ** If pFrom falls into either of the two categories above, pFrom->pTab
 36053  //  ** and other fields are populated accordingly. The caller should check
 36054  //  ** (pFrom->pTab!=0) to determine whether or not a successful match
 36055  //  ** was found.
 36056  //  **
 36057  //  ** Whether or not a match is found, SQLITE_OK is returned if no error
 36058  //  ** occurs. If an error does occur, an error message is stored in the
 36059  //  ** parser and some error code other than SQLITE_OK returned.
 36060  //  */
 36061  func _withExpand(tls *crt.TLS, _pWalker *XWalker, _pFrom *TSrcList_item) (r0 int32) {
 36062  	var _1_bMayRecursive, _3_i int32
 36063  	var _db *Xsqlite3
 36064  	var _1_pTab *XTable
 36065  	var _3_pSrc *XSrcList
 36066  	var _4_pItem *TSrcList_item
 36067  	var _pWith, _1_pSavedWith *XWith
 36068  	var _pCte *TCte
 36069  	var _1_pEList *XExprList
 36070  	var _1_pSel, _1_pLeft, _7_pPrior *XSelect
 36071  	var _pParse *XParse
 36072  	_pParse = (*XParse)(_pWalker.XpParse)
 36073  	_db = (*Xsqlite3)(_pParse.Xdb)
 36074  	func() {
 36075  		if (*XTable)(_pFrom.XpTab) != nil {
 36076  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120697), unsafe.Pointer(&_withExpandØ00__func__Ø000), unsafe.Pointer(str(48046)))
 36077  			crt.X__builtin_abort(tls)
 36078  		}
 36079  	}()
 36080  	_pCte = _searchWith(tls, (*XWith)(_pParse.XpWith), _pFrom, &_pWith)
 36081  	if _pCte == nil {
 36082  		goto _2
 36083  	}
 36084  	if _pCte.XzCteErr != nil {
 36085  		_sqlite3ErrorMsg(tls, _pParse, _pCte.XzCteErr, unsafe.Pointer(_pCte.XzName))
 36086  		return int32(1)
 36087  	}
 36088  	if _cannotBeFunction(tls, _pParse, _pFrom) != 0 {
 36089  		return int32(1)
 36090  	}
 36091  	func() {
 36092  		if (*XTable)(_pFrom.XpTab) != nil {
 36093  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120718), unsafe.Pointer(&_withExpandØ00__func__Ø000), unsafe.Pointer(str(48046)))
 36094  			crt.X__builtin_abort(tls)
 36095  		}
 36096  	}()
 36097  	*(**XTable)(unsafe.Pointer(&_pFrom.XpTab)) = store72(&_1_pTab, (*XTable)(_sqlite3DbMallocZero(tls, _db, uint64(80))))
 36098  	if _1_pTab == nil {
 36099  		return int32(2)
 36100  	}
 36101  	_1_pTab.XnTabRef = uint32(1)
 36102  	_1_pTab.XzName = _sqlite3DbStrDup(tls, _db, _pCte.XzName)
 36103  	_1_pTab.XiPKey = int16(-1)
 36104  	_1_pTab.XnRowLogEst = int16(200)
 36105  	func() {
 36106  		if int32(200) != int32(_sqlite3LogEst(tls, uint64(1048576))) {
 36107  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120724), unsafe.Pointer(&_withExpandØ00__func__Ø000), unsafe.Pointer(str(48082)))
 36108  			crt.X__builtin_abort(tls)
 36109  		}
 36110  	}()
 36111  	_1_pTab.XtabFlags |= uint32(66)
 36112  	*(**XSelect)(unsafe.Pointer(&_pFrom.XpSelect)) = _sqlite3SelectDup(tls, _db, (*XSelect)(_pCte.XpSelect), int32(0))
 36113  	if _db.XmallocFailed != 0 {
 36114  		return _sqlite3NomemError(tls, int32(120727))
 36115  	}
 36116  	func() {
 36117  		if _pFrom.XpSelect == nil {
 36118  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120728), unsafe.Pointer(&_withExpandØ00__func__Ø000), unsafe.Pointer(str(48595)))
 36119  			crt.X__builtin_abort(tls)
 36120  		}
 36121  	}()
 36122  	_1_pSel = (*XSelect)(_pFrom.XpSelect)
 36123  	_1_bMayRecursive = bool2int((int32(_1_pSel.Xop) == int32(116)) || (int32(_1_pSel.Xop) == int32(115)))
 36124  	if _1_bMayRecursive == 0 {
 36125  		goto _14
 36126  	}
 36127  	_3_pSrc = (*XSrcList)((*XSelect)(_pFrom.XpSelect).XpSrc)
 36128  	_3_i = int32(0)
 36129  _15:
 36130  	if _3_i >= _3_pSrc.XnSrc {
 36131  		goto _18
 36132  	}
 36133  	_4_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&_3_pSrc.Xa)), uintptr(_3_i))
 36134  	if ((_4_pItem.XzDatabase == nil) && (_4_pItem.XzName != nil)) && (int32(0) == _sqlite3StrICmp(tls, _4_pItem.XzName, _pCte.XzName)) {
 36135  		*(**XTable)(unsafe.Pointer(&_4_pItem.XpTab)) = _1_pTab
 36136  		storebits5(&(_4_pItem.Xfg.XnotIndexed), int8(1), 32, 5)
 36137  		_1_pTab.XnTabRef += 1
 36138  		_1_pSel.XselFlags |= uint32(8192)
 36139  	}
 36140  	_3_i += 1
 36141  	goto _15
 36142  _18:
 36143  _14:
 36144  	if _1_pTab.XnTabRef > uint32(2) {
 36145  		_sqlite3ErrorMsg(tls, _pParse, str(48610), unsafe.Pointer(_pCte.XzName))
 36146  		return int32(1)
 36147  	}
 36148  	func() {
 36149  		if _1_pTab.XnTabRef != uint32(1) && ((_1_pSel.XselFlags&uint32(8192)) == 0 || _1_pTab.XnTabRef != uint32(2)) {
 36150  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120757), unsafe.Pointer(&_withExpandØ00__func__Ø000), unsafe.Pointer(str(48653)))
 36151  			crt.X__builtin_abort(tls)
 36152  		}
 36153  	}()
 36154  	_pCte.XzCteErr = str(48726)
 36155  	_1_pSavedWith = (*XWith)(_pParse.XpWith)
 36156  	*(**XWith)(unsafe.Pointer(&_pParse.XpWith)) = _pWith
 36157  	if _1_bMayRecursive != 0 {
 36158  		_7_pPrior = (*XSelect)(_1_pSel.XpPrior)
 36159  		func() {
 36160  			if (*XWith)(_7_pPrior.XpWith) != nil {
 36161  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120764), unsafe.Pointer(&_withExpandØ00__func__Ø000), unsafe.Pointer(str(48749)))
 36162  				crt.X__builtin_abort(tls)
 36163  			}
 36164  		}()
 36165  		*(**XWith)(unsafe.Pointer(&_7_pPrior.XpWith)) = (*XWith)(_1_pSel.XpWith)
 36166  		_sqlite3WalkSelect(tls, _pWalker, _7_pPrior)
 36167  		*(**XWith)(unsafe.Pointer(&_7_pPrior.XpWith)) = nil
 36168  		goto _30
 36169  	}
 36170  	_sqlite3WalkSelect(tls, _pWalker, _1_pSel)
 36171  _30:
 36172  	*(**XWith)(unsafe.Pointer(&_pParse.XpWith)) = _pWith
 36173  	_1_pLeft = _1_pSel
 36174  _31:
 36175  	if _1_pLeft.XpPrior == nil {
 36176  		goto _34
 36177  	}
 36178  	_1_pLeft = (*XSelect)(_1_pLeft.XpPrior)
 36179  	goto _31
 36180  _34:
 36181  	_1_pEList = (*XExprList)(_1_pLeft.XpEList)
 36182  	if _pCte.XpCols == nil {
 36183  		goto _35
 36184  	}
 36185  	if (_1_pEList != nil) && (_1_pEList.XnExpr != ((*XExprList)(_pCte.XpCols).XnExpr)) {
 36186  		_sqlite3ErrorMsg(tls, _pParse, str(48766), unsafe.Pointer(_pCte.XzName), _1_pEList.XnExpr, (*XExprList)(_pCte.XpCols).XnExpr)
 36187  		*(**XWith)(unsafe.Pointer(&_pParse.XpWith)) = _1_pSavedWith
 36188  		return int32(1)
 36189  	}
 36190  	_1_pEList = (*XExprList)(_pCte.XpCols)
 36191  _35:
 36192  	_sqlite3ColumnsFromExprList(tls, _pParse, _1_pEList, &_1_pTab.XnCol, (**XColumn)(unsafe.Pointer(&_1_pTab.XaCol)))
 36193  	if _1_bMayRecursive == 0 {
 36194  		goto _38
 36195  	}
 36196  	if (_1_pSel.XselFlags & uint32(8192)) != 0 {
 36197  		_pCte.XzCteErr = str(48804)
 36198  		goto _40
 36199  	}
 36200  	_pCte.XzCteErr = str(48838)
 36201  _40:
 36202  	_sqlite3WalkSelect(tls, _pWalker, _1_pSel)
 36203  _38:
 36204  	_pCte.XzCteErr = nil
 36205  	*(**XWith)(unsafe.Pointer(&_pParse.XpWith)) = _1_pSavedWith
 36206  _2:
 36207  	return int32(0)
 36208  }
 36209  
 36210  var _withExpandØ00__func__Ø000 [11]int8
 36211  
 36212  func init() {
 36213  	crt.Xstrncpy(nil, &_withExpandØ00__func__Ø000[0], str(48876), 11)
 36214  }
 36215  
 36216  // C comment
 36217  //  /*
 36218  //  ** Argument pWith (which may be NULL) points to a linked list of nested
 36219  //  ** WITH contexts, from inner to outermost. If the table identified by
 36220  //  ** FROM clause element pItem is really a common-table-expression (CTE)
 36221  //  ** then return a pointer to the CTE definition for that table. Otherwise
 36222  //  ** return NULL.
 36223  //  **
 36224  //  ** If a non-NULL value is returned, set *ppContext to point to the With
 36225  //  ** object that the returned CTE belongs to.
 36226  //  */
 36227  func _searchWith(tls *crt.TLS, _pWith *XWith, _pItem *TSrcList_item, _ppContext **XWith) (r0 *TCte) {
 36228  	var _2_i int32
 36229  	var _zName *int8
 36230  	var _1_p *XWith
 36231  	if _pItem.XzDatabase != nil || store1(&_zName, _pItem.XzName) == nil {
 36232  		goto _1
 36233  	}
 36234  	_1_p = _pWith
 36235  _2:
 36236  	if _1_p == nil {
 36237  		goto _5
 36238  	}
 36239  	_2_i = int32(0)
 36240  _6:
 36241  	if _2_i >= _1_p.XnCte {
 36242  		goto _9
 36243  	}
 36244  	if _sqlite3StrICmp(tls, _zName, elem43((*TCte)(unsafe.Pointer(&_1_p.Xa)), uintptr(_2_i)).XzName) == int32(0) {
 36245  		*_ppContext = _1_p
 36246  		return elem43((*TCte)(unsafe.Pointer(&_1_p.Xa)), uintptr(_2_i))
 36247  	}
 36248  	_2_i += 1
 36249  	goto _6
 36250  _9:
 36251  	_1_p = (*XWith)(_1_p.XpOuter)
 36252  	goto _2
 36253  _5:
 36254  _1:
 36255  	return nil
 36256  }
 36257  
 36258  // C comment
 36259  //  /*
 36260  //  ** Check to see if the FROM clause term pFrom has table-valued function
 36261  //  ** arguments.  If it does, leave an error message in pParse and return
 36262  //  ** non-zero, since pFrom is not allowed to be a table-valued function.
 36263  //  */
 36264  func _cannotBeFunction(tls *crt.TLS, _pParse *XParse, _pFrom *TSrcList_item) (r0 int32) {
 36265  	if ((uint32((_pFrom.Xfg.XnotIndexed)>>2) << 31) >> 31) != 0 {
 36266  		_sqlite3ErrorMsg(tls, _pParse, str(48887), unsafe.Pointer(_pFrom.XzName))
 36267  		return int32(1)
 36268  	}
 36269  	return int32(0)
 36270  }
 36271  
 36272  // C comment
 36273  //  /*
 36274  //  ** Convert an integer into a LogEst.  In other words, compute an
 36275  //  ** approximation for 10*log2(x).
 36276  //  */
 36277  func _sqlite3LogEst(tls *crt.TLS, _x uint64) (r0 int16) {
 36278  	var _y int16
 36279  	_y = int16(40)
 36280  	if _x >= uint64(8) {
 36281  		goto _0
 36282  	}
 36283  	if _x < uint64(2) {
 36284  		return 0
 36285  	}
 36286  _1:
 36287  	if _x < uint64(8) {
 36288  		{
 36289  			p := &_y
 36290  			*p = int16(int32(*p) - int32(10))
 36291  		}
 36292  		_x <<= 1
 36293  		goto _1
 36294  	}
 36295  	goto _4
 36296  _0:
 36297  _5:
 36298  	if _x > uint64(255) {
 36299  		{
 36300  			p := &_y
 36301  			*p = int16(int32(*p) + int32(40))
 36302  		}
 36303  		_x >>= 4
 36304  		goto _5
 36305  	}
 36306  _6:
 36307  	if _x > uint64(15) {
 36308  		{
 36309  			p := &_y
 36310  			*p = int16(int32(*p) + int32(10))
 36311  		}
 36312  		_x >>= 1
 36313  		goto _6
 36314  	}
 36315  _4:
 36316  	return int16((int32(*elem50((*int16)(unsafe.Pointer(&_sqlite3LogEstØ00aØ001)), uintptr(_x&uint64(7)))) + int32(_y)) - int32(10))
 36317  }
 36318  
 36319  var _sqlite3LogEstØ00aØ001 [8]int16
 36320  
 36321  func init() {
 36322  	_sqlite3LogEstØ00aØ001 = [8]int16{int16(0), int16(2), int16(3), int16(5), int16(6), int16(7), int16(8), int16(9)}
 36323  }
 36324  
 36325  func _sqlite3SelectDup(tls *crt.TLS, _db *Xsqlite3, _pDup *XSelect, _flags int32) (r0 *XSelect) {
 36326  	var _pRet, _pNext, _p, _1_pNew *XSelect
 36327  	var _pp **XSelect
 36328  	_pRet = nil
 36329  	_pNext = nil
 36330  	_pp = &_pRet
 36331  	func() {
 36332  		if _db == nil {
 36333  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92317), unsafe.Pointer(&_sqlite3SelectDupØ00__func__Ø000), unsafe.Pointer(str(1219)))
 36334  			crt.X__builtin_abort(tls)
 36335  		}
 36336  	}()
 36337  	_p = _pDup
 36338  _2:
 36339  	if _p == nil {
 36340  		goto _5
 36341  	}
 36342  	_1_pNew = (*XSelect)(_sqlite3DbMallocRawNN(tls, _db, uint64(80)))
 36343  	if _1_pNew == nil {
 36344  		goto _5
 36345  	}
 36346  	*(**XExprList)(unsafe.Pointer(&_1_pNew.XpEList)) = _sqlite3ExprListDup(tls, _db, (*XExprList)(_p.XpEList), _flags)
 36347  	*(**XSrcList)(unsafe.Pointer(&_1_pNew.XpSrc)) = _sqlite3SrcListDup(tls, _db, (*XSrcList)(_p.XpSrc), _flags)
 36348  	*(**XExpr)(unsafe.Pointer(&_1_pNew.XpWhere)) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.XpWhere), _flags)
 36349  	*(**XExprList)(unsafe.Pointer(&_1_pNew.XpGroupBy)) = _sqlite3ExprListDup(tls, _db, (*XExprList)(_p.XpGroupBy), _flags)
 36350  	*(**XExpr)(unsafe.Pointer(&_1_pNew.XpHaving)) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.XpHaving), _flags)
 36351  	*(**XExprList)(unsafe.Pointer(&_1_pNew.XpOrderBy)) = _sqlite3ExprListDup(tls, _db, (*XExprList)(_p.XpOrderBy), _flags)
 36352  	_1_pNew.Xop = _p.Xop
 36353  	*(**XSelect)(unsafe.Pointer(&_1_pNew.XpNext)) = _pNext
 36354  	*(**XSelect)(unsafe.Pointer(&_1_pNew.XpPrior)) = nil
 36355  	*(**XExpr)(unsafe.Pointer(&_1_pNew.XpLimit)) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.XpLimit), _flags)
 36356  	*(**XExpr)(unsafe.Pointer(&_1_pNew.XpOffset)) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.XpOffset), _flags)
 36357  	_1_pNew.XiLimit = int32(0)
 36358  	_1_pNew.XiOffset = int32(0)
 36359  	_1_pNew.XselFlags = _p.XselFlags & uint32(4294967263)
 36360  	*elem8((*int32)(unsafe.Pointer(&_1_pNew.XaddrOpenEphm)), 0) = int32(-1)
 36361  	*elem8((*int32)(unsafe.Pointer(&_1_pNew.XaddrOpenEphm)), uintptr(1)) = int32(-1)
 36362  	_1_pNew.XnSelectRow = _p.XnSelectRow
 36363  	*(**XWith)(unsafe.Pointer(&_1_pNew.XpWith)) = _withDup(tls, _db, (*XWith)(_p.XpWith))
 36364  	_sqlite3SelectSetName(tls, _1_pNew, (*int8)(unsafe.Pointer(&_p.XzSelName)))
 36365  	*_pp = _1_pNew
 36366  	_pp = (**XSelect)(unsafe.Pointer(&_1_pNew.XpPrior))
 36367  	_pNext = _1_pNew
 36368  	_p = (*XSelect)(_p.XpPrior)
 36369  	goto _2
 36370  _5:
 36371  	return _pRet
 36372  }
 36373  
 36374  var _sqlite3SelectDupØ00__func__Ø000 [17]int8
 36375  
 36376  func init() {
 36377  	crt.Xstrncpy(nil, &_sqlite3SelectDupØ00__func__Ø000[0], str(48910), 17)
 36378  }
 36379  
 36380  func _sqlite3ExprListDup(tls *crt.TLS, _db *Xsqlite3, _p *XExprList, _flags int32) (r0 *XExprList) {
 36381  	var _i int32
 36382  	var _pNew *XExprList
 36383  	var _pItem, _pOldItem *TExprList_item
 36384  	var _pPriorSelectCol, _1_pOldExpr, _1_pNewExpr *XExpr
 36385  	_pPriorSelectCol = nil
 36386  	func() {
 36387  		if _db == nil {
 36388  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92200), unsafe.Pointer(&_sqlite3ExprListDupØ00__func__Ø000), unsafe.Pointer(str(1219)))
 36389  			crt.X__builtin_abort(tls)
 36390  		}
 36391  	}()
 36392  	if _p == nil {
 36393  		return nil
 36394  	}
 36395  	_pNew = (*XExprList)(_sqlite3DbMallocRawNN(tls, _db, uint64(uint32(28)+(uint32(20)*uint32(_p.XnExpr-int32(1))))))
 36396  	if _pNew == nil {
 36397  		return nil
 36398  	}
 36399  	_pNew.XnAlloc = store2(&_pNew.XnExpr, _p.XnExpr)
 36400  	_pItem = (*TExprList_item)(unsafe.Pointer(&_pNew.Xa))
 36401  	_pOldItem = (*TExprList_item)(unsafe.Pointer(&_p.Xa))
 36402  	_i = int32(0)
 36403  _4:
 36404  	if _i >= _p.XnExpr {
 36405  		goto _7
 36406  	}
 36407  	_1_pOldExpr = (*XExpr)(_pOldItem.XpExpr)
 36408  	*(**XExpr)(unsafe.Pointer(&_pItem.XpExpr)) = _sqlite3ExprDup(tls, _db, _1_pOldExpr, _flags)
 36409  	if _1_pOldExpr == nil || int32(_1_pOldExpr.Xop) != int32(159) || store58(&_1_pNewExpr, (*XExpr)(_pItem.XpExpr)) == nil {
 36410  		goto _10
 36411  	}
 36412  	func() {
 36413  		if int32(_1_pNewExpr.XiColumn) != int32(0) && _i <= int32(0) {
 36414  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92216), unsafe.Pointer(&_sqlite3ExprListDupØ00__func__Ø000), unsafe.Pointer(str(48927)))
 36415  			crt.X__builtin_abort(tls)
 36416  		}
 36417  	}()
 36418  	if int32(_1_pNewExpr.XiColumn) == int32(0) {
 36419  		func() {
 36420  			if (*XExpr)(_1_pOldExpr.XpLeft) != (*XExpr)(_1_pOldExpr.XpRight) {
 36421  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92218), unsafe.Pointer(&_sqlite3ExprListDupØ00__func__Ø000), unsafe.Pointer(str(48955)))
 36422  				crt.X__builtin_abort(tls)
 36423  			}
 36424  		}()
 36425  		_pPriorSelectCol = store58((**XExpr)(unsafe.Pointer(&_1_pNewExpr.XpLeft)), (*XExpr)(_1_pNewExpr.XpRight))
 36426  		goto _17
 36427  	}
 36428  	func() {
 36429  		if _i <= int32(0) {
 36430  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92221), unsafe.Pointer(&_sqlite3ExprListDupØ00__func__Ø000), unsafe.Pointer(str(12925)))
 36431  			crt.X__builtin_abort(tls)
 36432  		}
 36433  	}()
 36434  	func() {
 36435  		if (*XExpr)(elem57(_pItem, uintptr(4294967295)).XpExpr) == nil {
 36436  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92222), unsafe.Pointer(&_sqlite3ExprListDupØ00__func__Ø000), unsafe.Pointer(str(48989)))
 36437  			crt.X__builtin_abort(tls)
 36438  		}
 36439  	}()
 36440  	func() {
 36441  		if int32(_1_pNewExpr.XiColumn) != (int32((*XExpr)(elem57(_pItem, uintptr(4294967295)).XpExpr).XiColumn) + int32(1)) {
 36442  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92223), unsafe.Pointer(&_sqlite3ExprListDupØ00__func__Ø000), unsafe.Pointer(str(49008)))
 36443  			crt.X__builtin_abort(tls)
 36444  		}
 36445  	}()
 36446  	func() {
 36447  		if _pPriorSelectCol != (*XExpr)((*XExpr)(elem57(_pItem, uintptr(4294967295)).XpExpr).XpLeft) {
 36448  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92224), unsafe.Pointer(&_sqlite3ExprListDupØ00__func__Ø000), unsafe.Pointer(str(49054)))
 36449  			crt.X__builtin_abort(tls)
 36450  		}
 36451  	}()
 36452  	*(**XExpr)(unsafe.Pointer(&_1_pNewExpr.XpLeft)) = _pPriorSelectCol
 36453  _17:
 36454  _10:
 36455  	_pItem.XzName = _sqlite3DbStrDup(tls, _db, _pOldItem.XzName)
 36456  	_pItem.XzSpan = _sqlite3DbStrDup(tls, _db, _pOldItem.XzSpan)
 36457  	_pItem.XsortOrder = _pOldItem.XsortOrder
 36458  	storebits5(&_pItem.Xdone, 0, 1, 0)
 36459  	storebits5(&_pItem.Xdone, int8((uint32(_pOldItem.Xdone>>1)<<31)>>31), 2, 1)
 36460  	_pItem.Xu = _pOldItem.Xu
 36461  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item {
 36462  		*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pItem }())) += uintptr(20)
 36463  		return &_pOldItem
 36464  	}())) += uintptr(20)
 36465  	goto _4
 36466  _7:
 36467  	return _pNew
 36468  }
 36469  
 36470  var _sqlite3ExprListDupØ00__func__Ø000 [19]int8
 36471  
 36472  func init() {
 36473  	crt.Xstrncpy(nil, &_sqlite3ExprListDupØ00__func__Ø000[0], str(49094), 19)
 36474  }
 36475  
 36476  // C comment
 36477  //  /*
 36478  //  ** The following group of routines make deep copies of expressions,
 36479  //  ** expression lists, ID lists, and select statements.  The copies can
 36480  //  ** be deleted (by being passed to their respective ...Delete() routines)
 36481  //  ** without effecting the originals.
 36482  //  **
 36483  //  ** The expression list, ID, and source lists return by sqlite3ExprListDup(),
 36484  //  ** sqlite3IdListDup(), and sqlite3SrcListDup() can not be further expanded
 36485  //  ** by subsequent calls to sqlite*ListAppend() routines.
 36486  //  **
 36487  //  ** Any tables that the SrcList might point to are not duplicated.
 36488  //  **
 36489  //  ** The flags parameter contains a combination of the EXPRDUP_XXX flags.
 36490  //  ** If the EXPRDUP_REDUCE flag is set, then the structure returned is a
 36491  //  ** truncated version of the usual Expr structure that will be stored as
 36492  //  ** part of the in-memory representation of the database schema.
 36493  //  */
 36494  func _sqlite3ExprDup(tls *crt.TLS, _db *Xsqlite3, _p *XExpr, _flags int32) (r0 *XExpr) {
 36495  	func() {
 36496  		if _flags != int32(0) && _flags != int32(1) {
 36497  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92192), unsafe.Pointer(&_sqlite3ExprDupØ00__func__Ø000), unsafe.Pointer(str(49113)))
 36498  			crt.X__builtin_abort(tls)
 36499  		}
 36500  	}()
 36501  	return func() *XExpr {
 36502  		if _p != nil {
 36503  			return _exprDup(tls, _db, _p, _flags, nil)
 36504  		}
 36505  		return nil
 36506  	}()
 36507  }
 36508  
 36509  var _sqlite3ExprDupØ00__func__Ø000 [15]int8
 36510  
 36511  func init() {
 36512  	crt.Xstrncpy(nil, &_sqlite3ExprDupØ00__func__Ø000[0], str(49147), 15)
 36513  }
 36514  
 36515  // C comment
 36516  //  /*
 36517  //  ** This function is similar to sqlite3ExprDup(), except that if pzBuffer
 36518  //  ** is not NULL then *pzBuffer is assumed to point to a buffer large enough
 36519  //  ** to store the copy of expression p, the copies of p->u.zToken
 36520  //  ** (if applicable), and the copies of the p->pLeft and p->pRight expressions,
 36521  //  ** if any. Before returning, *pzBuffer is set to the first byte past the
 36522  //  ** portion of the buffer copied into by this function.
 36523  //  */
 36524  func _exprDup(tls *crt.TLS, _db *Xsqlite3, _p *XExpr, _dupFlags int32, _pzBuffer **uint8) (r0 *XExpr) {
 36525  	var _3_nNewSize, _3_nToken int32
 36526  	var _staticFlag, _3_nStructSize, _7_nSize uint32
 36527  	var _9_zToken *int8
 36528  	var _zAlloc *uint8
 36529  	var _pNew *XExpr
 36530  	func() {
 36531  		if _db == nil {
 36532  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92059), unsafe.Pointer(&_exprDupØ00__func__Ø000), unsafe.Pointer(str(1219)))
 36533  			crt.X__builtin_abort(tls)
 36534  		}
 36535  	}()
 36536  	func() {
 36537  		if _p == nil {
 36538  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92060), unsafe.Pointer(&_exprDupØ00__func__Ø000), unsafe.Pointer(str(9615)))
 36539  			crt.X__builtin_abort(tls)
 36540  		}
 36541  	}()
 36542  	func() {
 36543  		if _dupFlags != int32(0) && _dupFlags != int32(1) {
 36544  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92061), unsafe.Pointer(&_exprDupØ00__func__Ø000), unsafe.Pointer(str(49162)))
 36545  			crt.X__builtin_abort(tls)
 36546  		}
 36547  	}()
 36548  	func() {
 36549  		if _pzBuffer != nil && _dupFlags != int32(1) {
 36550  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92062), unsafe.Pointer(&_exprDupØ00__func__Ø000), unsafe.Pointer(str(49202)))
 36551  			crt.X__builtin_abort(tls)
 36552  		}
 36553  	}()
 36554  	if _pzBuffer != nil {
 36555  		_zAlloc = *_pzBuffer
 36556  		_staticFlag = uint32(32768)
 36557  		goto _11
 36558  	}
 36559  	_zAlloc = (*uint8)(_sqlite3DbMallocRawNN(tls, _db, uint64(_dupedExprSize(tls, _p, _dupFlags))))
 36560  	_staticFlag = 0
 36561  _11:
 36562  	_pNew = (*XExpr)(unsafe.Pointer(_zAlloc))
 36563  	if _pNew == nil {
 36564  		goto _12
 36565  	}
 36566  	_3_nStructSize = uint32(_dupedExprStructSize(tls, _p, _dupFlags))
 36567  	_3_nNewSize = int32(_3_nStructSize & uint32(4095))
 36568  	if ((_p.Xflags & uint32(1024)) == (0)) && ((*(**int8)(unsafe.Pointer(&_p.Xu))) != nil) {
 36569  		_3_nToken = _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer(&_p.Xu))) + int32(1)
 36570  		goto _15
 36571  	}
 36572  	_3_nToken = int32(0)
 36573  _15:
 36574  	if _dupFlags != 0 {
 36575  		func() {
 36576  			if bool2int((_p.Xflags&uint32(8192)) != (0)) != int32(0) {
 36577  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92089), unsafe.Pointer(&_exprDupØ00__func__Ø000), unsafe.Pointer(str(49242)))
 36578  				crt.X__builtin_abort(tls)
 36579  			}
 36580  		}()
 36581  		crt.Xmemcpy(tls, unsafe.Pointer(_zAlloc), unsafe.Pointer(_p), uint32(_3_nNewSize))
 36582  		goto _19
 36583  	}
 36584  	_7_nSize = uint32(_exprStructSize(tls, _p))
 36585  	crt.Xmemcpy(tls, unsafe.Pointer(_zAlloc), unsafe.Pointer(_p), _7_nSize)
 36586  	if _7_nSize < uint32(48) {
 36587  		crt.Xmemset(tls, unsafe.Pointer(elem15(_zAlloc, uintptr(_7_nSize))), int32(0), uint32(48)-_7_nSize)
 36588  	}
 36589  _19:
 36590  	_pNew.Xflags &= uint32(4294844415)
 36591  	_pNew.Xflags |= _3_nStructSize & uint32(24576)
 36592  	_pNew.Xflags |= _staticFlag
 36593  	if _3_nToken != 0 {
 36594  		_9_zToken = store1((**int8)(unsafe.Pointer(&_pNew.Xu)), (*int8)(unsafe.Pointer(elem15(_zAlloc, uintptr(_3_nNewSize)))))
 36595  		crt.Xmemcpy(tls, unsafe.Pointer(_9_zToken), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_p.Xu))), uint32(_3_nToken))
 36596  	}
 36597  	if (0) != ((_p.Xflags | _pNew.Xflags) & uint32(8404992)) {
 36598  		goto _22
 36599  	}
 36600  	if (_p.Xflags & uint32(2048)) != (0) {
 36601  		*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.Xx)))) = _sqlite3SelectDup(tls, _db, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))), _dupFlags)
 36602  		goto _24
 36603  	}
 36604  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.Xx)))) = _sqlite3ExprListDup(tls, _db, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))), _dupFlags)
 36605  _24:
 36606  _22:
 36607  	if (_pNew.Xflags & uint32(24576)) == (0) {
 36608  		goto _25
 36609  	}
 36610  	*(*uintptr)(unsafe.Pointer(&_zAlloc)) += uintptr(_dupedExprNodeSize(tls, _p, _dupFlags))
 36611  	if (_pNew.Xflags & uint32(8404992)) == (0) {
 36612  		*(**XExpr)(unsafe.Pointer(&_pNew.XpLeft)) = func() *XExpr {
 36613  			if _p.XpLeft != nil {
 36614  				return _exprDup(tls, _db, (*XExpr)(_p.XpLeft), int32(1), &_zAlloc)
 36615  			}
 36616  			return nil
 36617  		}()
 36618  		*(**XExpr)(unsafe.Pointer(&_pNew.XpRight)) = func() *XExpr {
 36619  			if _p.XpRight != nil {
 36620  				return _exprDup(tls, _db, (*XExpr)(_p.XpRight), int32(1), &_zAlloc)
 36621  			}
 36622  			return nil
 36623  		}()
 36624  	}
 36625  	if _pzBuffer != nil {
 36626  		*_pzBuffer = _zAlloc
 36627  	}
 36628  	goto _32
 36629  _25:
 36630  	if (_p.Xflags & uint32(8404992)) != (0) {
 36631  		goto _33
 36632  	}
 36633  	if int32(_pNew.Xop) == int32(159) {
 36634  		*(**XExpr)(unsafe.Pointer(&_pNew.XpLeft)) = (*XExpr)(_p.XpLeft)
 36635  		func() {
 36636  			if int32(_p.XiColumn) != int32(0) && (*XExpr)(_p.XpRight) != nil {
 36637  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92135), unsafe.Pointer(&_exprDupØ00__func__Ø000), unsafe.Pointer(str(49276)))
 36638  				crt.X__builtin_abort(tls)
 36639  			}
 36640  		}()
 36641  		func() {
 36642  			if (*XExpr)(_p.XpRight) != nil && (*XExpr)(_p.XpRight) != (*XExpr)(_p.XpLeft) {
 36643  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92136), unsafe.Pointer(&_exprDupØ00__func__Ø000), unsafe.Pointer(str(49306)))
 36644  				crt.X__builtin_abort(tls)
 36645  			}
 36646  		}()
 36647  		goto _41
 36648  	}
 36649  	*(**XExpr)(unsafe.Pointer(&_pNew.XpLeft)) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.XpLeft), int32(0))
 36650  _41:
 36651  	*(**XExpr)(unsafe.Pointer(&_pNew.XpRight)) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.XpRight), int32(0))
 36652  _33:
 36653  _32:
 36654  _12:
 36655  	return _pNew
 36656  }
 36657  
 36658  var _exprDupØ00__func__Ø000 [8]int8
 36659  
 36660  func init() {
 36661  	crt.Xstrncpy(nil, &_exprDupØ00__func__Ø000[0], str(49342), 8)
 36662  }
 36663  
 36664  // C comment
 36665  //  /*
 36666  //  ** Return the number of bytes required to create a duplicate of the
 36667  //  ** expression passed as the first argument. The second argument is a
 36668  //  ** mask containing EXPRDUP_XXX flags.
 36669  //  **
 36670  //  ** The value returned includes space to create a copy of the Expr struct
 36671  //  ** itself and the buffer referred to by Expr.u.zToken, if any.
 36672  //  **
 36673  //  ** If the EXPRDUP_REDUCE flag is set, then the return value includes
 36674  //  ** space to duplicate all Expr nodes in the tree formed by Expr.pLeft
 36675  //  ** and Expr.pRight variables (but not for any structures pointed to or
 36676  //  ** descended from the Expr.x.pList or Expr.x.pSelect variables).
 36677  //  */
 36678  func _dupedExprSize(tls *crt.TLS, _p *XExpr, _flags int32) (r0 int32) {
 36679  	var _nByte int32
 36680  	_nByte = int32(0)
 36681  	if _p == nil {
 36682  		goto _0
 36683  	}
 36684  	_nByte = _dupedExprNodeSize(tls, _p, _flags)
 36685  	if (_flags & int32(1)) != 0 {
 36686  		_nByte += _dupedExprSize(tls, (*XExpr)(_p.XpLeft), _flags) + _dupedExprSize(tls, (*XExpr)(_p.XpRight), _flags)
 36687  	}
 36688  _0:
 36689  	return _nByte
 36690  }
 36691  
 36692  // C comment
 36693  //  /*
 36694  //  ** This function returns the space in bytes required to store the copy
 36695  //  ** of the Expr structure and a copy of the Expr.u.zToken string (if that
 36696  //  ** string is defined.)
 36697  //  */
 36698  func _dupedExprNodeSize(tls *crt.TLS, _p *XExpr, _flags int32) (r0 int32) {
 36699  	var _nByte int32
 36700  	_nByte = _dupedExprStructSize(tls, _p, _flags) & int32(4095)
 36701  	if ((_p.Xflags & uint32(1024)) == (0)) && ((*(**int8)(unsafe.Pointer(&_p.Xu))) != nil) {
 36702  		_nByte += _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer(&_p.Xu))) + int32(1)
 36703  	}
 36704  	return (_nByte + int32(7)) & int32(-8)
 36705  }
 36706  
 36707  // C comment
 36708  //  /*
 36709  //  ** The dupedExpr*Size() routines each return the number of bytes required
 36710  //  ** to store a copy of an expression or expression tree.  They differ in
 36711  //  ** how much of the tree is measured.
 36712  //  **
 36713  //  **     dupedExprStructSize()     Size of only the Expr structure
 36714  //  **     dupedExprNodeSize()       Size of Expr + space for token
 36715  //  **     dupedExprSize()           Expr + token + subtree components
 36716  //  **
 36717  //  ***************************************************************************
 36718  //  **
 36719  //  ** The dupedExprStructSize() function returns two values OR-ed together:
 36720  //  ** (1) the space required for a copy of the Expr structure only and
 36721  //  ** (2) the EP_xxx flags that indicate what the structure size should be.
 36722  //  ** The return values is always one of:
 36723  //  **
 36724  //  **      EXPR_FULLSIZE
 36725  //  **      EXPR_REDUCEDSIZE   | EP_Reduced
 36726  //  **      EXPR_TOKENONLYSIZE | EP_TokenOnly
 36727  //  **
 36728  //  ** The size of the structure can be found by masking the return value
 36729  //  ** of this routine with 0xfff.  The flags can be found by masking the
 36730  //  ** return value with EP_Reduced|EP_TokenOnly.
 36731  //  **
 36732  //  ** Note that with flags==EXPRDUP_REDUCE, this routines works on full-size
 36733  //  ** (unreduced) Expr objects as they or originally constructed by the parser.
 36734  //  ** During expression analysis, extra information is computed and moved into
 36735  //  ** later parts of teh Expr object and that extra information might get chopped
 36736  //  ** off if the expression is reduced.  Note also that it does not work to
 36737  //  ** make an EXPRDUP_REDUCE copy of a reduced expression.  It is only legal
 36738  //  ** to reduce a pristine expression tree from the parser.  The implementation
 36739  //  ** of dupedExprStructSize() contain multiple assert() statements that attempt
 36740  //  ** to enforce this constraint.
 36741  //  */
 36742  func _dupedExprStructSize(tls *crt.TLS, _p *XExpr, _flags int32) (r0 int32) {
 36743  	var _nSize int32
 36744  	func() {
 36745  		if _flags != int32(1) && _flags != int32(0) {
 36746  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91989), unsafe.Pointer(&_dupedExprStructSizeØ00__func__Ø000), unsafe.Pointer(str(49350)))
 36747  			crt.X__builtin_abort(tls)
 36748  		}
 36749  	}()
 36750  
 36751  	if (int32(0) == _flags) || (int32(_p.Xop) == int32(159)) {
 36752  		_nSize = int32(48)
 36753  		goto _5
 36754  	}
 36755  	func() {
 36756  		if (_p.Xflags & uint32(24576)) != (0) {
 36757  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91995), unsafe.Pointer(&_dupedExprStructSizeØ00__func__Ø000), unsafe.Pointer(str(49384)))
 36758  			crt.X__builtin_abort(tls)
 36759  		}
 36760  	}()
 36761  	func() {
 36762  		if (_p.Xflags & uint32(1)) != (0) {
 36763  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91996), unsafe.Pointer(&_dupedExprStructSizeØ00__func__Ø000), unsafe.Pointer(str(49429)))
 36764  			crt.X__builtin_abort(tls)
 36765  		}
 36766  	}()
 36767  	func() {
 36768  		if (_p.Xflags & uint32(65536)) != (0) {
 36769  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91997), unsafe.Pointer(&_dupedExprStructSizeØ00__func__Ø000), unsafe.Pointer(str(49462)))
 36770  			crt.X__builtin_abort(tls)
 36771  		}
 36772  	}()
 36773  	func() {
 36774  		if (_p.Xflags & uint32(131072)) != (0) {
 36775  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91998), unsafe.Pointer(&_dupedExprStructSizeØ00__func__Ø000), unsafe.Pointer(str(49495)))
 36776  			crt.X__builtin_abort(tls)
 36777  		}
 36778  	}()
 36779  	if (_p.XpLeft != nil) || ((*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))) != nil) {
 36780  		_nSize = int32(8220)
 36781  		goto _16
 36782  	}
 36783  	func() {
 36784  		if (*XExpr)(_p.XpRight) != nil {
 36785  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92002), unsafe.Pointer(&_dupedExprStructSizeØ00__func__Ø000), unsafe.Pointer(str(21211)))
 36786  			crt.X__builtin_abort(tls)
 36787  		}
 36788  	}()
 36789  	_nSize = int32(16396)
 36790  _16:
 36791  _5:
 36792  	return _nSize
 36793  }
 36794  
 36795  var _dupedExprStructSizeØ00__func__Ø000 [20]int8
 36796  
 36797  func init() {
 36798  	crt.Xstrncpy(nil, &_dupedExprStructSizeØ00__func__Ø000[0], str(49528), 20)
 36799  }
 36800  
 36801  // C comment
 36802  //  /*
 36803  //  ** Return the number of bytes allocated for the expression structure
 36804  //  ** passed as the first argument. This is always one of EXPR_FULLSIZE,
 36805  //  ** EXPR_REDUCEDSIZE or EXPR_TOKENONLYSIZE.
 36806  //  */
 36807  func _exprStructSize(tls *crt.TLS, _p *XExpr) (r0 int32) {
 36808  	if (_p.Xflags & uint32(16384)) != (0) {
 36809  		return int32(12)
 36810  	}
 36811  	if (_p.Xflags & uint32(8192)) != (0) {
 36812  		return int32(28)
 36813  	}
 36814  	return int32(48)
 36815  }
 36816  
 36817  func _sqlite3SrcListDup(tls *crt.TLS, _db *Xsqlite3, _p *XSrcList, _flags int32) (r0 *XSrcList) {
 36818  	var _i, _nByte int32
 36819  	var _1_pTab *XTable
 36820  	var _pNew *XSrcList
 36821  	var _1_pNewItem, _1_pOldItem *TSrcList_item
 36822  	func() {
 36823  		if _db == nil {
 36824  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92250), unsafe.Pointer(&_sqlite3SrcListDupØ00__func__Ø000), unsafe.Pointer(str(1219)))
 36825  			crt.X__builtin_abort(tls)
 36826  		}
 36827  	}()
 36828  	if _p == nil {
 36829  		return nil
 36830  	}
 36831  	_nByte = int32(uint32(76) + func() uint32 {
 36832  		if _p.XnSrc > int32(0) {
 36833  			return (uint32(68) * uint32(_p.XnSrc-int32(1)))
 36834  		}
 36835  		return (0)
 36836  	}())
 36837  	_pNew = (*XSrcList)(_sqlite3DbMallocRawNN(tls, _db, uint64(_nByte)))
 36838  	if _pNew == nil {
 36839  		return nil
 36840  	}
 36841  	_pNew.XnSrc = int32(store23(&_pNew.XnAlloc, uint32(_p.XnSrc)))
 36842  	_i = int32(0)
 36843  _6:
 36844  	if _i >= _p.XnSrc {
 36845  		goto _9
 36846  	}
 36847  	_1_pNewItem = elem6((*TSrcList_item)(unsafe.Pointer(&_pNew.Xa)), uintptr(_i))
 36848  	_1_pOldItem = elem6((*TSrcList_item)(unsafe.Pointer(&_p.Xa)), uintptr(_i))
 36849  	*(**XSchema)(unsafe.Pointer(&_1_pNewItem.XpSchema)) = (*XSchema)(_1_pOldItem.XpSchema)
 36850  	_1_pNewItem.XzDatabase = _sqlite3DbStrDup(tls, _db, _1_pOldItem.XzDatabase)
 36851  	_1_pNewItem.XzName = _sqlite3DbStrDup(tls, _db, _1_pOldItem.XzName)
 36852  	_1_pNewItem.XzAlias = _sqlite3DbStrDup(tls, _db, _1_pOldItem.XzAlias)
 36853  	_1_pNewItem.Xfg = _1_pOldItem.Xfg
 36854  	_1_pNewItem.XiCursor = _1_pOldItem.XiCursor
 36855  	_1_pNewItem.XaddrFillSub = _1_pOldItem.XaddrFillSub
 36856  	_1_pNewItem.XregReturn = _1_pOldItem.XregReturn
 36857  	if ((uint32((_1_pNewItem.Xfg.XnotIndexed)>>1) << 31) >> 31) != 0 {
 36858  		*(**int8)(unsafe.Pointer(&_1_pNewItem.Xu1)) = _sqlite3DbStrDup(tls, _db, *(**int8)(unsafe.Pointer(&_1_pOldItem.Xu1)))
 36859  	}
 36860  	*(**XIndex)(unsafe.Pointer(&_1_pNewItem.XpIBIndex)) = (*XIndex)(_1_pOldItem.XpIBIndex)
 36861  	if ((uint32((_1_pNewItem.Xfg.XnotIndexed)>>2) << 31) >> 31) != 0 {
 36862  		*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pNewItem.Xu1)))) = _sqlite3ExprListDup(tls, _db, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_1_pOldItem.Xu1))), _flags)
 36863  	}
 36864  	_1_pTab = store72((**XTable)(unsafe.Pointer(&_1_pNewItem.XpTab)), (*XTable)(_1_pOldItem.XpTab))
 36865  	if _1_pTab != nil {
 36866  		_1_pTab.XnTabRef += 1
 36867  	}
 36868  	*(**XSelect)(unsafe.Pointer(&_1_pNewItem.XpSelect)) = _sqlite3SelectDup(tls, _db, (*XSelect)(_1_pOldItem.XpSelect), _flags)
 36869  	*(**XExpr)(unsafe.Pointer(&_1_pNewItem.XpOn)) = _sqlite3ExprDup(tls, _db, (*XExpr)(_1_pOldItem.XpOn), _flags)
 36870  	*(**XIdList)(unsafe.Pointer(&_1_pNewItem.XpUsing)) = _sqlite3IdListDup(tls, _db, (*XIdList)(_1_pOldItem.XpUsing))
 36871  	_1_pNewItem.XcolUsed = _1_pOldItem.XcolUsed
 36872  	_i += 1
 36873  	goto _6
 36874  _9:
 36875  	return _pNew
 36876  }
 36877  
 36878  var _sqlite3SrcListDupØ00__func__Ø000 [18]int8
 36879  
 36880  func init() {
 36881  	crt.Xstrncpy(nil, &_sqlite3SrcListDupØ00__func__Ø000[0], str(49548), 18)
 36882  }
 36883  
 36884  func _sqlite3IdListDup(tls *crt.TLS, _db *Xsqlite3, _p *XIdList) (r0 *XIdList) {
 36885  	var _i int32
 36886  	var _pNew *XIdList
 36887  	var _2_pNewItem, _2_pOldItem *TIdList_item
 36888  	func() {
 36889  		if _db == nil {
 36890  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92290), unsafe.Pointer(&_sqlite3IdListDupØ00__func__Ø000), unsafe.Pointer(str(1219)))
 36891  			crt.X__builtin_abort(tls)
 36892  		}
 36893  	}()
 36894  	if _p == nil {
 36895  		return nil
 36896  	}
 36897  	_pNew = (*XIdList)(_sqlite3DbMallocRawNN(tls, _db, uint64(8)))
 36898  	if _pNew == nil {
 36899  		return nil
 36900  	}
 36901  	_pNew.XnId = _p.XnId
 36902  	*(**TIdList_item)(unsafe.Pointer(&_pNew.Xa)) = (*TIdList_item)(_sqlite3DbMallocRawNN(tls, _db, uint64(uint32(_p.XnId)*uint32(8))))
 36903  	if (*TIdList_item)(_pNew.Xa) == nil {
 36904  		_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_pNew))
 36905  		return nil
 36906  	}
 36907  	_i = int32(0)
 36908  _5:
 36909  	if _i >= _p.XnId {
 36910  		goto _8
 36911  	}
 36912  	_2_pNewItem = elem42((*TIdList_item)(_pNew.Xa), uintptr(_i))
 36913  	_2_pOldItem = elem42((*TIdList_item)(_p.Xa), uintptr(_i))
 36914  	_2_pNewItem.XzName = _sqlite3DbStrDup(tls, _db, _2_pOldItem.XzName)
 36915  	_2_pNewItem.Xidx = _2_pOldItem.Xidx
 36916  	_i += 1
 36917  	goto _5
 36918  _8:
 36919  	return _pNew
 36920  }
 36921  
 36922  var _sqlite3IdListDupØ00__func__Ø000 [17]int8
 36923  
 36924  func init() {
 36925  	crt.Xstrncpy(nil, &_sqlite3IdListDupØ00__func__Ø000[0], str(49566), 17)
 36926  }
 36927  
 36928  func _withDup(tls *crt.TLS, _db *Xsqlite3, _p *XWith) (r0 *XWith) {
 36929  	var _1_nByte, _2_i int32
 36930  	var _pRet *XWith
 36931  	_pRet = nil
 36932  	if _p == nil {
 36933  		goto _0
 36934  	}
 36935  	_1_nByte = int32(uint32(24) + (uint32(16) * uint32(_p.XnCte-int32(1))))
 36936  	_pRet = (*XWith)(_sqlite3DbMallocZero(tls, _db, uint64(_1_nByte)))
 36937  	if _pRet == nil {
 36938  		goto _1
 36939  	}
 36940  	_pRet.XnCte = _p.XnCte
 36941  	_2_i = int32(0)
 36942  _2:
 36943  	if _2_i >= _p.XnCte {
 36944  		goto _5
 36945  	}
 36946  	*(**XSelect)(unsafe.Pointer(&(elem43((*TCte)(unsafe.Pointer(&_pRet.Xa)), uintptr(_2_i)).XpSelect))) = _sqlite3SelectDup(tls, _db, (*XSelect)(elem43((*TCte)(unsafe.Pointer(&_p.Xa)), uintptr(_2_i)).XpSelect), int32(0))
 36947  	*(**XExprList)(unsafe.Pointer(&(elem43((*TCte)(unsafe.Pointer(&_pRet.Xa)), uintptr(_2_i)).XpCols))) = _sqlite3ExprListDup(tls, _db, (*XExprList)(elem43((*TCte)(unsafe.Pointer(&_p.Xa)), uintptr(_2_i)).XpCols), int32(0))
 36948  	elem43((*TCte)(unsafe.Pointer(&_pRet.Xa)), uintptr(_2_i)).XzName = _sqlite3DbStrDup(tls, _db, elem43((*TCte)(unsafe.Pointer(&_p.Xa)), uintptr(_2_i)).XzName)
 36949  	_2_i += 1
 36950  	goto _2
 36951  _5:
 36952  _1:
 36953  _0:
 36954  	return _pRet
 36955  }
 36956  
 36957  // C comment
 36958  //  /*
 36959  //  ** Set the name of a Select object
 36960  //  */
 36961  func _sqlite3SelectSetName(tls *crt.TLS, _p *XSelect, _zName *int8) {
 36962  	if (_p != nil) && (_zName != nil) {
 36963  		Xsqlite3_snprintf(tls, int32(12), (*int8)(unsafe.Pointer(&_p.XzSelName)), str(24531), unsafe.Pointer(_zName))
 36964  	}
 36965  }
 36966  
 36967  // C comment
 36968  //  /*
 36969  //  ** Given an expression list (which is really the list of expressions
 36970  //  ** that form the result set of a SELECT statement) compute appropriate
 36971  //  ** column names for a table that would hold the expression list.
 36972  //  **
 36973  //  ** All column names will be unique.
 36974  //  **
 36975  //  ** Only the column names are computed.  Column.zType, Column.zColl,
 36976  //  ** and other fields of Column are zeroed.
 36977  //  **
 36978  //  ** Return SQLITE_OK on success.  If a memory allocation error occurs,
 36979  //  ** store NULL in *paCol and 0 in *pnCol and return SQLITE_NOMEM.
 36980  //  */
 36981  func _sqlite3ColumnsFromExprList(tls *crt.TLS, _pParse *XParse, _pEList *XExprList, _pnCol *int16, _paCol **XColumn) (r0 int32) {
 36982  	var _i, _j, _nCol, _nName, _7_iCol int32
 36983  	var _cnt uint32
 36984  	var _zName *int8
 36985  	var _ht XHash
 36986  	var _db *Xsqlite3
 36987  	var _5_pTab *XTable
 36988  	var _p, _5_pColExpr *XExpr
 36989  	var _aCol, _pCol *XColumn
 36990  	_db = (*Xsqlite3)(_pParse.Xdb)
 36991  	_sqlite3HashInit(tls, &_ht)
 36992  	if _pEList != nil {
 36993  		_nCol = _pEList.XnExpr
 36994  		_aCol = (*XColumn)(_sqlite3DbMallocZero(tls, _db, uint64(uint32(16)*uint32(_nCol))))
 36995  		goto _1
 36996  	}
 36997  	_nCol = int32(0)
 36998  	_aCol = nil
 36999  _1:
 37000  	func() {
 37001  		if _nCol != int32(int16(_nCol)) {
 37002  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118197), unsafe.Pointer(&_sqlite3ColumnsFromExprListØ00__func__Ø000), unsafe.Pointer(str(49583)))
 37003  			crt.X__builtin_abort(tls)
 37004  		}
 37005  	}()
 37006  	*_pnCol = int16(_nCol)
 37007  	*_paCol = _aCol
 37008  	*func() **XColumn { _i = int32(0); return &_pCol }() = _aCol
 37009  _4:
 37010  	if _i >= _nCol || _db.XmallocFailed != 0 {
 37011  		goto _8
 37012  	}
 37013  	_p = _sqlite3ExprSkipCollate(tls, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XpExpr))
 37014  	if store1(&_zName, elem57((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XzName) != nil {
 37015  		goto _10
 37016  	}
 37017  	_5_pColExpr = _p
 37018  _11:
 37019  	if int32(_5_pColExpr.Xop) == int32(122) {
 37020  		_5_pColExpr = (*XExpr)(_5_pColExpr.XpRight)
 37021  		func() {
 37022  			if _5_pColExpr == nil {
 37023  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118212), unsafe.Pointer(&_sqlite3ColumnsFromExprListØ00__func__Ø000), unsafe.Pointer(str(49599)))
 37024  				crt.X__builtin_abort(tls)
 37025  			}
 37026  		}()
 37027  		goto _11
 37028  	}
 37029  	if int32(_5_pColExpr.Xop) != int32(152) || (*XTable)(_5_pColExpr.XpTab) == nil {
 37030  		goto _16
 37031  	}
 37032  	_7_iCol = int32(_5_pColExpr.XiColumn)
 37033  	_5_pTab = (*XTable)(_5_pColExpr.XpTab)
 37034  	if _7_iCol < int32(0) {
 37035  		_7_iCol = int32(_5_pTab.XiPKey)
 37036  	}
 37037  	_zName = func() *int8 {
 37038  		if _7_iCol >= int32(0) {
 37039  			return (elem41((*XColumn)(_5_pTab.XaCol), uintptr(_7_iCol)).XzName)
 37040  		}
 37041  		return str(27182)
 37042  	}()
 37043  	goto _24
 37044  _16:
 37045  	if int32(_5_pColExpr.Xop) == int32(27) {
 37046  		func() {
 37047  			if (_5_pColExpr.Xflags & uint32(1024)) != (0) {
 37048  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118221), unsafe.Pointer(&_sqlite3ColumnsFromExprListØ00__func__Ø000), unsafe.Pointer(str(49611)))
 37049  				crt.X__builtin_abort(tls)
 37050  			}
 37051  		}()
 37052  		_zName = *(**int8)(unsafe.Pointer(&_5_pColExpr.Xu))
 37053  		goto _24
 37054  	}
 37055  	_zName = elem57((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XzSpan
 37056  _24:
 37057  _10:
 37058  	_zName = _sqlite3MPrintf(tls, _db, str(24531), unsafe.Pointer(_zName))
 37059  	_cnt = 0
 37060  _25:
 37061  	if _zName == nil || _sqlite3HashFind(tls, &_ht, _zName) == nil {
 37062  		goto _26
 37063  	}
 37064  	_nName = _sqlite3Strlen30(tls, _zName)
 37065  	if _nName <= int32(0) {
 37066  		goto _28
 37067  	}
 37068  	_j = _nName - int32(1)
 37069  _29:
 37070  	if _j <= int32(0) || (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_zName, uintptr(_j))))))&int32(4)) == 0 {
 37071  		goto _33
 37072  	}
 37073  	_j -= 1
 37074  	goto _29
 37075  _33:
 37076  	if int32(*elem1(_zName, uintptr(_j))) == int32(58) {
 37077  		_nName = _j
 37078  	}
 37079  _28:
 37080  	_zName = _sqlite3MPrintf(tls, _db, str(49651), _nName, unsafe.Pointer(_zName), preInc23(&_cnt, uint32(1)))
 37081  	if _cnt > uint32(3) {
 37082  		Xsqlite3_randomness(tls, int32(4), unsafe.Pointer(&_cnt))
 37083  	}
 37084  	goto _25
 37085  _26:
 37086  	_pCol.XzName = _zName
 37087  	if (_zName != nil) && (_sqlite3HashInsert(tls, &_ht, _zName, unsafe.Pointer(_pCol)) == unsafe.Pointer(_pCol)) {
 37088  		_sqlite3OomFault(tls, _db)
 37089  	}
 37090  	*(*uintptr)(unsafe.Pointer(func() **XColumn { _i += 1; return &_pCol }())) += uintptr(16)
 37091  	goto _4
 37092  _8:
 37093  	_sqlite3HashClear(tls, &_ht)
 37094  	if _db.XmallocFailed == 0 {
 37095  		goto _38
 37096  	}
 37097  	_j = int32(0)
 37098  _39:
 37099  	if _j >= _i {
 37100  		goto _42
 37101  	}
 37102  	_sqlite3DbFree(tls, _db, unsafe.Pointer(elem41(_aCol, uintptr(_j)).XzName))
 37103  	_j += 1
 37104  	goto _39
 37105  _42:
 37106  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_aCol))
 37107  	*_paCol = nil
 37108  	*_pnCol = 0
 37109  	return _sqlite3NomemError(tls, int32(118257))
 37110  
 37111  _38:
 37112  	return int32(0)
 37113  }
 37114  
 37115  var _sqlite3ColumnsFromExprListØ00__func__Ø000 [27]int8
 37116  
 37117  func init() {
 37118  	crt.Xstrncpy(nil, &_sqlite3ColumnsFromExprListØ00__func__Ø000[0], str(49659), 27)
 37119  }
 37120  
 37121  // C comment
 37122  //  /*
 37123  //  ** Locate the table identified by *p.
 37124  //  **
 37125  //  ** This is a wrapper around sqlite3LocateTable(). The difference between
 37126  //  ** sqlite3LocateTable() and this function is that this function restricts
 37127  //  ** the search to schema (p->pSchema) if it is not NULL. p->pSchema may be
 37128  //  ** non-NULL if it is part of a view or trigger program definition. See
 37129  //  ** sqlite3FixSrcList() for details.
 37130  //  */
 37131  func _sqlite3LocateTableItem(tls *crt.TLS, _pParse *XParse, _flags uint32, _p *TSrcList_item) (r0 *XTable) {
 37132  	var _1_iDb int32
 37133  	var _zDb *int8
 37134  	func() {
 37135  		if (*XSchema)(_p.XpSchema) != nil && _p.XzDatabase != nil {
 37136  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100094), unsafe.Pointer(&_sqlite3LocateTableItemØ00__func__Ø000), unsafe.Pointer(str(49686)))
 37137  			crt.X__builtin_abort(tls)
 37138  		}
 37139  	}()
 37140  	if _p.XpSchema != nil {
 37141  		_1_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), (*XSchema)(_p.XpSchema))
 37142  		_zDb = elem27((*XDb)((*Xsqlite3)(_pParse.Xdb).XaDb), uintptr(_1_iDb)).XzDbSName
 37143  		goto _4
 37144  	}
 37145  	_zDb = _p.XzDatabase
 37146  _4:
 37147  	return _sqlite3LocateTable(tls, _pParse, _flags, _p.XzName, _zDb)
 37148  }
 37149  
 37150  var _sqlite3LocateTableItemØ00__func__Ø000 [23]int8
 37151  
 37152  func init() {
 37153  	crt.Xstrncpy(nil, &_sqlite3LocateTableItemØ00__func__Ø000[0], str(49719), 23)
 37154  }
 37155  
 37156  // C comment
 37157  //  /*
 37158  //  ** Locate the in-memory structure that describes a particular database
 37159  //  ** table given the name of that table and (optionally) the name of the
 37160  //  ** database containing the table.  Return NULL if not found.  Also leave an
 37161  //  ** error message in pParse->zErrMsg.
 37162  //  **
 37163  //  ** The difference between this routine and sqlite3FindTable() is that this
 37164  //  ** routine leaves an error message in pParse->zErrMsg where
 37165  //  ** sqlite3FindTable() does not.
 37166  //  */
 37167  func _sqlite3LocateTable(tls *crt.TLS, _pParse *XParse, _flags uint32, _zName *int8, _zDbase *int8) (r0 *XTable) {
 37168  	var _2_zMsg *int8
 37169  	var _p *XTable
 37170  	var _3_pMod *XModule
 37171  	if int32(0) != _sqlite3ReadSchema(tls, _pParse) {
 37172  		return nil
 37173  	}
 37174  	_p = _sqlite3FindTable(tls, (*Xsqlite3)(_pParse.Xdb), _zName, _zDbase)
 37175  	if _p != nil {
 37176  		goto _1
 37177  	}
 37178  	_2_zMsg = func() *int8 {
 37179  		if (_flags & uint32(1)) != 0 {
 37180  			return str(49742)
 37181  		}
 37182  		return str(49755)
 37183  	}()
 37184  	if _sqlite3FindDbName(tls, (*Xsqlite3)(_pParse.Xdb), _zDbase) >= int32(1) {
 37185  		goto _4
 37186  	}
 37187  	_3_pMod = (*XModule)(_sqlite3HashFind(tls, &((*Xsqlite3)(_pParse.Xdb).XaModule), _zName))
 37188  	if (_3_pMod == nil) && (Xsqlite3_strnicmp(tls, _zName, str(49769), int32(7)) == int32(0)) {
 37189  		_3_pMod = _sqlite3PragmaVtabRegister(tls, (*Xsqlite3)(_pParse.Xdb), _zName)
 37190  	}
 37191  	if (_3_pMod != nil) && _sqlite3VtabEponymousTableInit(tls, _pParse, _3_pMod) != 0 {
 37192  		return (*XTable)(_3_pMod.XpEpoTab)
 37193  	}
 37194  _4:
 37195  	if (_flags & uint32(2)) != (0) {
 37196  		goto _9
 37197  	}
 37198  	if _zDbase != nil {
 37199  		_sqlite3ErrorMsg(tls, _pParse, str(49777), unsafe.Pointer(_2_zMsg), unsafe.Pointer(_zDbase), unsafe.Pointer(_zName))
 37200  		goto _11
 37201  	}
 37202  	_sqlite3ErrorMsg(tls, _pParse, str(49787), unsafe.Pointer(_2_zMsg), unsafe.Pointer(_zName))
 37203  _11:
 37204  	_pParse.XcheckSchema = uint8(1)
 37205  _9:
 37206  _1:
 37207  	return _p
 37208  }
 37209  
 37210  // C comment
 37211  //  /*
 37212  //  ** This routine is a no-op if the database schema is already initialized.
 37213  //  ** Otherwise, the schema is loaded. An error code is returned.
 37214  //  */
 37215  func _sqlite3ReadSchema(tls *crt.TLS, _pParse *XParse) (r0 int32) {
 37216  	var _rc int32
 37217  	var _db *Xsqlite3
 37218  	_rc = int32(0)
 37219  	_db = (*Xsqlite3)(_pParse.Xdb)
 37220  	func() {
 37221  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 37222  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116068), unsafe.Pointer(&_sqlite3ReadSchemaØ00__func__Ø000), unsafe.Pointer(str(881)))
 37223  			crt.X__builtin_abort(tls)
 37224  		}
 37225  	}()
 37226  	if (_db.Xinit.Xbusy) == 0 {
 37227  		_rc = _sqlite3Init(tls, _db, &_pParse.XzErrMsg)
 37228  	}
 37229  	if _rc != int32(0) {
 37230  		_pParse.Xrc = _rc
 37231  		_pParse.XnErr += 1
 37232  	}
 37233  	return _rc
 37234  }
 37235  
 37236  var _sqlite3ReadSchemaØ00__func__Ø000 [18]int8
 37237  
 37238  func init() {
 37239  	crt.Xstrncpy(nil, &_sqlite3ReadSchemaØ00__func__Ø000[0], str(49794), 18)
 37240  }
 37241  
 37242  // C comment
 37243  //  /*
 37244  //  ** Initialize all database files - the main database file, the file
 37245  //  ** used to store temporary tables, and any additional database files
 37246  //  ** created using ATTACH statements.  Return a success code.  If an
 37247  //  ** error occurs, write an error message into *pzErrMsg.
 37248  //  **
 37249  //  ** After a database is initialized, the DB_SchemaLoaded bit is set
 37250  //  ** bit is set in the flags field of the Db structure. If the database
 37251  //  ** file was of zero-length, then the DB_Empty flag is also set.
 37252  //  */
 37253  func _sqlite3Init(tls *crt.TLS, _db *Xsqlite3, _pzErrMsg **int8) (r0 int32) {
 37254  	var _i, _rc, _commit_internal int32
 37255  	_commit_internal = bool2int((_db.Xflags & int32(2)) == 0)
 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(116025), unsafe.Pointer(&_sqlite3InitØ00__func__Ø000), unsafe.Pointer(str(881)))
 37259  			crt.X__builtin_abort(tls)
 37260  		}
 37261  	}()
 37262  	func() {
 37263  		if _sqlite3BtreeHoldsMutex(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), 0).XpBt)) == 0 {
 37264  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116026), unsafe.Pointer(&_sqlite3InitØ00__func__Ø000), unsafe.Pointer(str(49812)))
 37265  			crt.X__builtin_abort(tls)
 37266  		}
 37267  	}()
 37268  	func() {
 37269  		if int32(_db.Xinit.Xbusy) != int32(0) {
 37270  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116027), unsafe.Pointer(&_sqlite3InitØ00__func__Ø000), unsafe.Pointer(str(49851)))
 37271  			crt.X__builtin_abort(tls)
 37272  		}
 37273  	}()
 37274  	_rc = int32(0)
 37275  	_db.Xinit.Xbusy = uint8(1)
 37276  	_db.Xenc = (*XSchema)(elem27((*XDb)(_db.XaDb), 0).XpSchema).Xenc
 37277  	_i = int32(0)
 37278  _6:
 37279  	if _rc != int32(0) || _i >= _db.XnDb {
 37280  		goto _10
 37281  	}
 37282  	if ((int32((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpSchema).XschemaFlags) & int32(1)) == int32(1)) || (_i == int32(1)) {
 37283  		goto _7
 37284  	}
 37285  	_rc = _sqlite3InitOne(tls, _db, _i, _pzErrMsg)
 37286  	if _rc != 0 {
 37287  		_sqlite3ResetOneSchema(tls, _db, _i)
 37288  	}
 37289  _7:
 37290  	_i += 1
 37291  	goto _6
 37292  _10:
 37293  	func() {
 37294  		if _db.XnDb <= int32(1) {
 37295  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116044), unsafe.Pointer(&_sqlite3InitØ00__func__Ø000), unsafe.Pointer(str(49868)))
 37296  			crt.X__builtin_abort(tls)
 37297  		}
 37298  	}()
 37299  	if _rc != int32(0) || (int32((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(1)).XpSchema).XschemaFlags)&int32(1)) == int32(1) {
 37300  		goto _17
 37301  	}
 37302  	_rc = _sqlite3InitOne(tls, _db, int32(1), _pzErrMsg)
 37303  	if _rc != 0 {
 37304  		_sqlite3ResetOneSchema(tls, _db, int32(1))
 37305  	}
 37306  _17:
 37307  	_db.Xinit.Xbusy = 0
 37308  	if (_rc == int32(0)) && _commit_internal != 0 {
 37309  		_sqlite3CommitInternalChanges(tls, _db)
 37310  	}
 37311  	return _rc
 37312  }
 37313  
 37314  var _sqlite3InitØ00__func__Ø000 [12]int8
 37315  
 37316  func init() {
 37317  	crt.Xstrncpy(nil, &_sqlite3InitØ00__func__Ø000[0], str(49878), 12)
 37318  }
 37319  
 37320  // C comment
 37321  //  /*
 37322  //  ** Attempt to read the database schema and initialize internal
 37323  //  ** data structures for a single database file.  The index of the
 37324  //  ** database file is given by iDb.  iDb==0 is used for the main
 37325  //  ** database.  iDb==1 should never be used.  iDb>=2 is used for
 37326  //  ** auxiliary databases.  Return one of the SQLITE_ error codes to
 37327  //  ** indicate success or failure.
 37328  //  */
 37329  func _sqlite3InitOne(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _pzErrMsg **int8) (r0 int32) {
 37330  	var _rc, _i, _size, _openedTransaction int32
 37331  	var _zMasterName, _17_zSql *int8
 37332  	var _8_encoding uint8
 37333  	var _18_xAuth func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32
 37334  	var _pDb *XDb
 37335  	var _meta [5]int32
 37336  	var _azArg [4]*int8
 37337  	var _initData XInitData
 37338  	_openedTransaction = int32(0)
 37339  	func() {
 37340  		if _iDb < int32(0) || _iDb >= _db.XnDb {
 37341  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115814), unsafe.Pointer(&_sqlite3InitOneØ00__func__Ø000), unsafe.Pointer(str(21693)))
 37342  			crt.X__builtin_abort(tls)
 37343  		}
 37344  	}()
 37345  	func() {
 37346  		if (elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema) == nil {
 37347  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115815), unsafe.Pointer(&_sqlite3InitOneØ00__func__Ø000), unsafe.Pointer(str(49890)))
 37348  			crt.X__builtin_abort(tls)
 37349  		}
 37350  	}()
 37351  	func() {
 37352  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 37353  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115816), unsafe.Pointer(&_sqlite3InitOneØ00__func__Ø000), unsafe.Pointer(str(881)))
 37354  			crt.X__builtin_abort(tls)
 37355  		}
 37356  	}()
 37357  	func() {
 37358  		if _iDb != int32(1) && _sqlite3BtreeHoldsMutex(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpBt)) == 0 {
 37359  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115817), unsafe.Pointer(&_sqlite3InitOneØ00__func__Ø000), unsafe.Pointer(str(49911)))
 37360  			crt.X__builtin_abort(tls)
 37361  		}
 37362  	}()
 37363  	*elem0((**int8)(unsafe.Pointer(&_azArg)), 0) = store1(&_zMasterName, func() *int8 {
 37364  		if int32(1) != 0 && (_iDb == int32(1)) {
 37365  			return str(49962)
 37366  		}
 37367  		return str(49981)
 37368  	}())
 37369  	*elem0((**int8)(unsafe.Pointer(&_azArg)), uintptr(1)) = str(49995)
 37370  	*elem0((**int8)(unsafe.Pointer(&_azArg)), uintptr(2)) = str(49997)
 37371  	*elem0((**int8)(unsafe.Pointer(&_azArg)), uintptr(3)) = nil
 37372  	*(**Xsqlite3)(unsafe.Pointer(&_initData.Xdb)) = _db
 37373  	_initData.XiDb = _iDb
 37374  	_initData.Xrc = int32(0)
 37375  	_initData.XpzErrMsg = _pzErrMsg
 37376  	_sqlite3InitCallback(tls, unsafe.Pointer(&_initData), int32(3), (**int8)(unsafe.Pointer(&_azArg)), nil)
 37377  	if _initData.Xrc != 0 {
 37378  		_rc = _initData.Xrc
 37379  		goto _error_out
 37380  	}
 37381  	_pDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb))
 37382  	if (*XBtree)(_pDb.XpBt) != nil {
 37383  		goto _14
 37384  	}
 37385  	if int32(1) != 0 && func() int32 {
 37386  		if _iDb == int32(1) {
 37387  			return int32(1)
 37388  		}
 37389  		return func() int32 {
 37390  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115843), unsafe.Pointer(&_sqlite3InitOneØ00__func__Ø000), unsafe.Pointer(str(4809)))
 37391  			crt.X__builtin_abort(tls)
 37392  			return int32(0)
 37393  		}()
 37394  	}() != 0 {
 37395  		{
 37396  			p := &((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(1)).XpSchema).XschemaFlags)
 37397  			*p = uint16(int32(*p) | int32(1))
 37398  		}
 37399  	}
 37400  	return int32(0)
 37401  
 37402  _14:
 37403  	_sqlite3BtreeEnter(tls, (*XBtree)(_pDb.XpBt))
 37404  	if _sqlite3BtreeIsInReadTrans(tls, (*XBtree)(_pDb.XpBt)) != 0 {
 37405  		goto _19
 37406  	}
 37407  	_rc = _sqlite3BtreeBeginTrans(tls, (*XBtree)(_pDb.XpBt), int32(0))
 37408  	if _rc != int32(0) {
 37409  		_sqlite3SetString(tls, _pzErrMsg, _db, _sqlite3ErrStr(tls, _rc))
 37410  		goto _initone_error_out
 37411  	}
 37412  	_openedTransaction = int32(1)
 37413  _19:
 37414  	_i = int32(0)
 37415  _21:
 37416  	if _i >= int32(5) {
 37417  		goto _24
 37418  	}
 37419  	_sqlite3BtreeGetMeta(tls, (*XBtree)(_pDb.XpBt), _i+int32(1), (*uint32)(unsafe.Pointer(elem8((*int32)(unsafe.Pointer(&_meta)), uintptr(_i)))))
 37420  	_i += 1
 37421  	goto _21
 37422  _24:
 37423  	(*XSchema)(_pDb.XpSchema).Xschema_cookie = *elem8((*int32)(unsafe.Pointer(&_meta)), 0)
 37424  	if (*elem8((*int32)(unsafe.Pointer(&_meta)), uintptr(4))) == 0 {
 37425  		goto _25
 37426  	}
 37427  	if _iDb != int32(0) {
 37428  		goto _26
 37429  	}
 37430  	_8_encoding = uint8(int32(uint8(*elem8((*int32)(unsafe.Pointer(&_meta)), uintptr(4)))) & int32(3))
 37431  	if int32(_8_encoding) == int32(0) {
 37432  		_8_encoding = uint8(1)
 37433  	}
 37434  	_db.Xenc = _8_encoding
 37435  	goto _28
 37436  _26:
 37437  	if (*elem8((*int32)(unsafe.Pointer(&_meta)), uintptr(4))) != int32(_db.Xenc) {
 37438  		_sqlite3SetString(tls, _pzErrMsg, _db, str(50073))
 37439  		_rc = int32(1)
 37440  		goto _initone_error_out
 37441  	}
 37442  _28:
 37443  	goto _30
 37444  _25:
 37445  	{
 37446  		p := &((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema).XschemaFlags)
 37447  		*p = uint16(int32(*p) | int32(4))
 37448  	}
 37449  _30:
 37450  	(*XSchema)(_pDb.XpSchema).Xenc = _db.Xenc
 37451  	if ((*XSchema)(_pDb.XpSchema).Xcache_size) != int32(0) {
 37452  		goto _31
 37453  	}
 37454  	_size = _sqlite3AbsInt32(tls, *elem8((*int32)(unsafe.Pointer(&_meta)), uintptr(2)))
 37455  	if _size == int32(0) {
 37456  		_size = int32(-2000)
 37457  	}
 37458  	(*XSchema)(_pDb.XpSchema).Xcache_size = _size
 37459  	_sqlite3BtreeSetCacheSize(tls, (*XBtree)(_pDb.XpBt), (*XSchema)(_pDb.XpSchema).Xcache_size)
 37460  _31:
 37461  	(*XSchema)(_pDb.XpSchema).Xfile_format = uint8(*elem8((*int32)(unsafe.Pointer(&_meta)), uintptr(1)))
 37462  	if int32((*XSchema)(_pDb.XpSchema).Xfile_format) == int32(0) {
 37463  		(*XSchema)(_pDb.XpSchema).Xfile_format = uint8(1)
 37464  	}
 37465  	if int32((*XSchema)(_pDb.XpSchema).Xfile_format) > int32(4) {
 37466  		_sqlite3SetString(tls, _pzErrMsg, _db, str(50141))
 37467  		_rc = int32(1)
 37468  		goto _initone_error_out
 37469  	}
 37470  	if (_iDb == int32(0)) && ((*elem8((*int32)(unsafe.Pointer(&_meta)), uintptr(1))) >= int32(4)) {
 37471  		_db.Xflags &= int32(-32769)
 37472  	}
 37473  	func() {
 37474  		if (_db.Xinit.Xbusy) == 0 {
 37475  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115952), unsafe.Pointer(&_sqlite3InitOneØ00__func__Ø000), unsafe.Pointer(str(50165)))
 37476  			crt.X__builtin_abort(tls)
 37477  		}
 37478  	}()
 37479  	_17_zSql = _sqlite3MPrintf(tls, _db, str(50179), unsafe.Pointer(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName), unsafe.Pointer(_zMasterName))
 37480  	_18_xAuth = _db.XxAuth
 37481  	_db.XxAuth = nil
 37482  	_rc = Xsqlite3_exec(tls, _db, _17_zSql, _sqlite3InitCallback, unsafe.Pointer(&_initData), nil)
 37483  	_db.XxAuth = _18_xAuth
 37484  	if _rc == int32(0) {
 37485  		_rc = _initData.Xrc
 37486  	}
 37487  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_17_zSql))
 37488  	if _rc == int32(0) {
 37489  		_sqlite3AnalysisLoad(tls, _db, _iDb)
 37490  	}
 37491  	if _db.XmallocFailed != 0 {
 37492  		_rc = _sqlite3NomemError(tls, int32(115978))
 37493  		_sqlite3ResetAllSchemasOfConnection(tls, _db)
 37494  	}
 37495  	if (_rc == int32(0)) || (_db.Xflags&int32(65536)) != 0 {
 37496  		{
 37497  			p := &((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema).XschemaFlags)
 37498  			*p = uint16(int32(*p) | int32(1))
 37499  		}
 37500  		_rc = int32(0)
 37501  	}
 37502  _initone_error_out:
 37503  	if _openedTransaction != 0 {
 37504  		_sqlite3BtreeCommit(tls, (*XBtree)(_pDb.XpBt))
 37505  	}
 37506  	_sqlite3BtreeLeave(tls, (*XBtree)(_pDb.XpBt))
 37507  _error_out:
 37508  	if (_rc == int32(7)) || (_rc == int32(3082)) {
 37509  		_sqlite3OomFault(tls, _db)
 37510  	}
 37511  	return _rc
 37512  
 37513  	_ = _azArg
 37514  	_ = _meta
 37515  	panic(0)
 37516  }
 37517  
 37518  var _sqlite3InitOneØ00__func__Ø000 [15]int8
 37519  
 37520  func init() {
 37521  	crt.Xstrncpy(nil, &_sqlite3InitOneØ00__func__Ø000[0], str(50234), 15)
 37522  }
 37523  
 37524  // C comment
 37525  //  /*
 37526  //  ** This is the callback routine for the code that initializes the
 37527  //  ** database.  See sqlite3Init() below for additional information.
 37528  //  ** This routine is also called from the OP_ParseSchema opcode of the VDBE.
 37529  //  **
 37530  //  ** Each callback contains the following information:
 37531  //  **
 37532  //  **     argv[0] = name of thing being created
 37533  //  **     argv[1] = root page number for table or index. 0 for trigger or view.
 37534  //  **     argv[2] = SQL text for the CREATE statement.
 37535  //  **
 37536  //  */
 37537  func _sqlite3InitCallback(tls *crt.TLS, _pInit unsafe.Pointer, _argc int32, _argv **int8, _NotUsed **int8) (r0 int32) {
 37538  	var _iDb, _3_rc, _3_rcp int32
 37539  	var _3_pStmt unsafe.Pointer
 37540  	var _3_saved_iDb uint8
 37541  	var _db *Xsqlite3
 37542  	var _10_pIndex *XIndex
 37543  	var _pData *XInitData
 37544  	_pData = (*XInitData)(_pInit)
 37545  	_db = (*Xsqlite3)(_pData.Xdb)
 37546  	_iDb = _pData.XiDb
 37547  	func() {
 37548  		if _argc != int32(3) {
 37549  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115722), unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000), unsafe.Pointer(str(50249)))
 37550  			crt.X__builtin_abort(tls)
 37551  		}
 37552  	}()
 37553  	_ = _argc
 37554  
 37555  	func() {
 37556  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 37557  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115724), unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000), unsafe.Pointer(str(881)))
 37558  			crt.X__builtin_abort(tls)
 37559  		}
 37560  	}()
 37561  	{
 37562  		p := &((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema).XschemaFlags)
 37563  		*p = uint16(int32(*p) & int32(-5))
 37564  	}
 37565  	if _db.XmallocFailed != 0 {
 37566  		_corruptSchema(tls, _pData, *elem0(_argv, 0), nil)
 37567  		return int32(1)
 37568  	}
 37569  	func() {
 37570  		if _iDb < int32(0) || _iDb >= _db.XnDb {
 37571  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115731), unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000), unsafe.Pointer(str(21693)))
 37572  			crt.X__builtin_abort(tls)
 37573  		}
 37574  	}()
 37575  	if _argv == nil {
 37576  		return int32(0)
 37577  	}
 37578  	if (*elem0(_argv, uintptr(1))) == nil {
 37579  		_corruptSchema(tls, _pData, *elem0(_argv, 0), nil)
 37580  		goto _32
 37581  	}
 37582  	if Xsqlite3_strnicmp(tls, *elem0(_argv, uintptr(2)), str(50257), int32(7)) != int32(0) {
 37583  		goto _11
 37584  	}
 37585  	_3_saved_iDb = _db.Xinit.XiDb
 37586  	func() {
 37587  		if (_db.Xinit.Xbusy) == 0 {
 37588  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115746), unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000), unsafe.Pointer(str(50165)))
 37589  			crt.X__builtin_abort(tls)
 37590  		}
 37591  	}()
 37592  	_db.Xinit.XiDb = uint8(_iDb)
 37593  	_db.Xinit.XnewTnum = _sqlite3Atoi(tls, *elem0(_argv, uintptr(1)))
 37594  	_db.Xinit.XorphanTrigger = 0
 37595  	_3_rcp = Xsqlite3_prepare(tls, _db, *elem0(_argv, uintptr(2)), int32(-1), &_3_pStmt, nil)
 37596  	_3_rc = _db.XerrCode
 37597  	func() {
 37598  		if (_3_rc & int32(255)) != (_3_rcp & int32(255)) {
 37599  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115752), unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000), unsafe.Pointer(str(50265)))
 37600  			crt.X__builtin_abort(tls)
 37601  		}
 37602  	}()
 37603  	_db.Xinit.XiDb = _3_saved_iDb
 37604  	func() {
 37605  		if int32(_3_saved_iDb) != int32(0) && (_db.Xflags&int32(268435456)) == int32(0) {
 37606  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115754), unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000), unsafe.Pointer(str(50287)))
 37607  			crt.X__builtin_abort(tls)
 37608  		}
 37609  	}()
 37610  	if int32(0) == _3_rc {
 37611  		goto _19
 37612  	}
 37613  	if (_db.Xinit.XorphanTrigger) != 0 {
 37614  		func() {
 37615  			if _iDb != int32(1) {
 37616  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115757), unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000), unsafe.Pointer(str(50334)))
 37617  				crt.X__builtin_abort(tls)
 37618  			}
 37619  		}()
 37620  		goto _23
 37621  	}
 37622  	_pData.Xrc = _3_rc
 37623  	if _3_rc == int32(7) {
 37624  		_sqlite3OomFault(tls, _db)
 37625  		goto _27
 37626  	}
 37627  	if (_3_rc != int32(9)) && ((_3_rc & int32(255)) != int32(6)) {
 37628  		_corruptSchema(tls, _pData, *elem0(_argv, 0), Xsqlite3_errmsg(tls, _db))
 37629  	}
 37630  _27:
 37631  _23:
 37632  _19:
 37633  	Xsqlite3_finalize(tls, _3_pStmt)
 37634  	goto _32
 37635  _11:
 37636  	if ((*elem0(_argv, 0)) == nil) || (((*elem0(_argv, uintptr(2))) != nil) && (int32(*elem1(*elem0(_argv, uintptr(2)), 0)) != int32(0))) {
 37637  		_corruptSchema(tls, _pData, *elem0(_argv, 0), nil)
 37638  		goto _32
 37639  	}
 37640  	_10_pIndex = _sqlite3FindIndex(tls, _db, *elem0(_argv, 0), elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName)
 37641  	if _10_pIndex == nil {
 37642  		goto _35
 37643  	}
 37644  	if _sqlite3GetInt32(tls, *elem0(_argv, uintptr(1)), &_10_pIndex.Xtnum) == int32(0) {
 37645  		_corruptSchema(tls, _pData, *elem0(_argv, 0), str(50341))
 37646  	}
 37647  _35:
 37648  _32:
 37649  	return int32(0)
 37650  }
 37651  
 37652  var _sqlite3InitCallbackØ00__func__Ø000 [20]int8
 37653  
 37654  func init() {
 37655  	crt.Xstrncpy(nil, &_sqlite3InitCallbackØ00__func__Ø000[0], str(50358), 20)
 37656  }
 37657  
 37658  // C comment
 37659  //  /*
 37660  //  ** Fill the InitData structure with an error message that indicates
 37661  //  ** that the database is corrupt.
 37662  //  */
 37663  func _corruptSchema(tls *crt.TLS, _pData *XInitData, _zObj *int8, _zExtra *int8) {
 37664  	var _1_z *int8
 37665  	var _db *Xsqlite3
 37666  	_db = (*Xsqlite3)(_pData.Xdb)
 37667  	if _db.XmallocFailed != 0 || (_db.Xflags&int32(65536)) != int32(0) {
 37668  		goto _1
 37669  	}
 37670  	if _zObj == nil {
 37671  		_zObj = str(50378)
 37672  	}
 37673  	_1_z = _sqlite3MPrintf(tls, _db, str(50380), unsafe.Pointer(_zObj))
 37674  	if _zExtra != nil {
 37675  		_1_z = _sqlite3MPrintf(tls, _db, str(50411), unsafe.Pointer(_1_z), unsafe.Pointer(_zExtra))
 37676  	}
 37677  	_sqlite3DbFree(tls, _db, unsafe.Pointer(*_pData.XpzErrMsg))
 37678  	*_pData.XpzErrMsg = _1_z
 37679  _1:
 37680  	_pData.Xrc = func() int32 {
 37681  		if _db.XmallocFailed != 0 {
 37682  			return _sqlite3NomemError(tls, int32(115702))
 37683  		}
 37684  		return _sqlite3CorruptError(tls, int32(115702))
 37685  	}()
 37686  }
 37687  
 37688  // C comment
 37689  //  /*
 37690  //  ** Return a 32-bit integer value extracted from a string.  If the
 37691  //  ** string is not an integer, just return 0.
 37692  //  */
 37693  func _sqlite3Atoi(tls *crt.TLS, _z *int8) (r0 int32) {
 37694  	var _x int32
 37695  	_x = int32(0)
 37696  	if _z != nil {
 37697  		_sqlite3GetInt32(tls, _z, &_x)
 37698  	}
 37699  	return _x
 37700  }
 37701  
 37702  // C comment
 37703  //  /*
 37704  //  ** Two versions of the official API.  Legacy and new use.  In the legacy
 37705  //  ** version, the original SQL text is not saved in the prepared statement
 37706  //  ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
 37707  //  ** sqlite3_step().  In the new version, the original SQL text is retained
 37708  //  ** and the statement is automatically recompiled if an schema change
 37709  //  ** occurs.
 37710  //  */
 37711  func Xsqlite3_prepare(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _nBytes int32, _ppStmt *unsafe.Pointer, _pzTail **int8) (r0 int32) {
 37712  	var _rc int32
 37713  	_rc = _sqlite3LockAndPrepare(tls, _db, _zSql, _nBytes, int32(0), nil, _ppStmt, _pzTail)
 37714  	func() {
 37715  		if _rc != int32(0) && _ppStmt != nil && (*_ppStmt) != nil {
 37716  			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)))
 37717  			crt.X__builtin_abort(tls)
 37718  		}
 37719  	}()
 37720  	return _rc
 37721  }
 37722  
 37723  func _sqlite3LockAndPrepare(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _nBytes int32, _saveSqlFlag int32, _pOld *TVdbe, _ppStmt *unsafe.Pointer, _pzTail **int8) (r0 int32) {
 37724  	var _rc int32
 37725  	if _ppStmt == nil {
 37726  		return _sqlite3MisuseError(tls, int32(116341))
 37727  	}
 37728  	*_ppStmt = nil
 37729  	if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zSql == nil) {
 37730  		return _sqlite3MisuseError(tls, int32(116345))
 37731  	}
 37732  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 37733  	_sqlite3BtreeEnterAll(tls, _db)
 37734  	_rc = _sqlite3Prepare(tls, _db, _zSql, _nBytes, _saveSqlFlag, _pOld, _ppStmt, _pzTail)
 37735  	if _rc == int32(17) {
 37736  		Xsqlite3_finalize(tls, *_ppStmt)
 37737  		_rc = _sqlite3Prepare(tls, _db, _zSql, _nBytes, _saveSqlFlag, _pOld, _ppStmt, _pzTail)
 37738  	}
 37739  	_sqlite3BtreeLeaveAll(tls, _db)
 37740  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 37741  	func() {
 37742  		if _rc != int32(0) && (*_ppStmt) != nil {
 37743  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116356), unsafe.Pointer(&_sqlite3LockAndPrepareØ00__func__Ø000), unsafe.Pointer(str(50460)))
 37744  			crt.X__builtin_abort(tls)
 37745  		}
 37746  	}()
 37747  	return _rc
 37748  }
 37749  
 37750  // C comment
 37751  //  /*
 37752  //  ** Compile the UTF-8 encoded SQL statement zSql into a statement handle.
 37753  //  */
 37754  func _sqlite3Prepare(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _nBytes int32, _saveSqlFlag int32, _pReprepare *TVdbe, _ppStmt *unsafe.Pointer, _pzTail **int8) (r0 int32) {
 37755  	var _rc, _i, _4_mxLen, _12_iFirst, _12_mx int32
 37756  	var _zErrMsg, _3_zDb, _4_zSqlCopy *int8
 37757  	var _1_pBt *XBtree
 37758  	var _16_pVdbe *TVdbe
 37759  	var _sParse XParse
 37760  	var _21_pT *XTriggerPrg
 37761  	_zErrMsg = nil
 37762  	_rc = int32(0)
 37763  	crt.Xmemset(tls, unsafe.Pointer(&_sParse), int32(0), uint32(160))
 37764  	crt.Xmemset(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sParse))+uintptr(uint32(400))))), int32(0), uint32(84))
 37765  	*(**TVdbe)(unsafe.Pointer(&_sParse.XpReprepare)) = _pReprepare
 37766  	func() {
 37767  		if _ppStmt == nil || (*_ppStmt) != nil {
 37768  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116195), unsafe.Pointer(&_sqlite3PrepareØ00__func__Ø000), unsafe.Pointer(str(50488)))
 37769  			crt.X__builtin_abort(tls)
 37770  		}
 37771  	}()
 37772  	func() {
 37773  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 37774  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116197), unsafe.Pointer(&_sqlite3PrepareØ00__func__Ø000), unsafe.Pointer(str(881)))
 37775  			crt.X__builtin_abort(tls)
 37776  		}
 37777  	}()
 37778  	_i = int32(0)
 37779  _5:
 37780  	if _i >= _db.XnDb {
 37781  		goto _8
 37782  	}
 37783  	_1_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 37784  	if _1_pBt == nil {
 37785  		goto _9
 37786  	}
 37787  	func() {
 37788  		if _sqlite3BtreeHoldsMutex(tls, _1_pBt) == 0 {
 37789  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116225), unsafe.Pointer(&_sqlite3PrepareØ00__func__Ø000), unsafe.Pointer(str(50509)))
 37790  			crt.X__builtin_abort(tls)
 37791  		}
 37792  	}()
 37793  	_rc = _sqlite3BtreeSchemaLocked(tls, _1_pBt)
 37794  	if _rc != 0 {
 37795  		_3_zDb = elem27((*XDb)(_db.XaDb), uintptr(_i)).XzDbSName
 37796  		_sqlite3ErrorWithMsg(tls, _db, _rc, str(50537), unsafe.Pointer(_3_zDb))
 37797  		goto _end_prepare
 37798  	}
 37799  _9:
 37800  	_i += 1
 37801  	goto _5
 37802  _8:
 37803  	_sqlite3VtabUnlockList(tls, _db)
 37804  	*(**Xsqlite3)(unsafe.Pointer(&_sParse.Xdb)) = _db
 37805  	if _nBytes < int32(0) || _nBytes != int32(0) && int32(*elem1(_zSql, uintptr(_nBytes-int32(1)))) == int32(0) {
 37806  		goto _15
 37807  	}
 37808  	_4_mxLen = *elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(1))
 37809  	if _nBytes > _4_mxLen {
 37810  		_sqlite3ErrorWithMsg(tls, _db, int32(18), str(50567))
 37811  		_rc = _sqlite3ApiExit(tls, _db, int32(18))
 37812  		goto _end_prepare
 37813  	}
 37814  	_4_zSqlCopy = _sqlite3DbStrNDup(tls, _db, _zSql, uint64(_nBytes))
 37815  	if _4_zSqlCopy != nil {
 37816  		_sqlite3RunParser(tls, &_sParse, _4_zSqlCopy, &_zErrMsg)
 37817  		_sParse.XzTail = elem1(_zSql, uintptr(int32(uintptr(unsafe.Pointer(_sParse.XzTail))-uintptr(unsafe.Pointer(_4_zSqlCopy)))))
 37818  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_4_zSqlCopy))
 37819  		goto _18
 37820  	}
 37821  	_sParse.XzTail = elem1(_zSql, uintptr(_nBytes))
 37822  _18:
 37823  	goto _19
 37824  _15:
 37825  	_sqlite3RunParser(tls, &_sParse, _zSql, &_zErrMsg)
 37826  _19:
 37827  	func() {
 37828  		if (0) != _sParse.XnQueryLoop {
 37829  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116260), unsafe.Pointer(&_sqlite3PrepareØ00__func__Ø000), unsafe.Pointer(str(50586)))
 37830  			crt.X__builtin_abort(tls)
 37831  		}
 37832  	}()
 37833  	if _sParse.Xrc == int32(101) {
 37834  		_sParse.Xrc = int32(0)
 37835  	}
 37836  	if _sParse.XcheckSchema != 0 {
 37837  		_schemaIsValid(tls, &_sParse)
 37838  	}
 37839  	if _db.XmallocFailed != 0 {
 37840  		_sParse.Xrc = _sqlite3NomemError(tls, int32(116267))
 37841  	}
 37842  	if _pzTail != nil {
 37843  		*_pzTail = _sParse.XzTail
 37844  	}
 37845  	_rc = _sParse.Xrc
 37846  	if _rc != int32(0) || _sParse.XpVdbe == nil || _sParse.Xexplain == 0 {
 37847  		goto _28
 37848  	}
 37849  	if int32(_sParse.Xexplain) == int32(2) {
 37850  		_sqlite3VdbeSetNumCols(tls, (*TVdbe)(_sParse.XpVdbe), int32(4))
 37851  		_12_iFirst = int32(8)
 37852  		_12_mx = int32(12)
 37853  		goto _30
 37854  	}
 37855  	_sqlite3VdbeSetNumCols(tls, (*TVdbe)(_sParse.XpVdbe), int32(8))
 37856  	_12_iFirst = int32(0)
 37857  	_12_mx = int32(8)
 37858  _30:
 37859  	_i = _12_iFirst
 37860  _31:
 37861  	if _i >= _12_mx {
 37862  		goto _34
 37863  	}
 37864  	_sqlite3VdbeSetColName(tls, (*TVdbe)(_sParse.XpVdbe), _i-_12_iFirst, int32(0), *elem0((**int8)(unsafe.Pointer(&_sqlite3PrepareØ00azColNameØ001)), uintptr(_i)), nil)
 37865  	_i += 1
 37866  	goto _31
 37867  _34:
 37868  _28:
 37869  	if int32(_db.Xinit.Xbusy) == int32(0) {
 37870  		_16_pVdbe = (*TVdbe)(_sParse.XpVdbe)
 37871  		_sqlite3VdbeSetSql(tls, _16_pVdbe, _zSql, int32(uintptr(unsafe.Pointer(_sParse.XzTail))-uintptr(unsafe.Pointer(_zSql))), _saveSqlFlag)
 37872  	}
 37873  	if (_sParse.XpVdbe != nil) && ((_rc != int32(0)) || (_db.XmallocFailed != 0)) {
 37874  		_sqlite3VdbeFinalize(tls, (*TVdbe)(_sParse.XpVdbe))
 37875  		func() {
 37876  			if (*_ppStmt) != nil {
 37877  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116303), unsafe.Pointer(&_sqlite3PrepareØ00__func__Ø000), unsafe.Pointer(str(50607)))
 37878  				crt.X__builtin_abort(tls)
 37879  			}
 37880  		}()
 37881  		goto _41
 37882  	}
 37883  	*_ppStmt = _sParse.XpVdbe
 37884  _41:
 37885  	if _zErrMsg != nil {
 37886  		_sqlite3ErrorWithMsg(tls, _db, _rc, str(24531), unsafe.Pointer(_zErrMsg))
 37887  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErrMsg))
 37888  		goto _43
 37889  	}
 37890  	_sqlite3Error(tls, _db, _rc)
 37891  _43:
 37892  	if _sParse.XpTriggerPrg != nil {
 37893  		_21_pT = (*XTriggerPrg)(_sParse.XpTriggerPrg)
 37894  		*(**XTriggerPrg)(unsafe.Pointer(&_sParse.XpTriggerPrg)) = (*XTriggerPrg)(_21_pT.XpNext)
 37895  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_21_pT))
 37896  		goto _43
 37897  	}
 37898  _end_prepare:
 37899  	_sqlite3ParserReset(tls, &_sParse)
 37900  	_rc = _sqlite3ApiExit(tls, _db, _rc)
 37901  	func() {
 37902  		if (_rc & _db.XerrMask) != _rc {
 37903  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116326), unsafe.Pointer(&_sqlite3PrepareØ00__func__Ø000), unsafe.Pointer(str(50618)))
 37904  			crt.X__builtin_abort(tls)
 37905  		}
 37906  	}()
 37907  	return _rc
 37908  }
 37909  
 37910  var _sqlite3PrepareØ00__func__Ø000 [15]int8
 37911  
 37912  func init() {
 37913  	crt.Xstrncpy(nil, &_sqlite3PrepareØ00__func__Ø000[0], str(50639), 15)
 37914  }
 37915  
 37916  // C comment
 37917  //  /*
 37918  //  ** Return SQLITE_LOCKED_SHAREDCACHE if another user of the same shared
 37919  //  ** btree as the argument handle holds an exclusive lock on the
 37920  //  ** sqlite_master table. Otherwise SQLITE_OK.
 37921  //  */
 37922  func _sqlite3BtreeSchemaLocked(tls *crt.TLS, _p *XBtree) (r0 int32) {
 37923  	var _rc int32
 37924  	func() {
 37925  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 37926  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68723), unsafe.Pointer(&_sqlite3BtreeSchemaLockedØ00__func__Ø000), unsafe.Pointer(str(8939)))
 37927  			crt.X__builtin_abort(tls)
 37928  		}
 37929  	}()
 37930  	_sqlite3BtreeEnter(tls, _p)
 37931  	_rc = _querySharedCacheTableLock(tls, _p, uint32(1), uint8(1))
 37932  	func() {
 37933  		if _rc != int32(0) && _rc != int32(262) {
 37934  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68726), unsafe.Pointer(&_sqlite3BtreeSchemaLockedØ00__func__Ø000), unsafe.Pointer(str(50654)))
 37935  			crt.X__builtin_abort(tls)
 37936  		}
 37937  	}()
 37938  	_sqlite3BtreeLeave(tls, _p)
 37939  	return _rc
 37940  }
 37941  
 37942  var _sqlite3BtreeSchemaLockedØ00__func__Ø000 [25]int8
 37943  
 37944  func init() {
 37945  	crt.Xstrncpy(nil, &_sqlite3BtreeSchemaLockedØ00__func__Ø000[0], str(50701), 25)
 37946  }
 37947  
 37948  // C comment
 37949  //  /*
 37950  //  ** Query to see if Btree handle p may obtain a lock of type eLock
 37951  //  ** (READ_LOCK or WRITE_LOCK) on the table with root-page iTab. Return
 37952  //  ** SQLITE_OK if the lock may be obtained (by calling
 37953  //  ** setSharedCacheTableLock()), or SQLITE_LOCKED if not.
 37954  //  */
 37955  func _querySharedCacheTableLock(tls *crt.TLS, _p *XBtree, _iTab uint32, _eLock uint8) (r0 int32) {
 37956  	var _pBt *XBtShared
 37957  	var _pIter *XBtLock
 37958  	_pBt = (*XBtShared)(_p.XpBt)
 37959  	func() {
 37960  		if _sqlite3BtreeHoldsMutex(tls, _p) == 0 {
 37961  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59285), unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(17442)))
 37962  			crt.X__builtin_abort(tls)
 37963  		}
 37964  	}()
 37965  	func() {
 37966  		if int32(_eLock) != int32(1) && int32(_eLock) != int32(2) {
 37967  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59286), unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(50726)))
 37968  			crt.X__builtin_abort(tls)
 37969  		}
 37970  	}()
 37971  	func() {
 37972  		if (*Xsqlite3)(_p.Xdb) == nil {
 37973  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59287), unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(23631)))
 37974  			crt.X__builtin_abort(tls)
 37975  		}
 37976  	}()
 37977  	func() {
 37978  		if (((*Xsqlite3)(_p.Xdb).Xflags)&int32(16384)) != 0 && int32(_eLock) != int32(2) && _iTab != uint32(1) {
 37979  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59288), unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(50764)))
 37980  			crt.X__builtin_abort(tls)
 37981  		}
 37982  	}()
 37983  	func() {
 37984  		if int32(_eLock) != int32(1) && (_p != (*XBtree)(_pBt.XpWriter) || int32(_p.XinTrans) != int32(2)) {
 37985  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59294), unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(50831)))
 37986  			crt.X__builtin_abort(tls)
 37987  		}
 37988  	}()
 37989  	func() {
 37990  		if int32(_eLock) != int32(1) && int32(_pBt.XinTransaction) != int32(2) {
 37991  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59295), unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(50896)))
 37992  			crt.X__builtin_abort(tls)
 37993  		}
 37994  	}()
 37995  	if _p.Xsharable == 0 {
 37996  		return int32(0)
 37997  	}
 37998  	if ((*XBtree)(_pBt.XpWriter) != _p) && ((int32(_pBt.XbtsFlags) & int32(32)) != int32(0)) {
 37999  		return int32(262)
 38000  	}
 38001  	_pIter = (*XBtLock)(_pBt.XpLock)
 38002  _21:
 38003  	if _pIter == nil {
 38004  		goto _24
 38005  	}
 38006  	func() {
 38007  		if int32(_pIter.XeLock) != int32(1) && int32(_pIter.XeLock) != int32(2) {
 38008  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59320), unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(50948)))
 38009  			crt.X__builtin_abort(tls)
 38010  		}
 38011  	}()
 38012  	func() {
 38013  		if int32(_eLock) != int32(1) && (*XBtree)(_pIter.XpBtree) != _p && int32(_pIter.XeLock) != int32(1) {
 38014  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59321), unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(51000)))
 38015  			crt.X__builtin_abort(tls)
 38016  		}
 38017  	}()
 38018  	if (*XBtree)(_pIter.XpBtree) == _p || _pIter.XiTable != _iTab || int32(_pIter.XeLock) == int32(_eLock) {
 38019  		goto _34
 38020  	}
 38021  	if int32(_eLock) == int32(2) {
 38022  		func() {
 38023  			if _p != (*XBtree)(_pBt.XpWriter) {
 38024  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59325), unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(51064)))
 38025  				crt.X__builtin_abort(tls)
 38026  			}
 38027  		}()
 38028  		{
 38029  			p := &_pBt.XbtsFlags
 38030  			*p = uint16(int32(*p) | int32(64))
 38031  		}
 38032  	}
 38033  	return int32(262)
 38034  
 38035  _34:
 38036  	_pIter = (*XBtLock)(_pIter.XpNext)
 38037  	goto _21
 38038  _24:
 38039  	return int32(0)
 38040  }
 38041  
 38042  var _querySharedCacheTableLockØ00__func__Ø000 [26]int8
 38043  
 38044  func init() {
 38045  	crt.Xstrncpy(nil, &_querySharedCacheTableLockØ00__func__Ø000[0], str(51080), 26)
 38046  }
 38047  
 38048  // C comment
 38049  //  /*
 38050  //  ** Check schema cookies in all databases.  If any cookie is out
 38051  //  ** of date set pParse->rc to SQLITE_SCHEMA.  If all schema cookies
 38052  //  ** make no changes to pParse->rc.
 38053  //  */
 38054  func _schemaIsValid(tls *crt.TLS, _pParse *XParse) {
 38055  	var _iDb, _rc, _cookie, _1_openedTransaction int32
 38056  	var _db *Xsqlite3
 38057  	var _1_pBt *XBtree
 38058  	_db = (*Xsqlite3)(_pParse.Xdb)
 38059  	func() {
 38060  		if _pParse.XcheckSchema == 0 {
 38061  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116091), unsafe.Pointer(&_schemaIsValidØ00__func__Ø000), unsafe.Pointer(str(51106)))
 38062  			crt.X__builtin_abort(tls)
 38063  		}
 38064  	}()
 38065  	func() {
 38066  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 38067  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116092), unsafe.Pointer(&_schemaIsValidØ00__func__Ø000), unsafe.Pointer(str(881)))
 38068  			crt.X__builtin_abort(tls)
 38069  		}
 38070  	}()
 38071  	_iDb = int32(0)
 38072  _4:
 38073  	if _iDb >= _db.XnDb {
 38074  		goto _7
 38075  	}
 38076  	_1_openedTransaction = int32(0)
 38077  	_1_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpBt)
 38078  	if _1_pBt == nil {
 38079  		goto _5
 38080  	}
 38081  	if _sqlite3BtreeIsInReadTrans(tls, _1_pBt) != 0 {
 38082  		goto _9
 38083  	}
 38084  	_rc = _sqlite3BtreeBeginTrans(tls, _1_pBt, int32(0))
 38085  	if (_rc == int32(7)) || (_rc == int32(3082)) {
 38086  		_sqlite3OomFault(tls, _db)
 38087  	}
 38088  	if _rc != int32(0) {
 38089  		return
 38090  	}
 38091  	_1_openedTransaction = int32(1)
 38092  _9:
 38093  	_sqlite3BtreeGetMeta(tls, _1_pBt, int32(1), (*uint32)(unsafe.Pointer(&_cookie)))
 38094  	func() {
 38095  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 38096  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116114), unsafe.Pointer(&_schemaIsValidØ00__func__Ø000), unsafe.Pointer(str(51126)))
 38097  			crt.X__builtin_abort(tls)
 38098  		}
 38099  	}()
 38100  	if _cookie != ((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema).Xschema_cookie) {
 38101  		_sqlite3ResetOneSchema(tls, _db, _iDb)
 38102  		_pParse.Xrc = int32(17)
 38103  	}
 38104  	if _1_openedTransaction != 0 {
 38105  		_sqlite3BtreeCommit(tls, _1_pBt)
 38106  	}
 38107  _5:
 38108  	_iDb += 1
 38109  	goto _4
 38110  _7:
 38111  }
 38112  
 38113  var _schemaIsValidØ00__func__Ø000 [14]int8
 38114  
 38115  func init() {
 38116  	crt.Xstrncpy(nil, &_schemaIsValidØ00__func__Ø000[0], str(51161), 14)
 38117  }
 38118  
 38119  // C comment
 38120  //  /*
 38121  //  ** Return non-zero if a read (or write) transaction is active.
 38122  //  */
 38123  func _sqlite3BtreeIsInReadTrans(tls *crt.TLS, _p *XBtree) (r0 int32) {
 38124  	func() {
 38125  		if _p == nil {
 38126  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68674), unsafe.Pointer(&_sqlite3BtreeIsInReadTransØ00__func__Ø000), unsafe.Pointer(str(9615)))
 38127  			crt.X__builtin_abort(tls)
 38128  		}
 38129  	}()
 38130  	func() {
 38131  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 38132  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68675), unsafe.Pointer(&_sqlite3BtreeIsInReadTransØ00__func__Ø000), unsafe.Pointer(str(8939)))
 38133  			crt.X__builtin_abort(tls)
 38134  		}
 38135  	}()
 38136  	return bool2int(int32(_p.XinTrans) != int32(0))
 38137  }
 38138  
 38139  var _sqlite3BtreeIsInReadTransØ00__func__Ø000 [26]int8
 38140  
 38141  func init() {
 38142  	crt.Xstrncpy(nil, &_sqlite3BtreeIsInReadTransØ00__func__Ø000[0], str(51175), 26)
 38143  }
 38144  
 38145  // C comment
 38146  //  /*
 38147  //  ** Attempt to start a new transaction. A write-transaction
 38148  //  ** is started if the second argument is nonzero, otherwise a read-
 38149  //  ** transaction.  If the second argument is 2 or more and exclusive
 38150  //  ** transaction is started, meaning that no other process is allowed
 38151  //  ** to access the database.  A preexisting transaction may not be
 38152  //  ** upgraded to exclusive by calling this routine a second time - the
 38153  //  ** exclusivity flag only works for a new transaction.
 38154  //  **
 38155  //  ** A write-transaction must be started before attempting any
 38156  //  ** changes to the database.  None of the following routines
 38157  //  ** will work unless a transaction is started first:
 38158  //  **
 38159  //  **      sqlite3BtreeCreateTable()
 38160  //  **      sqlite3BtreeCreateIndex()
 38161  //  **      sqlite3BtreeClearTable()
 38162  //  **      sqlite3BtreeDropTable()
 38163  //  **      sqlite3BtreeInsert()
 38164  //  **      sqlite3BtreeDelete()
 38165  //  **      sqlite3BtreeUpdateMeta()
 38166  //  **
 38167  //  ** If an initial attempt to acquire the lock fails because of lock contention
 38168  //  ** and the database was previously unlocked, then invoke the busy handler
 38169  //  ** if there is one.  But if there was previously a read-lock, do not
 38170  //  ** invoke the busy handler - just return SQLITE_BUSY.  SQLITE_BUSY is
 38171  //  ** returned when there is already a read-lock in order to avoid a deadlock.
 38172  //  **
 38173  //  ** Suppose there are two processes A and B.  A has a read lock and B has
 38174  //  ** a reserved lock.  B tries to promote to exclusive but is blocked because
 38175  //  ** of A's read lock.  A tries to promote to reserved but is blocked by B.
 38176  //  ** One or the other of the two processes must give way or there can be
 38177  //  ** no progress.  By returning SQLITE_BUSY and not invoking the busy callback
 38178  //  ** when A already has a read lock, we encourage A to give up and let B
 38179  //  ** proceed.
 38180  //  */
 38181  func _sqlite3BtreeBeginTrans(tls *crt.TLS, _p *XBtree, _wrflag int32) (r0 int32) {
 38182  	var _rc int32
 38183  	var _3_pBlock *Xsqlite3
 38184  	var _pBt *XBtShared
 38185  	var _5_pIter *XBtLock
 38186  	var _19_pPage1 *XMemPage
 38187  	_pBt = (*XBtShared)(_p.XpBt)
 38188  	_rc = int32(0)
 38189  	_sqlite3BtreeEnter(tls, _p)
 38190  	func() {
 38191  		if int32((*XBtShared)(_p.XpBt).XinTransaction) == int32(0) && ((*XBtShared)(_p.XpBt).XnTransaction) != int32(0) {
 38192  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62247), unsafe.Pointer(&_sqlite3BtreeBeginTransØ00__func__Ø000), unsafe.Pointer(str(9932)))
 38193  			crt.X__builtin_abort(tls)
 38194  		}
 38195  	}()
 38196  	func() {
 38197  		if int32((*XBtShared)(_p.XpBt).XinTransaction) < int32(_p.XinTrans) {
 38198  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62247), unsafe.Pointer(&_sqlite3BtreeBeginTransØ00__func__Ø000), unsafe.Pointer(str(9993)))
 38199  			crt.X__builtin_abort(tls)
 38200  		}
 38201  	}()
 38202  	if (int32(_p.XinTrans) == int32(2)) || ((int32(_p.XinTrans) == int32(1)) && (_wrflag == 0)) {
 38203  		goto _trans_begun
 38204  	}
 38205  	func() {
 38206  		if int32(_pBt.XinTransaction) != int32(2) && int32(_pBt.XbDoTruncate) != int32(0) {
 38207  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62256), unsafe.Pointer(&_sqlite3BtreeBeginTransØ00__func__Ø000), unsafe.Pointer(str(51201)))
 38208  			crt.X__builtin_abort(tls)
 38209  		}
 38210  	}()
 38211  	if ((int32(_pBt.XbtsFlags) & int32(1)) != int32(0)) && _wrflag != 0 {
 38212  		_rc = int32(8)
 38213  		goto _trans_begun
 38214  	}
 38215  	_3_pBlock = nil
 38216  	if (_wrflag != 0 && (int32(_pBt.XinTransaction) == int32(2))) || ((int32(_pBt.XbtsFlags) & int32(64)) != int32(0)) {
 38217  		_3_pBlock = (*Xsqlite3)((*XBtree)(_pBt.XpWriter).Xdb)
 38218  		goto _17
 38219  	}
 38220  	if _wrflag <= int32(1) {
 38221  		goto _17
 38222  	}
 38223  	_5_pIter = (*XBtLock)(_pBt.XpLock)
 38224  _18:
 38225  	if _5_pIter == nil {
 38226  		goto _21
 38227  	}
 38228  	if (*XBtree)(_5_pIter.XpBtree) != _p {
 38229  		_3_pBlock = (*Xsqlite3)((*XBtree)(_5_pIter.XpBtree).Xdb)
 38230  		goto _21
 38231  	}
 38232  	_5_pIter = (*XBtLock)(_5_pIter.XpNext)
 38233  	goto _18
 38234  _21:
 38235  _17:
 38236  	if _3_pBlock != nil {
 38237  		_rc = int32(262)
 38238  		goto _trans_begun
 38239  	}
 38240  	_rc = _querySharedCacheTableLock(tls, _p, uint32(1), uint8(1))
 38241  	if int32(0) != _rc {
 38242  		goto _trans_begun
 38243  	}
 38244  	{
 38245  		p := &_pBt.XbtsFlags
 38246  		*p = uint16(int32(*p) & int32(-9))
 38247  	}
 38248  	if _pBt.XnPage == (0) {
 38249  		{
 38250  			p := &_pBt.XbtsFlags
 38251  			*p = uint16(int32(*p) | int32(8))
 38252  		}
 38253  	}
 38254  _25:
 38255  _27:
 38256  	if ((*XMemPage)(_pBt.XpPage1) == nil) && (int32(0) == store2(&_rc, _lockBtree(tls, _pBt))) {
 38257  		goto _27
 38258  	}
 38259  	if _rc != int32(0) || _wrflag == 0 {
 38260  		goto _31
 38261  	}
 38262  	if (int32(_pBt.XbtsFlags) & int32(1)) != int32(0) {
 38263  		_rc = int32(8)
 38264  		goto _33
 38265  	}
 38266  	_rc = _sqlite3PagerBegin(tls, (*XPager)(_pBt.XpPager), bool2int(_wrflag > int32(1)), _sqlite3TempInMemory(tls, (*Xsqlite3)(_p.Xdb)))
 38267  	if _rc == int32(0) {
 38268  		_rc = _newDatabase(tls, _pBt)
 38269  	}
 38270  _33:
 38271  _31:
 38272  	if _rc != int32(0) {
 38273  		_unlockBtreeIfUnused(tls, _pBt)
 38274  	}
 38275  	if (((_rc & int32(255)) == int32(5)) && (int32(_pBt.XinTransaction) == int32(0))) && _btreeInvokeBusyHandler(tls, unsafe.Pointer(_pBt)) != 0 {
 38276  		goto _25
 38277  	}
 38278  	if _rc != int32(0) {
 38279  		goto _trans_begun
 38280  	}
 38281  	if int32(_p.XinTrans) != int32(0) {
 38282  		goto _39
 38283  	}
 38284  	_pBt.XnTransaction += 1
 38285  	if _p.Xsharable != 0 {
 38286  		func() {
 38287  			if (*XBtree)(_p.Xlock.XpBtree) != _p || (_p.Xlock.XiTable) != uint32(1) {
 38288  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62332), unsafe.Pointer(&_sqlite3BtreeBeginTransØ00__func__Ø000), unsafe.Pointer(str(51269)))
 38289  				crt.X__builtin_abort(tls)
 38290  			}
 38291  		}()
 38292  		_p.Xlock.XeLock = uint8(1)
 38293  		*(**XBtLock)(unsafe.Pointer(&(_p.Xlock.XpNext))) = (*XBtLock)(_pBt.XpLock)
 38294  		*(**XBtLock)(unsafe.Pointer(&_pBt.XpLock)) = &_p.Xlock
 38295  	}
 38296  _39:
 38297  	_p.XinTrans = uint8(func() int32 {
 38298  		if _wrflag != 0 {
 38299  			return int32(2)
 38300  		}
 38301  		return int32(1)
 38302  	}())
 38303  	if int32(_p.XinTrans) > int32(_pBt.XinTransaction) {
 38304  		_pBt.XinTransaction = _p.XinTrans
 38305  	}
 38306  	if _wrflag == 0 {
 38307  		goto _47
 38308  	}
 38309  	_19_pPage1 = (*XMemPage)(_pBt.XpPage1)
 38310  	func() {
 38311  		if _pBt.XpWriter != nil {
 38312  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62346), unsafe.Pointer(&_sqlite3BtreeBeginTransØ00__func__Ø000), unsafe.Pointer(str(51308)))
 38313  			crt.X__builtin_abort(tls)
 38314  		}
 38315  	}()
 38316  	*(**XBtree)(unsafe.Pointer(&_pBt.XpWriter)) = _p
 38317  	{
 38318  		p := &_pBt.XbtsFlags
 38319  		*p = uint16(int32(*p) & int32(-33))
 38320  	}
 38321  	if _wrflag > int32(1) {
 38322  		{
 38323  			p := &_pBt.XbtsFlags
 38324  			*p = uint16(int32(*p) | int32(32))
 38325  		}
 38326  	}
 38327  	if _pBt.XnPage == _sqlite3Get4byte(tls, elem15(_19_pPage1.XaData, uintptr(28))) {
 38328  		goto _51
 38329  	}
 38330  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_19_pPage1.XpDbPage))
 38331  	if _rc == int32(0) {
 38332  		_sqlite3Put4byte(tls, elem15(_19_pPage1.XaData, uintptr(28)), _pBt.XnPage)
 38333  	}
 38334  _51:
 38335  _47:
 38336  _trans_begun:
 38337  	if (_rc == int32(0)) && _wrflag != 0 {
 38338  		_rc = _sqlite3PagerOpenSavepoint(tls, (*XPager)(_pBt.XpPager), (*Xsqlite3)(_p.Xdb).XnSavepoint)
 38339  	}
 38340  	func() {
 38341  		if int32((*XBtShared)(_p.XpBt).XinTransaction) == int32(0) && ((*XBtShared)(_p.XpBt).XnTransaction) != int32(0) {
 38342  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62377), unsafe.Pointer(&_sqlite3BtreeBeginTransØ00__func__Ø000), unsafe.Pointer(str(9932)))
 38343  			crt.X__builtin_abort(tls)
 38344  		}
 38345  	}()
 38346  	func() {
 38347  		if int32((*XBtShared)(_p.XpBt).XinTransaction) < int32(_p.XinTrans) {
 38348  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62377), unsafe.Pointer(&_sqlite3BtreeBeginTransØ00__func__Ø000), unsafe.Pointer(str(9993)))
 38349  			crt.X__builtin_abort(tls)
 38350  		}
 38351  	}()
 38352  	_sqlite3BtreeLeave(tls, _p)
 38353  	return _rc
 38354  }
 38355  
 38356  var _sqlite3BtreeBeginTransØ00__func__Ø000 [23]int8
 38357  
 38358  func init() {
 38359  	crt.Xstrncpy(nil, &_sqlite3BtreeBeginTransØ00__func__Ø000[0], str(51322), 23)
 38360  }
 38361  
 38362  // C comment
 38363  //  /*
 38364  //  ** Get a reference to pPage1 of the database file.  This will
 38365  //  ** also acquire a readlock on that file.
 38366  //  **
 38367  //  ** SQLITE_OK is returned on success.  If the file is not a
 38368  //  ** well-formed database file, then SQLITE_CORRUPT is returned.
 38369  //  ** SQLITE_BUSY is returned if the database is locked.  SQLITE_NOMEM
 38370  //  ** is returned if we run out of memory.
 38371  //  */
 38372  func _lockBtree(tls *crt.TLS, _pBt *XBtShared) (r0 int32) {
 38373  	var _rc, _nPage, _nPageFile, _nPageHeader, _6_isOpen int32
 38374  	var _2_pageSize, _2_usableSize uint32
 38375  	var _2_page1 *uint8
 38376  	var _pPage1 *XMemPage
 38377  	_nPageFile = int32(0)
 38378  	func() {
 38379  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 38380  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61941), unsafe.Pointer(&_lockBtreeØ00__func__Ø000), unsafe.Pointer(str(9235)))
 38381  			crt.X__builtin_abort(tls)
 38382  		}
 38383  	}()
 38384  	func() {
 38385  		if (*XMemPage)(_pBt.XpPage1) != nil {
 38386  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61942), unsafe.Pointer(&_lockBtreeØ00__func__Ø000), unsafe.Pointer(str(51345)))
 38387  			crt.X__builtin_abort(tls)
 38388  		}
 38389  	}()
 38390  	_rc = _sqlite3PagerSharedLock(tls, (*XPager)(_pBt.XpPager))
 38391  	if _rc != int32(0) {
 38392  		return _rc
 38393  	}
 38394  	_rc = _btreeGetPage(tls, _pBt, uint32(1), &_pPage1, int32(0))
 38395  	if _rc != int32(0) {
 38396  		return _rc
 38397  	}
 38398  	_nPage = store2(&_nPageHeader, int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(int32(28))+uintptr(unsafe.Pointer(_pPage1.XaData)))))))
 38399  	_sqlite3PagerPagecount(tls, (*XPager)(_pBt.XpPager), &_nPageFile)
 38400  	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))))), uint32(4)) != int32(0)) {
 38401  		_nPage = _nPageFile
 38402  	}
 38403  	if _nPage <= int32(0) {
 38404  		goto _8
 38405  	}
 38406  	_2_page1 = _pPage1.XaData
 38407  	_rc = int32(26)
 38408  	if crt.Xmemcmp(tls, unsafe.Pointer(_2_page1), unsafe.Pointer(&_zMagicHeader), uint32(16)) != int32(0) {
 38409  		goto _page1_init_failed
 38410  	}
 38411  	if int32(*elem15(_2_page1, uintptr(18))) > int32(2) {
 38412  		{
 38413  			p := &_pBt.XbtsFlags
 38414  			*p = uint16(int32(*p) | int32(1))
 38415  		}
 38416  	}
 38417  	if int32(*elem15(_2_page1, uintptr(19))) > int32(2) {
 38418  		goto _page1_init_failed
 38419  	}
 38420  	if int32(*elem15(_2_page1, uintptr(19))) != int32(2) || (int32(_pBt.XbtsFlags)&int32(16)) != int32(0) {
 38421  		goto _13
 38422  	}
 38423  	_6_isOpen = int32(0)
 38424  	_rc = _sqlite3PagerOpenWal(tls, (*XPager)(_pBt.XpPager), &_6_isOpen)
 38425  	if _rc != int32(0) {
 38426  		goto _page1_init_failed
 38427  	}
 38428  	if _6_isOpen == int32(0) {
 38429  		_releasePage(tls, _pPage1)
 38430  		return int32(0)
 38431  	}
 38432  	_rc = int32(26)
 38433  	goto _17
 38434  _13:
 38435  _17:
 38436  	if crt.Xmemcmp(tls, unsafe.Pointer(elem15(_2_page1, uintptr(21))), unsafe.Pointer(str(51360)), uint32(3)) != int32(0) {
 38437  		goto _page1_init_failed
 38438  	}
 38439  	_2_pageSize = uint32((int32(*elem15(_2_page1, uintptr(16))) << 8) | (int32(*elem15(_2_page1, uintptr(17))) << 16))
 38440  	if ((((_2_pageSize - uint32(1)) & _2_pageSize) != (0)) || (_2_pageSize > uint32(65536))) || (_2_pageSize <= uint32(256)) {
 38441  		goto _page1_init_failed
 38442  	}
 38443  	func() {
 38444  		if (_2_pageSize & uint32(7)) != (0) {
 38445  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62030), unsafe.Pointer(&_lockBtreeØ00__func__Ø000), unsafe.Pointer(str(51364)))
 38446  			crt.X__builtin_abort(tls)
 38447  		}
 38448  	}()
 38449  	_2_usableSize = _2_pageSize - uint32(*elem15(_2_page1, uintptr(20)))
 38450  	if _2_pageSize != _pBt.XpageSize {
 38451  		_releasePage(tls, _pPage1)
 38452  		_pBt.XusableSize = _2_usableSize
 38453  		_pBt.XpageSize = _2_pageSize
 38454  		_freeTempSpace(tls, _pBt)
 38455  		_rc = _sqlite3PagerSetPagesize(tls, (*XPager)(_pBt.XpPager), &_pBt.XpageSize, int32(_2_pageSize-_2_usableSize))
 38456  		return _rc
 38457  	}
 38458  	if ((((*Xsqlite3)(_pBt.Xdb).Xflags) & int32(65536)) == int32(0)) && (_nPage > _nPageFile) {
 38459  		_rc = _sqlite3CorruptError(tls, int32(62055))
 38460  		goto _page1_init_failed
 38461  	}
 38462  	if _2_usableSize < uint32(480) {
 38463  		goto _page1_init_failed
 38464  	}
 38465  	_pBt.XpageSize = _2_pageSize
 38466  	_pBt.XusableSize = _2_usableSize
 38467  	_pBt.XautoVacuum = uint8(func() int32 {
 38468  		if _sqlite3Get4byte(tls, elem15(_2_page1, uintptr(52))) != 0 {
 38469  			return int32(1)
 38470  		}
 38471  		return int32(0)
 38472  	}())
 38473  	_pBt.XincrVacuum = uint8(func() int32 {
 38474  		if _sqlite3Get4byte(tls, elem15(_2_page1, uintptr(64))) != 0 {
 38475  			return int32(1)
 38476  		}
 38477  		return int32(0)
 38478  	}())
 38479  _8:
 38480  	_pBt.XmaxLocal = uint16((((_pBt.XusableSize - uint32(12)) * uint32(64)) / uint32(255)) - uint32(23))
 38481  	_pBt.XminLocal = uint16((((_pBt.XusableSize - uint32(12)) * uint32(32)) / uint32(255)) - uint32(23))
 38482  	_pBt.XmaxLeaf = uint16(_pBt.XusableSize - uint32(35))
 38483  	_pBt.XminLeaf = uint16((((_pBt.XusableSize - uint32(12)) * uint32(32)) / uint32(255)) - uint32(23))
 38484  	if int32(_pBt.XmaxLocal) > int32(127) {
 38485  		_pBt.Xmax1bytePayload = uint8(127)
 38486  		goto _33
 38487  	}
 38488  	_pBt.Xmax1bytePayload = uint8(_pBt.XmaxLocal)
 38489  _33:
 38490  	func() {
 38491  		if (int32(_pBt.XmaxLeaf) + int32(23)) > int32(_pBt.XpageSize-uint32(8)) {
 38492  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62094), unsafe.Pointer(&_lockBtreeØ00__func__Ø000), unsafe.Pointer(str(51382)))
 38493  			crt.X__builtin_abort(tls)
 38494  		}
 38495  	}()
 38496  	*(**XMemPage)(unsafe.Pointer(&_pBt.XpPage1)) = _pPage1
 38497  	_pBt.XnPage = uint32(_nPage)
 38498  	return int32(0)
 38499  
 38500  _page1_init_failed:
 38501  	_releasePage(tls, _pPage1)
 38502  	*(**XMemPage)(unsafe.Pointer(&_pBt.XpPage1)) = nil
 38503  	return _rc
 38504  
 38505  	_ = _nPageHeader
 38506  	panic(0)
 38507  }
 38508  
 38509  var _lockBtreeØ00__func__Ø000 [10]int8
 38510  
 38511  func init() {
 38512  	crt.Xstrncpy(nil, &_lockBtreeØ00__func__Ø000[0], str(51421), 10)
 38513  }
 38514  
 38515  // C comment
 38516  //  /*
 38517  //  ** This function is called to obtain a shared lock on the database file.
 38518  //  ** It is illegal to call sqlite3PagerGet() until after this function
 38519  //  ** has been successfully called. If a shared-lock is already held when
 38520  //  ** this function is called, it is a no-op.
 38521  //  **
 38522  //  ** The following operations are also performed by this function.
 38523  //  **
 38524  //  **   1) If the pager is currently in PAGER_OPEN state (no lock held
 38525  //  **      on the database file), then an attempt is made to obtain a
 38526  //  **      SHARED lock on the database file. Immediately after obtaining
 38527  //  **      the SHARED lock, the file-system is checked for a hot-journal,
 38528  //  **      which is played back if present. Following any hot-journal
 38529  //  **      rollback, the contents of the cache are validated by checking
 38530  //  **      the 'change-counter' field of the database file header and
 38531  //  **      discarded if they are found to be invalid.
 38532  //  **
 38533  //  **   2) If the pager is running in exclusive-mode, and there are currently
 38534  //  **      no outstanding references to any pages, and is in the error state,
 38535  //  **      then an attempt is made to clear the error state by discarding
 38536  //  **      the contents of the page cache and rolling back any open journal
 38537  //  **      file.
 38538  //  **
 38539  //  ** If everything is successful, SQLITE_OK is returned. If an IO error
 38540  //  ** occurs while locking the database, checking for a hot-journal file or
 38541  //  ** rolling back a journal file, the IO error code is returned.
 38542  //  */
 38543  func _sqlite3PagerSharedLock(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 38544  	var _rc, _1_bHotJournal, _8_bExists, _9_fout, _9_f int32
 38545  	var _15_nPage uint32
 38546  	var _15_dbFileVers [16]int8
 38547  	var _8_pVfs *Xsqlite3_vfs
 38548  	_rc = int32(0)
 38549  	func() {
 38550  		if _sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.XpPCache)) != int32(0) {
 38551  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52037), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(51431)))
 38552  			crt.X__builtin_abort(tls)
 38553  		}
 38554  	}()
 38555  	func() {
 38556  		if _assert_pager_state(tls, _pPager) == 0 {
 38557  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52038), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(10971)))
 38558  			crt.X__builtin_abort(tls)
 38559  		}
 38560  	}()
 38561  	func() {
 38562  		if int32(_pPager.XeState) != int32(0) && int32(_pPager.XeState) != int32(1) {
 38563  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52039), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(51473)))
 38564  			crt.X__builtin_abort(tls)
 38565  		}
 38566  	}()
 38567  	func() {
 38568  		if _pPager.XerrCode != int32(0) {
 38569  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52040), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(11709)))
 38570  			crt.X__builtin_abort(tls)
 38571  		}
 38572  	}()
 38573  	if (*XWal)(_pPager.XpWal) != nil || int32(_pPager.XeState) != int32(0) {
 38574  		goto _10
 38575  	}
 38576  	_1_bHotJournal = int32(1)
 38577  	func() {
 38578  		if _pPager.XmemDb != 0 {
 38579  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52045), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(11702)))
 38580  			crt.X__builtin_abort(tls)
 38581  		}
 38582  	}()
 38583  	func() {
 38584  		if int32(_pPager.XtempFile) != int32(0) && int32(_pPager.XeLock) != int32(4) {
 38585  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52046), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(51532)))
 38586  			crt.X__builtin_abort(tls)
 38587  		}
 38588  	}()
 38589  	_rc = _pager_wait_on_lock(tls, _pPager, int32(1))
 38590  	if _rc != int32(0) {
 38591  		func() {
 38592  			if int32(_pPager.XeLock) != int32(0) && int32(_pPager.XeLock) != int32(5) {
 38593  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52050), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(51585)))
 38594  				crt.X__builtin_abort(tls)
 38595  			}
 38596  		}()
 38597  		goto _failed
 38598  	}
 38599  	if int32(_pPager.XeLock) <= int32(1) {
 38600  		_rc = _hasHotJournal(tls, _pPager, &_1_bHotJournal)
 38601  	}
 38602  	if _rc != int32(0) {
 38603  		goto _failed
 38604  	}
 38605  	if _1_bHotJournal == 0 {
 38606  		goto _22
 38607  	}
 38608  	if _pPager.XreadOnly != 0 {
 38609  		_rc = int32(776)
 38610  		goto _failed
 38611  	}
 38612  	_rc = _pagerLockDb(tls, _pPager, int32(4))
 38613  	if _rc != int32(0) {
 38614  		goto _failed
 38615  	}
 38616  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) != nil {
 38617  		goto _25
 38618  	}
 38619  	_8_pVfs = (*Xsqlite3_vfs)(_pPager.XpVfs)
 38620  	_rc = _sqlite3OsAccess(tls, _8_pVfs, _pPager.XzJournal, int32(0), &_8_bExists)
 38621  	if _rc != int32(0) || _8_bExists == 0 {
 38622  		goto _27
 38623  	}
 38624  	_9_fout = int32(0)
 38625  	_9_f = int32(2050)
 38626  	func() {
 38627  		if _pPager.XtempFile != 0 {
 38628  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52110), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(51639)))
 38629  			crt.X__builtin_abort(tls)
 38630  		}
 38631  	}()
 38632  	_rc = _sqlite3OsOpen(tls, _8_pVfs, _pPager.XzJournal, (*Xsqlite3_file)(_pPager.Xjfd), _9_f, &_9_fout)
 38633  	func() {
 38634  		if _rc == int32(0) && (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil {
 38635  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52112), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(13465)))
 38636  			crt.X__builtin_abort(tls)
 38637  		}
 38638  	}()
 38639  	if (_rc == int32(0)) && (_9_fout&int32(1)) != 0 {
 38640  		_rc = _sqlite3CantopenError(tls, int32(52114))
 38641  		_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.Xjfd))
 38642  	}
 38643  _27:
 38644  _25:
 38645  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil {
 38646  		goto _35
 38647  	}
 38648  	func() {
 38649  		if _rc != int32(0) {
 38650  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52129), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(14967)))
 38651  			crt.X__builtin_abort(tls)
 38652  		}
 38653  	}()
 38654  	_rc = _pagerSyncHotJournal(tls, _pPager)
 38655  	if _rc == int32(0) {
 38656  		_rc = _pager_playback(tls, _pPager, bool2int(_pPager.XtempFile == 0))
 38657  		_pPager.XeState = 0
 38658  	}
 38659  	goto _40
 38660  _35:
 38661  	if _pPager.XexclusiveMode == 0 {
 38662  		_pagerUnlockDb(tls, _pPager, int32(1))
 38663  	}
 38664  _40:
 38665  	if _rc != int32(0) {
 38666  		_pager_error(tls, _pPager, _rc)
 38667  		goto _failed
 38668  	}
 38669  	func() {
 38670  		if int32(_pPager.XeState) != int32(0) {
 38671  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52160), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(51657)))
 38672  			crt.X__builtin_abort(tls)
 38673  		}
 38674  	}()
 38675  	func() {
 38676  		if int32(_pPager.XeLock) != int32(1) && (_pPager.XexclusiveMode == 0 || int32(_pPager.XeLock) <= int32(1)) {
 38677  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52161), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(51684)))
 38678  			crt.X__builtin_abort(tls)
 38679  		}
 38680  	}()
 38681  _22:
 38682  	if _pPager.XtempFile != 0 || _pPager.XhasHeldSharedLock == 0 {
 38683  		goto _49
 38684  	}
 38685  	_15_nPage = uint32(0)
 38686  	_rc = _pagerPagecount(tls, _pPager, &_15_nPage)
 38687  	if _rc != 0 {
 38688  		goto _failed
 38689  	}
 38690  	if _15_nPage <= (0) {
 38691  		goto _51
 38692  	}
 38693  	_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.Xfd), unsafe.Pointer(&_15_dbFileVers), int32(16), int64(24))
 38694  	if (_rc != int32(0)) && (_rc != int32(522)) {
 38695  		goto _failed
 38696  	}
 38697  	goto _54
 38698  _51:
 38699  	crt.Xmemset(tls, unsafe.Pointer(&_15_dbFileVers), int32(0), uint32(16))
 38700  _54:
 38701  	if crt.Xmemcmp(tls, unsafe.Pointer(&_pPager.XdbFileVers), unsafe.Pointer(&_15_dbFileVers), uint32(16)) == int32(0) {
 38702  		goto _55
 38703  	}
 38704  	_pager_reset(tls, _pPager)
 38705  	if _pPager.XbUseFetch != 0 {
 38706  		_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pPager.Xfd), 0, nil)
 38707  	}
 38708  _55:
 38709  _49:
 38710  	_rc = _pagerOpenWalIfPresent(tls, _pPager)
 38711  	func() {
 38712  		if (*XWal)(_pPager.XpWal) != nil && _rc != int32(0) {
 38713  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52219), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(51769)))
 38714  			crt.X__builtin_abort(tls)
 38715  		}
 38716  	}()
 38717  _10:
 38718  	if (*XWal)(_pPager.XpWal) != nil {
 38719  		func() {
 38720  			if _rc != int32(0) {
 38721  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52224), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(14967)))
 38722  				crt.X__builtin_abort(tls)
 38723  			}
 38724  		}()
 38725  		_rc = _pagerBeginReadTransaction(tls, _pPager)
 38726  	}
 38727  	if ((int32(_pPager.XtempFile) == int32(0)) && (int32(_pPager.XeState) == int32(0))) && (_rc == int32(0)) {
 38728  		_rc = _pagerPagecount(tls, _pPager, &_pPager.XdbSize)
 38729  	}
 38730  _failed:
 38731  	if _rc != int32(0) {
 38732  		func() {
 38733  			if _pPager.XmemDb != 0 {
 38734  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52234), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(11702)))
 38735  				crt.X__builtin_abort(tls)
 38736  			}
 38737  		}()
 38738  		_pager_unlock(tls, _pPager)
 38739  		func() {
 38740  			if int32(_pPager.XeState) != int32(0) {
 38741  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52236), unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000), unsafe.Pointer(str(51657)))
 38742  				crt.X__builtin_abort(tls)
 38743  			}
 38744  		}()
 38745  		goto _71
 38746  	}
 38747  	_pPager.XeState = uint8(1)
 38748  	_pPager.XhasHeldSharedLock = uint8(1)
 38749  _71:
 38750  	return _rc
 38751  
 38752  	_ = _15_dbFileVers
 38753  	panic(0)
 38754  }
 38755  
 38756  var _sqlite3PagerSharedLockØ00__func__Ø000 [23]int8
 38757  
 38758  func init() {
 38759  	crt.Xstrncpy(nil, &_sqlite3PagerSharedLockØ00__func__Ø000[0], str(51802), 23)
 38760  }
 38761  
 38762  // C comment
 38763  //  /*
 38764  //  ** Try to obtain a lock of type locktype on the database file. If
 38765  //  ** a similar or greater lock is already held, this function is a no-op
 38766  //  ** (returning SQLITE_OK immediately).
 38767  //  **
 38768  //  ** Otherwise, attempt to obtain the lock using sqlite3OsLock(). Invoke
 38769  //  ** the busy callback if the lock is currently not available. Repeat
 38770  //  ** until the busy callback returns false or until the attempt to
 38771  //  ** obtain the lock succeeds.
 38772  //  **
 38773  //  ** Return SQLITE_OK on success and an error code if we cannot obtain
 38774  //  ** the lock. If the lock is obtained successfully, set the Pager.state
 38775  //  ** variable to locktype before returning.
 38776  //  */
 38777  func _pager_wait_on_lock(tls *crt.TLS, _pPager *XPager, _locktype int32) (r0 int32) {
 38778  	var _rc int32
 38779  	func() {
 38780  		if int32(_pPager.XeLock) < _locktype && (int32(_pPager.XeLock) != int32(0) || _locktype != int32(1)) && (int32(_pPager.XeLock) != int32(2) || _locktype != int32(4)) {
 38781  			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)))
 38782  			crt.X__builtin_abort(tls)
 38783  		}
 38784  	}()
 38785  _6:
 38786  	_rc = _pagerLockDb(tls, _pPager, _locktype)
 38787  	if (_rc == int32(5)) && _pPager.XxBusyHandler(tls, _pPager.XpBusyHandlerArg) != 0 {
 38788  		goto _6
 38789  	}
 38790  	return _rc
 38791  }
 38792  
 38793  var _pager_wait_on_lockØ00__func__Ø000 [19]int8
 38794  
 38795  func init() {
 38796  	crt.Xstrncpy(nil, &_pager_wait_on_lockØ00__func__Ø000[0], str(51966), 19)
 38797  }
 38798  
 38799  // C comment
 38800  //  /*
 38801  //  ** Lock the database file to level eLock, which must be either SHARED_LOCK,
 38802  //  ** RESERVED_LOCK or EXCLUSIVE_LOCK. If the caller is successful, set the
 38803  //  ** Pager.eLock variable to the new locking state.
 38804  //  **
 38805  //  ** Except, if Pager.eLock is set to UNKNOWN_LOCK when this function is
 38806  //  ** called, do not modify it unless the new locking state is EXCLUSIVE_LOCK.
 38807  //  ** See the comment above the #define of UNKNOWN_LOCK for an explanation
 38808  //  ** of this.
 38809  //  */
 38810  func _pagerLockDb(tls *crt.TLS, _pPager *XPager, _eLock int32) (r0 int32) {
 38811  	var _rc int32
 38812  	_rc = int32(0)
 38813  	func() {
 38814  		if _eLock != int32(1) && _eLock != int32(2) && _eLock != int32(4) {
 38815  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48076), unsafe.Pointer(&_pagerLockDbØ00__func__Ø000), unsafe.Pointer(str(51985)))
 38816  			crt.X__builtin_abort(tls)
 38817  		}
 38818  	}()
 38819  	if int32(_pPager.XeLock) >= _eLock && int32(_pPager.XeLock) != int32(5) {
 38820  		goto _5
 38821  	}
 38822  	_rc = func() int32 {
 38823  		if _pPager.XnoLock != 0 {
 38824  			return int32(0)
 38825  		}
 38826  		return _sqlite3OsLock(tls, (*Xsqlite3_file)(_pPager.Xfd), _eLock)
 38827  	}()
 38828  	if (_rc == int32(0)) && ((int32(_pPager.XeLock) != int32(5)) || (_eLock == int32(4))) {
 38829  		_pPager.XeLock = uint8(_eLock)
 38830  	}
 38831  _5:
 38832  	return _rc
 38833  }
 38834  
 38835  var _pagerLockDbØ00__func__Ø000 [12]int8
 38836  
 38837  func init() {
 38838  	crt.Xstrncpy(nil, &_pagerLockDbØ00__func__Ø000[0], str(52053), 12)
 38839  }
 38840  
 38841  // C comment
 38842  //  /*
 38843  //  ** This function is called after transitioning from PAGER_UNLOCK to
 38844  //  ** PAGER_SHARED state. It tests if there is a hot journal present in
 38845  //  ** the file-system for the given pager. A hot journal is one that
 38846  //  ** needs to be played back. According to this function, a hot-journal
 38847  //  ** file exists if the following criteria are met:
 38848  //  **
 38849  //  **   * The journal file exists in the file system, and
 38850  //  **   * No process holds a RESERVED or greater lock on the database file, and
 38851  //  **   * The database file itself is greater than 0 bytes in size, and
 38852  //  **   * The first byte of the journal file exists and is not 0x00.
 38853  //  **
 38854  //  ** If the current size of the database file is 0 but a journal file
 38855  //  ** exists, that is probably an old journal left over from a prior
 38856  //  ** database with the same name. In this case the journal file is
 38857  //  ** just deleted using OsDelete, *pExists is set to 0 and SQLITE_OK
 38858  //  ** is returned.
 38859  //  **
 38860  //  ** This routine does not check if there is a master journal filename
 38861  //  ** at the end of the file. If there is, and that master journal file
 38862  //  ** does not exist, then the journal file is not really hot. In this
 38863  //  ** case this routine will return a false-positive. The pager_playback()
 38864  //  ** routine will discover that the journal file is not really hot and
 38865  //  ** will not roll it back.
 38866  //  **
 38867  //  ** If a hot-journal file is found to exist, *pExists is set to 1 and
 38868  //  ** SQLITE_OK returned. If no hot-journal file is present, *pExists is
 38869  //  ** set to 0 and SQLITE_OK returned. If an IO error occurs while trying
 38870  //  ** to determine whether or not a hot-journal file exists, the IO error
 38871  //  ** code is returned and the value of *pExists is undefined.
 38872  //  */
 38873  func _hasHotJournal(tls *crt.TLS, _pPager *XPager, _pExists *int32) (r0 int32) {
 38874  	var _rc, _exists, _jrnlOpen, _2_locked, _8_f int32
 38875  	var _3_nPage uint32
 38876  	var _9_first uint8
 38877  	var _pVfs *Xsqlite3_vfs
 38878  	_pVfs = (*Xsqlite3_vfs)(_pPager.XpVfs)
 38879  	_rc = int32(0)
 38880  	_exists = int32(1)
 38881  	_jrnlOpen = bool2int((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) != nil)
 38882  	func() {
 38883  		if _pPager.XuseJournal == 0 {
 38884  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51916), unsafe.Pointer(&_hasHotJournalØ00__func__Ø000), unsafe.Pointer(str(12340)))
 38885  			crt.X__builtin_abort(tls)
 38886  		}
 38887  	}()
 38888  	func() {
 38889  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil {
 38890  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51917), unsafe.Pointer(&_hasHotJournalØ00__func__Ø000), unsafe.Pointer(str(16463)))
 38891  			crt.X__builtin_abort(tls)
 38892  		}
 38893  	}()
 38894  	func() {
 38895  		if int32(_pPager.XeState) != int32(0) {
 38896  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51918), unsafe.Pointer(&_hasHotJournalØ00__func__Ø000), unsafe.Pointer(str(51657)))
 38897  			crt.X__builtin_abort(tls)
 38898  		}
 38899  	}()
 38900  	func() {
 38901  		if _jrnlOpen != int32(0) && (_sqlite3OsDeviceCharacteristics(tls, (*Xsqlite3_file)(_pPager.Xjfd))&int32(2048)) == 0 {
 38902  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51920), unsafe.Pointer(&_hasHotJournalØ00__func__Ø000), unsafe.Pointer(str(52065)))
 38903  			crt.X__builtin_abort(tls)
 38904  		}
 38905  	}()
 38906  	*_pExists = int32(0)
 38907  	if _jrnlOpen == 0 {
 38908  		_rc = _sqlite3OsAccess(tls, _pVfs, _pPager.XzJournal, int32(0), &_exists)
 38909  	}
 38910  	if _rc != int32(0) || _exists == 0 {
 38911  		goto _11
 38912  	}
 38913  	_2_locked = int32(0)
 38914  	_rc = _sqlite3OsCheckReservedLock(tls, (*Xsqlite3_file)(_pPager.Xfd), &_2_locked)
 38915  	if _rc != int32(0) || _2_locked != 0 {
 38916  		goto _13
 38917  	}
 38918  	func() {
 38919  		if int32(_pPager.XtempFile) != int32(0) {
 38920  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51943), unsafe.Pointer(&_hasHotJournalØ00__func__Ø000), unsafe.Pointer(str(10998)))
 38921  			crt.X__builtin_abort(tls)
 38922  		}
 38923  	}()
 38924  	_rc = _pagerPagecount(tls, _pPager, &_3_nPage)
 38925  	if _rc != int32(0) {
 38926  		goto _16
 38927  	}
 38928  	if _3_nPage != (0) || _jrnlOpen != 0 {
 38929  		goto _18
 38930  	}
 38931  	_sqlite3BeginBenignMalloc(tls)
 38932  	if _pagerLockDb(tls, _pPager, int32(2)) != int32(0) {
 38933  		goto _19
 38934  	}
 38935  	_sqlite3OsDelete(tls, _pVfs, _pPager.XzJournal, int32(0))
 38936  	if _pPager.XexclusiveMode == 0 {
 38937  		_pagerUnlockDb(tls, _pPager, int32(1))
 38938  	}
 38939  _19:
 38940  	_sqlite3EndBenignMalloc(tls)
 38941  	goto _21
 38942  _18:
 38943  	if _jrnlOpen == 0 {
 38944  		_8_f = int32(2049)
 38945  		_rc = _sqlite3OsOpen(tls, _pVfs, _pPager.XzJournal, (*Xsqlite3_file)(_pPager.Xjfd), _8_f, &_8_f)
 38946  	}
 38947  	if _rc != int32(0) {
 38948  		goto _23
 38949  	}
 38950  	_9_first = uint8(0)
 38951  	_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.Xjfd), unsafe.Pointer(&_9_first), int32(1), 0)
 38952  	if _rc == int32(522) {
 38953  		_rc = int32(0)
 38954  	}
 38955  	if _jrnlOpen == 0 {
 38956  		_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.Xjfd))
 38957  	}
 38958  	*_pExists = bool2int(int32(_9_first) != int32(0))
 38959  	goto _27
 38960  _23:
 38961  	if _rc == int32(14) {
 38962  		*_pExists = int32(1)
 38963  		_rc = int32(0)
 38964  	}
 38965  _27:
 38966  _21:
 38967  _16:
 38968  _13:
 38969  _11:
 38970  	return _rc
 38971  }
 38972  
 38973  var _hasHotJournalØ00__func__Ø000 [14]int8
 38974  
 38975  func init() {
 38976  	crt.Xstrncpy(nil, &_hasHotJournalØ00__func__Ø000[0], str(52165), 14)
 38977  }
 38978  
 38979  func _sqlite3OsCheckReservedLock(tls *crt.TLS, _id *Xsqlite3_file, _pResOut *int32) (r0 int32) {
 38980  	return func() func(*crt.TLS, *Xsqlite3_file, *int32) int32 {
 38981  		v := (*Xsqlite3_io_methods)(_id.XpMethods).XxCheckReservedLock
 38982  		return *(*func(*crt.TLS, *Xsqlite3_file, *int32) int32)(unsafe.Pointer(&v))
 38983  	}()(tls, _id, _pResOut)
 38984  }
 38985  
 38986  // C comment
 38987  //  /*
 38988  //  ** This function is called as part of the transition from PAGER_OPEN
 38989  //  ** to PAGER_READER state to determine the size of the database file
 38990  //  ** in pages (assuming the page size currently stored in Pager.pageSize).
 38991  //  **
 38992  //  ** If no error occurs, SQLITE_OK is returned and the size of the database
 38993  //  ** in pages is stored in *pnPage. Otherwise, an error code (perhaps
 38994  //  ** SQLITE_IOERR_FSTAT) is returned and *pnPage is left unmodified.
 38995  //  */
 38996  func _pagerPagecount(tls *crt.TLS, _pPager *XPager, _pnPage *uint32) (r0 int32) {
 38997  	var _1_rc int32
 38998  	var _1_n int64
 38999  	var _nPage uint32
 39000  	func() {
 39001  		if int32(_pPager.XeState) != int32(0) {
 39002  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50166), unsafe.Pointer(&_pagerPagecountØ00__func__Ø000), unsafe.Pointer(str(51657)))
 39003  			crt.X__builtin_abort(tls)
 39004  		}
 39005  	}()
 39006  	func() {
 39007  		if int32(_pPager.XeLock) < int32(1) {
 39008  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50167), unsafe.Pointer(&_pagerPagecountØ00__func__Ø000), unsafe.Pointer(str(52179)))
 39009  			crt.X__builtin_abort(tls)
 39010  		}
 39011  	}()
 39012  	func() {
 39013  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil {
 39014  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50168), unsafe.Pointer(&_pagerPagecountØ00__func__Ø000), unsafe.Pointer(str(16463)))
 39015  			crt.X__builtin_abort(tls)
 39016  		}
 39017  	}()
 39018  	func() {
 39019  		if int32(_pPager.XtempFile) != int32(0) {
 39020  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50169), unsafe.Pointer(&_pagerPagecountØ00__func__Ø000), unsafe.Pointer(str(10998)))
 39021  			crt.X__builtin_abort(tls)
 39022  		}
 39023  	}()
 39024  	_nPage = _sqlite3WalDbsize(tls, (*XWal)(_pPager.XpWal))
 39025  	if _nPage != (0) || func() int32 {
 39026  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) != nil {
 39027  			return int32(1)
 39028  		}
 39029  		return func() int32 {
 39030  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50177), unsafe.Pointer(&_pagerPagecountØ00__func__Ø000), unsafe.Pointer(str(4809)))
 39031  			crt.X__builtin_abort(tls)
 39032  			return int32(0)
 39033  		}()
 39034  	}() == 0 {
 39035  		goto _11
 39036  	}
 39037  	_1_n = int64(0)
 39038  	_1_rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.Xfd), &_1_n)
 39039  	if _1_rc != int32(0) {
 39040  		return _1_rc
 39041  	}
 39042  	_nPage = uint32(((_1_n + int64(_pPager.XpageSize)) - int64(1)) / int64(_pPager.XpageSize))
 39043  _11:
 39044  	if _nPage > _pPager.XmxPgno {
 39045  		_pPager.XmxPgno = _nPage
 39046  	}
 39047  	*_pnPage = _nPage
 39048  	return int32(0)
 39049  }
 39050  
 39051  var _pagerPagecountØ00__func__Ø000 [15]int8
 39052  
 39053  func init() {
 39054  	crt.Xstrncpy(nil, &_pagerPagecountØ00__func__Ø000[0], str(52206), 15)
 39055  }
 39056  
 39057  // C comment
 39058  //  /*
 39059  //  ** Return the size of the database in pages (or zero, if unknown).
 39060  //  */
 39061  func _sqlite3WalDbsize(tls *crt.TLS, _pWal *XWal) (r0 uint32) {
 39062  	if (_pWal != nil) && func() int32 {
 39063  		if int32(_pWal.XreadLock) >= int32(0) {
 39064  			return int32(1)
 39065  		}
 39066  		return func() int32 {
 39067  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57179), unsafe.Pointer(&_sqlite3WalDbsizeØ00__func__Ø000), unsafe.Pointer(str(4809)))
 39068  			crt.X__builtin_abort(tls)
 39069  			return int32(0)
 39070  		}()
 39071  	}() != 0 {
 39072  		return _pWal.Xhdr.XnPage
 39073  	}
 39074  	return 0
 39075  }
 39076  
 39077  var _sqlite3WalDbsizeØ00__func__Ø000 [17]int8
 39078  
 39079  func init() {
 39080  	crt.Xstrncpy(nil, &_sqlite3WalDbsizeØ00__func__Ø000[0], str(52221), 17)
 39081  }
 39082  
 39083  // C comment
 39084  //  /*
 39085  //  ** Check if the *-wal file that corresponds to the database opened by pPager
 39086  //  ** exists if the database is not empy, or verify that the *-wal file does
 39087  //  ** not exist (by deleting it) if the database file is empty.
 39088  //  **
 39089  //  ** If the database is not empty and the *-wal file exists, open the pager
 39090  //  ** in WAL mode.  If the database is empty or if no *-wal file exists and
 39091  //  ** if no error occurs, make sure Pager.journalMode is not set to
 39092  //  ** PAGER_JOURNALMODE_WAL.
 39093  //  **
 39094  //  ** Return SQLITE_OK or an error code.
 39095  //  **
 39096  //  ** The caller must hold a SHARED lock on the database file to call this
 39097  //  ** function. Because an EXCLUSIVE lock on the db file is required to delete
 39098  //  ** a WAL on a none-empty database, this ensures there is no race condition
 39099  //  ** between the xAccess() below and an xDelete() being executed by some
 39100  //  ** other connection.
 39101  //  */
 39102  func _pagerOpenWalIfPresent(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 39103  	var _rc, _1_isWal int32
 39104  	var _1_nPage uint32
 39105  	_rc = int32(0)
 39106  	func() {
 39107  		if int32(_pPager.XeState) != int32(0) {
 39108  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50219), unsafe.Pointer(&_pagerOpenWalIfPresentØ00__func__Ø000), unsafe.Pointer(str(51657)))
 39109  			crt.X__builtin_abort(tls)
 39110  		}
 39111  	}()
 39112  	func() {
 39113  		if int32(_pPager.XeLock) < int32(1) {
 39114  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50220), unsafe.Pointer(&_pagerOpenWalIfPresentØ00__func__Ø000), unsafe.Pointer(str(52179)))
 39115  			crt.X__builtin_abort(tls)
 39116  		}
 39117  	}()
 39118  	if _pPager.XtempFile != 0 {
 39119  		goto _4
 39120  	}
 39121  	_rc = _pagerPagecount(tls, _pPager, &_1_nPage)
 39122  	if _rc != 0 {
 39123  		return _rc
 39124  	}
 39125  	if _1_nPage != (0) {
 39126  		goto _6
 39127  	}
 39128  	_rc = _sqlite3OsDelete(tls, (*Xsqlite3_vfs)(_pPager.XpVfs), _pPager.XzWal, int32(0))
 39129  	if _rc == int32(5898) {
 39130  		_rc = int32(0)
 39131  	}
 39132  	_1_isWal = int32(0)
 39133  	goto _8
 39134  _6:
 39135  	_rc = _sqlite3OsAccess(tls, (*Xsqlite3_vfs)(_pPager.XpVfs), _pPager.XzWal, int32(0), &_1_isWal)
 39136  _8:
 39137  	if _rc != int32(0) {
 39138  		goto _9
 39139  	}
 39140  	if _1_isWal != 0 {
 39141  		_rc = _sqlite3PagerOpenWal(tls, _pPager, nil)
 39142  		goto _12
 39143  	}
 39144  	if int32(_pPager.XjournalMode) == int32(5) {
 39145  		_pPager.XjournalMode = 0
 39146  	}
 39147  _12:
 39148  _9:
 39149  _4:
 39150  	return _rc
 39151  }
 39152  
 39153  var _pagerOpenWalIfPresentØ00__func__Ø000 [22]int8
 39154  
 39155  func init() {
 39156  	crt.Xstrncpy(nil, &_pagerOpenWalIfPresentØ00__func__Ø000[0], str(52238), 22)
 39157  }
 39158  
 39159  // C comment
 39160  //  /*
 39161  //  ** The caller must be holding a SHARED lock on the database file to call
 39162  //  ** this function.
 39163  //  **
 39164  //  ** If the pager passed as the first argument is open on a real database
 39165  //  ** file (not a temp file or an in-memory database), and the WAL file
 39166  //  ** is not already open, make an attempt to open it now. If successful,
 39167  //  ** return SQLITE_OK. If an error occurs or the VFS used by the pager does
 39168  //  ** not support the xShmXXX() methods, return an error code. *pbOpen is
 39169  //  ** not modified in either case.
 39170  //  **
 39171  //  ** If the pager is open on a temp-file (or in-memory database), or if
 39172  //  ** the WAL file is already open, set *pbOpen to 1 and return SQLITE_OK
 39173  //  ** without doing anything.
 39174  //  */
 39175  func _sqlite3PagerOpenWal(tls *crt.TLS, _pPager *XPager, _pbOpen *int32) (r0 int32) {
 39176  	var _rc int32
 39177  	_rc = int32(0)
 39178  	func() {
 39179  		if _assert_pager_state(tls, _pPager) == 0 {
 39180  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54344), unsafe.Pointer(&_sqlite3PagerOpenWalØ00__func__Ø000), unsafe.Pointer(str(10971)))
 39181  			crt.X__builtin_abort(tls)
 39182  		}
 39183  	}()
 39184  	func() {
 39185  		if int32(_pPager.XeState) != int32(0) && _pbOpen == nil {
 39186  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54345), unsafe.Pointer(&_sqlite3PagerOpenWalØ00__func__Ø000), unsafe.Pointer(str(52260)))
 39187  			crt.X__builtin_abort(tls)
 39188  		}
 39189  	}()
 39190  	func() {
 39191  		if int32(_pPager.XeState) != int32(1) && _pbOpen != nil {
 39192  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54346), unsafe.Pointer(&_sqlite3PagerOpenWalØ00__func__Ø000), unsafe.Pointer(str(52297)))
 39193  			crt.X__builtin_abort(tls)
 39194  		}
 39195  	}()
 39196  	func() {
 39197  		if _pbOpen != nil && (*_pbOpen) != int32(0) {
 39198  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54347), unsafe.Pointer(&_sqlite3PagerOpenWalØ00__func__Ø000), unsafe.Pointer(str(52337)))
 39199  			crt.X__builtin_abort(tls)
 39200  		}
 39201  	}()
 39202  	func() {
 39203  		if _pbOpen == nil && (_pPager.XtempFile != 0 || _pPager.XpWal != nil) {
 39204  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54348), unsafe.Pointer(&_sqlite3PagerOpenWalØ00__func__Ø000), unsafe.Pointer(str(52361)))
 39205  			crt.X__builtin_abort(tls)
 39206  		}
 39207  	}()
 39208  	if _pPager.XtempFile != 0 || _pPager.XpWal != nil {
 39209  		goto _16
 39210  	}
 39211  	if _sqlite3PagerWalSupported(tls, _pPager) == 0 {
 39212  		return int32(14)
 39213  	}
 39214  	_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.Xjfd))
 39215  	_rc = _pagerOpenWal(tls, _pPager)
 39216  	if _rc == int32(0) {
 39217  		_pPager.XjournalMode = uint8(5)
 39218  		_pPager.XeState = 0
 39219  	}
 39220  	goto _19
 39221  _16:
 39222  	*_pbOpen = int32(1)
 39223  _19:
 39224  	return _rc
 39225  }
 39226  
 39227  var _sqlite3PagerOpenWalØ00__func__Ø000 [20]int8
 39228  
 39229  func init() {
 39230  	crt.Xstrncpy(nil, &_sqlite3PagerOpenWalØ00__func__Ø000[0], str(52411), 20)
 39231  }
 39232  
 39233  // C comment
 39234  //  /*
 39235  //  ** Return true if the underlying VFS for the given pager supports the
 39236  //  ** primitives necessary for write-ahead logging.
 39237  //  */
 39238  func _sqlite3PagerWalSupported(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 39239  	var _pMethods *Xsqlite3_io_methods
 39240  	_pMethods = (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods)
 39241  	if _pPager.XnoLock != 0 {
 39242  		return int32(0)
 39243  	}
 39244  	return bool2int((_pPager.XexclusiveMode != 0) || ((_pMethods.XiVersion >= int32(2)) && (_pMethods.XxShmMap != nil)))
 39245  }
 39246  
 39247  // C comment
 39248  //  /*
 39249  //  ** Call sqlite3WalOpen() to open the WAL handle. If the pager is in
 39250  //  ** exclusive-locking mode when this function is called, take an EXCLUSIVE
 39251  //  ** lock on the database file and use heap-memory to store the wal-index
 39252  //  ** in. Otherwise, use the normal shared-memory.
 39253  //  */
 39254  func _pagerOpenWal(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 39255  	var _rc int32
 39256  	_rc = int32(0)
 39257  	func() {
 39258  		if (*XWal)(_pPager.XpWal) != nil || int32(_pPager.XtempFile) != int32(0) {
 39259  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54296), unsafe.Pointer(&_pagerOpenWalØ00__func__Ø000), unsafe.Pointer(str(52431)))
 39260  			crt.X__builtin_abort(tls)
 39261  		}
 39262  	}()
 39263  	func() {
 39264  		if int32(_pPager.XeLock) != int32(1) && int32(_pPager.XeLock) != int32(4) {
 39265  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54297), unsafe.Pointer(&_pagerOpenWalØ00__func__Ø000), unsafe.Pointer(str(52470)))
 39266  			crt.X__builtin_abort(tls)
 39267  		}
 39268  	}()
 39269  	if _pPager.XexclusiveMode != 0 {
 39270  		_rc = _pagerExclusiveLock(tls, _pPager)
 39271  	}
 39272  	if _rc == int32(0) {
 39273  		_rc = _sqlite3WalOpen(tls, (*Xsqlite3_vfs)(_pPager.XpVfs), (*Xsqlite3_file)(_pPager.Xfd), _pPager.XzWal, int32(_pPager.XexclusiveMode), _pPager.XjournalSizeLimit, (**XWal)(unsafe.Pointer(&_pPager.XpWal)))
 39274  	}
 39275  	_pagerFixMaplimit(tls, _pPager)
 39276  	return _rc
 39277  }
 39278  
 39279  var _pagerOpenWalØ00__func__Ø000 [13]int8
 39280  
 39281  func init() {
 39282  	crt.Xstrncpy(nil, &_pagerOpenWalØ00__func__Ø000[0], str(52530), 13)
 39283  }
 39284  
 39285  // C comment
 39286  //  /*
 39287  //  ** Attempt to take an exclusive lock on the database file. If a PENDING lock
 39288  //  ** is obtained instead, immediately release it.
 39289  //  */
 39290  func _pagerExclusiveLock(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 39291  	var _rc int32
 39292  	func() {
 39293  		if int32(_pPager.XeLock) != int32(1) && int32(_pPager.XeLock) != int32(4) {
 39294  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54276), unsafe.Pointer(&_pagerExclusiveLockØ00__func__Ø000), unsafe.Pointer(str(52470)))
 39295  			crt.X__builtin_abort(tls)
 39296  		}
 39297  	}()
 39298  	_rc = _pagerLockDb(tls, _pPager, int32(4))
 39299  	if _rc != int32(0) {
 39300  		_pagerUnlockDb(tls, _pPager, int32(1))
 39301  	}
 39302  	return _rc
 39303  }
 39304  
 39305  var _pagerExclusiveLockØ00__func__Ø000 [19]int8
 39306  
 39307  func init() {
 39308  	crt.Xstrncpy(nil, &_pagerExclusiveLockØ00__func__Ø000[0], str(52543), 19)
 39309  }
 39310  
 39311  // C comment
 39312  //  /*
 39313  //  ** Open a connection to the WAL file zWalName. The database file must
 39314  //  ** already be opened on connection pDbFd. The buffer that zWalName points
 39315  //  ** to must remain valid for the lifetime of the returned Wal* handle.
 39316  //  **
 39317  //  ** A SHARED lock should be held on the database file when this function
 39318  //  ** is called. The purpose of this SHARED lock is to prevent any other
 39319  //  ** client from unlinking the WAL or wal-index file. If another process
 39320  //  ** were to do this just after this client opened one of these files, the
 39321  //  ** system would be badly broken.
 39322  //  **
 39323  //  ** If the log file is successfully opened, SQLITE_OK is returned and
 39324  //  ** *ppWal is set to point to a new WAL handle. If an error occurs,
 39325  //  ** an SQLite error code is returned and *ppWal is left unmodified.
 39326  //  */
 39327  func _sqlite3WalOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _pDbFd *Xsqlite3_file, _zWalName *int8, _bNoShm int32, _mxWalSize int64, _ppWal **XWal) (r0 int32) {
 39328  	var _rc, _flags, _4_iDC int32
 39329  	var _pRet *XWal
 39330  	func() {
 39331  		if _zWalName == nil || (*elem1(_zWalName, 0)) == 0 {
 39332  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55767), unsafe.Pointer(&_sqlite3WalOpenØ00__func__Ø000), unsafe.Pointer(str(52562)))
 39333  			crt.X__builtin_abort(tls)
 39334  		}
 39335  	}()
 39336  	func() {
 39337  		if _pDbFd == nil {
 39338  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(55768), unsafe.Pointer(&_sqlite3WalOpenØ00__func__Ø000), unsafe.Pointer(str(52586)))
 39339  			crt.X__builtin_abort(tls)
 39340  		}
 39341  	}()
 39342  
 39343  	*_ppWal = nil
 39344  	_pRet = (*XWal)(_sqlite3MallocZero(tls, uint64(uint32(120)+uint32(_pVfs.XszOsFile))))
 39345  	if _pRet == nil {
 39346  		return _sqlite3NomemError(tls, int32(55790))
 39347  	}
 39348  	*(**Xsqlite3_vfs)(unsafe.Pointer(&_pRet.XpVfs)) = _pVfs
 39349  	*(**Xsqlite3_file)(unsafe.Pointer(&_pRet.XpWalFd)) = (*Xsqlite3_file)(unsafe.Pointer(elem74(_pRet, uintptr(1))))
 39350  	*(**Xsqlite3_file)(unsafe.Pointer(&_pRet.XpDbFd)) = _pDbFd
 39351  	_pRet.XreadLock = int16(-1)
 39352  	_pRet.XmxWalSize = _mxWalSize
 39353  	_pRet.XzWalName = _zWalName
 39354  	_pRet.XsyncHeader = uint8(1)
 39355  	_pRet.XpadToSectorBoundary = uint8(1)
 39356  	_pRet.XexclusiveMode = uint8(func() int32 {
 39357  		if _bNoShm != 0 {
 39358  			return int32(2)
 39359  		}
 39360  		return int32(0)
 39361  	}())
 39362  	_flags = int32(524294)
 39363  	_rc = _sqlite3OsOpen(tls, _pVfs, _zWalName, (*Xsqlite3_file)(_pRet.XpWalFd), _flags, &_flags)
 39364  	if (_rc == int32(0)) && (_flags&int32(1)) != 0 {
 39365  		_pRet.XreadOnly = uint8(1)
 39366  	}
 39367  	if _rc != int32(0) {
 39368  		_walIndexClose(tls, _pRet, int32(0))
 39369  		_sqlite3OsClose(tls, (*Xsqlite3_file)(_pRet.XpWalFd))
 39370  		Xsqlite3_free(tls, unsafe.Pointer(_pRet))
 39371  		goto _11
 39372  	}
 39373  	_4_iDC = _sqlite3OsDeviceCharacteristics(tls, _pDbFd)
 39374  	if (_4_iDC & int32(1024)) != 0 {
 39375  		_pRet.XsyncHeader = 0
 39376  	}
 39377  	if (_4_iDC & int32(4096)) != 0 {
 39378  		_pRet.XpadToSectorBoundary = 0
 39379  	}
 39380  	*_ppWal = _pRet
 39381  _11:
 39382  	return _rc
 39383  }
 39384  
 39385  var _sqlite3WalOpenØ00__func__Ø000 [15]int8
 39386  
 39387  func init() {
 39388  	crt.Xstrncpy(nil, &_sqlite3WalOpenØ00__func__Ø000[0], str(52592), 15)
 39389  }
 39390  
 39391  // C comment
 39392  //  /*
 39393  //  ** Begin a read transaction on the WAL.
 39394  //  **
 39395  //  ** This routine used to be called "pagerOpenSnapshot()" because it essentially
 39396  //  ** makes a snapshot of the database at the current point in time and preserves
 39397  //  ** that snapshot for use by the reader in spite of concurrently changes by
 39398  //  ** other writers or checkpointers.
 39399  //  */
 39400  func _pagerBeginReadTransaction(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 39401  	var _rc, _changed int32
 39402  	_changed = int32(0)
 39403  	func() {
 39404  		if (*XWal)(_pPager.XpWal) == nil {
 39405  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50128), unsafe.Pointer(&_pagerBeginReadTransactionØ00__func__Ø000), unsafe.Pointer(str(15781)))
 39406  			crt.X__builtin_abort(tls)
 39407  		}
 39408  	}()
 39409  	func() {
 39410  		if int32(_pPager.XeState) != int32(0) && int32(_pPager.XeState) != int32(1) {
 39411  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50129), unsafe.Pointer(&_pagerBeginReadTransactionØ00__func__Ø000), unsafe.Pointer(str(51473)))
 39412  			crt.X__builtin_abort(tls)
 39413  		}
 39414  	}()
 39415  	_sqlite3WalEndReadTransaction(tls, (*XWal)(_pPager.XpWal))
 39416  	_rc = _sqlite3WalBeginReadTransaction(tls, (*XWal)(_pPager.XpWal), &_changed)
 39417  	if _rc == int32(0) && _changed == 0 {
 39418  		goto _6
 39419  	}
 39420  	_pager_reset(tls, _pPager)
 39421  	if _pPager.XbUseFetch != 0 {
 39422  		_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pPager.Xfd), 0, nil)
 39423  	}
 39424  _6:
 39425  	return _rc
 39426  }
 39427  
 39428  var _pagerBeginReadTransactionØ00__func__Ø000 [26]int8
 39429  
 39430  func init() {
 39431  	crt.Xstrncpy(nil, &_pagerBeginReadTransactionØ00__func__Ø000[0], str(52607), 26)
 39432  }
 39433  
 39434  // C comment
 39435  //  /*
 39436  //  ** Begin a read transaction on the database.
 39437  //  **
 39438  //  ** This routine used to be called sqlite3OpenSnapshot() and with good reason:
 39439  //  ** it takes a snapshot of the state of the WAL and wal-index for the current
 39440  //  ** instant in time.  The current thread will continue to use this snapshot.
 39441  //  ** Other threads might append new content to the WAL and wal-index but
 39442  //  ** that extra content is ignored by the current thread.
 39443  //  **
 39444  //  ** If the database contents have changes since the previous read
 39445  //  ** transaction, then *pChanged is set to 1 before returning.  The
 39446  //  ** Pager layer will use this to know that is cache is stale and
 39447  //  ** needs to be flushed.
 39448  //  */
 39449  func _sqlite3WalBeginReadTransaction(tls *crt.TLS, _pWal *XWal, _pChanged *int32) (r0 int32) {
 39450  	var _rc, _cnt int32
 39451  	_cnt = int32(0)
 39452  _0:
 39453  	_rc = _walTryBeginRead(tls, _pWal, _pChanged, int32(0), preInc2(&_cnt, 1))
 39454  	if _rc == int32(-1) {
 39455  		goto _0
 39456  	}
 39457  	return _rc
 39458  
 39459  	_ = _cnt
 39460  	panic(0)
 39461  }
 39462  
 39463  // C comment
 39464  //  /*
 39465  //  ** Attempt to start a read transaction.  This might fail due to a race or
 39466  //  ** other transient condition.  When that happens, it returns WAL_RETRY to
 39467  //  ** indicate to the caller that it is safe to retry immediately.
 39468  //  **
 39469  //  ** On success return SQLITE_OK.  On a permanent failure (such an
 39470  //  ** I/O error or an SQLITE_BUSY because another process is running
 39471  //  ** recovery) return a positive error code.
 39472  //  **
 39473  //  ** The useWal parameter is true to force the use of the WAL and disable
 39474  //  ** the case where the WAL is bypassed because it has been completely
 39475  //  ** checkpointed.  If useWal==0 then this routine calls walIndexReadHdr()
 39476  //  ** to make a copy of the wal-index header into pWal->hdr.  If the
 39477  //  ** wal-index header has changed, *pChanged is set to 1 (as an indication
 39478  //  ** to the caller that the local paget cache is obsolete and needs to be
 39479  //  ** flushed.)  When useWal==1, the wal-index header is assumed to already
 39480  //  ** be loaded and the pChanged parameter is unused.
 39481  //  **
 39482  //  ** The caller must set the cnt parameter to the number of prior calls to
 39483  //  ** this routine during the current read attempt that returned WAL_RETRY.
 39484  //  ** This routine will start taking more aggressive measures to clear the
 39485  //  ** race conditions after multiple WAL_RETRY returns, and after an excessive
 39486  //  ** number of errors will ultimately return SQLITE_PROTOCOL.  The
 39487  //  ** SQLITE_PROTOCOL return indicates that some other process has gone rogue
 39488  //  ** and is not honoring the locking protocol.  There is a vanishingly small
 39489  //  ** chance that SQLITE_PROTOCOL could be returned because of a run of really
 39490  //  ** bad luck when there is lots of contention for the wal-index, but that
 39491  //  ** possibility is so small that it can be safely neglected, we believe.
 39492  //  **
 39493  //  ** On success, this routine obtains a read lock on
 39494  //  ** WAL_READ_LOCK(pWal->readLock).  The pWal->readLock integer is
 39495  //  ** in the range 0 <= pWal->readLock < WAL_NREADER.  If pWal->readLock==(-1)
 39496  //  ** that means the Wal does not hold any read lock.  The reader must not
 39497  //  ** access any database page that is modified by a WAL frame up to and
 39498  //  ** including frame number aReadMark[pWal->readLock].  The reader will
 39499  //  ** use WAL frames up to and including pWal->hdr.mxFrame if pWal->readLock>0
 39500  //  ** Or if pWal->readLock==0, then the reader will ignore the WAL
 39501  //  ** completely and get all content directly from the database file.
 39502  //  ** If the useWal parameter is 1 then the WAL will never be ignored and
 39503  //  ** this routine will always set pWal->readLock>0 on success.
 39504  //  ** When the read transaction is completed, the caller must release the
 39505  //  ** lock on WAL_READ_LOCK(pWal->readLock) and set pWal->readLock to -1.
 39506  //  **
 39507  //  ** This routine uses the nBackfill and aReadMark[] fields of the header
 39508  //  ** to select a particular WAL_READ_LOCK() that strives to let the
 39509  //  ** checkpoint process do as much work as possible.  This routine might
 39510  //  ** update values of the aReadMark[] array in the header, but if it does
 39511  //  ** so it takes care to hold an exclusive lock on the corresponding
 39512  //  ** WAL_READ_LOCK() while changing values.
 39513  //  */
 39514  func _walTryBeginRead(tls *crt.TLS, _pWal *XWal, _pChanged *int32, _useWal int32, _cnt int32) (r0 int32) {
 39515  	var _mxI, _i, _rc, _1_nDelay int32
 39516  	var _mxReadMark, _mxFrame, _13_thisMark uint32
 39517  	var _pInfo *XWalCkptInfo
 39518  	_rc = int32(0)
 39519  	func() {
 39520  		if int32(_pWal.XreadLock) >= int32(0) {
 39521  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56667), unsafe.Pointer(&_walTryBeginReadØ00__func__Ø000), unsafe.Pointer(str(52633)))
 39522  			crt.X__builtin_abort(tls)
 39523  		}
 39524  	}()
 39525  	if _cnt <= int32(5) {
 39526  		goto _2
 39527  	}
 39528  	_1_nDelay = int32(1)
 39529  	if _cnt > int32(100) {
 39530  		_pWal.XlockError = uint8(1)
 39531  		return int32(15)
 39532  	}
 39533  	if _cnt >= int32(10) {
 39534  		_1_nDelay = ((_cnt - int32(9)) * (_cnt - int32(9))) * int32(39)
 39535  	}
 39536  	_sqlite3OsSleep(tls, (*Xsqlite3_vfs)(_pWal.XpVfs), _1_nDelay)
 39537  _2:
 39538  	if _useWal != 0 {
 39539  		goto _5
 39540  	}
 39541  	_rc = _walIndexReadHdr(tls, _pWal, _pChanged)
 39542  	if _rc != int32(5) {
 39543  		goto _6
 39544  	}
 39545  	if (*elem36(_pWal.XapWiData, 0)) == nil {
 39546  		_rc = int32(-1)
 39547  		goto _11
 39548  	}
 39549  	if int32(0) == store2(&_rc, _walLockShared(tls, _pWal, int32(2))) {
 39550  		_walUnlockShared(tls, _pWal, int32(2))
 39551  		_rc = int32(-1)
 39552  		goto _11
 39553  	}
 39554  	if _rc == int32(5) {
 39555  		_rc = int32(261)
 39556  	}
 39557  _11:
 39558  _6:
 39559  	if _rc != int32(0) {
 39560  		return _rc
 39561  	}
 39562  _5:
 39563  	_pInfo = _walCkptInfo(tls, _pWal)
 39564  	if _useWal != 0 || _pInfo.XnBackfill != (_pWal.Xhdr.XmxFrame) {
 39565  		goto _14
 39566  	}
 39567  	_rc = _walLockShared(tls, _pWal, int32(3))
 39568  	_walShmBarrier(tls, _pWal)
 39569  	if _rc != int32(0) {
 39570  		goto _15
 39571  	}
 39572  	if crt.Xmemcmp(tls, unsafe.Pointer(_walIndexHdr(tls, _pWal)), unsafe.Pointer(&_pWal.Xhdr), uint32(48)) != 0 {
 39573  		_walUnlockShared(tls, _pWal, int32(3))
 39574  		return int32(-1)
 39575  	}
 39576  	_pWal.XreadLock = 0
 39577  	return int32(0)
 39578  
 39579  _15:
 39580  	if _rc != int32(5) {
 39581  		return _rc
 39582  	}
 39583  _14:
 39584  	_mxReadMark = 0
 39585  	_mxI = int32(0)
 39586  	_mxFrame = _pWal.Xhdr.XmxFrame
 39587  	_i = int32(1)
 39588  _19:
 39589  	if _i >= int32(5) {
 39590  		goto _22
 39591  	}
 39592  	_13_thisMark = *elem7((*uint32)(unsafe.Pointer(&_pInfo.XaReadMark)), uintptr(_i))
 39593  	if (_mxReadMark <= _13_thisMark) && (_13_thisMark <= _mxFrame) {
 39594  		func() {
 39595  			if _13_thisMark == uint32(4294967295) {
 39596  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56781), unsafe.Pointer(&_walTryBeginReadØ00__func__Ø000), unsafe.Pointer(str(52650)))
 39597  				crt.X__builtin_abort(tls)
 39598  			}
 39599  		}()
 39600  		_mxReadMark = _13_thisMark
 39601  		_mxI = _i
 39602  	}
 39603  	_i += 1
 39604  	goto _19
 39605  _22:
 39606  	if (int32(_pWal.XreadOnly)&int32(2)) != int32(0) || _mxReadMark >= _mxFrame && _mxI != int32(0) {
 39607  		goto _29
 39608  	}
 39609  	_i = int32(1)
 39610  _30:
 39611  	if _i >= int32(5) {
 39612  		goto _33
 39613  	}
 39614  	_rc = _walLockExclusive(tls, _pWal, int32(3)+_i, int32(1))
 39615  	if _rc == int32(0) {
 39616  		_mxReadMark = store23(elem7((*uint32)(unsafe.Pointer(&_pInfo.XaReadMark)), uintptr(_i)), _mxFrame)
 39617  		_mxI = _i
 39618  		_walUnlockExclusive(tls, _pWal, int32(3)+_i, int32(1))
 39619  		goto _33
 39620  	}
 39621  	if _rc != int32(5) {
 39622  		return _rc
 39623  	}
 39624  	_i += 1
 39625  	goto _30
 39626  _33:
 39627  _29:
 39628  	if _mxI == int32(0) {
 39629  		func() {
 39630  			if _rc != int32(5) && (int32(_pWal.XreadOnly)&int32(2)) == int32(0) {
 39631  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56802), unsafe.Pointer(&_walTryBeginReadØ00__func__Ø000), unsafe.Pointer(str(52678)))
 39632  				crt.X__builtin_abort(tls)
 39633  			}
 39634  		}()
 39635  		return func() int32 {
 39636  			if _rc == int32(5) {
 39637  				return int32(-1)
 39638  			}
 39639  			return int32(520)
 39640  		}()
 39641  	}
 39642  	_rc = _walLockShared(tls, _pWal, int32(3)+_mxI)
 39643  	if _rc != 0 {
 39644  		return func() int32 {
 39645  			if _rc == int32(5) {
 39646  				return int32(-1)
 39647  			}
 39648  			return _rc
 39649  		}()
 39650  	}
 39651  	_pWal.XminFrame = _pInfo.XnBackfill + uint32(1)
 39652  	_walShmBarrier(tls, _pWal)
 39653  	if ((*elem7((*uint32)(unsafe.Pointer(&_pInfo.XaReadMark)), uintptr(_mxI))) != _mxReadMark) || crt.Xmemcmp(tls, unsafe.Pointer(_walIndexHdr(tls, _pWal)), unsafe.Pointer(&_pWal.Xhdr), uint32(48)) != 0 {
 39654  		_walUnlockShared(tls, _pWal, int32(3)+_mxI)
 39655  		return int32(-1)
 39656  	}
 39657  	func() {
 39658  		if _mxReadMark > (_pWal.Xhdr.XmxFrame) {
 39659  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(56852), unsafe.Pointer(&_walTryBeginReadØ00__func__Ø000), unsafe.Pointer(str(52734)))
 39660  			crt.X__builtin_abort(tls)
 39661  		}
 39662  	}()
 39663  	_pWal.XreadLock = int16(_mxI)
 39664  	return _rc
 39665  }
 39666  
 39667  var _walTryBeginReadØ00__func__Ø000 [16]int8
 39668  
 39669  func init() {
 39670  	crt.Xstrncpy(nil, &_walTryBeginReadØ00__func__Ø000[0], str(52764), 16)
 39671  }
 39672  
 39673  // C comment
 39674  //  /*
 39675  //  ** The header string that appears at the beginning of every
 39676  //  ** SQLite database.
 39677  //  */
 39678  var _zMagicHeader [16]int8
 39679  
 39680  func init() {
 39681  	crt.Xstrncpy(nil, &_zMagicHeader[0], str(52780), 16)
 39682  }
 39683  
 39684  // C comment
 39685  //  /*
 39686  //  ** Begin a write-transaction on the specified pager object. If a
 39687  //  ** write-transaction has already been opened, this function is a no-op.
 39688  //  **
 39689  //  ** If the exFlag argument is false, then acquire at least a RESERVED
 39690  //  ** lock on the database file. If exFlag is true, then acquire at least
 39691  //  ** an EXCLUSIVE lock. If such a lock is already held, no locking
 39692  //  ** functions need be called.
 39693  //  **
 39694  //  ** If the subjInMemory argument is non-zero, then any sub-journal opened
 39695  //  ** within this transaction will be opened as an in-memory file. This
 39696  //  ** has no effect if the sub-journal is already opened (as it may be when
 39697  //  ** running in exclusive mode) or if the transaction does not require a
 39698  //  ** sub-journal. If the subjInMemory argument is zero, then any required
 39699  //  ** sub-journal is implemented in-memory if pPager is an in-memory database,
 39700  //  ** or using a temporary file otherwise.
 39701  //  */
 39702  func _sqlite3PagerBegin(tls *crt.TLS, _pPager *XPager, _exFlag int32, _subjInMemory int32) (r0 int32) {
 39703  	var _rc int32
 39704  	_rc = int32(0)
 39705  	if _pPager.XerrCode != 0 {
 39706  		return _pPager.XerrCode
 39707  	}
 39708  	func() {
 39709  		if int32(_pPager.XeState) < int32(1) || int32(_pPager.XeState) >= int32(6) {
 39710  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52679), unsafe.Pointer(&_sqlite3PagerBeginØ00__func__Ø000), unsafe.Pointer(str(52796)))
 39711  			crt.X__builtin_abort(tls)
 39712  		}
 39713  	}()
 39714  	_pPager.XsubjInMemory = uint8(_subjInMemory)
 39715  	if func() int32 {
 39716  		if int32(_pPager.XeState) == int32(1) {
 39717  			return int32(1)
 39718  		}
 39719  		return func() int32 {
 39720  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52682), unsafe.Pointer(&_sqlite3PagerBeginØ00__func__Ø000), unsafe.Pointer(str(4809)))
 39721  			crt.X__builtin_abort(tls)
 39722  			return int32(0)
 39723  		}()
 39724  	}() == 0 {
 39725  		goto _6
 39726  	}
 39727  	func() {
 39728  		if (*XBitvec)(_pPager.XpInJournal) != nil {
 39729  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52683), unsafe.Pointer(&_sqlite3PagerBeginØ00__func__Ø000), unsafe.Pointer(str(13443)))
 39730  			crt.X__builtin_abort(tls)
 39731  		}
 39732  	}()
 39733  	if (*XWal)(_pPager.XpWal) == nil {
 39734  		goto _9
 39735  	}
 39736  	if _pPager.XexclusiveMode == 0 || _sqlite3WalExclusiveMode(tls, (*XWal)(_pPager.XpWal), int32(-1)) == 0 {
 39737  		goto _11
 39738  	}
 39739  	_rc = _pagerLockDb(tls, _pPager, int32(4))
 39740  	if _rc != int32(0) {
 39741  		return _rc
 39742  	}
 39743  	_sqlite3WalExclusiveMode(tls, (*XWal)(_pPager.XpWal), int32(1))
 39744  _11:
 39745  	_rc = _sqlite3WalBeginWriteTransaction(tls, (*XWal)(_pPager.XpWal))
 39746  	goto _13
 39747  _9:
 39748  	_rc = _pagerLockDb(tls, _pPager, int32(2))
 39749  	if (_rc == int32(0)) && _exFlag != 0 {
 39750  		_rc = _pager_wait_on_lock(tls, _pPager, int32(4))
 39751  	}
 39752  _13:
 39753  	if _rc == int32(0) {
 39754  		_pPager.XeState = uint8(2)
 39755  		_pPager.XdbHintSize = _pPager.XdbSize
 39756  		_pPager.XdbFileSize = _pPager.XdbSize
 39757  		_pPager.XdbOrigSize = _pPager.XdbSize
 39758  		_pPager.XjournalOff = 0
 39759  	}
 39760  	func() {
 39761  		if _rc != int32(0) && int32(_pPager.XeState) != int32(1) {
 39762  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52732), unsafe.Pointer(&_sqlite3PagerBeginØ00__func__Ø000), unsafe.Pointer(str(52855)))
 39763  			crt.X__builtin_abort(tls)
 39764  		}
 39765  	}()
 39766  	func() {
 39767  		if _rc == int32(0) && int32(_pPager.XeState) != int32(2) {
 39768  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52733), unsafe.Pointer(&_sqlite3PagerBeginØ00__func__Ø000), unsafe.Pointer(str(52901)))
 39769  			crt.X__builtin_abort(tls)
 39770  		}
 39771  	}()
 39772  	func() {
 39773  		if _assert_pager_state(tls, _pPager) == 0 {
 39774  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(52734), unsafe.Pointer(&_sqlite3PagerBeginØ00__func__Ø000), unsafe.Pointer(str(10971)))
 39775  			crt.X__builtin_abort(tls)
 39776  		}
 39777  	}()
 39778  _6:
 39779  	return _rc
 39780  }
 39781  
 39782  var _sqlite3PagerBeginØ00__func__Ø000 [18]int8
 39783  
 39784  func init() {
 39785  	crt.Xstrncpy(nil, &_sqlite3PagerBeginØ00__func__Ø000[0], str(52954), 18)
 39786  }
 39787  
 39788  // C comment
 39789  //  /*
 39790  //  ** This function starts a write transaction on the WAL.
 39791  //  **
 39792  //  ** A read transaction must have already been started by a prior call
 39793  //  ** to sqlite3WalBeginReadTransaction().
 39794  //  **
 39795  //  ** If another thread or process has written into the database since
 39796  //  ** the read transaction was started, then it is not possible for this
 39797  //  ** thread to write as doing so would cause a fork.  So this routine
 39798  //  ** returns SQLITE_BUSY in that case and no write transaction is started.
 39799  //  **
 39800  //  ** There can only be a single writer active at a time.
 39801  //  */
 39802  func _sqlite3WalBeginWriteTransaction(tls *crt.TLS, _pWal *XWal) (r0 int32) {
 39803  	var _rc int32
 39804  	func() {
 39805  		if int32(_pWal.XreadLock) < int32(0) {
 39806  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57204), unsafe.Pointer(&_sqlite3WalBeginWriteTransactionØ00__func__Ø000), unsafe.Pointer(str(19182)))
 39807  			crt.X__builtin_abort(tls)
 39808  		}
 39809  	}()
 39810  	func() {
 39811  		if int32(_pWal.XwriteLock) != int32(0) || _pWal.XiReCksum != (0) {
 39812  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57205), unsafe.Pointer(&_sqlite3WalBeginWriteTransactionØ00__func__Ø000), unsafe.Pointer(str(52972)))
 39813  			crt.X__builtin_abort(tls)
 39814  		}
 39815  	}()
 39816  	if _pWal.XreadOnly != 0 {
 39817  		return int32(8)
 39818  	}
 39819  	_rc = _walLockExclusive(tls, _pWal, int32(0), int32(1))
 39820  	if _rc != 0 {
 39821  		return _rc
 39822  	}
 39823  	_pWal.XwriteLock = uint8(1)
 39824  	if crt.Xmemcmp(tls, unsafe.Pointer(&_pWal.Xhdr), unsafe.Pointer(_walIndexHdr(tls, _pWal)), uint32(48)) != int32(0) {
 39825  		_walUnlockExclusive(tls, _pWal, int32(0), int32(1))
 39826  		_pWal.XwriteLock = 0
 39827  		_rc = int32(517)
 39828  	}
 39829  	return _rc
 39830  }
 39831  
 39832  var _sqlite3WalBeginWriteTransactionØ00__func__Ø000 [32]int8
 39833  
 39834  func init() {
 39835  	crt.Xstrncpy(nil, &_sqlite3WalBeginWriteTransactionØ00__func__Ø000[0], str(53012), 32)
 39836  }
 39837  
 39838  // C comment
 39839  //  /*
 39840  //  ** This function returns true if main-memory should be used instead of
 39841  //  ** a temporary file for transient pager files and statement journals.
 39842  //  ** The value returned depends on the value of db->temp_store (runtime
 39843  //  ** parameter) and the compile time value of SQLITE_TEMP_STORE. The
 39844  //  ** following table describes the relationship between these two values
 39845  //  ** and this functions return value.
 39846  //  **
 39847  //  **   SQLITE_TEMP_STORE     db->temp_store     Location of temporary database
 39848  //  **   -----------------     --------------     ------------------------------
 39849  //  **   0                     any                file      (return 0)
 39850  //  **   1                     1                  file      (return 0)
 39851  //  **   1                     2                  memory    (return 1)
 39852  //  **   1                     0                  file      (return 0)
 39853  //  **   2                     1                  file      (return 0)
 39854  //  **   2                     2                  memory    (return 1)
 39855  //  **   2                     0                  memory    (return 1)
 39856  //  **   3                     any                memory    (return 1)
 39857  //  */
 39858  func _sqlite3TempInMemory(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 39859  	return bool2int(int32(_db.Xtemp_store) == int32(2))
 39860  }
 39861  
 39862  // C comment
 39863  //  /*
 39864  //  ** If pBt points to an empty file then convert that empty file
 39865  //  ** into a new empty database by initializing the first page of
 39866  //  ** the database.
 39867  //  */
 39868  func _newDatabase(tls *crt.TLS, _pBt *XBtShared) (r0 int32) {
 39869  	var _rc int32
 39870  	var _data *uint8
 39871  	var _pP1 *XMemPage
 39872  	func() {
 39873  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 39874  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62159), unsafe.Pointer(&_newDatabaseØ00__func__Ø000), unsafe.Pointer(str(9235)))
 39875  			crt.X__builtin_abort(tls)
 39876  		}
 39877  	}()
 39878  	if _pBt.XnPage > (0) {
 39879  		return int32(0)
 39880  	}
 39881  	_pP1 = (*XMemPage)(_pBt.XpPage1)
 39882  	func() {
 39883  		if _pP1 == nil {
 39884  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62164), unsafe.Pointer(&_newDatabaseØ00__func__Ø000), unsafe.Pointer(str(53044)))
 39885  			crt.X__builtin_abort(tls)
 39886  		}
 39887  	}()
 39888  	_data = _pP1.XaData
 39889  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pP1.XpDbPage))
 39890  	if _rc != 0 {
 39891  		return _rc
 39892  	}
 39893  	crt.Xmemcpy(tls, unsafe.Pointer(_data), unsafe.Pointer(&_zMagicHeader), uint32(16))
 39894  
 39895  	*elem15(_data, uintptr(16)) = uint8((_pBt.XpageSize >> 8) & uint32(255))
 39896  	*elem15(_data, uintptr(17)) = uint8((_pBt.XpageSize >> 16) & uint32(255))
 39897  	*elem15(_data, uintptr(18)) = uint8(1)
 39898  	*elem15(_data, uintptr(19)) = uint8(1)
 39899  	func() {
 39900  		if _pBt.XusableSize > _pBt.XpageSize || (_pBt.XusableSize+uint32(255)) < _pBt.XpageSize {
 39901  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62174), unsafe.Pointer(&_newDatabaseØ00__func__Ø000), unsafe.Pointer(str(53051)))
 39902  			crt.X__builtin_abort(tls)
 39903  		}
 39904  	}()
 39905  	*elem15(_data, uintptr(20)) = uint8(_pBt.XpageSize - _pBt.XusableSize)
 39906  	*elem15(_data, uintptr(21)) = uint8(64)
 39907  	*elem15(_data, uintptr(22)) = uint8(32)
 39908  	*elem15(_data, uintptr(23)) = uint8(32)
 39909  	crt.Xmemset(tls, unsafe.Pointer(elem15(_data, uintptr(24))), int32(0), uint32(76))
 39910  	_zeroPage(tls, _pP1, int32(13))
 39911  	{
 39912  		p := &_pBt.XbtsFlags
 39913  		*p = uint16(int32(*p) | int32(2))
 39914  	}
 39915  	func() {
 39916  		if int32(_pBt.XautoVacuum) != int32(1) && int32(_pBt.XautoVacuum) != int32(0) {
 39917  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62183), unsafe.Pointer(&_newDatabaseØ00__func__Ø000), unsafe.Pointer(str(53120)))
 39918  			crt.X__builtin_abort(tls)
 39919  		}
 39920  	}()
 39921  	func() {
 39922  		if int32(_pBt.XincrVacuum) != int32(1) && int32(_pBt.XincrVacuum) != int32(0) {
 39923  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62184), unsafe.Pointer(&_newDatabaseØ00__func__Ø000), unsafe.Pointer(str(53161)))
 39924  			crt.X__builtin_abort(tls)
 39925  		}
 39926  	}()
 39927  	_sqlite3Put4byte(tls, elem15(_data, uintptr(52)), uint32(_pBt.XautoVacuum))
 39928  	_sqlite3Put4byte(tls, elem15(_data, uintptr(64)), uint32(_pBt.XincrVacuum))
 39929  	_pBt.XnPage = uint32(1)
 39930  	*elem15(_data, uintptr(31)) = uint8(1)
 39931  	return int32(0)
 39932  }
 39933  
 39934  var _newDatabaseØ00__func__Ø000 [12]int8
 39935  
 39936  func init() {
 39937  	crt.Xstrncpy(nil, &_newDatabaseØ00__func__Ø000[0], str(53202), 12)
 39938  }
 39939  
 39940  // C comment
 39941  //  /*
 39942  //  ** Set up a raw page so that it looks like a database page holding
 39943  //  ** no entries.
 39944  //  */
 39945  func _zeroPage(tls *crt.TLS, _pPage *XMemPage, _flags int32) {
 39946  	var _first uint16
 39947  	var _hdr uint8
 39948  	var _data *uint8
 39949  	var _pBt *XBtShared
 39950  	_data = _pPage.XaData
 39951  	_pBt = (*XBtShared)(_pPage.XpBt)
 39952  	_hdr = _pPage.XhdrOffset
 39953  	func() {
 39954  		if _sqlite3PagerPagenumber(tls, (*XPgHdr)(_pPage.XpDbPage)) != _pPage.Xpgno {
 39955  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60959), unsafe.Pointer(&_zeroPageØ00__func__Ø000), unsafe.Pointer(str(53214)))
 39956  			crt.X__builtin_abort(tls)
 39957  		}
 39958  	}()
 39959  	func() {
 39960  		if _sqlite3PagerGetExtra(tls, (*XPgHdr)(_pPage.XpDbPage)) != unsafe.Pointer(_pPage) {
 39961  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60960), unsafe.Pointer(&_zeroPageØ00__func__Ø000), unsafe.Pointer(str(20291)))
 39962  			crt.X__builtin_abort(tls)
 39963  		}
 39964  	}()
 39965  	func() {
 39966  		if _sqlite3PagerGetData(tls, (*XPgHdr)(_pPage.XpDbPage)) != unsafe.Pointer(_data) {
 39967  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60961), unsafe.Pointer(&_zeroPageØ00__func__Ø000), unsafe.Pointer(str(53266)))
 39968  			crt.X__builtin_abort(tls)
 39969  		}
 39970  	}()
 39971  	func() {
 39972  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.XpDbPage)) == 0 {
 39973  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60962), unsafe.Pointer(&_zeroPageØ00__func__Ø000), unsafe.Pointer(str(53310)))
 39974  			crt.X__builtin_abort(tls)
 39975  		}
 39976  	}()
 39977  	func() {
 39978  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 39979  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60963), unsafe.Pointer(&_zeroPageØ00__func__Ø000), unsafe.Pointer(str(9235)))
 39980  			crt.X__builtin_abort(tls)
 39981  		}
 39982  	}()
 39983  	if (int32(_pBt.XbtsFlags) & int32(4)) != 0 {
 39984  		crt.Xmemset(tls, unsafe.Pointer(elem15(_data, uintptr(_hdr))), int32(0), _pBt.XusableSize-uint32(_hdr))
 39985  	}
 39986  	*elem15(_data, uintptr(_hdr)) = uint8(int8(_flags))
 39987  	_first = uint16(int32(_hdr) + func() int32 {
 39988  		if (_flags & int32(8)) == int32(0) {
 39989  			return int32(12)
 39990  		}
 39991  		return int32(8)
 39992  	}())
 39993  	crt.Xmemset(tls, unsafe.Pointer(elem15(_data, uintptr(int32(_hdr)+int32(1)))), int32(0), uint32(4))
 39994  	*elem15(_data, uintptr(int32(_hdr)+int32(7))) = 0
 39995  	*elem15(elem15(func() *uint8 {
 39996  		*elem15(elem15(_data, uintptr(int32(_hdr)+int32(5))), 0) = uint8(_pBt.XusableSize >> 8)
 39997  		return _data
 39998  	}(), uintptr(int32(_hdr)+int32(5))), uintptr(1)) = uint8(_pBt.XusableSize)
 39999  	_pPage.XnFree = uint16(_pBt.XusableSize - uint32(_first))
 40000  	_decodeFlags(tls, _pPage, _flags)
 40001  	_pPage.XcellOffset = _first
 40002  	_pPage.XaDataEnd = elem15(_data, uintptr(_pBt.XusableSize))
 40003  	_pPage.XaCellIdx = elem15(_data, uintptr(_first))
 40004  	_pPage.XaDataOfst = elem15(_data, uintptr(_pPage.XchildPtrSize))
 40005  	_pPage.XnOverflow = 0
 40006  	func() {
 40007  		if _pBt.XpageSize < uint32(512) || _pBt.XpageSize > uint32(65536) {
 40008  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60979), unsafe.Pointer(&_zeroPageØ00__func__Ø000), unsafe.Pointer(str(53350)))
 40009  			crt.X__builtin_abort(tls)
 40010  		}
 40011  	}()
 40012  	_pPage.XmaskPage = uint16(_pBt.XpageSize - uint32(1))
 40013  	_pPage.XnCell = 0
 40014  	_pPage.XisInit = uint8(1)
 40015  }
 40016  
 40017  // C comment
 40018  //  /*
 40019  //  ** Return the page number for page pPg.
 40020  //  */
 40021  func _sqlite3PagerPagenumber(tls *crt.TLS, _pPg *XPgHdr) (r0 uint32) {
 40022  	return _pPg.Xpgno
 40023  }
 40024  
 40025  var _zeroPageØ00__func__Ø000 [9]int8
 40026  
 40027  func init() {
 40028  	crt.Xstrncpy(nil, &_zeroPageØ00__func__Ø000[0], str(53393), 9)
 40029  }
 40030  
 40031  func _sqlite3PagerIswriteable(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
 40032  	return int32(_pPg.Xflags) & int32(4)
 40033  }
 40034  
 40035  // C comment
 40036  //  /*
 40037  //  ** Decode the flags byte (the first byte of the header) for a page
 40038  //  ** and initialize fields of the MemPage structure accordingly.
 40039  //  **
 40040  //  ** Only the following combinations are supported.  Anything different
 40041  //  ** indicates a corrupt database files:
 40042  //  **
 40043  //  **         PTF_ZERODATA
 40044  //  **         PTF_ZERODATA | PTF_LEAF
 40045  //  **         PTF_LEAFDATA | PTF_INTKEY
 40046  //  **         PTF_LEAFDATA | PTF_INTKEY | PTF_LEAF
 40047  //  */
 40048  func _decodeFlags(tls *crt.TLS, _pPage *XMemPage, _flagByte int32) (r0 int32) {
 40049  	var _pBt *XBtShared
 40050  	func() {
 40051  		if int32(_pPage.XhdrOffset) != func() int32 {
 40052  			if _pPage.Xpgno == uint32(1) {
 40053  				return int32(100)
 40054  			}
 40055  			return int32(0)
 40056  		}() {
 40057  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60762), unsafe.Pointer(&_decodeFlagsØ00__func__Ø000), unsafe.Pointer(str(53402)))
 40058  			crt.X__builtin_abort(tls)
 40059  		}
 40060  	}()
 40061  	func() {
 40062  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 40063  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60763), unsafe.Pointer(&_decodeFlagsØ00__func__Ø000), unsafe.Pointer(str(20394)))
 40064  			crt.X__builtin_abort(tls)
 40065  		}
 40066  	}()
 40067  	_pPage.Xleaf = uint8(_flagByte >> 3)
 40068  
 40069  	_flagByte &= int32(-9)
 40070  	_pPage.XchildPtrSize = uint8(int32(4) - (int32(4) * int32(_pPage.Xleaf)))
 40071  	*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&_pPage.XxCellSize)) = _cellSizePtr
 40072  	_pBt = (*XBtShared)(_pPage.XpBt)
 40073  	if _flagByte != int32(5) {
 40074  		goto _6
 40075  	}
 40076  
 40077  	_pPage.XintKey = uint8(1)
 40078  	if _pPage.Xleaf != 0 {
 40079  		_pPage.XintKeyLeaf = uint8(1)
 40080  		*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&_pPage.XxParseCell)) = _btreeParseCellPtr
 40081  		goto _8
 40082  	}
 40083  	_pPage.XintKeyLeaf = 0
 40084  	*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&_pPage.XxCellSize)) = _cellSizePtrNoPayload
 40085  	*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&_pPage.XxParseCell)) = _btreeParseCellPtrNoPayload
 40086  _8:
 40087  	_pPage.XmaxLocal = _pBt.XmaxLeaf
 40088  	_pPage.XminLocal = _pBt.XminLeaf
 40089  	goto _11
 40090  _6:
 40091  	if _flagByte == int32(2) {
 40092  		_pPage.XintKey = 0
 40093  		_pPage.XintKeyLeaf = 0
 40094  		*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&_pPage.XxParseCell)) = _btreeParseCellPtrIndex
 40095  		_pPage.XmaxLocal = _pBt.XmaxLocal
 40096  		_pPage.XminLocal = _pBt.XminLocal
 40097  		goto _11
 40098  	}
 40099  	return _sqlite3CorruptError(tls, int32(60802))
 40100  
 40101  _11:
 40102  	_pPage.Xmax1bytePayload = _pBt.Xmax1bytePayload
 40103  	return int32(0)
 40104  }
 40105  
 40106  var _decodeFlagsØ00__func__Ø000 [12]int8
 40107  
 40108  func init() {
 40109  	crt.Xstrncpy(nil, &_decodeFlagsØ00__func__Ø000[0], str(53447), 12)
 40110  }
 40111  
 40112  // C comment
 40113  //  /*
 40114  //  ** The following routines are implementations of the MemPage.xCellSize
 40115  //  ** method.
 40116  //  **
 40117  //  ** Compute the total number of bytes that a Cell needs in the cell
 40118  //  ** data area of the btree-page.  The return number includes the cell
 40119  //  ** data header and the local payload, but not any overflow page or
 40120  //  ** the space used by the cell pointer.
 40121  //  **
 40122  //  ** cellSizePtrNoPayload()    =>   table internal nodes
 40123  //  ** cellSizePtr()             =>   all index nodes & table leaf nodes
 40124  //  */
 40125  func _cellSizePtr(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8) (r0 uint16) {
 40126  	var _5_minLocal int32
 40127  	var _nSize uint32
 40128  	var _pIter, _pEnd *uint8
 40129  	var _debuginfo XCellInfo
 40130  	_pIter = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell)) + uintptr(_pPage.XchildPtrSize)))
 40131  	func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) {
 40132  		v := _pPage.XxParseCell
 40133  		return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v))
 40134  	}()(tls, _pPage, _pCell, &_debuginfo)
 40135  	_nSize = uint32(*_pIter)
 40136  	if _nSize < uint32(128) {
 40137  		goto _0
 40138  	}
 40139  	_pEnd = elem15(_pIter, uintptr(8))
 40140  	_nSize &= uint32(127)
 40141  _1:
 40142  	_nSize = (_nSize << 7) | uint32(int32(*preInc15(&_pIter, 1))&int32(127))
 40143  	if (int32(*_pIter) >= int32(128)) && (crt.P2U(unsafe.Pointer(_pIter)) < crt.P2U(unsafe.Pointer(_pEnd))) {
 40144  		goto _1
 40145  	}
 40146  _0:
 40147  	*(*uintptr)(unsafe.Pointer(&_pIter)) += uintptr(1)
 40148  	if _pPage.XintKey == 0 {
 40149  		goto _3
 40150  	}
 40151  	_pEnd = elem15(_pIter, uintptr(9))
 40152  _4:
 40153  	if (int32(*postInc15(&_pIter, 1))&int32(128)) != 0 && (crt.P2U(unsafe.Pointer(_pIter)) < crt.P2U(unsafe.Pointer(_pEnd))) {
 40154  		goto _4
 40155  	}
 40156  _3:
 40157  	if _nSize > uint32(_pPage.XmaxLocal) {
 40158  		goto _7
 40159  	}
 40160  	_nSize += uint32(int32(uintptr(unsafe.Pointer(_pIter)) - uintptr(unsafe.Pointer(_pCell))))
 40161  	if _nSize < uint32(4) {
 40162  		_nSize = uint32(4)
 40163  	}
 40164  	goto _9
 40165  _7:
 40166  	_5_minLocal = int32(_pPage.XminLocal)
 40167  	_nSize = uint32(_5_minLocal) + ((_nSize - uint32(_5_minLocal)) % (((*XBtShared)(_pPage.XpBt).XusableSize) - uint32(4)))
 40168  	if _nSize > uint32(_pPage.XmaxLocal) {
 40169  		_nSize = uint32(_5_minLocal)
 40170  	}
 40171  	_nSize += uint32(int32(4) + int32(uint16(int32(uintptr(unsafe.Pointer(_pIter))-uintptr(unsafe.Pointer(_pCell))))))
 40172  _9:
 40173  	func() {
 40174  		if _nSize != uint32(_debuginfo.XnSize) && _sqlite3Config.XneverCorrupt != int32(0) {
 40175  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60301), unsafe.Pointer(&_cellSizePtrØ00__func__Ø000), unsafe.Pointer(str(53459)))
 40176  			crt.X__builtin_abort(tls)
 40177  		}
 40178  	}()
 40179  	return uint16(_nSize)
 40180  }
 40181  
 40182  var _cellSizePtrØ00__func__Ø000 [12]int8
 40183  
 40184  func init() {
 40185  	crt.Xstrncpy(nil, &_cellSizePtrØ00__func__Ø000[0], str(53496), 12)
 40186  }
 40187  
 40188  func _btreeParseCellPtr(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pInfo *XCellInfo) {
 40189  	var _nPayload uint32
 40190  	var _iKey uint64
 40191  	var _pIter, _1_pEnd, _3_pEnd *uint8
 40192  	func() {
 40193  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 40194  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60140), unsafe.Pointer(&_btreeParseCellPtrØ00__func__Ø000), unsafe.Pointer(str(20394)))
 40195  			crt.X__builtin_abort(tls)
 40196  		}
 40197  	}()
 40198  	func() {
 40199  		if int32(_pPage.Xleaf) != int32(0) && int32(_pPage.Xleaf) != int32(1) {
 40200  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60141), unsafe.Pointer(&_btreeParseCellPtrØ00__func__Ø000), unsafe.Pointer(str(53508)))
 40201  			crt.X__builtin_abort(tls)
 40202  		}
 40203  	}()
 40204  	func() {
 40205  		if _pPage.XintKeyLeaf == 0 {
 40206  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60142), unsafe.Pointer(&_btreeParseCellPtrØ00__func__Ø000), unsafe.Pointer(str(53541)))
 40207  			crt.X__builtin_abort(tls)
 40208  		}
 40209  	}()
 40210  	func() {
 40211  		if int32(_pPage.XchildPtrSize) != int32(0) {
 40212  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60143), unsafe.Pointer(&_btreeParseCellPtrØ00__func__Ø000), unsafe.Pointer(str(53559)))
 40213  			crt.X__builtin_abort(tls)
 40214  		}
 40215  	}()
 40216  	_pIter = _pCell
 40217  	_nPayload = uint32(*_pIter)
 40218  	if _nPayload < uint32(128) {
 40219  		goto _9
 40220  	}
 40221  	_1_pEnd = elem15(_pIter, uintptr(8))
 40222  	_nPayload &= uint32(127)
 40223  _10:
 40224  	_nPayload = (_nPayload << 7) | uint32(int32(*preInc15(&_pIter, 1))&int32(127))
 40225  	if (int32(*_pIter) >= int32(128)) && (crt.P2U(unsafe.Pointer(_pIter)) < crt.P2U(unsafe.Pointer(_1_pEnd))) {
 40226  		goto _10
 40227  	}
 40228  _9:
 40229  	*(*uintptr)(unsafe.Pointer(&_pIter)) += uintptr(1)
 40230  	_iKey = uint64(*_pIter)
 40231  	if _iKey < uint64(128) {
 40232  		goto _12
 40233  	}
 40234  	_3_pEnd = elem15(_pIter, uintptr(7))
 40235  	_iKey &= uint64(127)
 40236  _13:
 40237  	_iKey = (_iKey << 7) | uint64(int32(*preInc15(&_pIter, 1))&int32(127))
 40238  	if int32(*_pIter) < int32(128) {
 40239  		goto _14
 40240  	}
 40241  	if crt.P2U(unsafe.Pointer(_pIter)) >= crt.P2U(unsafe.Pointer(_3_pEnd)) {
 40242  		_iKey = (_iKey << 8) | uint64(*preInc15(&_pIter, 1))
 40243  		goto _14
 40244  	}
 40245  	goto _13
 40246  _14:
 40247  _12:
 40248  	*(*uintptr)(unsafe.Pointer(&_pIter)) += uintptr(1)
 40249  	_pInfo.XnKey = *(*int64)(unsafe.Pointer(&_iKey))
 40250  	_pInfo.XnPayload = _nPayload
 40251  	_pInfo.XpPayload = _pIter
 40252  	if _nPayload > uint32(_pPage.XmaxLocal) {
 40253  		goto _17
 40254  	}
 40255  	_pInfo.XnSize = uint16(_nPayload + uint32(uint16(int32(uintptr(unsafe.Pointer(_pIter))-uintptr(unsafe.Pointer(_pCell))))))
 40256  	if int32(_pInfo.XnSize) < int32(4) {
 40257  		_pInfo.XnSize = uint16(4)
 40258  	}
 40259  	_pInfo.XnLocal = uint16(_nPayload)
 40260  	goto _19
 40261  _17:
 40262  	_btreeParseCellAdjustSizeForOverflow(tls, _pPage, _pCell, _pInfo)
 40263  _19:
 40264  }
 40265  
 40266  var _btreeParseCellPtrØ00__func__Ø000 [18]int8
 40267  
 40268  func init() {
 40269  	crt.Xstrncpy(nil, &_btreeParseCellPtrØ00__func__Ø000[0], str(53582), 18)
 40270  }
 40271  
 40272  // C comment
 40273  //  /*
 40274  //  ** This is common tail processing for btreeParseCellPtr() and
 40275  //  ** btreeParseCellPtrIndex() for the case when the cell does not fit entirely
 40276  //  ** on a single B-tree page.  Make necessary adjustments to the CellInfo
 40277  //  ** structure.
 40278  //  */
 40279  func _btreeParseCellAdjustSizeForOverflow(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pInfo *XCellInfo) {
 40280  	var _minLocal, _maxLocal, _surplus int32
 40281  	_minLocal = int32(_pPage.XminLocal)
 40282  	_maxLocal = int32(_pPage.XmaxLocal)
 40283  	_surplus = int32(uint32(_minLocal) + ((_pInfo.XnPayload - uint32(_minLocal)) % (((*XBtShared)(_pPage.XpBt).XusableSize) - uint32(4))))
 40284  	if _surplus <= _maxLocal {
 40285  		_pInfo.XnLocal = uint16(_surplus)
 40286  		goto _1
 40287  	}
 40288  	_pInfo.XnLocal = uint16(_minLocal)
 40289  _1:
 40290  	_pInfo.XnSize = uint16(int32(uint16(int32(uintptr(unsafe.Pointer(elem15(_pInfo.XpPayload, uintptr(_pInfo.XnLocal))))-uintptr(unsafe.Pointer(_pCell))))) + int32(4))
 40291  }
 40292  
 40293  func _cellSizePtrNoPayload(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8) (r0 uint16) {
 40294  	var _pIter, _pEnd *uint8
 40295  	var _debuginfo XCellInfo
 40296  	_pIter = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell)) + uintptr(int32(4))))
 40297  	func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) {
 40298  		v := _pPage.XxParseCell
 40299  		return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v))
 40300  	}()(tls, _pPage, _pCell, &_debuginfo)
 40301  	func() {
 40302  		if int32(_pPage.XchildPtrSize) != int32(4) {
 40303  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60319), unsafe.Pointer(&_cellSizePtrNoPayloadØ00__func__Ø000), unsafe.Pointer(str(53600)))
 40304  			crt.X__builtin_abort(tls)
 40305  		}
 40306  	}()
 40307  	_pEnd = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIter)) + uintptr(int32(9))))
 40308  _2:
 40309  	if (int32(*postInc15(&_pIter, 1))&int32(128)) != 0 && (crt.P2U(unsafe.Pointer(_pIter)) < crt.P2U(unsafe.Pointer(_pEnd))) {
 40310  		goto _2
 40311  	}
 40312  	func() {
 40313  		if int32(_debuginfo.XnSize) != int32(uint16(int32(uintptr(unsafe.Pointer(_pIter))-uintptr(unsafe.Pointer(_pCell))))) && _sqlite3Config.XneverCorrupt != int32(0) {
 40314  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60322), unsafe.Pointer(&_cellSizePtrNoPayloadØ00__func__Ø000), unsafe.Pointer(str(53623)))
 40315  			crt.X__builtin_abort(tls)
 40316  		}
 40317  	}()
 40318  	return uint16(int32(uintptr(unsafe.Pointer(_pIter)) - uintptr(unsafe.Pointer(_pCell))))
 40319  }
 40320  
 40321  var _cellSizePtrNoPayloadØ00__func__Ø000 [21]int8
 40322  
 40323  func init() {
 40324  	crt.Xstrncpy(nil, &_cellSizePtrNoPayloadØ00__func__Ø000[0], str(53675), 21)
 40325  }
 40326  
 40327  // C comment
 40328  //  /*
 40329  //  ** The following routines are implementations of the MemPage.xParseCell()
 40330  //  ** method.
 40331  //  **
 40332  //  ** Parse a cell content block and fill in the CellInfo structure.
 40333  //  **
 40334  //  ** btreeParseCellPtr()        =>   table btree leaf nodes
 40335  //  ** btreeParseCellNoPayload()  =>   table btree internal nodes
 40336  //  ** btreeParseCellPtrIndex()   =>   index btree nodes
 40337  //  **
 40338  //  ** There is also a wrapper function btreeParseCell() that works for
 40339  //  ** all MemPage types and that references the cell by index rather than
 40340  //  ** by pointer.
 40341  //  */
 40342  func _btreeParseCellPtrNoPayload(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pInfo *XCellInfo) {
 40343  	func() {
 40344  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 40345  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60119), unsafe.Pointer(&_btreeParseCellPtrNoPayloadØ00__func__Ø000), unsafe.Pointer(str(20394)))
 40346  			crt.X__builtin_abort(tls)
 40347  		}
 40348  	}()
 40349  	func() {
 40350  		if int32(_pPage.Xleaf) != int32(0) {
 40351  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60120), unsafe.Pointer(&_btreeParseCellPtrNoPayloadØ00__func__Ø000), unsafe.Pointer(str(53696)))
 40352  			crt.X__builtin_abort(tls)
 40353  		}
 40354  	}()
 40355  	func() {
 40356  		if int32(_pPage.XchildPtrSize) != int32(4) {
 40357  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60121), unsafe.Pointer(&_btreeParseCellPtrNoPayloadØ00__func__Ø000), unsafe.Pointer(str(53600)))
 40358  			crt.X__builtin_abort(tls)
 40359  		}
 40360  	}()
 40361  	_pInfo.XnSize = uint16(int32(4) + int32(_sqlite3GetVarint(tls, elem15(_pCell, uintptr(4)), (*uint64)(unsafe.Pointer(&_pInfo.XnKey)))))
 40362  	_pInfo.XnPayload = 0
 40363  	_pInfo.XnLocal = 0
 40364  	_pInfo.XpPayload = nil
 40365  }
 40366  
 40367  var _btreeParseCellPtrNoPayloadØ00__func__Ø000 [27]int8
 40368  
 40369  func init() {
 40370  	crt.Xstrncpy(nil, &_btreeParseCellPtrNoPayloadØ00__func__Ø000[0], str(53711), 27)
 40371  }
 40372  
 40373  // C comment
 40374  //  /*
 40375  //  ** Read a 64-bit variable-length integer from memory starting at p[0].
 40376  //  ** Return the number of bytes read.  The value is stored in *v.
 40377  //  */
 40378  func _sqlite3GetVarint(tls *crt.TLS, _p *uint8, _v *uint64) (r0 uint8) {
 40379  	var _a, _b, _s uint32
 40380  	_a = uint32(*_p)
 40381  	if (_a & uint32(128)) == 0 {
 40382  		*_v = uint64(_a)
 40383  		return uint8(1)
 40384  	}
 40385  	*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
 40386  	_b = uint32(*_p)
 40387  	if (_b & uint32(128)) == 0 {
 40388  		_a &= uint32(127)
 40389  		_a = _a << 7
 40390  		_a |= _b
 40391  		*_v = uint64(_a)
 40392  		return uint8(2)
 40393  	}
 40394  
 40395  	*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
 40396  	_a = _a << 14
 40397  	_a |= uint32(*_p)
 40398  	if (_a & uint32(128)) == 0 {
 40399  		_a &= uint32(2080895)
 40400  		_b &= uint32(127)
 40401  		_b = _b << 7
 40402  		_a |= _b
 40403  		*_v = uint64(_a)
 40404  		return uint8(3)
 40405  	}
 40406  	_a &= uint32(2080895)
 40407  	*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
 40408  	_b = _b << 14
 40409  	_b |= uint32(*_p)
 40410  	if (_b & uint32(128)) == 0 {
 40411  		_b &= uint32(2080895)
 40412  		_a = _a << 7
 40413  		_a |= _b
 40414  		*_v = uint64(_a)
 40415  		return uint8(4)
 40416  	}
 40417  	_b &= uint32(2080895)
 40418  	_s = _a
 40419  	*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
 40420  	_a = _a << 14
 40421  	_a |= uint32(*_p)
 40422  	if (_a & uint32(128)) == 0 {
 40423  		_b = _b << 7
 40424  		_a |= _b
 40425  		_s = _s >> 18
 40426  		*_v = (uint64(_s) << 32) | uint64(_a)
 40427  		return uint8(5)
 40428  	}
 40429  	_s = _s << 7
 40430  	_s |= _b
 40431  	*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
 40432  	_b = _b << 14
 40433  	_b |= uint32(*_p)
 40434  	if (_b & uint32(128)) == 0 {
 40435  		_a &= uint32(2080895)
 40436  		_a = _a << 7
 40437  		_a |= _b
 40438  		_s = _s >> 18
 40439  		*_v = (uint64(_s) << 32) | uint64(_a)
 40440  		return uint8(6)
 40441  	}
 40442  	*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
 40443  	_a = _a << 14
 40444  	_a |= uint32(*_p)
 40445  	if (_a & uint32(128)) == 0 {
 40446  		_a &= uint32(4028612735)
 40447  		_b &= uint32(2080895)
 40448  		_b = _b << 7
 40449  		_a |= _b
 40450  		_s = _s >> 11
 40451  		*_v = (uint64(_s) << 32) | uint64(_a)
 40452  		return uint8(7)
 40453  	}
 40454  	_a &= uint32(2080895)
 40455  	*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
 40456  	_b = _b << 14
 40457  	_b |= uint32(*_p)
 40458  	if (_b & uint32(128)) == 0 {
 40459  		_b &= uint32(4028612735)
 40460  		_a = _a << 7
 40461  		_a |= _b
 40462  		_s = _s >> 4
 40463  		*_v = (uint64(_s) << 32) | uint64(_a)
 40464  		return uint8(8)
 40465  	}
 40466  	*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
 40467  	_a = _a << 15
 40468  	_a |= uint32(*_p)
 40469  	_b &= uint32(2080895)
 40470  	_b = _b << 8
 40471  	_a |= _b
 40472  	_s = _s << 4
 40473  	_b = uint32(*elem15(_p, uintptr(4294967292)))
 40474  	_b &= uint32(127)
 40475  	_b = _b >> 3
 40476  	_s |= _b
 40477  	*_v = (uint64(_s) << 32) | uint64(_a)
 40478  	return uint8(9)
 40479  }
 40480  
 40481  func _btreeParseCellPtrIndex(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pInfo *XCellInfo) {
 40482  	var _nPayload uint32
 40483  	var _pIter, _1_pEnd *uint8
 40484  	func() {
 40485  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 40486  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60207), unsafe.Pointer(&_btreeParseCellPtrIndexØ00__func__Ø000), unsafe.Pointer(str(20394)))
 40487  			crt.X__builtin_abort(tls)
 40488  		}
 40489  	}()
 40490  	func() {
 40491  		if int32(_pPage.Xleaf) != int32(0) && int32(_pPage.Xleaf) != int32(1) {
 40492  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60208), unsafe.Pointer(&_btreeParseCellPtrIndexØ00__func__Ø000), unsafe.Pointer(str(53508)))
 40493  			crt.X__builtin_abort(tls)
 40494  		}
 40495  	}()
 40496  	func() {
 40497  		if int32(_pPage.XintKeyLeaf) != int32(0) {
 40498  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60209), unsafe.Pointer(&_btreeParseCellPtrIndexØ00__func__Ø000), unsafe.Pointer(str(53738)))
 40499  			crt.X__builtin_abort(tls)
 40500  		}
 40501  	}()
 40502  	_pIter = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell)) + uintptr(_pPage.XchildPtrSize)))
 40503  	_nPayload = uint32(*_pIter)
 40504  	if _nPayload < uint32(128) {
 40505  		goto _7
 40506  	}
 40507  	_1_pEnd = elem15(_pIter, uintptr(8))
 40508  	_nPayload &= uint32(127)
 40509  _8:
 40510  	_nPayload = (_nPayload << 7) | uint32(int32(*preInc15(&_pIter, 1))&int32(127))
 40511  	if (int32(*_pIter) >= int32(128)) && (crt.P2U(unsafe.Pointer(_pIter)) < crt.P2U(unsafe.Pointer(_1_pEnd))) {
 40512  		goto _8
 40513  	}
 40514  _7:
 40515  	*(*uintptr)(unsafe.Pointer(&_pIter)) += uintptr(1)
 40516  	_pInfo.XnKey = int64(_nPayload)
 40517  	_pInfo.XnPayload = _nPayload
 40518  	_pInfo.XpPayload = _pIter
 40519  	if _nPayload > uint32(_pPage.XmaxLocal) {
 40520  		goto _10
 40521  	}
 40522  	_pInfo.XnSize = uint16(_nPayload + uint32(uint16(int32(uintptr(unsafe.Pointer(_pIter))-uintptr(unsafe.Pointer(_pCell))))))
 40523  	if int32(_pInfo.XnSize) < int32(4) {
 40524  		_pInfo.XnSize = uint16(4)
 40525  	}
 40526  	_pInfo.XnLocal = uint16(_nPayload)
 40527  	goto _12
 40528  _10:
 40529  	_btreeParseCellAdjustSizeForOverflow(tls, _pPage, _pCell, _pInfo)
 40530  _12:
 40531  }
 40532  
 40533  var _btreeParseCellPtrIndexØ00__func__Ø000 [23]int8
 40534  
 40535  func init() {
 40536  	crt.Xstrncpy(nil, &_btreeParseCellPtrIndexØ00__func__Ø000[0], str(53759), 23)
 40537  }
 40538  
 40539  // C comment
 40540  //  /*
 40541  //  ** Invoke the busy handler for a btree.
 40542  //  */
 40543  func _btreeInvokeBusyHandler(tls *crt.TLS, _pArg unsafe.Pointer) (r0 int32) {
 40544  	var _pBt *XBtShared
 40545  	_pBt = (*XBtShared)(_pArg)
 40546  	func() {
 40547  		if _pBt.Xdb == nil {
 40548  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61201), unsafe.Pointer(&_btreeInvokeBusyHandlerØ00__func__Ø000), unsafe.Pointer(str(53782)))
 40549  			crt.X__builtin_abort(tls)
 40550  		}
 40551  	}()
 40552  	func() {
 40553  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pBt.Xdb).Xmutex)) == 0 {
 40554  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61202), unsafe.Pointer(&_btreeInvokeBusyHandlerØ00__func__Ø000), unsafe.Pointer(str(53790)))
 40555  			crt.X__builtin_abort(tls)
 40556  		}
 40557  	}()
 40558  	return _sqlite3InvokeBusyHandler(tls, &((*Xsqlite3)(_pBt.Xdb).XbusyHandler))
 40559  }
 40560  
 40561  var _btreeInvokeBusyHandlerØ00__func__Ø000 [23]int8
 40562  
 40563  func init() {
 40564  	crt.Xstrncpy(nil, &_btreeInvokeBusyHandlerØ00__func__Ø000[0], str(53825), 23)
 40565  }
 40566  
 40567  // C comment
 40568  //  /*
 40569  //  ** Invoke the given busy handler.
 40570  //  **
 40571  //  ** This routine is called when an operation failed with a lock.
 40572  //  ** If this routine returns non-zero, the lock is retried.  If it
 40573  //  ** returns 0, the operation aborts with an SQLITE_BUSY error.
 40574  //  */
 40575  func _sqlite3InvokeBusyHandler(tls *crt.TLS, _p *t75) (r0 int32) {
 40576  	var _rc int32
 40577  	if (func() int32 {
 40578  		if _p == nil {
 40579  			return func() int32 {
 40580  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(141968), unsafe.Pointer(&_sqlite3InvokeBusyHandlerØ00__func__Ø000), unsafe.Pointer(str(4809)))
 40581  				crt.X__builtin_abort(tls)
 40582  				return int32(1)
 40583  			}()
 40584  		}
 40585  		return int32(0)
 40586  	}() != 0 || (_p.XxFunc == nil)) || (_p.XnBusy < int32(0)) {
 40587  		return int32(0)
 40588  	}
 40589  	_rc = _p.XxFunc(tls, _p.XpArg, _p.XnBusy)
 40590  	if _rc == int32(0) {
 40591  		_p.XnBusy = int32(-1)
 40592  		goto _6
 40593  	}
 40594  	_p.XnBusy += 1
 40595  _6:
 40596  	return _rc
 40597  }
 40598  
 40599  var _sqlite3InvokeBusyHandlerØ00__func__Ø000 [25]int8
 40600  
 40601  func init() {
 40602  	crt.Xstrncpy(nil, &_sqlite3InvokeBusyHandlerØ00__func__Ø000[0], str(53848), 25)
 40603  }
 40604  
 40605  func _sqlite3PagerOpenSavepoint(tls *crt.TLS, _pPager *XPager, _nSavepoint int32) (r0 int32) {
 40606  	func() {
 40607  		if int32(_pPager.XeState) < int32(2) {
 40608  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53654), unsafe.Pointer(&_sqlite3PagerOpenSavepointØ00__func__Ø000), unsafe.Pointer(str(10935)))
 40609  			crt.X__builtin_abort(tls)
 40610  		}
 40611  	}()
 40612  	func() {
 40613  		if _assert_pager_state(tls, _pPager) == 0 {
 40614  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53655), unsafe.Pointer(&_sqlite3PagerOpenSavepointØ00__func__Ø000), unsafe.Pointer(str(10971)))
 40615  			crt.X__builtin_abort(tls)
 40616  		}
 40617  	}()
 40618  	if (_nSavepoint > _pPager.XnSavepoint) && (_pPager.XuseJournal != 0) {
 40619  		return _pagerOpenSavepoint(tls, _pPager, _nSavepoint)
 40620  	}
 40621  	return int32(0)
 40622  }
 40623  
 40624  var _sqlite3PagerOpenSavepointØ00__func__Ø000 [26]int8
 40625  
 40626  func init() {
 40627  	crt.Xstrncpy(nil, &_sqlite3PagerOpenSavepointØ00__func__Ø000[0], str(53873), 26)
 40628  }
 40629  
 40630  // C comment
 40631  //  /*
 40632  //  ** Check that there are at least nSavepoint savepoints open. If there are
 40633  //  ** currently less than nSavepoints open, then open one or more savepoints
 40634  //  ** to make up the difference. If the number of savepoints is already
 40635  //  ** equal to nSavepoint, then this function is a no-op.
 40636  //  **
 40637  //  ** If a memory allocation fails, SQLITE_NOMEM is returned. If an error
 40638  //  ** occurs while opening the sub-journal file, then an IO error code is
 40639  //  ** returned. Otherwise, SQLITE_OK.
 40640  //  */
 40641  func _pagerOpenSavepoint(tls *crt.TLS, _pPager *XPager, _nSavepoint int32) (r0 int32) {
 40642  	var _rc, _nCurrent, _ii int32
 40643  	var _aNew *XPagerSavepoint
 40644  	_rc = int32(0)
 40645  	_nCurrent = _pPager.XnSavepoint
 40646  	func() {
 40647  		if int32(_pPager.XeState) < int32(2) {
 40648  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53614), unsafe.Pointer(&_pagerOpenSavepointØ00__func__Ø000), unsafe.Pointer(str(10935)))
 40649  			crt.X__builtin_abort(tls)
 40650  		}
 40651  	}()
 40652  	func() {
 40653  		if _assert_pager_state(tls, _pPager) == 0 {
 40654  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53615), unsafe.Pointer(&_pagerOpenSavepointØ00__func__Ø000), unsafe.Pointer(str(10971)))
 40655  			crt.X__builtin_abort(tls)
 40656  		}
 40657  	}()
 40658  	func() {
 40659  		if _nSavepoint <= _nCurrent || _pPager.XuseJournal == 0 {
 40660  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53616), unsafe.Pointer(&_pagerOpenSavepointØ00__func__Ø000), unsafe.Pointer(str(53899)))
 40661  			crt.X__builtin_abort(tls)
 40662  		}
 40663  	}()
 40664  	_aNew = (*XPagerSavepoint)(_sqlite3Realloc(tls, _pPager.XaSavepoint, uint64(uint32(44)*uint32(_nSavepoint))))
 40665  	if _aNew == nil {
 40666  		return _sqlite3NomemError(tls, int32(53626))
 40667  	}
 40668  	crt.Xmemset(tls, unsafe.Pointer(elem31(_aNew, uintptr(_nCurrent))), int32(0), uint32(_nSavepoint-_nCurrent)*uint32(44))
 40669  	*(**XPagerSavepoint)(unsafe.Pointer(&_pPager.XaSavepoint)) = _aNew
 40670  	_ii = _nCurrent
 40671  _8:
 40672  	if _ii >= _nSavepoint {
 40673  		goto _11
 40674  	}
 40675  	elem31(_aNew, uintptr(_ii)).XnOrig = _pPager.XdbSize
 40676  	if ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) != nil) && (_pPager.XjournalOff > (0)) {
 40677  		elem31(_aNew, uintptr(_ii)).XiOffset = _pPager.XjournalOff
 40678  		goto _14
 40679  	}
 40680  	elem31(_aNew, uintptr(_ii)).XiOffset = int64(_pPager.XsectorSize)
 40681  _14:
 40682  	elem31(_aNew, uintptr(_ii)).XiSubRec = _pPager.XnSubRec
 40683  	*(**XBitvec)(unsafe.Pointer(&(elem31(_aNew, uintptr(_ii)).XpInSavepoint))) = _sqlite3BitvecCreate(tls, _pPager.XdbSize)
 40684  	if (elem31(_aNew, uintptr(_ii)).XpInSavepoint) == nil {
 40685  		return _sqlite3NomemError(tls, int32(53642))
 40686  	}
 40687  	if (*XWal)(_pPager.XpWal) != nil {
 40688  		_sqlite3WalSavepoint(tls, (*XWal)(_pPager.XpWal), (*uint32)(unsafe.Pointer(&(elem31(_aNew, uintptr(_ii)).XaWalData))))
 40689  	}
 40690  	_pPager.XnSavepoint = _ii + int32(1)
 40691  	_ii += 1
 40692  	goto _8
 40693  _11:
 40694  	func() {
 40695  		if _pPager.XnSavepoint != _nSavepoint {
 40696  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53649), unsafe.Pointer(&_pagerOpenSavepointØ00__func__Ø000), unsafe.Pointer(str(53941)))
 40697  			crt.X__builtin_abort(tls)
 40698  		}
 40699  	}()
 40700  	_assertTruncateConstraint(tls, _pPager)
 40701  	return _rc
 40702  }
 40703  
 40704  var _pagerOpenSavepointØ00__func__Ø000 [19]int8
 40705  
 40706  func init() {
 40707  	crt.Xstrncpy(nil, &_pagerOpenSavepointØ00__func__Ø000[0], str(53972), 19)
 40708  }
 40709  
 40710  // C comment
 40711  //  /*
 40712  //  ** Argument aWalData must point to an array of WAL_SAVEPOINT_NDATA u32
 40713  //  ** values. This function populates the array with values required to
 40714  //  ** "rollback" the write position of the WAL handle back to the current
 40715  //  ** point in the event of a savepoint rollback (via WalSavepointUndo()).
 40716  //  */
 40717  func _sqlite3WalSavepoint(tls *crt.TLS, _pWal *XWal, _aWalData *uint32) {
 40718  	func() {
 40719  		if _pWal.XwriteLock == 0 {
 40720  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57300), unsafe.Pointer(&_sqlite3WalSavepointØ00__func__Ø000), unsafe.Pointer(str(15561)))
 40721  			crt.X__builtin_abort(tls)
 40722  		}
 40723  	}()
 40724  	*elem7(_aWalData, 0) = _pWal.Xhdr.XmxFrame
 40725  	*elem7(_aWalData, uintptr(1)) = *elem7((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), 0)
 40726  	*elem7(_aWalData, uintptr(2)) = *elem7((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), uintptr(1))
 40727  	*elem7(_aWalData, uintptr(3)) = _pWal.XnCkpt
 40728  }
 40729  
 40730  var _sqlite3WalSavepointØ00__func__Ø000 [20]int8
 40731  
 40732  func init() {
 40733  	crt.Xstrncpy(nil, &_sqlite3WalSavepointØ00__func__Ø000[0], str(53991), 20)
 40734  }
 40735  
 40736  func _assertTruncateConstraint(tls *crt.TLS, _pPager *XPager) {
 40737  	_sqlite3PcacheIterateDirty(tls, (*XPCache)(_pPager.XpPCache), _assertTruncateConstraintCb)
 40738  }
 40739  
 40740  // C comment
 40741  //  /*
 40742  //  ** For all dirty pages currently in the cache, invoke the specified
 40743  //  ** callback. This is only used if the SQLITE_CHECK_PAGES macro is
 40744  //  ** defined.
 40745  //  */
 40746  func _sqlite3PcacheIterateDirty(tls *crt.TLS, _pCache *XPCache, _xIter func(*crt.TLS, *XPgHdr)) {
 40747  	var _pDirty *XPgHdr
 40748  	_pDirty = (*XPgHdr)(_pCache.XpDirty)
 40749  _0:
 40750  	if _pDirty == nil {
 40751  		goto _3
 40752  	}
 40753  	_xIter(tls, _pDirty)
 40754  	_pDirty = (*XPgHdr)(_pDirty.XpDirtyNext)
 40755  	goto _0
 40756  _3:
 40757  }
 40758  
 40759  func _assertTruncateConstraintCb(tls *crt.TLS, _pPg *XPgHdr) {
 40760  	func() {
 40761  		if (int32(_pPg.Xflags) & int32(2)) == 0 {
 40762  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50854), unsafe.Pointer(&_assertTruncateConstraintCbØ00__func__Ø000), unsafe.Pointer(str(54011)))
 40763  			crt.X__builtin_abort(tls)
 40764  		}
 40765  	}()
 40766  	func() {
 40767  		if _subjRequiresPage(tls, _pPg) != 0 && _pPg.Xpgno > ((*XPager)(_pPg.XpPager).XdbSize) {
 40768  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50855), unsafe.Pointer(&_assertTruncateConstraintCbØ00__func__Ø000), unsafe.Pointer(str(54034)))
 40769  			crt.X__builtin_abort(tls)
 40770  		}
 40771  	}()
 40772  }
 40773  
 40774  var _assertTruncateConstraintCbØ00__func__Ø000 [27]int8
 40775  
 40776  func init() {
 40777  	crt.Xstrncpy(nil, &_assertTruncateConstraintCbØ00__func__Ø000[0], str(54091), 27)
 40778  }
 40779  
 40780  // C comment
 40781  //  /*
 40782  //  ** This function may only be called if the b-tree connection already
 40783  //  ** has a read or write transaction open on the database.
 40784  //  **
 40785  //  ** Read the meta-information out of a database file.  Meta[0]
 40786  //  ** is the number of free pages currently in the database.  Meta[1]
 40787  //  ** through meta[15] are available for use by higher layers.  Meta[0]
 40788  //  ** is read-only, the others are read/write.
 40789  //  **
 40790  //  ** The schema layer numbers meta values differently.  At the schema
 40791  //  ** layer (and the SetCookie and ReadCookie opcodes) the number of
 40792  //  ** free pages is not visible.  So Cookie[0] is the same as Meta[1].
 40793  //  **
 40794  //  ** This routine treats Meta[BTREE_DATA_VERSION] as a special case.  Instead
 40795  //  ** of reading the value out of the header, it instead loads the "DataVersion"
 40796  //  ** from the pager.  The BTREE_DATA_VERSION value is not actually stored in the
 40797  //  ** database file.  It is a number computed by the pager.  But its access
 40798  //  ** pattern is the same as header meta values, and so it is convenient to
 40799  //  ** read it from this routine.
 40800  //  */
 40801  func _sqlite3BtreeGetMeta(tls *crt.TLS, _p *XBtree, _idx int32, _pMeta *uint32) {
 40802  	var _pBt *XBtShared
 40803  	_pBt = (*XBtShared)(_p.XpBt)
 40804  	_sqlite3BtreeEnter(tls, _p)
 40805  	func() {
 40806  		if int32(_p.XinTrans) <= int32(0) {
 40807  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67861), unsafe.Pointer(&_sqlite3BtreeGetMetaØ00__func__Ø000), unsafe.Pointer(str(54118)))
 40808  			crt.X__builtin_abort(tls)
 40809  		}
 40810  	}()
 40811  	func() {
 40812  		if int32(0) != _querySharedCacheTableLock(tls, _p, uint32(1), uint8(1)) {
 40813  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67862), unsafe.Pointer(&_sqlite3BtreeGetMetaØ00__func__Ø000), unsafe.Pointer(str(54140)))
 40814  			crt.X__builtin_abort(tls)
 40815  		}
 40816  	}()
 40817  	func() {
 40818  		if _pBt.XpPage1 == nil {
 40819  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67863), unsafe.Pointer(&_sqlite3BtreeGetMetaØ00__func__Ø000), unsafe.Pointer(str(54204)))
 40820  			crt.X__builtin_abort(tls)
 40821  		}
 40822  	}()
 40823  	func() {
 40824  		if _idx < int32(0) || _idx > int32(15) {
 40825  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67864), unsafe.Pointer(&_sqlite3BtreeGetMetaØ00__func__Ø000), unsafe.Pointer(str(54216)))
 40826  			crt.X__builtin_abort(tls)
 40827  		}
 40828  	}()
 40829  	if _idx == int32(15) {
 40830  		*_pMeta = _sqlite3PagerDataVersion(tls, (*XPager)(_pBt.XpPager)) + _p.XiDataVersion
 40831  		goto _10
 40832  	}
 40833  	*_pMeta = _sqlite3Get4byte(tls, elem15((*XMemPage)(_pBt.XpPage1).XaData, uintptr(int32(36)+(_idx*int32(4)))))
 40834  _10:
 40835  	_sqlite3BtreeLeave(tls, _p)
 40836  }
 40837  
 40838  var _sqlite3BtreeGetMetaØ00__func__Ø000 [20]int8
 40839  
 40840  func init() {
 40841  	crt.Xstrncpy(nil, &_sqlite3BtreeGetMetaØ00__func__Ø000[0], str(54234), 20)
 40842  }
 40843  
 40844  // C comment
 40845  //  /*
 40846  //  ** Return the pPager->iDataVersion value
 40847  //  */
 40848  func _sqlite3PagerDataVersion(tls *crt.TLS, _pPager *XPager) (r0 uint32) {
 40849  	func() {
 40850  		if int32(_pPager.XeState) <= int32(0) {
 40851  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48656), unsafe.Pointer(&_sqlite3PagerDataVersionØ00__func__Ø000), unsafe.Pointer(str(54254)))
 40852  			crt.X__builtin_abort(tls)
 40853  		}
 40854  	}()
 40855  	return _pPager.XiDataVersion
 40856  }
 40857  
 40858  var _sqlite3PagerDataVersionØ00__func__Ø000 [24]int8
 40859  
 40860  func init() {
 40861  	crt.Xstrncpy(nil, &_sqlite3PagerDataVersionØ00__func__Ø000[0], str(54280), 24)
 40862  }
 40863  
 40864  // C comment
 40865  //  /*
 40866  //  ** Reset the schema for the database at index iDb.  Also reset the
 40867  //  ** TEMP schema.
 40868  //  */
 40869  func _sqlite3ResetOneSchema(tls *crt.TLS, _db *Xsqlite3, _iDb int32) {
 40870  	var _pDb *XDb
 40871  	func() {
 40872  		if _iDb >= _db.XnDb {
 40873  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100217), unsafe.Pointer(&_sqlite3ResetOneSchemaØ00__func__Ø000), unsafe.Pointer(str(54304)))
 40874  			crt.X__builtin_abort(tls)
 40875  		}
 40876  	}()
 40877  	_pDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb))
 40878  	func() {
 40879  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 40880  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100221), unsafe.Pointer(&_sqlite3ResetOneSchemaØ00__func__Ø000), unsafe.Pointer(str(51126)))
 40881  			crt.X__builtin_abort(tls)
 40882  		}
 40883  	}()
 40884  	func() {
 40885  		if (*XSchema)(_pDb.XpSchema) == nil {
 40886  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100222), unsafe.Pointer(&_sqlite3ResetOneSchemaØ00__func__Ø000), unsafe.Pointer(str(54316)))
 40887  			crt.X__builtin_abort(tls)
 40888  		}
 40889  	}()
 40890  	_sqlite3SchemaClear(tls, _pDb.XpSchema)
 40891  	if _iDb != int32(1) {
 40892  		_pDb = elem27((*XDb)(_db.XaDb), uintptr(1))
 40893  		func() {
 40894  			if (*XSchema)(_pDb.XpSchema) == nil {
 40895  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100231), unsafe.Pointer(&_sqlite3ResetOneSchemaØ00__func__Ø000), unsafe.Pointer(str(54316)))
 40896  				crt.X__builtin_abort(tls)
 40897  			}
 40898  		}()
 40899  		_sqlite3SchemaClear(tls, _pDb.XpSchema)
 40900  	}
 40901  }
 40902  
 40903  var _sqlite3ResetOneSchemaØ00__func__Ø000 [22]int8
 40904  
 40905  func init() {
 40906  	crt.Xstrncpy(nil, &_sqlite3ResetOneSchemaØ00__func__Ø000[0], str(54332), 22)
 40907  }
 40908  
 40909  // C comment
 40910  //  /*
 40911  //  ** Do both phases of a commit.
 40912  //  */
 40913  func _sqlite3BtreeCommit(tls *crt.TLS, _p *XBtree) (r0 int32) {
 40914  	var _rc int32
 40915  	_sqlite3BtreeEnter(tls, _p)
 40916  	_rc = _sqlite3BtreeCommitPhaseOne(tls, _p, nil)
 40917  	if _rc == int32(0) {
 40918  		_rc = _sqlite3BtreeCommitPhaseTwo(tls, _p, int32(0))
 40919  	}
 40920  	_sqlite3BtreeLeave(tls, _p)
 40921  	return _rc
 40922  }
 40923  
 40924  // C comment
 40925  //  /*
 40926  //  ** This routine does the first phase of a two-phase commit.  This routine
 40927  //  ** causes a rollback journal to be created (if it does not already exist)
 40928  //  ** and populated with enough information so that if a power loss occurs
 40929  //  ** the database can be restored to its original state by playing back
 40930  //  ** the journal.  Then the contents of the journal are flushed out to
 40931  //  ** the disk.  After the journal is safely on oxide, the changes to the
 40932  //  ** database are written into the database file and flushed to oxide.
 40933  //  ** At the end of this call, the rollback journal still exists on the
 40934  //  ** disk and we are still holding all locks, so the transaction has not
 40935  //  ** committed.  See sqlite3BtreeCommitPhaseTwo() for the second phase of the
 40936  //  ** commit process.
 40937  //  **
 40938  //  ** This call is a no-op if no write-transaction is currently active on pBt.
 40939  //  **
 40940  //  ** Otherwise, sync the database file for the btree pBt. zMaster points to
 40941  //  ** the name of a master journal file that should be written into the
 40942  //  ** individual journal file, or is NULL, indicating no master journal file
 40943  //  ** (single database transaction).
 40944  //  **
 40945  //  ** When this is called, the master journal should already have been
 40946  //  ** created, populated with this journal pointer and synced to disk.
 40947  //  **
 40948  //  ** Once this is routine has returned, the only thing required to commit
 40949  //  ** the write-transaction for this database file is to delete the journal.
 40950  //  */
 40951  func _sqlite3BtreeCommitPhaseOne(tls *crt.TLS, _p *XBtree, _zMaster *int8) (r0 int32) {
 40952  	var _rc int32
 40953  	var _1_pBt *XBtShared
 40954  	_rc = int32(0)
 40955  	if int32(_p.XinTrans) != int32(2) {
 40956  		goto _0
 40957  	}
 40958  	_1_pBt = (*XBtShared)(_p.XpBt)
 40959  	_sqlite3BtreeEnter(tls, _p)
 40960  	if _1_pBt.XautoVacuum == 0 {
 40961  		goto _1
 40962  	}
 40963  	_rc = _autoVacuumCommit(tls, _1_pBt)
 40964  	if _rc != int32(0) {
 40965  		_sqlite3BtreeLeave(tls, _p)
 40966  		return _rc
 40967  	}
 40968  _1:
 40969  	if _1_pBt.XbDoTruncate != 0 {
 40970  		_sqlite3PagerTruncateImage(tls, (*XPager)(_1_pBt.XpPager), _1_pBt.XnPage)
 40971  	}
 40972  	_rc = _sqlite3PagerCommitPhaseOne(tls, (*XPager)(_1_pBt.XpPager), _zMaster, int32(0))
 40973  	_sqlite3BtreeLeave(tls, _p)
 40974  _0:
 40975  	return _rc
 40976  }
 40977  
 40978  // C comment
 40979  //  /*
 40980  //  ** This routine is called prior to sqlite3PagerCommit when a transaction
 40981  //  ** is committed for an auto-vacuum database.
 40982  //  **
 40983  //  ** If SQLITE_OK is returned, then *pnTrunc is set to the number of pages
 40984  //  ** the database file should be truncated to during the commit process.
 40985  //  ** i.e. the database has been reorganized so that only the first *pnTrunc
 40986  //  ** pages are in use.
 40987  //  */
 40988  func _autoVacuumCommit(tls *crt.TLS, _pBt *XBtShared) (r0 int32) {
 40989  	var _rc, _nRef int32
 40990  	var _1_nFin, _1_nFree, _1_iFree, _1_nOrig uint32
 40991  	var _pPager *XPager
 40992  	_rc = int32(0)
 40993  	_pPager = (*XPager)(_pBt.XpPager)
 40994  	_nRef = _sqlite3PagerRefcount(tls, _pPager)
 40995  	func() {
 40996  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 40997  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62757), unsafe.Pointer(&_autoVacuumCommitØ00__func__Ø000), unsafe.Pointer(str(9235)))
 40998  			crt.X__builtin_abort(tls)
 40999  		}
 41000  	}()
 41001  	_invalidateAllOverflowCache(tls, _pBt)
 41002  	func() {
 41003  		if _pBt.XautoVacuum == 0 {
 41004  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62759), unsafe.Pointer(&_autoVacuumCommitØ00__func__Ø000), unsafe.Pointer(str(54354)))
 41005  			crt.X__builtin_abort(tls)
 41006  		}
 41007  	}()
 41008  	if _pBt.XincrVacuum != 0 {
 41009  		goto _4
 41010  	}
 41011  	_1_nOrig = _btreePagecount(tls, _pBt)
 41012  	if (_ptrmapPageno(tls, _pBt, _1_nOrig) == _1_nOrig) || (_1_nOrig == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1))) {
 41013  		return _sqlite3CorruptError(tls, int32(62772))
 41014  	}
 41015  	_1_nFree = _sqlite3Get4byte(tls, elem15((*XMemPage)(_pBt.XpPage1).XaData, uintptr(36)))
 41016  	_1_nFin = _finalDbSize(tls, _pBt, _1_nOrig, _1_nFree)
 41017  	if _1_nFin > _1_nOrig {
 41018  		return _sqlite3CorruptError(tls, int32(62777))
 41019  	}
 41020  	if _1_nFin < _1_nOrig {
 41021  		_rc = _saveAllCursors(tls, _pBt, 0, nil)
 41022  	}
 41023  	_1_iFree = _1_nOrig
 41024  _9:
 41025  	if _1_iFree <= _1_nFin || _rc != int32(0) {
 41026  		goto _13
 41027  	}
 41028  	_rc = _incrVacuumStep(tls, _pBt, _1_nFin, _1_iFree, int32(1))
 41029  	_1_iFree -= 1
 41030  	goto _9
 41031  _13:
 41032  	if ((_rc == int32(101)) || (_rc == int32(0))) && (_1_nFree > (0)) {
 41033  		_rc = _sqlite3PagerWrite(tls, (*XPgHdr)((*XMemPage)(_pBt.XpPage1).XpDbPage))
 41034  		_sqlite3Put4byte(tls, elem15((*XMemPage)(_pBt.XpPage1).XaData, uintptr(32)), 0)
 41035  		_sqlite3Put4byte(tls, elem15((*XMemPage)(_pBt.XpPage1).XaData, uintptr(36)), 0)
 41036  		_sqlite3Put4byte(tls, elem15((*XMemPage)(_pBt.XpPage1).XaData, uintptr(28)), _1_nFin)
 41037  		_pBt.XbDoTruncate = uint8(1)
 41038  		_pBt.XnPage = _1_nFin
 41039  	}
 41040  	if _rc != int32(0) {
 41041  		_sqlite3PagerRollback(tls, _pPager)
 41042  	}
 41043  _4:
 41044  	func() {
 41045  		if _nRef < _sqlite3PagerRefcount(tls, _pPager) {
 41046  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62797), unsafe.Pointer(&_autoVacuumCommitØ00__func__Ø000), unsafe.Pointer(str(54370)))
 41047  			crt.X__builtin_abort(tls)
 41048  		}
 41049  	}()
 41050  	return _rc
 41051  }
 41052  
 41053  var _autoVacuumCommitØ00__func__Ø000 [17]int8
 41054  
 41055  func init() {
 41056  	crt.Xstrncpy(nil, &_autoVacuumCommitØ00__func__Ø000[0], str(54405), 17)
 41057  }
 41058  
 41059  // C comment
 41060  //  /*
 41061  //  ** Invalidate the overflow page-list cache for all cursors opened
 41062  //  ** on the shared btree structure pBt.
 41063  //  */
 41064  func _invalidateAllOverflowCache(tls *crt.TLS, _pBt *XBtShared) {
 41065  	var _p *XBtCursor
 41066  	func() {
 41067  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 41068  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59514), unsafe.Pointer(&_invalidateAllOverflowCacheØ00__func__Ø000), unsafe.Pointer(str(9235)))
 41069  			crt.X__builtin_abort(tls)
 41070  		}
 41071  	}()
 41072  	_p = (*XBtCursor)(_pBt.XpCursor)
 41073  _2:
 41074  	if _p == nil {
 41075  		goto _5
 41076  	}
 41077  	{
 41078  		p := &_p.XcurFlags
 41079  		*p = uint8(int32(*p) & int32(-5))
 41080  	}
 41081  	_p = (*XBtCursor)(_p.XpNext)
 41082  	goto _2
 41083  _5:
 41084  }
 41085  
 41086  var _invalidateAllOverflowCacheØ00__func__Ø000 [27]int8
 41087  
 41088  func init() {
 41089  	crt.Xstrncpy(nil, &_invalidateAllOverflowCacheØ00__func__Ø000[0], str(54422), 27)
 41090  }
 41091  
 41092  // C comment
 41093  //  /*
 41094  //  ** The database opened by the first argument is an auto-vacuum database
 41095  //  ** nOrig pages in size containing nFree free pages. Return the expected
 41096  //  ** size of the database in pages following an auto-vacuum operation.
 41097  //  */
 41098  func _finalDbSize(tls *crt.TLS, _pBt *XBtShared, _nOrig uint32, _nFree uint32) (r0 uint32) {
 41099  	var _nEntry int32
 41100  	var _nPtrmap, _nFin uint32
 41101  	_nEntry = int32(_pBt.XusableSize / uint32(5))
 41102  	_nPtrmap = (((_nFree - _nOrig) + _ptrmapPageno(tls, _pBt, _nOrig)) + uint32(_nEntry)) / uint32(_nEntry)
 41103  	_nFin = (_nOrig - _nFree) - _nPtrmap
 41104  	if (_nOrig > ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1))) && (_nFin < ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1))) {
 41105  		_nFin -= 1
 41106  	}
 41107  _1:
 41108  	if (_ptrmapPageno(tls, _pBt, _nFin) == _nFin) || (_nFin == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1))) {
 41109  		_nFin -= 1
 41110  		goto _1
 41111  	}
 41112  	return _nFin
 41113  }
 41114  
 41115  // C comment
 41116  //  /*
 41117  //  ** Perform a single step of an incremental-vacuum. If successful, return
 41118  //  ** SQLITE_OK. If there is no work to do (and therefore no point in
 41119  //  ** calling this function again), return SQLITE_DONE. Or, if an error
 41120  //  ** occurs, return some other error code.
 41121  //  **
 41122  //  ** More specifically, this function attempts to re-organize the database so
 41123  //  ** that the last page of the file currently in use is no longer in use.
 41124  //  **
 41125  //  ** Parameter nFin is the number of pages that this database would contain
 41126  //  ** were this function called until it returns SQLITE_DONE.
 41127  //  **
 41128  //  ** If the bCommit parameter is non-zero, this function assumes that the
 41129  //  ** caller will keep calling incrVacuumStep() until it returns SQLITE_DONE
 41130  //  ** or an error. bCommit is passed true for an auto-vacuum-on-commit
 41131  //  ** operation, or false for an incremental vacuum.
 41132  //  */
 41133  func _incrVacuumStep(tls *crt.TLS, _pBt *XBtShared, _nFin uint32, _iLastPg uint32, _bCommit int32) (r0 int32) {
 41134  	var _rc int32
 41135  	var _nFreeList, _1_iPtrPage, _6_iFreePg, _8_iFreePg, _8_iNear uint32
 41136  	var _1_eType, _8_eMode uint8
 41137  	var _6_pFreePg, _8_pLastPg, _11_pFreePg *XMemPage
 41138  	func() {
 41139  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 41140  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62592), unsafe.Pointer(&_incrVacuumStepØ00__func__Ø000), unsafe.Pointer(str(9235)))
 41141  			crt.X__builtin_abort(tls)
 41142  		}
 41143  	}()
 41144  	func() {
 41145  		if _iLastPg <= _nFin {
 41146  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62593), unsafe.Pointer(&_incrVacuumStepØ00__func__Ø000), unsafe.Pointer(str(54449)))
 41147  			crt.X__builtin_abort(tls)
 41148  		}
 41149  	}()
 41150  	if _ptrmapPageno(tls, _pBt, _iLastPg) == _iLastPg || _iLastPg == ((uint32(_sqlite3PendingByte)/_pBt.XpageSize)+uint32(1)) {
 41151  		goto _5
 41152  	}
 41153  	_nFreeList = _sqlite3Get4byte(tls, elem15((*XMemPage)(_pBt.XpPage1).XaData, uintptr(36)))
 41154  	if _nFreeList == (0) {
 41155  		return int32(101)
 41156  	}
 41157  	_rc = _ptrmapGet(tls, _pBt, _iLastPg, &_1_eType, &_1_iPtrPage)
 41158  	if _rc != int32(0) {
 41159  		return _rc
 41160  	}
 41161  	if int32(_1_eType) == int32(1) {
 41162  		return _sqlite3CorruptError(tls, int32(62609))
 41163  	}
 41164  	if int32(_1_eType) != int32(2) {
 41165  		goto _9
 41166  	}
 41167  	if _bCommit != int32(0) {
 41168  		goto _10
 41169  	}
 41170  	_rc = _allocateBtreePage(tls, _pBt, &_6_pFreePg, &_6_iFreePg, _iLastPg, uint8(1))
 41171  	if _rc != int32(0) {
 41172  		return _rc
 41173  	}
 41174  	func() {
 41175  		if _6_iFreePg != _iLastPg {
 41176  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62625), unsafe.Pointer(&_incrVacuumStepØ00__func__Ø000), unsafe.Pointer(str(54462)))
 41177  			crt.X__builtin_abort(tls)
 41178  		}
 41179  	}()
 41180  	_releasePage(tls, _6_pFreePg)
 41181  _10:
 41182  	goto _14
 41183  _9:
 41184  	_8_eMode = uint8(0)
 41185  	_8_iNear = uint32(0)
 41186  	_rc = _btreeGetPage(tls, _pBt, _iLastPg, &_8_pLastPg, int32(0))
 41187  	if _rc != int32(0) {
 41188  		return _rc
 41189  	}
 41190  	if _bCommit == int32(0) {
 41191  		_8_eMode = uint8(2)
 41192  		_8_iNear = _nFin
 41193  	}
 41194  _16:
 41195  	_rc = _allocateBtreePage(tls, _pBt, &_11_pFreePg, &_8_iFreePg, _8_iNear, _8_eMode)
 41196  	if _rc != int32(0) {
 41197  		_releasePage(tls, _8_pLastPg)
 41198  		return _rc
 41199  	}
 41200  	_releasePage(tls, _11_pFreePg)
 41201  	if _bCommit != 0 && (_8_iFreePg > _nFin) {
 41202  		goto _16
 41203  	}
 41204  	func() {
 41205  		if _8_iFreePg >= _iLastPg {
 41206  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62659), unsafe.Pointer(&_incrVacuumStepØ00__func__Ø000), unsafe.Pointer(str(54479)))
 41207  			crt.X__builtin_abort(tls)
 41208  		}
 41209  	}()
 41210  	_rc = _relocatePage(tls, _pBt, _8_pLastPg, _1_eType, _1_iPtrPage, _8_iFreePg, _bCommit)
 41211  	_releasePage(tls, _8_pLastPg)
 41212  	if _rc != int32(0) {
 41213  		return _rc
 41214  	}
 41215  _14:
 41216  _5:
 41217  	if _bCommit != int32(0) {
 41218  		goto _23
 41219  	}
 41220  _24:
 41221  	_iLastPg -= 1
 41222  	if (_iLastPg == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1))) || (_ptrmapPageno(tls, _pBt, _iLastPg) == _iLastPg) {
 41223  		goto _24
 41224  	}
 41225  	_pBt.XbDoTruncate = uint8(1)
 41226  	_pBt.XnPage = _iLastPg
 41227  _23:
 41228  	return int32(0)
 41229  }
 41230  
 41231  var _incrVacuumStepØ00__func__Ø000 [15]int8
 41232  
 41233  func init() {
 41234  	crt.Xstrncpy(nil, &_incrVacuumStepØ00__func__Ø000[0], str(54495), 15)
 41235  }
 41236  
 41237  // C comment
 41238  //  /*
 41239  //  ** Allocate a new page from the database file.
 41240  //  **
 41241  //  ** The new page is marked as dirty.  (In other words, sqlite3PagerWrite()
 41242  //  ** has already been called on the new page.)  The new page has also
 41243  //  ** been referenced and the calling routine is responsible for calling
 41244  //  ** sqlite3PagerUnref() on the new page when it is done.
 41245  //  **
 41246  //  ** SQLITE_OK is returned on success.  Any other return value indicates
 41247  //  ** an error.  *ppPage is set to NULL in the event of an error.
 41248  //  **
 41249  //  ** If the "nearby" parameter is not 0, then an effort is made to
 41250  //  ** locate a page close to the page number "nearby".  This can be used in an
 41251  //  ** attempt to keep related pages close to each other in the database file,
 41252  //  ** which in turn can make database access faster.
 41253  //  **
 41254  //  ** If the eMode parameter is BTALLOC_EXACT and the nearby page exists
 41255  //  ** anywhere on the free-list, then it is guaranteed to be returned.  If
 41256  //  ** eMode is BTALLOC_LT then the page returned will be less than or equal
 41257  //  ** to nearby if any such page exists.  If eMode is BTALLOC_ANY then there
 41258  //  ** are no restrictions on which page is returned.
 41259  //  */
 41260  func _allocateBtreePage(tls *crt.TLS, _pBt *XBtShared, _ppPage **XMemPage, _pPgno *uint32, _nearby uint32, _eMode uint8) (r0 int32) {
 41261  	var _rc, _34_dist, _35_d2, _39_noContent, _43_bNoContent int32
 41262  	var _n, _k, _mxPage, _2_iTrunk, _2_nSearch, _22_iNewTrunk, _29_closest, _29_iPage, _30_i uint32
 41263  	var _2_searchList, _4_eType uint8
 41264  	var _29_aData *uint8
 41265  	var _pPage1, _pTrunk, _pPrevTrunk, _22_pNewTrunk, _44_pPg *XMemPage
 41266  	_pTrunk = nil
 41267  	_pPrevTrunk = nil
 41268  	func() {
 41269  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 41270  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64690), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(9235)))
 41271  			crt.X__builtin_abort(tls)
 41272  		}
 41273  	}()
 41274  	func() {
 41275  		if int32(_eMode) != int32(0) && (_nearby <= (0) || _pBt.XautoVacuum == 0) {
 41276  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64691), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(54510)))
 41277  			crt.X__builtin_abort(tls)
 41278  		}
 41279  	}()
 41280  	_pPage1 = (*XMemPage)(_pBt.XpPage1)
 41281  	_mxPage = _btreePagecount(tls, _pBt)
 41282  	_n = _sqlite3Get4byte(tls, elem15(_pPage1.XaData, uintptr(36)))
 41283  	if _n >= _mxPage {
 41284  		return _sqlite3CorruptError(tls, int32(64699))
 41285  	}
 41286  	if _n <= (0) {
 41287  		goto _7
 41288  	}
 41289  	_2_searchList = uint8(0)
 41290  	_2_nSearch = uint32(0)
 41291  	if int32(_eMode) != int32(1) {
 41292  		goto _8
 41293  	}
 41294  	if _nearby > _mxPage {
 41295  		goto _9
 41296  	}
 41297  	func() {
 41298  		if _nearby <= (0) {
 41299  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64715), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(54575)))
 41300  			crt.X__builtin_abort(tls)
 41301  		}
 41302  	}()
 41303  	func() {
 41304  		if _pBt.XautoVacuum == 0 {
 41305  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64716), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(54354)))
 41306  			crt.X__builtin_abort(tls)
 41307  		}
 41308  	}()
 41309  	_rc = _ptrmapGet(tls, _pBt, _nearby, &_4_eType, nil)
 41310  	if _rc != 0 {
 41311  		return _rc
 41312  	}
 41313  	if int32(_4_eType) == int32(2) {
 41314  		_2_searchList = uint8(1)
 41315  	}
 41316  _9:
 41317  	goto _17
 41318  _8:
 41319  	if int32(_eMode) == int32(2) {
 41320  		_2_searchList = uint8(1)
 41321  	}
 41322  _17:
 41323  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage1.XpDbPage))
 41324  	if _rc != 0 {
 41325  		return _rc
 41326  	}
 41327  	_sqlite3Put4byte(tls, elem15(_pPage1.XaData, uintptr(36)), _n-uint32(1))
 41328  _19:
 41329  	_pPrevTrunk = _pTrunk
 41330  	if _pPrevTrunk != nil {
 41331  		_2_iTrunk = _sqlite3Get4byte(tls, elem15(_pPrevTrunk.XaData, 0))
 41332  		goto _21
 41333  	}
 41334  	_2_iTrunk = _sqlite3Get4byte(tls, elem15(_pPage1.XaData, uintptr(32)))
 41335  _21:
 41336  	if (_2_iTrunk > _mxPage) || (postInc23(&_2_nSearch, uint32(1)) > _n) {
 41337  		_rc = _sqlite3CorruptError(tls, int32(64755))
 41338  		goto _24
 41339  	}
 41340  	_rc = _btreeGetUnusedPage(tls, _pBt, _2_iTrunk, &_pTrunk, int32(0))
 41341  _24:
 41342  	if _rc != 0 {
 41343  		_pTrunk = nil
 41344  		goto _end_allocate_page
 41345  	}
 41346  	func() {
 41347  		if _pTrunk == nil {
 41348  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64763), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(54584)))
 41349  			crt.X__builtin_abort(tls)
 41350  		}
 41351  	}()
 41352  	func() {
 41353  		if _pTrunk.XaData == nil {
 41354  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64764), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(54594)))
 41355  			crt.X__builtin_abort(tls)
 41356  		}
 41357  	}()
 41358  	_k = _sqlite3Get4byte(tls, elem15(_pTrunk.XaData, uintptr(4)))
 41359  	if _k != (0) || _2_searchList != 0 {
 41360  		goto _31
 41361  	}
 41362  	func() {
 41363  		if _pPrevTrunk != nil {
 41364  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64772), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(54611)))
 41365  			crt.X__builtin_abort(tls)
 41366  		}
 41367  	}()
 41368  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pTrunk.XpDbPage))
 41369  	if _rc != 0 {
 41370  		goto _end_allocate_page
 41371  	}
 41372  	*_pPgno = _2_iTrunk
 41373  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_pPage1.XaData, uintptr(32))), unsafe.Pointer(elem15(_pTrunk.XaData, 0)), uint32(4))
 41374  	*_ppPage = _pTrunk
 41375  	_pTrunk = nil
 41376  	goto _57
 41377  _31:
 41378  	if _k > ((_pBt.XusableSize / uint32(4)) - uint32(2)) {
 41379  		_rc = _sqlite3CorruptError(tls, int32(64784))
 41380  		goto _end_allocate_page
 41381  	}
 41382  	if _2_searchList == 0 || _nearby != _2_iTrunk && (_2_iTrunk >= _nearby || int32(_eMode) != int32(2)) {
 41383  		goto _41
 41384  	}
 41385  	*_pPgno = _2_iTrunk
 41386  	*_ppPage = _pTrunk
 41387  	_2_searchList = 0
 41388  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pTrunk.XpDbPage))
 41389  	if _rc != 0 {
 41390  		goto _end_allocate_page
 41391  	}
 41392  	if _k != (0) {
 41393  		goto _43
 41394  	}
 41395  	if _pPrevTrunk == nil {
 41396  		crt.Xmemcpy(tls, unsafe.Pointer(elem15(_pPage1.XaData, uintptr(32))), unsafe.Pointer(elem15(_pTrunk.XaData, 0)), uint32(4))
 41397  		goto _45
 41398  	}
 41399  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPrevTrunk.XpDbPage))
 41400  	if _rc != int32(0) {
 41401  		goto _end_allocate_page
 41402  	}
 41403  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_pPrevTrunk.XaData, 0)), unsafe.Pointer(elem15(_pTrunk.XaData, 0)), uint32(4))
 41404  _45:
 41405  	goto _47
 41406  _43:
 41407  	_22_iNewTrunk = _sqlite3Get4byte(tls, elem15(_pTrunk.XaData, uintptr(8)))
 41408  	if _22_iNewTrunk > _mxPage {
 41409  		_rc = _sqlite3CorruptError(tls, int32(64818))
 41410  		goto _end_allocate_page
 41411  	}
 41412  	_rc = _btreeGetUnusedPage(tls, _pBt, _22_iNewTrunk, &_22_pNewTrunk, int32(0))
 41413  	if _rc != int32(0) {
 41414  		goto _end_allocate_page
 41415  	}
 41416  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_22_pNewTrunk.XpDbPage))
 41417  	if _rc != int32(0) {
 41418  		_releasePage(tls, _22_pNewTrunk)
 41419  		goto _end_allocate_page
 41420  	}
 41421  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_22_pNewTrunk.XaData, 0)), unsafe.Pointer(elem15(_pTrunk.XaData, 0)), uint32(4))
 41422  	_sqlite3Put4byte(tls, elem15(_22_pNewTrunk.XaData, uintptr(4)), _k-uint32(1))
 41423  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_22_pNewTrunk.XaData, uintptr(8))), unsafe.Pointer(elem15(_pTrunk.XaData, uintptr(12))), (_k-uint32(1))*uint32(4))
 41424  	_releasePage(tls, _22_pNewTrunk)
 41425  	if _pPrevTrunk == nil {
 41426  		func() {
 41427  			if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage1.XpDbPage)) == 0 {
 41428  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64836), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(54625)))
 41429  				crt.X__builtin_abort(tls)
 41430  			}
 41431  		}()
 41432  		_sqlite3Put4byte(tls, elem15(_pPage1.XaData, uintptr(32)), _22_iNewTrunk)
 41433  		goto _54
 41434  	}
 41435  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPrevTrunk.XpDbPage))
 41436  	if _rc != 0 {
 41437  		goto _end_allocate_page
 41438  	}
 41439  	_sqlite3Put4byte(tls, elem15(_pPrevTrunk.XaData, 0), _22_iNewTrunk)
 41440  _54:
 41441  _47:
 41442  	_pTrunk = nil
 41443  	goto _57
 41444  _41:
 41445  	if _k <= (0) {
 41446  		goto _57
 41447  	}
 41448  	_29_aData = _pTrunk.XaData
 41449  	if _nearby <= (0) {
 41450  		goto _58
 41451  	}
 41452  	_29_closest = 0
 41453  	if int32(_eMode) != int32(2) {
 41454  		goto _59
 41455  	}
 41456  	_30_i = 0
 41457  _60:
 41458  	if _30_i >= _k {
 41459  		goto _63
 41460  	}
 41461  	_29_iPage = _sqlite3Get4byte(tls, elem15(_29_aData, uintptr(uint32(8)+(_30_i*uint32(4)))))
 41462  	if _29_iPage <= _nearby {
 41463  		_29_closest = _30_i
 41464  		goto _63
 41465  	}
 41466  	_30_i += 1
 41467  	goto _60
 41468  _63:
 41469  	goto _65
 41470  _59:
 41471  	_34_dist = _sqlite3AbsInt32(tls, int32(_sqlite3Get4byte(tls, elem15(_29_aData, uintptr(8)))-_nearby))
 41472  	_30_i = uint32(1)
 41473  _66:
 41474  	if _30_i >= _k {
 41475  		goto _69
 41476  	}
 41477  	_35_d2 = _sqlite3AbsInt32(tls, int32(_sqlite3Get4byte(tls, elem15(_29_aData, uintptr(uint32(8)+(_30_i*uint32(4)))))-_nearby))
 41478  	if _35_d2 < _34_dist {
 41479  		_29_closest = _30_i
 41480  		_34_dist = _35_d2
 41481  	}
 41482  	_30_i += 1
 41483  	goto _66
 41484  _69:
 41485  _65:
 41486  	goto _71
 41487  _58:
 41488  	_29_closest = 0
 41489  _71:
 41490  	_29_iPage = _sqlite3Get4byte(tls, elem15(_29_aData, uintptr(uint32(8)+(_29_closest*uint32(4)))))
 41491  	if _29_iPage > _mxPage {
 41492  		_rc = _sqlite3CorruptError(tls, int32(64883))
 41493  		goto _end_allocate_page
 41494  	}
 41495  	if _2_searchList != 0 && (_29_iPage != _nearby && (_29_iPage >= _nearby || int32(_eMode) != int32(2))) {
 41496  		goto _76
 41497  	}
 41498  	*_pPgno = _29_iPage
 41499  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pTrunk.XpDbPage))
 41500  	if _rc != 0 {
 41501  		goto _end_allocate_page
 41502  	}
 41503  	if _29_closest < (_k - uint32(1)) {
 41504  		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))))), uint32(4))
 41505  	}
 41506  	_sqlite3Put4byte(tls, elem15(_29_aData, uintptr(4)), _k-uint32(1))
 41507  	_39_noContent = func() int32 {
 41508  		if _btreeGetHasContent(tls, _pBt, *_pPgno) == 0 {
 41509  			return int32(1)
 41510  		}
 41511  		return int32(0)
 41512  	}()
 41513  	_rc = _btreeGetUnusedPage(tls, _pBt, *_pPgno, _ppPage, _39_noContent)
 41514  	if _rc != int32(0) {
 41515  		goto _81
 41516  	}
 41517  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)((*_ppPage).XpDbPage))
 41518  	if _rc != int32(0) {
 41519  		_releasePage(tls, *_ppPage)
 41520  		*_ppPage = nil
 41521  	}
 41522  _81:
 41523  	_2_searchList = 0
 41524  _76:
 41525  _57:
 41526  	_releasePage(tls, _pPrevTrunk)
 41527  	_pPrevTrunk = nil
 41528  	if _2_searchList != 0 {
 41529  		goto _19
 41530  	}
 41531  	goto _83
 41532  _7:
 41533  	_43_bNoContent = func() int32 {
 41534  		if int32(0) == int32(_pBt.XbDoTruncate) {
 41535  			return int32(1)
 41536  		}
 41537  		return int32(0)
 41538  	}()
 41539  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)((*XMemPage)(_pBt.XpPage1).XpDbPage))
 41540  	if _rc != 0 {
 41541  		return _rc
 41542  	}
 41543  	_pBt.XnPage += 1
 41544  	if _pBt.XnPage == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1)) {
 41545  		_pBt.XnPage += 1
 41546  	}
 41547  	if _pBt.XautoVacuum == 0 || _ptrmapPageno(tls, _pBt, _pBt.XnPage) != _pBt.XnPage {
 41548  		goto _89
 41549  	}
 41550  	_44_pPg = nil
 41551  	func() {
 41552  		if _pBt.XnPage == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1)) {
 41553  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64950), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(54666)))
 41554  			crt.X__builtin_abort(tls)
 41555  		}
 41556  	}()
 41557  	_rc = _btreeGetUnusedPage(tls, _pBt, _pBt.XnPage, &_44_pPg, _43_bNoContent)
 41558  	if _rc == int32(0) {
 41559  		_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_44_pPg.XpDbPage))
 41560  		_releasePage(tls, _44_pPg)
 41561  	}
 41562  	if _rc != 0 {
 41563  		return _rc
 41564  	}
 41565  	_pBt.XnPage += 1
 41566  	if _pBt.XnPage == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1)) {
 41567  		_pBt.XnPage += 1
 41568  	}
 41569  _89:
 41570  	_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(int32(28))+uintptr(unsafe.Pointer((*XMemPage)(_pBt.XpPage1).XaData)))), _pBt.XnPage)
 41571  	*_pPgno = _pBt.XnPage
 41572  	func() {
 41573  		if (*_pPgno) == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1)) {
 41574  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64964), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(54701)))
 41575  			crt.X__builtin_abort(tls)
 41576  		}
 41577  	}()
 41578  	_rc = _btreeGetUnusedPage(tls, _pBt, *_pPgno, _ppPage, _43_bNoContent)
 41579  	if _rc != 0 {
 41580  		return _rc
 41581  	}
 41582  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)((*_ppPage).XpDbPage))
 41583  	if _rc != int32(0) {
 41584  		_releasePage(tls, *_ppPage)
 41585  		*_ppPage = nil
 41586  	}
 41587  _83:
 41588  	func() {
 41589  		if (*_pPgno) == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1)) {
 41590  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64975), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(54701)))
 41591  			crt.X__builtin_abort(tls)
 41592  		}
 41593  	}()
 41594  _end_allocate_page:
 41595  	_releasePage(tls, _pTrunk)
 41596  	_releasePage(tls, _pPrevTrunk)
 41597  	func() {
 41598  		if _rc == int32(0) && _sqlite3PagerPageRefcount(tls, (*XPgHdr)((*_ppPage).XpDbPage)) > int32(1) {
 41599  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64980), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(54732)))
 41600  			crt.X__builtin_abort(tls)
 41601  		}
 41602  	}()
 41603  	func() {
 41604  		if _rc == int32(0) && int32((*_ppPage).XisInit) != int32(0) {
 41605  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64981), unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000), unsafe.Pointer(str(54797)))
 41606  			crt.X__builtin_abort(tls)
 41607  		}
 41608  	}()
 41609  	return _rc
 41610  
 41611  	_ = _2_nSearch
 41612  	panic(0)
 41613  }
 41614  
 41615  var _allocateBtreePageØ00__func__Ø000 [18]int8
 41616  
 41617  func init() {
 41618  	crt.Xstrncpy(nil, &_allocateBtreePageØ00__func__Ø000[0], str(54835), 18)
 41619  }
 41620  
 41621  // C comment
 41622  //  /*
 41623  //  ** Get an unused page.
 41624  //  **
 41625  //  ** This works just like btreeGetPage() with the addition:
 41626  //  **
 41627  //  **   *  If the page is already in use for some other purpose, immediately
 41628  //  **      release it and return an SQLITE_CURRUPT error.
 41629  //  **   *  Make sure the isInit flag is clear
 41630  //  */
 41631  func _btreeGetUnusedPage(tls *crt.TLS, _pBt *XBtShared, _pgno uint32, _ppPage **XMemPage, _flags int32) (r0 int32) {
 41632  	var _rc int32
 41633  	_rc = _btreeGetPage(tls, _pBt, _pgno, _ppPage, _flags)
 41634  	if _rc != int32(0) {
 41635  		goto _0
 41636  	}
 41637  	if _sqlite3PagerPageRefcount(tls, (*XPgHdr)((*_ppPage).XpDbPage)) > int32(1) {
 41638  		_releasePage(tls, *_ppPage)
 41639  		*_ppPage = nil
 41640  		return _sqlite3CorruptError(tls, int32(61159))
 41641  	}
 41642  	(*_ppPage).XisInit = 0
 41643  	goto _2
 41644  _0:
 41645  	*_ppPage = nil
 41646  _2:
 41647  	return _rc
 41648  }
 41649  
 41650  // C comment
 41651  //  /*
 41652  //  ** Return the number of references to the specified page.
 41653  //  */
 41654  func _sqlite3PagerPageRefcount(tls *crt.TLS, _pPage *XPgHdr) (r0 int32) {
 41655  	return _sqlite3PcachePageRefcount(tls, _pPage)
 41656  }
 41657  
 41658  // C comment
 41659  //  /*
 41660  //  ** Compute the absolute value of a 32-bit signed integer, of possible.  Or
 41661  //  ** if the integer has a value of -2147483648, return +2147483647
 41662  //  */
 41663  func _sqlite3AbsInt32(tls *crt.TLS, _x int32) (r0 int32) {
 41664  	if _x >= int32(0) {
 41665  		return _x
 41666  	}
 41667  	if _x == int32(-2147483648) {
 41668  		return int32(2147483647)
 41669  	}
 41670  	return -_x
 41671  }
 41672  
 41673  // C comment
 41674  //  /*
 41675  //  ** Query the BtShared.pHasContent vector.
 41676  //  **
 41677  //  ** This function is called when a free-list leaf page is removed from the
 41678  //  ** free-list for reuse. It returns false if it is safe to retrieve the
 41679  //  ** page from the pager layer with the 'no-content' flag set. True otherwise.
 41680  //  */
 41681  func _btreeGetHasContent(tls *crt.TLS, _pBt *XBtShared, _pgno uint32) (r0 int32) {
 41682  	var _p *XBitvec
 41683  	_p = (*XBitvec)(_pBt.XpHasContent)
 41684  	return bool2int((_p != nil) && ((_pgno > _sqlite3BitvecSize(tls, _p)) || _sqlite3BitvecTest(tls, _p, _pgno) != 0))
 41685  }
 41686  
 41687  // C comment
 41688  //  /*
 41689  //  ** Return the value of the iSize parameter specified when Bitvec *p
 41690  //  ** was created.
 41691  //  */
 41692  func _sqlite3BitvecSize(tls *crt.TLS, _p *XBitvec) (r0 uint32) {
 41693  	return _p.XiSize
 41694  }
 41695  
 41696  // C comment
 41697  //  /*
 41698  //  ** Move the open database page pDbPage to location iFreePage in the
 41699  //  ** database. The pDbPage reference remains valid.
 41700  //  **
 41701  //  ** The isCommit flag indicates that there is no need to remember that
 41702  //  ** the journal needs to be sync()ed before database page pDbPage->pgno
 41703  //  ** can be written to. The caller has already promised not to write to that
 41704  //  ** page.
 41705  //  */
 41706  func _relocatePage(tls *crt.TLS, _pBt *XBtShared, _pDbPage *XMemPage, _eType uint8, _iPtrPage uint32, _iFreePage uint32, _isCommit int32) (r0 int32) {
 41707  	var _rc int32
 41708  	var _iDbPage, _4_nextOvfl uint32
 41709  	var _pPager *XPager
 41710  	var _pPtrPage *XMemPage
 41711  	_iDbPage = _pDbPage.Xpgno
 41712  	_pPager = (*XPager)(_pBt.XpPager)
 41713  	func() {
 41714  		if int32(_eType) != int32(4) && int32(_eType) != int32(3) && int32(_eType) != int32(5) && int32(_eType) != int32(1) {
 41715  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62508), unsafe.Pointer(&_relocatePageØ00__func__Ø000), unsafe.Pointer(str(54853)))
 41716  			crt.X__builtin_abort(tls)
 41717  		}
 41718  	}()
 41719  	func() {
 41720  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 41721  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62510), unsafe.Pointer(&_relocatePageØ00__func__Ø000), unsafe.Pointer(str(9235)))
 41722  			crt.X__builtin_abort(tls)
 41723  		}
 41724  	}()
 41725  	func() {
 41726  		if (*XBtShared)(_pDbPage.XpBt) != _pBt {
 41727  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62511), unsafe.Pointer(&_relocatePageØ00__func__Ø000), unsafe.Pointer(str(54953)))
 41728  			crt.X__builtin_abort(tls)
 41729  		}
 41730  	}()
 41731  	_rc = _sqlite3PagerMovepage(tls, _pPager, (*XPgHdr)(_pDbPage.XpDbPage), _iFreePage, _isCommit)
 41732  	if _rc != int32(0) {
 41733  		return _rc
 41734  	}
 41735  	_pDbPage.Xpgno = _iFreePage
 41736  	if int32(_eType) != int32(5) && int32(_eType) != int32(1) {
 41737  		goto _11
 41738  	}
 41739  	_rc = _setChildPtrmaps(tls, _pDbPage)
 41740  	if _rc != int32(0) {
 41741  		return _rc
 41742  	}
 41743  	goto _13
 41744  _11:
 41745  	_4_nextOvfl = _sqlite3Get4byte(tls, _pDbPage.XaData)
 41746  	if _4_nextOvfl == (0) {
 41747  		goto _14
 41748  	}
 41749  	_ptrmapPut(tls, _pBt, _4_nextOvfl, uint8(4), _iFreePage, &_rc)
 41750  	if _rc != int32(0) {
 41751  		return _rc
 41752  	}
 41753  _14:
 41754  _13:
 41755  	if int32(_eType) == int32(1) {
 41756  		goto _16
 41757  	}
 41758  	_rc = _btreeGetPage(tls, _pBt, _iPtrPage, &_pPtrPage, int32(0))
 41759  	if _rc != int32(0) {
 41760  		return _rc
 41761  	}
 41762  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPtrPage.XpDbPage))
 41763  	if _rc != int32(0) {
 41764  		_releasePage(tls, _pPtrPage)
 41765  		return _rc
 41766  	}
 41767  	_rc = _modifyPagePointer(tls, _pPtrPage, _iDbPage, _iFreePage, _eType)
 41768  	_releasePage(tls, _pPtrPage)
 41769  	if _rc == int32(0) {
 41770  		_ptrmapPut(tls, _pBt, _iFreePage, _eType, _iPtrPage, &_rc)
 41771  	}
 41772  _16:
 41773  	return _rc
 41774  }
 41775  
 41776  var _relocatePageØ00__func__Ø000 [13]int8
 41777  
 41778  func init() {
 41779  	crt.Xstrncpy(nil, &_relocatePageØ00__func__Ø000[0], str(54971), 13)
 41780  }
 41781  
 41782  // C comment
 41783  //  /*
 41784  //  ** Move the page pPg to location pgno in the file.
 41785  //  **
 41786  //  ** There must be no references to the page previously located at
 41787  //  ** pgno (which we call pPgOld) though that page is allowed to be
 41788  //  ** in cache.  If the page previously located at pgno is not already
 41789  //  ** in the rollback journal, it is not put there by by this routine.
 41790  //  **
 41791  //  ** References to the page pPg remain valid. Updating any
 41792  //  ** meta-data associated with pPg (i.e. data stored in the nExtra bytes
 41793  //  ** allocated along with the page) is the responsibility of the caller.
 41794  //  **
 41795  //  ** A transaction must be active when this routine is called. It used to be
 41796  //  ** required that a statement transaction was not active, but this restriction
 41797  //  ** has been removed (CREATE INDEX needs to move a page when a statement
 41798  //  ** transaction is active).
 41799  //  **
 41800  //  ** If the fourth argument, isCommit, is non-zero, then this page is being
 41801  //  ** moved as part of a database reorganization just before the transaction
 41802  //  ** is being committed. In this case, it is guaranteed that the database page
 41803  //  ** pPg refers to will not be written to again within this transaction.
 41804  //  **
 41805  //  ** This function may return SQLITE_NOMEM or an IO error code if an error
 41806  //  ** occurs. Otherwise, it returns SQLITE_OK.
 41807  //  */
 41808  func _sqlite3PagerMovepage(tls *crt.TLS, _pPager *XPager, _pPg *XPgHdr, _pgno uint32, _isCommit int32) (r0 int32) {
 41809  	var _rc int32
 41810  	var _needSyncPgno, _origPgno uint32
 41811  	var _pPgOld, _8_pPgHdr *XPgHdr
 41812  	_needSyncPgno = uint32(0)
 41813  	func() {
 41814  		if int32(_pPg.XnRef) <= int32(0) {
 41815  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53886), unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000), unsafe.Pointer(str(54984)))
 41816  			crt.X__builtin_abort(tls)
 41817  		}
 41818  	}()
 41819  	func() {
 41820  		if int32(_pPager.XeState) != int32(3) && int32(_pPager.XeState) != int32(4) {
 41821  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53887), unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000), unsafe.Pointer(str(54996)))
 41822  			crt.X__builtin_abort(tls)
 41823  		}
 41824  	}()
 41825  	func() {
 41826  		if _assert_pager_state(tls, _pPager) == 0 {
 41827  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53890), unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000), unsafe.Pointer(str(10971)))
 41828  			crt.X__builtin_abort(tls)
 41829  		}
 41830  	}()
 41831  	func() {
 41832  		if _pPager.XtempFile == 0 && _pPager.XmemDb != 0 {
 41833  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53895), unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000), unsafe.Pointer(str(55072)))
 41834  			crt.X__builtin_abort(tls)
 41835  		}
 41836  	}()
 41837  	if _pPager.XtempFile == 0 {
 41838  		goto _10
 41839  	}
 41840  	_rc = _sqlite3PagerWrite(tls, _pPg)
 41841  	if _rc != 0 {
 41842  		return _rc
 41843  	}
 41844  _10:
 41845  	if ((int32(_pPg.Xflags) & int32(2)) != int32(0)) && (int32(0) != store2(&_rc, _subjournalPageIfRequired(tls, _pPg))) {
 41846  		return _rc
 41847  	}
 41848  	if (int32(_pPg.Xflags)&int32(8)) != 0 && (_isCommit == 0) {
 41849  		_needSyncPgno = _pPg.Xpgno
 41850  		func() {
 41851  			if int32(_pPager.XjournalMode) != int32(2) && _pageInJournal(tls, _pPager, _pPg) == 0 && _pPg.Xpgno <= _pPager.XdbOrigSize {
 41852  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53938), unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000), unsafe.Pointer(str(55099)))
 41853  				crt.X__builtin_abort(tls)
 41854  			}
 41855  		}()
 41856  		func() {
 41857  			if (int32(_pPg.Xflags) & int32(2)) == 0 {
 41858  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53940), unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000), unsafe.Pointer(str(54011)))
 41859  				crt.X__builtin_abort(tls)
 41860  			}
 41861  		}()
 41862  	}
 41863  	{
 41864  		p := &_pPg.Xflags
 41865  		*p = uint16(int32(*p) & int32(-9))
 41866  	}
 41867  	_pPgOld = _sqlite3PagerLookup(tls, _pPager, _pgno)
 41868  	func() {
 41869  		if _pPgOld != nil && int32(_pPgOld.XnRef) != int32(1) {
 41870  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53950), unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000), unsafe.Pointer(str(55204)))
 41871  			crt.X__builtin_abort(tls)
 41872  		}
 41873  	}()
 41874  	if _pPgOld == nil {
 41875  		goto _25
 41876  	}
 41877  	{
 41878  		p := &_pPg.Xflags
 41879  		*p = uint16(int32(*p) | (int32(_pPgOld.Xflags) & int32(8)))
 41880  	}
 41881  	if _pPager.XtempFile != 0 {
 41882  		_sqlite3PcacheMove(tls, _pPgOld, _pPager.XdbSize+uint32(1))
 41883  		goto _27
 41884  	}
 41885  	_sqlite3PcacheDrop(tls, _pPgOld)
 41886  _27:
 41887  _25:
 41888  	_origPgno = _pPg.Xpgno
 41889  	_sqlite3PcacheMove(tls, _pPg, _pgno)
 41890  	_sqlite3PcacheMakeDirty(tls, _pPg)
 41891  	if (_pPager.XtempFile != 0) && (_pPgOld != nil) {
 41892  		_sqlite3PcacheMove(tls, _pPgOld, _origPgno)
 41893  		_sqlite3PagerUnrefNotNull(tls, _pPgOld)
 41894  	}
 41895  	if _needSyncPgno == 0 {
 41896  		goto _30
 41897  	}
 41898  	_rc = _sqlite3PagerGet(tls, _pPager, _needSyncPgno, &_8_pPgHdr, int32(0))
 41899  	if _rc == int32(0) {
 41900  		goto _31
 41901  	}
 41902  	if _needSyncPgno <= _pPager.XdbOrigSize {
 41903  		func() {
 41904  			if _pPager.XpTmpSpace == nil {
 41905  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53994), unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000), unsafe.Pointer(str(55231)))
 41906  				crt.X__builtin_abort(tls)
 41907  			}
 41908  		}()
 41909  		_sqlite3BitvecClear(tls, (*XBitvec)(_pPager.XpInJournal), _needSyncPgno, unsafe.Pointer(_pPager.XpTmpSpace))
 41910  	}
 41911  	return _rc
 41912  
 41913  _31:
 41914  	{
 41915  		p := &_8_pPgHdr.Xflags
 41916  		*p = uint16(int32(*p) | int32(8))
 41917  	}
 41918  	_sqlite3PcacheMakeDirty(tls, _8_pPgHdr)
 41919  	_sqlite3PagerUnrefNotNull(tls, _8_pPgHdr)
 41920  _30:
 41921  	return int32(0)
 41922  }
 41923  
 41924  var _sqlite3PagerMovepageØ00__func__Ø000 [21]int8
 41925  
 41926  func init() {
 41927  	crt.Xstrncpy(nil, &_sqlite3PagerMovepageØ00__func__Ø000[0], str(55252), 21)
 41928  }
 41929  
 41930  // C comment
 41931  //  /*
 41932  //  ** Change the page number of page p to newPgno.
 41933  //  */
 41934  func _sqlite3PcacheMove(tls *crt.TLS, _p *XPgHdr, _newPgno uint32) {
 41935  	var _pCache *XPCache
 41936  	_pCache = (*XPCache)(_p.XpCache)
 41937  	func() {
 41938  		if int32(_p.XnRef) <= int32(0) {
 41939  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44751), unsafe.Pointer(&_sqlite3PcacheMoveØ00__func__Ø000), unsafe.Pointer(str(13812)))
 41940  			crt.X__builtin_abort(tls)
 41941  		}
 41942  	}()
 41943  	func() {
 41944  		if _newPgno <= (0) {
 41945  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44752), unsafe.Pointer(&_sqlite3PcacheMoveØ00__func__Ø000), unsafe.Pointer(str(55273)))
 41946  			crt.X__builtin_abort(tls)
 41947  		}
 41948  	}()
 41949  	func() {
 41950  		if _sqlite3PcachePageSanity(tls, _p) == 0 {
 41951  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44753), unsafe.Pointer(&_sqlite3PcacheMoveØ00__func__Ø000), unsafe.Pointer(str(13822)))
 41952  			crt.X__builtin_abort(tls)
 41953  		}
 41954  	}()
 41955  	func() func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, uint32, uint32) {
 41956  		v := _sqlite3Config.Xpcache2.XxRekey
 41957  		return *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, uint32, uint32))(unsafe.Pointer(&v))
 41958  	}()(tls, _pCache.XpCache, (*Xsqlite3_pcache_page)(_p.XpPage), _p.Xpgno, _newPgno)
 41959  	_p.Xpgno = _newPgno
 41960  	if (int32(_p.Xflags)&int32(2)) != 0 && (int32(_p.Xflags)&int32(8)) != 0 {
 41961  		_pcacheManageDirtyList(tls, _p, uint8(3))
 41962  	}
 41963  }
 41964  
 41965  var _sqlite3PcacheMoveØ00__func__Ø000 [18]int8
 41966  
 41967  func init() {
 41968  	crt.Xstrncpy(nil, &_sqlite3PcacheMoveØ00__func__Ø000[0], str(55283), 18)
 41969  }
 41970  
 41971  // C comment
 41972  //  /*
 41973  //  ** Clear the i-th bit.
 41974  //  **
 41975  //  ** pBuf must be a pointer to at least BITVEC_SZ bytes of temporary storage
 41976  //  ** that BitvecClear can use to rebuilt its hash table.
 41977  //  */
 41978  func _sqlite3BitvecClear(tls *crt.TLS, _p *XBitvec, _i uint32, _pBuf unsafe.Pointer) {
 41979  	var _1_bin, _4_j, _6_h uint32
 41980  	var _4_aiValues *uint32
 41981  	if _p == nil {
 41982  		return
 41983  	}
 41984  	func() {
 41985  		if _i <= (0) {
 41986  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(43951), unsafe.Pointer(&_sqlite3BitvecClearØ00__func__Ø000), unsafe.Pointer(str(12925)))
 41987  			crt.X__builtin_abort(tls)
 41988  		}
 41989  	}()
 41990  	_i -= 1
 41991  _3:
 41992  	if _p.XiDivisor == 0 {
 41993  		goto _4
 41994  	}
 41995  	_1_bin = _i / _p.XiDivisor
 41996  	_i = _i % _p.XiDivisor
 41997  	_p = *elem32((**XBitvec)(unsafe.Pointer((*[125]unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))), uintptr(_1_bin))
 41998  	if _p == nil {
 41999  		return
 42000  	}
 42001  	goto _3
 42002  _4:
 42003  	if _p.XiSize <= uint32(4000) {
 42004  		{
 42005  			p := elem15((*uint8)(unsafe.Pointer((*[500]uint8)(unsafe.Pointer(&_p.Xu)))), uintptr(_i/uint32(8)))
 42006  			*p = uint8(int32(*p) & (^(int32(1) << uint(int32(_i&uint32(7))))))
 42007  		}
 42008  		goto _7
 42009  	}
 42010  	_4_aiValues = (*uint32)(_pBuf)
 42011  	crt.Xmemcpy(tls, unsafe.Pointer(_4_aiValues), unsafe.Pointer((*[125]uint32)(unsafe.Pointer(&_p.Xu))), uint32(500))
 42012  	crt.Xmemset(tls, unsafe.Pointer((*[125]uint32)(unsafe.Pointer(&_p.Xu))), int32(0), uint32(500))
 42013  	_p.XnSet = 0
 42014  	_4_j = 0
 42015  _8:
 42016  	if _4_j >= uint32(125) {
 42017  		goto _11
 42018  	}
 42019  	if (*elem7(_4_aiValues, uintptr(_4_j))) == 0 || (*elem7(_4_aiValues, uintptr(_4_j))) == (_i+uint32(1)) {
 42020  		goto _13
 42021  	}
 42022  	_6_h = (((*elem7(_4_aiValues, uintptr(_4_j))) - uint32(1)) * uint32(1)) % uint32(125)
 42023  	_p.XnSet += 1
 42024  _14:
 42025  	if (*elem7((*uint32)(unsafe.Pointer((*[125]uint32)(unsafe.Pointer(&_p.Xu)))), uintptr(_6_h))) == 0 {
 42026  		goto _15
 42027  	}
 42028  	_6_h += 1
 42029  	if _6_h >= uint32(125) {
 42030  		_6_h = 0
 42031  	}
 42032  	goto _14
 42033  _15:
 42034  	*elem7((*uint32)(unsafe.Pointer((*[125]uint32)(unsafe.Pointer(&_p.Xu)))), uintptr(_6_h)) = *elem7(_4_aiValues, uintptr(_4_j))
 42035  _13:
 42036  	_4_j += 1
 42037  	goto _8
 42038  _11:
 42039  _7:
 42040  }
 42041  
 42042  var _sqlite3BitvecClearØ00__func__Ø000 [19]int8
 42043  
 42044  func init() {
 42045  	crt.Xstrncpy(nil, &_sqlite3BitvecClearØ00__func__Ø000[0], str(55301), 19)
 42046  }
 42047  
 42048  // C comment
 42049  //  /*
 42050  //  ** Set the pointer-map entries for all children of page pPage. Also, if
 42051  //  ** pPage contains cells that point to overflow pages, set the pointer
 42052  //  ** map entries for the overflow pages as well.
 42053  //  */
 42054  func _setChildPtrmaps(tls *crt.TLS, _pPage *XMemPage) (r0 int32) {
 42055  	var _i, _nCell, _rc int32
 42056  	var _pgno, _2_childPgno, _3_childPgno uint32
 42057  	var _1_pCell *uint8
 42058  	var _pBt *XBtShared
 42059  	_pBt = (*XBtShared)(_pPage.XpBt)
 42060  	_pgno = _pPage.Xpgno
 42061  	func() {
 42062  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 42063  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62396), unsafe.Pointer(&_setChildPtrmapsØ00__func__Ø000), unsafe.Pointer(str(20394)))
 42064  			crt.X__builtin_abort(tls)
 42065  		}
 42066  	}()
 42067  	_rc = _btreeInitPage(tls, _pPage)
 42068  	if _rc != int32(0) {
 42069  		return _rc
 42070  	}
 42071  	_nCell = int32(_pPage.XnCell)
 42072  	_i = int32(0)
 42073  _3:
 42074  	if _i >= _nCell {
 42075  		goto _6
 42076  	}
 42077  	_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)))))))
 42078  	_ptrmapPutOvflPtr(tls, _pPage, _1_pCell, &_rc)
 42079  	if _pPage.Xleaf == 0 {
 42080  		_2_childPgno = _sqlite3Get4byte(tls, _1_pCell)
 42081  		_ptrmapPut(tls, _pBt, _2_childPgno, uint8(5), _pgno, &_rc)
 42082  	}
 42083  	_i += 1
 42084  	goto _3
 42085  _6:
 42086  	if _pPage.Xleaf == 0 {
 42087  		_3_childPgno = _sqlite3Get4byte(tls, elem15(_pPage.XaData, uintptr(int32(_pPage.XhdrOffset)+int32(8))))
 42088  		_ptrmapPut(tls, _pBt, _3_childPgno, uint8(5), _pgno, &_rc)
 42089  	}
 42090  	return _rc
 42091  }
 42092  
 42093  var _setChildPtrmapsØ00__func__Ø000 [16]int8
 42094  
 42095  func init() {
 42096  	crt.Xstrncpy(nil, &_setChildPtrmapsØ00__func__Ø000[0], str(55320), 16)
 42097  }
 42098  
 42099  // C comment
 42100  //  /*
 42101  //  ** Initialize the auxiliary information for a disk block.
 42102  //  **
 42103  //  ** Return SQLITE_OK on success.  If we see that the page does
 42104  //  ** not contain a well-formed database page, then return
 42105  //  ** SQLITE_CORRUPT.  Note that a return of SQLITE_OK does not
 42106  //  ** guarantee that the page is well-formed.  It only shows that
 42107  //  ** we failed to detect any corruption.
 42108  //  */
 42109  func _btreeInitPage(tls *crt.TLS, _pPage *XMemPage) (r0 int32) {
 42110  	var _1_pc, _1_usableSize, _1_nFree, _1_top, _1_iCellFirst, _1_iCellLast, _3_i, _3_sz int32
 42111  	var _7_next, _7_size uint32
 42112  	var _1_cellOffset uint16
 42113  	var _1_hdr uint8
 42114  	var _1_data *uint8
 42115  	var _1_pBt *XBtShared
 42116  	func() {
 42117  		if (*XBtShared)(_pPage.XpBt) == nil {
 42118  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60819), unsafe.Pointer(&_btreeInitPageØ00__func__Ø000), unsafe.Pointer(str(55336)))
 42119  			crt.X__builtin_abort(tls)
 42120  		}
 42121  	}()
 42122  	func() {
 42123  		if (*Xsqlite3)((*XBtShared)(_pPage.XpBt).Xdb) == nil {
 42124  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60820), unsafe.Pointer(&_btreeInitPageØ00__func__Ø000), unsafe.Pointer(str(55350)))
 42125  			crt.X__builtin_abort(tls)
 42126  		}
 42127  	}()
 42128  	func() {
 42129  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 42130  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60821), unsafe.Pointer(&_btreeInitPageØ00__func__Ø000), unsafe.Pointer(str(20394)))
 42131  			crt.X__builtin_abort(tls)
 42132  		}
 42133  	}()
 42134  	func() {
 42135  		if _pPage.Xpgno != _sqlite3PagerPagenumber(tls, (*XPgHdr)(_pPage.XpDbPage)) {
 42136  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60822), unsafe.Pointer(&_btreeInitPageØ00__func__Ø000), unsafe.Pointer(str(55368)))
 42137  			crt.X__builtin_abort(tls)
 42138  		}
 42139  	}()
 42140  	func() {
 42141  		if _pPage != (*XMemPage)(_sqlite3PagerGetExtra(tls, (*XPgHdr)(_pPage.XpDbPage))) {
 42142  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60823), unsafe.Pointer(&_btreeInitPageØ00__func__Ø000), unsafe.Pointer(str(55420)))
 42143  			crt.X__builtin_abort(tls)
 42144  		}
 42145  	}()
 42146  	func() {
 42147  		if _pPage.XaData != (*uint8)(_sqlite3PagerGetData(tls, (*XPgHdr)(_pPage.XpDbPage))) {
 42148  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60824), unsafe.Pointer(&_btreeInitPageØ00__func__Ø000), unsafe.Pointer(str(55466)))
 42149  			crt.X__builtin_abort(tls)
 42150  		}
 42151  	}()
 42152  	if _pPage.XisInit != 0 {
 42153  		goto _12
 42154  	}
 42155  	_1_pBt = (*XBtShared)(_pPage.XpBt)
 42156  	_1_hdr = _pPage.XhdrOffset
 42157  	_1_data = _pPage.XaData
 42158  	if _decodeFlags(tls, _pPage, int32(*elem15(_1_data, uintptr(_1_hdr)))) != 0 {
 42159  		return _sqlite3CorruptError(tls, int32(60844))
 42160  	}
 42161  	func() {
 42162  		if _1_pBt.XpageSize < uint32(512) || _1_pBt.XpageSize > uint32(65536) {
 42163  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60845), unsafe.Pointer(&_btreeInitPageØ00__func__Ø000), unsafe.Pointer(str(53350)))
 42164  			crt.X__builtin_abort(tls)
 42165  		}
 42166  	}()
 42167  	_pPage.XmaskPage = uint16(_1_pBt.XpageSize - uint32(1))
 42168  	_pPage.XnOverflow = 0
 42169  	_1_usableSize = int32(_1_pBt.XusableSize)
 42170  	_pPage.XcellOffset = store76(&_1_cellOffset, uint16((int32(_1_hdr)+int32(8))+int32(_pPage.XchildPtrSize)))
 42171  	_pPage.XaDataEnd = elem15(_1_data, uintptr(_1_usableSize))
 42172  	_pPage.XaCellIdx = elem15(_1_data, uintptr(_1_cellOffset))
 42173  	_pPage.XaDataOfst = elem15(_1_data, uintptr(_pPage.XchildPtrSize))
 42174  	_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)
 42175  	_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))))
 42176  	if uint32(_pPage.XnCell) > ((_1_pBt.XpageSize - uint32(8)) / uint32(6)) {
 42177  		return _sqlite3CorruptError(tls, int32(60862))
 42178  	}
 42179  	func() {
 42180  		if int32(_pPage.XnCell) <= int32(0) && _1_top != _1_usableSize && _sqlite3Config.XneverCorrupt != int32(0) {
 42181  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60869), unsafe.Pointer(&_btreeInitPageØ00__func__Ø000), unsafe.Pointer(str(55518)))
 42182  			crt.X__builtin_abort(tls)
 42183  		}
 42184  	}()
 42185  	_1_iCellFirst = int32(_1_cellOffset) + (int32(2) * int32(_pPage.XnCell))
 42186  	_1_iCellLast = _1_usableSize - int32(4)
 42187  	if (((*Xsqlite3)(_1_pBt.Xdb).Xflags) & int32(536870912)) == 0 {
 42188  		goto _22
 42189  	}
 42190  	if _pPage.Xleaf == 0 {
 42191  		_1_iCellLast -= 1
 42192  	}
 42193  	_3_i = int32(0)
 42194  _24:
 42195  	if _3_i >= int32(_pPage.XnCell) {
 42196  		goto _27
 42197  	}
 42198  	_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)))
 42199  	if (_1_pc < _1_iCellFirst) || (_1_pc > _1_iCellLast) {
 42200  		return _sqlite3CorruptError(tls, int32(60890))
 42201  	}
 42202  	_3_sz = int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 42203  		v := _pPage.XxCellSize
 42204  		return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 42205  	}()(tls, _pPage, elem15(_1_data, uintptr(_1_pc))))
 42206  	if (_1_pc + _3_sz) > _1_usableSize {
 42207  		return _sqlite3CorruptError(tls, int32(60895))
 42208  	}
 42209  	_3_i += 1
 42210  	goto _24
 42211  _27:
 42212  	if _pPage.Xleaf == 0 {
 42213  		_1_iCellLast += 1
 42214  	}
 42215  _22:
 42216  	_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)))
 42217  	_1_nFree = int32(*elem15(_1_data, uintptr(int32(_1_hdr)+int32(7)))) + _1_top
 42218  	if _1_pc <= int32(0) {
 42219  		goto _32
 42220  	}
 42221  	if _1_pc < _1_iCellFirst {
 42222  		return _sqlite3CorruptError(tls, int32(60913))
 42223  	}
 42224  _33:
 42225  	if _1_pc > _1_iCellLast {
 42226  		return _sqlite3CorruptError(tls, int32(60917))
 42227  	}
 42228  	_7_next = uint32((int32(*elem15(elem15(_1_data, uintptr(_1_pc)), 0)) << 8) | int32(*elem15(elem15(_1_data, uintptr(_1_pc)), uintptr(1))))
 42229  	_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))))
 42230  	_1_nFree = int32(uint32(_1_nFree) + _7_size)
 42231  	if _7_next <= ((uint32(_1_pc) + _7_size) + uint32(3)) {
 42232  		goto _35
 42233  	}
 42234  	_1_pc = int32(_7_next)
 42235  	goto _33
 42236  _35:
 42237  	if _7_next > (0) {
 42238  		return _sqlite3CorruptError(tls, int32(60926))
 42239  	}
 42240  	if (uint32(_1_pc) + _7_size) > uint32(_1_usableSize) {
 42241  		return _sqlite3CorruptError(tls, int32(60929))
 42242  	}
 42243  _32:
 42244  	if _1_nFree > _1_usableSize {
 42245  		return _sqlite3CorruptError(tls, int32(60941))
 42246  	}
 42247  	_pPage.XnFree = uint16(_1_nFree - _1_iCellFirst)
 42248  	_pPage.XisInit = uint8(1)
 42249  _12:
 42250  	return int32(0)
 42251  }
 42252  
 42253  var _btreeInitPageØ00__func__Ø000 [14]int8
 42254  
 42255  func init() {
 42256  	crt.Xstrncpy(nil, &_btreeInitPageØ00__func__Ø000[0], str(55566), 14)
 42257  }
 42258  
 42259  // C comment
 42260  //  /*
 42261  //  ** If the cell pCell, part of page pPage contains a pointer
 42262  //  ** to an overflow page, insert an entry into the pointer-map
 42263  //  ** for the overflow page.
 42264  //  */
 42265  func _ptrmapPutOvflPtr(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pRC *int32) {
 42266  	var _1_ovfl uint32
 42267  	var _info XCellInfo
 42268  	if (*_pRC) != 0 {
 42269  		return
 42270  	}
 42271  	func() {
 42272  		if _pCell == nil {
 42273  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60344), unsafe.Pointer(&_ptrmapPutOvflPtrØ00__func__Ø000), unsafe.Pointer(str(55580)))
 42274  			crt.X__builtin_abort(tls)
 42275  		}
 42276  	}()
 42277  	func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) {
 42278  		v := _pPage.XxParseCell
 42279  		return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v))
 42280  	}()(tls, _pPage, _pCell, &_info)
 42281  	if uint32(_info.XnLocal) < _info.XnPayload {
 42282  		_1_ovfl = _sqlite3Get4byte(tls, elem15(_pCell, uintptr(int32(_info.XnSize)-int32(4))))
 42283  		_ptrmapPut(tls, (*XBtShared)(_pPage.XpBt), _1_ovfl, uint8(3), _pPage.Xpgno, _pRC)
 42284  	}
 42285  }
 42286  
 42287  var _ptrmapPutOvflPtrØ00__func__Ø000 [17]int8
 42288  
 42289  func init() {
 42290  	crt.Xstrncpy(nil, &_ptrmapPutOvflPtrØ00__func__Ø000[0], str(55589), 17)
 42291  }
 42292  
 42293  // C comment
 42294  //  /*
 42295  //  ** Write an entry into the pointer map.
 42296  //  **
 42297  //  ** This routine updates the pointer map entry for page number 'key'
 42298  //  ** so that it maps to type 'eType' and parent page number 'pgno'.
 42299  //  **
 42300  //  ** If *pRC is initially non-zero (non-SQLITE_OK) then this routine is
 42301  //  ** a no-op.  If an error occurs, the appropriate error code is written
 42302  //  ** into *pRC.
 42303  //  */
 42304  func _ptrmapPut(tls *crt.TLS, _pBt *XBtShared, _key uint32, _eType uint8, _parent uint32, _pRC *int32) {
 42305  	var _offset, _rc int32
 42306  	var _iPtrmap uint32
 42307  	var _pPtrmap *uint8
 42308  	var _pDbPage *XPgHdr
 42309  	if (*_pRC) != 0 {
 42310  		return
 42311  	}
 42312  	func() {
 42313  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 42314  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59967), unsafe.Pointer(&_ptrmapPutØ00__func__Ø000), unsafe.Pointer(str(9235)))
 42315  			crt.X__builtin_abort(tls)
 42316  		}
 42317  	}()
 42318  	func() {
 42319  		if int32(0) != bool2int(_ptrmapPageno(tls, _pBt, (uint32(_sqlite3PendingByte)/_pBt.XpageSize)+uint32(1)) == ((uint32(_sqlite3PendingByte)/_pBt.XpageSize)+uint32(1))) {
 42320  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59969), unsafe.Pointer(&_ptrmapPutØ00__func__Ø000), unsafe.Pointer(str(55606)))
 42321  			crt.X__builtin_abort(tls)
 42322  		}
 42323  	}()
 42324  	func() {
 42325  		if _pBt.XautoVacuum == 0 {
 42326  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59971), unsafe.Pointer(&_ptrmapPutØ00__func__Ø000), unsafe.Pointer(str(54354)))
 42327  			crt.X__builtin_abort(tls)
 42328  		}
 42329  	}()
 42330  	if _key == (0) {
 42331  		*_pRC = _sqlite3CorruptError(tls, int32(59973))
 42332  		return
 42333  	}
 42334  	_iPtrmap = _ptrmapPageno(tls, _pBt, _key)
 42335  	_rc = _sqlite3PagerGet(tls, (*XPager)(_pBt.XpPager), _iPtrmap, &_pDbPage, int32(0))
 42336  	if _rc != int32(0) {
 42337  		*_pRC = _rc
 42338  		return
 42339  	}
 42340  	_offset = int32(uint32(5) * ((_key - _iPtrmap) - uint32(1)))
 42341  	if _offset < int32(0) {
 42342  		*_pRC = _sqlite3CorruptError(tls, int32(59984))
 42343  		goto _ptrmap_exit
 42344  	}
 42345  	func() {
 42346  		if _offset > (int32(_pBt.XusableSize) - int32(5)) {
 42347  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59987), unsafe.Pointer(&_ptrmapPutØ00__func__Ø000), unsafe.Pointer(str(20052)))
 42348  			crt.X__builtin_abort(tls)
 42349  		}
 42350  	}()
 42351  	_pPtrmap = (*uint8)(_sqlite3PagerGetData(tls, _pDbPage))
 42352  	if int32(_eType) == int32(*elem15(_pPtrmap, uintptr(_offset))) && _sqlite3Get4byte(tls, elem15(_pPtrmap, uintptr(_offset+int32(1)))) == _parent {
 42353  		goto _ptrmap_exit
 42354  	}
 42355  	*_pRC = store2(&_rc, _sqlite3PagerWrite(tls, _pDbPage))
 42356  	if _rc == int32(0) {
 42357  		*elem15(_pPtrmap, uintptr(_offset)) = _eType
 42358  		_sqlite3Put4byte(tls, elem15(_pPtrmap, uintptr(_offset+int32(1))), _parent)
 42359  	}
 42360  _ptrmap_exit:
 42361  	_sqlite3PagerUnref(tls, _pDbPage)
 42362  }
 42363  
 42364  var _ptrmapPutØ00__func__Ø000 [10]int8
 42365  
 42366  func init() {
 42367  	crt.Xstrncpy(nil, &_ptrmapPutØ00__func__Ø000[0], str(55652), 10)
 42368  }
 42369  
 42370  // C comment
 42371  //  /*
 42372  //  ** Somewhere on pPage is a pointer to page iFrom.  Modify this pointer so
 42373  //  ** that it points to iTo. Parameter eType describes the type of pointer to
 42374  //  ** be modified, as  follows:
 42375  //  **
 42376  //  ** PTRMAP_BTREE:     pPage is a btree-page. The pointer points at a child
 42377  //  **                   page of pPage.
 42378  //  **
 42379  //  ** PTRMAP_OVERFLOW1: pPage is a btree-page. The pointer points at an overflow
 42380  //  **                   page pointed to by one of the cells on pPage.
 42381  //  **
 42382  //  ** PTRMAP_OVERFLOW2: pPage is an overflow-page. The pointer points at the next
 42383  //  **                   overflow page in the list.
 42384  //  */
 42385  func _modifyPagePointer(tls *crt.TLS, _pPage *XMemPage, _iFrom uint32, _iTo uint32, _eType uint8) (r0 int32) {
 42386  	var _3_i, _3_nCell, _3_rc int32
 42387  	var _4_pCell *uint8
 42388  	var _5_info XCellInfo
 42389  	func() {
 42390  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 42391  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62435), unsafe.Pointer(&_modifyPagePointerØ00__func__Ø000), unsafe.Pointer(str(20394)))
 42392  			crt.X__builtin_abort(tls)
 42393  		}
 42394  	}()
 42395  	func() {
 42396  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.XpDbPage)) == 0 {
 42397  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62436), unsafe.Pointer(&_modifyPagePointerØ00__func__Ø000), unsafe.Pointer(str(53310)))
 42398  			crt.X__builtin_abort(tls)
 42399  		}
 42400  	}()
 42401  	if int32(_eType) != int32(4) {
 42402  		goto _4
 42403  	}
 42404  	if _sqlite3Get4byte(tls, _pPage.XaData) != _iFrom {
 42405  		return _sqlite3CorruptError(tls, int32(62440))
 42406  	}
 42407  	_sqlite3Put4byte(tls, _pPage.XaData, _iTo)
 42408  	goto _6
 42409  _4:
 42410  	_3_rc = _btreeInitPage(tls, _pPage)
 42411  	if _3_rc != 0 {
 42412  		return _3_rc
 42413  	}
 42414  	_3_nCell = int32(_pPage.XnCell)
 42415  	_3_i = int32(0)
 42416  _8:
 42417  	if _3_i >= _3_nCell {
 42418  		goto _11
 42419  	}
 42420  	_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)))))))
 42421  	if int32(_eType) != int32(3) {
 42422  		goto _12
 42423  	}
 42424  	func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) {
 42425  		v := _pPage.XxParseCell
 42426  		return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v))
 42427  	}()(tls, _pPage, _4_pCell, &_5_info)
 42428  	if uint32(_5_info.XnLocal) >= _5_info.XnPayload {
 42429  		goto _13
 42430  	}
 42431  	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))))) {
 42432  		return _sqlite3CorruptError(tls, int32(62459))
 42433  	}
 42434  	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))))) {
 42435  		_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_4_pCell))+uintptr(_5_info.XnSize)))))-uintptr(int32(4)))), _iTo)
 42436  		goto _11
 42437  	}
 42438  _13:
 42439  	goto _16
 42440  _12:
 42441  	if _sqlite3Get4byte(tls, _4_pCell) == _iFrom {
 42442  		_sqlite3Put4byte(tls, _4_pCell, _iTo)
 42443  		goto _11
 42444  	}
 42445  _16:
 42446  	_3_i += 1
 42447  	goto _8
 42448  _11:
 42449  	if _3_i != _3_nCell {
 42450  		goto _18
 42451  	}
 42452  	if (int32(_eType) != int32(5)) || (_sqlite3Get4byte(tls, elem15(_pPage.XaData, uintptr(int32(_pPage.XhdrOffset)+int32(8)))) != _iFrom) {
 42453  		return _sqlite3CorruptError(tls, int32(62477))
 42454  	}
 42455  	_sqlite3Put4byte(tls, elem15(_pPage.XaData, uintptr(int32(_pPage.XhdrOffset)+int32(8))), _iTo)
 42456  _18:
 42457  _6:
 42458  	return int32(0)
 42459  }
 42460  
 42461  var _modifyPagePointerØ00__func__Ø000 [18]int8
 42462  
 42463  func init() {
 42464  	crt.Xstrncpy(nil, &_modifyPagePointerØ00__func__Ø000[0], str(55662), 18)
 42465  }
 42466  
 42467  // C comment
 42468  //  /*
 42469  //  ** Truncate the in-memory database file image to nPage pages. This
 42470  //  ** function does not actually modify the database file on disk. It
 42471  //  ** just sets the internal state of the pager object so that the
 42472  //  ** truncation will be done when the current transaction is committed.
 42473  //  **
 42474  //  ** This function is only called right before committing a transaction.
 42475  //  ** Once this function has been called, the transaction must either be
 42476  //  ** rolled back or committed. It is not safe to call this function and
 42477  //  ** then continue writing to the database.
 42478  //  */
 42479  func _sqlite3PagerTruncateImage(tls *crt.TLS, _pPager *XPager, _nPage uint32) {
 42480  	func() {
 42481  		if _pPager.XdbSize < _nPage {
 42482  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50876), unsafe.Pointer(&_sqlite3PagerTruncateImageØ00__func__Ø000), unsafe.Pointer(str(55680)))
 42483  			crt.X__builtin_abort(tls)
 42484  		}
 42485  	}()
 42486  	func() {
 42487  		if int32(_pPager.XeState) < int32(3) {
 42488  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50877), unsafe.Pointer(&_sqlite3PagerTruncateImageØ00__func__Ø000), unsafe.Pointer(str(13287)))
 42489  			crt.X__builtin_abort(tls)
 42490  		}
 42491  	}()
 42492  	_pPager.XdbSize = _nPage
 42493  }
 42494  
 42495  var _sqlite3PagerTruncateImageØ00__func__Ø000 [26]int8
 42496  
 42497  func init() {
 42498  	crt.Xstrncpy(nil, &_sqlite3PagerTruncateImageØ00__func__Ø000[0], str(55702), 26)
 42499  }
 42500  
 42501  // C comment
 42502  //  /*
 42503  //  ** Sync the database file for the pager pPager. zMaster points to the name
 42504  //  ** of a master journal file that should be written into the individual
 42505  //  ** journal file. zMaster may be NULL, which is interpreted as no master
 42506  //  ** journal (a single database transaction).
 42507  //  **
 42508  //  ** This routine ensures that:
 42509  //  **
 42510  //  **   * The database file change-counter is updated,
 42511  //  **   * the journal is synced (unless the atomic-write optimization is used),
 42512  //  **   * all dirty pages are written to the database file,
 42513  //  **   * the database file is truncated (if required), and
 42514  //  **   * the database file synced.
 42515  //  **
 42516  //  ** The only thing that remains to commit the transaction is to finalize
 42517  //  ** (delete, truncate or zero the first part of) the journal file (or
 42518  //  ** delete the master journal file if specified).
 42519  //  **
 42520  //  ** Note that if zMaster==NULL, this does not overwrite a previous value
 42521  //  ** passed to an sqlite3PagerCommitPhaseOne() call.
 42522  //  **
 42523  //  ** If the final parameter - noSync - is true, then the database file itself
 42524  //  ** is not synced. The caller must call sqlite3PagerSync() directly to
 42525  //  ** sync the database file before calling CommitPhaseTwo() to delete the
 42526  //  ** journal file in this case.
 42527  //  */
 42528  func _sqlite3PagerCommitPhaseOne(tls *crt.TLS, _pPager *XPager, _zMaster *int8, _noSync int32) (r0 int32) {
 42529  	var _rc int32
 42530  	var _9_nNew uint32
 42531  	var _3_pList, _3_pPageOne *XPgHdr
 42532  	_rc = int32(0)
 42533  	func() {
 42534  		if int32(_pPager.XeState) != int32(2) && int32(_pPager.XeState) != int32(3) && int32(_pPager.XeState) != int32(4) && int32(_pPager.XeState) != int32(6) {
 42535  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53228), unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000), unsafe.Pointer(str(55728)))
 42536  			crt.X__builtin_abort(tls)
 42537  		}
 42538  	}()
 42539  	func() {
 42540  		if _assert_pager_state(tls, _pPager) == 0 {
 42541  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53233), unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000), unsafe.Pointer(str(10971)))
 42542  			crt.X__builtin_abort(tls)
 42543  		}
 42544  	}()
 42545  	if func() int32 {
 42546  		if _pPager.XerrCode != 0 {
 42547  			return func() int32 {
 42548  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53236), unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000), unsafe.Pointer(str(4809)))
 42549  				crt.X__builtin_abort(tls)
 42550  				return int32(1)
 42551  			}()
 42552  		}
 42553  		return int32(0)
 42554  	}() != 0 {
 42555  		return _pPager.XerrCode
 42556  	}
 42557  	if _sqlite3FaultSim(tls, int32(400)) != 0 {
 42558  		return int32(10)
 42559  	}
 42560  	if int32(_pPager.XeState) < int32(3) {
 42561  		return int32(0)
 42562  	}
 42563  	func() {
 42564  		if int32(_pPager.XmemDb) != int32(0) && _pPager.XtempFile == 0 {
 42565  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53247), unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000), unsafe.Pointer(str(55874)))
 42566  			crt.X__builtin_abort(tls)
 42567  		}
 42568  	}()
 42569  	func() {
 42570  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil && _pPager.XtempFile == 0 {
 42571  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53248), unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000), unsafe.Pointer(str(19520)))
 42572  			crt.X__builtin_abort(tls)
 42573  		}
 42574  	}()
 42575  	if int32(0) == _pagerFlushOnCommit(tls, _pPager, int32(1)) {
 42576  		_sqlite3BackupRestart(tls, (*Xsqlite3_backup)(_pPager.XpBackup))
 42577  		goto _commit_phase_one_exit
 42578  	}
 42579  	if (*XWal)(_pPager.XpWal) == nil {
 42580  		goto _20
 42581  	}
 42582  	_3_pList = _sqlite3PcacheDirtyList(tls, (*XPCache)(_pPager.XpPCache))
 42583  	_3_pPageOne = nil
 42584  	if _3_pList == nil {
 42585  		_rc = _sqlite3PagerGet(tls, _pPager, uint32(1), &_3_pPageOne, int32(0))
 42586  		_3_pList = _3_pPageOne
 42587  		*(**XPgHdr)(unsafe.Pointer(&_3_pList.XpDirty)) = nil
 42588  	}
 42589  	func() {
 42590  		if _rc != int32(0) {
 42591  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53265), unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000), unsafe.Pointer(str(14967)))
 42592  			crt.X__builtin_abort(tls)
 42593  		}
 42594  	}()
 42595  	if func() int32 {
 42596  		if _3_pList != nil {
 42597  			return int32(1)
 42598  		}
 42599  		return func() int32 {
 42600  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53266), unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000), unsafe.Pointer(str(4809)))
 42601  			crt.X__builtin_abort(tls)
 42602  			return int32(0)
 42603  		}()
 42604  	}() != 0 {
 42605  		_rc = _pagerWalFrames(tls, _pPager, _3_pList, _pPager.XdbSize, int32(1))
 42606  	}
 42607  	_sqlite3PagerUnref(tls, _3_pPageOne)
 42608  	if _rc == int32(0) {
 42609  		_sqlite3PcacheCleanAll(tls, (*XPCache)(_pPager.XpPCache))
 42610  	}
 42611  	goto _28
 42612  _20:
 42613  	_rc = _pager_incr_changecounter(tls, _pPager, int32(0))
 42614  	if _rc != int32(0) {
 42615  		goto _commit_phase_one_exit
 42616  	}
 42617  	_rc = _writeMasterJournal(tls, _pPager, _zMaster)
 42618  	if _rc != int32(0) {
 42619  		goto _commit_phase_one_exit
 42620  	}
 42621  	_rc = _syncJournal(tls, _pPager, int32(0))
 42622  	if _rc != int32(0) {
 42623  		goto _commit_phase_one_exit
 42624  	}
 42625  	_rc = _pager_write_pagelist(tls, _pPager, _sqlite3PcacheDirtyList(tls, (*XPCache)(_pPager.XpPCache)))
 42626  	if _rc != int32(0) {
 42627  		func() {
 42628  			if _rc == int32(2826) {
 42629  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53349), unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000), unsafe.Pointer(str(55903)))
 42630  				crt.X__builtin_abort(tls)
 42631  			}
 42632  		}()
 42633  		goto _commit_phase_one_exit
 42634  	}
 42635  	_sqlite3PcacheCleanAll(tls, (*XPCache)(_pPager.XpPCache))
 42636  	if _pPager.XdbSize <= _pPager.XdbFileSize {
 42637  		goto _35
 42638  	}
 42639  	_9_nNew = _pPager.XdbSize - uint32(bool2int(_pPager.XdbSize == uint32((_sqlite3PendingByte/_pPager.XpageSize)+int32(1))))
 42640  	func() {
 42641  		if int32(_pPager.XeState) != int32(4) {
 42642  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53362), unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000), unsafe.Pointer(str(55928)))
 42643  			crt.X__builtin_abort(tls)
 42644  		}
 42645  	}()
 42646  	_rc = _pager_truncate(tls, _pPager, _9_nNew)
 42647  	if _rc != int32(0) {
 42648  		goto _commit_phase_one_exit
 42649  	}
 42650  _35:
 42651  	if _noSync == 0 {
 42652  		_rc = _sqlite3PagerSync(tls, _pPager, _zMaster)
 42653  	}
 42654  _28:
 42655  _commit_phase_one_exit:
 42656  	if (_rc == int32(0)) && ((*XWal)(_pPager.XpWal) == nil) {
 42657  		_pPager.XeState = uint8(5)
 42658  	}
 42659  	return _rc
 42660  }
 42661  
 42662  var _sqlite3PagerCommitPhaseOneØ00__func__Ø000 [27]int8
 42663  
 42664  func init() {
 42665  	crt.Xstrncpy(nil, &_sqlite3PagerCommitPhaseOneØ00__func__Ø000[0], str(55963), 27)
 42666  }
 42667  
 42668  func _sqlite3FaultSim(tls *crt.TLS, _iTest int32) (r0 int32) {
 42669  	var _xCallback func(*crt.TLS, int32) int32
 42670  	_xCallback = _sqlite3Config.XxTestCallback
 42671  	return func() int32 {
 42672  		if _xCallback != nil {
 42673  			return _xCallback(tls, _iTest)
 42674  		}
 42675  		return int32(0)
 42676  	}()
 42677  }
 42678  
 42679  func _pagerWalFrames(tls *crt.TLS, _pPager *XPager, _pList *XPgHdr, _nTruncate uint32, _isCommit int32) (r0 int32) {
 42680  	var _rc, _nList int32
 42681  	var _p *XPgHdr
 42682  	var _2_ppNext **XPgHdr
 42683  	func() {
 42684  		if _pPager.XpWal == nil {
 42685  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50067), unsafe.Pointer(&_pagerWalFramesØ00__func__Ø000), unsafe.Pointer(str(55990)))
 42686  			crt.X__builtin_abort(tls)
 42687  		}
 42688  	}()
 42689  	func() {
 42690  		if _pList == nil {
 42691  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50068), unsafe.Pointer(&_pagerWalFramesØ00__func__Ø000), unsafe.Pointer(str(56003)))
 42692  			crt.X__builtin_abort(tls)
 42693  		}
 42694  	}()
 42695  	_p = _pList
 42696  _4:
 42697  	if _p == nil || _p.XpDirty == nil {
 42698  		goto _8
 42699  	}
 42700  	func() {
 42701  		if _p.Xpgno >= ((*XPgHdr)(_p.XpDirty).Xpgno) {
 42702  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50072), unsafe.Pointer(&_pagerWalFramesØ00__func__Ø000), unsafe.Pointer(str(56009)))
 42703  			crt.X__builtin_abort(tls)
 42704  		}
 42705  	}()
 42706  	_p = (*XPgHdr)(_p.XpDirty)
 42707  	goto _4
 42708  _8:
 42709  	func() {
 42710  		if (*XPgHdr)(_pList.XpDirty) != nil && _isCommit == 0 {
 42711  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50076), unsafe.Pointer(&_pagerWalFramesØ00__func__Ø000), unsafe.Pointer(str(56035)))
 42712  			crt.X__builtin_abort(tls)
 42713  		}
 42714  	}()
 42715  	if _isCommit == 0 {
 42716  		goto _14
 42717  	}
 42718  	_2_ppNext = &_pList
 42719  	_nList = int32(0)
 42720  	_p = _pList
 42721  _15:
 42722  	if store34(_2_ppNext, _p) == nil {
 42723  		goto _18
 42724  	}
 42725  	if _p.Xpgno <= _nTruncate {
 42726  		_2_ppNext = (**XPgHdr)(unsafe.Pointer(&_p.XpDirty))
 42727  		_nList += 1
 42728  	}
 42729  	_p = (*XPgHdr)(_p.XpDirty)
 42730  	goto _15
 42731  _18:
 42732  	func() {
 42733  		if _pList == nil {
 42734  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50090), unsafe.Pointer(&_pagerWalFramesØ00__func__Ø000), unsafe.Pointer(str(56003)))
 42735  			crt.X__builtin_abort(tls)
 42736  		}
 42737  	}()
 42738  	goto _22
 42739  _14:
 42740  	_nList = int32(1)
 42741  _22:
 42742  	*elem8((*int32)(unsafe.Pointer(&_pPager.XaStat)), uintptr(2)) += _nList
 42743  	if _pList.Xpgno == uint32(1) {
 42744  		_pager_write_changecounter(tls, _pList)
 42745  	}
 42746  	_rc = _sqlite3WalFrames(tls, (*XWal)(_pPager.XpWal), _pPager.XpageSize, _pList, _nTruncate, _isCommit, int32(_pPager.XwalSyncFlags))
 42747  	if _rc != int32(0) || _pPager.XpBackup == nil {
 42748  		goto _25
 42749  	}
 42750  	_p = _pList
 42751  _26:
 42752  	if _p == nil {
 42753  		goto _29
 42754  	}
 42755  	_sqlite3BackupUpdate(tls, (*Xsqlite3_backup)(_pPager.XpBackup), _p.Xpgno, (*uint8)(_p.XpData))
 42756  	_p = (*XPgHdr)(_p.XpDirty)
 42757  	goto _26
 42758  _29:
 42759  _25:
 42760  	return _rc
 42761  }
 42762  
 42763  var _pagerWalFramesØ00__func__Ø000 [15]int8
 42764  
 42765  func init() {
 42766  	crt.Xstrncpy(nil, &_pagerWalFramesØ00__func__Ø000[0], str(56064), 15)
 42767  }
 42768  
 42769  // C comment
 42770  //  /*
 42771  //  ** Update the value of the change-counter at offsets 24 and 92 in
 42772  //  ** the header and the sqlite version number at offset 96.
 42773  //  **
 42774  //  ** This is an unconditional update.  See also the pager_incr_changecounter()
 42775  //  ** routine which only updates the change-counter if the update is actually
 42776  //  ** needed, as determined by the pPager->changeCountDone state variable.
 42777  //  */
 42778  func _pager_write_changecounter(tls *crt.TLS, _pPg *XPgHdr) {
 42779  	var _change_counter uint32
 42780  	_change_counter = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(&((*XPager)(_pPg.XpPager).XdbFileVers)))))) + uint32(1)
 42781  	_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(_pPg.XpData)+uintptr(int32(24)))), _change_counter)
 42782  	_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(_pPg.XpData)+uintptr(int32(92)))), _change_counter)
 42783  	_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(_pPg.XpData)+uintptr(int32(96)))), uint32(3019003))
 42784  }
 42785  
 42786  // C comment
 42787  //  /*
 42788  //  ** Write a set of frames to the log. The caller must hold the write-lock
 42789  //  ** on the log file (obtained using sqlite3WalBeginWriteTransaction()).
 42790  //  */
 42791  func _sqlite3WalFrames(tls *crt.TLS, _pWal *XWal, _szPage int32, _pList *XPgHdr, _nTruncate uint32, _isCommit int32, _sync_flags int32) (r0 int32) {
 42792  	var _rc, _nExtra, _szFrame, _6_nDbSize, _11_bSync, _12_sectorSize int32
 42793  	var _iOffset, _8_iOff, _15_sz int64
 42794  	var _iFrame, _iFirst, _7_iWrite uint32
 42795  	var _8_pData unsafe.Pointer
 42796  	var _3_aWalHdr [32]uint8
 42797  	var _p, _pLast *XPgHdr
 42798  	var _3_aCksum [2]uint32
 42799  	var _pLive *XWalIndexHdr
 42800  	var _w XWalWriter
 42801  	_pLast = nil
 42802  	_nExtra = int32(0)
 42803  	_iFirst = uint32(0)
 42804  	func() {
 42805  		if _pList == nil {
 42806  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57536), unsafe.Pointer(&_sqlite3WalFramesØ00__func__Ø000), unsafe.Pointer(str(56003)))
 42807  			crt.X__builtin_abort(tls)
 42808  		}
 42809  	}()
 42810  	func() {
 42811  		if _pWal.XwriteLock == 0 {
 42812  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57537), unsafe.Pointer(&_sqlite3WalFramesØ00__func__Ø000), unsafe.Pointer(str(15561)))
 42813  			crt.X__builtin_abort(tls)
 42814  		}
 42815  	}()
 42816  	func() {
 42817  		if (_isCommit != int32(0)) != (_nTruncate != (0)) {
 42818  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57541), unsafe.Pointer(&_sqlite3WalFramesØ00__func__Ø000), unsafe.Pointer(str(56079)))
 42819  			crt.X__builtin_abort(tls)
 42820  		}
 42821  	}()
 42822  	_pLive = _walIndexHdr(tls, _pWal)
 42823  	if crt.Xmemcmp(tls, unsafe.Pointer(&_pWal.Xhdr), unsafe.Pointer(_pLive), uint32(48)) != int32(0) {
 42824  		_iFirst = _pLive.XmxFrame + uint32(1)
 42825  	}
 42826  	if int32(0) != store2(&_rc, _walRestartLog(tls, _pWal)) {
 42827  		return _rc
 42828  	}
 42829  	_iFrame = _pWal.Xhdr.XmxFrame
 42830  	if _iFrame != (0) {
 42831  		goto _8
 42832  	}
 42833  	_sqlite3Put4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_aWalHdr)), 0), uint32(931071618))
 42834  	_sqlite3Put4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_aWalHdr)), uintptr(4)), uint32(3007000))
 42835  	_sqlite3Put4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_aWalHdr)), uintptr(8)), uint32(_szPage))
 42836  	_sqlite3Put4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_aWalHdr)), uintptr(12)), _pWal.XnCkpt)
 42837  	if _pWal.XnCkpt == (0) {
 42838  		Xsqlite3_randomness(tls, int32(8), unsafe.Pointer(&(_pWal.Xhdr.XaSalt)))
 42839  	}
 42840  	crt.Xmemcpy(tls, unsafe.Pointer(elem15((*uint8)(unsafe.Pointer(&_3_aWalHdr)), uintptr(16))), unsafe.Pointer(&(_pWal.Xhdr.XaSalt)), uint32(8))
 42841  	_walChecksumBytes(tls, int32(1), (*uint8)(unsafe.Pointer(&_3_aWalHdr)), int32(24), nil, (*uint32)(unsafe.Pointer(&_3_aCksum)))
 42842  	_sqlite3Put4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_aWalHdr)), uintptr(24)), *elem7((*uint32)(unsafe.Pointer(&_3_aCksum)), 0))
 42843  	_sqlite3Put4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_aWalHdr)), uintptr(28)), *elem7((*uint32)(unsafe.Pointer(&_3_aCksum)), uintptr(1)))
 42844  	_pWal.XszPage = uint32(_szPage)
 42845  	_pWal.Xhdr.XbigEndCksum = 0
 42846  	*elem7((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), 0) = *elem7((*uint32)(unsafe.Pointer(&_3_aCksum)), 0)
 42847  	*elem7((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), uintptr(1)) = *elem7((*uint32)(unsafe.Pointer(&_3_aCksum)), uintptr(1))
 42848  	_pWal.XtruncateOnCommit = uint8(1)
 42849  	_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pWal.XpWalFd), unsafe.Pointer(&_3_aWalHdr), int32(32), 0)
 42850  	if _rc != int32(0) {
 42851  		return _rc
 42852  	}
 42853  	if _pWal.XsyncHeader == 0 || _sync_flags == 0 {
 42854  		goto _12
 42855  	}
 42856  	_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pWal.XpWalFd), _sync_flags&int32(19))
 42857  	if _rc != 0 {
 42858  		return _rc
 42859  	}
 42860  _12:
 42861  _8:
 42862  	func() {
 42863  		if int32(_pWal.XszPage) != _szPage {
 42864  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57605), unsafe.Pointer(&_sqlite3WalFramesØ00__func__Ø000), unsafe.Pointer(str(56109)))
 42865  			crt.X__builtin_abort(tls)
 42866  		}
 42867  	}()
 42868  	*(**XWal)(unsafe.Pointer(&_w.XpWal)) = _pWal
 42869  	*(**Xsqlite3_file)(unsafe.Pointer(&_w.XpFd)) = (*Xsqlite3_file)(_pWal.XpWalFd)
 42870  	_w.XiSyncPoint = 0
 42871  	_w.XsyncFlags = _sync_flags
 42872  	_w.XszPage = _szPage
 42873  	_iOffset = int64(32) + (int64((_iFrame+uint32(1))-uint32(1)) * int64(_szPage+int32(24)))
 42874  	_szFrame = _szPage + int32(24)
 42875  	_p = _pList
 42876  _16:
 42877  	if _p == nil {
 42878  		goto _19
 42879  	}
 42880  	if _iFirst == 0 || _p.XpDirty == nil && _isCommit != int32(0) {
 42881  		goto _22
 42882  	}
 42883  	_7_iWrite = 0
 42884  	_rc = _sqlite3WalFindFrame(tls, _pWal, _p.Xpgno, &_7_iWrite)
 42885  	func() {
 42886  		if _rc != int32(0) && _7_iWrite != (0) {
 42887  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57627), unsafe.Pointer(&_sqlite3WalFramesØ00__func__Ø000), unsafe.Pointer(str(56135)))
 42888  			crt.X__builtin_abort(tls)
 42889  		}
 42890  	}()
 42891  	if _7_iWrite < _iFirst {
 42892  		goto _26
 42893  	}
 42894  	_8_iOff = (int64(32) + (int64(_7_iWrite-uint32(1)) * int64(_szPage+int32(24)))) + int64(24)
 42895  	if (_pWal.XiReCksum == (0)) || (_7_iWrite < _pWal.XiReCksum) {
 42896  		_pWal.XiReCksum = _7_iWrite
 42897  	}
 42898  	_8_pData = _p.XpData
 42899  	_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pWal.XpWalFd), _8_pData, _szPage, _8_iOff)
 42900  	if _rc != 0 {
 42901  		return _rc
 42902  	}
 42903  	{
 42904  		p := &_p.Xflags
 42905  		*p = uint16(int32(*p) & int32(-65))
 42906  	}
 42907  	goto _17
 42908  _26:
 42909  _22:
 42910  	_iFrame += 1
 42911  	func() {
 42912  		if _iOffset != (int64(32) + (int64(_iFrame-uint32(1)) * int64(_szPage+int32(24)))) {
 42913  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57647), unsafe.Pointer(&_sqlite3WalFramesØ00__func__Ø000), unsafe.Pointer(str(56162)))
 42914  			crt.X__builtin_abort(tls)
 42915  		}
 42916  	}()
 42917  	_6_nDbSize = int32(func() uint32 {
 42918  		if _isCommit != 0 && ((*XPgHdr)(_p.XpDirty) == nil) {
 42919  			return _nTruncate
 42920  		}
 42921  		return (0)
 42922  	}())
 42923  	_rc = _walWriteOneFrame(tls, &_w, _p, _6_nDbSize, _iOffset)
 42924  	if _rc != 0 {
 42925  		return _rc
 42926  	}
 42927  	_pLast = _p
 42928  	_iOffset += int64(_szFrame)
 42929  	{
 42930  		p := &_p.Xflags
 42931  		*p = uint16(int32(*p) | int32(64))
 42932  	}
 42933  _17:
 42934  	_p = (*XPgHdr)(_p.XpDirty)
 42935  	goto _16
 42936  _19:
 42937  	if _isCommit == 0 || _pWal.XiReCksum == 0 {
 42938  		goto _37
 42939  	}
 42940  	_rc = _walRewriteChecksums(tls, _pWal, _iFrame)
 42941  	if _rc != 0 {
 42942  		return _rc
 42943  	}
 42944  _37:
 42945  	if _isCommit == 0 || (_sync_flags&int32(32)) == int32(0) {
 42946  		goto _40
 42947  	}
 42948  	_11_bSync = int32(1)
 42949  	if _pWal.XpadToSectorBoundary == 0 {
 42950  		goto _41
 42951  	}
 42952  	_12_sectorSize = _sqlite3SectorSize(tls, (*Xsqlite3_file)(_pWal.XpWalFd))
 42953  	_w.XiSyncPoint = (((_iOffset + int64(_12_sectorSize)) - int64(1)) / int64(_12_sectorSize)) * int64(_12_sectorSize)
 42954  	_11_bSync = bool2int(_w.XiSyncPoint == _iOffset)
 42955  _42:
 42956  	if _iOffset >= _w.XiSyncPoint {
 42957  		goto _43
 42958  	}
 42959  	_rc = _walWriteOneFrame(tls, &_w, _pLast, int32(_nTruncate), _iOffset)
 42960  	if _rc != 0 {
 42961  		return _rc
 42962  	}
 42963  	_iOffset += int64(_szFrame)
 42964  	_nExtra += 1
 42965  	goto _42
 42966  _43:
 42967  _41:
 42968  	if _11_bSync != 0 {
 42969  		func() {
 42970  			if _rc != int32(0) {
 42971  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57691), unsafe.Pointer(&_sqlite3WalFramesØ00__func__Ø000), unsafe.Pointer(str(14967)))
 42972  				crt.X__builtin_abort(tls)
 42973  			}
 42974  		}()
 42975  		_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_w.XpFd), _sync_flags&int32(19))
 42976  	}
 42977  _40:
 42978  	if _isCommit == 0 || _pWal.XtruncateOnCommit == 0 || _pWal.XmxWalSize < (0) {
 42979  		goto _50
 42980  	}
 42981  	_15_sz = _pWal.XmxWalSize
 42982  	if (int64(32) + (int64(((_iFrame+uint32(_nExtra))+uint32(1))-uint32(1)) * int64(_szPage+int32(24)))) > _pWal.XmxWalSize {
 42983  		_15_sz = int64(32) + (int64(((_iFrame+uint32(_nExtra))+uint32(1))-uint32(1)) * int64(_szPage+int32(24)))
 42984  	}
 42985  	_walLimitSize(tls, _pWal, _15_sz)
 42986  	_pWal.XtruncateOnCommit = 0
 42987  _50:
 42988  	_iFrame = _pWal.Xhdr.XmxFrame
 42989  	_p = _pList
 42990  _52:
 42991  	if _p == nil || _rc != int32(0) {
 42992  		goto _56
 42993  	}
 42994  	if (int32(_p.Xflags) & int32(64)) == int32(0) {
 42995  		goto _53
 42996  	}
 42997  	_iFrame += 1
 42998  	_rc = _walIndexAppend(tls, _pWal, _iFrame, _p.Xpgno)
 42999  _53:
 43000  	_p = (*XPgHdr)(_p.XpDirty)
 43001  	goto _52
 43002  _56:
 43003  	if (_rc == int32(0)) && (_nExtra > int32(0)) {
 43004  		_iFrame += 1
 43005  		_nExtra -= 1
 43006  		_rc = _walIndexAppend(tls, _pWal, _iFrame, _pLast.Xpgno)
 43007  		goto _56
 43008  	}
 43009  	if _rc != int32(0) {
 43010  		goto _61
 43011  	}
 43012  	_pWal.Xhdr.XszPage = uint16((_szPage & int32(65280)) | (_szPage >> 16))
 43013  	_pWal.Xhdr.XmxFrame = _iFrame
 43014  	if _isCommit != 0 {
 43015  		_pWal.Xhdr.XiChange += 1
 43016  		_pWal.Xhdr.XnPage = _nTruncate
 43017  	}
 43018  	if _isCommit != 0 {
 43019  		_walIndexWriteHdr(tls, _pWal)
 43020  		_pWal.XiCallback = _iFrame
 43021  	}
 43022  _61:
 43023  	return _rc
 43024  
 43025  	_ = _3_aWalHdr
 43026  	_ = _3_aCksum
 43027  	panic(0)
 43028  }
 43029  
 43030  var _sqlite3WalFramesØ00__func__Ø000 [17]int8
 43031  
 43032  func init() {
 43033  	crt.Xstrncpy(nil, &_sqlite3WalFramesØ00__func__Ø000[0], str(56202), 17)
 43034  }
 43035  
 43036  // C comment
 43037  //  /*
 43038  //  ** This function is called just before writing a set of frames to the log
 43039  //  ** file (see sqlite3WalFrames()). It checks to see if, instead of appending
 43040  //  ** to the current log file, it is possible to overwrite the start of the
 43041  //  ** existing log file with the new frames (i.e. "reset" the log). If so,
 43042  //  ** it sets pWal->hdr.mxFrame to 0. Otherwise, pWal->hdr.mxFrame is left
 43043  //  ** unchanged.
 43044  //  **
 43045  //  ** SQLITE_OK is returned if no error is encountered (regardless of whether
 43046  //  ** or not pWal->hdr.mxFrame is modified). An SQLite error code is returned
 43047  //  ** if an error occurs.
 43048  //  */
 43049  func _walRestartLog(tls *crt.TLS, _pWal *XWal) (r0 int32) {
 43050  	var _rc, _cnt, _5_notUsed int32
 43051  	var _2_salt1 uint32
 43052  	var _1_pInfo *XWalCkptInfo
 43053  	_rc = int32(0)
 43054  	if int32(_pWal.XreadLock) != int32(0) {
 43055  		goto _0
 43056  	}
 43057  	_1_pInfo = _walCkptInfo(tls, _pWal)
 43058  	func() {
 43059  		if _1_pInfo.XnBackfill != (_pWal.Xhdr.XmxFrame) {
 43060  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57356), unsafe.Pointer(&_walRestartLogØ00__func__Ø000), unsafe.Pointer(str(22912)))
 43061  			crt.X__builtin_abort(tls)
 43062  		}
 43063  	}()
 43064  	if _1_pInfo.XnBackfill <= (0) {
 43065  		goto _3
 43066  	}
 43067  	Xsqlite3_randomness(tls, int32(4), unsafe.Pointer(&_2_salt1))
 43068  	_rc = _walLockExclusive(tls, _pWal, int32(4), int32(4))
 43069  	if _rc == int32(0) {
 43070  		_walRestartHdr(tls, _pWal, _2_salt1)
 43071  		_walUnlockExclusive(tls, _pWal, int32(4), int32(4))
 43072  		goto _6
 43073  	}
 43074  	if _rc != int32(5) {
 43075  		return _rc
 43076  	}
 43077  _6:
 43078  _3:
 43079  	_walUnlockShared(tls, _pWal, int32(3))
 43080  	_pWal.XreadLock = int16(-1)
 43081  	_cnt = int32(0)
 43082  _7:
 43083  	_rc = _walTryBeginRead(tls, _pWal, &_5_notUsed, int32(1), preInc2(&_cnt, 1))
 43084  	if _rc == int32(-1) {
 43085  		goto _7
 43086  	}
 43087  	func() {
 43088  		if (_rc & int32(255)) == int32(5) {
 43089  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57384), unsafe.Pointer(&_walRestartLogØ00__func__Ø000), unsafe.Pointer(str(56219)))
 43090  			crt.X__builtin_abort(tls)
 43091  		}
 43092  	}()
 43093  _0:
 43094  	return _rc
 43095  
 43096  	_ = _cnt
 43097  	panic(0)
 43098  }
 43099  
 43100  var _walRestartLogØ00__func__Ø000 [14]int8
 43101  
 43102  func init() {
 43103  	crt.Xstrncpy(nil, &_walRestartLogØ00__func__Ø000[0], str(56242), 14)
 43104  }
 43105  
 43106  // C comment
 43107  //  /*
 43108  //  ** Write out a single frame of the WAL
 43109  //  */
 43110  func _walWriteOneFrame(tls *crt.TLS, _p *XWalWriter, _pPage *XPgHdr, _nTruncate int32, _iOffset int64) (r0 int32) {
 43111  	var _rc int32
 43112  	var _pData unsafe.Pointer
 43113  	var _aFrame [24]uint8
 43114  	_pData = _pPage.XpData
 43115  	_walEncodeFrame(tls, (*XWal)(_p.XpWal), _pPage.Xpgno, uint32(_nTruncate), (*uint8)(_pData), (*uint8)(unsafe.Pointer(&_aFrame)))
 43116  	_rc = _walWriteToLog(tls, _p, unsafe.Pointer(&_aFrame), int32(24), _iOffset)
 43117  	if _rc != 0 {
 43118  		return _rc
 43119  	}
 43120  	_rc = _walWriteToLog(tls, _p, _pData, _p.XszPage, _iOffset+int64(24))
 43121  	return _rc
 43122  
 43123  	_ = _aFrame
 43124  	panic(0)
 43125  }
 43126  
 43127  // C comment
 43128  //  /*
 43129  //  ** This function encodes a single frame header and writes it to a buffer
 43130  //  ** supplied by the caller. A frame-header is made up of a series of
 43131  //  ** 4-byte big-endian integers, as follows:
 43132  //  **
 43133  //  **     0: Page number.
 43134  //  **     4: For commit records, the size of the database image in pages
 43135  //  **        after the commit. For all other records, zero.
 43136  //  **     8: Salt-1 (copied from the wal-header)
 43137  //  **    12: Salt-2 (copied from the wal-header)
 43138  //  **    16: Checksum-1.
 43139  //  **    20: Checksum-2.
 43140  //  */
 43141  func _walEncodeFrame(tls *crt.TLS, _pWal *XWal, _iPage uint32, _nTruncate uint32, _aData *uint8, _aFrame *uint8) {
 43142  	var _nativeCksum int32
 43143  	var _aCksum *uint32
 43144  	_aCksum = (*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum)))
 43145  
 43146  	_sqlite3Put4byte(tls, elem15(_aFrame, 0), _iPage)
 43147  	_sqlite3Put4byte(tls, elem15(_aFrame, uintptr(4)), _nTruncate)
 43148  	if _pWal.XiReCksum == (0) {
 43149  		crt.Xmemcpy(tls, unsafe.Pointer(elem15(_aFrame, uintptr(8))), unsafe.Pointer(&(_pWal.Xhdr.XaSalt)), uint32(8))
 43150  		_nativeCksum = bool2int(int32(_pWal.Xhdr.XbigEndCksum) == int32(0))
 43151  		_walChecksumBytes(tls, _nativeCksum, _aFrame, int32(8), _aCksum, _aCksum)
 43152  		_walChecksumBytes(tls, _nativeCksum, _aData, int32(_pWal.XszPage), _aCksum, _aCksum)
 43153  		_sqlite3Put4byte(tls, elem15(_aFrame, uintptr(16)), *elem7(_aCksum, 0))
 43154  		_sqlite3Put4byte(tls, elem15(_aFrame, uintptr(20)), *elem7(_aCksum, uintptr(1)))
 43155  		goto _1
 43156  	}
 43157  	crt.Xmemset(tls, unsafe.Pointer(elem15(_aFrame, uintptr(8))), int32(0), uint32(16))
 43158  _1:
 43159  }
 43160  
 43161  // C comment
 43162  //  /*
 43163  //  ** Write iAmt bytes of content into the WAL file beginning at iOffset.
 43164  //  ** Do a sync when crossing the p->iSyncPoint boundary.
 43165  //  **
 43166  //  ** In other words, if iSyncPoint is in between iOffset and iOffset+iAmt,
 43167  //  ** first write the part before iSyncPoint, then sync, then write the
 43168  //  ** rest.
 43169  //  */
 43170  func _walWriteToLog(tls *crt.TLS, _p *XWalWriter, _pContent unsafe.Pointer, _iAmt int32, _iOffset int64) (r0 int32) {
 43171  	var _rc, _1_iFirstAmt int32
 43172  	if _iOffset >= _p.XiSyncPoint || (_iOffset+int64(_iAmt)) < _p.XiSyncPoint {
 43173  		goto _1
 43174  	}
 43175  	_1_iFirstAmt = int32(_p.XiSyncPoint - _iOffset)
 43176  	_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_p.XpFd), _pContent, _1_iFirstAmt, _iOffset)
 43177  	if _rc != 0 {
 43178  		return _rc
 43179  	}
 43180  	_iOffset += int64(_1_iFirstAmt)
 43181  	_iAmt -= _1_iFirstAmt
 43182  	_pContent = unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_1_iFirstAmt) + uintptr(_pContent))))
 43183  	func() {
 43184  		if (_p.XsyncFlags & int32(3)) == 0 {
 43185  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57427), unsafe.Pointer(&_walWriteToLogØ00__func__Ø000), unsafe.Pointer(str(56256)))
 43186  			crt.X__builtin_abort(tls)
 43187  		}
 43188  	}()
 43189  	_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_p.XpFd), _p.XsyncFlags&int32(19))
 43190  	if (_iAmt == int32(0)) || _rc != 0 {
 43191  		return _rc
 43192  	}
 43193  _1:
 43194  	_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_p.XpFd), _pContent, _iAmt, _iOffset)
 43195  	return _rc
 43196  }
 43197  
 43198  var _walWriteToLogØ00__func__Ø000 [14]int8
 43199  
 43200  func init() {
 43201  	crt.Xstrncpy(nil, &_walWriteToLogØ00__func__Ø000[0], str(56309), 14)
 43202  }
 43203  
 43204  // C comment
 43205  //  /*
 43206  //  ** This function is called as part of committing a transaction within which
 43207  //  ** one or more frames have been overwritten. It updates the checksums for
 43208  //  ** all frames written to the wal file by the current transaction starting
 43209  //  ** with the earliest to have been overwritten.
 43210  //  **
 43211  //  ** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
 43212  //  */
 43213  func _walRewriteChecksums(tls *crt.TLS, _pWal *XWal, _iLast uint32) (r0 int32) {
 43214  	var _szPage, _rc int32
 43215  	var _iCksumOff, _3_iOff int64
 43216  	var _iRead, _4_iPgno, _4_nDbSize uint32
 43217  	var _aBuf *uint8
 43218  	var _aFrame [24]uint8
 43219  	_szPage = int32(_pWal.XszPage)
 43220  	_rc = int32(0)
 43221  	_aBuf = (*uint8)(Xsqlite3_malloc(tls, _szPage+int32(24)))
 43222  	if _aBuf == nil {
 43223  		return _sqlite3NomemError(tls, int32(57477))
 43224  	}
 43225  	func() {
 43226  		if _pWal.XiReCksum <= (0) {
 43227  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(57484), unsafe.Pointer(&_walRewriteChecksumsØ00__func__Ø000), unsafe.Pointer(str(56323)))
 43228  			crt.X__builtin_abort(tls)
 43229  		}
 43230  	}()
 43231  	if _pWal.XiReCksum == uint32(1) {
 43232  		_iCksumOff = int64(24)
 43233  		goto _4
 43234  	}
 43235  	_iCksumOff = (int64(32) + (int64((_pWal.XiReCksum-uint32(1))-uint32(1)) * int64(_szPage+int32(24)))) + int64(16)
 43236  _4:
 43237  	_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.XpWalFd), unsafe.Pointer(_aBuf), int32(8), _iCksumOff)
 43238  	*elem7((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), 0) = _sqlite3Get4byte(tls, _aBuf)
 43239  	*elem7((*uint32)(unsafe.Pointer(&(_pWal.Xhdr.XaFrameCksum))), uintptr(1)) = _sqlite3Get4byte(tls, elem15(_aBuf, uintptr(4)))
 43240  	_iRead = _pWal.XiReCksum
 43241  	_pWal.XiReCksum = 0
 43242  _5:
 43243  	if _rc != int32(0) || _iRead > _iLast {
 43244  		goto _9
 43245  	}
 43246  	_3_iOff = int64(32) + (int64(_iRead-uint32(1)) * int64(_szPage+int32(24)))
 43247  	_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.XpWalFd), unsafe.Pointer(_aBuf), _szPage+int32(24), _3_iOff)
 43248  	if _rc == int32(0) {
 43249  		_4_iPgno = _sqlite3Get4byte(tls, _aBuf)
 43250  		_4_nDbSize = _sqlite3Get4byte(tls, elem15(_aBuf, uintptr(4)))
 43251  		_walEncodeFrame(tls, _pWal, _4_iPgno, _4_nDbSize, elem15(_aBuf, uintptr(24)), (*uint8)(unsafe.Pointer(&_aFrame)))
 43252  		_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pWal.XpWalFd), unsafe.Pointer(&_aFrame), int32(24), _3_iOff)
 43253  	}
 43254  	_iRead += 1
 43255  	goto _5
 43256  _9:
 43257  	Xsqlite3_free(tls, unsafe.Pointer(_aBuf))
 43258  	return _rc
 43259  
 43260  	_ = _aFrame
 43261  	panic(0)
 43262  }
 43263  
 43264  var _walRewriteChecksumsØ00__func__Ø000 [20]int8
 43265  
 43266  func init() {
 43267  	crt.Xstrncpy(nil, &_walRewriteChecksumsØ00__func__Ø000[0], str(56340), 20)
 43268  }
 43269  
 43270  // C comment
 43271  //  /*
 43272  //  ** This routine is called to increment the value of the database file
 43273  //  ** change-counter, stored as a 4-byte big-endian integer starting at
 43274  //  ** byte offset 24 of the pager file.  The secondary change counter at
 43275  //  ** 92 is also updated, as is the SQLite version number at offset 96.
 43276  //  **
 43277  //  ** But this only happens if the pPager->changeCountDone flag is false.
 43278  //  ** To avoid excess churning of page 1, the update only happens once.
 43279  //  ** See also the pager_write_changecounter() routine that does an
 43280  //  ** unconditional update of the change counters.
 43281  //  **
 43282  //  ** If the isDirectMode flag is zero, then this is done by calling
 43283  //  ** sqlite3PagerWrite() on page 1, then modifying the contents of the
 43284  //  ** page data. In this case the file will be updated when the current
 43285  //  ** transaction is committed.
 43286  //  **
 43287  //  ** The isDirectMode flag may only be non-zero if the library was compiled
 43288  //  ** with the SQLITE_ENABLE_ATOMIC_WRITE macro defined. In this case,
 43289  //  ** if isDirect is non-zero, then the database file is updated directly
 43290  //  ** by writing an updated version of page 1 using a call to the
 43291  //  ** sqlite3OsWrite() function.
 43292  //  */
 43293  func _pager_incr_changecounter(tls *crt.TLS, _pPager *XPager, _isDirectMode int32) (r0 int32) {
 43294  	var _rc int32
 43295  	var _4_zBuf, _6_pCopy unsafe.Pointer
 43296  	var _1_pPgHdr *XPgHdr
 43297  	_rc = int32(0)
 43298  	func() {
 43299  		if int32(_pPager.XeState) != int32(3) && int32(_pPager.XeState) != int32(4) {
 43300  			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)))
 43301  			crt.X__builtin_abort(tls)
 43302  		}
 43303  	}()
 43304  	func() {
 43305  		if _assert_pager_state(tls, _pPager) == 0 {
 43306  			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)))
 43307  			crt.X__builtin_abort(tls)
 43308  		}
 43309  	}()
 43310  	func() {
 43311  		if _isDirectMode != int32(0) {
 43312  			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)))
 43313  			crt.X__builtin_abort(tls)
 43314  		}
 43315  	}()
 43316  
 43317  	if _pPager.XchangeCountDone != 0 || func() int32 {
 43318  		if _pPager.XdbSize > (0) {
 43319  			return int32(1)
 43320  		}
 43321  		return func() int32 {
 43322  			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)))
 43323  			crt.X__builtin_abort(tls)
 43324  			return int32(0)
 43325  		}()
 43326  	}() == 0 {
 43327  		goto _10
 43328  	}
 43329  	func() {
 43330  		if _pPager.XtempFile != 0 || (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil {
 43331  			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)))
 43332  			crt.X__builtin_abort(tls)
 43333  		}
 43334  	}()
 43335  	_rc = _sqlite3PagerGet(tls, _pPager, uint32(1), &_1_pPgHdr, int32(0))
 43336  	func() {
 43337  		if _1_pPgHdr != nil && _rc != int32(0) {
 43338  			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)))
 43339  			crt.X__builtin_abort(tls)
 43340  		}
 43341  	}()
 43342  	if int32(1) != 0 && func() int32 {
 43343  		if _rc == int32(0) {
 43344  			return int32(1)
 43345  		}
 43346  		return func() int32 {
 43347  			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)))
 43348  			crt.X__builtin_abort(tls)
 43349  			return int32(0)
 43350  		}()
 43351  	}() != 0 {
 43352  		_rc = _sqlite3PagerWrite(tls, _1_pPgHdr)
 43353  	}
 43354  	if _rc != int32(0) {
 43355  		goto _21
 43356  	}
 43357  	_pager_write_changecounter(tls, _1_pPgHdr)
 43358  	goto _22
 43359  _22:
 43360  	_pPager.XchangeCountDone = uint8(1)
 43361  _21:
 43362  	_sqlite3PagerUnref(tls, _1_pPgHdr)
 43363  _10:
 43364  	return _rc
 43365  
 43366  	_ = _4_zBuf
 43367  	_ = _6_pCopy
 43368  	panic(0)
 43369  }
 43370  
 43371  var _pager_incr_changecounterØ00__func__Ø000 [25]int8
 43372  
 43373  func init() {
 43374  	crt.Xstrncpy(nil, &_pager_incr_changecounterØ00__func__Ø000[0], str(56443), 25)
 43375  }
 43376  
 43377  // C comment
 43378  //  /*
 43379  //  ** Write the supplied master journal name into the journal file for pager
 43380  //  ** pPager at the current location. The master journal name must be the last
 43381  //  ** thing written to a journal file. If the pager is in full-sync mode, the
 43382  //  ** journal file descriptor is advanced to the next sector boundary before
 43383  //  ** anything is written. The format is:
 43384  //  **
 43385  //  **   + 4 bytes: PAGER_MJ_PGNO.
 43386  //  **   + N bytes: Master journal filename in utf-8.
 43387  //  **   + 4 bytes: N (length of master journal name in bytes, no nul-terminator).
 43388  //  **   + 4 bytes: Master journal name checksum.
 43389  //  **   + 8 bytes: aJournalMagic[].
 43390  //  **
 43391  //  ** The master journal page checksum is the sum of the bytes in the master
 43392  //  ** journal name, where each byte is interpreted as a signed 8-bit integer.
 43393  //  **
 43394  //  ** If zMaster is a NULL pointer (occurs for a single database transaction),
 43395  //  ** this call is a no-op.
 43396  //  */
 43397  func _writeMasterJournal(tls *crt.TLS, _pPager *XPager, _zMaster *int8) (r0 int32) {
 43398  	var _rc, _nMaster int32
 43399  	var _iHdrOff, _jrnlSize int64
 43400  	var _cksum uint32
 43401  	_cksum = uint32(0)
 43402  	func() {
 43403  		if int32(_pPager.XsetMaster) != int32(0) {
 43404  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48585), unsafe.Pointer(&_writeMasterJournalØ00__func__Ø000), unsafe.Pointer(str(11980)))
 43405  			crt.X__builtin_abort(tls)
 43406  		}
 43407  	}()
 43408  	func() {
 43409  		if (*XWal)(_pPager.XpWal) != nil {
 43410  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48586), unsafe.Pointer(&_writeMasterJournalØ00__func__Ø000), unsafe.Pointer(str(12123)))
 43411  			crt.X__builtin_abort(tls)
 43412  		}
 43413  	}()
 43414  	if ((_zMaster == nil) || (int32(_pPager.XjournalMode) == int32(4))) || ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil) {
 43415  		return int32(0)
 43416  	}
 43417  	_pPager.XsetMaster = uint8(1)
 43418  	func() {
 43419  		if _pPager.XjournalHdr > _pPager.XjournalOff {
 43420  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(48595), unsafe.Pointer(&_writeMasterJournalØ00__func__Ø000), unsafe.Pointer(str(13638)))
 43421  			crt.X__builtin_abort(tls)
 43422  		}
 43423  	}()
 43424  	_nMaster = int32(0)
 43425  _9:
 43426  	if (*elem1(_zMaster, uintptr(_nMaster))) == 0 {
 43427  		goto _12
 43428  	}
 43429  	_cksum += uint32(*elem1(_zMaster, uintptr(_nMaster)))
 43430  	_nMaster += 1
 43431  	goto _9
 43432  _12:
 43433  	if _pPager.XfullSync != 0 {
 43434  		_pPager.XjournalOff = _journalHdrOffset(tls, _pPager)
 43435  	}
 43436  	_iHdrOff = _pPager.XjournalOff
 43437  	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)))) {
 43438  		return _rc
 43439  	}
 43440  	_pPager.XjournalOff += int64(_nMaster + int32(20))
 43441  	if (int32(0) == store2(&_rc, _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.Xjfd), &_jrnlSize))) && (_jrnlSize > _pPager.XjournalOff) {
 43442  		_rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pPager.Xjfd), _pPager.XjournalOff)
 43443  	}
 43444  	return _rc
 43445  }
 43446  
 43447  var _writeMasterJournalØ00__func__Ø000 [19]int8
 43448  
 43449  func init() {
 43450  	crt.Xstrncpy(nil, &_writeMasterJournalØ00__func__Ø000[0], str(56468), 19)
 43451  }
 43452  
 43453  // C comment
 43454  //  /*
 43455  //  ** Sync the journal. In other words, make sure all the pages that have
 43456  //  ** been written to the journal have actually reached the surface of the
 43457  //  ** disk and can be restored in the event of a hot-journal rollback.
 43458  //  **
 43459  //  ** If the Pager.noSync flag is set, then this function is a no-op.
 43460  //  ** Otherwise, the actions required depend on the journal-mode and the
 43461  //  ** device characteristics of the file-system, as follows:
 43462  //  **
 43463  //  **   * If the journal file is an in-memory journal file, no action need
 43464  //  **     be taken.
 43465  //  **
 43466  //  **   * Otherwise, if the device does not support the SAFE_APPEND property,
 43467  //  **     then the nRec field of the most recently written journal header
 43468  //  **     is updated to contain the number of journal records that have
 43469  //  **     been written following it. If the pager is operating in full-sync
 43470  //  **     mode, then the journal file is synced before this field is updated.
 43471  //  **
 43472  //  **   * If the device does not support the SEQUENTIAL property, then
 43473  //  **     journal file is synced.
 43474  //  **
 43475  //  ** Or, in pseudo-code:
 43476  //  **
 43477  //  **   if( NOT <in-memory journal> ){
 43478  //  **     if( NOT SAFE_APPEND ){
 43479  //  **       if( <full-sync mode> ) xSync(<journal file>);
 43480  //  **       <update nRec field>
 43481  //  **     }
 43482  //  **     if( NOT SEQUENTIAL ) xSync(<journal file>);
 43483  //  **   }
 43484  //  **
 43485  //  ** If successful, this routine clears the PGHDR_NEED_SYNC flag of every
 43486  //  ** page currently held in memory before returning SQLITE_OK. If an IO
 43487  //  ** error is encountered, then the IO error code is returned to the caller.
 43488  //  */
 43489  func _syncJournal(tls *crt.TLS, _pPager *XPager, _newHdr int32) (r0 int32) {
 43490  	var _rc, _2_iDc int32
 43491  	var _3_iNextHdrOffset int64
 43492  	var _3_aMagic [8]uint8
 43493  	var _3_zHeader [12]uint8
 43494  	func() {
 43495  		if int32(_pPager.XeState) != int32(3) && int32(_pPager.XeState) != int32(4) {
 43496  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51120), unsafe.Pointer(&_syncJournalØ00__func__Ø000), unsafe.Pointer(str(54996)))
 43497  			crt.X__builtin_abort(tls)
 43498  		}
 43499  	}()
 43500  	func() {
 43501  		if _assert_pager_state(tls, _pPager) == 0 {
 43502  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51123), unsafe.Pointer(&_syncJournalØ00__func__Ø000), unsafe.Pointer(str(10971)))
 43503  			crt.X__builtin_abort(tls)
 43504  		}
 43505  	}()
 43506  	func() {
 43507  		if (*XWal)(_pPager.XpWal) != nil {
 43508  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51124), unsafe.Pointer(&_syncJournalØ00__func__Ø000), unsafe.Pointer(str(12123)))
 43509  			crt.X__builtin_abort(tls)
 43510  		}
 43511  	}()
 43512  	_rc = _sqlite3PagerExclusiveLock(tls, _pPager)
 43513  	if _rc != int32(0) {
 43514  		return _rc
 43515  	}
 43516  	if _pPager.XnoSync != 0 {
 43517  		goto _8
 43518  	}
 43519  	func() {
 43520  		if _pPager.XtempFile != 0 {
 43521  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51130), unsafe.Pointer(&_syncJournalØ00__func__Ø000), unsafe.Pointer(str(51639)))
 43522  			crt.X__builtin_abort(tls)
 43523  		}
 43524  	}()
 43525  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil || int32(_pPager.XjournalMode) == int32(4) {
 43526  		goto _12
 43527  	}
 43528  	_2_iDc = _sqlite3OsDeviceCharacteristics(tls, (*Xsqlite3_file)(_pPager.Xfd))
 43529  	func() {
 43530  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) == nil {
 43531  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51133), unsafe.Pointer(&_syncJournalØ00__func__Ø000), unsafe.Pointer(str(13581)))
 43532  			crt.X__builtin_abort(tls)
 43533  		}
 43534  	}()
 43535  	if int32(0) != (_2_iDc & int32(512)) {
 43536  		goto _15
 43537  	}
 43538  	crt.Xmemcpy(tls, unsafe.Pointer(&_3_zHeader), unsafe.Pointer(&_aJournalMagic), uint32(8))
 43539  	_sqlite3Put4byte(tls, elem15((*uint8)(unsafe.Pointer(&_3_zHeader)), uintptr(8)), uint32(_pPager.XnRec))
 43540  	_3_iNextHdrOffset = _journalHdrOffset(tls, _pPager)
 43541  	_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.Xjfd), unsafe.Pointer(&_3_aMagic), int32(8), _3_iNextHdrOffset)
 43542  	if (_rc == int32(0)) && (int32(0) == crt.Xmemcmp(tls, unsafe.Pointer(&_3_aMagic), unsafe.Pointer(&_aJournalMagic), uint32(8))) {
 43543  		_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.Xjfd), unsafe.Pointer(&_syncJournalØ00zerobyteØ001), int32(1), _3_iNextHdrOffset)
 43544  	}
 43545  	if (_rc != int32(0)) && (_rc != int32(522)) {
 43546  		return _rc
 43547  	}
 43548  	if _pPager.XfullSync == 0 || int32(0) != (_2_iDc&int32(1024)) {
 43549  		goto _21
 43550  	}
 43551  	_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pPager.Xjfd), int32(_pPager.XsyncFlags))
 43552  	if _rc != int32(0) {
 43553  		return _rc
 43554  	}
 43555  _21:
 43556  	_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.Xjfd), unsafe.Pointer(&_3_zHeader), int32(12), _pPager.XjournalHdr)
 43557  	if _rc != int32(0) {
 43558  		return _rc
 43559  	}
 43560  _15:
 43561  	if int32(0) != (_2_iDc & int32(1024)) {
 43562  		goto _24
 43563  	}
 43564  	_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pPager.Xjfd), int32(_pPager.XsyncFlags)|func() int32 {
 43565  		if int32(_pPager.XsyncFlags) == int32(3) {
 43566  			return int32(16)
 43567  		}
 43568  		return int32(0)
 43569  	}())
 43570  	if _rc != int32(0) {
 43571  		return _rc
 43572  	}
 43573  _24:
 43574  	_pPager.XjournalHdr = _pPager.XjournalOff
 43575  	if _newHdr == 0 || int32(0) != (_2_iDc&int32(512)) {
 43576  		goto _29
 43577  	}
 43578  	_pPager.XnRec = int32(0)
 43579  	_rc = _writeJournalHdr(tls, _pPager)
 43580  	if _rc != int32(0) {
 43581  		return _rc
 43582  	}
 43583  _29:
 43584  	goto _31
 43585  _12:
 43586  	_pPager.XjournalHdr = _pPager.XjournalOff
 43587  _31:
 43588  _8:
 43589  	_sqlite3PcacheClearSyncFlags(tls, (*XPCache)(_pPager.XpPCache))
 43590  	_pPager.XeState = uint8(4)
 43591  	func() {
 43592  		if _assert_pager_state(tls, _pPager) == 0 {
 43593  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51224), unsafe.Pointer(&_syncJournalØ00__func__Ø000), unsafe.Pointer(str(10971)))
 43594  			crt.X__builtin_abort(tls)
 43595  		}
 43596  	}()
 43597  	return int32(0)
 43598  
 43599  	_ = _3_aMagic
 43600  	_ = _3_zHeader
 43601  	panic(0)
 43602  }
 43603  
 43604  var _syncJournalØ00__func__Ø000 [12]int8
 43605  
 43606  func init() {
 43607  	crt.Xstrncpy(nil, &_syncJournalØ00__func__Ø000[0], str(56487), 12)
 43608  }
 43609  
 43610  // C comment
 43611  //  /*
 43612  //  ** This function may only be called while a write-transaction is active in
 43613  //  ** rollback. If the connection is in WAL mode, this call is a no-op.
 43614  //  ** Otherwise, if the connection does not already have an EXCLUSIVE lock on
 43615  //  ** the database file, an attempt is made to obtain one.
 43616  //  **
 43617  //  ** If the EXCLUSIVE lock is already held or the attempt to obtain it is
 43618  //  ** successful, or the connection is in WAL mode, SQLITE_OK is returned.
 43619  //  ** Otherwise, either SQLITE_BUSY or an SQLITE_IOERR_XXX error code is
 43620  //  ** returned.
 43621  //  */
 43622  func _sqlite3PagerExclusiveLock(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 43623  	var _rc int32
 43624  	_rc = _pPager.XerrCode
 43625  	func() {
 43626  		if _assert_pager_state(tls, _pPager) == 0 {
 43627  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53181), unsafe.Pointer(&_sqlite3PagerExclusiveLockØ00__func__Ø000), unsafe.Pointer(str(10971)))
 43628  			crt.X__builtin_abort(tls)
 43629  		}
 43630  	}()
 43631  	if _rc != int32(0) {
 43632  		goto _2
 43633  	}
 43634  	func() {
 43635  		if int32(_pPager.XeState) != int32(3) && int32(_pPager.XeState) != int32(4) && int32(_pPager.XeState) != int32(2) {
 43636  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53183), unsafe.Pointer(&_sqlite3PagerExclusiveLockØ00__func__Ø000), unsafe.Pointer(str(56499)))
 43637  			crt.X__builtin_abort(tls)
 43638  		}
 43639  	}()
 43640  	func() {
 43641  		if _assert_pager_state(tls, _pPager) == 0 {
 43642  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53187), unsafe.Pointer(&_sqlite3PagerExclusiveLockØ00__func__Ø000), unsafe.Pointer(str(10971)))
 43643  			crt.X__builtin_abort(tls)
 43644  		}
 43645  	}()
 43646  	if int32(0) == bool2int((*XWal)(_pPager.XpWal) != nil) {
 43647  		_rc = _pager_wait_on_lock(tls, _pPager, int32(4))
 43648  	}
 43649  _2:
 43650  	return _rc
 43651  }
 43652  
 43653  var _sqlite3PagerExclusiveLockØ00__func__Ø000 [26]int8
 43654  
 43655  func init() {
 43656  	crt.Xstrncpy(nil, &_sqlite3PagerExclusiveLockØ00__func__Ø000[0], str(56614), 26)
 43657  }
 43658  
 43659  var _syncJournalØ00zerobyteØ001 uint8
 43660  
 43661  // C comment
 43662  //  /*
 43663  //  ** Clear the PGHDR_NEED_SYNC flag from all dirty pages.
 43664  //  */
 43665  func _sqlite3PcacheClearSyncFlags(tls *crt.TLS, _pCache *XPCache) {
 43666  	var _p *XPgHdr
 43667  	_p = (*XPgHdr)(_pCache.XpDirty)
 43668  _0:
 43669  	if _p == nil {
 43670  		goto _3
 43671  	}
 43672  	{
 43673  		p := &_p.Xflags
 43674  		*p = uint16(int32(*p) & int32(-9))
 43675  	}
 43676  	_p = (*XPgHdr)(_p.XpDirtyNext)
 43677  	goto _0
 43678  _3:
 43679  	*(**XPgHdr)(unsafe.Pointer(&_pCache.XpSynced)) = (*XPgHdr)(_pCache.XpDirtyTail)
 43680  }
 43681  
 43682  // C comment
 43683  //  /*
 43684  //  ** The argument is the first in a linked list of dirty pages connected
 43685  //  ** by the PgHdr.pDirty pointer. This function writes each one of the
 43686  //  ** in-memory pages in the list to the database file. The argument may
 43687  //  ** be NULL, representing an empty list. In this case this function is
 43688  //  ** a no-op.
 43689  //  **
 43690  //  ** The pager must hold at least a RESERVED lock when this function
 43691  //  ** is called. Before writing anything to the database file, this lock
 43692  //  ** is upgraded to an EXCLUSIVE lock. If the lock cannot be obtained,
 43693  //  ** SQLITE_BUSY is returned and no data is written to the database file.
 43694  //  **
 43695  //  ** If the pager is a temp-file pager and the actual file-system file
 43696  //  ** is not yet open, it is created and opened before any data is
 43697  //  ** written out.
 43698  //  **
 43699  //  ** Once the lock has been upgraded and, if necessary, the file opened,
 43700  //  ** the pages are written out to the database file in list order. Writing
 43701  //  ** a page is skipped if it meets either of the following criteria:
 43702  //  **
 43703  //  **   * The page number is greater than Pager.dbSize, or
 43704  //  **   * The PGHDR_DONT_WRITE flag is set on the page.
 43705  //  **
 43706  //  ** If writing out a page causes the database file to grow, Pager.dbFileSize
 43707  //  ** is updated accordingly. If page 1 is written out, then the value cached
 43708  //  ** in Pager.dbFileVers[] is updated to match the new value stored in
 43709  //  ** the database file.
 43710  //  **
 43711  //  ** If everything is successful, SQLITE_OK is returned. If an IO error
 43712  //  ** occurs, an IO error code is returned. Or, if the EXCLUSIVE lock cannot
 43713  //  ** be obtained, SQLITE_BUSY is returned.
 43714  //  */
 43715  func _pager_write_pagelist(tls *crt.TLS, _pPager *XPager, _pList *XPgHdr) (r0 int32) {
 43716  	var _rc int32
 43717  	var _2_szFile, _4_offset int64
 43718  	var _3_pgno uint32
 43719  	var _4_pData *int8
 43720  	_rc = int32(0)
 43721  	func() {
 43722  		if (*XWal)(_pPager.XpWal) != nil {
 43723  			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)))
 43724  			crt.X__builtin_abort(tls)
 43725  		}
 43726  	}()
 43727  	func() {
 43728  		if _pPager.XtempFile == 0 && int32(_pPager.XeState) != int32(4) {
 43729  			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)))
 43730  			crt.X__builtin_abort(tls)
 43731  		}
 43732  	}()
 43733  	func() {
 43734  		if int32(_pPager.XeLock) != int32(4) {
 43735  			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)))
 43736  			crt.X__builtin_abort(tls)
 43737  		}
 43738  	}()
 43739  	func() {
 43740  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil && (*XPgHdr)(_pList.XpDirty) != nil {
 43741  			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)))
 43742  			crt.X__builtin_abort(tls)
 43743  		}
 43744  	}()
 43745  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil {
 43746  		func() {
 43747  			if _pPager.XtempFile == 0 || _rc != int32(0) {
 43748  				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)))
 43749  				crt.X__builtin_abort(tls)
 43750  			}
 43751  		}()
 43752  		_rc = _pagerOpentemp(tls, _pPager, (*Xsqlite3_file)(_pPager.Xfd), int32(_pPager.XvfsFlags))
 43753  	}
 43754  	func() {
 43755  		if _rc == int32(0) && (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil {
 43756  			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)))
 43757  			crt.X__builtin_abort(tls)
 43758  		}
 43759  	}()
 43760  	if ((_rc == int32(0)) && (_pPager.XdbHintSize < _pPager.XdbSize)) && ((_pList.XpDirty != nil) || (_pList.Xpgno > _pPager.XdbHintSize)) {
 43761  		_2_szFile = int64(_pPager.XpageSize) * int64(_pPager.XdbSize)
 43762  		_sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pPager.Xfd), int32(5), unsafe.Pointer(&_2_szFile))
 43763  		_pPager.XdbHintSize = _pPager.XdbSize
 43764  	}
 43765  _20:
 43766  	if _rc != int32(0) || _pList == nil {
 43767  		goto _22
 43768  	}
 43769  	_3_pgno = _pList.Xpgno
 43770  	if _3_pgno > _pPager.XdbSize || int32(0) != (int32(_pList.Xflags)&int32(16)) {
 43771  		goto _25
 43772  	}
 43773  	_4_offset = int64(_3_pgno-uint32(1)) * int64(_pPager.XpageSize)
 43774  	func() {
 43775  		if (int32(_pList.Xflags) & int32(8)) != int32(0) {
 43776  			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)))
 43777  			crt.X__builtin_abort(tls)
 43778  		}
 43779  	}()
 43780  	if _pList.Xpgno == uint32(1) {
 43781  		_pager_write_changecounter(tls, _pList)
 43782  	}
 43783  	_4_pData = (*int8)(_pList.XpData)
 43784  	_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.Xfd), unsafe.Pointer(_4_pData), _pPager.XpageSize, _4_offset)
 43785  	if _3_pgno == uint32(1) {
 43786  		crt.Xmemcpy(tls, unsafe.Pointer(&_pPager.XdbFileVers), unsafe.Pointer(elem1(_4_pData, uintptr(24))), uint32(16))
 43787  	}
 43788  	if _3_pgno > _pPager.XdbFileSize {
 43789  		_pPager.XdbFileSize = _3_pgno
 43790  	}
 43791  	*elem8((*int32)(unsafe.Pointer(&_pPager.XaStat)), uintptr(2)) += 1
 43792  	_sqlite3BackupUpdate(tls, (*Xsqlite3_backup)(_pPager.XpBackup), _3_pgno, (*uint8)(_pList.XpData))
 43793  	goto _31
 43794  _25:
 43795  _31:
 43796  	_pList = (*XPgHdr)(_pList.XpDirty)
 43797  	goto _20
 43798  _22:
 43799  	return _rc
 43800  
 43801  	_ = _2_szFile
 43802  	panic(0)
 43803  }
 43804  
 43805  var _pager_write_pagelistØ00__func__Ø000 [21]int8
 43806  
 43807  func init() {
 43808  	crt.Xstrncpy(nil, &_pager_write_pagelistØ00__func__Ø000[0], str(56838), 21)
 43809  }
 43810  
 43811  // C comment
 43812  //  /*
 43813  //  ** Open a temporary file.
 43814  //  **
 43815  //  ** Write the file descriptor into *pFile. Return SQLITE_OK on success
 43816  //  ** or some other error code if we fail. The OS will automatically
 43817  //  ** delete the temporary file when it is closed.
 43818  //  **
 43819  //  ** The flags passed to the VFS layer xOpen() call are those specified
 43820  //  ** by parameter vfsFlags ORed with the following:
 43821  //  **
 43822  //  **     SQLITE_OPEN_READWRITE
 43823  //  **     SQLITE_OPEN_CREATE
 43824  //  **     SQLITE_OPEN_EXCLUSIVE
 43825  //  **     SQLITE_OPEN_DELETEONCLOSE
 43826  //  */
 43827  func _pagerOpentemp(tls *crt.TLS, _pPager *XPager, _pFile *Xsqlite3_file, _vfsFlags int32) (r0 int32) {
 43828  	var _rc int32
 43829  	_vfsFlags |= int32(30)
 43830  	_rc = _sqlite3OsOpen(tls, (*Xsqlite3_vfs)(_pPager.XpVfs), nil, _pFile, _vfsFlags, nil)
 43831  	func() {
 43832  		if _rc == int32(0) && (*Xsqlite3_io_methods)(_pFile.XpMethods) == nil {
 43833  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50570), unsafe.Pointer(&_pagerOpentempØ00__func__Ø000), unsafe.Pointer(str(56859)))
 43834  			crt.X__builtin_abort(tls)
 43835  		}
 43836  	}()
 43837  	return _rc
 43838  }
 43839  
 43840  var _pagerOpentempØ00__func__Ø000 [14]int8
 43841  
 43842  func init() {
 43843  	crt.Xstrncpy(nil, &_pagerOpentempØ00__func__Ø000[0], str(56890), 14)
 43844  }
 43845  
 43846  // C comment
 43847  //  /*
 43848  //  ** Commit the transaction currently in progress.
 43849  //  **
 43850  //  ** This routine implements the second phase of a 2-phase commit.  The
 43851  //  ** sqlite3BtreeCommitPhaseOne() routine does the first phase and should
 43852  //  ** be invoked prior to calling this routine.  The sqlite3BtreeCommitPhaseOne()
 43853  //  ** routine did all the work of writing information out to disk and flushing the
 43854  //  ** contents so that they are written onto the disk platter.  All this
 43855  //  ** routine has to do is delete or truncate or zero the header in the
 43856  //  ** the rollback journal (which causes the transaction to commit) and
 43857  //  ** drop locks.
 43858  //  **
 43859  //  ** Normally, if an error occurs while the pager layer is attempting to
 43860  //  ** finalize the underlying journal file, this function returns an error and
 43861  //  ** the upper layer will attempt a rollback. However, if the second argument
 43862  //  ** is non-zero then this b-tree transaction is part of a multi-file
 43863  //  ** transaction. In this case, the transaction has already been committed
 43864  //  ** (by deleting a master journal file) and the caller will ignore this
 43865  //  ** functions return code. So, even if an error occurs in the pager layer,
 43866  //  ** reset the b-tree objects internal state to indicate that the write
 43867  //  ** transaction has been closed. This is quite safe, as the pager will have
 43868  //  ** transitioned to the error state.
 43869  //  **
 43870  //  ** This will release the write lock on the database file.  If there
 43871  //  ** are no active cursors, it also releases the read lock.
 43872  //  */
 43873  func _sqlite3BtreeCommitPhaseTwo(tls *crt.TLS, _p *XBtree, _bCleanup int32) (r0 int32) {
 43874  	var _1_rc int32
 43875  	var _1_pBt *XBtShared
 43876  	if int32(_p.XinTrans) == int32(0) {
 43877  		return int32(0)
 43878  	}
 43879  	_sqlite3BtreeEnter(tls, _p)
 43880  	func() {
 43881  		if int32((*XBtShared)(_p.XpBt).XinTransaction) == int32(0) && ((*XBtShared)(_p.XpBt).XnTransaction) != int32(0) {
 43882  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62924), unsafe.Pointer(&_sqlite3BtreeCommitPhaseTwoØ00__func__Ø000), unsafe.Pointer(str(9932)))
 43883  			crt.X__builtin_abort(tls)
 43884  		}
 43885  	}()
 43886  	func() {
 43887  		if int32((*XBtShared)(_p.XpBt).XinTransaction) < int32(_p.XinTrans) {
 43888  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62924), unsafe.Pointer(&_sqlite3BtreeCommitPhaseTwoØ00__func__Ø000), unsafe.Pointer(str(9993)))
 43889  			crt.X__builtin_abort(tls)
 43890  		}
 43891  	}()
 43892  	if int32(_p.XinTrans) != int32(2) {
 43893  		goto _6
 43894  	}
 43895  	_1_pBt = (*XBtShared)(_p.XpBt)
 43896  	func() {
 43897  		if int32(_1_pBt.XinTransaction) != int32(2) {
 43898  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62932), unsafe.Pointer(&_sqlite3BtreeCommitPhaseTwoØ00__func__Ø000), unsafe.Pointer(str(56904)))
 43899  			crt.X__builtin_abort(tls)
 43900  		}
 43901  	}()
 43902  	func() {
 43903  		if _1_pBt.XnTransaction <= int32(0) {
 43904  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62933), unsafe.Pointer(&_sqlite3BtreeCommitPhaseTwoØ00__func__Ø000), unsafe.Pointer(str(56936)))
 43905  			crt.X__builtin_abort(tls)
 43906  		}
 43907  	}()
 43908  	_1_rc = _sqlite3PagerCommitPhaseTwo(tls, (*XPager)(_1_pBt.XpPager))
 43909  	if (_1_rc != int32(0)) && (_bCleanup == int32(0)) {
 43910  		_sqlite3BtreeLeave(tls, _p)
 43911  		return _1_rc
 43912  	}
 43913  	_p.XiDataVersion -= 1
 43914  	_1_pBt.XinTransaction = uint8(1)
 43915  	_btreeClearHasContent(tls, _1_pBt)
 43916  _6:
 43917  	_btreeEndTransaction(tls, _p)
 43918  	_sqlite3BtreeLeave(tls, _p)
 43919  	return int32(0)
 43920  }
 43921  
 43922  var _sqlite3BtreeCommitPhaseTwoØ00__func__Ø000 [27]int8
 43923  
 43924  func init() {
 43925  	crt.Xstrncpy(nil, &_sqlite3BtreeCommitPhaseTwoØ00__func__Ø000[0], str(56956), 27)
 43926  }
 43927  
 43928  // C comment
 43929  //  /*
 43930  //  ** When this function is called, the database file has been completely
 43931  //  ** updated to reflect the changes made by the current transaction and
 43932  //  ** synced to disk. The journal file still exists in the file-system
 43933  //  ** though, and if a failure occurs at this point it will eventually
 43934  //  ** be used as a hot-journal and the current transaction rolled back.
 43935  //  **
 43936  //  ** This function finalizes the journal file, either by deleting,
 43937  //  ** truncating or partially zeroing it, so that it cannot be used
 43938  //  ** for hot-journal rollback. Once this is done the transaction is
 43939  //  ** irrevocably committed.
 43940  //  **
 43941  //  ** If an error occurs, an IO error code is returned and the pager
 43942  //  ** moves into the error state. Otherwise, SQLITE_OK is returned.
 43943  //  */
 43944  func _sqlite3PagerCommitPhaseTwo(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 43945  	var _rc int32
 43946  	_rc = int32(0)
 43947  	if func() int32 {
 43948  		if _pPager.XerrCode != 0 {
 43949  			return func() int32 {
 43950  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53404), unsafe.Pointer(&_sqlite3PagerCommitPhaseTwoØ00__func__Ø000), unsafe.Pointer(str(4809)))
 43951  				crt.X__builtin_abort(tls)
 43952  				return int32(1)
 43953  			}()
 43954  		}
 43955  		return int32(0)
 43956  	}() != 0 {
 43957  		return _pPager.XerrCode
 43958  	}
 43959  	func() {
 43960  		if int32(_pPager.XeState) != int32(2) && int32(_pPager.XeState) != int32(5) && ((*XWal)(_pPager.XpWal) == nil || int32(_pPager.XeState) != int32(3)) {
 43961  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53406), unsafe.Pointer(&_sqlite3PagerCommitPhaseTwoØ00__func__Ø000), unsafe.Pointer(str(56983)))
 43962  			crt.X__builtin_abort(tls)
 43963  		}
 43964  	}()
 43965  	func() {
 43966  		if _assert_pager_state(tls, _pPager) == 0 {
 43967  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53410), unsafe.Pointer(&_sqlite3PagerCommitPhaseTwoØ00__func__Ø000), unsafe.Pointer(str(10971)))
 43968  			crt.X__builtin_abort(tls)
 43969  		}
 43970  	}()
 43971  	if ((int32(_pPager.XeState) == int32(2)) && (_pPager.XexclusiveMode != 0)) && (int32(_pPager.XjournalMode) == int32(1)) {
 43972  		func() {
 43973  			if _pPager.XjournalOff != int64(_pPager.XsectorSize) && _pPager.XjournalOff != 0 {
 43974  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53427), unsafe.Pointer(&_sqlite3PagerCommitPhaseTwoØ00__func__Ø000), unsafe.Pointer(str(57126)))
 43975  				crt.X__builtin_abort(tls)
 43976  			}
 43977  		}()
 43978  		_pPager.XeState = uint8(1)
 43979  		return int32(0)
 43980  	}
 43981  	_pPager.XiDataVersion += 1
 43982  	_rc = _pager_end_transaction(tls, _pPager, int32(_pPager.XsetMaster), int32(1))
 43983  	return _pager_error(tls, _pPager, _rc)
 43984  }
 43985  
 43986  var _sqlite3PagerCommitPhaseTwoØ00__func__Ø000 [27]int8
 43987  
 43988  func init() {
 43989  	crt.Xstrncpy(nil, &_sqlite3PagerCommitPhaseTwoØ00__func__Ø000[0], str(57192), 27)
 43990  }
 43991  
 43992  // C comment
 43993  //  /*
 43994  //  ** Set the number of result columns that will be returned by this SQL
 43995  //  ** statement. This is now set at compile time, rather than during
 43996  //  ** execution of the vdbe program so that sqlite3_column_count() can
 43997  //  ** be called on an SQL statement before sqlite3_step().
 43998  //  */
 43999  func _sqlite3VdbeSetNumCols(tls *crt.TLS, _p *TVdbe, _nResColumn int32) {
 44000  	var _n int32
 44001  	var _db *Xsqlite3
 44002  	var _pColName *XMem
 44003  	_db = (*Xsqlite3)(_p.Xdb)
 44004  	_releaseMemArray(tls, (*XMem)(_p.XaColName), int32(_p.XnResColumn)*int32(2))
 44005  	_sqlite3DbFree(tls, _db, _p.XaColName)
 44006  	_n = _nResColumn * int32(2)
 44007  	_p.XnResColumn = uint16(_nResColumn)
 44008  	*(**XMem)(unsafe.Pointer(&_p.XaColName)) = store25(&_pColName, (*XMem)(_sqlite3DbMallocRawNN(tls, _db, uint64(uint32(48)*uint32(_n)))))
 44009  	if (*XMem)(_p.XaColName) == nil {
 44010  		return
 44011  	}
 44012  	_initMemArray(tls, (*XMem)(_p.XaColName), _n, (*Xsqlite3)(_p.Xdb), uint16(1))
 44013  	_ = _pColName
 44014  }
 44015  
 44016  // C comment
 44017  //  /*
 44018  //  ** Release an array of N Mem elements
 44019  //  */
 44020  func _releaseMemArray(tls *crt.TLS, _p *XMem, _N int32) {
 44021  	var _1_db *Xsqlite3
 44022  	var _1_pEnd *XMem
 44023  	if _p == nil || _N == 0 {
 44024  		goto _1
 44025  	}
 44026  	_1_pEnd = elem25(_p, uintptr(_N))
 44027  	_1_db = (*Xsqlite3)(_p.Xdb)
 44028  	if _1_db.XpnBytesFreed == nil {
 44029  		goto _2
 44030  	}
 44031  _3:
 44032  	if _p.XszMalloc != 0 {
 44033  		_sqlite3DbFree(tls, _1_db, unsafe.Pointer(_p.XzMalloc))
 44034  	}
 44035  	if crt.P2U(unsafe.Pointer(preInc25(&_p, 48))) < crt.P2U(unsafe.Pointer(_1_pEnd)) {
 44036  		goto _3
 44037  	}
 44038  	return
 44039  _2:
 44040  	func() {
 44041  		if elem25(_p, uintptr(1)) != _1_pEnd && (*Xsqlite3)(elem25(_p, 0).Xdb) != (*Xsqlite3)(elem25(_p, uintptr(1)).Xdb) {
 44042  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72960), unsafe.Pointer(&_releaseMemArrayØ00__func__Ø000), unsafe.Pointer(str(57219)))
 44043  			crt.X__builtin_abort(tls)
 44044  		}
 44045  	}()
 44046  	func() {
 44047  		if _sqlite3VdbeCheckMemInvariants(tls, _p) == 0 {
 44048  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72961), unsafe.Pointer(&_releaseMemArrayØ00__func__Ø000), unsafe.Pointer(str(6078)))
 44049  			crt.X__builtin_abort(tls)
 44050  		}
 44051  	}()
 44052  	if (int32(_p.Xflags) & int32(9312)) != 0 {
 44053  		_sqlite3VdbeMemRelease(tls, _p)
 44054  		goto _13
 44055  	}
 44056  	if _p.XszMalloc != 0 {
 44057  		_sqlite3DbFreeNN(tls, _1_db, unsafe.Pointer(_p.XzMalloc))
 44058  		_p.XszMalloc = int32(0)
 44059  	}
 44060  _13:
 44061  	_p.Xflags = uint16(128)
 44062  	if crt.P2U(unsafe.Pointer(preInc25(&_p, 48))) < crt.P2U(unsafe.Pointer(_1_pEnd)) {
 44063  		goto _2
 44064  	}
 44065  _1:
 44066  }
 44067  
 44068  var _releaseMemArrayØ00__func__Ø000 [16]int8
 44069  
 44070  func init() {
 44071  	crt.Xstrncpy(nil, &_releaseMemArrayØ00__func__Ø000[0], str(57253), 16)
 44072  }
 44073  
 44074  // C comment
 44075  //  /*
 44076  //  ** Initialize an array of N Mem element.
 44077  //  */
 44078  func _initMemArray(tls *crt.TLS, _p *XMem, _N int32, _db *Xsqlite3, _flags uint16) {
 44079  _0:
 44080  	if postInc2(&_N, -1) > int32(0) {
 44081  		*(**Xsqlite3)(unsafe.Pointer(&_p.Xdb)) = _db
 44082  		_p.Xflags = _flags
 44083  		_p.XszMalloc = int32(0)
 44084  		*(**XMem)(unsafe.Pointer(&_p.XpScopyFrom)) = nil
 44085  		*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(48)
 44086  		goto _0
 44087  	}
 44088  }
 44089  
 44090  // C comment
 44091  //  /*
 44092  //  ** Set the name of the idx'th column to be returned by the SQL statement.
 44093  //  ** zName must be a pointer to a nul terminated string.
 44094  //  **
 44095  //  ** This call must be made after a call to sqlite3VdbeSetNumCols().
 44096  //  **
 44097  //  ** The final parameter, xDel, must be one of SQLITE_DYNAMIC, SQLITE_STATIC
 44098  //  ** or SQLITE_TRANSIENT. If it is SQLITE_DYNAMIC, then the buffer pointed
 44099  //  ** to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed.
 44100  //  */
 44101  func _sqlite3VdbeSetColName(tls *crt.TLS, _p *TVdbe, _idx int32, _var int32, _zName *int8, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
 44102  	var _rc int32
 44103  	var _pColName *XMem
 44104  	func() {
 44105  		if _idx >= int32(_p.XnResColumn) {
 44106  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73615), unsafe.Pointer(&_sqlite3VdbeSetColNameØ00__func__Ø000), unsafe.Pointer(str(57269)))
 44107  			crt.X__builtin_abort(tls)
 44108  		}
 44109  	}()
 44110  	func() {
 44111  		if _var >= int32(2) {
 44112  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73616), unsafe.Pointer(&_sqlite3VdbeSetColNameØ00__func__Ø000), unsafe.Pointer(str(57287)))
 44113  			crt.X__builtin_abort(tls)
 44114  		}
 44115  	}()
 44116  	if ((*Xsqlite3)(_p.Xdb).XmallocFailed) != 0 {
 44117  		func() {
 44118  			if _zName != nil && *(*uintptr)(unsafe.Pointer(&struct {
 44119  				f func(*crt.TLS, unsafe.Pointer)
 44120  			}{_xDel})) == *(*uintptr)(unsafe.Pointer(&struct {
 44121  				f func(*crt.TLS, unsafe.Pointer)
 44122  			}{func() func(*crt.TLS, unsafe.Pointer) {
 44123  				v := _sqlite3MallocSize
 44124  				return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
 44125  			}()})) {
 44126  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73618), unsafe.Pointer(&_sqlite3VdbeSetColNameØ00__func__Ø000), unsafe.Pointer(str(57301)))
 44127  				crt.X__builtin_abort(tls)
 44128  			}
 44129  		}()
 44130  		return _sqlite3NomemError(tls, int32(73619))
 44131  	}
 44132  	func() {
 44133  		if (*XMem)(_p.XaColName) == nil {
 44134  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73621), unsafe.Pointer(&_sqlite3VdbeSetColNameØ00__func__Ø000), unsafe.Pointer(str(57332)))
 44135  			crt.X__builtin_abort(tls)
 44136  		}
 44137  	}()
 44138  	_pColName = elem25((*XMem)(_p.XaColName), uintptr(_idx+(_var*int32(_p.XnResColumn))))
 44139  	_rc = _sqlite3VdbeMemSetStr(tls, _pColName, _zName, int32(-1), uint8(1), _xDel)
 44140  	func() {
 44141  		if _rc == int32(0) && _zName != nil && (int32(_pColName.Xflags)&int32(512)) == int32(0) {
 44142  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73624), unsafe.Pointer(&_sqlite3VdbeSetColNameØ00__func__Ø000), unsafe.Pointer(str(57347)))
 44143  			crt.X__builtin_abort(tls)
 44144  		}
 44145  	}()
 44146  	return _rc
 44147  }
 44148  
 44149  var _sqlite3VdbeSetColNameØ00__func__Ø000 [22]int8
 44150  
 44151  func init() {
 44152  	crt.Xstrncpy(nil, &_sqlite3VdbeSetColNameØ00__func__Ø000[0], str(57396), 22)
 44153  }
 44154  
 44155  var _sqlite3PrepareØ00azColNameØ001 [12]*int8
 44156  
 44157  func init() {
 44158  	_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)}
 44159  }
 44160  
 44161  // C comment
 44162  //  /*
 44163  //  ** Remember the SQL string for a prepared statement.
 44164  //  */
 44165  func _sqlite3VdbeSetSql(tls *crt.TLS, _p *TVdbe, _z *int8, _n int32, _isPrepareV2 int32) {
 44166  	func() {
 44167  		if _isPrepareV2 != int32(1) && _isPrepareV2 != int32(0) {
 44168  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71478), unsafe.Pointer(&_sqlite3VdbeSetSqlØ00__func__Ø000), unsafe.Pointer(str(57475)))
 44169  			crt.X__builtin_abort(tls)
 44170  		}
 44171  	}()
 44172  	if _p == nil {
 44173  		return
 44174  	}
 44175  	if _isPrepareV2 == 0 {
 44176  		_p.Xexpmask = 0
 44177  	}
 44178  	func() {
 44179  		if _p.XzSql != nil {
 44180  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71484), unsafe.Pointer(&_sqlite3VdbeSetSqlØ00__func__Ø000), unsafe.Pointer(str(57508)))
 44181  			crt.X__builtin_abort(tls)
 44182  		}
 44183  	}()
 44184  	_p.XzSql = _sqlite3DbStrNDup(tls, (*Xsqlite3)(_p.Xdb), _z, uint64(_n))
 44185  	storebits26(&_p.Xexpired, int16(uint8(_isPrepareV2)), 512, 9)
 44186  }
 44187  
 44188  var _sqlite3VdbeSetSqlØ00__func__Ø000 [18]int8
 44189  
 44190  func init() {
 44191  	crt.Xstrncpy(nil, &_sqlite3VdbeSetSqlØ00__func__Ø000[0], str(57519), 18)
 44192  }
 44193  
 44194  // C comment
 44195  //  /*
 44196  //  ** Clean up and delete a VDBE after execution.  Return an integer which is
 44197  //  ** the result code.  Write any error message text into *pzErrMsg.
 44198  //  */
 44199  func _sqlite3VdbeFinalize(tls *crt.TLS, _p *TVdbe) (r0 int32) {
 44200  	var _rc int32
 44201  	_rc = int32(0)
 44202  	if (_p.Xmagic == uint32(770837923)) || (_p.Xmagic == uint32(832317811)) {
 44203  		_rc = _sqlite3VdbeReset(tls, _p)
 44204  		func() {
 44205  			if (_rc & ((*Xsqlite3)(_p.Xdb).XerrMask)) != _rc {
 44206  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74365), unsafe.Pointer(&_sqlite3VdbeFinalizeØ00__func__Ø000), unsafe.Pointer(str(57537)))
 44207  				crt.X__builtin_abort(tls)
 44208  			}
 44209  		}()
 44210  	}
 44211  	_sqlite3VdbeDelete(tls, _p)
 44212  	return _rc
 44213  }
 44214  
 44215  // C comment
 44216  //  /*
 44217  //  ** Clean up a VDBE after execution but do not delete the VDBE just yet.
 44218  //  ** Write any error messages into *pzErrMsg.  Return the result code.
 44219  //  **
 44220  //  ** After this routine is run, the VDBE should be ready to be executed
 44221  //  ** again.
 44222  //  **
 44223  //  ** To look at it another way, this routine resets the state of the
 44224  //  ** virtual machine from VDBE_MAGIC_RUN or VDBE_MAGIC_HALT back to
 44225  //  ** VDBE_MAGIC_INIT.
 44226  //  */
 44227  func _sqlite3VdbeReset(tls *crt.TLS, _p *TVdbe) (r0 int32) {
 44228  	var _db *Xsqlite3
 44229  	_db = (*Xsqlite3)(_p.Xdb)
 44230  	_sqlite3VdbeHalt(tls, _p)
 44231  	if _p.Xpc < int32(0) {
 44232  		goto _0
 44233  	}
 44234  	_sqlite3VdbeTransferError(tls, _p)
 44235  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_p.XzErrMsg))
 44236  	_p.XzErrMsg = nil
 44237  	if ((uint32(_p.Xexpired>>5) << 31) >> 31) != 0 {
 44238  		storebits26(&_p.Xexpired, int16(1), 1, 0)
 44239  	}
 44240  	goto _4
 44241  _0:
 44242  	if _p.Xrc != 0 && (((uint32(_p.Xexpired) << 31) >> 31) != 0) {
 44243  		_sqlite3ErrorWithMsg(tls, _db, _p.Xrc, func() *int8 {
 44244  			if _p.XzErrMsg != nil {
 44245  				return str(24531)
 44246  			}
 44247  			return nil
 44248  		}(), unsafe.Pointer(_p.XzErrMsg))
 44249  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_p.XzErrMsg))
 44250  		_p.XzErrMsg = nil
 44251  	}
 44252  _4:
 44253  	_Cleanup(tls, _p)
 44254  	_p.Xmagic = uint32(1224384374)
 44255  	return _p.Xrc & _db.XerrMask
 44256  }
 44257  
 44258  // C comment
 44259  //  /*
 44260  //  ** This routine is called the when a VDBE tries to halt.  If the VDBE
 44261  //  ** has made changes and is in autocommit mode, then commit those
 44262  //  ** changes.  If a rollback is needed, then do the rollback.
 44263  //  **
 44264  //  ** This routine is the only way to move the state of a VM from
 44265  //  ** SQLITE_MAGIC_RUN to SQLITE_MAGIC_HALT.  It is harmless to
 44266  //  ** call this on a VM that is in the SQLITE_MAGIC_HALT state.
 44267  //  **
 44268  //  ** Return an error code.  If the commit could not complete because of
 44269  //  ** lock contention, return SQLITE_BUSY.  If SQLITE_BUSY is returned, it
 44270  //  ** means the close did not happen and needs to be repeated.
 44271  //  */
 44272  func _sqlite3VdbeHalt(tls *crt.TLS, _p *TVdbe) (r0 int32) {
 44273  	var _rc, _3_mrc, _3_eStatementOp, _3_isSpecialError int32
 44274  	var _db *Xsqlite3
 44275  	_db = (*Xsqlite3)(_p.Xdb)
 44276  	if _p.Xmagic != uint32(770837923) {
 44277  		return int32(0)
 44278  	}
 44279  	if _db.XmallocFailed != 0 {
 44280  		_p.Xrc = _sqlite3NomemError(tls, int32(74044))
 44281  	}
 44282  	_closeAllCursors(tls, _p)
 44283  	_checkActiveVdbeCnt(tls, _db)
 44284  	if _p.Xpc < int32(0) || ((uint32(_p.Xexpired>>8)<<31)>>31) == 0 {
 44285  		goto _3
 44286  	}
 44287  	_3_eStatementOp = int32(0)
 44288  	_sqlite3VdbeEnter(tls, _p)
 44289  	_3_mrc = _p.Xrc & int32(255)
 44290  	_3_isSpecialError = bool2int((((_3_mrc == int32(7)) || (_3_mrc == int32(10))) || (_3_mrc == int32(9))) || (_3_mrc == int32(13)))
 44291  	if _3_isSpecialError == 0 {
 44292  		goto _7
 44293  	}
 44294  	if ((uint32(_p.Xexpired>>7)<<31)>>31) != 0 && _3_mrc == int32(9) {
 44295  		goto _9
 44296  	}
 44297  	if ((_3_mrc == int32(7)) || (_3_mrc == int32(13))) && (((uint32(_p.Xexpired>>6) << 31) >> 31) != 0) {
 44298  		_3_eStatementOp = int32(2)
 44299  		goto _13
 44300  	}
 44301  	_sqlite3RollbackAll(tls, _db, int32(516))
 44302  	_sqlite3CloseSavepoints(tls, _db)
 44303  	_db.XautoCommit = uint8(1)
 44304  	_p.XnChange = int32(0)
 44305  _13:
 44306  _9:
 44307  _7:
 44308  	if _p.Xrc == int32(0) {
 44309  		_sqlite3VdbeCheckFk(tls, _p, int32(0))
 44310  	}
 44311  	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)) {
 44312  		goto _18
 44313  	}
 44314  	if _p.Xrc != int32(0) && (int32(_p.XerrorAction) != int32(3) || _3_isSpecialError != 0) {
 44315  		goto _21
 44316  	}
 44317  	_rc = _sqlite3VdbeCheckFk(tls, _p, int32(1))
 44318  	if _rc == int32(0) {
 44319  		goto _22
 44320  	}
 44321  	if func() int32 {
 44322  		if ((uint32(_p.Xexpired>>7) << 31) >> 31) != 0 {
 44323  			return func() int32 {
 44324  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74109), unsafe.Pointer(&_sqlite3VdbeHaltØ00__func__Ø000), unsafe.Pointer(str(4809)))
 44325  				crt.X__builtin_abort(tls)
 44326  				return int32(1)
 44327  			}()
 44328  		}
 44329  		return int32(0)
 44330  	}() != 0 {
 44331  		_sqlite3VdbeLeave(tls, _p)
 44332  		return int32(1)
 44333  	}
 44334  	_rc = int32(787)
 44335  	goto _26
 44336  _22:
 44337  	_rc = _vdbeCommit(tls, _db, _p)
 44338  _26:
 44339  	if (_rc == int32(5)) && (((uint32(_p.Xexpired>>7) << 31) >> 31) != 0) {
 44340  		_sqlite3VdbeLeave(tls, _p)
 44341  		return int32(5)
 44342  	}
 44343  	if _rc != int32(0) {
 44344  		_p.Xrc = _rc
 44345  		_sqlite3RollbackAll(tls, _db, int32(0))
 44346  		_p.XnChange = int32(0)
 44347  		goto _31
 44348  	}
 44349  	_db.XnDeferredCons = 0
 44350  	_db.XnDeferredImmCons = 0
 44351  	_db.Xflags &= int32(-33554433)
 44352  	_sqlite3CommitInternalChanges(tls, _db)
 44353  _31:
 44354  	goto _32
 44355  _21:
 44356  	_sqlite3RollbackAll(tls, _db, int32(0))
 44357  	_p.XnChange = int32(0)
 44358  _32:
 44359  	_db.XnStatement = int32(0)
 44360  	goto _34
 44361  _18:
 44362  	if _3_eStatementOp != int32(0) {
 44363  		goto _34
 44364  	}
 44365  	if (_p.Xrc == int32(0)) || (int32(_p.XerrorAction) == int32(3)) {
 44366  		_3_eStatementOp = int32(1)
 44367  		goto _39
 44368  	}
 44369  	if int32(_p.XerrorAction) == int32(2) {
 44370  		_3_eStatementOp = int32(2)
 44371  		goto _39
 44372  	}
 44373  	_sqlite3RollbackAll(tls, _db, int32(516))
 44374  	_sqlite3CloseSavepoints(tls, _db)
 44375  	_db.XautoCommit = uint8(1)
 44376  	_p.XnChange = int32(0)
 44377  _39:
 44378  _34:
 44379  	if _3_eStatementOp == 0 {
 44380  		goto _40
 44381  	}
 44382  	_rc = _sqlite3VdbeCloseStatement(tls, _p, _3_eStatementOp)
 44383  	if _rc == 0 {
 44384  		goto _41
 44385  	}
 44386  	if (_p.Xrc == int32(0)) || ((_p.Xrc & int32(255)) == int32(19)) {
 44387  		_p.Xrc = _rc
 44388  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_p.XzErrMsg))
 44389  		_p.XzErrMsg = nil
 44390  	}
 44391  	_sqlite3RollbackAll(tls, _db, int32(516))
 44392  	_sqlite3CloseSavepoints(tls, _db)
 44393  	_db.XautoCommit = uint8(1)
 44394  	_p.XnChange = int32(0)
 44395  _41:
 44396  _40:
 44397  	if ((uint32(_p.Xexpired>>4) << 31) >> 31) == 0 {
 44398  		goto _44
 44399  	}
 44400  	if _3_eStatementOp != int32(2) {
 44401  		_sqlite3VdbeSetChanges(tls, _db, _p.XnChange)
 44402  		goto _46
 44403  	}
 44404  	_sqlite3VdbeSetChanges(tls, _db, int32(0))
 44405  _46:
 44406  	_p.XnChange = int32(0)
 44407  _44:
 44408  	_sqlite3VdbeLeave(tls, _p)
 44409  _3:
 44410  	if _p.Xpc < int32(0) {
 44411  		goto _47
 44412  	}
 44413  	_db.XnVdbeActive -= 1
 44414  	if ((uint32(_p.Xexpired>>7) << 31) >> 31) == 0 {
 44415  		_db.XnVdbeWrite -= 1
 44416  	}
 44417  	if ((uint32(_p.Xexpired>>8) << 31) >> 31) != 0 {
 44418  		_db.XnVdbeRead -= 1
 44419  	}
 44420  	func() {
 44421  		if _db.XnVdbeActive < _db.XnVdbeRead {
 44422  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74194), unsafe.Pointer(&_sqlite3VdbeHaltØ00__func__Ø000), unsafe.Pointer(str(57563)))
 44423  			crt.X__builtin_abort(tls)
 44424  		}
 44425  	}()
 44426  	func() {
 44427  		if _db.XnVdbeRead < _db.XnVdbeWrite {
 44428  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74195), unsafe.Pointer(&_sqlite3VdbeHaltØ00__func__Ø000), unsafe.Pointer(str(57594)))
 44429  			crt.X__builtin_abort(tls)
 44430  		}
 44431  	}()
 44432  	func() {
 44433  		if _db.XnVdbeWrite < int32(0) {
 44434  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74196), unsafe.Pointer(&_sqlite3VdbeHaltØ00__func__Ø000), unsafe.Pointer(str(57624)))
 44435  			crt.X__builtin_abort(tls)
 44436  		}
 44437  	}()
 44438  _47:
 44439  	_p.Xmagic = uint32(832317811)
 44440  	_checkActiveVdbeCnt(tls, _db)
 44441  	if _db.XmallocFailed != 0 {
 44442  		_p.Xrc = _sqlite3NomemError(tls, int32(74201))
 44443  	}
 44444  	if _db.XautoCommit != 0 {
 44445  	}
 44446  	func() {
 44447  		if _db.XnVdbeActive <= int32(0) && int32(_db.XautoCommit) != int32(0) && _db.XnStatement != int32(0) {
 44448  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74212), unsafe.Pointer(&_sqlite3VdbeHaltØ00__func__Ø000), unsafe.Pointer(str(57642)))
 44449  			crt.X__builtin_abort(tls)
 44450  		}
 44451  	}()
 44452  	return func() int32 {
 44453  		if _p.Xrc == int32(5) {
 44454  			return int32(5)
 44455  		}
 44456  		return int32(0)
 44457  	}()
 44458  }
 44459  
 44460  // C comment
 44461  //  /*
 44462  //  ** Close all cursors.
 44463  //  **
 44464  //  ** Also release any dynamic memory held by the VM in the Vdbe.aMem memory
 44465  //  ** cell array. This is necessary as the memory cell array may contain
 44466  //  ** pointers to VdbeFrame objects, which may in turn contain pointers to
 44467  //  ** open cursors.
 44468  //  */
 44469  func _closeAllCursors(tls *crt.TLS, _p *TVdbe) {
 44470  	var _1_pFrame, _3_pDel *XVdbeFrame
 44471  	if _p.XpFrame == nil {
 44472  		goto _0
 44473  	}
 44474  	_1_pFrame = (*XVdbeFrame)(_p.XpFrame)
 44475  _1:
 44476  	if _1_pFrame.XpParent == nil {
 44477  		goto _4
 44478  	}
 44479  	_1_pFrame = (*XVdbeFrame)(_1_pFrame.XpParent)
 44480  	goto _1
 44481  _4:
 44482  	_sqlite3VdbeFrameRestore(tls, _1_pFrame)
 44483  	*(**XVdbeFrame)(unsafe.Pointer(&_p.XpFrame)) = nil
 44484  	_p.XnFrame = int32(0)
 44485  _0:
 44486  	func() {
 44487  		if _p.XnFrame != int32(0) {
 44488  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73539), unsafe.Pointer(&_closeAllCursorsØ00__func__Ø000), unsafe.Pointer(str(57702)))
 44489  			crt.X__builtin_abort(tls)
 44490  		}
 44491  	}()
 44492  	_closeCursorsInFrame(tls, _p)
 44493  	if _p.XaMem != nil {
 44494  		_releaseMemArray(tls, (*XMem)(_p.XaMem), _p.XnMem)
 44495  	}
 44496  _7:
 44497  	if _p.XpDelFrame != nil {
 44498  		_3_pDel = (*XVdbeFrame)(_p.XpDelFrame)
 44499  		*(**XVdbeFrame)(unsafe.Pointer(&_p.XpDelFrame)) = (*XVdbeFrame)(_3_pDel.XpParent)
 44500  		_sqlite3VdbeFrameDelete(tls, _3_pDel)
 44501  		goto _7
 44502  	}
 44503  	if _p.XpAuxData != nil {
 44504  		_sqlite3VdbeDeleteAuxData(tls, (*Xsqlite3)(_p.Xdb), (**XAuxData)(unsafe.Pointer(&_p.XpAuxData)), int32(-1), int32(0))
 44505  	}
 44506  	func() {
 44507  		if (*XAuxData)(_p.XpAuxData) != nil {
 44508  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73552), unsafe.Pointer(&_closeAllCursorsØ00__func__Ø000), unsafe.Pointer(str(57715)))
 44509  			crt.X__builtin_abort(tls)
 44510  		}
 44511  	}()
 44512  }
 44513  
 44514  // C comment
 44515  //  /*
 44516  //  ** Copy the values stored in the VdbeFrame structure to its Vdbe. This
 44517  //  ** is used, for example, when a trigger sub-program is halted to restore
 44518  //  ** control to the main program.
 44519  //  */
 44520  func _sqlite3VdbeFrameRestore(tls *crt.TLS, _pFrame *XVdbeFrame) (r0 int32) {
 44521  	var _v *TVdbe
 44522  	_v = (*TVdbe)(_pFrame.Xv)
 44523  	_closeCursorsInFrame(tls, _v)
 44524  	*(**XVdbeOp)(unsafe.Pointer(&_v.XaOp)) = (*XVdbeOp)(_pFrame.XaOp)
 44525  	_v.XnOp = _pFrame.XnOp
 44526  	*(**XMem)(unsafe.Pointer(&_v.XaMem)) = (*XMem)(_pFrame.XaMem)
 44527  	_v.XnMem = _pFrame.XnMem
 44528  	*(***XVdbeCursor)(unsafe.Pointer(&_v.XapCsr)) = (**XVdbeCursor)(unsafe.Pointer(_pFrame.XapCsr))
 44529  	_v.XnCursor = _pFrame.XnCursor
 44530  	(*Xsqlite3)(_v.Xdb).XlastRowid = _pFrame.XlastRowid
 44531  	_v.XnChange = _pFrame.XnChange
 44532  	(*Xsqlite3)(_v.Xdb).XnChange = _pFrame.XnDbChange
 44533  	_sqlite3VdbeDeleteAuxData(tls, (*Xsqlite3)(_v.Xdb), (**XAuxData)(unsafe.Pointer(&_v.XpAuxData)), int32(-1), int32(0))
 44534  	*(**XAuxData)(unsafe.Pointer(&_v.XpAuxData)) = (*XAuxData)(_pFrame.XpAuxData)
 44535  	*(**XAuxData)(unsafe.Pointer(&_pFrame.XpAuxData)) = nil
 44536  	return _pFrame.Xpc
 44537  }
 44538  
 44539  // C comment
 44540  //  /*
 44541  //  ** Close all cursors in the current frame.
 44542  //  */
 44543  func _closeCursorsInFrame(tls *crt.TLS, _p *TVdbe) {
 44544  	var _1_i int32
 44545  	var _2_pC *XVdbeCursor
 44546  	if _p.XapCsr == nil {
 44547  		goto _0
 44548  	}
 44549  	_1_i = int32(0)
 44550  _1:
 44551  	if _1_i >= _p.XnCursor {
 44552  		goto _4
 44553  	}
 44554  	_2_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_1_i))
 44555  	if _2_pC != nil {
 44556  		_sqlite3VdbeFreeCursor(tls, _p, _2_pC)
 44557  		*elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_1_i)) = nil
 44558  	}
 44559  	_1_i += 1
 44560  	goto _1
 44561  _4:
 44562  _0:
 44563  }
 44564  
 44565  // C comment
 44566  //  /*
 44567  //  ** Close a VDBE cursor and release all the resources that cursor
 44568  //  ** happens to hold.
 44569  //  */
 44570  func _sqlite3VdbeFreeCursor(tls *crt.TLS, _p *TVdbe, _pCx *XVdbeCursor) {
 44571  	var _7_pVCur *Xsqlite3_vtab_cursor
 44572  	var _7_pModule *Xsqlite3_module
 44573  	if _pCx == nil {
 44574  		return
 44575  	}
 44576  	func() {
 44577  		if (*XBtree)(_pCx.XpBtx) != nil && int32(_pCx.XeCurType) != int32(0) {
 44578  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73451), unsafe.Pointer(&_sqlite3VdbeFreeCursorØ00__func__Ø000), unsafe.Pointer(str(57730)))
 44579  			crt.X__builtin_abort(tls)
 44580  		}
 44581  	}()
 44582  	switch int32(_pCx.XeCurType) {
 44583  	case int32(0):
 44584  		goto _6
 44585  	case int32(1):
 44586  		goto _5
 44587  	case int32(2):
 44588  		goto _7
 44589  	default:
 44590  		goto _8
 44591  	}
 44592  
 44593  _5:
 44594  	_sqlite3VdbeSorterClose(tls, (*Xsqlite3)(_p.Xdb), _pCx)
 44595  	goto _8
 44596  _6:
 44597  	if ((uint32(_pCx.XisEphemeral) << 31) >> 31) == 0 {
 44598  		goto _9
 44599  	}
 44600  	if _pCx.XpBtx != nil {
 44601  		_sqlite3BtreeClose(tls, (*XBtree)(_pCx.XpBtx))
 44602  	}
 44603  	goto _11
 44604  _9:
 44605  	func() {
 44606  		if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_pCx.Xuc))) == nil {
 44607  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73463), unsafe.Pointer(&_sqlite3VdbeFreeCursorØ00__func__Ø000), unsafe.Pointer(str(57775)))
 44608  			crt.X__builtin_abort(tls)
 44609  		}
 44610  	}()
 44611  	_sqlite3BtreeCloseCursor(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_pCx.Xuc))))
 44612  _11:
 44613  	goto _8
 44614  _7:
 44615  	_7_pVCur = (*Xsqlite3_vtab_cursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_pCx.Xuc)))
 44616  	_7_pModule = (*Xsqlite3_module)((*Xsqlite3_vtab)(_7_pVCur.XpVtab).XpModule)
 44617  	func() {
 44618  		if ((*Xsqlite3_vtab)(_7_pVCur.XpVtab).XnRef) <= int32(0) {
 44619  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73472), unsafe.Pointer(&_sqlite3VdbeFreeCursorØ00__func__Ø000), unsafe.Pointer(str(57794)))
 44620  			crt.X__builtin_abort(tls)
 44621  		}
 44622  	}()
 44623  	(*Xsqlite3_vtab)(_7_pVCur.XpVtab).XnRef -= 1
 44624  	func() func(*crt.TLS, *Xsqlite3_vtab_cursor) int32 {
 44625  		v := _7_pModule.XxClose
 44626  		return *(*func(*crt.TLS, *Xsqlite3_vtab_cursor) int32)(unsafe.Pointer(&v))
 44627  	}()(tls, _7_pVCur)
 44628  	goto _8
 44629  _8:
 44630  }
 44631  
 44632  var _sqlite3VdbeFreeCursorØ00__func__Ø000 [22]int8
 44633  
 44634  func init() {
 44635  	crt.Xstrncpy(nil, &_sqlite3VdbeFreeCursorØ00__func__Ø000[0], str(57815), 22)
 44636  }
 44637  
 44638  // C comment
 44639  //  /*
 44640  //  ** Free any cursor components allocated by sqlite3VdbeSorterXXX routines.
 44641  //  */
 44642  func _sqlite3VdbeSorterClose(tls *crt.TLS, _db *Xsqlite3, _pCsr *XVdbeCursor) {
 44643  	var _pSorter *XVdbeSorter
 44644  	func() {
 44645  		if int32(_pCsr.XeCurType) != int32(1) {
 44646  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87275), unsafe.Pointer(&_sqlite3VdbeSorterCloseØ00__func__Ø000), unsafe.Pointer(str(57837)))
 44647  			crt.X__builtin_abort(tls)
 44648  		}
 44649  	}()
 44650  	_pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer(&_pCsr.Xuc)))
 44651  	if _pSorter != nil {
 44652  		_sqlite3VdbeSorterReset(tls, _db, _pSorter)
 44653  		Xsqlite3_free(tls, unsafe.Pointer(_pSorter.Xlist.XaMemory))
 44654  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_pSorter))
 44655  		*(**XVdbeSorter)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pCsr.Xuc)))) = nil
 44656  	}
 44657  }
 44658  
 44659  var _sqlite3VdbeSorterCloseØ00__func__Ø000 [23]int8
 44660  
 44661  func init() {
 44662  	crt.Xstrncpy(nil, &_sqlite3VdbeSorterCloseØ00__func__Ø000[0], str(57868), 23)
 44663  }
 44664  
 44665  // C comment
 44666  //  /*
 44667  //  ** Reset a sorting cursor back to its original empty state.
 44668  //  */
 44669  func _sqlite3VdbeSorterReset(tls *crt.TLS, _db *Xsqlite3, _pSorter *XVdbeSorter) {
 44670  	var _i int32
 44671  	var _2_pTask *XSortSubtask
 44672  	_vdbeSorterJoinAll(tls, _pSorter, int32(0))
 44673  	func() {
 44674  		if _pSorter.XbUseThreads == 0 && (*XPmaReader)(_pSorter.XpReader) != nil {
 44675  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87243), unsafe.Pointer(&_sqlite3VdbeSorterResetØ00__func__Ø000), unsafe.Pointer(str(57891)))
 44676  			crt.X__builtin_abort(tls)
 44677  		}
 44678  	}()
 44679  	if _pSorter.XpReader != nil {
 44680  		_vdbePmaReaderClear(tls, (*XPmaReader)(_pSorter.XpReader))
 44681  		_sqlite3DbFree(tls, _db, _pSorter.XpReader)
 44682  		*(**XPmaReader)(unsafe.Pointer(&_pSorter.XpReader)) = nil
 44683  	}
 44684  	_vdbeMergeEngineFree(tls, (*XMergeEngine)(_pSorter.XpMerger))
 44685  	*(**XMergeEngine)(unsafe.Pointer(&_pSorter.XpMerger)) = nil
 44686  	_i = int32(0)
 44687  _4:
 44688  	if _i >= int32(_pSorter.XnTask) {
 44689  		goto _7
 44690  	}
 44691  	_2_pTask = elem78((*XSortSubtask)(unsafe.Pointer(&_pSorter.XaTask)), uintptr(_i))
 44692  	_vdbeSortSubtaskCleanup(tls, _db, _2_pTask)
 44693  	*(**XVdbeSorter)(unsafe.Pointer(&_2_pTask.XpSorter)) = _pSorter
 44694  	_i += 1
 44695  	goto _4
 44696  _7:
 44697  	if (_pSorter.Xlist.XaMemory) == nil {
 44698  		_vdbeSorterRecordFree(tls, nil, (*XSorterRecord)(_pSorter.Xlist.XpList))
 44699  	}
 44700  	*(**XSorterRecord)(unsafe.Pointer(&(_pSorter.Xlist.XpList))) = nil
 44701  	_pSorter.Xlist.XszPMA = int32(0)
 44702  	_pSorter.XbUsePMA = 0
 44703  	_pSorter.XiMemory = int32(0)
 44704  	_pSorter.XmxKeysize = int32(0)
 44705  	_sqlite3DbFree(tls, _db, _pSorter.XpUnpacked)
 44706  	*(**XUnpackedRecord)(unsafe.Pointer(&_pSorter.XpUnpacked)) = nil
 44707  }
 44708  
 44709  // C comment
 44710  //  /*
 44711  //  ** Join all outstanding threads launched by SorterWrite() to create
 44712  //  ** level-0 PMAs.
 44713  //  */
 44714  func _vdbeSorterJoinAll(tls *crt.TLS, _pSorter *XVdbeSorter, _rcin int32) (r0 int32) {
 44715  	var _rc, _i, _1_rc2 int32
 44716  	var _1_pTask *XSortSubtask
 44717  	_rc = _rcin
 44718  	_i = int32(_pSorter.XnTask) - int32(1)
 44719  _0:
 44720  	if _i < int32(0) {
 44721  		goto _3
 44722  	}
 44723  	_1_pTask = elem78((*XSortSubtask)(unsafe.Pointer(&_pSorter.XaTask)), uintptr(_i))
 44724  	_1_rc2 = _vdbeSorterJoinThread(tls, _1_pTask)
 44725  	if _rc == int32(0) {
 44726  		_rc = _1_rc2
 44727  	}
 44728  	_i -= 1
 44729  	goto _0
 44730  _3:
 44731  	return _rc
 44732  }
 44733  
 44734  // C comment
 44735  //  /*
 44736  //  ** Join thread pTask->thread.
 44737  //  */
 44738  func _vdbeSorterJoinThread(tls *crt.TLS, _pTask *XSortSubtask) (r0 int32) {
 44739  	var _rc int32
 44740  	var _1_pRet unsafe.Pointer
 44741  	_rc = int32(0)
 44742  	if _pTask.XpThread != nil {
 44743  		_1_pRet = crt.U2P(1)
 44744  		_sqlite3ThreadJoin(tls, (*XSQLiteThread)(_pTask.XpThread), &_1_pRet)
 44745  		_rc = int32(crt.P2U(_1_pRet))
 44746  		func() {
 44747  			if _pTask.XbDone != int32(1) {
 44748  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87133), unsafe.Pointer(&_vdbeSorterJoinThreadØ00__func__Ø000), unsafe.Pointer(str(57935)))
 44749  				crt.X__builtin_abort(tls)
 44750  			}
 44751  		}()
 44752  		_pTask.XbDone = int32(0)
 44753  		*(**XSQLiteThread)(unsafe.Pointer(&_pTask.XpThread)) = nil
 44754  	}
 44755  	return _rc
 44756  }
 44757  
 44758  // C comment
 44759  //  /* Get the results of the thread */
 44760  func _sqlite3ThreadJoin(tls *crt.TLS, _p *XSQLiteThread, _ppOut *unsafe.Pointer) (r0 int32) {
 44761  	var _rc int32
 44762  	func() {
 44763  		if _ppOut == nil {
 44764  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(26937), unsafe.Pointer(&_sqlite3ThreadJoinØ00__func__Ø000), unsafe.Pointer(str(57951)))
 44765  			crt.X__builtin_abort(tls)
 44766  		}
 44767  	}()
 44768  	if func() int32 {
 44769  		if _p == nil {
 44770  			return func() int32 {
 44771  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(26938), unsafe.Pointer(&_sqlite3ThreadJoinØ00__func__Ø000), unsafe.Pointer(str(4809)))
 44772  				crt.X__builtin_abort(tls)
 44773  				return int32(1)
 44774  			}()
 44775  		}
 44776  		return int32(0)
 44777  	}() != 0 {
 44778  		return _sqlite3NomemError(tls, int32(26938))
 44779  	}
 44780  	if _p.Xdone != 0 {
 44781  		*_ppOut = _p.XpOut
 44782  		_rc = int32(0)
 44783  		goto _6
 44784  	}
 44785  	_rc = func() int32 {
 44786  		if crt.Xpthread_join(tls, _p.Xtid, _ppOut) != 0 {
 44787  			return int32(1)
 44788  		}
 44789  		return int32(0)
 44790  	}()
 44791  _6:
 44792  	Xsqlite3_free(tls, unsafe.Pointer(_p))
 44793  	return _rc
 44794  }
 44795  
 44796  var _sqlite3ThreadJoinØ00__func__Ø000 [18]int8
 44797  
 44798  func init() {
 44799  	crt.Xstrncpy(nil, &_sqlite3ThreadJoinØ00__func__Ø000[0], str(57960), 18)
 44800  }
 44801  
 44802  var _vdbeSorterJoinThreadØ00__func__Ø000 [21]int8
 44803  
 44804  func init() {
 44805  	crt.Xstrncpy(nil, &_vdbeSorterJoinThreadØ00__func__Ø000[0], str(57978), 21)
 44806  }
 44807  
 44808  var _sqlite3VdbeSorterResetØ00__func__Ø000 [23]int8
 44809  
 44810  func init() {
 44811  	crt.Xstrncpy(nil, &_sqlite3VdbeSorterResetØ00__func__Ø000[0], str(57999), 23)
 44812  }
 44813  
 44814  // C comment
 44815  //  /*
 44816  //  ** Free all memory belonging to the PmaReader object passed as the
 44817  //  ** argument. All structure fields are set to zero before returning.
 44818  //  */
 44819  func _vdbePmaReaderClear(tls *crt.TLS, _pReadr *XPmaReader) {
 44820  	Xsqlite3_free(tls, unsafe.Pointer(_pReadr.XaAlloc))
 44821  	Xsqlite3_free(tls, unsafe.Pointer(_pReadr.XaBuffer))
 44822  	if _pReadr.XaMap != nil {
 44823  		_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pReadr.XpFd), 0, unsafe.Pointer(_pReadr.XaMap))
 44824  	}
 44825  	_vdbeIncrFree(tls, (*XIncrMerger)(_pReadr.XpIncr))
 44826  	crt.Xmemset(tls, unsafe.Pointer(_pReadr), int32(0), uint32(52))
 44827  }
 44828  
 44829  // C comment
 44830  //  /*
 44831  //  ** Free all resources associated with the IncrMerger object indicated by
 44832  //  ** the first argument.
 44833  //  */
 44834  func _vdbeIncrFree(tls *crt.TLS, _pIncr *XIncrMerger) {
 44835  	if _pIncr == nil {
 44836  		goto _0
 44837  	}
 44838  	if _pIncr.XbUseThread == 0 {
 44839  		goto _1
 44840  	}
 44841  	_vdbeSorterJoinThread(tls, (*XSortSubtask)(_pIncr.XpTask))
 44842  	if (elem79((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), 0).XpFd) != nil {
 44843  		_sqlite3OsCloseFree(tls, (*Xsqlite3_file)(elem79((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), 0).XpFd))
 44844  	}
 44845  	if (elem79((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), uintptr(1)).XpFd) != nil {
 44846  		_sqlite3OsCloseFree(tls, (*Xsqlite3_file)(elem79((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), uintptr(1)).XpFd))
 44847  	}
 44848  _1:
 44849  	_vdbeMergeEngineFree(tls, (*XMergeEngine)(_pIncr.XpMerger))
 44850  	Xsqlite3_free(tls, unsafe.Pointer(_pIncr))
 44851  _0:
 44852  }
 44853  
 44854  func _sqlite3OsCloseFree(tls *crt.TLS, _pFile *Xsqlite3_file) {
 44855  	func() {
 44856  		if _pFile == nil {
 44857  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(20383), unsafe.Pointer(&_sqlite3OsCloseFreeØ00__func__Ø000), unsafe.Pointer(str(58022)))
 44858  			crt.X__builtin_abort(tls)
 44859  		}
 44860  	}()
 44861  	_sqlite3OsClose(tls, _pFile)
 44862  	Xsqlite3_free(tls, unsafe.Pointer(_pFile))
 44863  }
 44864  
 44865  var _sqlite3OsCloseFreeØ00__func__Ø000 [19]int8
 44866  
 44867  func init() {
 44868  	crt.Xstrncpy(nil, &_sqlite3OsCloseFreeØ00__func__Ø000[0], str(58028), 19)
 44869  }
 44870  
 44871  // C comment
 44872  //  /*
 44873  //  ** Free the MergeEngine object passed as the only argument.
 44874  //  */
 44875  func _vdbeMergeEngineFree(tls *crt.TLS, _pMerger *XMergeEngine) {
 44876  	var _i int32
 44877  	if _pMerger == nil {
 44878  		goto _0
 44879  	}
 44880  	_i = int32(0)
 44881  _1:
 44882  	if _i >= _pMerger.XnTree {
 44883  		goto _4
 44884  	}
 44885  	_vdbePmaReaderClear(tls, elem80((*XPmaReader)(_pMerger.XaReadr), uintptr(_i)))
 44886  	_i += 1
 44887  	goto _1
 44888  _4:
 44889  _0:
 44890  	Xsqlite3_free(tls, unsafe.Pointer(_pMerger))
 44891  }
 44892  
 44893  // C comment
 44894  //  /*
 44895  //  ** Free all resources owned by the object indicated by argument pTask. All
 44896  //  ** fields of *pTask are zeroed before returning.
 44897  //  */
 44898  func _vdbeSortSubtaskCleanup(tls *crt.TLS, _db *Xsqlite3, _pTask *XSortSubtask) {
 44899  	_sqlite3DbFree(tls, _db, _pTask.XpUnpacked)
 44900  	if (_pTask.Xlist.XaMemory) != nil {
 44901  		Xsqlite3_free(tls, unsafe.Pointer(_pTask.Xlist.XaMemory))
 44902  		goto _1
 44903  	}
 44904  	func() {
 44905  		if (_pTask.Xlist.XaMemory) != nil {
 44906  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87067), unsafe.Pointer(&_vdbeSortSubtaskCleanupØ00__func__Ø000), unsafe.Pointer(str(58047)))
 44907  			crt.X__builtin_abort(tls)
 44908  		}
 44909  	}()
 44910  	_vdbeSorterRecordFree(tls, nil, (*XSorterRecord)(_pTask.Xlist.XpList))
 44911  _1:
 44912  	if (_pTask.Xfile.XpFd) != nil {
 44913  		_sqlite3OsCloseFree(tls, (*Xsqlite3_file)(_pTask.Xfile.XpFd))
 44914  	}
 44915  	if (_pTask.Xfile2.XpFd) != nil {
 44916  		_sqlite3OsCloseFree(tls, (*Xsqlite3_file)(_pTask.Xfile2.XpFd))
 44917  	}
 44918  	crt.Xmemset(tls, unsafe.Pointer(_pTask), int32(0), uint32(60))
 44919  }
 44920  
 44921  var _vdbeSortSubtaskCleanupØ00__func__Ø000 [23]int8
 44922  
 44923  func init() {
 44924  	crt.Xstrncpy(nil, &_vdbeSortSubtaskCleanupØ00__func__Ø000[0], str(58070), 23)
 44925  }
 44926  
 44927  // C comment
 44928  //  /*
 44929  //  ** Free the list of sorted records starting at pRecord.
 44930  //  */
 44931  func _vdbeSorterRecordFree(tls *crt.TLS, _db *Xsqlite3, _pRecord *XSorterRecord) {
 44932  	var _p, _pNext *XSorterRecord
 44933  	_p = _pRecord
 44934  _0:
 44935  	if _p == nil {
 44936  		goto _3
 44937  	}
 44938  	_pNext = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))
 44939  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_p))
 44940  	_p = _pNext
 44941  	goto _0
 44942  _3:
 44943  }
 44944  
 44945  // C comment
 44946  //  /*
 44947  //  ** If parameter iOp is less than zero, then invoke the destructor for
 44948  //  ** all auxiliary data pointers currently cached by the VM passed as
 44949  //  ** the first argument.
 44950  //  **
 44951  //  ** Or, if iOp is greater than or equal to zero, then the destructor is
 44952  //  ** only invoked for those auxiliary data pointers created by the user
 44953  //  ** function invoked by the OP_Function opcode at instruction iOp of
 44954  //  ** VM pVdbe, and only then if:
 44955  //  **
 44956  //  **    * the associated function parameter is the 32nd or later (counting
 44957  //  **      from left to right), or
 44958  //  **
 44959  //  **    * the corresponding bit in argument mask is clear (where the first
 44960  //  **      function parameter corresponds to bit 0 etc.).
 44961  //  */
 44962  func _sqlite3VdbeDeleteAuxData(tls *crt.TLS, _db *Xsqlite3, _pp **XAuxData, _iOp int32, _mask int32) {
 44963  	var _1_pAux *XAuxData
 44964  _0:
 44965  	if (*_pp) == nil {
 44966  		goto _1
 44967  	}
 44968  	_1_pAux = *_pp
 44969  	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) {
 44970  		goto _6
 44971  	}
 44972  	if _1_pAux.XxDeleteAux != nil {
 44973  		_1_pAux.XxDeleteAux(tls, _1_pAux.XpAux)
 44974  	}
 44975  	*_pp = (*XAuxData)(_1_pAux.XpNextAux)
 44976  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_1_pAux))
 44977  	goto _8
 44978  _6:
 44979  	_pp = (**XAuxData)(unsafe.Pointer(&_1_pAux.XpNextAux))
 44980  _8:
 44981  	goto _0
 44982  _1:
 44983  }
 44984  
 44985  var _closeAllCursorsØ00__func__Ø000 [16]int8
 44986  
 44987  func init() {
 44988  	crt.Xstrncpy(nil, &_closeAllCursorsØ00__func__Ø000[0], str(58093), 16)
 44989  }
 44990  
 44991  // C comment
 44992  //  /*
 44993  //  ** Delete a VdbeFrame object and its contents. VdbeFrame objects are
 44994  //  ** allocated by the OP_Program opcode in sqlite3VdbeExec().
 44995  //  */
 44996  func _sqlite3VdbeFrameDelete(tls *crt.TLS, _p *XVdbeFrame) {
 44997  	var _i int32
 44998  	var _aMem *XMem
 44999  	var _apCsr **XVdbeCursor
 45000  	_aMem = (*XMem)(unsafe.Pointer(elem15((*uint8)(unsafe.Pointer(_p)), uintptr(80))))
 45001  	_apCsr = (**XVdbeCursor)(unsafe.Pointer(elem25(_aMem, uintptr(_p.XnChildMem))))
 45002  	_i = int32(0)
 45003  _0:
 45004  	if _i >= _p.XnChildCsr {
 45005  		goto _3
 45006  	}
 45007  	_sqlite3VdbeFreeCursor(tls, (*TVdbe)(_p.Xv), *elem77(_apCsr, uintptr(_i)))
 45008  	_i += 1
 45009  	goto _0
 45010  _3:
 45011  	_releaseMemArray(tls, _aMem, _p.XnChildMem)
 45012  	_sqlite3VdbeDeleteAuxData(tls, (*Xsqlite3)((*TVdbe)(_p.Xv).Xdb), (**XAuxData)(unsafe.Pointer(&_p.XpAuxData)), int32(-1), int32(0))
 45013  	_sqlite3DbFree(tls, (*Xsqlite3)((*TVdbe)(_p.Xv).Xdb), unsafe.Pointer(_p))
 45014  }
 45015  
 45016  func _checkActiveVdbeCnt(tls *crt.TLS, _db *Xsqlite3) {
 45017  	var _cnt, _nWrite, _nRead int32
 45018  	var _p *TVdbe
 45019  	_cnt = int32(0)
 45020  	_nWrite = int32(0)
 45021  	_nRead = int32(0)
 45022  	_p = (*TVdbe)(_db.XpVdbe)
 45023  _0:
 45024  	if _p == nil {
 45025  		goto _1
 45026  	}
 45027  	if Xsqlite3_stmt_busy(tls, unsafe.Pointer(_p)) == 0 {
 45028  		goto _2
 45029  	}
 45030  	_cnt += 1
 45031  	if int32((uint32(_p.Xexpired>>7)<<31)>>31) == int32(0) {
 45032  		_nWrite += 1
 45033  	}
 45034  	if ((uint32(_p.Xexpired>>8) << 31) >> 31) != 0 {
 45035  		_nRead += 1
 45036  	}
 45037  _2:
 45038  	_p = (*TVdbe)(_p.XpNext)
 45039  	goto _0
 45040  _1:
 45041  	func() {
 45042  		if _cnt != _db.XnVdbeActive {
 45043  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73910), unsafe.Pointer(&_checkActiveVdbeCntØ00__func__Ø000), unsafe.Pointer(str(58109)))
 45044  			crt.X__builtin_abort(tls)
 45045  		}
 45046  	}()
 45047  	func() {
 45048  		if _nWrite != _db.XnVdbeWrite {
 45049  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73911), unsafe.Pointer(&_checkActiveVdbeCntØ00__func__Ø000), unsafe.Pointer(str(58130)))
 45050  			crt.X__builtin_abort(tls)
 45051  		}
 45052  	}()
 45053  	func() {
 45054  		if _nRead != _db.XnVdbeRead {
 45055  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73912), unsafe.Pointer(&_checkActiveVdbeCntØ00__func__Ø000), unsafe.Pointer(str(58153)))
 45056  			crt.X__builtin_abort(tls)
 45057  		}
 45058  	}()
 45059  }
 45060  
 45061  // C comment
 45062  //  /*
 45063  //  ** Return true if the prepared statement is in need of being reset.
 45064  //  */
 45065  func Xsqlite3_stmt_busy(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
 45066  	var _v *TVdbe
 45067  	_v = (*TVdbe)(_pStmt)
 45068  	return bool2int(((_v != nil) && (_v.Xmagic == uint32(770837923))) && (_v.Xpc >= int32(0)))
 45069  }
 45070  
 45071  var _checkActiveVdbeCntØ00__func__Ø000 [19]int8
 45072  
 45073  func init() {
 45074  	crt.Xstrncpy(nil, &_checkActiveVdbeCntØ00__func__Ø000[0], str(58174), 19)
 45075  }
 45076  
 45077  // C comment
 45078  //  /*
 45079  //  ** If SQLite is compiled to support shared-cache mode and to be threadsafe,
 45080  //  ** this routine obtains the mutex associated with each BtShared structure
 45081  //  ** that may be accessed by the VM passed as an argument. In doing so it also
 45082  //  ** sets the BtShared.db member of each of the BtShared structures, ensuring
 45083  //  ** that the correct busy-handler callback is invoked if required.
 45084  //  **
 45085  //  ** If SQLite is not threadsafe but does support shared-cache mode, then
 45086  //  ** sqlite3BtreeEnter() is invoked to set the BtShared.db variables
 45087  //  ** of all of BtShared structures accessible via the database handle
 45088  //  ** associated with the VM.
 45089  //  **
 45090  //  ** If SQLite is not threadsafe and does not support shared-cache mode, this
 45091  //  ** function is a no-op.
 45092  //  **
 45093  //  ** The p->btreeMask field is a bitmask of all btrees that the prepared
 45094  //  ** statement p will ever use.  Let N be the number of bits in p->btreeMask
 45095  //  ** corresponding to btrees that use shared cache.  Then the runtime of
 45096  //  ** this routine is N*N.  But as N is rarely more than 1, this should not
 45097  //  ** be a problem.
 45098  //  */
 45099  func _sqlite3VdbeEnter(tls *crt.TLS, _p *TVdbe) {
 45100  	var _i, _nDb int32
 45101  	var _db *Xsqlite3
 45102  	var _aDb *XDb
 45103  	if _p.XlockMask == (0) {
 45104  		return
 45105  	}
 45106  	_db = (*Xsqlite3)(_p.Xdb)
 45107  	_aDb = (*XDb)(_db.XaDb)
 45108  	_nDb = _db.XnDb
 45109  	_i = int32(0)
 45110  _1:
 45111  	if _i >= _nDb {
 45112  		goto _4
 45113  	}
 45114  	if ((_i != int32(1)) && ((_p.XlockMask & (uint32(1) << uint(_i))) != (0))) && func() int32 {
 45115  		if (*XBtree)(elem27(_aDb, uintptr(_i)).XpBt) != nil {
 45116  			return int32(1)
 45117  		}
 45118  		return func() int32 {
 45119  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72873), unsafe.Pointer(&_sqlite3VdbeEnterØ00__func__Ø000), unsafe.Pointer(str(4809)))
 45120  			crt.X__builtin_abort(tls)
 45121  			return int32(0)
 45122  		}()
 45123  	}() != 0 {
 45124  		_sqlite3BtreeEnter(tls, (*XBtree)(elem27(_aDb, uintptr(_i)).XpBt))
 45125  	}
 45126  	_i += 1
 45127  	goto _1
 45128  _4:
 45129  }
 45130  
 45131  var _sqlite3VdbeEnterØ00__func__Ø000 [17]int8
 45132  
 45133  func init() {
 45134  	crt.Xstrncpy(nil, &_sqlite3VdbeEnterØ00__func__Ø000[0], str(58193), 17)
 45135  }
 45136  
 45137  func _sqlite3VdbeCheckFk(tls *crt.TLS, _p *TVdbe, _deferred int32) (r0 int32) {
 45138  	var _db *Xsqlite3
 45139  	_db = (*Xsqlite3)(_p.Xdb)
 45140  	if (_deferred != 0 && ((_db.XnDeferredCons + _db.XnDeferredImmCons) > (0))) || ((_deferred == 0) && (_p.XnFkConstraint > (0))) {
 45141  		_p.Xrc = int32(787)
 45142  		_p.XerrorAction = uint8(2)
 45143  		_sqlite3VdbeError(tls, _p, str(58210))
 45144  		return int32(1)
 45145  	}
 45146  	return int32(0)
 45147  }
 45148  
 45149  // C comment
 45150  //  /*
 45151  //  ** Change the error string stored in Vdbe.zErrMsg
 45152  //  */
 45153  func _sqlite3VdbeError(tls *crt.TLS, _p *TVdbe, _zFormat *int8, args ...interface{}) {
 45154  	var _ap []interface{}
 45155  	_sqlite3DbFree(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(_p.XzErrMsg))
 45156  	_ap = args
 45157  	_p.XzErrMsg = _sqlite3VMPrintf(tls, (*Xsqlite3)(_p.Xdb), _zFormat, _ap)
 45158  	_ap = nil
 45159  }
 45160  
 45161  var _sqlite3VdbeHaltØ00__func__Ø000 [16]int8
 45162  
 45163  func init() {
 45164  	crt.Xstrncpy(nil, &_sqlite3VdbeHaltØ00__func__Ø000[0], str(58240), 16)
 45165  }
 45166  
 45167  func _sqlite3VdbeLeave(tls *crt.TLS, _p *TVdbe) {
 45168  	if _p.XlockMask == (0) {
 45169  		return
 45170  	}
 45171  	_vdbeLeave(tls, _p)
 45172  }
 45173  
 45174  // C comment
 45175  //  /*
 45176  //  ** Unlock all of the btrees previously locked by a call to sqlite3VdbeEnter().
 45177  //  */
 45178  func _vdbeLeave(tls *crt.TLS, _p *TVdbe) {
 45179  	var _i, _nDb int32
 45180  	var _db *Xsqlite3
 45181  	var _aDb *XDb
 45182  	_db = (*Xsqlite3)(_p.Xdb)
 45183  	_aDb = (*XDb)(_db.XaDb)
 45184  	_nDb = _db.XnDb
 45185  	_i = int32(0)
 45186  _0:
 45187  	if _i >= _nDb {
 45188  		goto _3
 45189  	}
 45190  	if ((_i != int32(1)) && ((_p.XlockMask & (uint32(1) << uint(_i))) != (0))) && func() int32 {
 45191  		if (*XBtree)(elem27(_aDb, uintptr(_i)).XpBt) != nil {
 45192  			return int32(1)
 45193  		}
 45194  		return func() int32 {
 45195  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72893), unsafe.Pointer(&_vdbeLeaveØ00__func__Ø000), unsafe.Pointer(str(4809)))
 45196  			crt.X__builtin_abort(tls)
 45197  			return int32(0)
 45198  		}()
 45199  	}() != 0 {
 45200  		_sqlite3BtreeLeave(tls, (*XBtree)(elem27(_aDb, uintptr(_i)).XpBt))
 45201  	}
 45202  	_i += 1
 45203  	goto _0
 45204  _3:
 45205  }
 45206  
 45207  var _vdbeLeaveØ00__func__Ø000 [10]int8
 45208  
 45209  func init() {
 45210  	crt.Xstrncpy(nil, &_vdbeLeaveØ00__func__Ø000[0], str(58256), 10)
 45211  }
 45212  
 45213  // C comment
 45214  //  /*
 45215  //  ** A read or write transaction may or may not be active on database handle
 45216  //  ** db. If a transaction is active, commit it. If there is a
 45217  //  ** write-transaction spanning more than one database file, this routine
 45218  //  ** takes care of the master journal trickery.
 45219  //  */
 45220  func _vdbeCommit(tls *crt.TLS, _db *Xsqlite3, _p *TVdbe) (r0 int32) {
 45221  	var _i, _nTrans, _rc, _needXcommit, _13_res, _13_retryCount, _13_nMainFile int32
 45222  	var _13_offset int64
 45223  	var _14_iRandom uint32
 45224  	var _13_zMaster, _13_zMainFile, _21_zFile *int8
 45225  	var _1_pBt, _8_pBt, _10_pBt, _20_pBt, _25_pBt, _29_pBt *XBtree
 45226  	var _2_pPager *XPager
 45227  	var _13_pMaster *Xsqlite3_file
 45228  	var _13_pVfs *Xsqlite3_vfs
 45229  	_nTrans = int32(0)
 45230  	_rc = int32(0)
 45231  	_needXcommit = int32(0)
 45232  	_rc = _sqlite3VtabSync(tls, _db, _p)
 45233  	_i = int32(0)
 45234  _0:
 45235  	if _rc != int32(0) || _i >= _db.XnDb {
 45236  		goto _4
 45237  	}
 45238  	_1_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 45239  	if _sqlite3BtreeIsInTrans(tls, _1_pBt) == 0 {
 45240  		goto _5
 45241  	}
 45242  	_needXcommit = int32(1)
 45243  	_sqlite3BtreeEnter(tls, _1_pBt)
 45244  	_2_pPager = _sqlite3BtreePager(tls, _1_pBt)
 45245  	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) {
 45246  		func() {
 45247  			if _i == int32(1) {
 45248  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73684), unsafe.Pointer(&_vdbeCommitØ00__func__Ø000), unsafe.Pointer(str(58266)))
 45249  				crt.X__builtin_abort(tls)
 45250  			}
 45251  		}()
 45252  		_nTrans += 1
 45253  	}
 45254  	_rc = _sqlite3PagerExclusiveLock(tls, _2_pPager)
 45255  	_sqlite3BtreeLeave(tls, _1_pBt)
 45256  _5:
 45257  	_i += 1
 45258  	goto _0
 45259  _4:
 45260  	if _rc != int32(0) {
 45261  		return _rc
 45262  	}
 45263  	if _needXcommit == 0 || _db.XxCommitCallback == nil {
 45264  		goto _12
 45265  	}
 45266  	_rc = _db.XxCommitCallback(tls, _db.XpCommitArg)
 45267  	if _rc != 0 {
 45268  		return int32(531)
 45269  	}
 45270  _12:
 45271  	if int32(0) != _sqlite3Strlen30(tls, _sqlite3BtreeGetFilename(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), 0).XpBt))) && _nTrans > int32(1) {
 45272  		goto _15
 45273  	}
 45274  	_i = int32(0)
 45275  _16:
 45276  	if _rc != int32(0) || _i >= _db.XnDb {
 45277  		goto _20
 45278  	}
 45279  	_8_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 45280  	if _8_pBt != nil {
 45281  		_rc = _sqlite3BtreeCommitPhaseOne(tls, _8_pBt, nil)
 45282  	}
 45283  	_i += 1
 45284  	goto _16
 45285  _20:
 45286  	_i = int32(0)
 45287  _22:
 45288  	if _rc != int32(0) || _i >= _db.XnDb {
 45289  		goto _26
 45290  	}
 45291  	_10_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 45292  	if _10_pBt != nil {
 45293  		_rc = _sqlite3BtreeCommitPhaseTwo(tls, _10_pBt, int32(0))
 45294  	}
 45295  	_i += 1
 45296  	goto _22
 45297  _26:
 45298  	if _rc == int32(0) {
 45299  		_sqlite3VtabCommit(tls, _db)
 45300  	}
 45301  	goto _29
 45302  _15:
 45303  	_13_pVfs = (*Xsqlite3_vfs)(_db.XpVfs)
 45304  	_13_zMaster = nil
 45305  	_13_zMainFile = _sqlite3BtreeGetFilename(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), 0).XpBt))
 45306  	_13_pMaster = nil
 45307  	_13_offset = int64(0)
 45308  	_13_retryCount = int32(0)
 45309  	_13_nMainFile = _sqlite3Strlen30(tls, _13_zMainFile)
 45310  	_13_zMaster = _sqlite3MPrintf(tls, _db, str(58271), unsafe.Pointer(_13_zMainFile))
 45311  	if _13_zMaster == nil {
 45312  		return _sqlite3NomemError(tls, int32(73756))
 45313  	}
 45314  _30:
 45315  	if _13_retryCount == 0 {
 45316  		goto _32
 45317  	}
 45318  	if _13_retryCount > int32(100) {
 45319  		Xsqlite3_log(tls, int32(13), str(58287), unsafe.Pointer(_13_zMaster))
 45320  		_sqlite3OsDelete(tls, _13_pVfs, _13_zMaster, int32(0))
 45321  		goto _34
 45322  	}
 45323  	if _13_retryCount == int32(1) {
 45324  		Xsqlite3_log(tls, int32(13), str(58301), unsafe.Pointer(_13_zMaster))
 45325  	}
 45326  _32:
 45327  	_13_retryCount += 1
 45328  	Xsqlite3_randomness(tls, int32(4), unsafe.Pointer(&_14_iRandom))
 45329  	Xsqlite3_snprintf(tls, int32(13), elem1(_13_zMaster, uintptr(_13_nMainFile)), str(58316), (_14_iRandom>>8)&uint32(16777215), _14_iRandom&uint32(255))
 45330  	func() {
 45331  		if int32(*elem1(_13_zMaster, uintptr(_sqlite3Strlen30(tls, _13_zMaster)-int32(3)))) != int32(57) {
 45332  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73774), unsafe.Pointer(&_vdbeCommitØ00__func__Ø000), unsafe.Pointer(str(58329)))
 45333  			crt.X__builtin_abort(tls)
 45334  		}
 45335  	}()
 45336  	_rc = _sqlite3OsAccess(tls, _13_pVfs, _13_zMaster, int32(0), &_13_res)
 45337  	if (_rc == int32(0)) && _13_res != 0 {
 45338  		goto _30
 45339  	}
 45340  _34:
 45341  	if _rc == int32(0) {
 45342  		_rc = _sqlite3OsOpenMalloc(tls, _13_pVfs, _13_zMaster, &_13_pMaster, int32(16406), nil)
 45343  	}
 45344  	if _rc != int32(0) {
 45345  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_13_zMaster))
 45346  		return _rc
 45347  	}
 45348  	_i = int32(0)
 45349  _42:
 45350  	if _i >= _db.XnDb {
 45351  		goto _45
 45352  	}
 45353  	_20_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 45354  	if _sqlite3BtreeIsInTrans(tls, _20_pBt) == 0 {
 45355  		goto _46
 45356  	}
 45357  	_21_zFile = _sqlite3BtreeGetJournalname(tls, _20_pBt)
 45358  	if _21_zFile == nil {
 45359  		goto _43
 45360  	}
 45361  	func() {
 45362  		if int32(*elem1(_21_zFile, 0)) == int32(0) {
 45363  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73803), unsafe.Pointer(&_vdbeCommitØ00__func__Ø000), unsafe.Pointer(str(58370)))
 45364  			crt.X__builtin_abort(tls)
 45365  		}
 45366  	}()
 45367  	_rc = _sqlite3OsWrite(tls, _13_pMaster, unsafe.Pointer(_21_zFile), _sqlite3Strlen30(tls, _21_zFile)+int32(1), _13_offset)
 45368  	_13_offset += int64(_sqlite3Strlen30(tls, _21_zFile) + int32(1))
 45369  	if _rc != int32(0) {
 45370  		_sqlite3OsCloseFree(tls, _13_pMaster)
 45371  		_sqlite3OsDelete(tls, _13_pVfs, _13_zMaster, int32(0))
 45372  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_13_zMaster))
 45373  		return _rc
 45374  	}
 45375  _46:
 45376  _43:
 45377  	_i += 1
 45378  	goto _42
 45379  _45:
 45380  	if (int32(0) == (_sqlite3OsDeviceCharacteristics(tls, _13_pMaster) & int32(1024))) && (int32(0) != store2(&_rc, _sqlite3OsSync(tls, _13_pMaster, int32(2)))) {
 45381  		_sqlite3OsCloseFree(tls, _13_pMaster)
 45382  		_sqlite3OsDelete(tls, _13_pVfs, _13_zMaster, int32(0))
 45383  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_13_zMaster))
 45384  		return _rc
 45385  	}
 45386  	_i = int32(0)
 45387  _53:
 45388  	if _rc != int32(0) || _i >= _db.XnDb {
 45389  		goto _57
 45390  	}
 45391  	_25_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 45392  	if _25_pBt != nil {
 45393  		_rc = _sqlite3BtreeCommitPhaseOne(tls, _25_pBt, _13_zMaster)
 45394  	}
 45395  	_i += 1
 45396  	goto _53
 45397  _57:
 45398  	_sqlite3OsCloseFree(tls, _13_pMaster)
 45399  	func() {
 45400  		if _rc == int32(5) {
 45401  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73844), unsafe.Pointer(&_vdbeCommitØ00__func__Ø000), unsafe.Pointer(str(58382)))
 45402  			crt.X__builtin_abort(tls)
 45403  		}
 45404  	}()
 45405  	if _rc != int32(0) {
 45406  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_13_zMaster))
 45407  		return _rc
 45408  	}
 45409  	_rc = _sqlite3OsDelete(tls, _13_pVfs, _13_zMaster, int32(1))
 45410  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_13_zMaster))
 45411  	_13_zMaster = nil
 45412  	if _rc != 0 {
 45413  		return _rc
 45414  	}
 45415  	_sqlite3BeginBenignMalloc(tls)
 45416  	_i = int32(0)
 45417  _63:
 45418  	if _i >= _db.XnDb {
 45419  		goto _66
 45420  	}
 45421  	_29_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 45422  	if _29_pBt != nil {
 45423  		_sqlite3BtreeCommitPhaseTwo(tls, _29_pBt, int32(1))
 45424  	}
 45425  	_i += 1
 45426  	goto _63
 45427  _66:
 45428  	_sqlite3EndBenignMalloc(tls)
 45429  	_sqlite3VtabCommit(tls, _db)
 45430  _29:
 45431  	return _rc
 45432  }
 45433  
 45434  // C comment
 45435  //  /*
 45436  //  ** Invoke the xSync method of all virtual tables in the sqlite3.aVTrans
 45437  //  ** array. Return the error code for the first error that occurs, or
 45438  //  ** SQLITE_OK if all xSync operations are successful.
 45439  //  **
 45440  //  ** If an error message is available, leave it in p->zErrMsg.
 45441  //  */
 45442  func _sqlite3VtabSync(tls *crt.TLS, _db *Xsqlite3, _p *TVdbe) (r0 int32) {
 45443  	var _i, _rc int32
 45444  	var _1_pVtab *Xsqlite3_vtab
 45445  	var _aVTrans **XVTable
 45446  	var _1_x func(*crt.TLS, *Xsqlite3_vtab) int32
 45447  	_rc = int32(0)
 45448  	_aVTrans = (**XVTable)(unsafe.Pointer(_db.XaVTrans))
 45449  	*(***XVTable)(unsafe.Pointer(&_db.XaVTrans)) = nil
 45450  	_i = int32(0)
 45451  _0:
 45452  	if _rc != int32(0) || _i >= _db.XnVTrans {
 45453  		goto _4
 45454  	}
 45455  	_1_pVtab = (*Xsqlite3_vtab)((*elem28(_aVTrans, uintptr(_i))).XpVtab)
 45456  	if (_1_pVtab != nil) && (store81(&_1_x, func() func(*crt.TLS, *Xsqlite3_vtab) int32 {
 45457  		v := (*Xsqlite3_module)(_1_pVtab.XpModule).XxSync
 45458  		return *(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&v))
 45459  	}()) != nil) {
 45460  		_rc = _1_x(tls, _1_pVtab)
 45461  		_sqlite3VtabImportErrmsg(tls, _p, _1_pVtab)
 45462  	}
 45463  	_i += 1
 45464  	goto _0
 45465  _4:
 45466  	*(***XVTable)(unsafe.Pointer(&_db.XaVTrans)) = _aVTrans
 45467  	return _rc
 45468  }
 45469  
 45470  // C comment
 45471  //  /*
 45472  //  ** Transfer error message text from an sqlite3_vtab.zErrMsg (text stored
 45473  //  ** in memory obtained from sqlite3_malloc) into a Vdbe.zErrMsg (text stored
 45474  //  ** in memory obtained from sqlite3DbMalloc).
 45475  //  */
 45476  func _sqlite3VtabImportErrmsg(tls *crt.TLS, _p *TVdbe, _pVtab *Xsqlite3_vtab) {
 45477  	var _1_db *Xsqlite3
 45478  	if _pVtab.XzErrMsg != nil {
 45479  		_1_db = (*Xsqlite3)(_p.Xdb)
 45480  		_sqlite3DbFree(tls, _1_db, unsafe.Pointer(_p.XzErrMsg))
 45481  		_p.XzErrMsg = _sqlite3DbStrDup(tls, _1_db, _pVtab.XzErrMsg)
 45482  		Xsqlite3_free(tls, unsafe.Pointer(_pVtab.XzErrMsg))
 45483  		_pVtab.XzErrMsg = nil
 45484  	}
 45485  }
 45486  
 45487  var _vdbeCommitØ00aMJNeededØ001 [6]uint8
 45488  
 45489  func init() {
 45490  	_vdbeCommitØ00aMJNeededØ001 = [6]uint8{1, 1, 0, 1, 0, 0}
 45491  }
 45492  
 45493  // C comment
 45494  //  /*
 45495  //  ** Return the current journal mode.
 45496  //  */
 45497  func _sqlite3PagerGetJournalMode(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 45498  	return int32(_pPager.XjournalMode)
 45499  }
 45500  
 45501  var _vdbeCommitØ00__func__Ø000 [11]int8
 45502  
 45503  func init() {
 45504  	crt.Xstrncpy(nil, &_vdbeCommitØ00__func__Ø000[0], str(58398), 11)
 45505  }
 45506  
 45507  // C comment
 45508  //  /*
 45509  //  ** Return the full pathname of the underlying database file.  Return
 45510  //  ** an empty string if the database is in-memory or a TEMP database.
 45511  //  **
 45512  //  ** The pager filename is invariant as long as the pager is
 45513  //  ** open so it is safe to access without the BtShared mutex.
 45514  //  */
 45515  func _sqlite3BtreeGetFilename(tls *crt.TLS, _p *XBtree) (r0 *int8) {
 45516  	func() {
 45517  		if (*XPager)((*XBtShared)(_p.XpBt).XpPager) == nil {
 45518  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68620), unsafe.Pointer(&_sqlite3BtreeGetFilenameØ00__func__Ø000), unsafe.Pointer(str(58409)))
 45519  			crt.X__builtin_abort(tls)
 45520  		}
 45521  	}()
 45522  	return _sqlite3PagerFilename(tls, (*XPager)((*XBtShared)(_p.XpBt).XpPager), int32(1))
 45523  }
 45524  
 45525  var _sqlite3BtreeGetFilenameØ00__func__Ø000 [24]int8
 45526  
 45527  func init() {
 45528  	crt.Xstrncpy(nil, &_sqlite3BtreeGetFilenameØ00__func__Ø000[0], str(58427), 24)
 45529  }
 45530  
 45531  // C comment
 45532  //  /*
 45533  //  ** Return the full pathname of the database file.
 45534  //  **
 45535  //  ** Except, if the pager is in-memory only, then return an empty string if
 45536  //  ** nullIfMemDb is true.  This routine is called with nullIfMemDb==1 when
 45537  //  ** used to report the filename to the user, for compatibility with legacy
 45538  //  ** behavior.  But when the Btree needs to know the filename for matching to
 45539  //  ** shared cache, it uses nullIfMemDb==0 so that in-memory databases can
 45540  //  ** participate in shared-cache.
 45541  //  */
 45542  func _sqlite3PagerFilename(tls *crt.TLS, _pPager *XPager, _nullIfMemDb int32) (r0 *int8) {
 45543  	return func() *int8 {
 45544  		if _nullIfMemDb != 0 && (_pPager.XmemDb != 0) {
 45545  			return str(284)
 45546  		}
 45547  		return _pPager.XzFilename
 45548  	}()
 45549  }
 45550  
 45551  // C comment
 45552  //  /*
 45553  //  ** Invoke the xCommit method of all virtual tables in the
 45554  //  ** sqlite3.aVTrans array. Then clear the array itself.
 45555  //  */
 45556  func _sqlite3VtabCommit(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 45557  	_callFinaliser(tls, _db, int32(64))
 45558  	return int32(0)
 45559  }
 45560  
 45561  // C comment
 45562  //  /*
 45563  //  ** Convenience functions for opening and closing files using
 45564  //  ** sqlite3_malloc() to obtain space for the file-handle structure.
 45565  //  */
 45566  func _sqlite3OsOpenMalloc(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zFile *int8, _ppFile **Xsqlite3_file, _flags int32, _pOutFlags *int32) (r0 int32) {
 45567  	var _rc int32
 45568  	var _pFile *Xsqlite3_file
 45569  	_pFile = (*Xsqlite3_file)(_sqlite3MallocZero(tls, uint64(_pVfs.XszOsFile)))
 45570  	if _pFile == nil {
 45571  		goto _0
 45572  	}
 45573  	_rc = _sqlite3OsOpen(tls, _pVfs, _zFile, _pFile, _flags, _pOutFlags)
 45574  	if _rc != int32(0) {
 45575  		Xsqlite3_free(tls, unsafe.Pointer(_pFile))
 45576  		goto _2
 45577  	}
 45578  	*_ppFile = _pFile
 45579  _2:
 45580  	goto _3
 45581  _0:
 45582  	_rc = _sqlite3NomemError(tls, int32(20378))
 45583  _3:
 45584  	return _rc
 45585  }
 45586  
 45587  // C comment
 45588  //  /*
 45589  //  ** Return the pathname of the journal file for this database. The return
 45590  //  ** value of this routine is the same regardless of whether the journal file
 45591  //  ** has been created or not.
 45592  //  **
 45593  //  ** The pager journal filename is invariant as long as the pager is
 45594  //  ** open so it is safe to access without the BtShared mutex.
 45595  //  */
 45596  func _sqlite3BtreeGetJournalname(tls *crt.TLS, _p *XBtree) (r0 *int8) {
 45597  	func() {
 45598  		if (*XPager)((*XBtShared)(_p.XpBt).XpPager) == nil {
 45599  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68633), unsafe.Pointer(&_sqlite3BtreeGetJournalnameØ00__func__Ø000), unsafe.Pointer(str(58409)))
 45600  			crt.X__builtin_abort(tls)
 45601  		}
 45602  	}()
 45603  	return _sqlite3PagerJournalname(tls, (*XPager)((*XBtShared)(_p.XpBt).XpPager))
 45604  }
 45605  
 45606  var _sqlite3BtreeGetJournalnameØ00__func__Ø000 [27]int8
 45607  
 45608  func init() {
 45609  	crt.Xstrncpy(nil, &_sqlite3BtreeGetJournalnameØ00__func__Ø000[0], str(58451), 27)
 45610  }
 45611  
 45612  // C comment
 45613  //  /*
 45614  //  ** Return the full pathname of the journal file.
 45615  //  */
 45616  func _sqlite3PagerJournalname(tls *crt.TLS, _pPager *XPager) (r0 *int8) {
 45617  	return _pPager.XzJournal
 45618  }
 45619  
 45620  // C comment
 45621  //  /*
 45622  //  ** This routine is called when a commit occurs.
 45623  //  */
 45624  func _sqlite3CommitInternalChanges(tls *crt.TLS, _db *Xsqlite3) {
 45625  	_db.Xflags &= int32(-3)
 45626  }
 45627  
 45628  func _sqlite3VdbeCloseStatement(tls *crt.TLS, _p *TVdbe, _eOp int32) (r0 int32) {
 45629  	if ((*Xsqlite3)(_p.Xdb).XnStatement) != 0 && _p.XiStatement != 0 {
 45630  		return _vdbeCloseStatement(tls, _p, _eOp)
 45631  	}
 45632  	return int32(0)
 45633  }
 45634  
 45635  // C comment
 45636  //  /*
 45637  //  ** If the Vdbe passed as the first argument opened a statement-transaction,
 45638  //  ** close it now. Argument eOp must be either SAVEPOINT_ROLLBACK or
 45639  //  ** SAVEPOINT_RELEASE. If it is SAVEPOINT_ROLLBACK, then the statement
 45640  //  ** transaction is rolled back. If eOp is SAVEPOINT_RELEASE, then the
 45641  //  ** statement transaction is committed.
 45642  //  **
 45643  //  ** If an IO error occurs, an SQLITE_IOERR_XXX error code is returned.
 45644  //  ** Otherwise SQLITE_OK.
 45645  //  */
 45646  func _vdbeCloseStatement(tls *crt.TLS, _p *TVdbe, _eOp int32) (r0 int32) {
 45647  	var _rc, _i, _iSavepoint, _1_rc2 int32
 45648  	var _db *Xsqlite3
 45649  	var _1_pBt *XBtree
 45650  	_db = (*Xsqlite3)(_p.Xdb)
 45651  	_rc = int32(0)
 45652  	_iSavepoint = _p.XiStatement - int32(1)
 45653  	func() {
 45654  		if _eOp != int32(2) && _eOp != int32(1) {
 45655  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73934), unsafe.Pointer(&_vdbeCloseStatementØ00__func__Ø000), unsafe.Pointer(str(58478)))
 45656  			crt.X__builtin_abort(tls)
 45657  		}
 45658  	}()
 45659  	func() {
 45660  		if _db.XnStatement <= int32(0) {
 45661  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73935), unsafe.Pointer(&_vdbeCloseStatementØ00__func__Ø000), unsafe.Pointer(str(58528)))
 45662  			crt.X__builtin_abort(tls)
 45663  		}
 45664  	}()
 45665  	func() {
 45666  		if _p.XiStatement != (_db.XnStatement + _db.XnSavepoint) {
 45667  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73936), unsafe.Pointer(&_vdbeCloseStatementØ00__func__Ø000), unsafe.Pointer(str(58545)))
 45668  			crt.X__builtin_abort(tls)
 45669  		}
 45670  	}()
 45671  	_i = int32(0)
 45672  _7:
 45673  	if _i >= _db.XnDb {
 45674  		goto _10
 45675  	}
 45676  	_1_rc2 = int32(0)
 45677  	_1_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 45678  	if _1_pBt == nil {
 45679  		goto _11
 45680  	}
 45681  	if _eOp == int32(2) {
 45682  		_1_rc2 = _sqlite3BtreeSavepoint(tls, _1_pBt, int32(2), _iSavepoint)
 45683  	}
 45684  	if _1_rc2 == int32(0) {
 45685  		_1_rc2 = _sqlite3BtreeSavepoint(tls, _1_pBt, int32(1), _iSavepoint)
 45686  	}
 45687  	if _rc == int32(0) {
 45688  		_rc = _1_rc2
 45689  	}
 45690  _11:
 45691  	_i += 1
 45692  	goto _7
 45693  _10:
 45694  	_db.XnStatement -= 1
 45695  	_p.XiStatement = int32(0)
 45696  	if _rc != int32(0) {
 45697  		goto _15
 45698  	}
 45699  	if _eOp == int32(2) {
 45700  		_rc = _sqlite3VtabSavepoint(tls, _db, int32(2), _iSavepoint)
 45701  	}
 45702  	if _rc == int32(0) {
 45703  		_rc = _sqlite3VtabSavepoint(tls, _db, int32(1), _iSavepoint)
 45704  	}
 45705  _15:
 45706  	if _eOp == int32(2) {
 45707  		_db.XnDeferredCons = _p.XnStmtDefCons
 45708  		_db.XnDeferredImmCons = _p.XnStmtDefImmCons
 45709  	}
 45710  	return _rc
 45711  }
 45712  
 45713  var _vdbeCloseStatementØ00__func__Ø000 [19]int8
 45714  
 45715  func init() {
 45716  	crt.Xstrncpy(nil, &_vdbeCloseStatementØ00__func__Ø000[0], str(58592), 19)
 45717  }
 45718  
 45719  // C comment
 45720  //  /*
 45721  //  ** The second argument to this function, op, is always SAVEPOINT_ROLLBACK
 45722  //  ** or SAVEPOINT_RELEASE. This function either releases or rolls back the
 45723  //  ** savepoint identified by parameter iSavepoint, depending on the value
 45724  //  ** of op.
 45725  //  **
 45726  //  ** Normally, iSavepoint is greater than or equal to zero. However, if op is
 45727  //  ** SAVEPOINT_ROLLBACK, then iSavepoint may also be -1. In this case the
 45728  //  ** contents of the entire transaction are rolled back. This is different
 45729  //  ** from a normal transaction rollback, as no locks are released and the
 45730  //  ** transaction remains open.
 45731  //  */
 45732  func _sqlite3BtreeSavepoint(tls *crt.TLS, _p *XBtree, _op int32, _iSavepoint int32) (r0 int32) {
 45733  	var _rc int32
 45734  	var _1_pBt *XBtShared
 45735  	_rc = int32(0)
 45736  	if _p == nil || int32(_p.XinTrans) != int32(2) {
 45737  		goto _1
 45738  	}
 45739  	_1_pBt = (*XBtShared)(_p.XpBt)
 45740  	func() {
 45741  		if _op != int32(1) && _op != int32(2) {
 45742  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63136), unsafe.Pointer(&_sqlite3BtreeSavepointØ00__func__Ø000), unsafe.Pointer(str(14879)))
 45743  			crt.X__builtin_abort(tls)
 45744  		}
 45745  	}()
 45746  	func() {
 45747  		if _iSavepoint < int32(0) && (_iSavepoint != int32(-1) || _op != int32(2)) {
 45748  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63137), unsafe.Pointer(&_sqlite3BtreeSavepointØ00__func__Ø000), unsafe.Pointer(str(58611)))
 45749  			crt.X__builtin_abort(tls)
 45750  		}
 45751  	}()
 45752  	_sqlite3BtreeEnter(tls, _p)
 45753  	if _op == int32(2) {
 45754  		_rc = _saveAllCursors(tls, _1_pBt, 0, nil)
 45755  	}
 45756  	if _rc == int32(0) {
 45757  		_rc = _sqlite3PagerSavepoint(tls, (*XPager)(_1_pBt.XpPager), _op, _iSavepoint)
 45758  	}
 45759  	if _rc != int32(0) {
 45760  		goto _11
 45761  	}
 45762  	if (_iSavepoint < int32(0)) && ((int32(_1_pBt.XbtsFlags) & int32(8)) != int32(0)) {
 45763  		_1_pBt.XnPage = 0
 45764  	}
 45765  	_rc = _newDatabase(tls, _1_pBt)
 45766  	_1_pBt.XnPage = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(int32(28))+uintptr(unsafe.Pointer((*XMemPage)(_1_pBt.XpPage1).XaData)))))
 45767  	func() {
 45768  		if _1_pBt.XnPage <= (0) {
 45769  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63155), unsafe.Pointer(&_sqlite3BtreeSavepointØ00__func__Ø000), unsafe.Pointer(str(58671)))
 45770  			crt.X__builtin_abort(tls)
 45771  		}
 45772  	}()
 45773  _11:
 45774  	_sqlite3BtreeLeave(tls, _p)
 45775  _1:
 45776  	return _rc
 45777  }
 45778  
 45779  var _sqlite3BtreeSavepointØ00__func__Ø000 [22]int8
 45780  
 45781  func init() {
 45782  	crt.Xstrncpy(nil, &_sqlite3BtreeSavepointØ00__func__Ø000[0], str(58684), 22)
 45783  }
 45784  
 45785  // C comment
 45786  //  /*
 45787  //  ** Invoke either the xSavepoint, xRollbackTo or xRelease method of all
 45788  //  ** virtual tables that currently have an open transaction. Pass iSavepoint
 45789  //  ** as the second argument to the virtual table method invoked.
 45790  //  **
 45791  //  ** If op is SAVEPOINT_BEGIN, the xSavepoint method is invoked. If it is
 45792  //  ** SAVEPOINT_ROLLBACK, the xRollbackTo method. Otherwise, if op is
 45793  //  ** SAVEPOINT_RELEASE, then the xRelease method of each virtual table with
 45794  //  ** an open transaction is invoked.
 45795  //  **
 45796  //  ** If any virtual table method returns an error code other than SQLITE_OK,
 45797  //  ** processing is abandoned and the error returned to the caller of this
 45798  //  ** function immediately. If all calls to virtual table methods are successful,
 45799  //  ** SQLITE_OK is returned.
 45800  //  */
 45801  func _sqlite3VtabSavepoint(tls *crt.TLS, _db *Xsqlite3, _op int32, _iSavepoint int32) (r0 int32) {
 45802  	var _rc, _1_i int32
 45803  	var _2_pVTab *XVTable
 45804  	var _2_pMod *Xsqlite3_module
 45805  	var _3_xMethod func(*crt.TLS, *Xsqlite3_vtab, int32) int32
 45806  	_rc = int32(0)
 45807  	func() {
 45808  		if _op != int32(1) && _op != int32(2) && _op != int32(0) {
 45809  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125979), unsafe.Pointer(&_sqlite3VtabSavepointØ00__func__Ø000), unsafe.Pointer(str(58706)))
 45810  			crt.X__builtin_abort(tls)
 45811  		}
 45812  	}()
 45813  	func() {
 45814  		if _iSavepoint < int32(-1) {
 45815  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125980), unsafe.Pointer(&_sqlite3VtabSavepointØ00__func__Ø000), unsafe.Pointer(str(58773)))
 45816  			crt.X__builtin_abort(tls)
 45817  		}
 45818  	}()
 45819  	if _db.XaVTrans == nil {
 45820  		goto _6
 45821  	}
 45822  	_1_i = int32(0)
 45823  _7:
 45824  	if _rc != int32(0) || _1_i >= _db.XnVTrans {
 45825  		goto _11
 45826  	}
 45827  	_2_pVTab = *elem28((**XVTable)(unsafe.Pointer(_db.XaVTrans)), uintptr(_1_i))
 45828  	_2_pMod = (*Xsqlite3_module)((*XModule)(_2_pVTab.XpMod).XpModule)
 45829  	if _2_pVTab.XpVtab == nil || _2_pMod.XiVersion < int32(2) {
 45830  		goto _13
 45831  	}
 45832  	switch _op {
 45833  	case int32(0):
 45834  		goto _15
 45835  	case int32(2):
 45836  		goto _16
 45837  	default:
 45838  		goto _17
 45839  	}
 45840  
 45841  _15:
 45842  	_3_xMethod = func() func(*crt.TLS, *Xsqlite3_vtab, int32) int32 {
 45843  		v := _2_pMod.XxSavepoint
 45844  		return *(*func(*crt.TLS, *Xsqlite3_vtab, int32) int32)(unsafe.Pointer(&v))
 45845  	}()
 45846  	_2_pVTab.XiSavepoint = _iSavepoint + int32(1)
 45847  	goto _18
 45848  _16:
 45849  	_3_xMethod = func() func(*crt.TLS, *Xsqlite3_vtab, int32) int32 {
 45850  		v := _2_pMod.XxRollbackTo
 45851  		return *(*func(*crt.TLS, *Xsqlite3_vtab, int32) int32)(unsafe.Pointer(&v))
 45852  	}()
 45853  	goto _18
 45854  _17:
 45855  	_3_xMethod = func() func(*crt.TLS, *Xsqlite3_vtab, int32) int32 {
 45856  		v := _2_pMod.XxRelease
 45857  		return *(*func(*crt.TLS, *Xsqlite3_vtab, int32) int32)(unsafe.Pointer(&v))
 45858  	}()
 45859  	goto _18
 45860  _18:
 45861  	if (_3_xMethod != nil) && (_2_pVTab.XiSavepoint > _iSavepoint) {
 45862  		_rc = _3_xMethod(tls, (*Xsqlite3_vtab)(_2_pVTab.XpVtab), _iSavepoint)
 45863  	}
 45864  _13:
 45865  	_1_i += 1
 45866  	goto _7
 45867  _11:
 45868  _6:
 45869  	return _rc
 45870  }
 45871  
 45872  var _sqlite3VtabSavepointØ00__func__Ø000 [21]int8
 45873  
 45874  func init() {
 45875  	crt.Xstrncpy(nil, &_sqlite3VtabSavepointØ00__func__Ø000[0], str(58788), 21)
 45876  }
 45877  
 45878  // C comment
 45879  //  /*
 45880  //  ** This routine sets the value to be returned by subsequent calls to
 45881  //  ** sqlite3_changes() on the database handle 'db'.
 45882  //  */
 45883  func _sqlite3VdbeSetChanges(tls *crt.TLS, _db *Xsqlite3, _nChange int32) {
 45884  	func() {
 45885  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 45886  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75914), unsafe.Pointer(&_sqlite3VdbeSetChangesØ00__func__Ø000), unsafe.Pointer(str(881)))
 45887  			crt.X__builtin_abort(tls)
 45888  		}
 45889  	}()
 45890  	_db.XnChange = _nChange
 45891  	_db.XnTotalChange += _nChange
 45892  }
 45893  
 45894  var _sqlite3VdbeSetChangesØ00__func__Ø000 [22]int8
 45895  
 45896  func init() {
 45897  	crt.Xstrncpy(nil, &_sqlite3VdbeSetChangesØ00__func__Ø000[0], str(58809), 22)
 45898  }
 45899  
 45900  // C comment
 45901  //  /*
 45902  //  ** Copy the error code and error message belonging to the VDBE passed
 45903  //  ** as the first argument to its database handle (so that they will be
 45904  //  ** returned by calls to sqlite3_errcode() and sqlite3_errmsg()).
 45905  //  **
 45906  //  ** This function does not clear the VDBE error code or message, just
 45907  //  ** copies them to the database handle.
 45908  //  */
 45909  func _sqlite3VdbeTransferError(tls *crt.TLS, _p *TVdbe) (r0 int32) {
 45910  	var _rc int32
 45911  	var _db *Xsqlite3
 45912  	_db = (*Xsqlite3)(_p.Xdb)
 45913  	_rc = _p.Xrc
 45914  	if _p.XzErrMsg == nil {
 45915  		goto _0
 45916  	}
 45917  	_db.XbBenignMalloc += 1
 45918  	_sqlite3BeginBenignMalloc(tls)
 45919  	if (*XMem)(_db.XpErr) == nil {
 45920  		*(**XMem)(unsafe.Pointer(&_db.XpErr)) = _sqlite3ValueNew(tls, _db)
 45921  	}
 45922  	_sqlite3ValueSetStr(tls, (*XMem)(_db.XpErr), int32(-1), unsafe.Pointer(_p.XzErrMsg), uint8(1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
 45923  	_sqlite3EndBenignMalloc(tls)
 45924  	_db.XbBenignMalloc -= 1
 45925  	_db.XerrCode = _rc
 45926  	goto _2
 45927  _0:
 45928  	_sqlite3Error(tls, _db, _rc)
 45929  _2:
 45930  	return _rc
 45931  }
 45932  
 45933  // C comment
 45934  //  /*
 45935  //  ** Clean up the VM after a single run.
 45936  //  */
 45937  func _Cleanup(tls *crt.TLS, _p *TVdbe) {
 45938  	var _i int32
 45939  	var _db *Xsqlite3
 45940  	_db = (*Xsqlite3)(_p.Xdb)
 45941  	if _p.XapCsr == nil {
 45942  		goto _4
 45943  	}
 45944  	_i = int32(0)
 45945  _1:
 45946  	if _i >= _p.XnCursor {
 45947  		goto _4
 45948  	}
 45949  	func() {
 45950  		if (*elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_i))) != nil {
 45951  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73565), unsafe.Pointer(&_CleanupØ00__func__Ø000), unsafe.Pointer(str(58831)))
 45952  			crt.X__builtin_abort(tls)
 45953  		}
 45954  	}()
 45955  	_i += 1
 45956  	goto _1
 45957  _4:
 45958  	if _p.XaMem == nil {
 45959  		goto _7
 45960  	}
 45961  	_i = int32(0)
 45962  _8:
 45963  	if _i >= _p.XnMem {
 45964  		goto _11
 45965  	}
 45966  	func() {
 45967  		if int32(elem25((*XMem)(_p.XaMem), uintptr(_i)).Xflags) != int32(128) {
 45968  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73567), unsafe.Pointer(&_CleanupØ00__func__Ø000), unsafe.Pointer(str(58846)))
 45969  			crt.X__builtin_abort(tls)
 45970  		}
 45971  	}()
 45972  	_i += 1
 45973  	goto _8
 45974  _11:
 45975  _7:
 45976  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_p.XzErrMsg))
 45977  	_p.XzErrMsg = nil
 45978  	*(**XMem)(unsafe.Pointer(&_p.XpResultSet)) = nil
 45979  }
 45980  
 45981  var _CleanupØ00__func__Ø000 [8]int8
 45982  
 45983  func init() {
 45984  	crt.Xstrncpy(nil, &_CleanupØ00__func__Ø000[0], str(58878), 8)
 45985  }
 45986  
 45987  var _sqlite3VdbeFinalizeØ00__func__Ø000 [20]int8
 45988  
 45989  func init() {
 45990  	crt.Xstrncpy(nil, &_sqlite3VdbeFinalizeØ00__func__Ø000[0], str(58886), 20)
 45991  }
 45992  
 45993  // C comment
 45994  //  /*
 45995  //  ** Delete an entire VDBE.
 45996  //  */
 45997  func _sqlite3VdbeDelete(tls *crt.TLS, _p *TVdbe) {
 45998  	var _db *Xsqlite3
 45999  	if func() int32 {
 46000  		if _p == nil {
 46001  			return func() int32 {
 46002  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74449), unsafe.Pointer(&_sqlite3VdbeDeleteØ00__func__Ø000), unsafe.Pointer(str(4809)))
 46003  				crt.X__builtin_abort(tls)
 46004  				return int32(1)
 46005  			}()
 46006  		}
 46007  		return int32(0)
 46008  	}() != 0 {
 46009  		return
 46010  	}
 46011  	_db = (*Xsqlite3)(_p.Xdb)
 46012  	func() {
 46013  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 46014  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74451), unsafe.Pointer(&_sqlite3VdbeDeleteØ00__func__Ø000), unsafe.Pointer(str(881)))
 46015  			crt.X__builtin_abort(tls)
 46016  		}
 46017  	}()
 46018  	_sqlite3VdbeClearObject(tls, _db, _p)
 46019  	if _p.XpPrev != nil {
 46020  		*(**TVdbe)(unsafe.Pointer(&((*TVdbe)(_p.XpPrev).XpNext))) = (*TVdbe)(_p.XpNext)
 46021  		goto _6
 46022  	}
 46023  	func() {
 46024  		if (*TVdbe)(_db.XpVdbe) != _p {
 46025  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74456), unsafe.Pointer(&_sqlite3VdbeDeleteØ00__func__Ø000), unsafe.Pointer(str(58906)))
 46026  			crt.X__builtin_abort(tls)
 46027  		}
 46028  	}()
 46029  	*(**TVdbe)(unsafe.Pointer(&_db.XpVdbe)) = (*TVdbe)(_p.XpNext)
 46030  _6:
 46031  	if _p.XpNext != nil {
 46032  		*(**TVdbe)(unsafe.Pointer(&((*TVdbe)(_p.XpNext).XpPrev))) = (*TVdbe)(_p.XpPrev)
 46033  	}
 46034  	_p.Xmagic = uint32(1443283912)
 46035  	*(**Xsqlite3)(unsafe.Pointer(&_p.Xdb)) = nil
 46036  	_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_p))
 46037  }
 46038  
 46039  var _sqlite3VdbeDeleteØ00__func__Ø000 [18]int8
 46040  
 46041  func init() {
 46042  	crt.Xstrncpy(nil, &_sqlite3VdbeDeleteØ00__func__Ø000[0], str(58919), 18)
 46043  }
 46044  
 46045  // C comment
 46046  //  /*
 46047  //  ** Free all memory associated with the Vdbe passed as the second argument,
 46048  //  ** except for object itself, which is preserved.
 46049  //  **
 46050  //  ** The difference between this function and sqlite3VdbeDelete() is that
 46051  //  ** VdbeDelete() also unlinks the Vdbe from the list of VMs associated with
 46052  //  ** the database connection and frees the object itself.
 46053  //  */
 46054  func _sqlite3VdbeClearObject(tls *crt.TLS, _db *Xsqlite3, _p *TVdbe) {
 46055  	var _pSub, _pNext *XSubProgram
 46056  	func() {
 46057  		if (*Xsqlite3)(_p.Xdb) != nil && (*Xsqlite3)(_p.Xdb) != _db {
 46058  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74417), unsafe.Pointer(&_sqlite3VdbeClearObjectØ00__func__Ø000), unsafe.Pointer(str(58937)))
 46059  			crt.X__builtin_abort(tls)
 46060  		}
 46061  	}()
 46062  	_releaseMemArray(tls, (*XMem)(_p.XaColName), int32(_p.XnResColumn)*int32(2))
 46063  	_pSub = (*XSubProgram)(_p.XpProgram)
 46064  _3:
 46065  	if _pSub == nil {
 46066  		goto _6
 46067  	}
 46068  	_pNext = (*XSubProgram)(_pSub.XpNext)
 46069  	_vdbeFreeOpArray(tls, _db, (*XVdbeOp)(_pSub.XaOp), _pSub.XnOp)
 46070  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pSub))
 46071  	_pSub = _pNext
 46072  	goto _3
 46073  _6:
 46074  	if _p.Xmagic != uint32(381479589) {
 46075  		_releaseMemArray(tls, (*XMem)(_p.XaVar), int32(_p.XnVar))
 46076  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_p.XpVList))
 46077  		_sqlite3DbFree(tls, _db, _p.XpFree)
 46078  	}
 46079  	_vdbeFreeOpArray(tls, _db, (*XVdbeOp)(_p.XaOp), _p.XnOp)
 46080  	_sqlite3DbFree(tls, _db, _p.XaColName)
 46081  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_p.XzSql))
 46082  }
 46083  
 46084  var _sqlite3VdbeClearObjectØ00__func__Ø000 [23]int8
 46085  
 46086  func init() {
 46087  	crt.Xstrncpy(nil, &_sqlite3VdbeClearObjectØ00__func__Ø000[0], str(58959), 23)
 46088  }
 46089  
 46090  // C comment
 46091  //  /*
 46092  //  ** Free the space allocated for aOp and any p4 values allocated for the
 46093  //  ** opcodes contained within. If aOp is not NULL it is assumed to contain
 46094  //  ** nOp entries.
 46095  //  */
 46096  func _vdbeFreeOpArray(tls *crt.TLS, _db *Xsqlite3, _aOp *XVdbeOp, _nOp int32) {
 46097  	var _1_pOp *XVdbeOp
 46098  	if _aOp == nil {
 46099  		goto _0
 46100  	}
 46101  	_1_pOp = elem61(_aOp, uintptr(_nOp-int32(1)))
 46102  _1:
 46103  	if crt.P2U(unsafe.Pointer(_1_pOp)) < crt.P2U(unsafe.Pointer(_aOp)) {
 46104  		goto _4
 46105  	}
 46106  	if _1_pOp.Xp4type != 0 {
 46107  		_freeP4(tls, _db, int32(_1_pOp.Xp4type), *(*unsafe.Pointer)(unsafe.Pointer(&_1_pOp.Xp4)))
 46108  	}
 46109  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_1_pOp.XzComment))
 46110  	*(*uintptr)(unsafe.Pointer(&_1_pOp)) += uintptr(4294967272)
 46111  	goto _1
 46112  _4:
 46113  	_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_aOp))
 46114  _0:
 46115  }
 46116  
 46117  // C comment
 46118  //  /*
 46119  //  ** Free all memory allocations in the pParse object
 46120  //  */
 46121  func _sqlite3ParserReset(tls *crt.TLS, _pParse *XParse) {
 46122  	var _1_db *Xsqlite3
 46123  	if _pParse == nil {
 46124  		goto _0
 46125  	}
 46126  	_1_db = (*Xsqlite3)(_pParse.Xdb)
 46127  	_sqlite3DbFree(tls, _1_db, unsafe.Pointer(_pParse.XaLabel))
 46128  	_sqlite3ExprListDelete(tls, _1_db, (*XExprList)(_pParse.XpConstExpr))
 46129  	if _1_db != nil {
 46130  		func() {
 46131  			if (_1_db.Xlookaside.XbDisable) < uint32(_pParse.XdisableLookaside) {
 46132  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116168), unsafe.Pointer(&_sqlite3ParserResetØ00__func__Ø000), unsafe.Pointer(str(58982)))
 46133  				crt.X__builtin_abort(tls)
 46134  			}
 46135  		}()
 46136  		_1_db.Xlookaside.XbDisable -= uint32(_pParse.XdisableLookaside)
 46137  	}
 46138  	_pParse.XdisableLookaside = 0
 46139  _0:
 46140  }
 46141  
 46142  var _sqlite3ParserResetØ00__func__Ø000 [19]int8
 46143  
 46144  func init() {
 46145  	crt.Xstrncpy(nil, &_sqlite3ParserResetØ00__func__Ø000[0], str(59033), 19)
 46146  }
 46147  
 46148  // C comment
 46149  //  /*
 46150  //  ** The following routine destroys a virtual machine that is created by
 46151  //  ** the sqlite3_compile() routine. The integer returned is an SQLITE_
 46152  //  ** success/failure code that describes the result of executing the virtual
 46153  //  ** machine.
 46154  //  **
 46155  //  ** This routine sets the error code and string returned by
 46156  //  ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
 46157  //  */
 46158  func Xsqlite3_finalize(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
 46159  	var _rc int32
 46160  	var _2_db *Xsqlite3
 46161  	var _2_v *TVdbe
 46162  	if _pStmt == nil {
 46163  		_rc = int32(0)
 46164  		goto _1
 46165  	}
 46166  	_2_v = (*TVdbe)(_pStmt)
 46167  	_2_db = (*Xsqlite3)(_2_v.Xdb)
 46168  	if _vdbeSafety(tls, _2_v) != 0 {
 46169  		return _sqlite3MisuseError(tls, int32(76202))
 46170  	}
 46171  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_2_db.Xmutex))
 46172  	if _2_v.XstartTime > (0) {
 46173  		_invokeProfileCallback(tls, _2_db, _2_v)
 46174  	}
 46175  	_rc = _sqlite3VdbeFinalize(tls, _2_v)
 46176  	_rc = _sqlite3ApiExit(tls, _2_db, _rc)
 46177  	_sqlite3LeaveMutexAndCloseZombie(tls, _2_db)
 46178  _1:
 46179  	return _rc
 46180  }
 46181  
 46182  // C comment
 46183  //  /*
 46184  //  ** Invoke the profile callback.  This routine is only called if we already
 46185  //  ** know that the profile callback is defined and needs to be invoked.
 46186  //  */
 46187  func _invokeProfileCallback(tls *crt.TLS, _db *Xsqlite3, _p *TVdbe) {
 46188  	var _iNow, _iElapse int64
 46189  	func() {
 46190  		if _p.XstartTime <= (0) {
 46191  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76160), unsafe.Pointer(&_invokeProfileCallbackØ00__func__Ø000), unsafe.Pointer(str(59052)))
 46192  			crt.X__builtin_abort(tls)
 46193  		}
 46194  	}()
 46195  	func() {
 46196  		if _db.XxProfile == nil && (int32(_db.XmTrace)&int32(2)) == int32(0) {
 46197  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76161), unsafe.Pointer(&_invokeProfileCallbackØ00__func__Ø000), unsafe.Pointer(str(59067)))
 46198  			crt.X__builtin_abort(tls)
 46199  		}
 46200  	}()
 46201  	func() {
 46202  		if int32(_db.Xinit.Xbusy) != int32(0) {
 46203  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76162), unsafe.Pointer(&_invokeProfileCallbackØ00__func__Ø000), unsafe.Pointer(str(49851)))
 46204  			crt.X__builtin_abort(tls)
 46205  		}
 46206  	}()
 46207  	func() {
 46208  		if _p.XzSql == nil {
 46209  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76163), unsafe.Pointer(&_invokeProfileCallbackØ00__func__Ø000), unsafe.Pointer(str(59125)))
 46210  			crt.X__builtin_abort(tls)
 46211  		}
 46212  	}()
 46213  	_sqlite3OsCurrentTimeInt64(tls, (*Xsqlite3_vfs)(_db.XpVfs), &_iNow)
 46214  	_iElapse = (_iNow - _p.XstartTime) * int64(1000000)
 46215  	if _db.XxProfile != nil {
 46216  		_db.XxProfile(tls, _db.XpProfileArg, _p.XzSql, uint64(_iElapse))
 46217  	}
 46218  	if (int32(_db.XmTrace) & int32(2)) != 0 {
 46219  		_db.XxTrace(tls, uint32(2), _db.XpTraceArg, unsafe.Pointer(_p), unsafe.Pointer(&_iElapse))
 46220  	}
 46221  	_p.XstartTime = 0
 46222  }
 46223  
 46224  var _invokeProfileCallbackØ00__func__Ø000 [22]int8
 46225  
 46226  func init() {
 46227  	crt.Xstrncpy(nil, &_invokeProfileCallbackØ00__func__Ø000[0], str(59136), 22)
 46228  }
 46229  
 46230  var _sqlite3LockAndPrepareØ00__func__Ø000 [22]int8
 46231  
 46232  func init() {
 46233  	crt.Xstrncpy(nil, &_sqlite3LockAndPrepareØ00__func__Ø000[0], str(59158), 22)
 46234  }
 46235  
 46236  var _sqlite3_prepareØ00__func__Ø000 [16]int8
 46237  
 46238  func init() {
 46239  	crt.Xstrncpy(nil, &_sqlite3_prepareØ00__func__Ø000[0], str(59180), 16)
 46240  }
 46241  
 46242  // C comment
 46243  //  /*
 46244  //  ** Return UTF-8 encoded English language explanation of the most recent
 46245  //  ** error.
 46246  //  */
 46247  func Xsqlite3_errmsg(tls *crt.TLS, _db *Xsqlite3) (r0 *int8) {
 46248  	var _z *int8
 46249  	if _db == nil {
 46250  		return _sqlite3ErrStr(tls, _sqlite3NomemError(tls, int32(142705)))
 46251  	}
 46252  	if _sqlite3SafetyCheckSickOrOk(tls, _db) == 0 {
 46253  		return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(142708)))
 46254  	}
 46255  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 46256  	if _db.XmallocFailed != 0 {
 46257  		_z = _sqlite3ErrStr(tls, _sqlite3NomemError(tls, int32(142712)))
 46258  		goto _3
 46259  	}
 46260  	_z = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, (*XMem)(_db.XpErr))))
 46261  	func() {
 46262  		if _db.XmallocFailed != 0 {
 46263  			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)))
 46264  			crt.X__builtin_abort(tls)
 46265  		}
 46266  	}()
 46267  	if _z == nil {
 46268  		_z = _sqlite3ErrStr(tls, _db.XerrCode)
 46269  	}
 46270  _3:
 46271  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 46272  	return _z
 46273  }
 46274  
 46275  // C comment
 46276  //  /*
 46277  //  ** Return a static string that describes the kind of error specified in the
 46278  //  ** argument.
 46279  //  */
 46280  func _sqlite3ErrStr(tls *crt.TLS, _rc int32) (r0 *int8) {
 46281  	var _zErr *int8
 46282  	_zErr = str(59196)
 46283  	switch _rc {
 46284  	case int32(516):
 46285  		goto _1
 46286  	default:
 46287  		goto _2
 46288  	}
 46289  
 46290  _1:
 46291  	_zErr = str(59210)
 46292  	goto _3
 46293  _2:
 46294  	_rc &= int32(255)
 46295  	if (func() int32 {
 46296  		if _rc >= int32(0) {
 46297  			return int32(1)
 46298  		}
 46299  		return func() int32 {
 46300  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(141905), unsafe.Pointer(&_sqlite3ErrStrØ00__func__Ø000), unsafe.Pointer(str(4809)))
 46301  			crt.X__builtin_abort(tls)
 46302  			return int32(0)
 46303  		}()
 46304  	}() != 0 && (_rc < int32(27))) && ((*elem0((**int8)(unsafe.Pointer(&_sqlite3ErrStrØ00aMsgØ001)), uintptr(_rc))) != nil) {
 46305  		_zErr = *elem0((**int8)(unsafe.Pointer(&_sqlite3ErrStrØ00aMsgØ001)), uintptr(_rc))
 46306  	}
 46307  	goto _3
 46308  _3:
 46309  	return _zErr
 46310  }
 46311  
 46312  var _sqlite3ErrStrØ00__func__Ø000 [14]int8
 46313  
 46314  func init() {
 46315  	crt.Xstrncpy(nil, &_sqlite3ErrStrØ00__func__Ø000[0], str(59232), 14)
 46316  }
 46317  
 46318  var _sqlite3ErrStrØ00aMsgØ001 [27]*int8
 46319  
 46320  func init() {
 46321  	_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)}
 46322  }
 46323  
 46324  var _sqlite3_errmsgØ00__func__Ø000 [15]int8
 46325  
 46326  func init() {
 46327  	crt.Xstrncpy(nil, &_sqlite3_errmsgØ00__func__Ø000[0], str(59878), 15)
 46328  }
 46329  
 46330  // C comment
 46331  //  /*
 46332  //  ** Locate the in-memory structure that describes
 46333  //  ** a particular index given the name of that index
 46334  //  ** and the name of the database that contains the index.
 46335  //  ** Return NULL if not found.
 46336  //  **
 46337  //  ** If zDatabase is 0, all databases are searched for the
 46338  //  ** table and the first matching index is returned.  (No checking
 46339  //  ** for duplicate index names is done.)  The search order is
 46340  //  ** TEMP first, then MAIN, then any auxiliary databases added
 46341  //  ** using the ATTACH command.
 46342  //  */
 46343  func _sqlite3FindIndex(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _zDb *int8) (r0 *XIndex) {
 46344  	var _i, _1_j int32
 46345  	var _1_pSchema *XSchema
 46346  	var _p *XIndex
 46347  	_p = nil
 46348  	func() {
 46349  		if _zDb == nil && _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
 46350  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100120), unsafe.Pointer(&_sqlite3FindIndexØ00__func__Ø000), unsafe.Pointer(str(59893)))
 46351  			crt.X__builtin_abort(tls)
 46352  		}
 46353  	}()
 46354  	_i = int32(0)
 46355  _3:
 46356  	if _i >= _db.XnDb {
 46357  		goto _6
 46358  	}
 46359  	_1_j = func() int32 {
 46360  		if _i < int32(2) {
 46361  			return (_i ^ int32(1))
 46362  		}
 46363  		return _i
 46364  	}()
 46365  	_1_pSchema = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_1_j)).XpSchema)
 46366  	func() {
 46367  		if _1_pSchema == nil {
 46368  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100124), unsafe.Pointer(&_sqlite3FindIndexØ00__func__Ø000), unsafe.Pointer(str(59935)))
 46369  			crt.X__builtin_abort(tls)
 46370  		}
 46371  	}()
 46372  	if (_zDb != nil) && _sqlite3StrICmp(tls, _zDb, elem27((*XDb)(_db.XaDb), uintptr(_1_j)).XzDbSName) != 0 {
 46373  		goto _4
 46374  	}
 46375  	func() {
 46376  		if _sqlite3SchemaMutexHeld(tls, _db, _1_j, nil) == 0 {
 46377  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100126), unsafe.Pointer(&_sqlite3FindIndexØ00__func__Ø000), unsafe.Pointer(str(59943)))
 46378  			crt.X__builtin_abort(tls)
 46379  		}
 46380  	}()
 46381  	_p = (*XIndex)(_sqlite3HashFind(tls, &_1_pSchema.XidxHash, _zName))
 46382  	if _p != nil {
 46383  		goto _6
 46384  	}
 46385  _4:
 46386  	_i += 1
 46387  	goto _3
 46388  _6:
 46389  	return _p
 46390  }
 46391  
 46392  var _sqlite3FindIndexØ00__func__Ø000 [17]int8
 46393  
 46394  func init() {
 46395  	crt.Xstrncpy(nil, &_sqlite3FindIndexØ00__func__Ø000[0], str(59976), 17)
 46396  }
 46397  
 46398  // C comment
 46399  //  /*
 46400  //  ** Free any prior content in *pz and replace it with a copy of zNew.
 46401  //  */
 46402  func _sqlite3SetString(tls *crt.TLS, _pz **int8, _db *Xsqlite3, _zNew *int8) {
 46403  	_sqlite3DbFree(tls, _db, unsafe.Pointer(*_pz))
 46404  	*_pz = _sqlite3DbStrDup(tls, _db, _zNew)
 46405  }
 46406  
 46407  // C comment
 46408  //  /*
 46409  //  ** Change the "soft" limit on the number of pages in the cache.
 46410  //  ** Unused and unmodified pages will be recycled when the number of
 46411  //  ** pages in the cache exceeds this soft limit.  But the size of the
 46412  //  ** cache is allowed to grow larger than this limit if it contains
 46413  //  ** dirty pages or pages still in active use.
 46414  //  */
 46415  func _sqlite3BtreeSetCacheSize(tls *crt.TLS, _p *XBtree, _mxPage int32) (r0 int32) {
 46416  	var _pBt *XBtShared
 46417  	_pBt = (*XBtShared)(_p.XpBt)
 46418  	func() {
 46419  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 46420  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61662), unsafe.Pointer(&_sqlite3BtreeSetCacheSizeØ00__func__Ø000), unsafe.Pointer(str(8939)))
 46421  			crt.X__builtin_abort(tls)
 46422  		}
 46423  	}()
 46424  	_sqlite3BtreeEnter(tls, _p)
 46425  	_sqlite3PagerSetCachesize(tls, (*XPager)(_pBt.XpPager), _mxPage)
 46426  	_sqlite3BtreeLeave(tls, _p)
 46427  	return int32(0)
 46428  }
 46429  
 46430  var _sqlite3BtreeSetCacheSizeØ00__func__Ø000 [25]int8
 46431  
 46432  func init() {
 46433  	crt.Xstrncpy(nil, &_sqlite3BtreeSetCacheSizeØ00__func__Ø000[0], str(59993), 25)
 46434  }
 46435  
 46436  // C comment
 46437  //  /*
 46438  //  ** Change the maximum number of in-memory pages that are allowed
 46439  //  ** before attempting to recycle clean and unused pages.
 46440  //  */
 46441  func _sqlite3PagerSetCachesize(tls *crt.TLS, _pPager *XPager, _mxPage int32) {
 46442  	_sqlite3PcacheSetCachesize(tls, (*XPCache)(_pPager.XpPCache), _mxPage)
 46443  }
 46444  
 46445  // C comment
 46446  //  /*
 46447  //  ** Set the suggested cache-size value.
 46448  //  */
 46449  func _sqlite3PcacheSetCachesize(tls *crt.TLS, _pCache *XPCache, _mxPage int32) {
 46450  	func() {
 46451  		if _pCache.XpCache == nil {
 46452  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44939), unsafe.Pointer(&_sqlite3PcacheSetCachesizeØ00__func__Ø000), unsafe.Pointer(str(15913)))
 46453  			crt.X__builtin_abort(tls)
 46454  		}
 46455  	}()
 46456  	_pCache.XszCache = _mxPage
 46457  	(_sqlite3Config.Xpcache2.XxCachesize)(tls, _pCache.XpCache, _numberOfCachePages(tls, _pCache))
 46458  }
 46459  
 46460  var _sqlite3PcacheSetCachesizeØ00__func__Ø000 [26]int8
 46461  
 46462  func init() {
 46463  	crt.Xstrncpy(nil, &_sqlite3PcacheSetCachesizeØ00__func__Ø000[0], str(60018), 26)
 46464  }
 46465  
 46466  // C comment
 46467  //  /*
 46468  //  ** Execute SQL code.  Return one of the SQLITE_ success/failure
 46469  //  ** codes.  Also write an error message into memory obtained from
 46470  //  ** malloc() and make *pzErrMsg point to that message.
 46471  //  **
 46472  //  ** If the SQL is a query, then for each row in the query result
 46473  //  ** the xCallback() function is called.  pArg becomes the first
 46474  //  ** argument to xCallback().  If xCallback=NULL then no callback
 46475  //  ** is invoked, even for queries.
 46476  //  */
 46477  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) {
 46478  	var _rc, _callbackIsInit, _1_nCol, _4_i, _14_nErrMsg int32
 46479  	var _zLeftover *int8
 46480  	var _pStmt unsafe.Pointer
 46481  	var _azCols, _1_azVals **int8
 46482  	_rc = int32(0)
 46483  	_pStmt = nil
 46484  	_azCols = nil
 46485  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
 46486  		return _sqlite3MisuseError(tls, int32(111141))
 46487  	}
 46488  	if _zSql == nil {
 46489  		_zSql = str(284)
 46490  	}
 46491  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 46492  	_sqlite3Error(tls, _db, int32(0))
 46493  _2:
 46494  	if _rc != int32(0) || (*elem1(_zSql, 0)) == 0 {
 46495  		goto _exec_out
 46496  	}
 46497  	_1_azVals = nil
 46498  	_pStmt = nil
 46499  	_rc = Xsqlite3_prepare_v2(tls, _db, _zSql, int32(-1), &_pStmt, &_zLeftover)
 46500  	func() {
 46501  		if _rc != int32(0) && _pStmt != nil {
 46502  			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)))
 46503  			crt.X__builtin_abort(tls)
 46504  		}
 46505  	}()
 46506  	if _rc != int32(0) {
 46507  		goto _2
 46508  	}
 46509  	if _pStmt == nil {
 46510  		_zSql = _zLeftover
 46511  		goto _2
 46512  	}
 46513  	_callbackIsInit = int32(0)
 46514  	_1_nCol = Xsqlite3_column_count(tls, _pStmt)
 46515  _10:
 46516  	_rc = Xsqlite3_step(tls, _pStmt)
 46517  	if _xCallback == nil || int32(100) != _rc && (int32(101) != _rc || _callbackIsInit != 0 || (_db.Xflags&int32(256)) == 0) {
 46518  		goto _16
 46519  	}
 46520  	if _callbackIsInit != 0 {
 46521  		goto _17
 46522  	}
 46523  	_azCols = (**int8)(_sqlite3DbMallocRaw(tls, _db, uint64(uint32((int32(2)*_1_nCol)+int32(1))*uint32(4))))
 46524  	if _azCols == nil {
 46525  		goto _exec_out
 46526  	}
 46527  	_4_i = int32(0)
 46528  _19:
 46529  	if _4_i >= _1_nCol {
 46530  		goto _22
 46531  	}
 46532  	*elem0(_azCols, uintptr(_4_i)) = Xsqlite3_column_name(tls, _pStmt, _4_i)
 46533  	func() {
 46534  		if (*elem0(_azCols, uintptr(_4_i))) == nil {
 46535  			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)))
 46536  			crt.X__builtin_abort(tls)
 46537  		}
 46538  	}()
 46539  	_4_i += 1
 46540  	goto _19
 46541  _22:
 46542  	_callbackIsInit = int32(1)
 46543  _17:
 46544  	if _rc != int32(100) {
 46545  		goto _25
 46546  	}
 46547  	_1_azVals = elem0(_azCols, uintptr(_1_nCol))
 46548  	_4_i = int32(0)
 46549  _26:
 46550  	if _4_i >= _1_nCol {
 46551  		goto _29
 46552  	}
 46553  	*elem0(_1_azVals, uintptr(_4_i)) = (*int8)(unsafe.Pointer(Xsqlite3_column_text(tls, _pStmt, _4_i)))
 46554  	if ((*elem0(_1_azVals, uintptr(_4_i))) == nil) && (Xsqlite3_column_type(tls, _pStmt, _4_i) != int32(5)) {
 46555  		_sqlite3OomFault(tls, _db)
 46556  		goto _exec_out
 46557  	}
 46558  	_4_i += 1
 46559  	goto _26
 46560  _29:
 46561  	*elem0(_1_azVals, uintptr(_4_i)) = nil
 46562  _25:
 46563  	if _xCallback(tls, _pArg, _1_nCol, _1_azVals, _azCols) != 0 {
 46564  		_rc = int32(4)
 46565  		_sqlite3VdbeFinalize(tls, (*TVdbe)(_pStmt))
 46566  		_pStmt = nil
 46567  		_sqlite3Error(tls, _db, int32(4))
 46568  		goto _exec_out
 46569  	}
 46570  _16:
 46571  	if _rc == int32(100) {
 46572  		goto _33
 46573  	}
 46574  	_rc = _sqlite3VdbeFinalize(tls, (*TVdbe)(_pStmt))
 46575  	_pStmt = nil
 46576  	_zSql = _zLeftover
 46577  _34:
 46578  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_zSql, 0))))) & int32(1)) != 0 {
 46579  		*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
 46580  		goto _34
 46581  	}
 46582  	goto _11
 46583  _33:
 46584  	goto _10
 46585  _11:
 46586  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_azCols))
 46587  	_azCols = nil
 46588  	goto _2
 46589  _exec_out:
 46590  	if _pStmt != nil {
 46591  		_sqlite3VdbeFinalize(tls, (*TVdbe)(_pStmt))
 46592  	}
 46593  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_azCols))
 46594  	_rc = _sqlite3ApiExit(tls, _db, _rc)
 46595  	if _rc == int32(0) || _pzErrMsg == nil {
 46596  		goto _38
 46597  	}
 46598  	_14_nErrMsg = int32(1) + _sqlite3Strlen30(tls, Xsqlite3_errmsg(tls, _db))
 46599  	*_pzErrMsg = (*int8)(_sqlite3Malloc(tls, uint64(_14_nErrMsg)))
 46600  	if (*_pzErrMsg) != nil {
 46601  		crt.Xmemcpy(tls, unsafe.Pointer(*_pzErrMsg), unsafe.Pointer(Xsqlite3_errmsg(tls, _db)), uint32(_14_nErrMsg))
 46602  		goto _40
 46603  	}
 46604  	_rc = _sqlite3NomemError(tls, int32(111233))
 46605  	_sqlite3Error(tls, _db, int32(7))
 46606  _40:
 46607  	goto _42
 46608  _38:
 46609  	if _pzErrMsg != nil {
 46610  		*_pzErrMsg = nil
 46611  	}
 46612  _42:
 46613  	func() {
 46614  		if (_rc & _db.XerrMask) != _rc {
 46615  			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)))
 46616  			crt.X__builtin_abort(tls)
 46617  		}
 46618  	}()
 46619  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 46620  	return _rc
 46621  }
 46622  
 46623  func Xsqlite3_prepare_v2(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _nBytes int32, _ppStmt *unsafe.Pointer, _pzTail **int8) (r0 int32) {
 46624  	var _rc int32
 46625  	_rc = _sqlite3LockAndPrepare(tls, _db, _zSql, _nBytes, int32(1), nil, _ppStmt, _pzTail)
 46626  	func() {
 46627  		if _rc != int32(0) && _ppStmt != nil && (*_ppStmt) != nil {
 46628  			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)))
 46629  			crt.X__builtin_abort(tls)
 46630  		}
 46631  	}()
 46632  	return _rc
 46633  }
 46634  
 46635  var _sqlite3_prepare_v2Ø00__func__Ø000 [19]int8
 46636  
 46637  func init() {
 46638  	crt.Xstrncpy(nil, &_sqlite3_prepare_v2Ø00__func__Ø000[0], str(60083), 19)
 46639  }
 46640  
 46641  var _sqlite3_execØ00__func__Ø000 [13]int8
 46642  
 46643  func init() {
 46644  	crt.Xstrncpy(nil, &_sqlite3_execØ00__func__Ø000[0], str(60102), 13)
 46645  }
 46646  
 46647  // C comment
 46648  //  /*
 46649  //  ** This is the top-level implementation of sqlite3_step().  Call
 46650  //  ** sqlite3Step() to do most of the work.  If a schema error occurs,
 46651  //  ** call sqlite3Reprepare() and try again.
 46652  //  */
 46653  func Xsqlite3_step(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
 46654  	var _rc, _rc2, _cnt, _2_savedPc int32
 46655  	var _3_zErr *int8
 46656  	var _db *Xsqlite3
 46657  	var _v *TVdbe
 46658  	_rc = int32(0)
 46659  	_rc2 = int32(0)
 46660  	_v = (*TVdbe)(_pStmt)
 46661  	_cnt = int32(0)
 46662  	if _vdbeSafetyNotNull(tls, _v) != 0 {
 46663  		return _sqlite3MisuseError(tls, int32(76755))
 46664  	}
 46665  	_db = (*Xsqlite3)(_v.Xdb)
 46666  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 46667  	storebits26(&_v.Xexpired, 0, 2, 1)
 46668  _1:
 46669  	if store2(&_rc, _sqlite3Step(tls, _v)) != int32(17) || postInc2(&_cnt, 1) >= int32(50) {
 46670  		goto _2
 46671  	}
 46672  	_2_savedPc = _v.Xpc
 46673  	_rc2 = store2(&_rc, _sqlite3Reprepare(tls, _v))
 46674  	if _rc != int32(0) {
 46675  		goto _2
 46676  	}
 46677  	Xsqlite3_reset(tls, _pStmt)
 46678  	if _2_savedPc >= int32(0) {
 46679  		storebits26(&_v.Xexpired, int16(1), 2, 1)
 46680  	}
 46681  	func() {
 46682  		if int32((uint32(_v.Xexpired)<<31)>>31) != int32(0) {
 46683  			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)))
 46684  			crt.X__builtin_abort(tls)
 46685  		}
 46686  	}()
 46687  	goto _1
 46688  _2:
 46689  	if _rc2 == int32(0) {
 46690  		goto _8
 46691  	}
 46692  	_3_zErr = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, (*XMem)(_db.XpErr))))
 46693  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_v.XzErrMsg))
 46694  	if _db.XmallocFailed == 0 {
 46695  		_v.XzErrMsg = _sqlite3DbStrDup(tls, _db, _3_zErr)
 46696  		_v.Xrc = _rc2
 46697  		goto _10
 46698  	}
 46699  	_v.XzErrMsg = nil
 46700  	_v.Xrc = store2(&_rc, _sqlite3NomemError(tls, int32(76785)))
 46701  _10:
 46702  _8:
 46703  	_rc = _sqlite3ApiExit(tls, _db, _rc)
 46704  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
 46705  	return _rc
 46706  
 46707  	_ = _cnt
 46708  	panic(0)
 46709  }
 46710  
 46711  // C comment
 46712  //  /*
 46713  //  ** Execute the statement pStmt, either until a row of data is ready, the
 46714  //  ** statement is completely executed or an error occurs.
 46715  //  **
 46716  //  ** This routine implements the bulk of the logic behind the sqlite_step()
 46717  //  ** API.  The only thing omitted is the automatic recompile if a
 46718  //  ** schema change has occurred.  That detail is handled by the
 46719  //  ** outer sqlite3_step() wrapper procedure.
 46720  //  */
 46721  func _sqlite3Step(tls *crt.TLS, _p *TVdbe) (r0 int32) {
 46722  	var _rc int32
 46723  	var _db *Xsqlite3
 46724  	func() {
 46725  		if _p == nil {
 46726  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76621), unsafe.Pointer(&_sqlite3StepØ00__func__Ø000), unsafe.Pointer(str(9615)))
 46727  			crt.X__builtin_abort(tls)
 46728  		}
 46729  	}()
 46730  	if _p.Xmagic != uint32(770837923) {
 46731  		Xsqlite3_reset(tls, unsafe.Pointer(_p))
 46732  	}
 46733  	_db = (*Xsqlite3)(_p.Xdb)
 46734  	if _db.XmallocFailed != 0 {
 46735  		_p.Xrc = int32(7)
 46736  		return _sqlite3NomemError(tls, int32(76654))
 46737  	}
 46738  	if (_p.Xpc <= int32(0)) && (((uint32(_p.Xexpired) << 31) >> 31) != 0) {
 46739  		_p.Xrc = int32(17)
 46740  		_rc = int32(1)
 46741  		goto _end_of_step
 46742  	}
 46743  	if _p.Xpc >= int32(0) {
 46744  		goto _6
 46745  	}
 46746  	if _db.XnVdbeActive == int32(0) {
 46747  		*(*int32)(unsafe.Pointer(&_db.Xu1)) = int32(0)
 46748  	}
 46749  	func() {
 46750  		if _db.XnVdbeWrite <= int32(0) && int32(_db.XautoCommit) != int32(0) && (_db.XnDeferredCons != (0) || _db.XnDeferredImmCons != (0)) {
 46751  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76671), unsafe.Pointer(&_sqlite3StepØ00__func__Ø000), unsafe.Pointer(str(60129)))
 46752  			crt.X__builtin_abort(tls)
 46753  		}
 46754  	}()
 46755  	if (((_db.XxProfile != nil) || ((int32(_db.XmTrace) & int32(2)) != int32(0))) && ((_db.Xinit.Xbusy) == 0)) && (_p.XzSql != nil) {
 46756  		_sqlite3OsCurrentTimeInt64(tls, (*Xsqlite3_vfs)(_db.XpVfs), &_p.XstartTime)
 46757  		goto _17
 46758  	}
 46759  	func() {
 46760  		if _p.XstartTime != (0) {
 46761  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76680), unsafe.Pointer(&_sqlite3StepØ00__func__Ø000), unsafe.Pointer(str(60220)))
 46762  			crt.X__builtin_abort(tls)
 46763  		}
 46764  	}()
 46765  _17:
 46766  	_db.XnVdbeActive += 1
 46767  	if int32((uint32(_p.Xexpired>>7)<<31)>>31) == int32(0) {
 46768  		_db.XnVdbeWrite += 1
 46769  	}
 46770  	if ((uint32(_p.Xexpired>>8) << 31) >> 31) != 0 {
 46771  		_db.XnVdbeRead += 1
 46772  	}
 46773  	_p.Xpc = int32(0)
 46774  _6:
 46775  	_p.XrcApp = int32(0)
 46776  	if ((uint32(_p.Xexpired>>2) << 30) >> 30) != 0 {
 46777  		_rc = _sqlite3VdbeList(tls, _p)
 46778  		goto _23
 46779  	}
 46780  	_db.XnVdbeExec += 1
 46781  	_rc = _sqlite3VdbeExec(tls, _p)
 46782  	_db.XnVdbeExec -= 1
 46783  _23:
 46784  	if _rc == int32(100) {
 46785  		goto _25
 46786  	}
 46787  	if _p.XstartTime > (0) {
 46788  		_invokeProfileCallback(tls, _db, _p)
 46789  	}
 46790  _25:
 46791  	if _rc != int32(101) {
 46792  		goto _26
 46793  	}
 46794  	func() {
 46795  		if _p.Xrc != int32(0) {
 46796  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76709), unsafe.Pointer(&_sqlite3StepØ00__func__Ø000), unsafe.Pointer(str(60236)))
 46797  			crt.X__builtin_abort(tls)
 46798  		}
 46799  	}()
 46800  	_p.Xrc = _doWalCallbacks(tls, _db)
 46801  	if _p.Xrc != int32(0) {
 46802  		_rc = int32(1)
 46803  	}
 46804  _26:
 46805  	_db.XerrCode = _rc
 46806  	if int32(7) == _sqlite3ApiExit(tls, (*Xsqlite3)(_p.Xdb), _p.Xrc) {
 46807  		_p.Xrc = _sqlite3NomemError(tls, int32(76718))
 46808  	}
 46809  _end_of_step:
 46810  	func() {
 46811  		if _rc != int32(100) && _rc != int32(101) && _rc != int32(1) && (_rc&int32(255)) != int32(5) && _rc != int32(21) {
 46812  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76728), unsafe.Pointer(&_sqlite3StepØ00__func__Ø000), unsafe.Pointer(str(60253)))
 46813  			crt.X__builtin_abort(tls)
 46814  		}
 46815  	}()
 46816  	func() {
 46817  		if (_p.Xrc == int32(100) || _p.Xrc == int32(101)) && _p.Xrc != _p.XrcApp {
 46818  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76731), unsafe.Pointer(&_sqlite3StepØ00__func__Ø000), unsafe.Pointer(str(60354)))
 46819  			crt.X__builtin_abort(tls)
 46820  		}
 46821  	}()
 46822  	if ((((uint32(_p.Xexpired>>9) << 31) >> 31) != 0) && (_rc != int32(100))) && (_rc != int32(101)) {
 46823  		_rc = _sqlite3VdbeTransferError(tls, _p)
 46824  	}
 46825  	return _rc & _db.XerrMask
 46826  }
 46827  
 46828  var _sqlite3StepØ00__func__Ø000 [12]int8
 46829  
 46830  func init() {
 46831  	crt.Xstrncpy(nil, &_sqlite3StepØ00__func__Ø000[0], str(60415), 12)
 46832  }
 46833  
 46834  // C comment
 46835  //  /*
 46836  //  ** Terminate the current execution of an SQL statement and reset it
 46837  //  ** back to its starting state so that it can be reused. A success code from
 46838  //  ** the prior execution is returned.
 46839  //  **
 46840  //  ** This routine sets the error code and string returned by
 46841  //  ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
 46842  //  */
 46843  func Xsqlite3_reset(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
 46844  	var _rc int32
 46845  	var _2_db *Xsqlite3
 46846  	var _2_v *TVdbe
 46847  	if _pStmt == nil {
 46848  		_rc = int32(0)
 46849  		goto _1
 46850  	}
 46851  	_2_v = (*TVdbe)(_pStmt)
 46852  	_2_db = (*Xsqlite3)(_2_v.Xdb)
 46853  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_2_db.Xmutex))
 46854  	if _2_v.XstartTime > (0) {
 46855  		_invokeProfileCallback(tls, _2_db, _2_v)
 46856  	}
 46857  	_rc = _sqlite3VdbeReset(tls, _2_v)
 46858  	_sqlite3VdbeRewind(tls, _2_v)
 46859  	func() {
 46860  		if (_rc & _2_db.XerrMask) != _rc {
 46861  			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)))
 46862  			crt.X__builtin_abort(tls)
 46863  		}
 46864  	}()
 46865  	_rc = _sqlite3ApiExit(tls, _2_db, _rc)
 46866  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_2_db.Xmutex))
 46867  _1:
 46868  	return _rc
 46869  }
 46870  
 46871  // C comment
 46872  //  /*
 46873  //  ** Rewind the VDBE back to the beginning in preparation for
 46874  //  ** running it.
 46875  //  */
 46876  func _sqlite3VdbeRewind(tls *crt.TLS, _p *TVdbe) {
 46877  	var _i int32
 46878  	func() {
 46879  		if _p == nil {
 46880  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73299), unsafe.Pointer(&_sqlite3VdbeRewindØ00__func__Ø000), unsafe.Pointer(str(807)))
 46881  			crt.X__builtin_abort(tls)
 46882  		}
 46883  	}()
 46884  	func() {
 46885  		if _p.Xmagic != uint32(381479589) && _p.Xmagic != uint32(1224384374) {
 46886  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73300), unsafe.Pointer(&_sqlite3VdbeRewindØ00__func__Ø000), unsafe.Pointer(str(60452)))
 46887  			crt.X__builtin_abort(tls)
 46888  		}
 46889  	}()
 46890  	func() {
 46891  		if _p.XnOp <= int32(0) {
 46892  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73304), unsafe.Pointer(&_sqlite3VdbeRewindØ00__func__Ø000), unsafe.Pointer(str(41671)))
 46893  			crt.X__builtin_abort(tls)
 46894  		}
 46895  	}()
 46896  	_p.Xmagic = uint32(770837923)
 46897  	_i = int32(0)
 46898  _7:
 46899  	if _i >= _p.XnMem {
 46900  		goto _10
 46901  	}
 46902  	func() {
 46903  		if (*Xsqlite3)(elem25((*XMem)(_p.XaMem), uintptr(_i)).Xdb) != (*Xsqlite3)(_p.Xdb) {
 46904  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73311), unsafe.Pointer(&_sqlite3VdbeRewindØ00__func__Ø000), unsafe.Pointer(str(60508)))
 46905  			crt.X__builtin_abort(tls)
 46906  		}
 46907  	}()
 46908  	_i += 1
 46909  	goto _7
 46910  _10:
 46911  	_p.Xpc = int32(-1)
 46912  	_p.Xrc = int32(0)
 46913  	_p.XerrorAction = uint8(2)
 46914  	_p.XnChange = int32(0)
 46915  	_p.XcacheCtr = uint32(1)
 46916  	_p.XminWriteFileFormat = uint8(255)
 46917  	_p.XiStatement = int32(0)
 46918  	_p.XnFkConstraint = 0
 46919  }
 46920  
 46921  var _sqlite3VdbeRewindØ00__func__Ø000 [18]int8
 46922  
 46923  func init() {
 46924  	crt.Xstrncpy(nil, &_sqlite3VdbeRewindØ00__func__Ø000[0], str(60529), 18)
 46925  }
 46926  
 46927  var _sqlite3_resetØ00__func__Ø000 [14]int8
 46928  
 46929  func init() {
 46930  	crt.Xstrncpy(nil, &_sqlite3_resetØ00__func__Ø000[0], str(60547), 14)
 46931  }
 46932  
 46933  // C comment
 46934  //  /*
 46935  //  ** Give a listing of the program in the virtual machine.
 46936  //  **
 46937  //  ** The interface is the same as sqlite3VdbeExec().  But instead of
 46938  //  ** running the code, it invokes the callback once for each instruction.
 46939  //  ** This feature is used to implement "EXPLAIN".
 46940  //  **
 46941  //  ** When p->explain==1, each instruction is listed.  When
 46942  //  ** p->explain==2, only OP_Explain instructions are listed and these
 46943  //  ** are shown in a different format.  p->explain==2 is used to implement
 46944  //  ** EXPLAIN QUERY PLAN.
 46945  //  **
 46946  //  ** When p->explain==1, first the main program is listed, then each of
 46947  //  ** the trigger subprograms are listed one by one.
 46948  //  */
 46949  func _sqlite3VdbeList(tls *crt.TLS, _p *TVdbe) (r0 int32) {
 46950  	var _nRow, _nSub, _i, _rc, _10_j, _13_nByte, _13_j int32
 46951  	var _8_zP4 *int8
 46952  	var _db *Xsqlite3
 46953  	var _pSub, _pMem *XMem
 46954  	var _8_pOp *XVdbeOp
 46955  	var _apSub **XSubProgram
 46956  	_nSub = int32(0)
 46957  	_apSub = nil
 46958  	_pSub = nil
 46959  	_db = (*Xsqlite3)(_p.Xdb)
 46960  	_rc = int32(0)
 46961  	_pMem = elem25((*XMem)(_p.XaMem), uintptr(1))
 46962  	func() {
 46963  		if ((uint32(_p.Xexpired>>2) << 30) >> 30) == 0 {
 46964  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73035), unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000), unsafe.Pointer(str(60561)))
 46965  			crt.X__builtin_abort(tls)
 46966  		}
 46967  	}()
 46968  	func() {
 46969  		if _p.Xmagic != uint32(770837923) {
 46970  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73036), unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000), unsafe.Pointer(str(60572)))
 46971  			crt.X__builtin_abort(tls)
 46972  		}
 46973  	}()
 46974  	func() {
 46975  		if _p.Xrc != int32(0) && _p.Xrc != int32(5) && _p.Xrc != int32(7) {
 46976  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73037), unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000), unsafe.Pointer(str(60597)))
 46977  			crt.X__builtin_abort(tls)
 46978  		}
 46979  	}()
 46980  	_releaseMemArray(tls, _pMem, int32(8))
 46981  	*(**XMem)(unsafe.Pointer(&_p.XpResultSet)) = nil
 46982  	if _p.Xrc == _sqlite3NomemError(tls, int32(73046)) {
 46983  		_sqlite3OomFault(tls, _db)
 46984  		return int32(1)
 46985  	}
 46986  	_nRow = _p.XnOp
 46987  	if int32((uint32(_p.Xexpired>>2)<<30)>>30) != int32(1) {
 46988  		goto _9
 46989  	}
 46990  	func() {
 46991  		if _p.XnMem <= int32(9) {
 46992  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73066), unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000), unsafe.Pointer(str(60659)))
 46993  			crt.X__builtin_abort(tls)
 46994  		}
 46995  	}()
 46996  	_pSub = elem25((*XMem)(_p.XaMem), uintptr(9))
 46997  	if (int32(_pSub.Xflags) & int32(16)) != 0 {
 46998  		_nSub = int32(uint32(_pSub.Xn) / uint32(4))
 46999  		_apSub = (**XSubProgram)(unsafe.Pointer(_pSub.Xz))
 47000  	}
 47001  	_i = int32(0)
 47002  _13:
 47003  	if _i >= _nSub {
 47004  		goto _16
 47005  	}
 47006  	_nRow += (*elem63(_apSub, uintptr(_i))).XnOp
 47007  	_i += 1
 47008  	goto _13
 47009  _16:
 47010  _9:
 47011  	_i = postInc2(&_p.Xpc, 1)
 47012  	if ((_i < _nRow) && (int32((uint32(_p.Xexpired>>2)<<30)>>30) == int32(2))) && (int32(elem61((*XVdbeOp)(_p.XaOp), uintptr(_i)).Xopcode) != int32(165)) {
 47013  		goto _9
 47014  	}
 47015  	if _i >= _nRow {
 47016  		_p.Xrc = int32(0)
 47017  		_rc = int32(101)
 47018  		goto _23
 47019  	}
 47020  	if (*(*int32)(unsafe.Pointer(&_db.Xu1))) != 0 {
 47021  		_p.Xrc = int32(9)
 47022  		_rc = int32(1)
 47023  		_sqlite3VdbeError(tls, _p, _sqlite3ErrStr(tls, _p.Xrc))
 47024  		goto _23
 47025  	}
 47026  	if _i < _p.XnOp {
 47027  		_8_pOp = elem61((*XVdbeOp)(_p.XaOp), uintptr(_i))
 47028  		goto _25
 47029  	}
 47030  	_i -= _p.XnOp
 47031  	_10_j = int32(0)
 47032  _26:
 47033  	if _i < ((*elem63(_apSub, uintptr(_10_j))).XnOp) {
 47034  		goto _29
 47035  	}
 47036  	_i -= (*elem63(_apSub, uintptr(_10_j))).XnOp
 47037  	_10_j += 1
 47038  	goto _26
 47039  _29:
 47040  	_8_pOp = elem61((*XVdbeOp)((*elem63(_apSub, uintptr(_10_j))).XaOp), uintptr(_i))
 47041  _25:
 47042  	if int32((uint32(_p.Xexpired>>2)<<30)>>30) != int32(1) {
 47043  		goto _30
 47044  	}
 47045  	_pMem.Xflags = uint16(4)
 47046  	*(*int64)(unsafe.Pointer(&_pMem.Xu)) = int64(_i)
 47047  	*(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(48)
 47048  	_pMem.Xflags = uint16(2562)
 47049  	_pMem.Xz = _sqlite3OpcodeName(tls, int32(_8_pOp.Xopcode))
 47050  	func() {
 47051  		if _pMem.Xz == nil {
 47052  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73113), unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000), unsafe.Pointer(str(60669)))
 47053  			crt.X__builtin_abort(tls)
 47054  		}
 47055  	}()
 47056  	_pMem.Xn = _sqlite3Strlen30(tls, _pMem.Xz)
 47057  	_pMem.Xenc = uint8(1)
 47058  	*(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(48)
 47059  	if int32(_8_pOp.Xp4type) != int32(-13) {
 47060  		goto _33
 47061  	}
 47062  	_13_nByte = int32(uint32(_nSub+int32(1)) * uint32(4))
 47063  	_13_j = int32(0)
 47064  _34:
 47065  	if _13_j >= _nSub {
 47066  		goto _37
 47067  	}
 47068  	if (*elem63(_apSub, uintptr(_13_j))) == (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer(&_8_pOp.Xp4))) {
 47069  		goto _37
 47070  	}
 47071  	_13_j += 1
 47072  	goto _34
 47073  _37:
 47074  	if (_13_j == _nSub) && (int32(0) == _sqlite3VdbeMemGrow(tls, _pSub, _13_nByte, bool2int(_nSub != int32(0)))) {
 47075  		_apSub = (**XSubProgram)(unsafe.Pointer(_pSub.Xz))
 47076  		*elem63(_apSub, uintptr(postInc2(&_nSub, 1))) = (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer(&_8_pOp.Xp4)))
 47077  		{
 47078  			p := &_pSub.Xflags
 47079  			*p = uint16(int32(*p) | int32(16))
 47080  		}
 47081  		_pSub.Xn = int32(uint32(_nSub) * uint32(4))
 47082  	}
 47083  _33:
 47084  _30:
 47085  	_pMem.Xflags = uint16(4)
 47086  	*(*int64)(unsafe.Pointer(&_pMem.Xu)) = int64(_8_pOp.Xp1)
 47087  	*(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(48)
 47088  	_pMem.Xflags = uint16(4)
 47089  	*(*int64)(unsafe.Pointer(&_pMem.Xu)) = int64(_8_pOp.Xp2)
 47090  	*(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(48)
 47091  	_pMem.Xflags = uint16(4)
 47092  	*(*int64)(unsafe.Pointer(&_pMem.Xu)) = int64(_8_pOp.Xp3)
 47093  	*(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(48)
 47094  	if _sqlite3VdbeMemClearAndResize(tls, _pMem, int32(100)) != 0 {
 47095  		func() {
 47096  			if ((*Xsqlite3)(_p.Xdb).XmallocFailed) == 0 {
 47097  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73151), unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000), unsafe.Pointer(str(60680)))
 47098  				crt.X__builtin_abort(tls)
 47099  			}
 47100  		}()
 47101  		return int32(1)
 47102  	}
 47103  	_pMem.Xflags = uint16(514)
 47104  	_8_zP4 = _displayP4(tls, _8_pOp, _pMem.Xz, _pMem.XszMalloc)
 47105  	if _8_zP4 != _pMem.Xz {
 47106  		_pMem.Xn = int32(0)
 47107  		_sqlite3VdbeMemSetStr(tls, _pMem, _8_zP4, int32(-1), uint8(1), nil)
 47108  		goto _45
 47109  	}
 47110  	func() {
 47111  		if _pMem.Xz == nil {
 47112  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73160), unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000), unsafe.Pointer(str(60669)))
 47113  			crt.X__builtin_abort(tls)
 47114  		}
 47115  	}()
 47116  	_pMem.Xn = _sqlite3Strlen30(tls, _pMem.Xz)
 47117  	_pMem.Xenc = uint8(1)
 47118  _45:
 47119  	*(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(48)
 47120  	if int32((uint32(_p.Xexpired>>2)<<30)>>30) != int32(1) {
 47121  		goto _48
 47122  	}
 47123  	if _sqlite3VdbeMemClearAndResize(tls, _pMem, int32(4)) != 0 {
 47124  		func() {
 47125  			if ((*Xsqlite3)(_p.Xdb).XmallocFailed) == 0 {
 47126  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73168), unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000), unsafe.Pointer(str(60680)))
 47127  				crt.X__builtin_abort(tls)
 47128  			}
 47129  		}()
 47130  		return int32(1)
 47131  	}
 47132  	_pMem.Xflags = uint16(514)
 47133  	_pMem.Xn = int32(2)
 47134  	Xsqlite3_snprintf(tls, int32(3), _pMem.Xz, str(60700), int32(_8_pOp.Xp5))
 47135  	_pMem.Xenc = uint8(1)
 47136  	*(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(48)
 47137  	if _sqlite3VdbeMemClearAndResize(tls, _pMem, int32(500)) != 0 {
 47138  		func() {
 47139  			if ((*Xsqlite3)(_p.Xdb).XmallocFailed) == 0 {
 47140  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73179), unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000), unsafe.Pointer(str(60680)))
 47141  				crt.X__builtin_abort(tls)
 47142  			}
 47143  		}()
 47144  		return int32(1)
 47145  	}
 47146  	_pMem.Xflags = uint16(514)
 47147  	_pMem.Xn = _displayComment(tls, _8_pOp, _8_zP4, _pMem.Xz, int32(500))
 47148  	_pMem.Xenc = uint8(1)
 47149  _48:
 47150  	_p.XnResColumn = uint16(int32(8) - (int32(4) * (int32((uint32(_p.Xexpired>>2)<<30)>>30) - int32(1))))
 47151  	*(**XMem)(unsafe.Pointer(&_p.XpResultSet)) = elem25((*XMem)(_p.XaMem), uintptr(1))
 47152  	_p.Xrc = int32(0)
 47153  	_rc = int32(100)
 47154  _23:
 47155  	return _rc
 47156  }
 47157  
 47158  var _sqlite3VdbeListØ00__func__Ø000 [16]int8
 47159  
 47160  func init() {
 47161  	crt.Xstrncpy(nil, &_sqlite3VdbeListØ00__func__Ø000[0], str(60705), 16)
 47162  }
 47163  
 47164  // C comment
 47165  //  /*
 47166  //  ** Execute as much of a VDBE program as we can.
 47167  //  ** This is the core of sqlite3_step().
 47168  //  */
 47169  func _sqlite3VdbeExec(tls *crt.TLS, _p *TVdbe) (r0 int32) {
 47170  	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
 47171  	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
 47172  	var _73_bIntint, _113_affinity int8
 47173  	var _nVmStep, _nProgressLimit, _2_iPrior, _164_iAddr, _179_offset, _179_avail, _179_t, _215_serial_type, _215_len, _379_n, _546_newMax uint32
 47174  	var _94_uA, _179_offset64, _215_nData, _334_iKey uint64
 47175  	var _140_aPermute, _445_aRoot *int32
 47176  	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
 47177  	var _458_t unsafe.Pointer
 47178  	var _73_rA, _73_rB float64
 47179  	var _45_nullFlag, _73_flags, _73_type1, _73_type2, _113_flags1, _113_flags3 uint16
 47180  	var _resetSchemaOnFault, _encoding, _11_opProperty, _94_op, _514_isWriteLock, _538_vtabOnConflict, _557_opProperty uint8
 47181  	var _179_zData, _179_zHdr, _179_zEndHdr, _215_zNewRecord *uint8
 47182  	var _179_aOffset *uint32
 47183  	var _496_aRes [3]int32
 47184  	var _db *Xsqlite3
 47185  	var _266_pBt, _282_pX, _499_pBt, _509_pBt, _546_pBt *XBtree
 47186  	var _278_pDb, _282_pDb, _430_pDb *XDb
 47187  	var _499_pPager *XPager
 47188  	var _356_pTab, _366_pTab *XTable
 47189  	var _528_sContext Xsqlite3_context
 47190  	var _87_pCtx, _88_pCtx, _485_pCtx, _486_pCtx *Xsqlite3_context
 47191  	var _179_sMem, _486_t, _519_sMem XMem
 47192  	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
 47193  	var _526_apArg, _536_apArg **XMem
 47194  	var _179_pCrsr, _228_pCrsr, _334_pCrsr, _379_pCrsr, _390_pCrsr, _394_pCrsr, _397_pCrsr, _406_pCrsr *XBtCursor
 47195  	var _324_pFree, _324_pIdxKey *XUnpackedRecord
 47196  	var _303_r, _324_r, _406_r, _414_r XUnpackedRecord
 47197  	var _140_pKeyInfo, _282_pKeyInfo, _292_pKeyInfo *XKeyInfo
 47198  	var _356_x, _403_x XBtreePayload
 47199  	var _27_pFrame, _340_pFrame, _458_pFrame, _465_pFrame, _473_pFrame *XVdbeFrame
 47200  	var _aOp, _pOp, _pOrigOp, _24_pCaller *XVdbeOp
 47201  	var _458_pProgram *XSubProgram
 47202  	var _518_pVTab *XVTable
 47203  	var _140_pColl *XCollSeq
 47204  	var _382_pVtab, _522_pVtab, _526_pVtab, _528_pVtab, _532_pVtab, _535_pVtab, _536_pVtab *Xsqlite3_vtab
 47205  	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
 47206  	var _522_pVCur, _526_pVCur *Xsqlite3_vtab_cursor
 47207  	var _382_pModule, _522_pModule, _526_pModule, _528_pModule, _532_pModule, _536_pModule *Xsqlite3_module
 47208  	var _229_pNew, _229_pSavepoint, _229_pTmp *XSavepoint
 47209  	var _434_initData XInitData
 47210  	var _550_x func(*crt.TLS, unsafe.Pointer, *int8)
 47211  	_aOp = (*XVdbeOp)(_p.XaOp)
 47212  	_pOp = _aOp
 47213  	_nExtraDelete = int32(0)
 47214  	_rc = int32(0)
 47215  	_db = (*Xsqlite3)(_p.Xdb)
 47216  	_resetSchemaOnFault = uint8(0)
 47217  	_encoding = _db.Xenc
 47218  	_iCompare = int32(0)
 47219  	_nVmStep = uint32(0)
 47220  	_nProgressLimit = uint32(0)
 47221  	_aMem = (*XMem)(_p.XaMem)
 47222  	_pIn1 = nil
 47223  	_pIn2 = nil
 47224  	_pIn3 = nil
 47225  	_pOut = nil
 47226  	func() {
 47227  		if _p.Xmagic != uint32(770837923) {
 47228  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78878), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(60572)))
 47229  			crt.X__builtin_abort(tls)
 47230  		}
 47231  	}()
 47232  	_sqlite3VdbeEnter(tls, _p)
 47233  	if _p.Xrc == int32(7) {
 47234  		goto _no_mem
 47235  	}
 47236  	func() {
 47237  		if _p.Xrc != int32(0) && (_p.Xrc&int32(255)) != int32(5) {
 47238  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78885), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(60721)))
 47239  			crt.X__builtin_abort(tls)
 47240  		}
 47241  	}()
 47242  	func() {
 47243  		if ((uint32(_p.Xexpired>>8)<<31)>>31) == 0 && int32((uint32(_p.Xexpired>>7)<<31)>>31) == int32(0) {
 47244  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78886), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(60767)))
 47245  			crt.X__builtin_abort(tls)
 47246  		}
 47247  	}()
 47248  	_p.XiCurrentTime = 0
 47249  	func() {
 47250  		if int32((uint32(_p.Xexpired>>2)<<30)>>30) != int32(0) {
 47251  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78888), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(60798)))
 47252  			crt.X__builtin_abort(tls)
 47253  		}
 47254  	}()
 47255  	*(**XMem)(unsafe.Pointer(&_p.XpResultSet)) = nil
 47256  	_db.XbusyHandler.XnBusy = int32(0)
 47257  	if (*(*int32)(unsafe.Pointer(&_db.Xu1))) != 0 {
 47258  		goto _abort_due_to_interrupt
 47259  	}
 47260  	if _db.XxProgress != nil {
 47261  		_2_iPrior = *elem7((*uint32)(unsafe.Pointer(&_p.XaCounter)), uintptr(4))
 47262  		func() {
 47263  			if (0) >= _db.XnProgressOps {
 47264  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78896), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(60812)))
 47265  				crt.X__builtin_abort(tls)
 47266  			}
 47267  		}()
 47268  		_nProgressLimit = _db.XnProgressOps - (_2_iPrior % _db.XnProgressOps)
 47269  	}
 47270  	_sqlite3BeginBenignMalloc(tls)
 47271  	if _p.Xpc != int32(0) || (((*Xsqlite3)(_p.Xdb).Xflags)&int32(134218753)) == int32(0) {
 47272  		goto _16
 47273  	}
 47274  	_3_once = int32(1)
 47275  	_sqlite3VdbePrintSql(tls, _p)
 47276  	if (((*Xsqlite3)(_p.Xdb).Xflags) & int32(1024)) == 0 {
 47277  		goto _17
 47278  	}
 47279  	crt.Xprintf(tls, str(60833))
 47280  	_3_i = int32(0)
 47281  _18:
 47282  	if _3_i >= _p.XnOp {
 47283  		goto _21
 47284  	}
 47285  	_sqlite3VdbePrintOp(tls, (*crt.XFILE)(Xstdout), _3_i, elem61(_aOp, uintptr(_3_i)))
 47286  	_3_i += 1
 47287  	goto _18
 47288  _21:
 47289  _17:
 47290  	if (((*Xsqlite3)(_p.Xdb).Xflags) & int32(134217728)) == 0 {
 47291  		goto _22
 47292  	}
 47293  	_3_i = int32(0)
 47294  _23:
 47295  	if _3_i >= _p.XnOp {
 47296  		goto _26
 47297  	}
 47298  	if int32(elem61(_aOp, uintptr(_3_i)).Xopcode) != int32(165) {
 47299  		goto _27
 47300  	}
 47301  	if _3_once != 0 {
 47302  		crt.Xprintf(tls, str(60856))
 47303  	}
 47304  	crt.Xprintf(tls, str(60874), unsafe.Pointer(*(**int8)(unsafe.Pointer(&(elem61(_aOp, uintptr(_3_i)).Xp4)))))
 47305  	_3_once = int32(0)
 47306  _27:
 47307  	_3_i += 1
 47308  	goto _23
 47309  _26:
 47310  _22:
 47311  	if (((*Xsqlite3)(_p.Xdb).Xflags) & int32(1)) != 0 {
 47312  		crt.Xprintf(tls, str(60878))
 47313  	}
 47314  _16:
 47315  	_sqlite3EndBenignMalloc(tls)
 47316  	_pOp = elem61(_aOp, uintptr(_p.Xpc))
 47317  _30:
 47318  	func() {
 47319  		if _rc != int32(0) {
 47320  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78930), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(14967)))
 47321  			crt.X__builtin_abort(tls)
 47322  		}
 47323  	}()
 47324  	func() {
 47325  		if crt.P2U(unsafe.Pointer(_pOp)) < crt.P2U(unsafe.Pointer(_aOp)) || crt.P2U(unsafe.Pointer(_pOp)) >= crt.P2U(unsafe.Pointer(elem61(_aOp, uintptr(_p.XnOp)))) {
 47326  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78932), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(60891)))
 47327  			crt.X__builtin_abort(tls)
 47328  		}
 47329  	}()
 47330  	_nVmStep += 1
 47331  	if (_db.Xflags & int32(1)) != 0 {
 47332  		_sqlite3VdbePrintOp(tls, (*crt.XFILE)(Xstdout), int32((uintptr(unsafe.Pointer(_pOp))-uintptr(unsafe.Pointer(_aOp)))/24), _pOp)
 47333  	}
 47334  	_11_opProperty = *elem15((*uint8)(unsafe.Pointer(&_sqlite3OpcodeProperty)), uintptr(_pOp.Xopcode))
 47335  	if (int32(_11_opProperty) & int32(2)) == int32(0) {
 47336  		goto _40
 47337  	}
 47338  	func() {
 47339  		if _pOp.Xp1 <= int32(0) {
 47340  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78967), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(60920)))
 47341  			crt.X__builtin_abort(tls)
 47342  		}
 47343  	}()
 47344  	func() {
 47345  		if _pOp.Xp1 > ((_p.XnMem + int32(1)) - _p.XnCursor) {
 47346  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78968), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(60930)))
 47347  			crt.X__builtin_abort(tls)
 47348  		}
 47349  	}()
 47350  	func() {
 47351  		if (int32(elem25(_aMem, uintptr(_pOp.Xp1)).Xflags) & int32(128)) != int32(0) {
 47352  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78969), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(60964)))
 47353  			crt.X__builtin_abort(tls)
 47354  		}
 47355  	}()
 47356  	func() {
 47357  		if _sqlite3VdbeCheckMemInvariants(tls, elem25(_aMem, uintptr(_pOp.Xp1))) == 0 {
 47358  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78970), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(60991)))
 47359  			crt.X__builtin_abort(tls)
 47360  		}
 47361  	}()
 47362  	if (_db.Xflags & int32(1)) != 0 {
 47363  		_registerTrace(tls, _pOp.Xp1, elem25(_aMem, uintptr(_pOp.Xp1)))
 47364  	}
 47365  _40:
 47366  	if (int32(_11_opProperty) & int32(4)) == int32(0) {
 47367  		goto _50
 47368  	}
 47369  	func() {
 47370  		if _pOp.Xp2 <= int32(0) {
 47371  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78974), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61037)))
 47372  			crt.X__builtin_abort(tls)
 47373  		}
 47374  	}()
 47375  	func() {
 47376  		if _pOp.Xp2 > ((_p.XnMem + int32(1)) - _p.XnCursor) {
 47377  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78975), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61047)))
 47378  			crt.X__builtin_abort(tls)
 47379  		}
 47380  	}()
 47381  	func() {
 47382  		if (int32(elem25(_aMem, uintptr(_pOp.Xp2)).Xflags) & int32(128)) != int32(0) {
 47383  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78976), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61081)))
 47384  			crt.X__builtin_abort(tls)
 47385  		}
 47386  	}()
 47387  	func() {
 47388  		if _sqlite3VdbeCheckMemInvariants(tls, elem25(_aMem, uintptr(_pOp.Xp2))) == 0 {
 47389  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78977), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61108)))
 47390  			crt.X__builtin_abort(tls)
 47391  		}
 47392  	}()
 47393  	if (_db.Xflags & int32(1)) != 0 {
 47394  		_registerTrace(tls, _pOp.Xp2, elem25(_aMem, uintptr(_pOp.Xp2)))
 47395  	}
 47396  _50:
 47397  	if (int32(_11_opProperty) & int32(8)) == int32(0) {
 47398  		goto _60
 47399  	}
 47400  	func() {
 47401  		if _pOp.Xp3 <= int32(0) {
 47402  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78981), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61154)))
 47403  			crt.X__builtin_abort(tls)
 47404  		}
 47405  	}()
 47406  	func() {
 47407  		if _pOp.Xp3 > ((_p.XnMem + int32(1)) - _p.XnCursor) {
 47408  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78982), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61164)))
 47409  			crt.X__builtin_abort(tls)
 47410  		}
 47411  	}()
 47412  	func() {
 47413  		if (int32(elem25(_aMem, uintptr(_pOp.Xp3)).Xflags) & int32(128)) != int32(0) {
 47414  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78983), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61198)))
 47415  			crt.X__builtin_abort(tls)
 47416  		}
 47417  	}()
 47418  	func() {
 47419  		if _sqlite3VdbeCheckMemInvariants(tls, elem25(_aMem, uintptr(_pOp.Xp3))) == 0 {
 47420  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78984), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61225)))
 47421  			crt.X__builtin_abort(tls)
 47422  		}
 47423  	}()
 47424  	if (_db.Xflags & int32(1)) != 0 {
 47425  		_registerTrace(tls, _pOp.Xp3, elem25(_aMem, uintptr(_pOp.Xp3)))
 47426  	}
 47427  _60:
 47428  	if (int32(_11_opProperty) & int32(16)) != int32(0) {
 47429  		func() {
 47430  			if _pOp.Xp2 <= int32(0) {
 47431  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78988), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61037)))
 47432  				crt.X__builtin_abort(tls)
 47433  			}
 47434  		}()
 47435  		func() {
 47436  			if _pOp.Xp2 > ((_p.XnMem + int32(1)) - _p.XnCursor) {
 47437  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78989), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61047)))
 47438  				crt.X__builtin_abort(tls)
 47439  			}
 47440  		}()
 47441  		_sqlite3VdbeMemAboutToChange(tls, _p, elem25(_aMem, uintptr(_pOp.Xp2)))
 47442  	}
 47443  	if (int32(_11_opProperty) & int32(32)) != int32(0) {
 47444  		func() {
 47445  			if _pOp.Xp3 <= int32(0) {
 47446  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78993), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61154)))
 47447  				crt.X__builtin_abort(tls)
 47448  			}
 47449  		}()
 47450  		func() {
 47451  			if _pOp.Xp3 > ((_p.XnMem + int32(1)) - _p.XnCursor) {
 47452  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78994), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61164)))
 47453  				crt.X__builtin_abort(tls)
 47454  			}
 47455  		}()
 47456  		_sqlite3VdbeMemAboutToChange(tls, _p, elem25(_aMem, uintptr(_pOp.Xp3)))
 47457  	}
 47458  	_pOrigOp = _pOp
 47459  	switch int32(_pOp.Xopcode) {
 47460  	case int32(0):
 47461  		goto _144
 47462  	case int32(1):
 47463  		goto _145
 47464  	case int32(2):
 47465  		goto _146
 47466  	case int32(3):
 47467  		goto _184
 47468  	case int32(4):
 47469  		goto _185
 47470  	case int32(5):
 47471  		goto _185
 47472  	case int32(6):
 47473  		goto _1549
 47474  	case int32(7):
 47475  		goto _1549
 47476  	case int32(8):
 47477  		goto _225
 47478  	case int32(9):
 47479  		goto _226
 47480  	case int32(10):
 47481  		goto _227
 47482  	case int32(11):
 47483  		goto _235
 47484  	case int32(12):
 47485  		goto _239
 47486  	case int32(13):
 47487  		goto _81
 47488  	case int32(14):
 47489  		goto _82
 47490  	case int32(15):
 47491  		goto _84
 47492  	case int32(16):
 47493  		goto _86
 47494  	case int32(17):
 47495  		goto _117
 47496  	case int32(18):
 47497  		goto _129
 47498  	case int32(19):
 47499  		goto _132
 47500  	case int32(20):
 47501  		goto _134
 47502  	case int32(21):
 47503  		goto _135
 47504  	case int32(22):
 47505  		goto _135
 47506  	case int32(23):
 47507  		goto _139
 47508  	case int32(24):
 47509  		goto _159
 47510  	case int32(25):
 47511  		goto _159
 47512  	case int32(26):
 47513  		goto _159
 47514  	case int32(27):
 47515  		goto _159
 47516  	case int32(28):
 47517  		goto _163
 47518  	case int32(29):
 47519  		goto _163
 47520  	case int32(30):
 47521  		goto _163
 47522  	case int32(31):
 47523  		goto _166
 47524  	case int32(32):
 47525  		goto _1258
 47526  	case int32(33):
 47527  		goto _179
 47528  	case int32(34):
 47529  		goto _180
 47530  	case int32(35):
 47531  		goto _181
 47532  	case int32(36):
 47533  		goto _181
 47534  	case int32(37):
 47535  		goto _183
 47536  	case int32(38):
 47537  		goto _194
 47538  	case int32(39):
 47539  		goto _194
 47540  	case int32(40):
 47541  		goto _194
 47542  	case int32(41):
 47543  		goto _194
 47544  	case int32(42):
 47545  		goto _211
 47546  	case int32(43):
 47547  		goto _212
 47548  	case int32(44):
 47549  		goto _213
 47550  	case int32(45):
 47551  		goto _216
 47552  	case int32(46):
 47553  		goto _218
 47554  	case int32(47):
 47555  		goto _220
 47556  	case int32(48):
 47557  		goto _221
 47558  	case int32(49):
 47559  		goto _228
 47560  	case int32(50):
 47561  		goto _237
 47562  	case int32(51):
 47563  		goto _242
 47564  	case int32(52):
 47565  		goto _83
 47566  	case int32(53):
 47567  		goto _85
 47568  	case int32(54):
 47569  		goto _87
 47570  	case int32(55):
 47571  		goto _88
 47572  	case int32(56):
 47573  		goto _89
 47574  	case int32(57):
 47575  		goto _90
 47576  	case int32(58):
 47577  		goto _93
 47578  	case int32(59):
 47579  		goto _94
 47580  	case int32(60):
 47581  		goto _95
 47582  	case int32(61):
 47583  		goto _96
 47584  	case int32(62):
 47585  		goto _97
 47586  	case int32(63):
 47587  		goto _98
 47588  	case int32(64):
 47589  		goto _99
 47590  	case int32(65):
 47591  		goto _100
 47592  	case int32(66):
 47593  		goto _101
 47594  	case int32(67):
 47595  		goto _102
 47596  	case int32(68):
 47597  		goto _109
 47598  	case int32(69):
 47599  		goto _110
 47600  	case int32(70):
 47601  		goto _130
 47602  	case int32(71):
 47603  		goto _130
 47604  	case int32(72):
 47605  		goto _111
 47606  	case int32(73):
 47607  		goto _116
 47608  	case int32(74):
 47609  		goto _118
 47610  	case int32(75):
 47611  		goto _137
 47612  	case int32(76):
 47613  		goto _138
 47614  	case int32(77):
 47615  		goto _120
 47616  	case int32(78):
 47617  		goto _120
 47618  	case int32(79):
 47619  		goto _120
 47620  	case int32(80):
 47621  		goto _120
 47622  	case int32(81):
 47623  		goto _120
 47624  	case int32(82):
 47625  		goto _120
 47626  	case int32(83):
 47627  		goto _126
 47628  	case int32(84):
 47629  		goto _112
 47630  	case int32(85):
 47631  		goto _112
 47632  	case int32(86):
 47633  		goto _112
 47634  	case int32(87):
 47635  		goto _112
 47636  	case int32(88):
 47637  		goto _104
 47638  	case int32(89):
 47639  		goto _104
 47640  	case int32(90):
 47641  		goto _104
 47642  	case int32(91):
 47643  		goto _104
 47644  	case int32(92):
 47645  		goto _104
 47646  	case int32(93):
 47647  		goto _103
 47648  	case int32(94):
 47649  		goto _119
 47650  	case int32(95):
 47651  		goto _133
 47652  	case int32(96):
 47653  		goto _127
 47654  	case int32(97):
 47655  		goto _92
 47656  	case int32(98):
 47657  		goto _128
 47658  	case int32(99):
 47659  		goto _140
 47660  	case int32(100):
 47661  		goto _141
 47662  	case int32(101):
 47663  		goto _142
 47664  	case int32(102):
 47665  		goto _143
 47666  	case int32(103):
 47667  		goto _147
 47668  	case int32(104):
 47669  		goto _148
 47670  	case int32(105):
 47671  		goto _149
 47672  	case int32(106):
 47673  		goto _1013
 47674  	case int32(107):
 47675  		goto _1013
 47676  	case int32(108):
 47677  		goto _152
 47678  	case int32(109):
 47679  		goto _153
 47680  	case int32(110):
 47681  		goto _153
 47682  	case int32(111):
 47683  		goto _155
 47684  	case int32(112):
 47685  		goto _156
 47686  	case int32(113):
 47687  		goto _157
 47688  	case int32(114):
 47689  		goto _158
 47690  	case int32(116):
 47691  		goto _168
 47692  	case int32(117):
 47693  		goto _169
 47694  	case int32(118):
 47695  		goto _170
 47696  	case int32(119):
 47697  		goto _170
 47698  	case int32(120):
 47699  		goto _172
 47700  	case int32(121):
 47701  		goto _173
 47702  	case int32(122):
 47703  		goto _174
 47704  	case int32(123):
 47705  		goto _175
 47706  	case int32(124):
 47707  		goto _176
 47708  	case int32(125):
 47709  		goto _177
 47710  	case int32(126):
 47711  		goto _178
 47712  	case int32(127):
 47713  		goto _189
 47714  	case int32(128):
 47715  		goto _189
 47716  	case int32(129):
 47717  		goto _191
 47718  	case int32(130):
 47719  		goto _192
 47720  	case int32(131):
 47721  		goto _192
 47722  	case int32(132):
 47723  		goto _91
 47724  	case int32(133):
 47725  		goto _198
 47726  	case int32(134):
 47727  		goto _199
 47728  	case int32(135):
 47729  		goto _200
 47730  	case int32(136):
 47731  		goto _201
 47732  	case int32(137):
 47733  		goto _201
 47734  	case int32(138):
 47735  		goto _203
 47736  	case int32(139):
 47737  		goto _204
 47738  	case int32(140):
 47739  		goto _205
 47740  	case int32(141):
 47741  		goto _206
 47742  	case int32(142):
 47743  		goto _207
 47744  	case int32(143):
 47745  		goto _208
 47746  	case int32(144):
 47747  		goto _209
 47748  	case int32(145):
 47749  		goto _210
 47750  	case int32(146):
 47751  		goto _214
 47752  	case int32(147):
 47753  		goto _215
 47754  	case int32(148):
 47755  		goto _217
 47756  	case int32(149):
 47757  		goto _219
 47758  	case int32(150):
 47759  		goto _222
 47760  	case int32(151):
 47761  		goto _223
 47762  	case int32(152):
 47763  		goto _224
 47764  	case int32(153):
 47765  		goto _229
 47766  	case int32(154):
 47767  		goto _230
 47768  	case int32(155):
 47769  		goto _231
 47770  	case int32(156):
 47771  		goto _232
 47772  	case int32(157):
 47773  		goto _233
 47774  	case int32(158):
 47775  		goto _234
 47776  	case int32(159):
 47777  		goto _236
 47778  	case int32(160):
 47779  		goto _238
 47780  	case int32(161):
 47781  		goto _240
 47782  	case int32(162):
 47783  		goto _241
 47784  	default:
 47785  		goto _243
 47786  	}
 47787  
 47788  _81:
 47789  _jump_to_p2_and_check_for_interrupt:
 47790  	_pOp = elem61(_aOp, uintptr(_pOp.Xp2-int32(1)))
 47791  _check_for_interrupt:
 47792  	if (*(*int32)(unsafe.Pointer(&_db.Xu1))) != 0 {
 47793  		goto _abort_due_to_interrupt
 47794  	}
 47795  	if _db.XxProgress == nil || _nVmStep < _nProgressLimit {
 47796  		goto _246
 47797  	}
 47798  	func() {
 47799  		if _db.XnProgressOps == (0) {
 47800  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79076), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61271)))
 47801  			crt.X__builtin_abort(tls)
 47802  		}
 47803  	}()
 47804  	_nProgressLimit = (_nVmStep + _db.XnProgressOps) - (_nVmStep % _db.XnProgressOps)
 47805  	if _db.XxProgress(tls, _db.XpProgressArg) != 0 {
 47806  		_rc = int32(9)
 47807  		goto _abort_due_to_error
 47808  	}
 47809  _246:
 47810  	goto _250
 47811  _82:
 47812  	func() {
 47813  		if _pOp.Xp1 <= int32(0) || _pOp.Xp1 > ((_p.XnMem+int32(1))-_p.XnCursor) {
 47814  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79094), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61291)))
 47815  			crt.X__builtin_abort(tls)
 47816  		}
 47817  	}()
 47818  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 47819  	func() {
 47820  		if bool2int((int32(_pIn1.Xflags)&int32(9312)) != int32(0)) != int32(0) {
 47821  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79096), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61338)))
 47822  			crt.X__builtin_abort(tls)
 47823  		}
 47824  	}()
 47825  	_sqlite3VdbeMemAboutToChange(tls, _p, _pIn1)
 47826  	_pIn1.Xflags = uint16(4)
 47827  	*(*int64)(unsafe.Pointer(&_pIn1.Xu)) = int64(int32((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 24))
 47828  	if (_db.Xflags & int32(1)) != 0 {
 47829  		_registerTrace(tls, _pOp.Xp1, _pIn1)
 47830  	}
 47831  _jump_to_p2:
 47832  	_pOp = elem61(_aOp, uintptr(_pOp.Xp2-int32(1)))
 47833  	goto _250
 47834  _83:
 47835  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 47836  	func() {
 47837  		if int32(_pIn1.Xflags) != int32(4) {
 47838  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79116), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61362)))
 47839  			crt.X__builtin_abort(tls)
 47840  		}
 47841  	}()
 47842  	_pOp = elem61(_aOp, uintptr(*(*int64)(unsafe.Pointer(&_pIn1.Xu))))
 47843  	_pIn1.Xflags = uint16(128)
 47844  	goto _250
 47845  _84:
 47846  	func() {
 47847  		if _pOp.Xp1 <= int32(0) || _pOp.Xp1 > ((_p.XnMem+int32(1))-_p.XnCursor) {
 47848  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79134), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61291)))
 47849  			crt.X__builtin_abort(tls)
 47850  		}
 47851  	}()
 47852  	func() {
 47853  		if _pOp.Xp2 < int32(0) || _pOp.Xp2 >= _p.XnOp {
 47854  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79135), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61383)))
 47855  			crt.X__builtin_abort(tls)
 47856  		}
 47857  	}()
 47858  	func() {
 47859  		if _pOp.Xp3 < int32(0) || _pOp.Xp3 >= _p.XnOp {
 47860  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79136), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61412)))
 47861  			crt.X__builtin_abort(tls)
 47862  		}
 47863  	}()
 47864  	_pOut = elem25(_aMem, uintptr(_pOp.Xp1))
 47865  	func() {
 47866  		if (int32(_pOut.Xflags) & int32(9312)) != int32(0) {
 47867  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79138), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61441)))
 47868  			crt.X__builtin_abort(tls)
 47869  		}
 47870  	}()
 47871  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = int64(_pOp.Xp3 - int32(1))
 47872  	_pOut.Xflags = uint16(4)
 47873  	if _pOp.Xp2 != 0 {
 47874  		goto _jump_to_p2
 47875  	}
 47876  	goto _250
 47877  _85:
 47878  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 47879  	func() {
 47880  		if int32(_pIn1.Xflags) != int32(4) {
 47881  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79156), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61362)))
 47882  			crt.X__builtin_abort(tls)
 47883  		}
 47884  	}()
 47885  	func() {
 47886  		if (*(*int64)(unsafe.Pointer(&_pIn1.Xu))) < (0) || (*(*int64)(unsafe.Pointer(&_pIn1.Xu))) >= int64(_p.XnOp) {
 47887  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79157), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61463)))
 47888  			crt.X__builtin_abort(tls)
 47889  		}
 47890  	}()
 47891  	_24_pCaller = elem61(_aOp, uintptr(*(*int64)(unsafe.Pointer(&_pIn1.Xu))))
 47892  	func() {
 47893  		if int32(_24_pCaller.Xopcode) != int32(16) {
 47894  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79159), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61496)))
 47895  			crt.X__builtin_abort(tls)
 47896  		}
 47897  	}()
 47898  	func() {
 47899  		if _24_pCaller.Xp2 < int32(0) || _24_pCaller.Xp2 >= _p.XnOp {
 47900  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79160), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61522)))
 47901  			crt.X__builtin_abort(tls)
 47902  		}
 47903  	}()
 47904  	_pOp = elem61(_aOp, uintptr(_24_pCaller.Xp2-int32(1)))
 47905  	_pIn1.Xflags = uint16(128)
 47906  	goto _250
 47907  _86:
 47908  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 47909  	func() {
 47910  		if bool2int((int32(_pIn1.Xflags)&int32(9312)) != int32(0)) != int32(0) {
 47911  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79182), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61338)))
 47912  			crt.X__builtin_abort(tls)
 47913  		}
 47914  	}()
 47915  	_pIn1.Xflags = uint16(4)
 47916  	_25_pcDest = int32(*(*int64)(unsafe.Pointer(&_pIn1.Xu)))
 47917  	*(*int64)(unsafe.Pointer(&_pIn1.Xu)) = int64(int32((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 24))
 47918  	if (_db.Xflags & int32(1)) != 0 {
 47919  		_registerTrace(tls, _pOp.Xp1, _pIn1)
 47920  	}
 47921  	_pOp = elem61(_aOp, uintptr(_25_pcDest))
 47922  	goto _250
 47923  _87:
 47924  	_pIn3 = elem25(_aMem, uintptr(_pOp.Xp3))
 47925  	if (int32(_pIn3.Xflags) & int32(1)) == int32(0) {
 47926  		goto _250
 47927  	}
 47928  _88:
 47929  	_27_pcx = int32((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 24)
 47930  	if _pOp.Xp1 != int32(0) || _p.XpFrame == nil {
 47931  		goto _286
 47932  	}
 47933  	_27_pFrame = (*XVdbeFrame)(_p.XpFrame)
 47934  	*(**XVdbeFrame)(unsafe.Pointer(&_p.XpFrame)) = (*XVdbeFrame)(_27_pFrame.XpParent)
 47935  	_p.XnFrame -= 1
 47936  	_sqlite3VdbeSetChanges(tls, _db, _p.XnChange)
 47937  	_27_pcx = _sqlite3VdbeFrameRestore(tls, _27_pFrame)
 47938  	if _pOp.Xp2 == int32(4) {
 47939  		_27_pcx = (elem61((*XVdbeOp)(_p.XaOp), uintptr(_27_pcx)).Xp2) - int32(1)
 47940  	}
 47941  	_aOp = (*XVdbeOp)(_p.XaOp)
 47942  	_aMem = (*XMem)(_p.XaMem)
 47943  	_pOp = elem61(_aOp, uintptr(_27_pcx))
 47944  	goto _250
 47945  _286:
 47946  	_p.Xrc = _pOp.Xp1
 47947  	_p.XerrorAction = uint8(_pOp.Xp2)
 47948  	_p.Xpc = _27_pcx
 47949  	func() {
 47950  		if int32(_pOp.Xp5) > int32(4) {
 47951  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79263), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61559)))
 47952  			crt.X__builtin_abort(tls)
 47953  		}
 47954  	}()
 47955  	if _p.Xrc == 0 {
 47956  		goto _290
 47957  	}
 47958  	if _pOp.Xp5 == 0 {
 47959  		goto _291
 47960  	}
 47961  	_sqlite3VdbeError(tls, _p, str(61570), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00azTypeØ001)), uintptr(int32(_pOp.Xp5)-int32(1)))))
 47962  	if (*(**int8)(unsafe.Pointer(&_pOp.Xp4))) != nil {
 47963  		_p.XzErrMsg = _sqlite3MPrintf(tls, _db, str(61591), unsafe.Pointer(_p.XzErrMsg), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pOp.Xp4))))
 47964  	}
 47965  	goto _293
 47966  _291:
 47967  	_sqlite3VdbeError(tls, _p, str(24531), unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pOp.Xp4))))
 47968  _293:
 47969  	Xsqlite3_log(tls, _pOp.Xp1, str(61598), _27_pcx, unsafe.Pointer(_p.XzSql), unsafe.Pointer(_p.XzErrMsg))
 47970  _290:
 47971  	_rc = _sqlite3VdbeHalt(tls, _p)
 47972  	func() {
 47973  		if _rc != int32(5) && _rc != int32(0) && _rc != int32(1) {
 47974  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79282), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61622)))
 47975  			crt.X__builtin_abort(tls)
 47976  		}
 47977  	}()
 47978  	if _rc == int32(5) {
 47979  		_p.Xrc = int32(5)
 47980  		goto _299
 47981  	}
 47982  	func() {
 47983  		if _rc != int32(0) && (_p.Xrc&int32(255)) != int32(19) {
 47984  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79286), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61675)))
 47985  			crt.X__builtin_abort(tls)
 47986  		}
 47987  	}()
 47988  	func() {
 47989  		if _rc != int32(0) && _db.XnDeferredCons <= (0) && _db.XnDeferredImmCons <= (0) {
 47990  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79287), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61724)))
 47991  			crt.X__builtin_abort(tls)
 47992  		}
 47993  	}()
 47994  	_rc = func() int32 {
 47995  		if _p.Xrc != 0 {
 47996  			return int32(1)
 47997  		}
 47998  		return int32(101)
 47999  	}()
 48000  _299:
 48001  	goto _vdbe_return
 48002  _89:
 48003  	_pOut = _out2Prerelease(tls, _p, _pOp)
 48004  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = int64(_pOp.Xp1)
 48005  	goto _250
 48006  _90:
 48007  	_pOut = _out2Prerelease(tls, _p, _pOp)
 48008  	func() {
 48009  		if (*(**int64)(unsafe.Pointer(&_pOp.Xp4))) == nil {
 48010  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79312), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61787)))
 48011  			crt.X__builtin_abort(tls)
 48012  		}
 48013  	}()
 48014  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = *(*(**int64)(unsafe.Pointer(&_pOp.Xp4)))
 48015  	goto _250
 48016  _91:
 48017  	_pOut = _out2Prerelease(tls, _p, _pOp)
 48018  	_pOut.Xflags = uint16(8)
 48019  	func() {
 48020  		if _sqlite3IsNaN(tls, *(*(**float64)(unsafe.Pointer(&_pOp.Xp4)))) != 0 {
 48021  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79327), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61803)))
 48022  			crt.X__builtin_abort(tls)
 48023  		}
 48024  	}()
 48025  	*(*float64)(unsafe.Pointer(&_pOut.Xu)) = *(*(**float64)(unsafe.Pointer(&_pOp.Xp4)))
 48026  	goto _250
 48027  _92:
 48028  	func() {
 48029  		if (*(**int8)(unsafe.Pointer(&_pOp.Xp4))) == nil {
 48030  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79342), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61833)))
 48031  			crt.X__builtin_abort(tls)
 48032  		}
 48033  	}()
 48034  	_pOut = _out2Prerelease(tls, _p, _pOp)
 48035  	_pOp.Xopcode = uint8(58)
 48036  	_pOp.Xp1 = _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer(&_pOp.Xp4)))
 48037  	if int32(_encoding) == int32(1) {
 48038  		goto _315
 48039  	}
 48040  	_rc = _sqlite3VdbeMemSetStr(tls, _pOut, *(**int8)(unsafe.Pointer(&_pOp.Xp4)), int32(-1), uint8(1), nil)
 48041  	func() {
 48042  		if _rc != int32(0) && _rc != int32(18) {
 48043  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79350), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61846)))
 48044  			crt.X__builtin_abort(tls)
 48045  		}
 48046  	}()
 48047  	if int32(0) != _sqlite3VdbeChangeEncoding(tls, _pOut, int32(_encoding)) {
 48048  		goto _no_mem
 48049  	}
 48050  	func() {
 48051  		if _pOut.XszMalloc <= int32(0) || _pOut.XzMalloc != _pOut.Xz {
 48052  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79352), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61881)))
 48053  			crt.X__builtin_abort(tls)
 48054  		}
 48055  	}()
 48056  	func() {
 48057  		if bool2int((int32(_pOut.Xflags)&int32(9312)) != int32(0)) != int32(0) {
 48058  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79353), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61924)))
 48059  			crt.X__builtin_abort(tls)
 48060  		}
 48061  	}()
 48062  	_pOut.XszMalloc = int32(0)
 48063  	{
 48064  		p := &_pOut.Xflags
 48065  		*p = uint16(int32(*p) | int32(2048))
 48066  	}
 48067  	if int32(_pOp.Xp4type) == int32(-1) {
 48068  		_sqlite3DbFree(tls, _db, unsafe.Pointer(*(**int8)(unsafe.Pointer(&_pOp.Xp4))))
 48069  	}
 48070  	_pOp.Xp4type = int8(-1)
 48071  	*(**int8)(unsafe.Pointer(&_pOp.Xp4)) = _pOut.Xz
 48072  	_pOp.Xp1 = _pOut.Xn
 48073  _315:
 48074  	if _pOp.Xp1 > (*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), 0)) {
 48075  		goto _too_big
 48076  	}
 48077  	func() {
 48078  		if _rc != int32(0) {
 48079  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79368), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(14967)))
 48080  			crt.X__builtin_abort(tls)
 48081  		}
 48082  	}()
 48083  _93:
 48084  	func() {
 48085  		if (*(**int8)(unsafe.Pointer(&_pOp.Xp4))) == nil {
 48086  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79385), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61833)))
 48087  			crt.X__builtin_abort(tls)
 48088  		}
 48089  	}()
 48090  	_pOut = _out2Prerelease(tls, _p, _pOp)
 48091  	_pOut.Xflags = uint16(2562)
 48092  	_pOut.Xz = *(**int8)(unsafe.Pointer(&_pOp.Xp4))
 48093  	_pOut.Xn = _pOp.Xp1
 48094  	_pOut.Xenc = _encoding
 48095  	if _pOp.Xp3 <= int32(0) {
 48096  		goto _331
 48097  	}
 48098  	func() {
 48099  		if _pOp.Xp3 > ((_p.XnMem + int32(1)) - _p.XnCursor) {
 48100  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79394), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61164)))
 48101  			crt.X__builtin_abort(tls)
 48102  		}
 48103  	}()
 48104  	_pIn3 = elem25(_aMem, uintptr(_pOp.Xp3))
 48105  	func() {
 48106  		if (int32(_pIn3.Xflags) & int32(4)) == 0 {
 48107  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79396), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61948)))
 48108  			crt.X__builtin_abort(tls)
 48109  		}
 48110  	}()
 48111  	if (*(*int64)(unsafe.Pointer(&_pIn3.Xu))) == int64(_pOp.Xp5) {
 48112  		_pOut.Xflags = uint16(2576)
 48113  	}
 48114  _331:
 48115  	goto _250
 48116  _94:
 48117  	_pOut = _out2Prerelease(tls, _p, _pOp)
 48118  	_45_cnt = _pOp.Xp3 - _pOp.Xp2
 48119  	func() {
 48120  		if _pOp.Xp3 > ((_p.XnMem + int32(1)) - _p.XnCursor) {
 48121  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79420), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61164)))
 48122  			crt.X__builtin_abort(tls)
 48123  		}
 48124  	}()
 48125  	_pOut.Xflags = store76(&_45_nullFlag, uint16(func() int32 {
 48126  		if _pOp.Xp1 != 0 {
 48127  			return int32(257)
 48128  		}
 48129  		return int32(1)
 48130  	}()))
 48131  	_pOut.Xn = int32(0)
 48132  _341:
 48133  	if _45_cnt > int32(0) {
 48134  		*(*uintptr)(unsafe.Pointer(&_pOut)) += uintptr(48)
 48135  		_sqlite3VdbeMemAboutToChange(tls, _p, _pOut)
 48136  		_sqlite3VdbeMemSetNull(tls, _pOut)
 48137  		_pOut.Xflags = _45_nullFlag
 48138  		_pOut.Xn = int32(0)
 48139  		_45_cnt -= 1
 48140  		goto _341
 48141  	}
 48142  	goto _250
 48143  _95:
 48144  	func() {
 48145  		if _pOp.Xp1 <= int32(0) || _pOp.Xp1 > ((_p.XnMem+int32(1))-_p.XnCursor) {
 48146  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79443), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61291)))
 48147  			crt.X__builtin_abort(tls)
 48148  		}
 48149  	}()
 48150  	_pOut = elem25(_aMem, uintptr(_pOp.Xp1))
 48151  	_pOut.Xflags = uint16((int32(_pOut.Xflags) & int32(-160)) | int32(1))
 48152  	goto _250
 48153  _96:
 48154  	func() {
 48155  		if _pOp.Xp1 > int32(1000000000) {
 48156  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79456), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61970)))
 48157  			crt.X__builtin_abort(tls)
 48158  		}
 48159  	}()
 48160  	_pOut = _out2Prerelease(tls, _p, _pOp)
 48161  	_sqlite3VdbeMemSetStr(tls, _pOut, *(**int8)(unsafe.Pointer(&_pOp.Xp4)), _pOp.Xp1, 0, nil)
 48162  	_pOut.Xenc = _encoding
 48163  	goto _250
 48164  _97:
 48165  	func() {
 48166  		if _pOp.Xp1 <= int32(0) || _pOp.Xp1 > int32(_p.XnVar) {
 48167  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79475), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61999)))
 48168  			crt.X__builtin_abort(tls)
 48169  		}
 48170  	}()
 48171  	func() {
 48172  		if (*(**int8)(unsafe.Pointer(&_pOp.Xp4))) != nil && (*(**int8)(unsafe.Pointer(&_pOp.Xp4))) != _sqlite3VListNumToName(tls, _p.XpVList, _pOp.Xp1) {
 48173  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79476), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62029)))
 48174  			crt.X__builtin_abort(tls)
 48175  		}
 48176  	}()
 48177  	_49_pVar = elem25((*XMem)(_p.XaVar), uintptr(_pOp.Xp1-int32(1)))
 48178  	if _sqlite3VdbeMemTooBig(tls, _49_pVar) != 0 {
 48179  		goto _too_big
 48180  	}
 48181  	_pOut = elem25(_aMem, uintptr(_pOp.Xp2))
 48182  	_sqlite3VdbeMemShallowCopy(tls, _pOut, _49_pVar, int32(2048))
 48183  	goto _250
 48184  _98:
 48185  	_51_n = _pOp.Xp3
 48186  	_51_p1 = _pOp.Xp1
 48187  	_51_p2 = _pOp.Xp2
 48188  	func() {
 48189  		if _51_n <= int32(0) || _51_p1 <= int32(0) || _51_p2 <= int32(0) {
 48190  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79504), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62097)))
 48191  			crt.X__builtin_abort(tls)
 48192  		}
 48193  	}()
 48194  	func() {
 48195  		if (_51_p1+_51_n) > _51_p2 && (_51_p2+_51_n) > _51_p1 {
 48196  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79505), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62117)))
 48197  			crt.X__builtin_abort(tls)
 48198  		}
 48199  	}()
 48200  	_pIn1 = elem25(_aMem, uintptr(_51_p1))
 48201  	_pOut = elem25(_aMem, uintptr(_51_p2))
 48202  _362:
 48203  	func() {
 48204  		if crt.P2U(unsafe.Pointer(_pOut)) > crt.P2U(unsafe.Pointer(elem25(_aMem, uintptr((_p.XnMem+int32(1))-_p.XnCursor)))) {
 48205  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79510), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62138)))
 48206  			crt.X__builtin_abort(tls)
 48207  		}
 48208  	}()
 48209  	func() {
 48210  		if crt.P2U(unsafe.Pointer(_pIn1)) > crt.P2U(unsafe.Pointer(elem25(_aMem, uintptr((_p.XnMem+int32(1))-_p.XnCursor)))) {
 48211  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79511), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62176)))
 48212  			crt.X__builtin_abort(tls)
 48213  		}
 48214  	}()
 48215  	func() {
 48216  		if (int32(_pIn1.Xflags) & int32(128)) != int32(0) {
 48217  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79512), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62214)))
 48218  			crt.X__builtin_abort(tls)
 48219  		}
 48220  	}()
 48221  	_sqlite3VdbeMemAboutToChange(tls, _p, _pOut)
 48222  	_sqlite3VdbeMemMove(tls, _pOut, _pIn1)
 48223  	if (crt.P2U(_pOut.XpScopyFrom) >= crt.P2U(unsafe.Pointer(elem25(_aMem, uintptr(_51_p1))))) && (crt.P2U(_pOut.XpScopyFrom) < crt.P2U(unsafe.Pointer(_pOut))) {
 48224  		*(*uintptr)(unsafe.Pointer(&_pOut.XpScopyFrom)) += 48 * uintptr(_pOp.Xp2-_51_p1)
 48225  	}
 48226  	if ((int32(_pOut.Xflags) & int32(4096)) != int32(0)) && _sqlite3VdbeMemMakeWriteable(tls, _pOut) != 0 {
 48227  		goto _no_mem
 48228  	}
 48229  	if (_db.Xflags & int32(1)) != 0 {
 48230  		_registerTrace(tls, postInc2(&_51_p2, 1), _pOut)
 48231  	}
 48232  	*(*uintptr)(unsafe.Pointer(&_pIn1)) += uintptr(48)
 48233  	*(*uintptr)(unsafe.Pointer(&_pOut)) += uintptr(48)
 48234  	if preInc2(&_51_n, -1) != 0 {
 48235  		goto _362
 48236  	}
 48237  	goto _250
 48238  _99:
 48239  	_55_n = _pOp.Xp3
 48240  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 48241  	_pOut = elem25(_aMem, uintptr(_pOp.Xp2))
 48242  	func() {
 48243  		if _pOut == _pIn1 {
 48244  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79542), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62231)))
 48245  			crt.X__builtin_abort(tls)
 48246  		}
 48247  	}()
 48248  _376:
 48249  	_sqlite3VdbeMemShallowCopy(tls, _pOut, _pIn1, int32(4096))
 48250  	if ((int32(_pOut.Xflags) & int32(4096)) != int32(0)) && _sqlite3VdbeMemMakeWriteable(tls, _pOut) != 0 {
 48251  		goto _no_mem
 48252  	}
 48253  	*(**XMem)(unsafe.Pointer(&_pOut.XpScopyFrom)) = nil
 48254  	if (_db.Xflags & int32(1)) != 0 {
 48255  		_registerTrace(tls, (_pOp.Xp2+_pOp.Xp3)-_55_n, _pOut)
 48256  	}
 48257  	if postInc2(&_55_n, -1) == int32(0) {
 48258  		goto _377
 48259  	}
 48260  	*(*uintptr)(unsafe.Pointer(&_pOut)) += uintptr(48)
 48261  	*(*uintptr)(unsafe.Pointer(&_pIn1)) += uintptr(48)
 48262  	goto _376
 48263  _377:
 48264  	goto _250
 48265  _100:
 48266  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 48267  	_pOut = elem25(_aMem, uintptr(_pOp.Xp2))
 48268  	func() {
 48269  		if _pOut == _pIn1 {
 48270  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79573), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62231)))
 48271  			crt.X__builtin_abort(tls)
 48272  		}
 48273  	}()
 48274  	_sqlite3VdbeMemShallowCopy(tls, _pOut, _pIn1, int32(4096))
 48275  	if (*XMem)(_pOut.XpScopyFrom) == nil {
 48276  		*(**XMem)(unsafe.Pointer(&_pOut.XpScopyFrom)) = _pIn1
 48277  	}
 48278  	goto _250
 48279  _101:
 48280  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 48281  	func() {
 48282  		if (int32(_pIn1.Xflags) & int32(4)) == int32(0) {
 48283  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79591), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62242)))
 48284  			crt.X__builtin_abort(tls)
 48285  		}
 48286  	}()
 48287  	_pOut = elem25(_aMem, uintptr(_pOp.Xp2))
 48288  	_sqlite3VdbeMemSetInt64(tls, _pOut, *(*int64)(unsafe.Pointer(&_pIn1.Xu)))
 48289  	goto _250
 48290  _102:
 48291  	func() {
 48292  		if int32(_p.XnResColumn) != _pOp.Xp2 {
 48293  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79609), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62269)))
 48294  			crt.X__builtin_abort(tls)
 48295  		}
 48296  	}()
 48297  	func() {
 48298  		if _pOp.Xp1 <= int32(0) {
 48299  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79610), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(60920)))
 48300  			crt.X__builtin_abort(tls)
 48301  		}
 48302  	}()
 48303  	func() {
 48304  		if (_pOp.Xp1 + _pOp.Xp2) > (((_p.XnMem + int32(1)) - _p.XnCursor) + int32(1)) {
 48305  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79611), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62292)))
 48306  			crt.X__builtin_abort(tls)
 48307  		}
 48308  	}()
 48309  	if ((_db.XxProgress != nil) && (_nVmStep >= _nProgressLimit)) && (_db.XxProgress(tls, _db.XpProgressArg) != int32(0)) {
 48310  		_rc = int32(9)
 48311  		goto _abort_due_to_error
 48312  	}
 48313  	if int32(0) != store2(&_rc, _sqlite3VdbeCheckFk(tls, _p, int32(0))) {
 48314  		func() {
 48315  			if (_db.Xflags & int32(128)) == 0 {
 48316  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79629), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62336)))
 48317  				crt.X__builtin_abort(tls)
 48318  			}
 48319  		}()
 48320  		func() {
 48321  			if ((uint32(_p.Xexpired>>6) << 31) >> 31) == 0 {
 48322  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79630), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62363)))
 48323  				crt.X__builtin_abort(tls)
 48324  			}
 48325  		}()
 48326  		goto _abort_due_to_error
 48327  	}
 48328  	func() {
 48329  		if _p.XiStatement != int32(0) && (_db.Xflags&int32(128)) == 0 {
 48330  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79649), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62382)))
 48331  			crt.X__builtin_abort(tls)
 48332  		}
 48333  	}()
 48334  	_rc = _sqlite3VdbeCloseStatement(tls, _p, int32(1))
 48335  	func() {
 48336  		if _rc != int32(0) {
 48337  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79651), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(14967)))
 48338  			crt.X__builtin_abort(tls)
 48339  		}
 48340  	}()
 48341  	_p.XcacheCtr = (_p.XcacheCtr + uint32(2)) | uint32(1)
 48342  	_60_pMem = store25((**XMem)(unsafe.Pointer(&_p.XpResultSet)), elem25(_aMem, uintptr(_pOp.Xp1)))
 48343  	_60_i = int32(0)
 48344  _406:
 48345  	if _60_i >= _pOp.Xp2 {
 48346  		goto _409
 48347  	}
 48348  	func() {
 48349  		if (int32(elem25(_60_pMem, uintptr(_60_i)).Xflags) & int32(128)) != int32(0) {
 48350  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79662), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62429)))
 48351  			crt.X__builtin_abort(tls)
 48352  		}
 48353  	}()
 48354  	if ((int32(elem25(_60_pMem, uintptr(_60_i)).Xflags) & int32(4096)) != int32(0)) && _sqlite3VdbeMemMakeWriteable(tls, elem25(_60_pMem, uintptr(_60_i))) != 0 {
 48355  		goto _no_mem
 48356  	}
 48357  	func() {
 48358  		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) {
 48359  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79664), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62450)))
 48360  			crt.X__builtin_abort(tls)
 48361  		}
 48362  	}()
 48363  	_sqlite3VdbeMemNulTerminate(tls, elem25(_60_pMem, uintptr(_60_i)))
 48364  	if (_db.Xflags & int32(1)) != 0 {
 48365  		_registerTrace(tls, _pOp.Xp1+_60_i, elem25(_60_pMem, uintptr(_60_i)))
 48366  	}
 48367  	_60_i += 1
 48368  	goto _406
 48369  _409:
 48370  	if _db.XmallocFailed != 0 {
 48371  		goto _no_mem
 48372  	}
 48373  	if (int32(_db.XmTrace) & int32(4)) != 0 {
 48374  		_db.XxTrace(tls, uint32(4), _db.XpTraceArg, unsafe.Pointer(_p), nil)
 48375  	}
 48376  	_p.Xpc = int32((uintptr(unsafe.Pointer(_pOp))-uintptr(unsafe.Pointer(_aOp)))/24) + int32(1)
 48377  	_rc = int32(100)
 48378  	goto _vdbe_return
 48379  _103:
 48380  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 48381  	_pIn2 = elem25(_aMem, uintptr(_pOp.Xp2))
 48382  	_pOut = elem25(_aMem, uintptr(_pOp.Xp3))
 48383  	func() {
 48384  		if _pIn1 == _pOut {
 48385  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79701), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62524)))
 48386  			crt.X__builtin_abort(tls)
 48387  		}
 48388  	}()
 48389  	if ((int32(_pIn1.Xflags) | int32(_pIn2.Xflags)) & int32(1)) != 0 {
 48390  		_sqlite3VdbeMemSetNull(tls, _pOut)
 48391  		goto _250
 48392  	}
 48393  	if func() int32 {
 48394  		if (int32(_pIn1.Xflags) & int32(16384)) != 0 {
 48395  			return _sqlite3VdbeMemExpandBlob(tls, _pIn1)
 48396  		}
 48397  		return int32(0)
 48398  	}() != 0 || func() int32 {
 48399  		if (int32(_pIn2.Xflags) & int32(16384)) != 0 {
 48400  			return _sqlite3VdbeMemExpandBlob(tls, _pIn2)
 48401  		}
 48402  		return int32(0)
 48403  	}() != 0 {
 48404  		goto _no_mem
 48405  	}
 48406  	if ((int32(_pIn1.Xflags) & int32(18)) == int32(0)) && _sqlite3VdbeMemStringify(tls, _pIn1, _encoding, 0) != 0 {
 48407  		goto _no_mem
 48408  	}
 48409  	if ((int32(_pIn2.Xflags) & int32(18)) == int32(0)) && _sqlite3VdbeMemStringify(tls, _pIn2, _encoding, 0) != 0 {
 48410  		goto _no_mem
 48411  	}
 48412  	_66_nByte = int64(_pIn1.Xn + _pIn2.Xn)
 48413  	if _66_nByte > int64(*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), 0)) {
 48414  		goto _too_big
 48415  	}
 48416  	if _sqlite3VdbeMemGrow(tls, _pOut, int32(_66_nByte)+int32(2), bool2int(_pOut == _pIn2)) != 0 {
 48417  		goto _no_mem
 48418  	}
 48419  	_pOut.Xflags = uint16((int32(_pOut.Xflags) & int32(-49664)) | int32(2))
 48420  	if _pOut != _pIn2 {
 48421  		crt.Xmemcpy(tls, unsafe.Pointer(_pOut.Xz), unsafe.Pointer(_pIn2.Xz), uint32(_pIn2.Xn))
 48422  	}
 48423  	crt.Xmemcpy(tls, unsafe.Pointer(elem1(_pOut.Xz, uintptr(_pIn2.Xn))), unsafe.Pointer(_pIn1.Xz), uint32(_pIn1.Xn))
 48424  	*elem1(_pOut.Xz, uintptr(_66_nByte)) = 0
 48425  	*elem1(_pOut.Xz, uintptr(_66_nByte+int64(1))) = 0
 48426  	{
 48427  		p := &_pOut.Xflags
 48428  		*p = uint16(int32(*p) | int32(512))
 48429  	}
 48430  	_pOut.Xn = int32(_66_nByte)
 48431  	_pOut.Xenc = _encoding
 48432  	goto _250
 48433  _104:
 48434  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 48435  	_73_type1 = _numericType(tls, _pIn1)
 48436  	_pIn2 = elem25(_aMem, uintptr(_pOp.Xp2))
 48437  	_73_type2 = _numericType(tls, _pIn2)
 48438  	_pOut = elem25(_aMem, uintptr(_pOp.Xp3))
 48439  	_73_flags = uint16(int32(_pIn1.Xflags) | int32(_pIn2.Xflags))
 48440  	if ((int32(_73_type1) & int32(_73_type2)) & int32(4)) == int32(0) {
 48441  		goto _436
 48442  	}
 48443  	_73_iA = *(*int64)(unsafe.Pointer(&_pIn1.Xu))
 48444  	_73_iB = *(*int64)(unsafe.Pointer(&_pIn2.Xu))
 48445  	_73_bIntint = int8(1)
 48446  	switch int32(_pOp.Xopcode) {
 48447  	case int32(88):
 48448  		goto _438
 48449  	case int32(89):
 48450  		goto _439
 48451  	case int32(90):
 48452  		goto _440
 48453  	case int32(91):
 48454  		goto _441
 48455  	default:
 48456  		goto _442
 48457  	}
 48458  
 48459  _438:
 48460  	if _sqlite3AddInt64(tls, &_73_iB, _73_iA) != 0 {
 48461  		goto _fp_math
 48462  	}
 48463  	goto _444
 48464  _439:
 48465  	if _sqlite3SubInt64(tls, &_73_iB, _73_iA) != 0 {
 48466  		goto _fp_math
 48467  	}
 48468  	goto _444
 48469  _440:
 48470  	if _sqlite3MulInt64(tls, &_73_iB, _73_iA) != 0 {
 48471  		goto _fp_math
 48472  	}
 48473  	goto _444
 48474  _441:
 48475  	if _73_iA == (0) {
 48476  		goto _arithmetic_result_is_null
 48477  	}
 48478  	if (_73_iA == int64(-1)) && (_73_iB == int64(-9223372036854775808)) {
 48479  		goto _fp_math
 48480  	}
 48481  	_73_iB /= _73_iA
 48482  	goto _444
 48483  _442:
 48484  	if _73_iA == (0) {
 48485  		goto _arithmetic_result_is_null
 48486  	}
 48487  	if _73_iA == int64(-1) {
 48488  		_73_iA = int64(1)
 48489  	}
 48490  	_73_iB %= _73_iA
 48491  	goto _444
 48492  _444:
 48493  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = _73_iB
 48494  	_pOut.Xflags = uint16((int32(_pOut.Xflags) & int32(-49664)) | int32(4))
 48495  	goto _454
 48496  _436:
 48497  	if (int32(_73_flags) & int32(1)) != int32(0) {
 48498  		goto _arithmetic_result_is_null
 48499  	}
 48500  	_73_bIntint = 0
 48501  _fp_math:
 48502  	_73_rA = _sqlite3VdbeRealValue(tls, _pIn1)
 48503  	_73_rB = _sqlite3VdbeRealValue(tls, _pIn2)
 48504  	switch int32(_pOp.Xopcode) {
 48505  	case int32(88):
 48506  		goto _456
 48507  	case int32(89):
 48508  		goto _457
 48509  	case int32(90):
 48510  		goto _458
 48511  	case int32(91):
 48512  		goto _459
 48513  	default:
 48514  		goto _460
 48515  	}
 48516  
 48517  _456:
 48518  	_73_rB += _73_rA
 48519  	goto _461
 48520  _457:
 48521  	_73_rB -= _73_rA
 48522  	goto _461
 48523  _458:
 48524  	_73_rB *= _73_rA
 48525  	goto _461
 48526  _459:
 48527  	if _73_rA == float64(0) {
 48528  		goto _arithmetic_result_is_null
 48529  	}
 48530  	_73_rB /= _73_rA
 48531  	goto _461
 48532  _460:
 48533  	_73_iA = int64(_73_rA)
 48534  	_73_iB = int64(_73_rB)
 48535  	if _73_iA == (0) {
 48536  		goto _arithmetic_result_is_null
 48537  	}
 48538  	if _73_iA == int64(-1) {
 48539  		_73_iA = int64(1)
 48540  	}
 48541  	_73_rB = float64(_73_iB % _73_iA)
 48542  	goto _461
 48543  _461:
 48544  	if _sqlite3IsNaN(tls, _73_rB) != 0 {
 48545  		goto _arithmetic_result_is_null
 48546  	}
 48547  	*(*float64)(unsafe.Pointer(&_pOut.Xu)) = _73_rB
 48548  	_pOut.Xflags = uint16((int32(_pOut.Xflags) & int32(-49664)) | int32(8))
 48549  	if (((int32(_73_type1) | int32(_73_type2)) & int32(8)) == int32(0)) && (_73_bIntint == 0) {
 48550  		_sqlite3VdbeIntegerAffinity(tls, _pOut)
 48551  	}
 48552  _454:
 48553  	goto _250
 48554  _arithmetic_result_is_null:
 48555  	_sqlite3VdbeMemSetNull(tls, _pOut)
 48556  	goto _250
 48557  _109:
 48558  	func() {
 48559  		if int32(_pOp.Xp4type) != int32(-3) {
 48560  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79874), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62535)))
 48561  			crt.X__builtin_abort(tls)
 48562  		}
 48563  	}()
 48564  	if _pOp.Xp1 != 0 {
 48565  		_sqlite3VdbeMemSetInt64(tls, elem25(_aMem, uintptr(_pOp.Xp1)), 0)
 48566  	}
 48567  	goto _250
 48568  _110:
 48569  	func() {
 48570  		if int32(_pOp.Xp4type) != int32(-4) {
 48571  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79926), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62559)))
 48572  			crt.X__builtin_abort(tls)
 48573  		}
 48574  	}()
 48575  	_87_n = int32(_pOp.Xp5)
 48576  	func() {
 48577  		if _pOp.Xp3 <= int32(0) || _pOp.Xp3 > ((_p.XnMem+int32(1))-_p.XnCursor) {
 48578  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79928), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62583)))
 48579  			crt.X__builtin_abort(tls)
 48580  		}
 48581  	}()
 48582  	func() {
 48583  		if _87_n != int32(0) && (_pOp.Xp2 <= int32(0) || (_pOp.Xp2+_87_n) > (((_p.XnMem+int32(1))-_p.XnCursor)+int32(1))) {
 48584  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79929), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62630)))
 48585  			crt.X__builtin_abort(tls)
 48586  		}
 48587  	}()
 48588  	func() {
 48589  		if _pOp.Xp3 >= _pOp.Xp2 && _pOp.Xp3 < (_pOp.Xp2+_87_n) {
 48590  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79930), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62691)))
 48591  			crt.X__builtin_abort(tls)
 48592  		}
 48593  	}()
 48594  	_87_pCtx = (*Xsqlite3_context)(_sqlite3DbMallocRawNN(tls, _db, uint64(uint32(32)+(uint32(_87_n-int32(1))*uint32(4)))))
 48595  	if _87_pCtx == nil {
 48596  		goto _no_mem
 48597  	}
 48598  	*(**XMem)(unsafe.Pointer(&_87_pCtx.XpOut)) = nil
 48599  	*(**XFuncDef)(unsafe.Pointer(&_87_pCtx.XpFunc)) = (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 48600  	_87_pCtx.XiOp = int32((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 24)
 48601  	*(**TVdbe)(unsafe.Pointer(&_87_pCtx.XpVdbe)) = _p
 48602  	_87_pCtx.Xargc = uint8(_87_n)
 48603  	_pOp.Xp4type = int8(-16)
 48604  	*(**Xsqlite3_context)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))) = _87_pCtx
 48605  	_pOp.Xopcode = uint8(72)
 48606  _111:
 48607  	func() {
 48608  		if int32(_pOp.Xp4type) != int32(-16) {
 48609  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79947), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62729)))
 48610  			crt.X__builtin_abort(tls)
 48611  		}
 48612  	}()
 48613  	_88_pCtx = (*Xsqlite3_context)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 48614  	_pOut = elem25(_aMem, uintptr(_pOp.Xp3))
 48615  	if (*XMem)(_88_pCtx.XpOut) == _pOut {
 48616  		goto _486
 48617  	}
 48618  	*(**XMem)(unsafe.Pointer(&_88_pCtx.XpOut)) = _pOut
 48619  	_88_i = int32(_88_pCtx.Xargc) - int32(1)
 48620  _487:
 48621  	if _88_i < int32(0) {
 48622  		goto _490
 48623  	}
 48624  	*elem19((**XMem)(unsafe.Pointer(&_88_pCtx.Xargv)), uintptr(_88_i)) = elem25(_aMem, uintptr(_pOp.Xp2+_88_i))
 48625  	_88_i -= 1
 48626  	goto _487
 48627  _490:
 48628  _486:
 48629  	_sqlite3VdbeMemAboutToChange(tls, _p, _pOut)
 48630  	_88_i = int32(0)
 48631  _491:
 48632  	if _88_i >= int32(_88_pCtx.Xargc) {
 48633  		goto _494
 48634  	}
 48635  	func() {
 48636  		if (int32((*elem19((**XMem)(unsafe.Pointer(&_88_pCtx.Xargv)), uintptr(_88_i))).Xflags) & int32(128)) != int32(0) {
 48637  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(79963), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62753)))
 48638  			crt.X__builtin_abort(tls)
 48639  		}
 48640  	}()
 48641  	if (_db.Xflags & int32(1)) != 0 {
 48642  		_registerTrace(tls, _pOp.Xp2+_88_i, *elem19((**XMem)(unsafe.Pointer(&_88_pCtx.Xargv)), uintptr(_88_i)))
 48643  	}
 48644  	_88_i += 1
 48645  	goto _491
 48646  _494:
 48647  	_pOut.Xflags = uint16((int32(_pOut.Xflags) & int32(-49664)) | int32(1))
 48648  	_88_pCtx.XfErrorOrAux = 0
 48649  	func() func(*crt.TLS, *Xsqlite3_context, int32, **XMem) {
 48650  		v := (*XFuncDef)(_88_pCtx.XpFunc).XxSFunc
 48651  		return *(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer(&v))
 48652  	}()(tls, _88_pCtx, int32(_88_pCtx.Xargc), (**XMem)(unsafe.Pointer(&_88_pCtx.Xargv)))
 48653  	if _88_pCtx.XfErrorOrAux == 0 {
 48654  		goto _498
 48655  	}
 48656  	if _88_pCtx.XisError != 0 {
 48657  		_sqlite3VdbeError(tls, _p, str(24531), unsafe.Pointer(Xsqlite3_value_text(tls, _pOut)))
 48658  		_rc = _88_pCtx.XisError
 48659  	}
 48660  	_sqlite3VdbeDeleteAuxData(tls, _db, (**XAuxData)(unsafe.Pointer(&_p.XpAuxData)), _88_pCtx.XiOp, _pOp.Xp1)
 48661  	if _rc != 0 {
 48662  		goto _abort_due_to_error
 48663  	}
 48664  _498:
 48665  	if (int32(_pOut.Xflags) & int32(18)) == 0 {
 48666  		goto _501
 48667  	}
 48668  	_sqlite3VdbeChangeEncoding(tls, _pOut, int32(_encoding))
 48669  	if _sqlite3VdbeMemTooBig(tls, _pOut) != 0 {
 48670  		goto _too_big
 48671  	}
 48672  _501:
 48673  	if (_db.Xflags & int32(1)) != 0 {
 48674  		_registerTrace(tls, _pOp.Xp3, _pOut)
 48675  	}
 48676  	goto _250
 48677  _112:
 48678  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 48679  	_pIn2 = elem25(_aMem, uintptr(_pOp.Xp2))
 48680  	_pOut = elem25(_aMem, uintptr(_pOp.Xp3))
 48681  	if ((int32(_pIn1.Xflags) | int32(_pIn2.Xflags)) & int32(1)) != 0 {
 48682  		_sqlite3VdbeMemSetNull(tls, _pOut)
 48683  		goto _250
 48684  	}
 48685  	_94_iA = _sqlite3VdbeIntValue(tls, _pIn2)
 48686  	_94_iB = _sqlite3VdbeIntValue(tls, _pIn1)
 48687  	_94_op = _pOp.Xopcode
 48688  	if int32(_94_op) == int32(84) {
 48689  		_94_iA &= _94_iB
 48690  		goto _509
 48691  	}
 48692  	if int32(_94_op) == int32(85) {
 48693  		_94_iA |= _94_iB
 48694  		goto _509
 48695  	}
 48696  	if _94_iB == (0) {
 48697  		goto _509
 48698  	}
 48699  	func() {
 48700  		if int32(_94_op) != int32(87) && int32(_94_op) != int32(86) {
 48701  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80046), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62779)))
 48702  			crt.X__builtin_abort(tls)
 48703  		}
 48704  	}()
 48705  	if _94_iB < (0) {
 48706  		_94_op = uint8(int32(173) - int32(_94_op))
 48707  		_94_iB = func() int64 {
 48708  			if _94_iB > int64(-64) {
 48709  				return (-_94_iB)
 48710  			}
 48711  			return int64(64)
 48712  		}()
 48713  	}
 48714  	if _94_iB >= int64(64) {
 48715  		_94_iA = int64(func() int32 {
 48716  			if (_94_iA >= (0)) || (int32(_94_op) == int32(86)) {
 48717  				return int32(0)
 48718  			}
 48719  			return int32(-1)
 48720  		}())
 48721  		goto _520
 48722  	}
 48723  	crt.Xmemcpy(tls, unsafe.Pointer(&_94_uA), unsafe.Pointer(&_94_iA), uint32(8))
 48724  	if int32(_94_op) == int32(86) {
 48725  		_94_uA <<= uint(int32(_94_iB))
 48726  		goto _522
 48727  	}
 48728  	_94_uA >>= uint(int32(_94_iB))
 48729  	if _94_iA < (0) {
 48730  		_94_uA |= uint64(18446744073709551615) << uint(int32(int64(64)-_94_iB))
 48731  	}
 48732  _522:
 48733  	crt.Xmemcpy(tls, unsafe.Pointer(&_94_iA), unsafe.Pointer(&_94_uA), uint32(8))
 48734  _520:
 48735  _509:
 48736  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = _94_iA
 48737  	_pOut.Xflags = uint16((int32(_pOut.Xflags) & int32(-49664)) | int32(4))
 48738  	goto _250
 48739  _116:
 48740  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 48741  	_sqlite3VdbeMemAboutToChange(tls, _p, _pIn1)
 48742  	_sqlite3VdbeMemIntegerify(tls, _pIn1)
 48743  	*(*int64)(unsafe.Pointer(&_pIn1.Xu)) += int64(_pOp.Xp2)
 48744  	goto _250
 48745  _117:
 48746  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 48747  	if (int32(_pIn1.Xflags) & int32(4)) != int32(0) {
 48748  		goto _524
 48749  	}
 48750  	_applyAffinity(tls, _pIn1, int8(67), _encoding)
 48751  	if (int32(_pIn1.Xflags) & int32(4)) != int32(0) {
 48752  		goto _525
 48753  	}
 48754  	if _pOp.Xp2 == int32(0) {
 48755  		_rc = int32(20)
 48756  		goto _abort_due_to_error
 48757  	}
 48758  	goto _jump_to_p2
 48759  _525:
 48760  _524:
 48761  	_pIn1.Xflags = uint16((int32(_pIn1.Xflags) & int32(-49664)) | int32(4))
 48762  	goto _250
 48763  _118:
 48764  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 48765  	if (int32(_pIn1.Xflags) & int32(4)) != 0 {
 48766  		_sqlite3VdbeMemRealify(tls, _pIn1)
 48767  	}
 48768  	goto _250
 48769  _119:
 48770  	func() {
 48771  		if _pOp.Xp2 < int32(65) || _pOp.Xp2 > int32(69) {
 48772  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80151), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62817)))
 48773  			crt.X__builtin_abort(tls)
 48774  		}
 48775  	}()
 48776  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 48777  	_sqlite3VdbeMemAboutToChange(tls, _p, _pIn1)
 48778  	_rc = func() int32 {
 48779  		if (int32(_pIn1.Xflags) & int32(16384)) != 0 {
 48780  			return _sqlite3VdbeMemExpandBlob(tls, _pIn1)
 48781  		}
 48782  		return int32(0)
 48783  	}()
 48784  	_sqlite3VdbeMemCast(tls, _pIn1, uint8(_pOp.Xp2), _encoding)
 48785  	if _rc != 0 {
 48786  		goto _abort_due_to_error
 48787  	}
 48788  	goto _250
 48789  _120:
 48790  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 48791  	_pIn3 = elem25(_aMem, uintptr(_pOp.Xp3))
 48792  	_113_flags1 = _pIn1.Xflags
 48793  	_113_flags3 = _pIn3.Xflags
 48794  	if ((int32(_113_flags1) | int32(_113_flags3)) & int32(1)) == 0 {
 48795  		goto _535
 48796  	}
 48797  	if (int32(_pOp.Xp5) & int32(128)) == 0 {
 48798  		goto _536
 48799  	}
 48800  	func() {
 48801  		if int32(_pOp.Xopcode) != int32(78) && int32(_pOp.Xopcode) != int32(77) {
 48802  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80285), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62870)))
 48803  			crt.X__builtin_abort(tls)
 48804  		}
 48805  	}()
 48806  	func() {
 48807  		if (int32(_113_flags1) & int32(256)) != int32(0) {
 48808  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80286), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62911)))
 48809  			crt.X__builtin_abort(tls)
 48810  		}
 48811  	}()
 48812  	func() {
 48813  		if (int32(_pOp.Xp5) & int32(16)) != int32(0) {
 48814  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80287), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62937)))
 48815  			crt.X__builtin_abort(tls)
 48816  		}
 48817  	}()
 48818  	if (((int32(_113_flags1) & int32(_113_flags3)) & int32(1)) != int32(0)) && ((int32(_113_flags3) & int32(256)) == int32(0)) {
 48819  		_113_res = int32(0)
 48820  		goto _546
 48821  	}
 48822  	_113_res = int32(1)
 48823  _546:
 48824  	goto _547
 48825  _536:
 48826  	if (int32(_pOp.Xp5) & int32(32)) == 0 {
 48827  		goto _548
 48828  	}
 48829  	_pOut = elem25(_aMem, uintptr(_pOp.Xp2))
 48830  	_iCompare = int32(1)
 48831  	_sqlite3VdbeMemAboutToChange(tls, _p, _pOut)
 48832  	_pOut.Xflags = uint16((int32(_pOut.Xflags) & int32(-49664)) | int32(1))
 48833  	if (_db.Xflags & int32(1)) != 0 {
 48834  		_registerTrace(tls, _pOp.Xp2, _pOut)
 48835  	}
 48836  	goto _550
 48837  _548:
 48838  	if (int32(_pOp.Xp5) & int32(16)) != 0 {
 48839  		goto _jump_to_p2
 48840  	}
 48841  _550:
 48842  	goto _250
 48843  _547:
 48844  	goto _compare_op
 48845  _535:
 48846  	_113_affinity = int8(int32(_pOp.Xp5) & int32(71))
 48847  	if int32(_113_affinity) < int32(67) {
 48848  		goto _553
 48849  	}
 48850  	if ((int32(_113_flags1) | int32(_113_flags3)) & int32(2)) == 0 {
 48851  		goto _554
 48852  	}
 48853  	if (int32(_113_flags1) & int32(14)) == int32(2) {
 48854  		_applyNumericAffinity(tls, _pIn1, int32(0))
 48855  		_113_flags3 = _pIn3.Xflags
 48856  	}
 48857  	if (int32(_113_flags3) & int32(14)) == int32(2) {
 48858  		_applyNumericAffinity(tls, _pIn3, int32(0))
 48859  	}
 48860  _554:
 48861  	if ((int32(_pIn1.Xflags) & int32(_pIn3.Xflags)) & int32(4)) == int32(0) {
 48862  		goto _557
 48863  	}
 48864  	if (*(*int64)(unsafe.Pointer(&_pIn3.Xu))) > (*(*int64)(unsafe.Pointer(&_pIn1.Xu))) {
 48865  		_113_res = int32(1)
 48866  		goto _compare_op
 48867  	}
 48868  	if (*(*int64)(unsafe.Pointer(&_pIn3.Xu))) < (*(*int64)(unsafe.Pointer(&_pIn1.Xu))) {
 48869  		_113_res = int32(-1)
 48870  		goto _compare_op
 48871  	}
 48872  	_113_res = int32(0)
 48873  	goto _compare_op
 48874  _557:
 48875  	goto _561
 48876  _553:
 48877  	if int32(_113_affinity) != int32(66) {
 48878  		goto _561
 48879  	}
 48880  	if ((int32(_113_flags1) & int32(2)) == int32(0)) && ((int32(_113_flags1) & int32(12)) != int32(0)) {
 48881  		_sqlite3VdbeMemStringify(tls, _pIn1, _encoding, uint8(1))
 48882  		_113_flags1 = uint16((int32(_pIn1.Xflags) & int32(-33280)) | (int32(_113_flags1) & int32(33279)))
 48883  		func() {
 48884  			if _pIn1 == _pIn3 {
 48885  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80343), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62970)))
 48886  				crt.X__builtin_abort(tls)
 48887  			}
 48888  		}()
 48889  	}
 48890  	if ((int32(_113_flags3) & int32(2)) == int32(0)) && ((int32(_113_flags3) & int32(12)) != int32(0)) {
 48891  		_sqlite3VdbeMemStringify(tls, _pIn3, _encoding, uint8(1))
 48892  		_113_flags3 = uint16((int32(_pIn3.Xflags) & int32(-33280)) | (int32(_113_flags3) & int32(33279)))
 48893  	}
 48894  _561:
 48895  	func() {
 48896  		if int32(_pOp.Xp4type) != int32(-3) && (*XCollSeq)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))) != nil {
 48897  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80353), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62981)))
 48898  			crt.X__builtin_abort(tls)
 48899  		}
 48900  	}()
 48901  	_113_res = _sqlite3MemCompare(tls, _pIn3, _pIn1, (*XCollSeq)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))))
 48902  _compare_op:
 48903  	switch int32(_pOp.Xopcode) {
 48904  	case int32(77):
 48905  		goto _573
 48906  	case int32(78):
 48907  		goto _572
 48908  	case int32(79):
 48909  		goto _576
 48910  	case int32(80):
 48911  		goto _575
 48912  	case int32(81):
 48913  		goto _574
 48914  	default:
 48915  		goto _577
 48916  	}
 48917  
 48918  _572:
 48919  	_113_res2 = bool2int(_113_res == int32(0))
 48920  	goto _578
 48921  _573:
 48922  	_113_res2 = _113_res
 48923  	goto _578
 48924  _574:
 48925  	_113_res2 = bool2int(_113_res < int32(0))
 48926  	goto _578
 48927  _575:
 48928  	_113_res2 = bool2int(_113_res <= int32(0))
 48929  	goto _578
 48930  _576:
 48931  	_113_res2 = bool2int(_113_res > int32(0))
 48932  	goto _578
 48933  _577:
 48934  	_113_res2 = bool2int(_113_res >= int32(0))
 48935  	goto _578
 48936  _578:
 48937  	func() {
 48938  		if (int32(_pIn1.Xflags) & int32(1024)) != (int32(_113_flags1) & int32(1024)) {
 48939  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80367), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63025)))
 48940  			crt.X__builtin_abort(tls)
 48941  		}
 48942  	}()
 48943  	_pIn1.Xflags = _113_flags1
 48944  	func() {
 48945  		if (int32(_pIn3.Xflags) & int32(1024)) != (int32(_113_flags3) & int32(1024)) {
 48946  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80369), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63071)))
 48947  			crt.X__builtin_abort(tls)
 48948  		}
 48949  	}()
 48950  	_pIn3.Xflags = _113_flags3
 48951  	if (int32(_pOp.Xp5) & int32(32)) == 0 {
 48952  		goto _583
 48953  	}
 48954  	_pOut = elem25(_aMem, uintptr(_pOp.Xp2))
 48955  	_iCompare = _113_res
 48956  	_113_res2 = bool2int(_113_res2 != int32(0))
 48957  	if (int32(_pOp.Xp5) & int32(8)) == int32(0) {
 48958  		goto _584
 48959  	}
 48960  	func() {
 48961  		if int32(_pOp.Xopcode) != int32(77) && int32(_pOp.Xopcode) != int32(78) {
 48962  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80384), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63117)))
 48963  			crt.X__builtin_abort(tls)
 48964  		}
 48965  	}()
 48966  	func() {
 48967  		if _113_res2 != int32(0) && _113_res2 != int32(1) {
 48968  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80385), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63158)))
 48969  			crt.X__builtin_abort(tls)
 48970  		}
 48971  	}()
 48972  	if bool2int(int32(_pOp.Xopcode) == int32(78)) == _113_res2 {
 48973  		goto _250
 48974  	}
 48975  _584:
 48976  	_sqlite3VdbeMemAboutToChange(tls, _p, _pOut)
 48977  	_pOut.Xflags = uint16((int32(_pOut.Xflags) & int32(-49664)) | int32(4))
 48978  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = int64(_113_res2)
 48979  	if (_db.Xflags & int32(1)) != 0 {
 48980  		_registerTrace(tls, _pOp.Xp2, _pOut)
 48981  	}
 48982  	goto _593
 48983  _583:
 48984  	if _113_res2 != 0 {
 48985  		goto _jump_to_p2
 48986  	}
 48987  _593:
 48988  	goto _250
 48989  _126:
 48990  	func() {
 48991  		if crt.P2U(unsafe.Pointer(_pOp)) <= crt.P2U(unsafe.Pointer(_aOp)) {
 48992  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80414), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63177)))
 48993  			crt.X__builtin_abort(tls)
 48994  		}
 48995  	}()
 48996  	func() {
 48997  		if int32(elem61(_pOp, uintptr(4294967295)).Xopcode) != int32(81) && int32(elem61(_pOp, uintptr(4294967295)).Xopcode) != int32(79) {
 48998  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80415), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63185)))
 48999  			crt.X__builtin_abort(tls)
 49000  		}
 49001  	}()
 49002  	func() {
 49003  		if (int32(elem61(_pOp, uintptr(4294967295)).Xp5) & int32(32)) == 0 {
 49004  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80416), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63232)))
 49005  			crt.X__builtin_abort(tls)
 49006  		}
 49007  	}()
 49008  	if _iCompare != int32(0) {
 49009  		goto _jump_to_p2
 49010  	}
 49011  	goto _250
 49012  _127:
 49013  	func() {
 49014  		if int32(_pOp.Xp4type) != int32(-12) {
 49015  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80436), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63260)))
 49016  			crt.X__builtin_abort(tls)
 49017  		}
 49018  	}()
 49019  	func() {
 49020  		if (*(**int32)(unsafe.Pointer(&_pOp.Xp4))) == nil {
 49021  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80437), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63285)))
 49022  			crt.X__builtin_abort(tls)
 49023  		}
 49024  	}()
 49025  	func() {
 49026  		if int32(elem61(_pOp, uintptr(1)).Xopcode) != int32(98) {
 49027  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80438), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63296)))
 49028  			crt.X__builtin_abort(tls)
 49029  		}
 49030  	}()
 49031  	func() {
 49032  		if (int32(elem61(_pOp, uintptr(1)).Xp5) & int32(1)) == 0 {
 49033  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80439), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63322)))
 49034  			crt.X__builtin_abort(tls)
 49035  		}
 49036  	}()
 49037  	goto _250
 49038  _128:
 49039  	if (int32(_pOp.Xp5) & int32(1)) == int32(0) {
 49040  		_140_aPermute = nil
 49041  		goto _612
 49042  	}
 49043  	func() {
 49044  		if crt.P2U(unsafe.Pointer(_pOp)) <= crt.P2U(unsafe.Pointer(_aOp)) {
 49045  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80477), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63177)))
 49046  			crt.X__builtin_abort(tls)
 49047  		}
 49048  	}()
 49049  	func() {
 49050  		if int32(elem61(_pOp, uintptr(4294967295)).Xopcode) != int32(96) {
 49051  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80478), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63349)))
 49052  			crt.X__builtin_abort(tls)
 49053  		}
 49054  	}()
 49055  	func() {
 49056  		if int32(elem61(_pOp, uintptr(4294967295)).Xp4type) != int32(-12) {
 49057  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80479), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63380)))
 49058  			crt.X__builtin_abort(tls)
 49059  		}
 49060  	}()
 49061  	_140_aPermute = (*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int32)(unsafe.Pointer(&(elem61(_pOp, uintptr(4294967295)).Xp4))))) + uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(int32(1))*uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(4)))))))))))
 49062  	func() {
 49063  		if _140_aPermute == nil {
 49064  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80481), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63408)))
 49065  			crt.X__builtin_abort(tls)
 49066  		}
 49067  	}()
 49068  _612:
 49069  	_140_n = _pOp.Xp3
 49070  	_140_pKeyInfo = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 49071  	func() {
 49072  		if _140_n <= int32(0) {
 49073  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80485), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(1376)))
 49074  			crt.X__builtin_abort(tls)
 49075  		}
 49076  	}()
 49077  	func() {
 49078  		if _140_pKeyInfo == nil {
 49079  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80486), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(44995)))
 49080  			crt.X__builtin_abort(tls)
 49081  		}
 49082  	}()
 49083  	_140_p1 = _pOp.Xp1
 49084  	_140_p2 = _pOp.Xp2
 49085  	if _140_aPermute == nil {
 49086  		goto _625
 49087  	}
 49088  	_143_mx = int32(0)
 49089  	_143_k = int32(0)
 49090  _626:
 49091  	if _143_k >= _140_n {
 49092  		goto _629
 49093  	}
 49094  	if (*elem8(_140_aPermute, uintptr(_143_k))) > _143_mx {
 49095  		_143_mx = *elem8(_140_aPermute, uintptr(_143_k))
 49096  	}
 49097  	_143_k += 1
 49098  	goto _626
 49099  _629:
 49100  	func() {
 49101  		if _140_p1 <= int32(0) || (_140_p1+_143_mx) > (((_p.XnMem+int32(1))-_p.XnCursor)+int32(1)) {
 49102  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80493), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63420)))
 49103  			crt.X__builtin_abort(tls)
 49104  		}
 49105  	}()
 49106  	func() {
 49107  		if _140_p2 <= int32(0) || (_140_p2+_143_mx) > (((_p.XnMem+int32(1))-_p.XnCursor)+int32(1)) {
 49108  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80494), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63462)))
 49109  			crt.X__builtin_abort(tls)
 49110  		}
 49111  	}()
 49112  	goto _637
 49113  _625:
 49114  	func() {
 49115  		if _140_p1 <= int32(0) || (_140_p1+_140_n) > (((_p.XnMem+int32(1))-_p.XnCursor)+int32(1)) {
 49116  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80496), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63504)))
 49117  			crt.X__builtin_abort(tls)
 49118  		}
 49119  	}()
 49120  	func() {
 49121  		if _140_p2 <= int32(0) || (_140_p2+_140_n) > (((_p.XnMem+int32(1))-_p.XnCursor)+int32(1)) {
 49122  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80497), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63545)))
 49123  			crt.X__builtin_abort(tls)
 49124  		}
 49125  	}()
 49126  _637:
 49127  	_140_i = int32(0)
 49128  _644:
 49129  	if _140_i >= _140_n {
 49130  		goto _647
 49131  	}
 49132  	_140_idx = func() int32 {
 49133  		if _140_aPermute != nil {
 49134  			return (*elem8(_140_aPermute, uintptr(_140_i)))
 49135  		}
 49136  		return _140_i
 49137  	}()
 49138  	func() {
 49139  		if (int32(elem25(_aMem, uintptr(_140_p1+_140_idx)).Xflags) & int32(128)) != int32(0) {
 49140  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80502), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63586)))
 49141  			crt.X__builtin_abort(tls)
 49142  		}
 49143  	}()
 49144  	func() {
 49145  		if (int32(elem25(_aMem, uintptr(_140_p2+_140_idx)).Xflags) & int32(128)) != int32(0) {
 49146  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80503), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63612)))
 49147  			crt.X__builtin_abort(tls)
 49148  		}
 49149  	}()
 49150  	if (_db.Xflags & int32(1)) != 0 {
 49151  		_registerTrace(tls, _140_p1+_140_idx, elem25(_aMem, uintptr(_140_p1+_140_idx)))
 49152  	}
 49153  	if (_db.Xflags & int32(1)) != 0 {
 49154  		_registerTrace(tls, _140_p2+_140_idx, elem25(_aMem, uintptr(_140_p2+_140_idx)))
 49155  	}
 49156  	func() {
 49157  		if _140_i >= int32(_140_pKeyInfo.XnField) {
 49158  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80506), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63638)))
 49159  			crt.X__builtin_abort(tls)
 49160  		}
 49161  	}()
 49162  	_140_pColl = *elem62((**XCollSeq)(unsafe.Pointer(&_140_pKeyInfo.XaColl)), uintptr(_140_i))
 49163  	_140_bRev = int32(*elem15(_140_pKeyInfo.XaSortOrder, uintptr(_140_i)))
 49164  	_iCompare = _sqlite3MemCompare(tls, elem25(_aMem, uintptr(_140_p1+_140_idx)), elem25(_aMem, uintptr(_140_p2+_140_idx)), _140_pColl)
 49165  	if _iCompare == 0 {
 49166  		goto _658
 49167  	}
 49168  	if _140_bRev != 0 {
 49169  		_iCompare = -_iCompare
 49170  	}
 49171  	goto _647
 49172  _658:
 49173  	_140_i += 1
 49174  	goto _644
 49175  _647:
 49176  	goto _250
 49177  _129:
 49178  	if _iCompare < int32(0) {
 49179  		_pOp = elem61(_aOp, uintptr(_pOp.Xp1-int32(1)))
 49180  		goto _663
 49181  	}
 49182  	if _iCompare == int32(0) {
 49183  		_pOp = elem61(_aOp, uintptr(_pOp.Xp2-int32(1)))
 49184  		goto _663
 49185  	}
 49186  	_pOp = elem61(_aOp, uintptr(_pOp.Xp3-int32(1)))
 49187  _663:
 49188  	goto _250
 49189  _130:
 49190  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 49191  	if (int32(_pIn1.Xflags) & int32(1)) != 0 {
 49192  		_151_v1 = int32(2)
 49193  		goto _665
 49194  	}
 49195  	_151_v1 = bool2int(_sqlite3VdbeIntValue(tls, _pIn1) != (0))
 49196  _665:
 49197  	_pIn2 = elem25(_aMem, uintptr(_pOp.Xp2))
 49198  	if (int32(_pIn2.Xflags) & int32(1)) != 0 {
 49199  		_151_v2 = int32(2)
 49200  		goto _667
 49201  	}
 49202  	_151_v2 = bool2int(_sqlite3VdbeIntValue(tls, _pIn2) != (0))
 49203  _667:
 49204  	if int32(_pOp.Xopcode) == int32(71) {
 49205  		_151_v1 = int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3VdbeExecØ00and_logicØ002)), uintptr((_151_v1*int32(3))+_151_v2)))
 49206  		goto _669
 49207  	}
 49208  	_151_v1 = int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3VdbeExecØ00or_logicØ003)), uintptr((_151_v1*int32(3))+_151_v2)))
 49209  _669:
 49210  	_pOut = elem25(_aMem, uintptr(_pOp.Xp3))
 49211  	if _151_v1 == int32(2) {
 49212  		_pOut.Xflags = uint16((int32(_pOut.Xflags) & int32(-49664)) | int32(1))
 49213  		goto _671
 49214  	}
 49215  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = int64(_151_v1)
 49216  	_pOut.Xflags = uint16((int32(_pOut.Xflags) & int32(-49664)) | int32(4))
 49217  _671:
 49218  	goto _250
 49219  _132:
 49220  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 49221  	_pOut = elem25(_aMem, uintptr(_pOp.Xp2))
 49222  	_sqlite3VdbeMemSetNull(tls, _pOut)
 49223  	if (int32(_pIn1.Xflags) & int32(1)) == int32(0) {
 49224  		_pOut.Xflags = uint16(4)
 49225  		*(*int64)(unsafe.Pointer(&_pOut.Xu)) = int64(bool2int(_sqlite3VdbeIntValue(tls, _pIn1) == 0))
 49226  	}
 49227  	goto _250
 49228  _133:
 49229  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 49230  	_pOut = elem25(_aMem, uintptr(_pOp.Xp2))
 49231  	_sqlite3VdbeMemSetNull(tls, _pOut)
 49232  	if (int32(_pIn1.Xflags) & int32(1)) == int32(0) {
 49233  		_pOut.Xflags = uint16(4)
 49234  		*(*int64)(unsafe.Pointer(&_pOut.Xu)) = ^_sqlite3VdbeIntValue(tls, _pIn1)
 49235  	}
 49236  	goto _250
 49237  _134:
 49238  	func() {
 49239  		if int32(elem61((*XVdbeOp)(_p.XaOp), 0).Xopcode) != int32(51) {
 49240  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80644), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63657)))
 49241  			crt.X__builtin_abort(tls)
 49242  		}
 49243  	}()
 49244  	if _p.XpFrame == nil {
 49245  		goto _676
 49246  	}
 49247  	_164_iAddr = uint32(int32((uintptr(unsafe.Pointer(_pOp)) - uintptr(_p.XaOp)) / 24))
 49248  	if (int32(*elem15((*XVdbeFrame)(_p.XpFrame).XaOnce, uintptr(_164_iAddr/uint32(8)))) & (int32(1) << uint(int32(_164_iAddr&uint32(7))))) != int32(0) {
 49249  		goto _jump_to_p2
 49250  	}
 49251  	{
 49252  		p := elem15((*XVdbeFrame)(_p.XpFrame).XaOnce, uintptr(_164_iAddr/uint32(8)))
 49253  		*p = uint8(int32(*p) | (int32(1) << uint(int32(_164_iAddr&uint32(7)))))
 49254  	}
 49255  	goto _678
 49256  _676:
 49257  	if (elem61((*XVdbeOp)(_p.XaOp), 0).Xp1) == _pOp.Xp1 {
 49258  		goto _jump_to_p2
 49259  	}
 49260  _678:
 49261  	_pOp.Xp1 = elem61((*XVdbeOp)(_p.XaOp), 0).Xp1
 49262  	goto _250
 49263  _135:
 49264  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 49265  	if (int32(_pIn1.Xflags) & int32(1)) != 0 {
 49266  		_169_c = _pOp.Xp3
 49267  		goto _681
 49268  	}
 49269  	_169_c = bool2int(_sqlite3VdbeRealValue(tls, _pIn1) != float64(0))
 49270  	if int32(_pOp.Xopcode) == int32(22) {
 49271  		_169_c = bool2int(_169_c == 0)
 49272  	}
 49273  _681:
 49274  	if _169_c != 0 {
 49275  		goto _jump_to_p2
 49276  	}
 49277  	goto _250
 49278  _137:
 49279  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 49280  	if (int32(_pIn1.Xflags) & int32(1)) != int32(0) {
 49281  		goto _jump_to_p2
 49282  	}
 49283  	goto _250
 49284  _138:
 49285  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 49286  	if (int32(_pIn1.Xflags) & int32(1)) == int32(0) {
 49287  		goto _jump_to_p2
 49288  	}
 49289  	goto _250
 49290  _139:
 49291  	func() {
 49292  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 49293  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80733), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 49294  			crt.X__builtin_abort(tls)
 49295  		}
 49296  	}()
 49297  	func() {
 49298  		if (*elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))) == nil {
 49299  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80734), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63716)))
 49300  			crt.X__builtin_abort(tls)
 49301  		}
 49302  	}()
 49303  	if ((*elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))).XnullRow) != 0 {
 49304  		_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(48))))))))))))
 49305  		goto _jump_to_p2
 49306  	}
 49307  	goto _250
 49308  _140:
 49309  	_179_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 49310  	_179_p2 = _pOp.Xp2
 49311  	_rc = _sqlite3VdbeCursorMoveto(tls, &_179_pC, &_179_p2)
 49312  	if _rc != 0 {
 49313  		goto _abort_due_to_error
 49314  	}
 49315  	func() {
 49316  		if _pOp.Xp3 <= int32(0) || _pOp.Xp3 > ((_p.XnMem+int32(1))-_p.XnCursor) {
 49317  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80792), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62583)))
 49318  			crt.X__builtin_abort(tls)
 49319  		}
 49320  	}()
 49321  	_179_pDest = elem25(_aMem, uintptr(_pOp.Xp3))
 49322  	_sqlite3VdbeMemAboutToChange(tls, _p, _179_pDest)
 49323  	func() {
 49324  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 49325  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80795), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 49326  			crt.X__builtin_abort(tls)
 49327  		}
 49328  	}()
 49329  	func() {
 49330  		if _179_pC == nil {
 49331  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80796), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 49332  			crt.X__builtin_abort(tls)
 49333  		}
 49334  	}()
 49335  	func() {
 49336  		if _179_p2 >= int32(_179_pC.XnField) {
 49337  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80797), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63743)))
 49338  			crt.X__builtin_abort(tls)
 49339  		}
 49340  	}()
 49341  	_179_aOffset = _179_pC.XaOffset
 49342  	func() {
 49343  		if int32(_179_pC.XeCurType) == int32(2) {
 49344  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80799), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63757)))
 49345  			crt.X__builtin_abort(tls)
 49346  		}
 49347  	}()
 49348  	func() {
 49349  		if int32(_179_pC.XeCurType) == int32(3) && _179_pC.XnullRow == 0 {
 49350  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80800), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63784)))
 49351  			crt.X__builtin_abort(tls)
 49352  		}
 49353  	}()
 49354  	func() {
 49355  		if int32(_179_pC.XeCurType) == int32(1) {
 49356  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80801), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63828)))
 49357  			crt.X__builtin_abort(tls)
 49358  		}
 49359  	}()
 49360  	if _179_pC.XcacheStatus == _p.XcacheCtr {
 49361  		goto _710
 49362  	}
 49363  	if _179_pC.XnullRow == 0 {
 49364  		goto _711
 49365  	}
 49366  	if int32(_179_pC.XeCurType) == int32(3) {
 49367  		func() {
 49368  			if (*(*int32)(unsafe.Pointer(&_179_pC.Xuc))) <= int32(0) {
 49369  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80806), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63857)))
 49370  				crt.X__builtin_abort(tls)
 49371  			}
 49372  		}()
 49373  		_179_pReg = elem25(_aMem, uintptr(*(*int32)(unsafe.Pointer(&_179_pC.Xuc))))
 49374  		func() {
 49375  			if (int32(_179_pReg.Xflags) & int32(16)) == 0 {
 49376  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80808), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63881)))
 49377  				crt.X__builtin_abort(tls)
 49378  			}
 49379  		}()
 49380  		func() {
 49381  			if (int32(_179_pReg.Xflags) & int32(128)) != int32(0) {
 49382  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80809), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63904)))
 49383  				crt.X__builtin_abort(tls)
 49384  			}
 49385  		}()
 49386  		_179_pC.XpayloadSize = store23(&_179_pC.XszRow, store23(&_179_avail, uint32(_179_pReg.Xn)))
 49387  		_179_pC.XaRow = (*uint8)(unsafe.Pointer(_179_pReg.Xz))
 49388  		goto _719
 49389  	}
 49390  	_sqlite3VdbeMemSetNull(tls, _179_pDest)
 49391  	goto _op_column_out
 49392  _719:
 49393  	goto _720
 49394  _711:
 49395  	_179_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_179_pC.Xuc)))
 49396  	func() {
 49397  		if int32(_179_pC.XeCurType) != int32(0) {
 49398  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80818), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 49399  			crt.X__builtin_abort(tls)
 49400  		}
 49401  	}()
 49402  	func() {
 49403  		if _179_pCrsr == nil {
 49404  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80819), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63949)))
 49405  			crt.X__builtin_abort(tls)
 49406  		}
 49407  	}()
 49408  	func() {
 49409  		if _sqlite3BtreeCursorIsValid(tls, _179_pCrsr) == 0 {
 49410  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80820), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63955)))
 49411  			crt.X__builtin_abort(tls)
 49412  		}
 49413  	}()
 49414  	_179_pC.XpayloadSize = _sqlite3BtreePayloadSize(tls, _179_pCrsr)
 49415  	_179_pC.XaRow = (*uint8)(_sqlite3BtreePayloadFetch(tls, _179_pCrsr, &_179_avail))
 49416  	func() {
 49417  		if _179_avail > uint32(65536) {
 49418  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80823), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63988)))
 49419  			crt.X__builtin_abort(tls)
 49420  		}
 49421  	}()
 49422  	if _179_pC.XpayloadSize <= _179_avail {
 49423  		_179_pC.XszRow = _179_pC.XpayloadSize
 49424  		goto _732
 49425  	}
 49426  	if _179_pC.XpayloadSize > uint32(*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), 0)) {
 49427  		goto _too_big
 49428  	}
 49429  	_179_pC.XszRow = _179_avail
 49430  _732:
 49431  _720:
 49432  	_179_pC.XcacheStatus = _p.XcacheCtr
 49433  	_179_pC.XiHdrOffset = uint32(uint8(func() int32 {
 49434  		if int32(*_179_pC.XaRow) < int32(128) {
 49435  			return func() int32 { _179_offset = uint32(*_179_pC.XaRow); return int32(1) }()
 49436  		}
 49437  		return int32(_sqlite3GetVarint32(tls, _179_pC.XaRow, &_179_offset))
 49438  	}()))
 49439  	_179_pC.XnHdrParsed = 0
 49440  	*elem7(_179_aOffset, 0) = _179_offset
 49441  	if _179_avail >= _179_offset {
 49442  		goto _735
 49443  	}
 49444  	_179_pC.XaRow = nil
 49445  	_179_pC.XszRow = 0
 49446  	if (_179_offset > uint32(98307)) || (_179_offset > _179_pC.XpayloadSize) {
 49447  		_rc = _sqlite3CorruptError(tls, int32(80856))
 49448  		goto _abort_due_to_error
 49449  	}
 49450  	goto _739
 49451  _735:
 49452  	if _179_offset > (0) {
 49453  		_179_zData = _179_pC.XaRow
 49454  		func() {
 49455  			if int32(_179_pC.XnHdrParsed) > _179_p2 {
 49456  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80865), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64001)))
 49457  				crt.X__builtin_abort(tls)
 49458  			}
 49459  		}()
 49460  		goto _op_column_read_header
 49461  	}
 49462  _739:
 49463  _710:
 49464  	if int32(_179_pC.XnHdrParsed) > _179_p2 {
 49465  		goto _742
 49466  	}
 49467  	if _179_pC.XiHdrOffset >= (*elem7(_179_aOffset, 0)) {
 49468  		goto _743
 49469  	}
 49470  	if _179_pC.XaRow != nil {
 49471  		goto _744
 49472  	}
 49473  	crt.Xmemset(tls, unsafe.Pointer(&_179_sMem), int32(0), uint32(48))
 49474  	_rc = _sqlite3VdbeMemFromBtree(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_179_pC.Xuc))), 0, *elem7(_179_aOffset, 0), &_179_sMem)
 49475  	if _rc != int32(0) {
 49476  		goto _abort_due_to_error
 49477  	}
 49478  	_179_zData = (*uint8)(unsafe.Pointer(_179_sMem.Xz))
 49479  	goto _op_column_read_header
 49480  _744:
 49481  	_179_zData = _179_pC.XaRow
 49482  _op_column_read_header:
 49483  	_179_i = int32(_179_pC.XnHdrParsed)
 49484  	_179_offset64 = uint64(*elem7(_179_aOffset, uintptr(_179_i)))
 49485  	_179_zHdr = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_zData)) + uintptr(_179_pC.XiHdrOffset)))
 49486  	_179_zEndHdr = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_zData)) + uintptr(*elem7(_179_aOffset, 0))))
 49487  _747:
 49488  	if store23(&_179_t, uint32(*elem15(_179_zHdr, 0))) < uint32(128) {
 49489  		*(*uintptr)(unsafe.Pointer(&_179_zHdr)) += uintptr(1)
 49490  		_179_offset64 += uint64(_sqlite3VdbeOneByteSerialTypeLen(tls, uint8(_179_t)))
 49491  		goto _749
 49492  	}
 49493  	*(*uintptr)(unsafe.Pointer(&_179_zHdr)) += uintptr(_sqlite3GetVarint32(tls, _179_zHdr, &_179_t))
 49494  	_179_offset64 += uint64(_sqlite3VdbeSerialTypeLen(tls, _179_t))
 49495  _749:
 49496  	*elem7((*uint32)(unsafe.Pointer(&_179_pC.XaType)), uintptr(postInc2(&_179_i, 1))) = _179_t
 49497  	*elem7(_179_aOffset, uintptr(_179_i)) = uint32(_179_offset64 & uint64(4294967295))
 49498  	if (_179_i <= _179_p2) && (crt.P2U(unsafe.Pointer(_179_zHdr)) < crt.P2U(unsafe.Pointer(_179_zEndHdr))) {
 49499  		goto _747
 49500  	}
 49501  	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) {
 49502  		goto _754
 49503  	}
 49504  	if _179_pC.XaRow == nil {
 49505  		_sqlite3VdbeMemRelease(tls, &_179_sMem)
 49506  	}
 49507  	_rc = _sqlite3CorruptError(tls, int32(80915))
 49508  	goto _abort_due_to_error
 49509  _754:
 49510  	_179_pC.XnHdrParsed = uint16(_179_i)
 49511  	_179_pC.XiHdrOffset = uint32(int32(uintptr(unsafe.Pointer(_179_zHdr)) - uintptr(unsafe.Pointer(_179_zData))))
 49512  	if _179_pC.XaRow == nil {
 49513  		_sqlite3VdbeMemRelease(tls, &_179_sMem)
 49514  	}
 49515  	goto _757
 49516  _743:
 49517  	_179_t = 0
 49518  _757:
 49519  	if int32(_179_pC.XnHdrParsed) > _179_p2 {
 49520  		goto _758
 49521  	}
 49522  	if int32(_pOp.Xp4type) == int32(-7) {
 49523  		_sqlite3VdbeMemShallowCopy(tls, _179_pDest, (*XMem)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))), int32(2048))
 49524  		goto _760
 49525  	}
 49526  	_sqlite3VdbeMemSetNull(tls, _179_pDest)
 49527  _760:
 49528  	goto _op_column_out
 49529  _758:
 49530  	goto _761
 49531  _742:
 49532  	_179_t = *elem7((*uint32)(unsafe.Pointer(&_179_pC.XaType)), uintptr(_179_p2))
 49533  _761:
 49534  	func() {
 49535  		if _179_p2 >= int32(_179_pC.XnHdrParsed) {
 49536  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80946), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64020)))
 49537  			crt.X__builtin_abort(tls)
 49538  		}
 49539  	}()
 49540  	func() {
 49541  		if _rc != int32(0) {
 49542  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80947), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(14967)))
 49543  			crt.X__builtin_abort(tls)
 49544  		}
 49545  	}()
 49546  	func() {
 49547  		if _sqlite3VdbeCheckMemInvariants(tls, _179_pDest) == 0 {
 49548  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80948), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64038)))
 49549  			crt.X__builtin_abort(tls)
 49550  		}
 49551  	}()
 49552  	if (int32(_179_pDest.Xflags) & int32(9312)) != int32(0) {
 49553  		_sqlite3VdbeMemSetNull(tls, _179_pDest)
 49554  	}
 49555  	func() {
 49556  		if _179_t != (*elem7((*uint32)(unsafe.Pointer(&_179_pC.XaType)), uintptr(_179_p2))) {
 49557  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(80952), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64075)))
 49558  			crt.X__builtin_abort(tls)
 49559  		}
 49560  	}()
 49561  	if _179_pC.XszRow < (*elem7(_179_aOffset, uintptr(_179_p2+int32(1)))) {
 49562  		goto _771
 49563  	}
 49564  	_179_zData = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_pC.XaRow)) + uintptr(*elem7(_179_aOffset, uintptr(_179_p2)))))
 49565  	if _179_t < uint32(12) {
 49566  		_sqlite3VdbeSerialGet(tls, _179_zData, _179_t, _179_pDest)
 49567  		goto _773
 49568  	}
 49569  	_179_pDest.Xn = store2(&_179_len, int32((_179_t-uint32(12))/uint32(2)))
 49570  	_179_pDest.Xenc = _encoding
 49571  	if _179_pDest.XszMalloc >= (_179_len + int32(2)) {
 49572  		goto _774
 49573  	}
 49574  	_179_pDest.Xflags = uint16(1)
 49575  	if _sqlite3VdbeMemGrow(tls, _179_pDest, _179_len+int32(2), int32(0)) != 0 {
 49576  		goto _no_mem
 49577  	}
 49578  	goto _776
 49579  _774:
 49580  	_179_pDest.Xz = _179_pDest.XzMalloc
 49581  _776:
 49582  	crt.Xmemcpy(tls, unsafe.Pointer(_179_pDest.Xz), unsafe.Pointer(_179_zData), uint32(_179_len))
 49583  	*elem1(_179_pDest.Xz, uintptr(_179_len)) = 0
 49584  	*elem1(_179_pDest.Xz, uintptr(_179_len+int32(1))) = 0
 49585  	_179_pDest.Xflags = *elem20((*uint16)(unsafe.Pointer(&_sqlite3VdbeExecØ00aFlagØ004)), uintptr(_179_t&uint32(1)))
 49586  _773:
 49587  	goto _op_column_out
 49588  _771:
 49589  	_179_pDest.Xenc = _encoding
 49590  	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)) {
 49591  		_sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer(&_sqlite3VdbeExecØ00aZeroØ005)), _179_t, _179_pDest)
 49592  		goto _783
 49593  	}
 49594  	_rc = _sqlite3VdbeMemFromBtree(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_179_pC.Xuc))), *elem7(_179_aOffset, uintptr(_179_p2)), uint32(_179_len), _179_pDest)
 49595  	if _rc != int32(0) {
 49596  		goto _abort_due_to_error
 49597  	}
 49598  	_sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer(_179_pDest.Xz)), _179_t, _179_pDest)
 49599  	{
 49600  		p := &_179_pDest.Xflags
 49601  		*p = uint16(int32(*p) & int32(-4097))
 49602  	}
 49603  _783:
 49604  _op_column_out:
 49605  	if (_db.Xflags & int32(1)) != 0 {
 49606  		_registerTrace(tls, _pOp.Xp3, _179_pDest)
 49607  	}
 49608  	goto _250
 49609  _141:
 49610  	_213_zAffinity = *(**int8)(unsafe.Pointer(&_pOp.Xp4))
 49611  	func() {
 49612  		if _213_zAffinity == nil {
 49613  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81025), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64092)))
 49614  			crt.X__builtin_abort(tls)
 49615  		}
 49616  	}()
 49617  	func() {
 49618  		if _pOp.Xp2 <= int32(0) {
 49619  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81026), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61037)))
 49620  			crt.X__builtin_abort(tls)
 49621  		}
 49622  	}()
 49623  	func() {
 49624  		if int32(*elem1(_213_zAffinity, uintptr(_pOp.Xp2))) != int32(0) {
 49625  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81027), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64105)))
 49626  			crt.X__builtin_abort(tls)
 49627  		}
 49628  	}()
 49629  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 49630  _792:
 49631  	func() {
 49632  		if crt.P2U(unsafe.Pointer(_pIn1)) > crt.P2U(unsafe.Pointer(elem25((*XMem)(_p.XaMem), uintptr((_p.XnMem+int32(1))-_p.XnCursor)))) {
 49633  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81030), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64127)))
 49634  			crt.X__builtin_abort(tls)
 49635  		}
 49636  	}()
 49637  	func() {
 49638  		if (int32(_pIn1.Xflags) & int32(128)) != int32(0) {
 49639  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81031), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62214)))
 49640  			crt.X__builtin_abort(tls)
 49641  		}
 49642  	}()
 49643  	_applyAffinity(tls, _pIn1, *postInc1(&_213_zAffinity, 1), _encoding)
 49644  	*(*uintptr)(unsafe.Pointer(&_pIn1)) += uintptr(48)
 49645  	if (*elem1(_213_zAffinity, 0)) != 0 {
 49646  		goto _792
 49647  	}
 49648  	goto _250
 49649  _142:
 49650  	_215_nData = 0
 49651  	_215_nHdr = int32(0)
 49652  	_215_nZero = 0
 49653  	_215_nField = _pOp.Xp1
 49654  	_215_zAffinity = *(**int8)(unsafe.Pointer(&_pOp.Xp4))
 49655  	func() {
 49656  		if _215_nField <= int32(0) || _pOp.Xp2 <= int32(0) || (_pOp.Xp2+_215_nField) > (((_p.XnMem+int32(1))-_p.XnCursor)+int32(1)) {
 49657  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81092), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64170)))
 49658  			crt.X__builtin_abort(tls)
 49659  		}
 49660  	}()
 49661  	_215_pData0 = elem25(_aMem, uintptr(_215_nField))
 49662  	_215_nField = _pOp.Xp2
 49663  	_215_pLast = elem25(_215_pData0, uintptr(_215_nField-int32(1)))
 49664  	_215_file_format = int32(_p.XminWriteFileFormat)
 49665  	func() {
 49666  		if _pOp.Xp3 >= _pOp.Xp1 && _pOp.Xp3 < (_pOp.Xp1+_pOp.Xp2) {
 49667  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81099), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64238)))
 49668  			crt.X__builtin_abort(tls)
 49669  		}
 49670  	}()
 49671  	_pOut = elem25(_aMem, uintptr(_pOp.Xp3))
 49672  	_sqlite3VdbeMemAboutToChange(tls, _p, _pOut)
 49673  	func() {
 49674  		if crt.P2U(unsafe.Pointer(_215_pData0)) > crt.P2U(unsafe.Pointer(_215_pLast)) {
 49675  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81105), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64282)))
 49676  			crt.X__builtin_abort(tls)
 49677  		}
 49678  	}()
 49679  	if _215_zAffinity == nil {
 49680  		goto _806
 49681  	}
 49682  	_215_pRec = _215_pData0
 49683  _807:
 49684  	_applyAffinity(tls, postInc25(&_215_pRec, 48), *postInc1(&_215_zAffinity, 1), _encoding)
 49685  	func() {
 49686  		if int32(*elem1(_215_zAffinity, 0)) != int32(0) && crt.P2U(unsafe.Pointer(_215_pRec)) > crt.P2U(unsafe.Pointer(_215_pLast)) {
 49687  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81110), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64296)))
 49688  			crt.X__builtin_abort(tls)
 49689  		}
 49690  	}()
 49691  	if (*elem1(_215_zAffinity, 0)) != 0 {
 49692  		goto _807
 49693  	}
 49694  _806:
 49695  	_215_pRec = _215_pLast
 49696  _811:
 49697  	func() {
 49698  		if (int32(_215_pRec.Xflags) & int32(128)) != int32(0) {
 49699  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81133), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64327)))
 49700  			crt.X__builtin_abort(tls)
 49701  		}
 49702  	}()
 49703  	_215_pRec.XuTemp = store23(&_215_serial_type, _sqlite3VdbeSerialType(tls, _215_pRec, _215_file_format, &_215_len))
 49704  	if (int32(_215_pRec.Xflags) & int32(16384)) == 0 {
 49705  		goto _814
 49706  	}
 49707  	if _215_nData == 0 {
 49708  		goto _815
 49709  	}
 49710  	if _sqlite3VdbeMemExpandBlob(tls, _215_pRec) != 0 {
 49711  		goto _no_mem
 49712  	}
 49713  	goto _817
 49714  _815:
 49715  	_215_nZero += int64(*(*int32)(unsafe.Pointer(&_215_pRec.Xu)))
 49716  	_215_len -= uint32(*(*int32)(unsafe.Pointer(&_215_pRec.Xu)))
 49717  _817:
 49718  _814:
 49719  	_215_nData += uint64(_215_len)
 49720  	_215_nHdr += func() int32 {
 49721  		if _215_serial_type <= uint32(127) {
 49722  			return int32(1)
 49723  		}
 49724  		return _sqlite3VarintLen(tls, uint64(_215_serial_type))
 49725  	}()
 49726  	if _215_pRec == _215_pData0 {
 49727  		goto _821
 49728  	}
 49729  	*(*uintptr)(unsafe.Pointer(&_215_pRec)) += uintptr(4294967248)
 49730  	goto _811
 49731  _821:
 49732  	if _215_nHdr <= int32(126) {
 49733  		_215_nHdr += int32(1)
 49734  		goto _823
 49735  	}
 49736  	_215_nVarint = _sqlite3VarintLen(tls, uint64(_215_nHdr))
 49737  	_215_nHdr += _215_nVarint
 49738  	if _215_nVarint < _sqlite3VarintLen(tls, uint64(_215_nHdr)) {
 49739  		_215_nHdr += 1
 49740  	}
 49741  _823:
 49742  	_215_nByte = int64(uint64(_215_nHdr) + _215_nData)
 49743  	if (_215_nByte + _215_nZero) > int64(*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), 0)) {
 49744  		goto _too_big
 49745  	}
 49746  	if _sqlite3VdbeMemClearAndResize(tls, _pOut, int32(_215_nByte)) != 0 {
 49747  		goto _no_mem
 49748  	}
 49749  	_215_zNewRecord = (*uint8)(unsafe.Pointer(_pOut.Xz))
 49750  	_215_i = int32(uint8(func() int32 {
 49751  		if uint32(_215_nHdr) < uint32(128) {
 49752  			return func() int32 { *_215_zNewRecord = uint8(_215_nHdr); return int32(1) }()
 49753  		}
 49754  		return _sqlite3PutVarint(tls, _215_zNewRecord, uint64(_215_nHdr))
 49755  	}()))
 49756  	_215_j = _215_nHdr
 49757  	func() {
 49758  		if crt.P2U(unsafe.Pointer(_215_pData0)) > crt.P2U(unsafe.Pointer(_215_pLast)) {
 49759  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81184), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64282)))
 49760  			crt.X__builtin_abort(tls)
 49761  		}
 49762  	}()
 49763  	_215_pRec = _215_pData0
 49764  _831:
 49765  	_215_serial_type = _215_pRec.XuTemp
 49766  	_215_i += int32(uint8(func() int32 {
 49767  		if _215_serial_type < uint32(128) {
 49768  			return func() int32 { *elem15(_215_zNewRecord, uintptr(_215_i)) = uint8(_215_serial_type); return int32(1) }()
 49769  		}
 49770  		return _sqlite3PutVarint(tls, elem15(_215_zNewRecord, uintptr(_215_i)), uint64(_215_serial_type))
 49771  	}()))
 49772  	{
 49773  		p := &_215_j
 49774  		*p = int32(uint32(*p) + _sqlite3VdbeSerialPut(tls, elem15(_215_zNewRecord, uintptr(_215_j)), _215_pRec, _215_serial_type))
 49775  	}
 49776  	if crt.P2U(unsafe.Pointer(preInc25(&_215_pRec, 48))) <= crt.P2U(unsafe.Pointer(_215_pLast)) {
 49777  		goto _831
 49778  	}
 49779  	func() {
 49780  		if _215_i != _215_nHdr {
 49781  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81195), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64344)))
 49782  			crt.X__builtin_abort(tls)
 49783  		}
 49784  	}()
 49785  	func() {
 49786  		if int64(_215_j) != _215_nByte {
 49787  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81196), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64352)))
 49788  			crt.X__builtin_abort(tls)
 49789  		}
 49790  	}()
 49791  	func() {
 49792  		if _pOp.Xp3 <= int32(0) || _pOp.Xp3 > ((_p.XnMem+int32(1))-_p.XnCursor) {
 49793  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81198), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62583)))
 49794  			crt.X__builtin_abort(tls)
 49795  		}
 49796  	}()
 49797  	_pOut.Xn = int32(_215_nByte)
 49798  	_pOut.Xflags = uint16(16)
 49799  	if _215_nZero != 0 {
 49800  		*(*int32)(unsafe.Pointer(&_pOut.Xu)) = int32(_215_nZero)
 49801  		{
 49802  			p := &_pOut.Xflags
 49803  			*p = uint16(int32(*p) | int32(16384))
 49804  		}
 49805  	}
 49806  	if (_db.Xflags & int32(1)) != 0 {
 49807  		_registerTrace(tls, _pOp.Xp3, _pOut)
 49808  	}
 49809  	goto _250
 49810  _143:
 49811  	func() {
 49812  		if int32((*elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))).XeCurType) != int32(0) {
 49813  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81221), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64361)))
 49814  			crt.X__builtin_abort(tls)
 49815  		}
 49816  	}()
 49817  	_228_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&((*elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))).Xuc))))
 49818  	func() {
 49819  		if _228_pCrsr == nil {
 49820  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81223), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63949)))
 49821  			crt.X__builtin_abort(tls)
 49822  		}
 49823  	}()
 49824  	_228_nEntry = 0
 49825  	_rc = _sqlite3BtreeCount(tls, _228_pCrsr, &_228_nEntry)
 49826  	if _rc != 0 {
 49827  		goto _abort_due_to_error
 49828  	}
 49829  	_pOut = _out2Prerelease(tls, _p, _pOp)
 49830  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = _228_nEntry
 49831  	goto _250
 49832  _144:
 49833  	_229_p1 = _pOp.Xp1
 49834  	_229_zName = *(**int8)(unsafe.Pointer(&_pOp.Xp4))
 49835  	func() {
 49836  		if (*XSavepoint)(_db.XpSavepoint) != nil && int32(_db.XautoCommit) != int32(0) {
 49837  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81255), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64404)))
 49838  			crt.X__builtin_abort(tls)
 49839  		}
 49840  	}()
 49841  	func() {
 49842  		if _229_p1 != int32(0) && _229_p1 != int32(1) && _229_p1 != int32(2) {
 49843  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81256), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64443)))
 49844  			crt.X__builtin_abort(tls)
 49845  		}
 49846  	}()
 49847  	func() {
 49848  		if _db.XpSavepoint == nil && int32(_db.XisTransactionSavepoint) != int32(0) {
 49849  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81257), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64510)))
 49850  			crt.X__builtin_abort(tls)
 49851  		}
 49852  	}()
 49853  	func() {
 49854  		if _checkSavepointCount(tls, _db) == 0 {
 49855  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81258), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64558)))
 49856  			crt.X__builtin_abort(tls)
 49857  		}
 49858  	}()
 49859  	func() {
 49860  		if ((uint32(_p.Xexpired>>8) << 31) >> 31) == 0 {
 49861  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81259), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64582)))
 49862  			crt.X__builtin_abort(tls)
 49863  		}
 49864  	}()
 49865  	if _229_p1 != int32(0) {
 49866  		goto _862
 49867  	}
 49868  	if _db.XnVdbeWrite > int32(0) {
 49869  		_sqlite3VdbeError(tls, _p, str(64595))
 49870  		_rc = int32(5)
 49871  		goto _864
 49872  	}
 49873  	_229_nName = _sqlite3Strlen30(tls, _229_zName)
 49874  	func() {
 49875  		if int32(_db.XautoCommit) != int32(0) && _db.XnVTrans != int32(0) {
 49876  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81276), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64646)))
 49877  			crt.X__builtin_abort(tls)
 49878  		}
 49879  	}()
 49880  	_rc = _sqlite3VtabSavepoint(tls, _db, int32(0), _db.XnStatement+_db.XnSavepoint)
 49881  	if _rc != int32(0) {
 49882  		goto _abort_due_to_error
 49883  	}
 49884  	_229_pNew = (*XSavepoint)(_sqlite3DbMallocRawNN(tls, _db, uint64((uint32(24)+uint32(_229_nName))+uint32(1))))
 49885  	if _229_pNew == nil {
 49886  		goto _869
 49887  	}
 49888  	_229_pNew.XzName = (*int8)(unsafe.Pointer(elem82(_229_pNew, uintptr(1))))
 49889  	crt.Xmemcpy(tls, unsafe.Pointer(_229_pNew.XzName), unsafe.Pointer(_229_zName), uint32(_229_nName+int32(1)))
 49890  	if _db.XautoCommit != 0 {
 49891  		_db.XautoCommit = 0
 49892  		_db.XisTransactionSavepoint = uint8(1)
 49893  		goto _871
 49894  	}
 49895  	_db.XnSavepoint += 1
 49896  _871:
 49897  	*(**XSavepoint)(unsafe.Pointer(&_229_pNew.XpNext)) = (*XSavepoint)(_db.XpSavepoint)
 49898  	*(**XSavepoint)(unsafe.Pointer(&_db.XpSavepoint)) = _229_pNew
 49899  	_229_pNew.XnDeferredCons = _db.XnDeferredCons
 49900  	_229_pNew.XnDeferredImmCons = _db.XnDeferredImmCons
 49901  _869:
 49902  _864:
 49903  	goto _872
 49904  _862:
 49905  	_229_iSavepoint = int32(0)
 49906  	_229_pSavepoint = (*XSavepoint)(_db.XpSavepoint)
 49907  _873:
 49908  	if _229_pSavepoint == nil || _sqlite3StrICmp(tls, _229_pSavepoint.XzName, _229_zName) == 0 {
 49909  		goto _877
 49910  	}
 49911  	_229_iSavepoint += 1
 49912  	_229_pSavepoint = (*XSavepoint)(_229_pSavepoint.XpNext)
 49913  	goto _873
 49914  _877:
 49915  	if _229_pSavepoint == nil {
 49916  		_sqlite3VdbeError(tls, _p, str(64682), unsafe.Pointer(_229_zName))
 49917  		_rc = int32(1)
 49918  		goto _882
 49919  	}
 49920  	if (_db.XnVdbeWrite > int32(0)) && (_229_p1 == int32(1)) {
 49921  		_sqlite3VdbeError(tls, _p, str(64704))
 49922  		_rc = int32(5)
 49923  		goto _882
 49924  	}
 49925  	_240_isTransaction = bool2int(((*XSavepoint)(_229_pSavepoint.XpNext) == nil) && (_db.XisTransactionSavepoint != 0))
 49926  	if _240_isTransaction == 0 || _229_p1 != int32(1) {
 49927  		goto _885
 49928  	}
 49929  	if store2(&_rc, _sqlite3VdbeCheckFk(tls, _p, int32(1))) != int32(0) {
 49930  		goto _vdbe_return
 49931  	}
 49932  	_db.XautoCommit = uint8(1)
 49933  	if _sqlite3VdbeHalt(tls, _p) == int32(5) {
 49934  		_p.Xpc = int32((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 24)
 49935  		_db.XautoCommit = 0
 49936  		_p.Xrc = store2(&_rc, int32(5))
 49937  		goto _vdbe_return
 49938  	}
 49939  	_db.XisTransactionSavepoint = 0
 49940  	_rc = _p.Xrc
 49941  	goto _888
 49942  _885:
 49943  	_229_iSavepoint = (_db.XnSavepoint - _229_iSavepoint) - int32(1)
 49944  	if _229_p1 != int32(2) {
 49945  		goto _889
 49946  	}
 49947  	_244_isSchemaChange = bool2int((_db.Xflags & int32(2)) != int32(0))
 49948  	_229_ii = int32(0)
 49949  _890:
 49950  	if _229_ii >= _db.XnDb {
 49951  		goto _893
 49952  	}
 49953  	_rc = _sqlite3BtreeTripAllCursors(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_229_ii)).XpBt), int32(516), bool2int(_244_isSchemaChange == int32(0)))
 49954  	if _rc != int32(0) {
 49955  		goto _abort_due_to_error
 49956  	}
 49957  	_229_ii += 1
 49958  	goto _890
 49959  _893:
 49960  	goto _895
 49961  _889:
 49962  	_244_isSchemaChange = int32(0)
 49963  _895:
 49964  	_229_ii = int32(0)
 49965  _896:
 49966  	if _229_ii >= _db.XnDb {
 49967  		goto _899
 49968  	}
 49969  	_rc = _sqlite3BtreeSavepoint(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_229_ii)).XpBt), _229_p1, _229_iSavepoint)
 49970  	if _rc != int32(0) {
 49971  		goto _abort_due_to_error
 49972  	}
 49973  	_229_ii += 1
 49974  	goto _896
 49975  _899:
 49976  	if _244_isSchemaChange != 0 {
 49977  		_sqlite3ExpirePreparedStatements(tls, _db)
 49978  		_sqlite3ResetAllSchemasOfConnection(tls, _db)
 49979  		_db.Xflags = _db.Xflags | int32(2)
 49980  	}
 49981  _888:
 49982  	if (*XSavepoint)(_db.XpSavepoint) != _229_pSavepoint {
 49983  		_229_pTmp = (*XSavepoint)(_db.XpSavepoint)
 49984  		*(**XSavepoint)(unsafe.Pointer(&_db.XpSavepoint)) = (*XSavepoint)(_229_pTmp.XpNext)
 49985  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_229_pTmp))
 49986  		_db.XnSavepoint -= 1
 49987  		goto _888
 49988  	}
 49989  	if _229_p1 != int32(1) {
 49990  		goto _904
 49991  	}
 49992  	func() {
 49993  		if _229_pSavepoint != (*XSavepoint)(_db.XpSavepoint) {
 49994  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81387), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64758)))
 49995  			crt.X__builtin_abort(tls)
 49996  		}
 49997  	}()
 49998  	*(**XSavepoint)(unsafe.Pointer(&_db.XpSavepoint)) = (*XSavepoint)(_229_pSavepoint.XpNext)
 49999  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_229_pSavepoint))
 50000  	if _240_isTransaction == 0 {
 50001  		_db.XnSavepoint -= 1
 50002  	}
 50003  	goto _908
 50004  _904:
 50005  	_db.XnDeferredCons = _229_pSavepoint.XnDeferredCons
 50006  	_db.XnDeferredImmCons = _229_pSavepoint.XnDeferredImmCons
 50007  _908:
 50008  	if _240_isTransaction != 0 && _229_p1 != int32(2) {
 50009  		goto _910
 50010  	}
 50011  	_rc = _sqlite3VtabSavepoint(tls, _db, _229_p1, _229_iSavepoint)
 50012  	if _rc != int32(0) {
 50013  		goto _abort_due_to_error
 50014  	}
 50015  _910:
 50016  _882:
 50017  _872:
 50018  	if _rc != 0 {
 50019  		goto _abort_due_to_error
 50020  	}
 50021  	goto _250
 50022  _145:
 50023  	_256_desiredAutoCommit = _pOp.Xp1
 50024  	_256_iRollback = _pOp.Xp2
 50025  	func() {
 50026  		if _256_desiredAutoCommit != int32(1) && _256_desiredAutoCommit != int32(0) {
 50027  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81424), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64785)))
 50028  			crt.X__builtin_abort(tls)
 50029  		}
 50030  	}()
 50031  	func() {
 50032  		if _256_desiredAutoCommit != int32(1) && _256_iRollback != int32(0) {
 50033  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81425), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64830)))
 50034  			crt.X__builtin_abort(tls)
 50035  		}
 50036  	}()
 50037  	func() {
 50038  		if _db.XnVdbeActive <= int32(0) {
 50039  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81426), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64867)))
 50040  			crt.X__builtin_abort(tls)
 50041  		}
 50042  	}()
 50043  	func() {
 50044  		if ((uint32(_p.Xexpired>>8) << 31) >> 31) == 0 {
 50045  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81427), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64582)))
 50046  			crt.X__builtin_abort(tls)
 50047  		}
 50048  	}()
 50049  	if _256_desiredAutoCommit == int32(_db.XautoCommit) {
 50050  		goto _923
 50051  	}
 50052  	if _256_iRollback != 0 {
 50053  		func() {
 50054  			if _256_desiredAutoCommit != int32(1) {
 50055  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81431), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64885)))
 50056  				crt.X__builtin_abort(tls)
 50057  			}
 50058  		}()
 50059  		_sqlite3RollbackAll(tls, _db, int32(516))
 50060  		_db.XautoCommit = uint8(1)
 50061  		goto _932
 50062  	}
 50063  	if _256_desiredAutoCommit != 0 && (_db.XnVdbeWrite > int32(0)) {
 50064  		_sqlite3VdbeError(tls, _p, str(64906))
 50065  		_rc = int32(5)
 50066  		goto _abort_due_to_error
 50067  	}
 50068  	if store2(&_rc, _sqlite3VdbeCheckFk(tls, _p, int32(1))) != int32(0) {
 50069  		goto _vdbe_return
 50070  	}
 50071  	_db.XautoCommit = uint8(_256_desiredAutoCommit)
 50072  _932:
 50073  	if _sqlite3VdbeHalt(tls, _p) == int32(5) {
 50074  		_p.Xpc = int32((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 24)
 50075  		_db.XautoCommit = uint8(int32(1) - _256_desiredAutoCommit)
 50076  		_p.Xrc = store2(&_rc, int32(5))
 50077  		goto _vdbe_return
 50078  	}
 50079  	func() {
 50080  		if _db.XnStatement != int32(0) {
 50081  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81453), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64961)))
 50082  			crt.X__builtin_abort(tls)
 50083  		}
 50084  	}()
 50085  	_sqlite3CloseSavepoints(tls, _db)
 50086  	if _p.Xrc == int32(0) {
 50087  		_rc = int32(101)
 50088  		goto _937
 50089  	}
 50090  	_rc = int32(1)
 50091  _937:
 50092  	goto _vdbe_return
 50093  _923:
 50094  	_sqlite3VdbeError(tls, _p, func() *int8 {
 50095  		if _256_desiredAutoCommit == 0 {
 50096  			return str(64979)
 50097  		}
 50098  		return func() *int8 {
 50099  			if _256_iRollback != 0 {
 50100  				return str(65027)
 50101  			}
 50102  			return str(65070)
 50103  		}()
 50104  	}())
 50105  	_rc = int32(1)
 50106  	goto _abort_due_to_error
 50107  _146:
 50108  	func() {
 50109  		if ((uint32(_p.Xexpired>>8) << 31) >> 31) == 0 {
 50110  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81512), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64582)))
 50111  			crt.X__builtin_abort(tls)
 50112  		}
 50113  	}()
 50114  	func() {
 50115  		if int32((uint32(_p.Xexpired>>7)<<31)>>31) != int32(0) && _pOp.Xp2 != int32(0) {
 50116  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81513), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65111)))
 50117  			crt.X__builtin_abort(tls)
 50118  		}
 50119  	}()
 50120  	func() {
 50121  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _db.XnDb {
 50122  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81514), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65140)))
 50123  			crt.X__builtin_abort(tls)
 50124  		}
 50125  	}()
 50126  	func() {
 50127  		if (_p.XbtreeMask & (uint32(1) << uint(_pOp.Xp1))) == (0) {
 50128  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81515), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65170)))
 50129  			crt.X__builtin_abort(tls)
 50130  		}
 50131  	}()
 50132  	if _pOp.Xp2 != 0 && ((_db.Xflags & int32(67108864)) != int32(0)) {
 50133  		_rc = int32(8)
 50134  		goto _abort_due_to_error
 50135  	}
 50136  	_266_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_pOp.Xp1)).XpBt)
 50137  	if _266_pBt == nil {
 50138  		goto _955
 50139  	}
 50140  	_rc = _sqlite3BtreeBeginTrans(tls, _266_pBt, _pOp.Xp2)
 50141  	if _rc == int32(0) {
 50142  		goto _956
 50143  	}
 50144  	if (_rc & int32(255)) == int32(5) {
 50145  		_p.Xpc = int32((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 24)
 50146  		_p.Xrc = _rc
 50147  		goto _vdbe_return
 50148  	}
 50149  	goto _abort_due_to_error
 50150  _956:
 50151  	if _pOp.Xp2 == 0 || ((uint32(_p.Xexpired>>6)<<31)>>31) == 0 || int32(_db.XautoCommit) != int32(0) && _db.XnVdbeRead <= int32(1) {
 50152  		goto _961
 50153  	}
 50154  	func() {
 50155  		if _sqlite3BtreeIsInTrans(tls, _266_pBt) == 0 {
 50156  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81538), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65204)))
 50157  			crt.X__builtin_abort(tls)
 50158  		}
 50159  	}()
 50160  	if _p.XiStatement == int32(0) {
 50161  		func() {
 50162  			if _db.XnStatement < int32(0) || _db.XnSavepoint < int32(0) {
 50163  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81540), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65231)))
 50164  				crt.X__builtin_abort(tls)
 50165  			}
 50166  		}()
 50167  		_db.XnStatement += 1
 50168  		_p.XiStatement = _db.XnSavepoint + _db.XnStatement
 50169  	}
 50170  	_rc = _sqlite3VtabSavepoint(tls, _db, int32(0), _p.XiStatement-int32(1))
 50171  	if _rc == int32(0) {
 50172  		_rc = _sqlite3BtreeBeginStmt(tls, _266_pBt, _p.XiStatement)
 50173  	}
 50174  	_p.XnStmtDefCons = _db.XnDeferredCons
 50175  	_p.XnStmtDefImmCons = _db.XnDeferredImmCons
 50176  _961:
 50177  	_sqlite3BtreeGetMeta(tls, _266_pBt, int32(1), (*uint32)(unsafe.Pointer(&_266_iMeta)))
 50178  	_266_iGen = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_pOp.Xp1)).XpSchema).XiGeneration
 50179  	goto _969
 50180  _955:
 50181  	_266_iGen = store2(&_266_iMeta, int32(0))
 50182  _969:
 50183  	func() {
 50184  		if int32(_pOp.Xp5) != int32(0) && int32(_pOp.Xp4type) != int32(-11) {
 50185  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81567), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65270)))
 50186  			crt.X__builtin_abort(tls)
 50187  		}
 50188  	}()
 50189  	if _pOp.Xp5 == 0 || _266_iMeta == _pOp.Xp3 && _266_iGen == (*(*int32)(unsafe.Pointer(&_pOp.Xp4))) {
 50190  		goto _975
 50191  	}
 50192  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_p.XzErrMsg))
 50193  	_p.XzErrMsg = _sqlite3DbStrDup(tls, _db, str(59618))
 50194  	if ((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_pOp.Xp1)).XpSchema).Xschema_cookie) != _266_iMeta {
 50195  		_sqlite3ResetOneSchema(tls, _db, _pOp.Xp1)
 50196  	}
 50197  	storebits26(&_p.Xexpired, int16(1), 1, 0)
 50198  	_rc = int32(17)
 50199  _975:
 50200  	if _rc != 0 {
 50201  		goto _abort_due_to_error
 50202  	}
 50203  	goto _250
 50204  _147:
 50205  	func() {
 50206  		if ((uint32(_p.Xexpired>>8) << 31) >> 31) == 0 {
 50207  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81611), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64582)))
 50208  			crt.X__builtin_abort(tls)
 50209  		}
 50210  	}()
 50211  	_277_iDb = _pOp.Xp1
 50212  	_277_iCookie = _pOp.Xp3
 50213  	func() {
 50214  		if _pOp.Xp3 >= int32(16) {
 50215  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81614), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65306)))
 50216  			crt.X__builtin_abort(tls)
 50217  		}
 50218  	}()
 50219  	func() {
 50220  		if _277_iDb < int32(0) || _277_iDb >= _db.XnDb {
 50221  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81615), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(21693)))
 50222  			crt.X__builtin_abort(tls)
 50223  		}
 50224  	}()
 50225  	func() {
 50226  		if (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_277_iDb)).XpBt) == nil {
 50227  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81616), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65334)))
 50228  			crt.X__builtin_abort(tls)
 50229  		}
 50230  	}()
 50231  	func() {
 50232  		if (_p.XbtreeMask & (uint32(1) << uint(_277_iDb))) == (0) {
 50233  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81617), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65354)))
 50234  			crt.X__builtin_abort(tls)
 50235  		}
 50236  	}()
 50237  	_sqlite3BtreeGetMeta(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_277_iDb)).XpBt), _277_iCookie, (*uint32)(unsafe.Pointer(&_277_iMeta)))
 50238  	_pOut = _out2Prerelease(tls, _p, _pOp)
 50239  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = int64(_277_iMeta)
 50240  	goto _250
 50241  _148:
 50242  	func() {
 50243  		if _pOp.Xp2 >= int32(16) {
 50244  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81637), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65384)))
 50245  			crt.X__builtin_abort(tls)
 50246  		}
 50247  	}()
 50248  	func() {
 50249  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _db.XnDb {
 50250  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81638), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65140)))
 50251  			crt.X__builtin_abort(tls)
 50252  		}
 50253  	}()
 50254  	func() {
 50255  		if (_p.XbtreeMask & (uint32(1) << uint(_pOp.Xp1))) == (0) {
 50256  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81639), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65170)))
 50257  			crt.X__builtin_abort(tls)
 50258  		}
 50259  	}()
 50260  	func() {
 50261  		if int32((uint32(_p.Xexpired>>7)<<31)>>31) != int32(0) {
 50262  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81640), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65412)))
 50263  			crt.X__builtin_abort(tls)
 50264  		}
 50265  	}()
 50266  	_278_pDb = elem27((*XDb)(_db.XaDb), uintptr(_pOp.Xp1))
 50267  	func() {
 50268  		if (*XBtree)(_278_pDb.XpBt) == nil {
 50269  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81642), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65427)))
 50270  			crt.X__builtin_abort(tls)
 50271  		}
 50272  	}()
 50273  	func() {
 50274  		if _sqlite3SchemaMutexHeld(tls, _db, _pOp.Xp1, nil) == 0 {
 50275  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81643), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65439)))
 50276  			crt.X__builtin_abort(tls)
 50277  		}
 50278  	}()
 50279  	_rc = _sqlite3BtreeUpdateMeta(tls, (*XBtree)(_278_pDb.XpBt), _pOp.Xp2, uint32(_pOp.Xp3))
 50280  	if _pOp.Xp2 == int32(1) {
 50281  		(*XSchema)(_278_pDb.XpSchema).Xschema_cookie = _pOp.Xp3
 50282  		_db.Xflags |= int32(2)
 50283  		goto _1004
 50284  	}
 50285  	if _pOp.Xp2 == int32(2) {
 50286  		(*XSchema)(_278_pDb.XpSchema).Xfile_format = uint8(_pOp.Xp3)
 50287  	}
 50288  _1004:
 50289  	if _pOp.Xp1 == int32(1) {
 50290  		_sqlite3ExpirePreparedStatements(tls, _db)
 50291  		storebits26(&_p.Xexpired, 0, 1, 0)
 50292  	}
 50293  	if _rc != 0 {
 50294  		goto _abort_due_to_error
 50295  	}
 50296  	goto _250
 50297  _149:
 50298  	func() {
 50299  		if int32(_pOp.Xp5) != int32(0) && int32(_pOp.Xp5) != int32(2) {
 50300  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81739), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65478)))
 50301  			crt.X__builtin_abort(tls)
 50302  		}
 50303  	}()
 50304  	func() {
 50305  		if int32(_pOp.Xp4type) != int32(-5) {
 50306  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81740), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65515)))
 50307  			crt.X__builtin_abort(tls)
 50308  		}
 50309  	}()
 50310  	_282_pCur = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 50311  	if (_282_pCur != nil) && (_282_pCur.XpgnoRoot == uint32(_pOp.Xp2)) {
 50312  		func() {
 50313  			if int32(_282_pCur.XiDb) != _pOp.Xp3 {
 50314  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81743), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65539)))
 50315  				crt.X__builtin_abort(tls)
 50316  			}
 50317  		}()
 50318  		goto _open_cursor_set_hints
 50319  	}
 50320  _1013:
 50321  	func() {
 50322  		if int32(_pOp.Xopcode) != int32(107) && int32(_pOp.Xp5) != int32(0) && int32(_pOp.Xp5) != int32(2) {
 50323  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81751), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65558)))
 50324  			crt.X__builtin_abort(tls)
 50325  		}
 50326  	}()
 50327  	func() {
 50328  		if ((uint32(_p.Xexpired>>8) << 31) >> 31) == 0 {
 50329  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81752), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64582)))
 50330  			crt.X__builtin_abort(tls)
 50331  		}
 50332  	}()
 50333  	func() {
 50334  		if int32(_pOp.Xopcode) != int32(106) && int32(_pOp.Xopcode) != int32(105) && int32((uint32(_p.Xexpired>>7)<<31)>>31) != int32(0) {
 50335  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81753), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65624)))
 50336  			crt.X__builtin_abort(tls)
 50337  		}
 50338  	}()
 50339  	if ((uint32(_p.Xexpired) << 31) >> 31) != 0 {
 50340  		_rc = int32(516)
 50341  		goto _abort_due_to_error
 50342  	}
 50343  	_282_nField = int32(0)
 50344  	_282_pKeyInfo = nil
 50345  	_282_p2 = _pOp.Xp2
 50346  	_282_iDb = _pOp.Xp3
 50347  	func() {
 50348  		if _282_iDb < int32(0) || _282_iDb >= _db.XnDb {
 50349  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81765), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(21693)))
 50350  			crt.X__builtin_abort(tls)
 50351  		}
 50352  	}()
 50353  	func() {
 50354  		if (_p.XbtreeMask & (uint32(1) << uint(_282_iDb))) == (0) {
 50355  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81766), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65354)))
 50356  			crt.X__builtin_abort(tls)
 50357  		}
 50358  	}()
 50359  	_282_pDb = elem27((*XDb)(_db.XaDb), uintptr(_282_iDb))
 50360  	_282_pX = (*XBtree)(_282_pDb.XpBt)
 50361  	func() {
 50362  		if _282_pX == nil {
 50363  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81769), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65696)))
 50364  			crt.X__builtin_abort(tls)
 50365  		}
 50366  	}()
 50367  	if int32(_pOp.Xopcode) != int32(107) {
 50368  		goto _1034
 50369  	}
 50370  
 50371  	_282_wrFlag = int32(4) | (int32(_pOp.Xp5) & int32(8))
 50372  	func() {
 50373  		if _sqlite3SchemaMutexHeld(tls, _db, _282_iDb, nil) == 0 {
 50374  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81773), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(51126)))
 50375  			crt.X__builtin_abort(tls)
 50376  		}
 50377  	}()
 50378  	if int32((*XSchema)(_282_pDb.XpSchema).Xfile_format) < int32(_p.XminWriteFileFormat) {
 50379  		_p.XminWriteFileFormat = (*XSchema)(_282_pDb.XpSchema).Xfile_format
 50380  	}
 50381  	goto _1038
 50382  _1034:
 50383  	_282_wrFlag = int32(0)
 50384  _1038:
 50385  	if (int32(_pOp.Xp5) & int32(16)) != 0 {
 50386  		func() {
 50387  			if _282_p2 <= int32(0) {
 50388  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81781), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65702)))
 50389  				crt.X__builtin_abort(tls)
 50390  			}
 50391  		}()
 50392  		func() {
 50393  			if _282_p2 > ((_p.XnMem + int32(1)) - _p.XnCursor) {
 50394  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81782), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65707)))
 50395  				crt.X__builtin_abort(tls)
 50396  			}
 50397  		}()
 50398  		_pIn2 = elem25(_aMem, uintptr(_282_p2))
 50399  		func() {
 50400  			if (int32(_pIn2.Xflags) & int32(128)) != int32(0) {
 50401  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81784), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65736)))
 50402  				crt.X__builtin_abort(tls)
 50403  			}
 50404  		}()
 50405  		func() {
 50406  			if (int32(_pIn2.Xflags) & int32(4)) == int32(0) {
 50407  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81785), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65753)))
 50408  				crt.X__builtin_abort(tls)
 50409  			}
 50410  		}()
 50411  		_sqlite3VdbeMemIntegerify(tls, _pIn2)
 50412  		_282_p2 = int32(*(*int64)(unsafe.Pointer(&_pIn2.Xu)))
 50413  		func() {
 50414  			if _282_p2 < int32(2) {
 50415  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81792), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65780)))
 50416  				crt.X__builtin_abort(tls)
 50417  			}
 50418  		}()
 50419  	}
 50420  	if int32(_pOp.Xp4type) == int32(-5) {
 50421  		_282_pKeyInfo = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 50422  		func() {
 50423  			if int32(_282_pKeyInfo.Xenc) != int32(_db.Xenc) {
 50424  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81796), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65786)))
 50425  				crt.X__builtin_abort(tls)
 50426  			}
 50427  		}()
 50428  		func() {
 50429  			if (*Xsqlite3)(_282_pKeyInfo.Xdb) != _db {
 50430  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81797), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65809)))
 50431  				crt.X__builtin_abort(tls)
 50432  			}
 50433  		}()
 50434  		_282_nField = int32(_282_pKeyInfo.XnField) + int32(_282_pKeyInfo.XnXField)
 50435  		goto _1056
 50436  	}
 50437  	if int32(_pOp.Xp4type) == int32(-11) {
 50438  		_282_nField = *(*int32)(unsafe.Pointer(&_pOp.Xp4))
 50439  	}
 50440  _1056:
 50441  	func() {
 50442  		if _pOp.Xp1 < int32(0) {
 50443  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81802), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65826)))
 50444  			crt.X__builtin_abort(tls)
 50445  		}
 50446  	}()
 50447  	func() {
 50448  		if _282_nField < int32(0) {
 50449  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81803), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65837)))
 50450  			crt.X__builtin_abort(tls)
 50451  		}
 50452  	}()
 50453  	_282_pCur = _allocateCursor(tls, _p, _pOp.Xp1, _282_nField, _282_iDb, 0)
 50454  	if _282_pCur == nil {
 50455  		goto _no_mem
 50456  	}
 50457  	_282_pCur.XnullRow = uint8(1)
 50458  	storebits5(&_282_pCur.XisEphemeral, int8(1), 4, 2)
 50459  	_282_pCur.XpgnoRoot = uint32(_282_p2)
 50460  	_282_pCur.XwrFlag = uint8(_282_wrFlag)
 50461  	_rc = _sqlite3BtreeCursor(tls, _282_pX, _282_p2, _282_wrFlag, _282_pKeyInfo, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_282_pCur.Xuc))))
 50462  	*(**XKeyInfo)(unsafe.Pointer(&_282_pCur.XpKeyInfo)) = _282_pKeyInfo
 50463  	_282_pCur.XisTable = uint8(bool2int(int32(_pOp.Xp4type) != int32(-5)))
 50464  _open_cursor_set_hints:
 50465  
 50466  	_sqlite3BtreeCursorHintFlags(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_282_pCur.Xuc))), uint32(int32(_pOp.Xp5)&int32(3)))
 50467  	if _rc != 0 {
 50468  		goto _abort_due_to_error
 50469  	}
 50470  	goto _250
 50471  _152:
 50472  	_291_pOrig = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp2))
 50473  	func() {
 50474  		if (*XBtree)(_291_pOrig.XpBtx) == nil {
 50475  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81847), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65847)))
 50476  			crt.X__builtin_abort(tls)
 50477  		}
 50478  	}()
 50479  	_291_pCx = _allocateCursor(tls, _p, _pOp.Xp1, int32(_291_pOrig.XnField), int32(-1), 0)
 50480  	if _291_pCx == nil {
 50481  		goto _no_mem
 50482  	}
 50483  	_291_pCx.XnullRow = uint8(1)
 50484  	storebits5(&_291_pCx.XisEphemeral, int8(1), 1, 0)
 50485  	*(**XKeyInfo)(unsafe.Pointer(&_291_pCx.XpKeyInfo)) = (*XKeyInfo)(_291_pOrig.XpKeyInfo)
 50486  	_291_pCx.XisTable = _291_pOrig.XisTable
 50487  	_rc = _sqlite3BtreeCursor(tls, (*XBtree)(_291_pOrig.XpBtx), int32(1), int32(4), (*XKeyInfo)(_291_pCx.XpKeyInfo), (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_291_pCx.Xuc))))
 50488  	func() {
 50489  		if _rc != int32(0) {
 50490  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81860), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(14967)))
 50491  			crt.X__builtin_abort(tls)
 50492  		}
 50493  	}()
 50494  	goto _250
 50495  _153:
 50496  	func() {
 50497  		if _pOp.Xp1 < int32(0) {
 50498  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81902), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65826)))
 50499  			crt.X__builtin_abort(tls)
 50500  		}
 50501  	}()
 50502  	func() {
 50503  		if _pOp.Xp2 < int32(0) {
 50504  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81903), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65862)))
 50505  			crt.X__builtin_abort(tls)
 50506  		}
 50507  	}()
 50508  	_292_pCx = _allocateCursor(tls, _p, _pOp.Xp1, _pOp.Xp2, int32(-1), 0)
 50509  	if _292_pCx == nil {
 50510  		goto _no_mem
 50511  	}
 50512  	_292_pCx.XnullRow = uint8(1)
 50513  	storebits5(&_292_pCx.XisEphemeral, int8(1), 1, 0)
 50514  	_rc = _sqlite3BtreeOpen(tls, (*Xsqlite3_vfs)(_db.XpVfs), nil, _db, (**XBtree)(unsafe.Pointer(&_292_pCx.XpBtx)), int32(5)|int32(_pOp.Xp5), _sqlite3VdbeExecØ00vfsFlagsØ006)
 50515  	if _rc == int32(0) {
 50516  		_rc = _sqlite3BtreeBeginTrans(tls, (*XBtree)(_292_pCx.XpBtx), int32(1))
 50517  	}
 50518  	if _rc != int32(0) {
 50519  		goto _1074
 50520  	}
 50521  	if store65((**XKeyInfo)(unsafe.Pointer(&_292_pCx.XpKeyInfo)), store65(&_292_pKeyInfo, (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))))) == nil {
 50522  		goto _1075
 50523  	}
 50524  	func() {
 50525  		if int32(_pOp.Xp4type) != int32(-5) {
 50526  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81921), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65515)))
 50527  			crt.X__builtin_abort(tls)
 50528  		}
 50529  	}()
 50530  	_rc = _sqlite3BtreeCreateTable(tls, (*XBtree)(_292_pCx.XpBtx), &_295_pgno, int32(2)|int32(_pOp.Xp5))
 50531  	if _rc == int32(0) {
 50532  		func() {
 50533  			if _295_pgno != int32(2) {
 50534  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81924), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65873)))
 50535  				crt.X__builtin_abort(tls)
 50536  			}
 50537  		}()
 50538  		func() {
 50539  			if (*Xsqlite3)(_292_pKeyInfo.Xdb) != _db {
 50540  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81925), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65809)))
 50541  				crt.X__builtin_abort(tls)
 50542  			}
 50543  		}()
 50544  		func() {
 50545  			if int32(_292_pKeyInfo.Xenc) != int32(_db.Xenc) {
 50546  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81926), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65786)))
 50547  				crt.X__builtin_abort(tls)
 50548  			}
 50549  		}()
 50550  		_rc = _sqlite3BtreeCursor(tls, (*XBtree)(_292_pCx.XpBtx), _295_pgno, int32(4), _292_pKeyInfo, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_292_pCx.Xuc))))
 50551  	}
 50552  	_292_pCx.XisTable = 0
 50553  	goto _1085
 50554  _1075:
 50555  	_rc = _sqlite3BtreeCursor(tls, (*XBtree)(_292_pCx.XpBtx), int32(1), int32(4), nil, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_292_pCx.Xuc))))
 50556  	_292_pCx.XisTable = uint8(1)
 50557  _1085:
 50558  _1074:
 50559  	if _rc != 0 {
 50560  		goto _abort_due_to_error
 50561  	}
 50562  	storebits5(&_292_pCx.XisEphemeral, int8(bool2int(int32(_pOp.Xp5) != int32(8))), 4, 2)
 50563  	goto _250
 50564  _155:
 50565  	func() {
 50566  		if _pOp.Xp1 < int32(0) {
 50567  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81955), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65826)))
 50568  			crt.X__builtin_abort(tls)
 50569  		}
 50570  	}()
 50571  	func() {
 50572  		if _pOp.Xp2 < int32(0) {
 50573  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81956), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65862)))
 50574  			crt.X__builtin_abort(tls)
 50575  		}
 50576  	}()
 50577  	_298_pCx = _allocateCursor(tls, _p, _pOp.Xp1, _pOp.Xp2, int32(-1), uint8(1))
 50578  	if _298_pCx == nil {
 50579  		goto _no_mem
 50580  	}
 50581  	*(**XKeyInfo)(unsafe.Pointer(&_298_pCx.XpKeyInfo)) = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 50582  	func() {
 50583  		if (*Xsqlite3)((*XKeyInfo)(_298_pCx.XpKeyInfo).Xdb) != _db {
 50584  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81960), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65893)))
 50585  			crt.X__builtin_abort(tls)
 50586  		}
 50587  	}()
 50588  	func() {
 50589  		if int32((*XKeyInfo)(_298_pCx.XpKeyInfo).Xenc) != int32(_db.Xenc) {
 50590  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81961), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65915)))
 50591  			crt.X__builtin_abort(tls)
 50592  		}
 50593  	}()
 50594  	_rc = _sqlite3VdbeSorterInit(tls, _db, _pOp.Xp3, _298_pCx)
 50595  	if _rc != 0 {
 50596  		goto _abort_due_to_error
 50597  	}
 50598  	goto _250
 50599  _156:
 50600  	func() {
 50601  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 50602  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81976), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 50603  			crt.X__builtin_abort(tls)
 50604  		}
 50605  	}()
 50606  	_299_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 50607  	func() {
 50608  		if int32(_299_pC.XeCurType) != int32(1) {
 50609  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(81978), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65943)))
 50610  			crt.X__builtin_abort(tls)
 50611  		}
 50612  	}()
 50613  	if postInc35(&_299_pC.XseqCount, 1) == (0) {
 50614  		goto _jump_to_p2
 50615  	}
 50616  	goto _250
 50617  _157:
 50618  	func() {
 50619  		if _pOp.Xp1 < int32(0) {
 50620  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82004), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65826)))
 50621  			crt.X__builtin_abort(tls)
 50622  		}
 50623  	}()
 50624  	func() {
 50625  		if _pOp.Xp3 < int32(0) {
 50626  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82005), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65956)))
 50627  			crt.X__builtin_abort(tls)
 50628  		}
 50629  	}()
 50630  	_301_pCx = _allocateCursor(tls, _p, _pOp.Xp1, _pOp.Xp3, int32(-1), uint8(3))
 50631  	if _301_pCx == nil {
 50632  		goto _no_mem
 50633  	}
 50634  	_301_pCx.XnullRow = uint8(1)
 50635  	*(*int32)(unsafe.Pointer(&_301_pCx.Xuc)) = _pOp.Xp2
 50636  	_301_pCx.XisTable = uint8(1)
 50637  	func() {
 50638  		if int32(_pOp.Xp5) != int32(0) {
 50639  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82011), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65967)))
 50640  			crt.X__builtin_abort(tls)
 50641  		}
 50642  	}()
 50643  	goto _250
 50644  _158:
 50645  	func() {
 50646  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 50647  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82021), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 50648  			crt.X__builtin_abort(tls)
 50649  		}
 50650  	}()
 50651  	_sqlite3VdbeFreeCursor(tls, _p, *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1)))
 50652  	*elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1)) = nil
 50653  	goto _250
 50654  _159:
 50655  	func() {
 50656  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 50657  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82145), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 50658  			crt.X__builtin_abort(tls)
 50659  		}
 50660  	}()
 50661  	func() {
 50662  		if _pOp.Xp2 == int32(0) {
 50663  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82146), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65978)))
 50664  			crt.X__builtin_abort(tls)
 50665  		}
 50666  	}()
 50667  	_303_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 50668  	func() {
 50669  		if _303_pC == nil {
 50670  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82148), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 50671  			crt.X__builtin_abort(tls)
 50672  		}
 50673  	}()
 50674  	func() {
 50675  		if int32(_303_pC.XeCurType) != int32(0) {
 50676  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82149), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 50677  			crt.X__builtin_abort(tls)
 50678  		}
 50679  	}()
 50680  
 50681  	func() {
 50682  		if ((uint32(_303_pC.XisEphemeral>>2) << 31) >> 31) == 0 {
 50683  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82153), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65989)))
 50684  			crt.X__builtin_abort(tls)
 50685  		}
 50686  	}()
 50687  	func() {
 50688  		if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_303_pC.Xuc))) == nil {
 50689  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82154), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66003)))
 50690  			crt.X__builtin_abort(tls)
 50691  		}
 50692  	}()
 50693  	_303_oc = int32(_pOp.Xopcode)
 50694  	_303_eqOnly = int32(0)
 50695  	_303_pC.XnullRow = 0
 50696  	_303_pC.XseekOp = _pOp.Xopcode
 50697  	if _303_pC.XisTable == 0 {
 50698  		goto _1126
 50699  	}
 50700  	func() {
 50701  		if _sqlite3BtreeCursorHasHint(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_303_pC.Xuc))), uint32(2)) != int32(0) && _sqlite3Config.XneverCorrupt != int32(0) {
 50702  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82164), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66021)))
 50703  			crt.X__builtin_abort(tls)
 50704  		}
 50705  	}()
 50706  	_pIn3 = elem25(_aMem, uintptr(_pOp.Xp3))
 50707  	if (int32(_pIn3.Xflags) & int32(14)) == int32(2) {
 50708  		_applyNumericAffinity(tls, _pIn3, int32(0))
 50709  	}
 50710  	_303_iKey = _sqlite3VdbeIntValue(tls, _pIn3)
 50711  	if (int32(_pIn3.Xflags) & int32(4)) != int32(0) {
 50712  		goto _1131
 50713  	}
 50714  	if (int32(_pIn3.Xflags) & int32(8)) == int32(0) {
 50715  		goto _jump_to_p2
 50716  	}
 50717  	if (*(*float64)(unsafe.Pointer(&_pIn3.Xu))) >= float64(_303_iKey) {
 50718  		goto _1133
 50719  	}
 50720  
 50721  	if (_303_oc & int32(1)) == int32(1) {
 50722  		_303_oc -= 1
 50723  	}
 50724  	goto _1136
 50725  _1133:
 50726  	if (*(*float64)(unsafe.Pointer(&_pIn3.Xu))) <= float64(_303_iKey) {
 50727  		goto _1136
 50728  	}
 50729  
 50730  	if (_303_oc & int32(1)) == int32(0) {
 50731  		_303_oc += 1
 50732  	}
 50733  _1136:
 50734  _1131:
 50735  	_rc = _sqlite3BtreeMovetoUnpacked(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_303_pC.Xuc))), nil, int64(uint64(_303_iKey)), int32(0), &_303_res)
 50736  	_303_pC.XmovetoTarget = _303_iKey
 50737  	if _rc != int32(0) {
 50738  		goto _abort_due_to_error
 50739  	}
 50740  	goto _1139
 50741  _1126:
 50742  	if _sqlite3BtreeCursorHasHint(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_303_pC.Xuc))), uint32(2)) != 0 {
 50743  		_303_eqOnly = int32(1)
 50744  		func() {
 50745  			if int32(_pOp.Xopcode) != int32(26) && int32(_pOp.Xopcode) != int32(25) {
 50746  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82221), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66095)))
 50747  				crt.X__builtin_abort(tls)
 50748  			}
 50749  		}()
 50750  		func() {
 50751  			if int32(elem61(_pOp, uintptr(1)).Xopcode) != int32(40) && int32(elem61(_pOp, uintptr(1)).Xopcode) != int32(39) {
 50752  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82222), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66144)))
 50753  				crt.X__builtin_abort(tls)
 50754  			}
 50755  		}()
 50756  		func() {
 50757  			if (elem61(_pOp, uintptr(1)).Xp1) != (elem61(_pOp, 0).Xp1) {
 50758  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82223), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66195)))
 50759  				crt.X__builtin_abort(tls)
 50760  			}
 50761  		}()
 50762  		func() {
 50763  			if (elem61(_pOp, uintptr(1)).Xp2) != (elem61(_pOp, 0).Xp2) {
 50764  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82224), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66216)))
 50765  				crt.X__builtin_abort(tls)
 50766  			}
 50767  		}()
 50768  		func() {
 50769  			if (elem61(_pOp, uintptr(1)).Xp3) != (elem61(_pOp, 0).Xp3) {
 50770  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82225), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66237)))
 50771  				crt.X__builtin_abort(tls)
 50772  			}
 50773  		}()
 50774  		func() {
 50775  			if (*(*int32)(unsafe.Pointer(&(elem61(_pOp, uintptr(1)).Xp4)))) != (*(*int32)(unsafe.Pointer(&(elem61(_pOp, 0).Xp4)))) {
 50776  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82226), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66258)))
 50777  				crt.X__builtin_abort(tls)
 50778  			}
 50779  		}()
 50780  	}
 50781  	_303_nField = *(*int32)(unsafe.Pointer(&_pOp.Xp4))
 50782  	func() {
 50783  		if int32(_pOp.Xp4type) != int32(-11) {
 50784  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82230), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66283)))
 50785  			crt.X__builtin_abort(tls)
 50786  		}
 50787  	}()
 50788  	func() {
 50789  		if _303_nField <= int32(0) {
 50790  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82231), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66305)))
 50791  			crt.X__builtin_abort(tls)
 50792  		}
 50793  	}()
 50794  	*(**XKeyInfo)(unsafe.Pointer(&_303_r.XpKeyInfo)) = (*XKeyInfo)(_303_pC.XpKeyInfo)
 50795  	_303_r.XnField = uint16(_303_nField)
 50796  	_303_r.Xdefault_rc = int8(func() int32 {
 50797  		if (int32(1) & (_303_oc - int32(24))) != 0 {
 50798  			return int32(-1)
 50799  		}
 50800  		return int32(1)
 50801  	}())
 50802  	func() {
 50803  		if _303_oc == int32(27) && int32(_303_r.Xdefault_rc) != int32(-1) {
 50804  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82243), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66314)))
 50805  			crt.X__builtin_abort(tls)
 50806  		}
 50807  	}()
 50808  	func() {
 50809  		if _303_oc == int32(25) && int32(_303_r.Xdefault_rc) != int32(-1) {
 50810  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82244), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66348)))
 50811  			crt.X__builtin_abort(tls)
 50812  		}
 50813  	}()
 50814  	func() {
 50815  		if _303_oc == int32(26) && int32(_303_r.Xdefault_rc) != int32(1) {
 50816  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82245), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66382)))
 50817  			crt.X__builtin_abort(tls)
 50818  		}
 50819  	}()
 50820  	func() {
 50821  		if _303_oc == int32(24) && int32(_303_r.Xdefault_rc) != int32(1) {
 50822  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82246), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66416)))
 50823  			crt.X__builtin_abort(tls)
 50824  		}
 50825  	}()
 50826  	*(**XMem)(unsafe.Pointer(&_303_r.XaMem)) = elem25(_aMem, uintptr(_pOp.Xp3))
 50827  	_313_i = int32(0)
 50828  _1173:
 50829  	if _313_i >= int32(_303_r.XnField) {
 50830  		goto _1176
 50831  	}
 50832  	func() {
 50833  		if (int32(elem25((*XMem)(_303_r.XaMem), uintptr(_313_i)).Xflags) & int32(128)) != int32(0) {
 50834  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82250), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66450)))
 50835  			crt.X__builtin_abort(tls)
 50836  		}
 50837  	}()
 50838  	_313_i += 1
 50839  	goto _1173
 50840  _1176:
 50841  	_303_r.XeqSeen = 0
 50842  	_rc = _sqlite3BtreeMovetoUnpacked(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_303_pC.Xuc))), &_303_r, 0, int32(0), &_303_res)
 50843  	if _rc != int32(0) {
 50844  		goto _abort_due_to_error
 50845  	}
 50846  	if _303_eqOnly != 0 && (int32(_303_r.XeqSeen) == int32(0)) {
 50847  		func() {
 50848  			if _303_res == int32(0) {
 50849  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82258), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66473)))
 50850  				crt.X__builtin_abort(tls)
 50851  			}
 50852  		}()
 50853  		goto _seek_not_found
 50854  	}
 50855  _1139:
 50856  	_303_pC.XdeferredMoveto = 0
 50857  	_303_pC.XcacheStatus = 0
 50858  	if _303_oc < int32(26) {
 50859  		goto _1184
 50860  	}
 50861  	func() {
 50862  		if _303_oc != int32(26) && _303_oc != int32(27) {
 50863  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82267), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66480)))
 50864  			crt.X__builtin_abort(tls)
 50865  		}
 50866  	}()
 50867  	if _303_res >= int32(0) && (_303_res != int32(0) || _303_oc != int32(27)) {
 50868  		goto _1190
 50869  	}
 50870  	_303_res = int32(0)
 50871  	_rc = _sqlite3BtreeNext(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_303_pC.Xuc))), &_303_res)
 50872  	if _rc != int32(0) {
 50873  		goto _abort_due_to_error
 50874  	}
 50875  	goto _1192
 50876  _1190:
 50877  	_303_res = int32(0)
 50878  _1192:
 50879  	goto _seek_not_found
 50880  _1184:
 50881  	func() {
 50882  		if _303_oc != int32(24) && _303_oc != int32(25) {
 50883  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82276), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66511)))
 50884  			crt.X__builtin_abort(tls)
 50885  		}
 50886  	}()
 50887  	if _303_res <= int32(0) && (_303_res != int32(0) || _303_oc != int32(24)) {
 50888  		goto _1199
 50889  	}
 50890  	_303_res = int32(0)
 50891  	_rc = _sqlite3BtreePrevious(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_303_pC.Xuc))), &_303_res)
 50892  	if _rc != int32(0) {
 50893  		goto _abort_due_to_error
 50894  	}
 50895  	goto _1201
 50896  _1199:
 50897  	_303_res = _sqlite3BtreeEof(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_303_pC.Xuc))))
 50898  _1201:
 50899  _seek_not_found:
 50900  	func() {
 50901  		if _pOp.Xp2 <= int32(0) {
 50902  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82289), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61037)))
 50903  			crt.X__builtin_abort(tls)
 50904  		}
 50905  	}()
 50906  	if _303_res != 0 {
 50907  		goto _jump_to_p2
 50908  	}
 50909  	if _303_eqOnly != 0 {
 50910  		func() {
 50911  			if int32(elem61(_pOp, uintptr(1)).Xopcode) != int32(40) && int32(elem61(_pOp, uintptr(1)).Xopcode) != int32(39) {
 50912  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82294), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66144)))
 50913  				crt.X__builtin_abort(tls)
 50914  			}
 50915  		}()
 50916  		*(*uintptr)(unsafe.Pointer(&_pOp)) += uintptr(24)
 50917  	}
 50918  	goto _250
 50919  _163:
 50920  	func() {
 50921  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 50922  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82375), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 50923  			crt.X__builtin_abort(tls)
 50924  		}
 50925  	}()
 50926  	func() {
 50927  		if int32(_pOp.Xp4type) != int32(-11) {
 50928  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82376), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66283)))
 50929  			crt.X__builtin_abort(tls)
 50930  		}
 50931  	}()
 50932  	_324_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 50933  	func() {
 50934  		if _324_pC == nil {
 50935  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82378), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 50936  			crt.X__builtin_abort(tls)
 50937  		}
 50938  	}()
 50939  	_324_pC.XseekOp = _pOp.Xopcode
 50940  	_pIn3 = elem25(_aMem, uintptr(_pOp.Xp3))
 50941  	func() {
 50942  		if int32(_324_pC.XeCurType) != int32(0) {
 50943  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82383), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 50944  			crt.X__builtin_abort(tls)
 50945  		}
 50946  	}()
 50947  	func() {
 50948  		if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_324_pC.Xuc))) == nil {
 50949  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82384), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66003)))
 50950  			crt.X__builtin_abort(tls)
 50951  		}
 50952  	}()
 50953  	func() {
 50954  		if int32(_324_pC.XisTable) != int32(0) {
 50955  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82385), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66542)))
 50956  			crt.X__builtin_abort(tls)
 50957  		}
 50958  	}()
 50959  	if (*(*int32)(unsafe.Pointer(&_pOp.Xp4))) <= int32(0) {
 50960  		goto _1223
 50961  	}
 50962  	*(**XKeyInfo)(unsafe.Pointer(&_324_r.XpKeyInfo)) = (*XKeyInfo)(_324_pC.XpKeyInfo)
 50963  	_324_r.XnField = uint16(*(*int32)(unsafe.Pointer(&_pOp.Xp4)))
 50964  	*(**XMem)(unsafe.Pointer(&_324_r.XaMem)) = _pIn3
 50965  	_324_ii = int32(0)
 50966  _1224:
 50967  	if _324_ii >= int32(_324_r.XnField) {
 50968  		goto _1227
 50969  	}
 50970  	func() {
 50971  		if (int32(elem25((*XMem)(_324_r.XaMem), uintptr(_324_ii)).Xflags) & int32(128)) != int32(0) {
 50972  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82392), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66557)))
 50973  			crt.X__builtin_abort(tls)
 50974  		}
 50975  	}()
 50976  	func() {
 50977  		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) {
 50978  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82393), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66581)))
 50979  			crt.X__builtin_abort(tls)
 50980  		}
 50981  	}()
 50982  	if _324_ii == 0 {
 50983  		goto _1234
 50984  	}
 50985  	if (_db.Xflags & int32(1)) != 0 {
 50986  		_registerTrace(tls, _pOp.Xp3+_324_ii, elem25((*XMem)(_324_r.XaMem), uintptr(_324_ii)))
 50987  	}
 50988  _1234:
 50989  	_324_ii += 1
 50990  	goto _1224
 50991  _1227:
 50992  	_324_pIdxKey = &_324_r
 50993  	_324_pFree = nil
 50994  	goto _1235
 50995  _1223:
 50996  	func() {
 50997  		if (int32(_pIn3.Xflags) & int32(16)) == 0 {
 50998  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82400), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66633)))
 50999  			crt.X__builtin_abort(tls)
 51000  		}
 51001  	}()
 51002  	_rc = func() int32 {
 51003  		if (int32(_pIn3.Xflags) & int32(16384)) != 0 {
 51004  			return _sqlite3VdbeMemExpandBlob(tls, _pIn3)
 51005  		}
 51006  		return int32(0)
 51007  	}()
 51008  	func() {
 51009  		if _rc != int32(0) && _rc != int32(7) {
 51010  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82402), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(5706)))
 51011  			crt.X__builtin_abort(tls)
 51012  		}
 51013  	}()
 51014  	if _rc != 0 {
 51015  		goto _no_mem
 51016  	}
 51017  	_324_pFree = store83(&_324_pIdxKey, _sqlite3VdbeAllocUnpackedRecord(tls, (*XKeyInfo)(_324_pC.XpKeyInfo)))
 51018  	if _324_pIdxKey == nil {
 51019  		goto _no_mem
 51020  	}
 51021  	_sqlite3VdbeRecordUnpack(tls, (*XKeyInfo)(_324_pC.XpKeyInfo), _pIn3.Xn, unsafe.Pointer(_pIn3.Xz), _324_pIdxKey)
 51022  _1235:
 51023  	_324_pIdxKey.Xdefault_rc = 0
 51024  	_324_takeJump = int32(0)
 51025  	if int32(_pOp.Xopcode) != int32(28) {
 51026  		goto _1245
 51027  	}
 51028  	_324_ii = int32(0)
 51029  _1246:
 51030  	if _324_ii >= int32(_324_pIdxKey.XnField) {
 51031  		goto _1249
 51032  	}
 51033  	if (int32(elem25((*XMem)(_324_pIdxKey.XaMem), uintptr(_324_ii)).Xflags) & int32(1)) != 0 {
 51034  		_324_takeJump = int32(1)
 51035  		goto _1249
 51036  	}
 51037  	_324_ii += 1
 51038  	goto _1246
 51039  _1249:
 51040  _1245:
 51041  	_rc = _sqlite3BtreeMovetoUnpacked(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_324_pC.Xuc))), _324_pIdxKey, 0, int32(0), &_324_res)
 51042  	if _324_pFree != nil {
 51043  		_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_324_pFree))
 51044  	}
 51045  	if _rc != int32(0) {
 51046  		goto _abort_due_to_error
 51047  	}
 51048  	_324_pC.XseekResult = _324_res
 51049  	_324_alreadyExists = bool2int(_324_res == int32(0))
 51050  	_324_pC.XnullRow = uint8(int32(1) - _324_alreadyExists)
 51051  	_324_pC.XdeferredMoveto = 0
 51052  	_324_pC.XcacheStatus = 0
 51053  	if int32(_pOp.Xopcode) != int32(30) {
 51054  		goto _1253
 51055  	}
 51056  	if _324_alreadyExists != 0 {
 51057  		goto _jump_to_p2
 51058  	}
 51059  	goto _1255
 51060  _1253:
 51061  	if _324_takeJump != 0 || (_324_alreadyExists == 0) {
 51062  		goto _jump_to_p2
 51063  	}
 51064  _1255:
 51065  	goto _250
 51066  _166:
 51067  	_pIn3 = elem25(_aMem, uintptr(_pOp.Xp3))
 51068  	if (int32(_pIn3.Xflags) & int32(4)) != int32(0) {
 51069  		goto _1258
 51070  	}
 51071  	_applyAffinity(tls, _pIn3, int8(67), _encoding)
 51072  	if (int32(_pIn3.Xflags) & int32(4)) == int32(0) {
 51073  		goto _jump_to_p2
 51074  	}
 51075  _1258:
 51076  	_pIn3 = elem25(_aMem, uintptr(_pOp.Xp3))
 51077  	func() {
 51078  		if (int32(_pIn3.Xflags) & int32(4)) == 0 {
 51079  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82502), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61948)))
 51080  			crt.X__builtin_abort(tls)
 51081  		}
 51082  	}()
 51083  	func() {
 51084  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51085  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82503), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51086  			crt.X__builtin_abort(tls)
 51087  		}
 51088  	}()
 51089  	_334_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51090  	func() {
 51091  		if _334_pC == nil {
 51092  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82505), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 51093  			crt.X__builtin_abort(tls)
 51094  		}
 51095  	}()
 51096  	_334_pC.XseekOp = 0
 51097  	func() {
 51098  		if _334_pC.XisTable == 0 {
 51099  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82509), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66656)))
 51100  			crt.X__builtin_abort(tls)
 51101  		}
 51102  	}()
 51103  	func() {
 51104  		if int32(_334_pC.XeCurType) != int32(0) {
 51105  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82510), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 51106  			crt.X__builtin_abort(tls)
 51107  		}
 51108  	}()
 51109  	_334_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_334_pC.Xuc)))
 51110  	func() {
 51111  		if _334_pCrsr == nil {
 51112  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82512), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66668)))
 51113  			crt.X__builtin_abort(tls)
 51114  		}
 51115  	}()
 51116  	_334_res = int32(0)
 51117  	_334_iKey = uint64(*(*int64)(unsafe.Pointer(&_pIn3.Xu)))
 51118  	_rc = _sqlite3BtreeMovetoUnpacked(tls, _334_pCrsr, nil, int64(_334_iKey), int32(0), &_334_res)
 51119  	func() {
 51120  		if _rc != int32(0) && _334_res != int32(0) {
 51121  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82516), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66677)))
 51122  			crt.X__builtin_abort(tls)
 51123  		}
 51124  	}()
 51125  	_334_pC.XmovetoTarget = int64(_334_iKey)
 51126  	_334_pC.XnullRow = 0
 51127  	_334_pC.XcacheStatus = 0
 51128  	_334_pC.XdeferredMoveto = 0
 51129  	_334_pC.XseekResult = _334_res
 51130  	if _334_res == int32(0) {
 51131  		goto _1276
 51132  	}
 51133  	func() {
 51134  		if _rc != int32(0) {
 51135  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82524), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(14967)))
 51136  			crt.X__builtin_abort(tls)
 51137  		}
 51138  	}()
 51139  	if _pOp.Xp2 == int32(0) {
 51140  		_rc = _sqlite3CorruptError(tls, int32(82526))
 51141  		goto _1280
 51142  	}
 51143  	goto _jump_to_p2
 51144  _1280:
 51145  _1276:
 51146  	if _rc != 0 {
 51147  		goto _abort_due_to_error
 51148  	}
 51149  	goto _250
 51150  _168:
 51151  	func() {
 51152  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51153  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82544), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51154  			crt.X__builtin_abort(tls)
 51155  		}
 51156  	}()
 51157  	func() {
 51158  		if (*elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))) == nil {
 51159  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82545), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63716)))
 51160  			crt.X__builtin_abort(tls)
 51161  		}
 51162  	}()
 51163  	func() {
 51164  		if int32((*elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))).XeCurType) == int32(2) {
 51165  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82546), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66701)))
 51166  			crt.X__builtin_abort(tls)
 51167  		}
 51168  	}()
 51169  	_pOut = _out2Prerelease(tls, _p, _pOp)
 51170  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = postInc35(&((*elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))).XseqCount), 1)
 51171  	goto _250
 51172  _169:
 51173  	_340_v = 0
 51174  	_340_res = int32(0)
 51175  	_pOut = _out2Prerelease(tls, _p, _pOp)
 51176  	func() {
 51177  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51178  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82579), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51179  			crt.X__builtin_abort(tls)
 51180  		}
 51181  	}()
 51182  	_340_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51183  	func() {
 51184  		if _340_pC == nil {
 51185  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82581), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 51186  			crt.X__builtin_abort(tls)
 51187  		}
 51188  	}()
 51189  	func() {
 51190  		if int32(_340_pC.XeCurType) != int32(0) {
 51191  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82582), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 51192  			crt.X__builtin_abort(tls)
 51193  		}
 51194  	}()
 51195  	func() {
 51196  		if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_340_pC.Xuc))) == nil {
 51197  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82583), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66003)))
 51198  			crt.X__builtin_abort(tls)
 51199  		}
 51200  	}()
 51201  	func() {
 51202  		if _340_pC.XisTable == 0 {
 51203  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82598), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66656)))
 51204  			crt.X__builtin_abort(tls)
 51205  		}
 51206  	}()
 51207  	if ((uint32(_340_pC.XisEphemeral>>1) << 31) >> 31) != 0 {
 51208  		goto _1300
 51209  	}
 51210  	_rc = _sqlite3BtreeLast(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_340_pC.Xuc))), &_340_res)
 51211  	if _rc != int32(0) {
 51212  		goto _abort_due_to_error
 51213  	}
 51214  	if _340_res != 0 {
 51215  		_340_v = int64(1)
 51216  		goto _1303
 51217  	}
 51218  	func() {
 51219  		if _sqlite3BtreeCursorIsValid(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_340_pC.Xuc)))) == 0 {
 51220  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82618), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66743)))
 51221  			crt.X__builtin_abort(tls)
 51222  		}
 51223  	}()
 51224  	_340_v = _sqlite3BtreeIntegerKey(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_340_pC.Xuc))))
 51225  	if _340_v >= int64(9223372036854775807) {
 51226  		storebits5(&_340_pC.XisEphemeral, int8(1), 2, 1)
 51227  		goto _1307
 51228  	}
 51229  	_340_v += 1
 51230  _1307:
 51231  _1303:
 51232  _1300:
 51233  	if _pOp.Xp3 == 0 {
 51234  		goto _1308
 51235  	}
 51236  	func() {
 51237  		if _pOp.Xp3 <= int32(0) {
 51238  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82631), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61154)))
 51239  			crt.X__builtin_abort(tls)
 51240  		}
 51241  	}()
 51242  	if _p.XpFrame == nil {
 51243  		goto _1311
 51244  	}
 51245  	_340_pFrame = (*XVdbeFrame)(_p.XpFrame)
 51246  _1312:
 51247  	if _340_pFrame.XpParent == nil {
 51248  		goto _1315
 51249  	}
 51250  	_340_pFrame = (*XVdbeFrame)(_340_pFrame.XpParent)
 51251  	goto _1312
 51252  _1315:
 51253  	func() {
 51254  		if _pOp.Xp3 > _340_pFrame.XnMem {
 51255  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82635), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66785)))
 51256  			crt.X__builtin_abort(tls)
 51257  		}
 51258  	}()
 51259  	_340_pMem = elem25((*XMem)(_340_pFrame.XaMem), uintptr(_pOp.Xp3))
 51260  	goto _1318
 51261  _1311:
 51262  	func() {
 51263  		if _pOp.Xp3 > ((_p.XnMem + int32(1)) - _p.XnCursor) {
 51264  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82639), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61164)))
 51265  			crt.X__builtin_abort(tls)
 51266  		}
 51267  	}()
 51268  	_340_pMem = elem25(_aMem, uintptr(_pOp.Xp3))
 51269  	_sqlite3VdbeMemAboutToChange(tls, _p, _340_pMem)
 51270  _1318:
 51271  	func() {
 51272  		if (int32(_340_pMem.Xflags) & int32(128)) != int32(0) {
 51273  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82643), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66807)))
 51274  			crt.X__builtin_abort(tls)
 51275  		}
 51276  	}()
 51277  	if (_db.Xflags & int32(1)) != 0 {
 51278  		_registerTrace(tls, _pOp.Xp3, _340_pMem)
 51279  	}
 51280  	_sqlite3VdbeMemIntegerify(tls, _340_pMem)
 51281  	func() {
 51282  		if (int32(_340_pMem.Xflags) & int32(4)) == int32(0) {
 51283  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82647), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66824)))
 51284  			crt.X__builtin_abort(tls)
 51285  		}
 51286  	}()
 51287  	if ((*(*int64)(unsafe.Pointer(&_340_pMem.Xu))) == int64(9223372036854775807)) || (((uint32(_340_pC.XisEphemeral>>1) << 31) >> 31) != 0) {
 51288  		_rc = int32(13)
 51289  		goto _abort_due_to_error
 51290  	}
 51291  	if _340_v < ((*(*int64)(unsafe.Pointer(&_340_pMem.Xu))) + int64(1)) {
 51292  		_340_v = (*(*int64)(unsafe.Pointer(&_340_pMem.Xu))) + int64(1)
 51293  	}
 51294  	*(*int64)(unsafe.Pointer(&_340_pMem.Xu)) = _340_v
 51295  _1308:
 51296  	if ((uint32(_340_pC.XisEphemeral>>1) << 31) >> 31) == 0 {
 51297  		goto _1329
 51298  	}
 51299  	func() {
 51300  		if _pOp.Xp3 != int32(0) {
 51301  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82663), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66851)))
 51302  			crt.X__builtin_abort(tls)
 51303  		}
 51304  	}()
 51305  	_340_cnt = int32(0)
 51306  _1332:
 51307  	Xsqlite3_randomness(tls, int32(8), unsafe.Pointer(&_340_v))
 51308  	_340_v &= int64(4611686018427387903)
 51309  	_340_v += 1
 51310  	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)) {
 51311  		goto _1332
 51312  	}
 51313  	if _rc != 0 {
 51314  		goto _abort_due_to_error
 51315  	}
 51316  	if _340_res == int32(0) {
 51317  		_rc = int32(13)
 51318  		goto _abort_due_to_error
 51319  	}
 51320  	func() {
 51321  		if _340_v <= (0) {
 51322  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82678), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66862)))
 51323  			crt.X__builtin_abort(tls)
 51324  		}
 51325  	}()
 51326  _1329:
 51327  	_340_pC.XdeferredMoveto = 0
 51328  	_340_pC.XcacheStatus = 0
 51329  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = _340_v
 51330  	goto _250
 51331  _170:
 51332  	_356_op = int32(0)
 51333  	_356_pData = elem25(_aMem, uintptr(_pOp.Xp2))
 51334  	func() {
 51335  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51336  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82743), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51337  			crt.X__builtin_abort(tls)
 51338  		}
 51339  	}()
 51340  	func() {
 51341  		if (int32(_356_pData.Xflags) & int32(128)) != int32(0) {
 51342  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82744), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66866)))
 51343  			crt.X__builtin_abort(tls)
 51344  		}
 51345  	}()
 51346  	_356_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51347  	func() {
 51348  		if _356_pC == nil {
 51349  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82746), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 51350  			crt.X__builtin_abort(tls)
 51351  		}
 51352  	}()
 51353  	func() {
 51354  		if int32(_356_pC.XeCurType) != int32(0) {
 51355  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82747), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 51356  			crt.X__builtin_abort(tls)
 51357  		}
 51358  	}()
 51359  	func() {
 51360  		if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_356_pC.Xuc))) == nil {
 51361  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82748), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66003)))
 51362  			crt.X__builtin_abort(tls)
 51363  		}
 51364  	}()
 51365  	func() {
 51366  		if (int32(_pOp.Xp5)&int32(64)) == 0 && _356_pC.XisTable == 0 {
 51367  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82749), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66884)))
 51368  			crt.X__builtin_abort(tls)
 51369  		}
 51370  	}()
 51371  	func() {
 51372  		if int32(_pOp.Xp4type) != int32(-15) && int32(_pOp.Xp4type) < int32(-2) {
 51373  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82750), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66925)))
 51374  			crt.X__builtin_abort(tls)
 51375  		}
 51376  	}()
 51377  	if (_db.Xflags & int32(1)) != 0 {
 51378  		_registerTrace(tls, _pOp.Xp2, _356_pData)
 51379  	}
 51380  	if int32(_pOp.Xopcode) != int32(118) {
 51381  		goto _1357
 51382  	}
 51383  	_356_pKey = elem25(_aMem, uintptr(_pOp.Xp3))
 51384  	func() {
 51385  		if (int32(_356_pKey.Xflags) & int32(4)) == 0 {
 51386  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82755), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66973)))
 51387  			crt.X__builtin_abort(tls)
 51388  		}
 51389  	}()
 51390  	func() {
 51391  		if (int32(_356_pKey.Xflags) & int32(128)) != int32(0) {
 51392  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82756), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66995)))
 51393  			crt.X__builtin_abort(tls)
 51394  		}
 51395  	}()
 51396  	if (_db.Xflags & int32(1)) != 0 {
 51397  		_registerTrace(tls, _pOp.Xp3, _356_pKey)
 51398  	}
 51399  	_356_x.XnKey = *(*int64)(unsafe.Pointer(&_356_pKey.Xu))
 51400  	goto _1363
 51401  _1357:
 51402  	func() {
 51403  		if int32(_pOp.Xopcode) != int32(119) {
 51404  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82760), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67012)))
 51405  			crt.X__builtin_abort(tls)
 51406  		}
 51407  	}()
 51408  	_356_x.XnKey = int64(_pOp.Xp3)
 51409  _1363:
 51410  	if (int32(_pOp.Xp4type) == int32(-15)) && (_db.XxUpdateCallback != nil) {
 51411  		func() {
 51412  			if int32(_356_pC.XiDb) < int32(0) {
 51413  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82765), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67038)))
 51414  				crt.X__builtin_abort(tls)
 51415  			}
 51416  		}()
 51417  		_356_zDb = elem27((*XDb)(_db.XaDb), uintptr(_356_pC.XiDb)).XzDbSName
 51418  		_356_pTab = (*XTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 51419  		func() {
 51420  			if (int32(_pOp.Xp5)&int32(64)) == 0 && (_356_pTab.XtabFlags&uint32(32)) != (0) {
 51421  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82768), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67049)))
 51422  				crt.X__builtin_abort(tls)
 51423  			}
 51424  		}()
 51425  		_356_op = func() int32 {
 51426  			if (int32(_pOp.Xp5) & int32(4)) != 0 {
 51427  				return int32(23)
 51428  			}
 51429  			return int32(18)
 51430  		}()
 51431  		goto _1375
 51432  	}
 51433  	_356_pTab = nil
 51434  	_356_zDb = nil
 51435  _1375:
 51436  	if (int32(_pOp.Xp5) & int32(1)) != 0 {
 51437  		_p.XnChange += 1
 51438  	}
 51439  	if (int32(_pOp.Xp5) & int32(32)) != 0 {
 51440  		_db.XlastRowid = _356_x.XnKey
 51441  	}
 51442  	if (int32(_356_pData.Xflags) & int32(1)) != 0 {
 51443  		_356_x.XpData = nil
 51444  		_356_x.XnData = int32(0)
 51445  		goto _1379
 51446  	}
 51447  	func() {
 51448  		if (int32(_356_pData.Xflags) & int32(18)) == 0 {
 51449  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82792), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67093)))
 51450  			crt.X__builtin_abort(tls)
 51451  		}
 51452  	}()
 51453  	_356_x.XpData = unsafe.Pointer(_356_pData.Xz)
 51454  	_356_x.XnData = _356_pData.Xn
 51455  _1379:
 51456  	_356_seekResult = func() int32 {
 51457  		if (int32(_pOp.Xp5) & int32(16)) != 0 {
 51458  			return _356_pC.XseekResult
 51459  		}
 51460  		return int32(0)
 51461  	}()
 51462  	if (int32(_356_pData.Xflags) & int32(16384)) != 0 {
 51463  		_356_x.XnZero = *(*int32)(unsafe.Pointer(&_356_pData.Xu))
 51464  		goto _1385
 51465  	}
 51466  	_356_x.XnZero = int32(0)
 51467  _1385:
 51468  	_356_x.XpKey = nil
 51469  	_rc = _sqlite3BtreeInsert(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_356_pC.Xuc))), &_356_x, int32(_pOp.Xp5)&int32(10), _356_seekResult)
 51470  	_356_pC.XdeferredMoveto = 0
 51471  	_356_pC.XcacheStatus = 0
 51472  	if _rc != 0 {
 51473  		goto _abort_due_to_error
 51474  	}
 51475  	if (_db.XxUpdateCallback != nil) && _356_op != 0 {
 51476  		_db.XxUpdateCallback(tls, _db.XpUpdateArg, _356_op, _356_zDb, _356_pTab.XzName, _356_x.XnKey)
 51477  	}
 51478  	goto _250
 51479  _172:
 51480  	_366_opflags = _pOp.Xp2
 51481  	func() {
 51482  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51483  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82859), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51484  			crt.X__builtin_abort(tls)
 51485  		}
 51486  	}()
 51487  	_366_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51488  	func() {
 51489  		if _366_pC == nil {
 51490  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82861), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 51491  			crt.X__builtin_abort(tls)
 51492  		}
 51493  	}()
 51494  	func() {
 51495  		if int32(_366_pC.XeCurType) != int32(0) {
 51496  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82862), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 51497  			crt.X__builtin_abort(tls)
 51498  		}
 51499  	}()
 51500  	func() {
 51501  		if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_366_pC.Xuc))) == nil {
 51502  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82863), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66003)))
 51503  			crt.X__builtin_abort(tls)
 51504  		}
 51505  	}()
 51506  	func() {
 51507  		if int32(_366_pC.XdeferredMoveto) != int32(0) {
 51508  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82864), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67127)))
 51509  			crt.X__builtin_abort(tls)
 51510  		}
 51511  	}()
 51512  	if ((int32(_pOp.Xp4type) == int32(-15)) && ((((*XTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))).XtabFlags) & uint32(32)) == (0))) && (int32(_pOp.Xp5) == int32(0)) {
 51513  		_367_iKey = _sqlite3BtreeIntegerKey(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_366_pC.Xuc))))
 51514  		func() {
 51515  			if _366_pC.XmovetoTarget != _367_iKey {
 51516  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82872), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67149)))
 51517  				crt.X__builtin_abort(tls)
 51518  			}
 51519  		}()
 51520  	}
 51521  	if int32(_pOp.Xp4type) != int32(-15) || _db.XxUpdateCallback == nil {
 51522  		goto _1406
 51523  	}
 51524  	func() {
 51525  		if int32(_366_pC.XiDb) < int32(0) {
 51526  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82882), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67038)))
 51527  			crt.X__builtin_abort(tls)
 51528  		}
 51529  	}()
 51530  	func() {
 51531  		if (*XTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))) == nil {
 51532  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82883), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67172)))
 51533  			crt.X__builtin_abort(tls)
 51534  		}
 51535  	}()
 51536  	_366_zDb = elem27((*XDb)(_db.XaDb), uintptr(_366_pC.XiDb)).XzDbSName
 51537  	_366_pTab = (*XTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 51538  	if ((int32(_pOp.Xp5) & int32(2)) != int32(0)) && (_366_pC.XisTable != 0) {
 51539  		_366_pC.XmovetoTarget = _sqlite3BtreeIntegerKey(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_366_pC.Xuc))))
 51540  	}
 51541  	goto _1413
 51542  _1406:
 51543  	_366_zDb = nil
 51544  	_366_pTab = nil
 51545  _1413:
 51546  	func() {
 51547  		if (int32(_pOp.Xp5) & int32(-7)) != int32(0) {
 51548  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82911), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67188)))
 51549  			crt.X__builtin_abort(tls)
 51550  		}
 51551  	}()
 51552  
 51553  	if (*XVdbeFrame)(_p.XpFrame) != nil {
 51554  		goto _1416
 51555  	}
 51556  	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)) {
 51557  		_nExtraDelete += 1
 51558  	}
 51559  	if (_pOp.Xp2 & int32(1)) != 0 {
 51560  		_nExtraDelete -= 1
 51561  	}
 51562  _1416:
 51563  	_rc = _sqlite3BtreeDelete(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_366_pC.Xuc))), uint8(_pOp.Xp5))
 51564  	_366_pC.XcacheStatus = 0
 51565  	_366_pC.XseekResult = int32(0)
 51566  	if _rc != 0 {
 51567  		goto _abort_due_to_error
 51568  	}
 51569  	if (_366_opflags & int32(1)) == 0 {
 51570  		goto _1422
 51571  	}
 51572  	_p.XnChange += 1
 51573  	if (_db.XxUpdateCallback != nil) && ((_366_pTab.XtabFlags & uint32(32)) == (0)) {
 51574  		_db.XxUpdateCallback(tls, _db.XpUpdateArg, int32(9), _366_zDb, _366_pTab.XzName, _366_pC.XmovetoTarget)
 51575  		func() {
 51576  			if int32(_366_pC.XiDb) < int32(0) {
 51577  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82940), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67038)))
 51578  				crt.X__builtin_abort(tls)
 51579  			}
 51580  		}()
 51581  	}
 51582  _1422:
 51583  	goto _250
 51584  _173:
 51585  	_sqlite3VdbeSetChanges(tls, _db, _p.XnChange)
 51586  	_p.XnChange = int32(0)
 51587  	goto _250
 51588  _174:
 51589  	_377_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51590  	func() {
 51591  		if int32(_377_pC.XeCurType) != int32(1) {
 51592  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82980), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65943)))
 51593  			crt.X__builtin_abort(tls)
 51594  		}
 51595  	}()
 51596  	func() {
 51597  		if int32(_pOp.Xp4type) != int32(-11) {
 51598  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(82981), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66283)))
 51599  			crt.X__builtin_abort(tls)
 51600  		}
 51601  	}()
 51602  	_pIn3 = elem25(_aMem, uintptr(_pOp.Xp3))
 51603  	_377_nKeyCol = *(*int32)(unsafe.Pointer(&_pOp.Xp4))
 51604  	_377_res = int32(0)
 51605  	_rc = _sqlite3VdbeSorterCompare(tls, _377_pC, _pIn3, _377_nKeyCol, &_377_res)
 51606  	if _rc != 0 {
 51607  		goto _abort_due_to_error
 51608  	}
 51609  	if _377_res != 0 {
 51610  		goto _jump_to_p2
 51611  	}
 51612  	goto _250
 51613  _175:
 51614  	_pOut = elem25(_aMem, uintptr(_pOp.Xp2))
 51615  	_378_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51616  	func() {
 51617  		if int32(_378_pC.XeCurType) != int32(1) {
 51618  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83009), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65943)))
 51619  			crt.X__builtin_abort(tls)
 51620  		}
 51621  	}()
 51622  	_rc = _sqlite3VdbeSorterRowkey(tls, _378_pC, _pOut)
 51623  	func() {
 51624  		if _rc == int32(0) && (int32(_pOut.Xflags)&int32(16)) == 0 {
 51625  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83011), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67243)))
 51626  			crt.X__builtin_abort(tls)
 51627  		}
 51628  	}()
 51629  	func() {
 51630  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51631  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83012), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51632  			crt.X__builtin_abort(tls)
 51633  		}
 51634  	}()
 51635  	if _rc != 0 {
 51636  		goto _abort_due_to_error
 51637  	}
 51638  	(*elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp3))).XcacheStatus = 0
 51639  	goto _250
 51640  _176:
 51641  	_pOut = _out2Prerelease(tls, _p, _pOp)
 51642  	func() {
 51643  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51644  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83053), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51645  			crt.X__builtin_abort(tls)
 51646  		}
 51647  	}()
 51648  	_379_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51649  	func() {
 51650  		if _379_pC == nil {
 51651  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83055), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 51652  			crt.X__builtin_abort(tls)
 51653  		}
 51654  	}()
 51655  	func() {
 51656  		if int32(_379_pC.XeCurType) != int32(0) {
 51657  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83056), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 51658  			crt.X__builtin_abort(tls)
 51659  		}
 51660  	}()
 51661  	func() {
 51662  		if bool2int(int32(_379_pC.XeCurType) == int32(1)) != int32(0) {
 51663  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83057), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67285)))
 51664  			crt.X__builtin_abort(tls)
 51665  		}
 51666  	}()
 51667  	func() {
 51668  		if int32(_379_pC.XnullRow) != int32(0) {
 51669  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83058), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67301)))
 51670  			crt.X__builtin_abort(tls)
 51671  		}
 51672  	}()
 51673  	func() {
 51674  		if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_379_pC.Xuc))) == nil {
 51675  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83059), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66003)))
 51676  			crt.X__builtin_abort(tls)
 51677  		}
 51678  	}()
 51679  	_379_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_379_pC.Xuc)))
 51680  	func() {
 51681  		if int32(_379_pC.XdeferredMoveto) != int32(0) {
 51682  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83070), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67127)))
 51683  			crt.X__builtin_abort(tls)
 51684  		}
 51685  	}()
 51686  	func() {
 51687  		if _sqlite3BtreeCursorIsValid(tls, _379_pCrsr) == 0 {
 51688  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83071), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63955)))
 51689  			crt.X__builtin_abort(tls)
 51690  		}
 51691  	}()
 51692  	_379_n = _sqlite3BtreePayloadSize(tls, _379_pCrsr)
 51693  	if _379_n > uint32(*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), 0)) {
 51694  		goto _too_big
 51695  	}
 51696  	_rc = _sqlite3VdbeMemFromBtree(tls, _379_pCrsr, 0, _379_n, _pOut)
 51697  	if _rc != 0 {
 51698  		goto _abort_due_to_error
 51699  	}
 51700  	if _pOp.Xp3 != 0 {
 51701  		goto _1463
 51702  	}
 51703  	if ((int32(_pOut.Xflags) & int32(4096)) != int32(0)) && _sqlite3VdbeMemMakeWriteable(tls, _pOut) != 0 {
 51704  		goto _no_mem
 51705  	}
 51706  _1463:
 51707  	if (_db.Xflags & int32(1)) != 0 {
 51708  		_registerTrace(tls, _pOp.Xp2, _pOut)
 51709  	}
 51710  	goto _250
 51711  _177:
 51712  	_pOut = _out2Prerelease(tls, _p, _pOp)
 51713  	func() {
 51714  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51715  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83107), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51716  			crt.X__builtin_abort(tls)
 51717  		}
 51718  	}()
 51719  	_382_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51720  	func() {
 51721  		if _382_pC == nil {
 51722  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83109), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 51723  			crt.X__builtin_abort(tls)
 51724  		}
 51725  	}()
 51726  	func() {
 51727  		if int32(_382_pC.XeCurType) == int32(3) && _382_pC.XnullRow == 0 {
 51728  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83110), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63784)))
 51729  			crt.X__builtin_abort(tls)
 51730  		}
 51731  	}()
 51732  	if _382_pC.XnullRow != 0 {
 51733  		_pOut.Xflags = uint16(1)
 51734  		goto _250
 51735  	}
 51736  	if _382_pC.XdeferredMoveto != 0 {
 51737  		_382_v = _382_pC.XmovetoTarget
 51738  		goto _1483
 51739  	}
 51740  	if int32(_382_pC.XeCurType) != int32(2) {
 51741  		goto _1477
 51742  	}
 51743  	func() {
 51744  		if (*Xsqlite3_vtab_cursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_382_pC.Xuc))) == nil {
 51745  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83118), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67316)))
 51746  			crt.X__builtin_abort(tls)
 51747  		}
 51748  	}()
 51749  	_382_pVtab = (*Xsqlite3_vtab)((*Xsqlite3_vtab_cursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_382_pC.Xuc))).XpVtab)
 51750  	_382_pModule = (*Xsqlite3_module)(_382_pVtab.XpModule)
 51751  	func() {
 51752  		if _382_pModule.XxRowid == nil {
 51753  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83121), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67332)))
 51754  			crt.X__builtin_abort(tls)
 51755  		}
 51756  	}()
 51757  	_rc = func() func(*crt.TLS, *Xsqlite3_vtab_cursor, *int64) int32 {
 51758  		v := _382_pModule.XxRowid
 51759  		return *(*func(*crt.TLS, *Xsqlite3_vtab_cursor, *int64) int32)(unsafe.Pointer(&v))
 51760  	}()(tls, (*Xsqlite3_vtab_cursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_382_pC.Xuc))), &_382_v)
 51761  	_sqlite3VtabImportErrmsg(tls, _p, _382_pVtab)
 51762  	if _rc != 0 {
 51763  		goto _abort_due_to_error
 51764  	}
 51765  	goto _1483
 51766  _1477:
 51767  	func() {
 51768  		if int32(_382_pC.XeCurType) != int32(0) {
 51769  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83127), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 51770  			crt.X__builtin_abort(tls)
 51771  		}
 51772  	}()
 51773  	func() {
 51774  		if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_382_pC.Xuc))) == nil {
 51775  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83128), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66003)))
 51776  			crt.X__builtin_abort(tls)
 51777  		}
 51778  	}()
 51779  	_rc = _sqlite3VdbeCursorRestore(tls, _382_pC)
 51780  	if _rc != 0 {
 51781  		goto _abort_due_to_error
 51782  	}
 51783  	if _382_pC.XnullRow != 0 {
 51784  		_pOut.Xflags = uint16(1)
 51785  		goto _250
 51786  	}
 51787  	_382_v = _sqlite3BtreeIntegerKey(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_382_pC.Xuc))))
 51788  _1483:
 51789  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = _382_v
 51790  	goto _250
 51791  _178:
 51792  	func() {
 51793  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51794  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83150), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51795  			crt.X__builtin_abort(tls)
 51796  		}
 51797  	}()
 51798  	_388_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51799  	func() {
 51800  		if _388_pC == nil {
 51801  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83152), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 51802  			crt.X__builtin_abort(tls)
 51803  		}
 51804  	}()
 51805  	_388_pC.XnullRow = uint8(1)
 51806  	_388_pC.XcacheStatus = 0
 51807  	if int32(_388_pC.XeCurType) == int32(0) {
 51808  		func() {
 51809  			if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_388_pC.Xuc))) == nil {
 51810  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83156), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66003)))
 51811  				crt.X__builtin_abort(tls)
 51812  			}
 51813  		}()
 51814  		_sqlite3BtreeClearCursor(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_388_pC.Xuc))))
 51815  	}
 51816  	goto _250
 51817  _179:
 51818  	func() {
 51819  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51820  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83186), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51821  			crt.X__builtin_abort(tls)
 51822  		}
 51823  	}()
 51824  	_390_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51825  	func() {
 51826  		if _390_pC == nil {
 51827  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83188), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 51828  			crt.X__builtin_abort(tls)
 51829  		}
 51830  	}()
 51831  	func() {
 51832  		if int32(_390_pC.XeCurType) != int32(0) {
 51833  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83189), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 51834  			crt.X__builtin_abort(tls)
 51835  		}
 51836  	}()
 51837  	_390_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_390_pC.Xuc)))
 51838  	_390_res = int32(0)
 51839  	func() {
 51840  		if _390_pCrsr == nil {
 51841  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83192), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66668)))
 51842  			crt.X__builtin_abort(tls)
 51843  		}
 51844  	}()
 51845  	_390_pC.XseekResult = _pOp.Xp3
 51846  	_390_pC.XseekOp = uint8(33)
 51847  	if _pOp.Xp3 != int32(0) && _sqlite3BtreeCursorIsValidNN(tls, _390_pCrsr) != 0 {
 51848  		goto _1508
 51849  	}
 51850  	_rc = _sqlite3BtreeLast(tls, _390_pCrsr, &_390_res)
 51851  	_390_pC.XnullRow = uint8(_390_res)
 51852  	_390_pC.XdeferredMoveto = 0
 51853  	_390_pC.XcacheStatus = 0
 51854  	if _rc != 0 {
 51855  		goto _abort_due_to_error
 51856  	}
 51857  	if _pOp.Xp2 <= int32(0) {
 51858  		goto _1510
 51859  	}
 51860  	if _390_res != 0 {
 51861  		goto _jump_to_p2
 51862  	}
 51863  _1510:
 51864  	goto _1512
 51865  _1508:
 51866  	func() {
 51867  		if _pOp.Xp2 != int32(0) {
 51868  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83208), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67348)))
 51869  			crt.X__builtin_abort(tls)
 51870  		}
 51871  	}()
 51872  _1512:
 51873  	goto _250
 51874  _180:
 51875  	func() {
 51876  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51877  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83224), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51878  			crt.X__builtin_abort(tls)
 51879  		}
 51880  	}()
 51881  	_394_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51882  	func() {
 51883  		if _394_pC == nil {
 51884  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83226), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 51885  			crt.X__builtin_abort(tls)
 51886  		}
 51887  	}()
 51888  	_394_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_394_pC.Xuc)))
 51889  	func() {
 51890  		if _394_pCrsr == nil {
 51891  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83228), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63949)))
 51892  			crt.X__builtin_abort(tls)
 51893  		}
 51894  	}()
 51895  	_rc = _sqlite3BtreeFirst(tls, _394_pCrsr, &_394_res)
 51896  	if _rc != 0 {
 51897  		goto _abort_due_to_error
 51898  	}
 51899  	if _394_res != int32(0) {
 51900  		goto _1523
 51901  	}
 51902  	_394_sz = _sqlite3BtreeRowCountEst(tls, _394_pCrsr)
 51903  	if func() int32 {
 51904  		if _394_sz >= (0) {
 51905  			return int32(1)
 51906  		}
 51907  		return func() int32 {
 51908  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83233), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(4809)))
 51909  			crt.X__builtin_abort(tls)
 51910  			return int32(0)
 51911  		}()
 51912  	}() != 0 && (int32(_sqlite3LogEst(tls, uint64(_394_sz))) < _pOp.Xp3) {
 51913  		_394_res = int32(1)
 51914  	}
 51915  _1523:
 51916  	if _394_res != 0 {
 51917  		goto _jump_to_p2
 51918  	}
 51919  	goto _250
 51920  _181:
 51921  	*elem7((*uint32)(unsafe.Pointer(&_p.XaCounter)), uintptr(2)) += 1
 51922  _183:
 51923  	func() {
 51924  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51925  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83288), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51926  			crt.X__builtin_abort(tls)
 51927  		}
 51928  	}()
 51929  	_397_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51930  	func() {
 51931  		if _397_pC == nil {
 51932  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83290), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 51933  			crt.X__builtin_abort(tls)
 51934  		}
 51935  	}()
 51936  	func() {
 51937  		if (int32(_397_pC.XeCurType) == int32(1)) != (int32(_pOp.Xopcode) == int32(35)) {
 51938  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83291), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67359)))
 51939  			crt.X__builtin_abort(tls)
 51940  		}
 51941  	}()
 51942  	_397_res = int32(1)
 51943  	_397_pC.XseekOp = uint8(37)
 51944  	if int32(_397_pC.XeCurType) == int32(1) {
 51945  		_rc = _sqlite3VdbeSorterRewind(tls, _397_pC, &_397_res)
 51946  		goto _1537
 51947  	}
 51948  	func() {
 51949  		if int32(_397_pC.XeCurType) != int32(0) {
 51950  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83299), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 51951  			crt.X__builtin_abort(tls)
 51952  		}
 51953  	}()
 51954  	_397_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_397_pC.Xuc)))
 51955  	func() {
 51956  		if _397_pCrsr == nil {
 51957  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83301), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63949)))
 51958  			crt.X__builtin_abort(tls)
 51959  		}
 51960  	}()
 51961  	_rc = _sqlite3BtreeFirst(tls, _397_pCrsr, &_397_res)
 51962  	_397_pC.XdeferredMoveto = 0
 51963  	_397_pC.XcacheStatus = 0
 51964  _1537:
 51965  	if _rc != 0 {
 51966  		goto _abort_due_to_error
 51967  	}
 51968  	_397_pC.XnullRow = uint8(_397_res)
 51969  	func() {
 51970  		if _pOp.Xp2 <= int32(0) || _pOp.Xp2 >= _p.XnOp {
 51971  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83308), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67402)))
 51972  			crt.X__builtin_abort(tls)
 51973  		}
 51974  	}()
 51975  	if _397_res != 0 {
 51976  		goto _jump_to_p2
 51977  	}
 51978  	goto _250
 51979  _184:
 51980  	_400_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 51981  	func() {
 51982  		if int32(_400_pC.XeCurType) != int32(1) {
 51983  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83389), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65943)))
 51984  			crt.X__builtin_abort(tls)
 51985  		}
 51986  	}()
 51987  	_400_res = int32(0)
 51988  	_rc = _sqlite3VdbeSorterNext(tls, _db, _400_pC, &_400_res)
 51989  	goto _next_tail
 51990  _185:
 51991  	if (*elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))) == nil {
 51992  		goto _250
 51993  	}
 51994  _1549:
 51995  	func() {
 51996  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 51997  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83399), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 51998  			crt.X__builtin_abort(tls)
 51999  		}
 52000  	}()
 52001  	func() {
 52002  		if int32(_pOp.Xp5) >= int32(5) {
 52003  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83400), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67430)))
 52004  			crt.X__builtin_abort(tls)
 52005  		}
 52006  	}()
 52007  	_400_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 52008  	_400_res = _pOp.Xp3
 52009  	func() {
 52010  		if _400_pC == nil {
 52011  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83403), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 52012  			crt.X__builtin_abort(tls)
 52013  		}
 52014  	}()
 52015  	func() {
 52016  		if int32(_400_pC.XdeferredMoveto) != int32(0) {
 52017  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83404), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67127)))
 52018  			crt.X__builtin_abort(tls)
 52019  		}
 52020  	}()
 52021  	func() {
 52022  		if int32(_400_pC.XeCurType) != int32(0) {
 52023  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83405), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 52024  			crt.X__builtin_abort(tls)
 52025  		}
 52026  	}()
 52027  	func() {
 52028  		if _400_res != int32(0) && (_400_res != int32(1) || int32(_400_pC.XisTable) != int32(0)) {
 52029  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83406), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67461)))
 52030  			crt.X__builtin_abort(tls)
 52031  		}
 52032  	}()
 52033  	func() {
 52034  		if int32(_pOp.Xopcode) == int32(7) && *(*uintptr)(unsafe.Pointer(&struct {
 52035  			f func(*crt.TLS, *XBtCursor, *int32) int32
 52036  		}{func() func(*crt.TLS, *XBtCursor, *int32) int32 {
 52037  			v := *(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer(&_pOp.Xp4))
 52038  			return *(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer(&v))
 52039  		}()})) != *(*uintptr)(unsafe.Pointer(&struct {
 52040  			f func(*crt.TLS, *XBtCursor, *int32) int32
 52041  		}{_sqlite3BtreeNext})) {
 52042  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83408), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67498)))
 52043  			crt.X__builtin_abort(tls)
 52044  		}
 52045  	}()
 52046  	func() {
 52047  		if int32(_pOp.Xopcode) == int32(6) && *(*uintptr)(unsafe.Pointer(&struct {
 52048  			f func(*crt.TLS, *XBtCursor, *int32) int32
 52049  		}{func() func(*crt.TLS, *XBtCursor, *int32) int32 {
 52050  			v := *(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer(&_pOp.Xp4))
 52051  			return *(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer(&v))
 52052  		}()})) != *(*uintptr)(unsafe.Pointer(&struct {
 52053  			f func(*crt.TLS, *XBtCursor, *int32) int32
 52054  		}{_sqlite3BtreePrevious})) {
 52055  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83409), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67557)))
 52056  			crt.X__builtin_abort(tls)
 52057  		}
 52058  	}()
 52059  	func() {
 52060  		if int32(_pOp.Xopcode) == int32(5) && *(*uintptr)(unsafe.Pointer(&struct {
 52061  			f func(*crt.TLS, *XBtCursor, *int32) int32
 52062  		}{func() func(*crt.TLS, *XBtCursor, *int32) int32 {
 52063  			v := *(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer(&_pOp.Xp4))
 52064  			return *(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer(&v))
 52065  		}()})) != *(*uintptr)(unsafe.Pointer(&struct {
 52066  			f func(*crt.TLS, *XBtCursor, *int32) int32
 52067  		}{_sqlite3BtreeNext})) {
 52068  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83410), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67620)))
 52069  			crt.X__builtin_abort(tls)
 52070  		}
 52071  	}()
 52072  	func() {
 52073  		if int32(_pOp.Xopcode) == int32(4) && *(*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  		}{_sqlite3BtreePrevious})) {
 52081  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83411), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67685)))
 52082  			crt.X__builtin_abort(tls)
 52083  		}
 52084  	}()
 52085  	func() {
 52086  		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) {
 52087  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83415), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67754)))
 52088  			crt.X__builtin_abort(tls)
 52089  		}
 52090  	}()
 52091  	func() {
 52092  		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) {
 52093  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83418), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67904)))
 52094  			crt.X__builtin_abort(tls)
 52095  		}
 52096  	}()
 52097  	_rc = func() func(*crt.TLS, *XBtCursor, *int32) int32 {
 52098  		v := *(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer(&_pOp.Xp4))
 52099  		return *(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer(&v))
 52100  	}()(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_400_pC.Xuc))), &_400_res)
 52101  _next_tail:
 52102  	_400_pC.XcacheStatus = 0
 52103  	if _rc != 0 {
 52104  		goto _abort_due_to_error
 52105  	}
 52106  	if _400_res == int32(0) {
 52107  		_400_pC.XnullRow = 0
 52108  		*elem7((*uint32)(unsafe.Pointer(&_p.XaCounter)), uintptr(_pOp.Xp5)) += 1
 52109  		goto _jump_to_p2_and_check_for_interrupt
 52110  	}
 52111  	_400_pC.XnullRow = uint8(1)
 52112  	goto _check_for_interrupt
 52113  _189:
 52114  	func() {
 52115  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 52116  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83480), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 52117  			crt.X__builtin_abort(tls)
 52118  		}
 52119  	}()
 52120  	_403_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 52121  	func() {
 52122  		if _403_pC == nil {
 52123  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83482), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 52124  			crt.X__builtin_abort(tls)
 52125  		}
 52126  	}()
 52127  	func() {
 52128  		if (int32(_403_pC.XeCurType) == int32(1)) != (int32(_pOp.Xopcode) == int32(127)) {
 52129  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83483), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68028)))
 52130  			crt.X__builtin_abort(tls)
 52131  		}
 52132  	}()
 52133  	_pIn2 = elem25(_aMem, uintptr(_pOp.Xp2))
 52134  	func() {
 52135  		if (int32(_pIn2.Xflags) & int32(16)) == 0 {
 52136  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83485), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68073)))
 52137  			crt.X__builtin_abort(tls)
 52138  		}
 52139  	}()
 52140  	if (int32(_pOp.Xp5) & int32(1)) != 0 {
 52141  		_p.XnChange += 1
 52142  	}
 52143  	func() {
 52144  		if int32(_403_pC.XeCurType) != int32(0) && int32(_pOp.Xopcode) != int32(127) {
 52145  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83487), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68096)))
 52146  			crt.X__builtin_abort(tls)
 52147  		}
 52148  	}()
 52149  	func() {
 52150  		if int32(_403_pC.XisTable) != int32(0) {
 52151  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83488), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66542)))
 52152  			crt.X__builtin_abort(tls)
 52153  		}
 52154  	}()
 52155  	_rc = func() int32 {
 52156  		if (int32(_pIn2.Xflags) & int32(16384)) != 0 {
 52157  			return _sqlite3VdbeMemExpandBlob(tls, _pIn2)
 52158  		}
 52159  		return int32(0)
 52160  	}()
 52161  	if _rc != 0 {
 52162  		goto _abort_due_to_error
 52163  	}
 52164  	if int32(_pOp.Xopcode) == int32(127) {
 52165  		_rc = _sqlite3VdbeSorterWrite(tls, _403_pC, _pIn2)
 52166  		goto _1612
 52167  	}
 52168  	_403_x.XnKey = int64(_pIn2.Xn)
 52169  	_403_x.XpKey = unsafe.Pointer(_pIn2.Xz)
 52170  	*(**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(48)))))))))))
 52171  	_403_x.XnMem = uint16(*(*int32)(unsafe.Pointer(&_pOp.Xp4)))
 52172  	_rc = _sqlite3BtreeInsert(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_403_pC.Xuc))), &_403_x, int32(_pOp.Xp5)&int32(10), func() int32 {
 52173  		if (int32(_pOp.Xp5) & int32(16)) != 0 {
 52174  			return _403_pC.XseekResult
 52175  		}
 52176  		return int32(0)
 52177  	}())
 52178  	func() {
 52179  		if int32(_403_pC.XdeferredMoveto) != int32(0) {
 52180  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83502), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67127)))
 52181  			crt.X__builtin_abort(tls)
 52182  		}
 52183  	}()
 52184  	_403_pC.XcacheStatus = 0
 52185  _1612:
 52186  	if _rc != 0 {
 52187  		goto _abort_due_to_error
 52188  	}
 52189  	goto _250
 52190  _191:
 52191  	func() {
 52192  		if _pOp.Xp3 <= int32(0) {
 52193  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83522), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61154)))
 52194  			crt.X__builtin_abort(tls)
 52195  		}
 52196  	}()
 52197  	func() {
 52198  		if _pOp.Xp2 <= int32(0) || (_pOp.Xp2+_pOp.Xp3) > (((_p.XnMem+int32(1))-_p.XnCursor)+int32(1)) {
 52199  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83523), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68156)))
 52200  			crt.X__builtin_abort(tls)
 52201  		}
 52202  	}()
 52203  	func() {
 52204  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 52205  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83524), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 52206  			crt.X__builtin_abort(tls)
 52207  		}
 52208  	}()
 52209  	_406_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 52210  	func() {
 52211  		if _406_pC == nil {
 52212  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83526), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 52213  			crt.X__builtin_abort(tls)
 52214  		}
 52215  	}()
 52216  	func() {
 52217  		if int32(_406_pC.XeCurType) != int32(0) {
 52218  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83527), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 52219  			crt.X__builtin_abort(tls)
 52220  		}
 52221  	}()
 52222  	_406_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_406_pC.Xuc)))
 52223  	func() {
 52224  		if _406_pCrsr == nil {
 52225  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83529), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66668)))
 52226  			crt.X__builtin_abort(tls)
 52227  		}
 52228  	}()
 52229  	func() {
 52230  		if int32(_pOp.Xp5) != int32(0) {
 52231  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83530), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65967)))
 52232  			crt.X__builtin_abort(tls)
 52233  		}
 52234  	}()
 52235  	*(**XKeyInfo)(unsafe.Pointer(&_406_r.XpKeyInfo)) = (*XKeyInfo)(_406_pC.XpKeyInfo)
 52236  	_406_r.XnField = uint16(_pOp.Xp3)
 52237  	_406_r.Xdefault_rc = 0
 52238  	*(**XMem)(unsafe.Pointer(&_406_r.XaMem)) = elem25(_aMem, uintptr(_pOp.Xp2))
 52239  	_rc = _sqlite3BtreeMovetoUnpacked(tls, _406_pCrsr, &_406_r, 0, int32(0), &_406_res)
 52240  	if _rc != 0 {
 52241  		goto _abort_due_to_error
 52242  	}
 52243  	if _406_res != int32(0) {
 52244  		goto _1635
 52245  	}
 52246  	_rc = _sqlite3BtreeDelete(tls, _406_pCrsr, uint8(4))
 52247  	if _rc != 0 {
 52248  		goto _abort_due_to_error
 52249  	}
 52250  _1635:
 52251  	func() {
 52252  		if int32(_406_pC.XdeferredMoveto) != int32(0) {
 52253  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83541), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67127)))
 52254  			crt.X__builtin_abort(tls)
 52255  		}
 52256  	}()
 52257  	_406_pC.XcacheStatus = 0
 52258  	_406_pC.XseekResult = int32(0)
 52259  	goto _250
 52260  _192:
 52261  	func() {
 52262  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 52263  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83581), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 52264  			crt.X__builtin_abort(tls)
 52265  		}
 52266  	}()
 52267  	_408_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 52268  	func() {
 52269  		if _408_pC == nil {
 52270  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83583), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 52271  			crt.X__builtin_abort(tls)
 52272  		}
 52273  	}()
 52274  	func() {
 52275  		if int32(_408_pC.XeCurType) != int32(0) {
 52276  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83584), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 52277  			crt.X__builtin_abort(tls)
 52278  		}
 52279  	}()
 52280  	func() {
 52281  		if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_408_pC.Xuc))) == nil {
 52282  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83585), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66003)))
 52283  			crt.X__builtin_abort(tls)
 52284  		}
 52285  	}()
 52286  	func() {
 52287  		if int32(_408_pC.XisTable) != int32(0) {
 52288  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83586), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66542)))
 52289  			crt.X__builtin_abort(tls)
 52290  		}
 52291  	}()
 52292  	func() {
 52293  		if int32(_408_pC.XdeferredMoveto) != int32(0) {
 52294  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83587), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67127)))
 52295  			crt.X__builtin_abort(tls)
 52296  		}
 52297  	}()
 52298  	func() {
 52299  		if _408_pC.XnullRow != 0 && int32(_pOp.Xopcode) != int32(131) {
 52300  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83588), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68213)))
 52301  			crt.X__builtin_abort(tls)
 52302  		}
 52303  	}()
 52304  	_rc = _sqlite3VdbeCursorRestore(tls, _408_pC)
 52305  	if func() int32 {
 52306  		if _rc != int32(0) {
 52307  			return func() int32 {
 52308  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83597), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(4809)))
 52309  				crt.X__builtin_abort(tls)
 52310  				return int32(1)
 52311  			}()
 52312  		}
 52313  		return int32(0)
 52314  	}() != 0 {
 52315  		goto _abort_due_to_error
 52316  	}
 52317  	if _408_pC.XnullRow != 0 {
 52318  		goto _1658
 52319  	}
 52320  	_408_rowid = 0
 52321  	_rc = _sqlite3VdbeIdxRowid(tls, _db, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_408_pC.Xuc))), &_408_rowid)
 52322  	if _rc != int32(0) {
 52323  		goto _abort_due_to_error
 52324  	}
 52325  	if int32(_pOp.Xopcode) == int32(130) {
 52326  		func() {
 52327  			if _pOp.Xp3 < int32(0) || _pOp.Xp3 >= _p.XnCursor {
 52328  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83606), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68254)))
 52329  				crt.X__builtin_abort(tls)
 52330  			}
 52331  		}()
 52332  		_408_pTabCur = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp3))
 52333  		func() {
 52334  			if _408_pTabCur == nil {
 52335  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83608), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68287)))
 52336  				crt.X__builtin_abort(tls)
 52337  			}
 52338  		}()
 52339  		func() {
 52340  			if int32(_408_pTabCur.XeCurType) != int32(0) {
 52341  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83609), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68298)))
 52342  				crt.X__builtin_abort(tls)
 52343  			}
 52344  		}()
 52345  		func() {
 52346  			if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_408_pTabCur.Xuc))) == nil {
 52347  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83610), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68331)))
 52348  				crt.X__builtin_abort(tls)
 52349  			}
 52350  		}()
 52351  		func() {
 52352  			if _408_pTabCur.XisTable == 0 {
 52353  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83611), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68354)))
 52354  				crt.X__builtin_abort(tls)
 52355  			}
 52356  		}()
 52357  		_408_pTabCur.XnullRow = 0
 52358  		_408_pTabCur.XmovetoTarget = _408_rowid
 52359  		_408_pTabCur.XdeferredMoveto = uint8(1)
 52360  		func() {
 52361  			if int32(_pOp.Xp4type) != int32(-12) && (*(**int32)(unsafe.Pointer(&_pOp.Xp4))) != nil {
 52362  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83615), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68371)))
 52363  				crt.X__builtin_abort(tls)
 52364  			}
 52365  		}()
 52366  		_408_pTabCur.XaAltMap = *(**int32)(unsafe.Pointer(&_pOp.Xp4))
 52367  		*(**XVdbeCursor)(unsafe.Pointer(&_408_pTabCur.XpAltCursor)) = _408_pC
 52368  		goto _1675
 52369  	}
 52370  	_pOut = _out2Prerelease(tls, _p, _pOp)
 52371  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = _408_rowid
 52372  _1675:
 52373  	goto _1676
 52374  _1658:
 52375  	func() {
 52376  		if int32(_pOp.Xopcode) != int32(131) {
 52377  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83623), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68413)))
 52378  			crt.X__builtin_abort(tls)
 52379  		}
 52380  	}()
 52381  	_sqlite3VdbeMemSetNull(tls, elem25(_aMem, uintptr(_pOp.Xp2)))
 52382  _1676:
 52383  	goto _250
 52384  _194:
 52385  	func() {
 52386  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 52387  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83681), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 52388  			crt.X__builtin_abort(tls)
 52389  		}
 52390  	}()
 52391  	_414_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 52392  	func() {
 52393  		if _414_pC == nil {
 52394  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83683), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 52395  			crt.X__builtin_abort(tls)
 52396  		}
 52397  	}()
 52398  	func() {
 52399  		if ((uint32(_414_pC.XisEphemeral>>2) << 31) >> 31) == 0 {
 52400  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83684), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65989)))
 52401  			crt.X__builtin_abort(tls)
 52402  		}
 52403  	}()
 52404  	func() {
 52405  		if int32(_414_pC.XeCurType) != int32(0) {
 52406  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83685), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 52407  			crt.X__builtin_abort(tls)
 52408  		}
 52409  	}()
 52410  	func() {
 52411  		if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_414_pC.Xuc))) == nil {
 52412  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83686), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66003)))
 52413  			crt.X__builtin_abort(tls)
 52414  		}
 52415  	}()
 52416  	func() {
 52417  		if int32(_414_pC.XdeferredMoveto) != int32(0) {
 52418  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83687), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(67127)))
 52419  			crt.X__builtin_abort(tls)
 52420  		}
 52421  	}()
 52422  	func() {
 52423  		if int32(_pOp.Xp5) != int32(0) && int32(_pOp.Xp5) != int32(1) {
 52424  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83688), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68438)))
 52425  			crt.X__builtin_abort(tls)
 52426  		}
 52427  	}()
 52428  	func() {
 52429  		if int32(_pOp.Xp4type) != int32(-11) {
 52430  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83689), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66283)))
 52431  			crt.X__builtin_abort(tls)
 52432  		}
 52433  	}()
 52434  	*(**XKeyInfo)(unsafe.Pointer(&_414_r.XpKeyInfo)) = (*XKeyInfo)(_414_pC.XpKeyInfo)
 52435  	_414_r.XnField = uint16(*(*int32)(unsafe.Pointer(&_pOp.Xp4)))
 52436  	if int32(_pOp.Xopcode) < int32(40) {
 52437  		func() {
 52438  			if int32(_pOp.Xopcode) != int32(38) && int32(_pOp.Xopcode) != int32(39) {
 52439  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83693), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68463)))
 52440  				crt.X__builtin_abort(tls)
 52441  			}
 52442  		}()
 52443  		_414_r.Xdefault_rc = int8(-1)
 52444  		goto _1701
 52445  	}
 52446  	func() {
 52447  		if int32(_pOp.Xopcode) != int32(41) && int32(_pOp.Xopcode) != int32(40) {
 52448  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83696), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68510)))
 52449  			crt.X__builtin_abort(tls)
 52450  		}
 52451  	}()
 52452  	_414_r.Xdefault_rc = 0
 52453  _1701:
 52454  	*(**XMem)(unsafe.Pointer(&_414_r.XaMem)) = elem25(_aMem, uintptr(_pOp.Xp3))
 52455  	_417_i = int32(0)
 52456  _1705:
 52457  	if _417_i >= int32(_414_r.XnField) {
 52458  		goto _1708
 52459  	}
 52460  	func() {
 52461  		if (int32(elem25((*XMem)(_414_r.XaMem), uintptr(_417_i)).Xflags) & int32(128)) != int32(0) {
 52462  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83701), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66450)))
 52463  			crt.X__builtin_abort(tls)
 52464  		}
 52465  	}()
 52466  	_417_i += 1
 52467  	goto _1705
 52468  _1708:
 52469  	_414_res = int32(0)
 52470  	_rc = _sqlite3VdbeIdxKeyCompare(tls, _db, _414_pC, &_414_r, &_414_res)
 52471  
 52472  	if (int32(_pOp.Xopcode) & int32(1)) == int32(0) {
 52473  		func() {
 52474  			if int32(_pOp.Xopcode) != int32(38) && int32(_pOp.Xopcode) != int32(40) {
 52475  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83707), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68557)))
 52476  				crt.X__builtin_abort(tls)
 52477  			}
 52478  		}()
 52479  		_414_res = -_414_res
 52480  		goto _1715
 52481  	}
 52482  	func() {
 52483  		if int32(_pOp.Xopcode) != int32(41) && int32(_pOp.Xopcode) != int32(39) {
 52484  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83710), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68604)))
 52485  			crt.X__builtin_abort(tls)
 52486  		}
 52487  	}()
 52488  	_414_res += 1
 52489  _1715:
 52490  	if _rc != 0 {
 52491  		goto _abort_due_to_error
 52492  	}
 52493  	if _414_res > int32(0) {
 52494  		goto _jump_to_p2
 52495  	}
 52496  	goto _250
 52497  _198:
 52498  	func() {
 52499  		if int32((uint32(_p.Xexpired>>7)<<31)>>31) != int32(0) {
 52500  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83750), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65412)))
 52501  			crt.X__builtin_abort(tls)
 52502  		}
 52503  	}()
 52504  	func() {
 52505  		if _pOp.Xp1 <= int32(1) {
 52506  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83751), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68651)))
 52507  			crt.X__builtin_abort(tls)
 52508  		}
 52509  	}()
 52510  	_pOut = _out2Prerelease(tls, _p, _pOp)
 52511  	_pOut.Xflags = uint16(1)
 52512  	if _db.XnVdbeRead > (_db.XnVDestroy + int32(1)) {
 52513  		_rc = int32(6)
 52514  		_p.XerrorAction = uint8(2)
 52515  		goto _abort_due_to_error
 52516  	}
 52517  	_420_iDb = _pOp.Xp3
 52518  	func() {
 52519  		if (_p.XbtreeMask & (uint32(1) << uint(_420_iDb))) == (0) {
 52520  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83760), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65354)))
 52521  			crt.X__builtin_abort(tls)
 52522  		}
 52523  	}()
 52524  	_420_iMoved = int32(0)
 52525  	_rc = _sqlite3BtreeDropTable(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_420_iDb)).XpBt), _pOp.Xp1, &_420_iMoved)
 52526  	_pOut.Xflags = uint16(4)
 52527  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = int64(_420_iMoved)
 52528  	if _rc != 0 {
 52529  		goto _abort_due_to_error
 52530  	}
 52531  	if _420_iMoved != int32(0) {
 52532  		_sqlite3RootPageMoved(tls, _db, _420_iDb, _420_iMoved, _pOp.Xp1)
 52533  		func() {
 52534  			if int32(_resetSchemaOnFault) != int32(0) && int32(_resetSchemaOnFault) != (_420_iDb+int32(1)) {
 52535  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83770), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68661)))
 52536  				crt.X__builtin_abort(tls)
 52537  			}
 52538  		}()
 52539  		_resetSchemaOnFault = uint8(_420_iDb + int32(1))
 52540  	}
 52541  	goto _250
 52542  _199:
 52543  	_424_nChange = int32(0)
 52544  	func() {
 52545  		if int32((uint32(_p.Xexpired>>7)<<31)>>31) != int32(0) {
 52546  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83800), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65412)))
 52547  			crt.X__builtin_abort(tls)
 52548  		}
 52549  	}()
 52550  	func() {
 52551  		if (_p.XbtreeMask & (uint32(1) << uint(_pOp.Xp2))) == (0) {
 52552  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83801), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68712)))
 52553  			crt.X__builtin_abort(tls)
 52554  		}
 52555  	}()
 52556  	_rc = _sqlite3BtreeClearTable(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_pOp.Xp2)).XpBt), _pOp.Xp1, func() *int32 {
 52557  		if _pOp.Xp3 != 0 {
 52558  			return &_424_nChange
 52559  		}
 52560  		return nil
 52561  	}())
 52562  	if _pOp.Xp3 == 0 {
 52563  		goto _1740
 52564  	}
 52565  	_p.XnChange += _424_nChange
 52566  	if _pOp.Xp3 > int32(0) {
 52567  		func() {
 52568  			if (int32(elem25(_aMem, uintptr(_pOp.Xp3)).Xflags) & int32(128)) != int32(0) {
 52569  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83808), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61198)))
 52570  				crt.X__builtin_abort(tls)
 52571  			}
 52572  		}()
 52573  		_sqlite3VdbeMemAboutToChange(tls, _p, elem25(_aMem, uintptr(_pOp.Xp3)))
 52574  		*(*int64)(unsafe.Pointer(&(elem25(_aMem, uintptr(_pOp.Xp3)).Xu))) += int64(_424_nChange)
 52575  	}
 52576  _1740:
 52577  	if _rc != 0 {
 52578  		goto _abort_due_to_error
 52579  	}
 52580  	goto _250
 52581  _200:
 52582  	func() {
 52583  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _p.XnCursor {
 52584  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83828), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63683)))
 52585  			crt.X__builtin_abort(tls)
 52586  		}
 52587  	}()
 52588  	_427_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 52589  	func() {
 52590  		if _427_pC == nil {
 52591  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83830), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63737)))
 52592  			crt.X__builtin_abort(tls)
 52593  		}
 52594  	}()
 52595  	if int32(_427_pC.XeCurType) == int32(1) {
 52596  		_sqlite3VdbeSorterReset(tls, _db, (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer(&_427_pC.Xuc))))
 52597  		goto _1751
 52598  	}
 52599  	func() {
 52600  		if int32(_427_pC.XeCurType) != int32(0) {
 52601  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83834), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(63921)))
 52602  			crt.X__builtin_abort(tls)
 52603  		}
 52604  	}()
 52605  	func() {
 52606  		if ((uint32(_427_pC.XisEphemeral) << 31) >> 31) == 0 {
 52607  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83835), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68746)))
 52608  			crt.X__builtin_abort(tls)
 52609  		}
 52610  	}()
 52611  	_rc = _sqlite3BtreeClearTableOfCursor(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_427_pC.Xuc))))
 52612  	if _rc != 0 {
 52613  		goto _abort_due_to_error
 52614  	}
 52615  _1751:
 52616  	goto _250
 52617  _201:
 52618  	_pOut = _out2Prerelease(tls, _p, _pOp)
 52619  	_430_pgno = int32(0)
 52620  	func() {
 52621  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _db.XnDb {
 52622  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83874), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65140)))
 52623  			crt.X__builtin_abort(tls)
 52624  		}
 52625  	}()
 52626  	func() {
 52627  		if (_p.XbtreeMask & (uint32(1) << uint(_pOp.Xp1))) == (0) {
 52628  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83875), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65170)))
 52629  			crt.X__builtin_abort(tls)
 52630  		}
 52631  	}()
 52632  	func() {
 52633  		if int32((uint32(_p.Xexpired>>7)<<31)>>31) != int32(0) {
 52634  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83876), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65412)))
 52635  			crt.X__builtin_abort(tls)
 52636  		}
 52637  	}()
 52638  	_430_pDb = elem27((*XDb)(_db.XaDb), uintptr(_pOp.Xp1))
 52639  	func() {
 52640  		if (*XBtree)(_430_pDb.XpBt) == nil {
 52641  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83878), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65427)))
 52642  			crt.X__builtin_abort(tls)
 52643  		}
 52644  	}()
 52645  	if int32(_pOp.Xopcode) == int32(137) {
 52646  		_430_flags = int32(1)
 52647  		goto _1767
 52648  	}
 52649  	_430_flags = int32(2)
 52650  _1767:
 52651  	_rc = _sqlite3BtreeCreateTable(tls, (*XBtree)(_430_pDb.XpBt), &_430_pgno, _430_flags)
 52652  	if _rc != 0 {
 52653  		goto _abort_due_to_error
 52654  	}
 52655  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = int64(_430_pgno)
 52656  	goto _250
 52657  _203:
 52658  	_db.XnSqlExec += 1
 52659  	_rc = Xsqlite3_exec(tls, _db, *(**int8)(unsafe.Pointer(&_pOp.Xp4)), nil, nil, nil)
 52660  	_db.XnSqlExec -= 1
 52661  	if _rc != 0 {
 52662  		goto _abort_due_to_error
 52663  	}
 52664  	goto _250
 52665  _204:
 52666  	_434_iDb = int32(0)
 52667  _1770:
 52668  	if _434_iDb >= _db.XnDb {
 52669  		goto _1773
 52670  	}
 52671  	func() {
 52672  		if _434_iDb != int32(1) && _sqlite3BtreeHoldsMutex(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_434_iDb)).XpBt)) == 0 {
 52673  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83923), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(49911)))
 52674  			crt.X__builtin_abort(tls)
 52675  		}
 52676  	}()
 52677  	_434_iDb += 1
 52678  	goto _1770
 52679  _1773:
 52680  	_434_iDb = _pOp.Xp1
 52681  	func() {
 52682  		if _434_iDb < int32(0) || _434_iDb >= _db.XnDb {
 52683  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83928), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(21693)))
 52684  			crt.X__builtin_abort(tls)
 52685  		}
 52686  	}()
 52687  	func() {
 52688  		if (int32((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_434_iDb)).XpSchema).XschemaFlags) & int32(1)) != int32(1) {
 52689  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83929), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68762)))
 52690  			crt.X__builtin_abort(tls)
 52691  		}
 52692  	}()
 52693  	_434_zMaster = str(49981)
 52694  	*(**Xsqlite3)(unsafe.Pointer(&_434_initData.Xdb)) = _db
 52695  	_434_initData.XiDb = _pOp.Xp1
 52696  	_434_initData.XpzErrMsg = &_p.XzErrMsg
 52697  	_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))))
 52698  	if _434_zSql == nil {
 52699  		_rc = _sqlite3NomemError(tls, int32(83939))
 52700  		goto _1783
 52701  	}
 52702  	func() {
 52703  		if int32(_db.Xinit.Xbusy) != int32(0) {
 52704  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83941), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(49851)))
 52705  			crt.X__builtin_abort(tls)
 52706  		}
 52707  	}()
 52708  	_db.Xinit.Xbusy = uint8(1)
 52709  	_434_initData.Xrc = int32(0)
 52710  	func() {
 52711  		if _db.XmallocFailed != 0 {
 52712  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83944), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(23824)))
 52713  			crt.X__builtin_abort(tls)
 52714  		}
 52715  	}()
 52716  	_rc = Xsqlite3_exec(tls, _db, _434_zSql, _sqlite3InitCallback, unsafe.Pointer(&_434_initData), nil)
 52717  	if _rc == int32(0) {
 52718  		_rc = _434_initData.Xrc
 52719  	}
 52720  	_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_434_zSql))
 52721  	_db.Xinit.Xbusy = 0
 52722  _1783:
 52723  	if _rc == 0 {
 52724  		goto _1789
 52725  	}
 52726  	_sqlite3ResetAllSchemasOfConnection(tls, _db)
 52727  	if _rc == int32(7) {
 52728  		goto _no_mem
 52729  	}
 52730  	goto _abort_due_to_error
 52731  _1789:
 52732  	goto _250
 52733  _205:
 52734  	func() {
 52735  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _db.XnDb {
 52736  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(83969), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65140)))
 52737  			crt.X__builtin_abort(tls)
 52738  		}
 52739  	}()
 52740  	_rc = _sqlite3AnalysisLoad(tls, _db, _pOp.Xp1)
 52741  	if _rc != 0 {
 52742  		goto _abort_due_to_error
 52743  	}
 52744  	goto _250
 52745  _206:
 52746  	_sqlite3UnlinkAndDeleteTable(tls, _db, _pOp.Xp1, *(**int8)(unsafe.Pointer(&_pOp.Xp4)))
 52747  	goto _250
 52748  _207:
 52749  	_sqlite3UnlinkAndDeleteIndex(tls, _db, _pOp.Xp1, *(**int8)(unsafe.Pointer(&_pOp.Xp4)))
 52750  	goto _250
 52751  _208:
 52752  	_sqlite3UnlinkAndDeleteTrigger(tls, _db, _pOp.Xp1, *(**int8)(unsafe.Pointer(&_pOp.Xp4)))
 52753  	goto _250
 52754  _209:
 52755  	func() {
 52756  		if ((uint32(_p.Xexpired>>8) << 31) >> 31) == 0 {
 52757  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84043), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64582)))
 52758  			crt.X__builtin_abort(tls)
 52759  		}
 52760  	}()
 52761  	_445_nRoot = _pOp.Xp2
 52762  	_445_aRoot = *(**int32)(unsafe.Pointer(&_pOp.Xp4))
 52763  	func() {
 52764  		if _445_nRoot <= int32(0) {
 52765  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84046), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68866)))
 52766  			crt.X__builtin_abort(tls)
 52767  		}
 52768  	}()
 52769  	func() {
 52770  		if (*elem8(_445_aRoot, uintptr(_445_nRoot))) != int32(0) {
 52771  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84047), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68874)))
 52772  			crt.X__builtin_abort(tls)
 52773  		}
 52774  	}()
 52775  	func() {
 52776  		if _pOp.Xp3 <= int32(0) || _pOp.Xp3 > ((_p.XnMem+int32(1))-_p.XnCursor) {
 52777  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84048), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62583)))
 52778  			crt.X__builtin_abort(tls)
 52779  		}
 52780  	}()
 52781  	_445_pnErr = elem25(_aMem, uintptr(_pOp.Xp3))
 52782  	func() {
 52783  		if (int32(_445_pnErr.Xflags) & int32(4)) == int32(0) {
 52784  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84050), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68890)))
 52785  			crt.X__builtin_abort(tls)
 52786  		}
 52787  	}()
 52788  	func() {
 52789  		if (int32(_445_pnErr.Xflags) & int32(18)) != int32(0) {
 52790  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84051), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68918)))
 52791  			crt.X__builtin_abort(tls)
 52792  		}
 52793  	}()
 52794  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 52795  	func() {
 52796  		if int32(_pOp.Xp5) >= _db.XnDb {
 52797  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84053), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68957)))
 52798  			crt.X__builtin_abort(tls)
 52799  		}
 52800  	}()
 52801  	func() {
 52802  		if (_p.XbtreeMask & (uint32(1) << uint(int32(_pOp.Xp5)))) == (0) {
 52803  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84054), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(68973)))
 52804  			crt.X__builtin_abort(tls)
 52805  		}
 52806  	}()
 52807  	_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)
 52808  	_sqlite3VdbeMemSetNull(tls, _pIn1)
 52809  	if _445_nErr == int32(0) {
 52810  		func() {
 52811  			if _445_z != nil {
 52812  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84059), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69007)))
 52813  				crt.X__builtin_abort(tls)
 52814  			}
 52815  		}()
 52816  		goto _1817
 52817  	}
 52818  	if _445_z == nil {
 52819  		goto _no_mem
 52820  	}
 52821  	*(*int64)(unsafe.Pointer(&_445_pnErr.Xu)) -= int64(_445_nErr - int32(1))
 52822  	_sqlite3VdbeMemSetStr(tls, _pIn1, _445_z, int32(-1), uint8(1), Xsqlite3_free)
 52823  _1817:
 52824  	_sqlite3VdbeChangeEncoding(tls, _pIn1, int32(_encoding))
 52825  	goto _250
 52826  _210:
 52827  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 52828  	_pIn2 = elem25(_aMem, uintptr(_pOp.Xp2))
 52829  	func() {
 52830  		if (int32(_pIn2.Xflags) & int32(4)) == int32(0) {
 52831  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84083), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65753)))
 52832  			crt.X__builtin_abort(tls)
 52833  		}
 52834  	}()
 52835  	if (int32(_pIn1.Xflags) & int32(32)) != int32(0) {
 52836  		goto _1820
 52837  	}
 52838  	_sqlite3VdbeMemSetRowSet(tls, _pIn1)
 52839  	if (int32(_pIn1.Xflags) & int32(32)) == int32(0) {
 52840  		goto _no_mem
 52841  	}
 52842  _1820:
 52843  	_sqlite3RowSetInsert(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer(&_pIn1.Xu))), *(*int64)(unsafe.Pointer(&_pIn2.Xu)))
 52844  	goto _250
 52845  _211:
 52846  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 52847  	if ((int32(_pIn1.Xflags) & int32(32)) == int32(0)) || (_sqlite3RowSetNext(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer(&_pIn1.Xu))), &_451_val) == int32(0)) {
 52848  		_sqlite3VdbeMemSetNull(tls, _pIn1)
 52849  		goto _jump_to_p2_and_check_for_interrupt
 52850  	}
 52851  	_sqlite3VdbeMemSetInt64(tls, elem25(_aMem, uintptr(_pOp.Xp3)), _451_val)
 52852  	goto _check_for_interrupt
 52853  _212:
 52854  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 52855  	_pIn3 = elem25(_aMem, uintptr(_pOp.Xp3))
 52856  	_454_iSet = *(*int32)(unsafe.Pointer(&_pOp.Xp4))
 52857  	func() {
 52858  		if (int32(_pIn3.Xflags) & int32(4)) == 0 {
 52859  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84149), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69012)))
 52860  			crt.X__builtin_abort(tls)
 52861  		}
 52862  	}()
 52863  	if (int32(_pIn1.Xflags) & int32(32)) != int32(0) {
 52864  		goto _1827
 52865  	}
 52866  	_sqlite3VdbeMemSetRowSet(tls, _pIn1)
 52867  	if (int32(_pIn1.Xflags) & int32(32)) == int32(0) {
 52868  		goto _no_mem
 52869  	}
 52870  _1827:
 52871  	func() {
 52872  		if int32(_pOp.Xp4type) != int32(-11) {
 52873  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84159), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(66283)))
 52874  			crt.X__builtin_abort(tls)
 52875  		}
 52876  	}()
 52877  	func() {
 52878  		if _454_iSet != int32(-1) && _454_iSet < int32(0) {
 52879  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84160), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69032)))
 52880  			crt.X__builtin_abort(tls)
 52881  		}
 52882  	}()
 52883  	if _454_iSet == 0 {
 52884  		goto _1834
 52885  	}
 52886  	_454_exists = _sqlite3RowSetTest(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer(&_pIn1.Xu))), _454_iSet, *(*int64)(unsafe.Pointer(&_pIn3.Xu)))
 52887  	if _454_exists != 0 {
 52888  		goto _jump_to_p2
 52889  	}
 52890  _1834:
 52891  	if _454_iSet >= int32(0) {
 52892  		_sqlite3RowSetInsert(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer(&_pIn1.Xu))), *(*int64)(unsafe.Pointer(&_pIn3.Xu)))
 52893  	}
 52894  	goto _250
 52895  _213:
 52896  	_458_pProgram = (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 52897  	_458_pRt = elem25(_aMem, uintptr(_pOp.Xp3))
 52898  	func() {
 52899  		if _458_pProgram.XnOp <= int32(0) {
 52900  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84202), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69052)))
 52901  			crt.X__builtin_abort(tls)
 52902  		}
 52903  	}()
 52904  	if _pOp.Xp5 == 0 {
 52905  		goto _1839
 52906  	}
 52907  	_458_t = _458_pProgram.Xtoken
 52908  	_458_pFrame = (*XVdbeFrame)(_p.XpFrame)
 52909  _1840:
 52910  	if _458_pFrame == nil || _458_pFrame.Xtoken == _458_t {
 52911  		goto _1844
 52912  	}
 52913  	_458_pFrame = (*XVdbeFrame)(_458_pFrame.XpParent)
 52914  	goto _1840
 52915  _1844:
 52916  	if _458_pFrame != nil {
 52917  		goto _250
 52918  	}
 52919  _1839:
 52920  	if _p.XnFrame >= (*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(10))) {
 52921  		_rc = int32(1)
 52922  		_sqlite3VdbeError(tls, _p, str(69068))
 52923  		goto _abort_due_to_error
 52924  	}
 52925  	if (int32(_458_pRt.Xflags) & int32(64)) != int32(0) {
 52926  		goto _1847
 52927  	}
 52928  	_458_nMem = _458_pProgram.XnMem + _458_pProgram.XnCsr
 52929  	func() {
 52930  		if _458_nMem <= int32(0) {
 52931  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84238), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69105)))
 52932  			crt.X__builtin_abort(tls)
 52933  		}
 52934  	}()
 52935  	if _458_pProgram.XnCsr == int32(0) {
 52936  		_458_nMem += 1
 52937  	}
 52938  	_458_nByte = int32(((uint32(80) + (uint32(_458_nMem) * uint32(48))) + (uint32(_458_pProgram.XnCsr) * uint32(4))) + uint32((_458_pProgram.XnOp+int32(7))/int32(8)))
 52939  	_458_pFrame = (*XVdbeFrame)(_sqlite3DbMallocZero(tls, _db, uint64(_458_nByte)))
 52940  	if _458_pFrame == nil {
 52941  		goto _no_mem
 52942  	}
 52943  	_sqlite3VdbeMemRelease(tls, _458_pRt)
 52944  	_458_pRt.Xflags = uint16(64)
 52945  	*(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_458_pRt.Xu)))) = _458_pFrame
 52946  	*(**TVdbe)(unsafe.Pointer(&_458_pFrame.Xv)) = _p
 52947  	_458_pFrame.XnChildMem = _458_nMem
 52948  	_458_pFrame.XnChildCsr = _458_pProgram.XnCsr
 52949  	_458_pFrame.Xpc = int32((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 24)
 52950  	*(**XMem)(unsafe.Pointer(&_458_pFrame.XaMem)) = (*XMem)(_p.XaMem)
 52951  	_458_pFrame.XnMem = _p.XnMem
 52952  	*(***XVdbeCursor)(unsafe.Pointer(&_458_pFrame.XapCsr)) = (**XVdbeCursor)(unsafe.Pointer(_p.XapCsr))
 52953  	_458_pFrame.XnCursor = _p.XnCursor
 52954  	*(**XVdbeOp)(unsafe.Pointer(&_458_pFrame.XaOp)) = (*XVdbeOp)(_p.XaOp)
 52955  	_458_pFrame.XnOp = _p.XnOp
 52956  	_458_pFrame.Xtoken = _458_pProgram.Xtoken
 52957  	_458_pEnd = elem25((*XMem)(unsafe.Pointer(elem15((*uint8)(unsafe.Pointer(_458_pFrame)), uintptr(80)))), uintptr(_458_pFrame.XnChildMem))
 52958  	_458_pMem = (*XMem)(unsafe.Pointer(elem15((*uint8)(unsafe.Pointer(_458_pFrame)), uintptr(80))))
 52959  _1852:
 52960  	if _458_pMem == _458_pEnd {
 52961  		goto _1855
 52962  	}
 52963  	_458_pMem.Xflags = uint16(128)
 52964  	*(**Xsqlite3)(unsafe.Pointer(&_458_pMem.Xdb)) = _db
 52965  	*(*uintptr)(unsafe.Pointer(&_458_pMem)) += uintptr(48)
 52966  	goto _1852
 52967  _1855:
 52968  	goto _1856
 52969  _1847:
 52970  	_458_pFrame = (*XVdbeFrame)(*(*unsafe.Pointer)(unsafe.Pointer(&_458_pRt.Xu)))
 52971  	func() {
 52972  		if (_458_pProgram.XnMem+_458_pProgram.XnCsr) != _458_pFrame.XnChildMem && (_458_pProgram.XnCsr != int32(0) || (_458_pProgram.XnMem+int32(1)) != _458_pFrame.XnChildMem) {
 52973  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84274), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69112)))
 52974  			crt.X__builtin_abort(tls)
 52975  		}
 52976  	}()
 52977  	func() {
 52978  		if _458_pProgram.XnCsr != _458_pFrame.XnChildCsr {
 52979  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84276), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69223)))
 52980  			crt.X__builtin_abort(tls)
 52981  		}
 52982  	}()
 52983  	func() {
 52984  		if int32((uintptr(unsafe.Pointer(_pOp))-uintptr(unsafe.Pointer(_aOp)))/24) != _458_pFrame.Xpc {
 52985  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84277), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69257)))
 52986  			crt.X__builtin_abort(tls)
 52987  		}
 52988  	}()
 52989  _1856:
 52990  	_p.XnFrame += 1
 52991  	*(**XVdbeFrame)(unsafe.Pointer(&_458_pFrame.XpParent)) = (*XVdbeFrame)(_p.XpFrame)
 52992  	_458_pFrame.XlastRowid = _db.XlastRowid
 52993  	_458_pFrame.XnChange = _p.XnChange
 52994  	_458_pFrame.XnDbChange = (*Xsqlite3)(_p.Xdb).XnChange
 52995  	func() {
 52996  		if (*XAuxData)(_458_pFrame.XpAuxData) != nil {
 52997  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84285), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69286)))
 52998  			crt.X__builtin_abort(tls)
 52999  		}
 53000  	}()
 53001  	*(**XAuxData)(unsafe.Pointer(&_458_pFrame.XpAuxData)) = (*XAuxData)(_p.XpAuxData)
 53002  	*(**XAuxData)(unsafe.Pointer(&_p.XpAuxData)) = nil
 53003  	_p.XnChange = int32(0)
 53004  	*(**XVdbeFrame)(unsafe.Pointer(&_p.XpFrame)) = _458_pFrame
 53005  	*(**XMem)(unsafe.Pointer(&_p.XaMem)) = store25(&_aMem, (*XMem)(unsafe.Pointer(elem15((*uint8)(unsafe.Pointer(_458_pFrame)), uintptr(80)))))
 53006  	_p.XnMem = _458_pFrame.XnChildMem
 53007  	_p.XnCursor = int32(uint16(_458_pFrame.XnChildCsr))
 53008  	*(***XVdbeCursor)(unsafe.Pointer(&_p.XapCsr)) = (**XVdbeCursor)(unsafe.Pointer(elem25(_aMem, uintptr(_p.XnMem))))
 53009  	_458_pFrame.XaOnce = (*uint8)(unsafe.Pointer(elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_458_pProgram.XnCsr))))
 53010  	crt.Xmemset(tls, unsafe.Pointer(_458_pFrame.XaOnce), int32(0), uint32((_458_pProgram.XnOp+int32(7))/int32(8)))
 53011  	*(**XVdbeOp)(unsafe.Pointer(&_p.XaOp)) = store61(&_aOp, (*XVdbeOp)(_458_pProgram.XaOp))
 53012  	_p.XnOp = _458_pProgram.XnOp
 53013  	_pOp = elem61(_aOp, uintptr(4294967295))
 53014  	goto _250
 53015  _214:
 53016  	_pOut = _out2Prerelease(tls, _p, _pOp)
 53017  	_465_pFrame = (*XVdbeFrame)(_p.XpFrame)
 53018  	_465_pIn = elem25((*XMem)(_465_pFrame.XaMem), uintptr(_pOp.Xp1+(elem61((*XVdbeOp)(_465_pFrame.XaOp), uintptr(_465_pFrame.Xpc)).Xp1)))
 53019  	_sqlite3VdbeMemShallowCopy(tls, _pOut, _465_pIn, int32(4096))
 53020  	goto _250
 53021  _215:
 53022  	if (_db.Xflags & int32(33554432)) != 0 {
 53023  		_db.XnDeferredImmCons += int64(_pOp.Xp2)
 53024  		goto _1870
 53025  	}
 53026  	if _pOp.Xp1 != 0 {
 53027  		_db.XnDeferredCons += int64(_pOp.Xp2)
 53028  		goto _1870
 53029  	}
 53030  	_p.XnFkConstraint += int64(_pOp.Xp2)
 53031  _1870:
 53032  	goto _250
 53033  _216:
 53034  	if _pOp.Xp1 == 0 {
 53035  		goto _1871
 53036  	}
 53037  	if (_db.XnDeferredCons == (0)) && (_db.XnDeferredImmCons == (0)) {
 53038  		goto _jump_to_p2
 53039  	}
 53040  	goto _1874
 53041  _1871:
 53042  	if (_p.XnFkConstraint == (0)) && (_db.XnDeferredImmCons == (0)) {
 53043  		goto _jump_to_p2
 53044  	}
 53045  _1874:
 53046  	goto _250
 53047  _217:
 53048  	if _p.XpFrame == nil {
 53049  		goto _1877
 53050  	}
 53051  	_473_pFrame = (*XVdbeFrame)(_p.XpFrame)
 53052  _1878:
 53053  	if _473_pFrame.XpParent == nil {
 53054  		goto _1881
 53055  	}
 53056  	_473_pFrame = (*XVdbeFrame)(_473_pFrame.XpParent)
 53057  	goto _1878
 53058  _1881:
 53059  	_pIn1 = elem25((*XMem)(_473_pFrame.XaMem), uintptr(_pOp.Xp1))
 53060  	goto _1882
 53061  _1877:
 53062  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 53063  _1882:
 53064  	func() {
 53065  		if (int32(_pIn1.Xflags) & int32(128)) != int32(0) {
 53066  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84394), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62214)))
 53067  			crt.X__builtin_abort(tls)
 53068  		}
 53069  	}()
 53070  	_sqlite3VdbeMemIntegerify(tls, _pIn1)
 53071  	_pIn2 = elem25(_aMem, uintptr(_pOp.Xp2))
 53072  	_sqlite3VdbeMemIntegerify(tls, _pIn2)
 53073  	if (*(*int64)(unsafe.Pointer(&_pIn1.Xu))) < (*(*int64)(unsafe.Pointer(&_pIn2.Xu))) {
 53074  		*(*int64)(unsafe.Pointer(&_pIn1.Xu)) = *(*int64)(unsafe.Pointer(&_pIn2.Xu))
 53075  	}
 53076  	goto _250
 53077  _218:
 53078  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 53079  	func() {
 53080  		if (int32(_pIn1.Xflags) & int32(4)) == 0 {
 53081  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84417), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69306)))
 53082  			crt.X__builtin_abort(tls)
 53083  		}
 53084  	}()
 53085  	if (*(*int64)(unsafe.Pointer(&_pIn1.Xu))) > (0) {
 53086  		*(*int64)(unsafe.Pointer(&_pIn1.Xu)) -= int64(_pOp.Xp3)
 53087  		goto _jump_to_p2
 53088  	}
 53089  	goto _250
 53090  _219:
 53091  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 53092  	_pIn3 = elem25(_aMem, uintptr(_pOp.Xp3))
 53093  	_pOut = _out2Prerelease(tls, _p, _pOp)
 53094  	func() {
 53095  		if (int32(_pIn1.Xflags) & int32(4)) == 0 {
 53096  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84449), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69326)))
 53097  			crt.X__builtin_abort(tls)
 53098  		}
 53099  	}()
 53100  	func() {
 53101  		if (int32(_pIn3.Xflags) & int32(4)) == 0 {
 53102  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84450), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61948)))
 53103  			crt.X__builtin_abort(tls)
 53104  		}
 53105  	}()
 53106  	_479_x = *(*int64)(unsafe.Pointer(&_pIn1.Xu))
 53107  	if (_479_x <= (0)) || _sqlite3AddInt64(tls, &_479_x, func() int64 {
 53108  		if (*(*int64)(unsafe.Pointer(&_pIn3.Xu))) > (0) {
 53109  			return (*(*int64)(unsafe.Pointer(&_pIn3.Xu)))
 53110  		}
 53111  		return (0)
 53112  	}()) != 0 {
 53113  		*(*int64)(unsafe.Pointer(&_pOut.Xu)) = int64(-1)
 53114  		goto _1897
 53115  	}
 53116  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = _479_x
 53117  _1897:
 53118  	goto _250
 53119  _220:
 53120  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 53121  	func() {
 53122  		if (int32(_pIn1.Xflags) & int32(4)) == 0 {
 53123  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84477), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69306)))
 53124  			crt.X__builtin_abort(tls)
 53125  		}
 53126  	}()
 53127  	if (*(*int64)(unsafe.Pointer(&_pIn1.Xu))) == 0 {
 53128  		goto _1900
 53129  	}
 53130  	if (*(*int64)(unsafe.Pointer(&_pIn1.Xu))) > (0) {
 53131  		*(*int64)(unsafe.Pointer(&_pIn1.Xu)) -= 1
 53132  	}
 53133  	goto _jump_to_p2
 53134  _1900:
 53135  	goto _250
 53136  _221:
 53137  	_pIn1 = elem25(_aMem, uintptr(_pOp.Xp1))
 53138  	func() {
 53139  		if (int32(_pIn1.Xflags) & int32(4)) == 0 {
 53140  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84494), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69306)))
 53141  			crt.X__builtin_abort(tls)
 53142  		}
 53143  	}()
 53144  	if (*(*int64)(unsafe.Pointer(&_pIn1.Xu))) > int64(-9223372036854775808) {
 53145  		*(*int64)(unsafe.Pointer(&_pIn1.Xu)) -= 1
 53146  	}
 53147  	if (*(*int64)(unsafe.Pointer(&_pIn1.Xu))) == (0) {
 53148  		goto _jump_to_p2
 53149  	}
 53150  	goto _250
 53151  _222:
 53152  	func() {
 53153  		if int32(_pOp.Xp4type) != int32(-4) {
 53154  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84534), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62559)))
 53155  			crt.X__builtin_abort(tls)
 53156  		}
 53157  	}()
 53158  	_485_n = int32(_pOp.Xp5)
 53159  	func() {
 53160  		if _pOp.Xp3 <= int32(0) || _pOp.Xp3 > ((_p.XnMem+int32(1))-_p.XnCursor) {
 53161  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84536), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62583)))
 53162  			crt.X__builtin_abort(tls)
 53163  		}
 53164  	}()
 53165  	func() {
 53166  		if _485_n != int32(0) && (_pOp.Xp2 <= int32(0) || (_pOp.Xp2+_485_n) > (((_p.XnMem+int32(1))-_p.XnCursor)+int32(1))) {
 53167  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84537), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62630)))
 53168  			crt.X__builtin_abort(tls)
 53169  		}
 53170  	}()
 53171  	func() {
 53172  		if _pOp.Xp3 >= _pOp.Xp2 && _pOp.Xp3 < (_pOp.Xp2+_485_n) {
 53173  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84538), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62691)))
 53174  			crt.X__builtin_abort(tls)
 53175  		}
 53176  	}()
 53177  	_485_pCtx = (*Xsqlite3_context)(_sqlite3DbMallocRawNN(tls, _db, uint64(uint32(32)+(uint32(_485_n-int32(1))*uint32(4)))))
 53178  	if _485_pCtx == nil {
 53179  		goto _no_mem
 53180  	}
 53181  	*(**XMem)(unsafe.Pointer(&_485_pCtx.XpMem)) = nil
 53182  	*(**XFuncDef)(unsafe.Pointer(&_485_pCtx.XpFunc)) = (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 53183  	_485_pCtx.XiOp = int32((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 24)
 53184  	*(**TVdbe)(unsafe.Pointer(&_485_pCtx.XpVdbe)) = _p
 53185  	_485_pCtx.Xargc = uint8(_485_n)
 53186  	_pOp.Xp4type = int8(-16)
 53187  	*(**Xsqlite3_context)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))) = _485_pCtx
 53188  	_pOp.Xopcode = uint8(151)
 53189  _223:
 53190  	func() {
 53191  		if int32(_pOp.Xp4type) != int32(-16) {
 53192  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84557), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62729)))
 53193  			crt.X__builtin_abort(tls)
 53194  		}
 53195  	}()
 53196  	_486_pCtx = (*Xsqlite3_context)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 53197  	_486_pMem = elem25(_aMem, uintptr(_pOp.Xp3))
 53198  	if (*XMem)(_486_pCtx.XpMem) == _486_pMem {
 53199  		goto _1921
 53200  	}
 53201  	*(**XMem)(unsafe.Pointer(&_486_pCtx.XpMem)) = _486_pMem
 53202  	_486_i = int32(_486_pCtx.Xargc) - int32(1)
 53203  _1922:
 53204  	if _486_i < int32(0) {
 53205  		goto _1925
 53206  	}
 53207  	*elem19((**XMem)(unsafe.Pointer(&_486_pCtx.Xargv)), uintptr(_486_i)) = elem25(_aMem, uintptr(_pOp.Xp2+_486_i))
 53208  	_486_i -= 1
 53209  	goto _1922
 53210  _1925:
 53211  _1921:
 53212  	_486_i = int32(0)
 53213  _1926:
 53214  	if _486_i >= int32(_486_pCtx.Xargc) {
 53215  		goto _1929
 53216  	}
 53217  	func() {
 53218  		if (int32((*elem19((**XMem)(unsafe.Pointer(&_486_pCtx.Xargv)), uintptr(_486_i))).Xflags) & int32(128)) != int32(0) {
 53219  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84572), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62753)))
 53220  			crt.X__builtin_abort(tls)
 53221  		}
 53222  	}()
 53223  	if (_db.Xflags & int32(1)) != 0 {
 53224  		_registerTrace(tls, _pOp.Xp2+_486_i, *elem19((**XMem)(unsafe.Pointer(&_486_pCtx.Xargv)), uintptr(_486_i)))
 53225  	}
 53226  	_486_i += 1
 53227  	goto _1926
 53228  _1929:
 53229  	_486_pMem.Xn += 1
 53230  	_sqlite3VdbeMemInit(tls, &_486_t, _db, uint16(1))
 53231  	*(**XMem)(unsafe.Pointer(&_486_pCtx.XpOut)) = &_486_t
 53232  	_486_pCtx.XfErrorOrAux = 0
 53233  	_486_pCtx.XskipFlag = 0
 53234  	func() func(*crt.TLS, *Xsqlite3_context, int32, **XMem) {
 53235  		v := (*XFuncDef)(_486_pCtx.XpFunc).XxSFunc
 53236  		return *(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer(&v))
 53237  	}()(tls, _486_pCtx, int32(_486_pCtx.Xargc), (**XMem)(unsafe.Pointer(&_486_pCtx.Xargv)))
 53238  	if _486_pCtx.XfErrorOrAux == 0 {
 53239  		goto _1933
 53240  	}
 53241  	if _486_pCtx.XisError != 0 {
 53242  		_sqlite3VdbeError(tls, _p, str(24531), unsafe.Pointer(Xsqlite3_value_text(tls, &_486_t)))
 53243  		_rc = _486_pCtx.XisError
 53244  	}
 53245  	_sqlite3VdbeMemRelease(tls, &_486_t)
 53246  	if _rc != 0 {
 53247  		goto _abort_due_to_error
 53248  	}
 53249  	goto _1936
 53250  _1933:
 53251  	func() {
 53252  		if int32(_486_t.Xflags) != int32(1) {
 53253  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84591), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69348)))
 53254  			crt.X__builtin_abort(tls)
 53255  		}
 53256  	}()
 53257  _1936:
 53258  	if _486_pCtx.XskipFlag == 0 {
 53259  		goto _1939
 53260  	}
 53261  	func() {
 53262  		if int32(elem61(_pOp, uintptr(4294967295)).Xopcode) != int32(68) {
 53263  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84594), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69366)))
 53264  			crt.X__builtin_abort(tls)
 53265  		}
 53266  	}()
 53267  	_486_i = elem61(_pOp, uintptr(4294967295)).Xp1
 53268  	if _486_i != 0 {
 53269  		_sqlite3VdbeMemSetInt64(tls, elem25(_aMem, uintptr(_486_i)), int64(1))
 53270  	}
 53271  _1939:
 53272  	goto _250
 53273  _224:
 53274  	func() {
 53275  		if _pOp.Xp1 <= int32(0) || _pOp.Xp1 > ((_p.XnMem+int32(1))-_p.XnCursor) {
 53276  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84616), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61291)))
 53277  			crt.X__builtin_abort(tls)
 53278  		}
 53279  	}()
 53280  	_493_pMem = elem25(_aMem, uintptr(_pOp.Xp1))
 53281  	func() {
 53282  		if (int32(_493_pMem.Xflags) & int32(-8194)) != int32(0) {
 53283  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84618), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69393)))
 53284  			crt.X__builtin_abort(tls)
 53285  		}
 53286  	}()
 53287  	_rc = _sqlite3VdbeMemFinalize(tls, _493_pMem, (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))))
 53288  	if _rc != 0 {
 53289  		_sqlite3VdbeError(tls, _p, str(24531), unsafe.Pointer(Xsqlite3_value_text(tls, _493_pMem)))
 53290  		goto _abort_due_to_error
 53291  	}
 53292  	_sqlite3VdbeChangeEncoding(tls, _493_pMem, int32(_encoding))
 53293  	if _sqlite3VdbeMemTooBig(tls, _493_pMem) != 0 {
 53294  		goto _too_big
 53295  	}
 53296  	goto _250
 53297  _225:
 53298  	func() {
 53299  		if int32((uint32(_p.Xexpired>>7)<<31)>>31) != int32(0) {
 53300  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84649), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65412)))
 53301  			crt.X__builtin_abort(tls)
 53302  		}
 53303  	}()
 53304  	*elem8((*int32)(unsafe.Pointer(&_496_aRes)), 0) = int32(0)
 53305  	*elem8((*int32)(unsafe.Pointer(&_496_aRes)), uintptr(1)) = store2(elem8((*int32)(unsafe.Pointer(&_496_aRes)), uintptr(2)), int32(-1))
 53306  	func() {
 53307  		if _pOp.Xp2 != int32(0) && _pOp.Xp2 != int32(1) && _pOp.Xp2 != int32(2) && _pOp.Xp2 != int32(3) {
 53308  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84652), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69432)))
 53309  			crt.X__builtin_abort(tls)
 53310  		}
 53311  	}()
 53312  	_rc = _sqlite3Checkpoint(tls, _db, _pOp.Xp1, _pOp.Xp2, elem8((*int32)(unsafe.Pointer(&_496_aRes)), uintptr(1)), elem8((*int32)(unsafe.Pointer(&_496_aRes)), uintptr(2)))
 53313  	if _rc == 0 {
 53314  		goto _1957
 53315  	}
 53316  	if _rc != int32(5) {
 53317  		goto _abort_due_to_error
 53318  	}
 53319  	_rc = int32(0)
 53320  	*elem8((*int32)(unsafe.Pointer(&_496_aRes)), 0) = int32(1)
 53321  _1957:
 53322  	*func() **XMem { _496_i = int32(0); return &_496_pMem }() = elem25(_aMem, uintptr(_pOp.Xp3))
 53323  _1959:
 53324  	if _496_i >= int32(3) {
 53325  		goto _1962
 53326  	}
 53327  	_sqlite3VdbeMemSetInt64(tls, _496_pMem, int64(*elem8((*int32)(unsafe.Pointer(&_496_aRes)), uintptr(_496_i))))
 53328  	*(*uintptr)(unsafe.Pointer(func() **XMem { _496_i += 1; return &_496_pMem }())) += uintptr(48)
 53329  	goto _1959
 53330  _1962:
 53331  	goto _250
 53332  _226:
 53333  	_pOut = _out2Prerelease(tls, _p, _pOp)
 53334  	_499_eNew = _pOp.Xp3
 53335  	func() {
 53336  		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) {
 53337  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84693), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69579)))
 53338  			crt.X__builtin_abort(tls)
 53339  		}
 53340  	}()
 53341  	func() {
 53342  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _db.XnDb {
 53343  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84701), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65140)))
 53344  			crt.X__builtin_abort(tls)
 53345  		}
 53346  	}()
 53347  	func() {
 53348  		if int32((uint32(_p.Xexpired>>7)<<31)>>31) != int32(0) {
 53349  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84702), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65412)))
 53350  			crt.X__builtin_abort(tls)
 53351  		}
 53352  	}()
 53353  	_499_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_pOp.Xp1)).XpBt)
 53354  	_499_pPager = _sqlite3BtreePager(tls, _499_pBt)
 53355  	_499_eOld = _sqlite3PagerGetJournalMode(tls, _499_pPager)
 53356  	if _499_eNew == int32(-1) {
 53357  		_499_eNew = _499_eOld
 53358  	}
 53359  	if _sqlite3PagerOkToChangeJournalMode(tls, _499_pPager) == 0 {
 53360  		_499_eNew = _499_eOld
 53361  	}
 53362  	_499_zFilename = _sqlite3PagerFilename(tls, _499_pPager, int32(1))
 53363  	if (_499_eNew == int32(5)) && ((_sqlite3Strlen30(tls, _499_zFilename) == int32(0)) || (_sqlite3PagerWalSupported(tls, _499_pPager) == 0)) {
 53364  		_499_eNew = _499_eOld
 53365  	}
 53366  	if _499_eNew == _499_eOld || _499_eOld != int32(5) && _499_eNew != int32(5) {
 53367  		goto _1983
 53368  	}
 53369  	if (_db.XautoCommit == 0) || (_db.XnVdbeRead > int32(1)) {
 53370  		_rc = int32(1)
 53371  		_sqlite3VdbeError(tls, _p, str(69810), unsafe.Pointer(func() *int8 {
 53372  			if _499_eNew == int32(5) {
 53373  				return str(69862)
 53374  			}
 53375  			return str(69867)
 53376  		}()))
 53377  		goto _abort_due_to_error
 53378  	}
 53379  	if _499_eOld != int32(5) {
 53380  		goto _1989
 53381  	}
 53382  	_rc = _sqlite3PagerCloseWal(tls, _499_pPager, _db)
 53383  	if _rc == int32(0) {
 53384  		_sqlite3PagerSetJournalMode(tls, _499_pPager, _499_eNew)
 53385  	}
 53386  	goto _1992
 53387  _1989:
 53388  	if _499_eOld == int32(4) {
 53389  		_sqlite3PagerSetJournalMode(tls, _499_pPager, int32(2))
 53390  	}
 53391  _1992:
 53392  	func() {
 53393  		if _sqlite3BtreeIsInTrans(tls, _499_pBt) != int32(0) {
 53394  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84754), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69874)))
 53395  			crt.X__builtin_abort(tls)
 53396  		}
 53397  	}()
 53398  	if _rc == int32(0) {
 53399  		_rc = _sqlite3BtreeSetVersion(tls, _499_pBt, func() int32 {
 53400  			if _499_eNew == int32(5) {
 53401  				return int32(2)
 53402  			}
 53403  			return int32(1)
 53404  		}())
 53405  	}
 53406  _1983:
 53407  	if _rc != 0 {
 53408  		_499_eNew = _499_eOld
 53409  	}
 53410  	_499_eNew = _sqlite3PagerSetJournalMode(tls, _499_pPager, _499_eNew)
 53411  	_pOut.Xflags = uint16(2562)
 53412  	_pOut.Xz = _sqlite3JournalModename(tls, _499_eNew)
 53413  	_pOut.Xn = _sqlite3Strlen30(tls, _pOut.Xz)
 53414  	_pOut.Xenc = uint8(1)
 53415  	_sqlite3VdbeChangeEncoding(tls, _pOut, int32(_encoding))
 53416  	if _rc != 0 {
 53417  		goto _abort_due_to_error
 53418  	}
 53419  	goto _250
 53420  _227:
 53421  	func() {
 53422  		if int32((uint32(_p.Xexpired>>7)<<31)>>31) != int32(0) {
 53423  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84782), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65412)))
 53424  			crt.X__builtin_abort(tls)
 53425  		}
 53426  	}()
 53427  	_rc = _sqlite3RunVacuum(tls, &_p.XzErrMsg, _db, _pOp.Xp1)
 53428  	if _rc != 0 {
 53429  		goto _abort_due_to_error
 53430  	}
 53431  	goto _250
 53432  _228:
 53433  	func() {
 53434  		if _pOp.Xp1 < int32(0) || _pOp.Xp1 >= _db.XnDb {
 53435  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84799), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65140)))
 53436  			crt.X__builtin_abort(tls)
 53437  		}
 53438  	}()
 53439  	func() {
 53440  		if (_p.XbtreeMask & (uint32(1) << uint(_pOp.Xp1))) == (0) {
 53441  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84800), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65170)))
 53442  			crt.X__builtin_abort(tls)
 53443  		}
 53444  	}()
 53445  	func() {
 53446  		if int32((uint32(_p.Xexpired>>7)<<31)>>31) != int32(0) {
 53447  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84801), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65412)))
 53448  			crt.X__builtin_abort(tls)
 53449  		}
 53450  	}()
 53451  	_509_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_pOp.Xp1)).XpBt)
 53452  	_rc = _sqlite3BtreeIncrVacuum(tls, _509_pBt)
 53453  	if _rc == 0 {
 53454  		goto _2010
 53455  	}
 53456  	if _rc != int32(101) {
 53457  		goto _abort_due_to_error
 53458  	}
 53459  	_rc = int32(0)
 53460  	goto _jump_to_p2
 53461  _2010:
 53462  	goto _250
 53463  _229:
 53464  	if _pOp.Xp1 == 0 {
 53465  		_sqlite3ExpirePreparedStatements(tls, _db)
 53466  		goto _2013
 53467  	}
 53468  	storebits26(&_p.Xexpired, int16(1), 1, 0)
 53469  _2013:
 53470  	goto _250
 53471  _230:
 53472  	_514_isWriteLock = uint8(_pOp.Xp3)
 53473  	if _514_isWriteLock == 0 && int32(0) != (_db.Xflags&int32(16384)) {
 53474  		goto _2015
 53475  	}
 53476  	_515_p1 = _pOp.Xp1
 53477  	func() {
 53478  		if _515_p1 < int32(0) || _515_p1 >= _db.XnDb {
 53479  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84853), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69904)))
 53480  			crt.X__builtin_abort(tls)
 53481  		}
 53482  	}()
 53483  	func() {
 53484  		if (_p.XbtreeMask & (uint32(1) << uint(_515_p1))) == (0) {
 53485  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84854), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69924)))
 53486  			crt.X__builtin_abort(tls)
 53487  		}
 53488  	}()
 53489  	func() {
 53490  		if int32(_514_isWriteLock) != int32(0) && int32(_514_isWriteLock) != int32(1) {
 53491  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84855), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(69953)))
 53492  			crt.X__builtin_abort(tls)
 53493  		}
 53494  	}()
 53495  	_rc = _sqlite3BtreeLockTable(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_515_p1)).XpBt), _pOp.Xp2, _514_isWriteLock)
 53496  	if _rc == 0 {
 53497  		goto _2024
 53498  	}
 53499  	if (_rc & int32(255)) == int32(6) {
 53500  		_517_z = *(**int8)(unsafe.Pointer(&_pOp.Xp4))
 53501  		_sqlite3VdbeError(tls, _p, str(69986), unsafe.Pointer(_517_z))
 53502  	}
 53503  	goto _abort_due_to_error
 53504  _2024:
 53505  _2015:
 53506  	goto _250
 53507  _231:
 53508  	_518_pVTab = (*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 53509  	_rc = _sqlite3VtabBegin(tls, _db, _518_pVTab)
 53510  	if _518_pVTab != nil {
 53511  		_sqlite3VtabImportErrmsg(tls, _p, (*Xsqlite3_vtab)(_518_pVTab.XpVtab))
 53512  	}
 53513  	if _rc != 0 {
 53514  		goto _abort_due_to_error
 53515  	}
 53516  	goto _250
 53517  _232:
 53518  	crt.Xmemset(tls, unsafe.Pointer(&_519_sMem), int32(0), uint32(48))
 53519  	*(**Xsqlite3)(unsafe.Pointer(&_519_sMem.Xdb)) = _db
 53520  	func() {
 53521  		if (int32(elem25(_aMem, uintptr(_pOp.Xp2)).Xflags) & int32(2)) == int32(0) {
 53522  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84903), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70015)))
 53523  			crt.X__builtin_abort(tls)
 53524  		}
 53525  	}()
 53526  	func() {
 53527  		if (int32(elem25(_aMem, uintptr(_pOp.Xp2)).Xflags) & int32(2048)) == int32(0) {
 53528  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84904), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70050)))
 53529  			crt.X__builtin_abort(tls)
 53530  		}
 53531  	}()
 53532  	_rc = _sqlite3VdbeMemCopy(tls, &_519_sMem, elem25(_aMem, uintptr(_pOp.Xp2)))
 53533  	func() {
 53534  		if _rc != int32(0) {
 53535  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84906), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(14967)))
 53536  			crt.X__builtin_abort(tls)
 53537  		}
 53538  	}()
 53539  	_519_zTab = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, &_519_sMem)))
 53540  	func() {
 53541  		if _519_zTab == nil && _db.XmallocFailed == 0 {
 53542  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84908), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70088)))
 53543  			crt.X__builtin_abort(tls)
 53544  		}
 53545  	}()
 53546  	if _519_zTab != nil {
 53547  		_rc = _sqlite3VtabCallCreate(tls, _db, _pOp.Xp1, _519_zTab, &_p.XzErrMsg)
 53548  	}
 53549  	_sqlite3VdbeMemRelease(tls, &_519_sMem)
 53550  	if _rc != 0 {
 53551  		goto _abort_due_to_error
 53552  	}
 53553  	goto _250
 53554  _233:
 53555  	_db.XnVDestroy += 1
 53556  	_rc = _sqlite3VtabCallDestroy(tls, _db, _pOp.Xp1, *(**int8)(unsafe.Pointer(&_pOp.Xp4)))
 53557  	_db.XnVDestroy -= 1
 53558  	if _rc != 0 {
 53559  		goto _abort_due_to_error
 53560  	}
 53561  	goto _250
 53562  _234:
 53563  	func() {
 53564  		if ((uint32(_p.Xexpired>>8) << 31) >> 31) == 0 {
 53565  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84946), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(64582)))
 53566  			crt.X__builtin_abort(tls)
 53567  		}
 53568  	}()
 53569  	_522_pCur = nil
 53570  	_522_pVCur = nil
 53571  	_522_pVtab = (*Xsqlite3_vtab)((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))).XpVtab)
 53572  	if (_522_pVtab == nil) || func() int32 {
 53573  		if (*Xsqlite3_module)(_522_pVtab.XpModule) == nil {
 53574  			return func() int32 {
 53575  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84950), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(4809)))
 53576  				crt.X__builtin_abort(tls)
 53577  				return int32(1)
 53578  			}()
 53579  		}
 53580  		return int32(0)
 53581  	}() != 0 {
 53582  		_rc = int32(6)
 53583  		goto _abort_due_to_error
 53584  	}
 53585  	_522_pModule = (*Xsqlite3_module)(_522_pVtab.XpModule)
 53586  	_rc = func() func(*crt.TLS, *Xsqlite3_vtab, **Xsqlite3_vtab_cursor) int32 {
 53587  		v := _522_pModule.XxOpen
 53588  		return *(*func(*crt.TLS, *Xsqlite3_vtab, **Xsqlite3_vtab_cursor) int32)(unsafe.Pointer(&v))
 53589  	}()(tls, _522_pVtab, &_522_pVCur)
 53590  	_sqlite3VtabImportErrmsg(tls, _p, _522_pVtab)
 53591  	if _rc != 0 {
 53592  		goto _abort_due_to_error
 53593  	}
 53594  	*(**Xsqlite3_vtab)(unsafe.Pointer(&_522_pVCur.XpVtab)) = _522_pVtab
 53595  	_522_pCur = _allocateCursor(tls, _p, _pOp.Xp1, int32(0), int32(-1), uint8(2))
 53596  	if _522_pCur != nil {
 53597  		*(**Xsqlite3_vtab_cursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_522_pCur.Xuc)))) = _522_pVCur
 53598  		_522_pVtab.XnRef += 1
 53599  		goto _2048
 53600  	}
 53601  	func() {
 53602  		if _db.XmallocFailed == 0 {
 53603  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(84968), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(47803)))
 53604  			crt.X__builtin_abort(tls)
 53605  		}
 53606  	}()
 53607  	func() func(*crt.TLS, *Xsqlite3_vtab_cursor) int32 {
 53608  		v := _522_pModule.XxClose
 53609  		return *(*func(*crt.TLS, *Xsqlite3_vtab_cursor) int32)(unsafe.Pointer(&v))
 53610  	}()(tls, _522_pVCur)
 53611  	goto _no_mem
 53612  _2048:
 53613  	goto _250
 53614  _235:
 53615  	_526_pQuery = elem25(_aMem, uintptr(_pOp.Xp3))
 53616  	_526_pArgc = elem25(_526_pQuery, uintptr(1))
 53617  	_526_pCur = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 53618  	func() {
 53619  		if (int32(_526_pQuery.Xflags) & int32(128)) != int32(0) {
 53620  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85012), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70113)))
 53621  			crt.X__builtin_abort(tls)
 53622  		}
 53623  	}()
 53624  	if (_db.Xflags & int32(1)) != 0 {
 53625  		_registerTrace(tls, _pOp.Xp3, _526_pQuery)
 53626  	}
 53627  	func() {
 53628  		if int32(_526_pCur.XeCurType) != int32(2) {
 53629  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85014), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70132)))
 53630  			crt.X__builtin_abort(tls)
 53631  		}
 53632  	}()
 53633  	_526_pVCur = (*Xsqlite3_vtab_cursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_526_pCur.Xuc)))
 53634  	_526_pVtab = (*Xsqlite3_vtab)(_526_pVCur.XpVtab)
 53635  	_526_pModule = (*Xsqlite3_module)(_526_pVtab.XpModule)
 53636  	func() {
 53637  		if (int32(_526_pQuery.Xflags)&int32(4)) == int32(0) || int32(_526_pArgc.Xflags) != int32(4) {
 53638  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85020), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70161)))
 53639  			crt.X__builtin_abort(tls)
 53640  		}
 53641  	}()
 53642  	_526_nArg = int32(*(*int64)(unsafe.Pointer(&_526_pArgc.Xu)))
 53643  	_526_iQuery = int32(*(*int64)(unsafe.Pointer(&_526_pQuery.Xu)))
 53644  	_526_res = int32(0)
 53645  	_526_apArg = (**XMem)(unsafe.Pointer(_p.XapArg))
 53646  	_526_i = int32(0)
 53647  _2059:
 53648  	if _526_i >= _526_nArg {
 53649  		goto _2062
 53650  	}
 53651  	*elem19(_526_apArg, uintptr(_526_i)) = elem25(_526_pArgc, uintptr(_526_i+int32(1)))
 53652  	_526_i += 1
 53653  	goto _2059
 53654  _2062:
 53655  	_rc = func() func(*crt.TLS, *Xsqlite3_vtab_cursor, int32, *int8, int32, **XMem) int32 {
 53656  		v := _526_pModule.XxFilter
 53657  		return *(*func(*crt.TLS, *Xsqlite3_vtab_cursor, int32, *int8, int32, **XMem) int32)(unsafe.Pointer(&v))
 53658  	}()(tls, _526_pVCur, _526_iQuery, *(**int8)(unsafe.Pointer(&_pOp.Xp4)), _526_nArg, _526_apArg)
 53659  	_sqlite3VtabImportErrmsg(tls, _p, _526_pVtab)
 53660  	if _rc != 0 {
 53661  		goto _abort_due_to_error
 53662  	}
 53663  	_526_res = func() func(*crt.TLS, *Xsqlite3_vtab_cursor) int32 {
 53664  		v := _526_pModule.XxEof
 53665  		return *(*func(*crt.TLS, *Xsqlite3_vtab_cursor) int32)(unsafe.Pointer(&v))
 53666  	}()(tls, _526_pVCur)
 53667  	_526_pCur.XnullRow = 0
 53668  	if _526_res != 0 {
 53669  		goto _jump_to_p2
 53670  	}
 53671  	goto _250
 53672  _236:
 53673  	_528_pCur = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 53674  	func() {
 53675  		if int32(_528_pCur.XeCurType) != int32(2) {
 53676  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85056), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70132)))
 53677  			crt.X__builtin_abort(tls)
 53678  		}
 53679  	}()
 53680  	func() {
 53681  		if _pOp.Xp3 <= int32(0) || _pOp.Xp3 > ((_p.XnMem+int32(1))-_p.XnCursor) {
 53682  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85057), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(62583)))
 53683  			crt.X__builtin_abort(tls)
 53684  		}
 53685  	}()
 53686  	_528_pDest = elem25(_aMem, uintptr(_pOp.Xp3))
 53687  	_sqlite3VdbeMemAboutToChange(tls, _p, _528_pDest)
 53688  	if _528_pCur.XnullRow != 0 {
 53689  		_sqlite3VdbeMemSetNull(tls, _528_pDest)
 53690  		goto _250
 53691  	}
 53692  	_528_pVtab = (*Xsqlite3_vtab)((*Xsqlite3_vtab_cursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_528_pCur.Xuc))).XpVtab)
 53693  	_528_pModule = (*Xsqlite3_module)(_528_pVtab.XpModule)
 53694  	func() {
 53695  		if _528_pModule.XxColumn == nil {
 53696  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85066), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70213)))
 53697  			crt.X__builtin_abort(tls)
 53698  		}
 53699  	}()
 53700  	crt.Xmemset(tls, unsafe.Pointer(&_528_sContext), int32(0), uint32(32))
 53701  	*(**XMem)(unsafe.Pointer(&_528_sContext.XpOut)) = _528_pDest
 53702  	_528_pDest.Xflags = uint16((int32(_528_pDest.Xflags) & int32(-49664)) | int32(1))
 53703  	_rc = func() func(*crt.TLS, *Xsqlite3_vtab_cursor, *Xsqlite3_context, int32) int32 {
 53704  		v := _528_pModule.XxColumn
 53705  		return *(*func(*crt.TLS, *Xsqlite3_vtab_cursor, *Xsqlite3_context, int32) int32)(unsafe.Pointer(&v))
 53706  	}()(tls, (*Xsqlite3_vtab_cursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_528_pCur.Xuc))), &_528_sContext, _pOp.Xp2)
 53707  	_sqlite3VtabImportErrmsg(tls, _p, _528_pVtab)
 53708  	if _528_sContext.XisError != 0 {
 53709  		_rc = _528_sContext.XisError
 53710  	}
 53711  	_sqlite3VdbeChangeEncoding(tls, _528_pDest, int32(_encoding))
 53712  	if (_db.Xflags & int32(1)) != 0 {
 53713  		_registerTrace(tls, _pOp.Xp3, _528_pDest)
 53714  	}
 53715  	if _sqlite3VdbeMemTooBig(tls, _528_pDest) != 0 {
 53716  		goto _too_big
 53717  	}
 53718  	if _rc != 0 {
 53719  		goto _abort_due_to_error
 53720  	}
 53721  	goto _250
 53722  _237:
 53723  	_532_res = int32(0)
 53724  	_532_pCur = *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_pOp.Xp1))
 53725  	func() {
 53726  		if int32(_532_pCur.XeCurType) != int32(2) {
 53727  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85102), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70132)))
 53728  			crt.X__builtin_abort(tls)
 53729  		}
 53730  	}()
 53731  	if _532_pCur.XnullRow != 0 {
 53732  		goto _250
 53733  	}
 53734  	_532_pVtab = (*Xsqlite3_vtab)((*Xsqlite3_vtab_cursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_532_pCur.Xuc))).XpVtab)
 53735  	_532_pModule = (*Xsqlite3_module)(_532_pVtab.XpModule)
 53736  	func() {
 53737  		if _532_pModule.XxNext == nil {
 53738  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85108), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70230)))
 53739  			crt.X__builtin_abort(tls)
 53740  		}
 53741  	}()
 53742  	_rc = func() func(*crt.TLS, *Xsqlite3_vtab_cursor) int32 {
 53743  		v := _532_pModule.XxNext
 53744  		return *(*func(*crt.TLS, *Xsqlite3_vtab_cursor) int32)(unsafe.Pointer(&v))
 53745  	}()(tls, (*Xsqlite3_vtab_cursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_532_pCur.Xuc))))
 53746  	_sqlite3VtabImportErrmsg(tls, _p, _532_pVtab)
 53747  	if _rc != 0 {
 53748  		goto _abort_due_to_error
 53749  	}
 53750  	_532_res = func() func(*crt.TLS, *Xsqlite3_vtab_cursor) int32 {
 53751  		v := _532_pModule.XxEof
 53752  		return *(*func(*crt.TLS, *Xsqlite3_vtab_cursor) int32)(unsafe.Pointer(&v))
 53753  	}()(tls, (*Xsqlite3_vtab_cursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_532_pCur.Xuc))))
 53754  	if _532_res == 0 {
 53755  		goto _jump_to_p2_and_check_for_interrupt
 53756  	}
 53757  	goto _check_for_interrupt
 53758  _238:
 53759  	_535_pVtab = (*Xsqlite3_vtab)((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))).XpVtab)
 53760  	_535_pName = elem25(_aMem, uintptr(_pOp.Xp1))
 53761  	func() {
 53762  		if ((*Xsqlite3_module)(_535_pVtab.XpModule).XxRename) == nil {
 53763  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85142), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70245)))
 53764  			crt.X__builtin_abort(tls)
 53765  		}
 53766  	}()
 53767  	func() {
 53768  		if (int32(_535_pName.Xflags) & int32(128)) != int32(0) {
 53769  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85143), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70269)))
 53770  			crt.X__builtin_abort(tls)
 53771  		}
 53772  	}()
 53773  	func() {
 53774  		if int32((uint32(_p.Xexpired>>7)<<31)>>31) != int32(0) {
 53775  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85144), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65412)))
 53776  			crt.X__builtin_abort(tls)
 53777  		}
 53778  	}()
 53779  	if (_db.Xflags & int32(1)) != 0 {
 53780  		_registerTrace(tls, _pOp.Xp1, _535_pName)
 53781  	}
 53782  	func() {
 53783  		if (int32(_535_pName.Xflags) & int32(2)) == 0 {
 53784  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85146), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70287)))
 53785  			crt.X__builtin_abort(tls)
 53786  		}
 53787  	}()
 53788  	_rc = _sqlite3VdbeChangeEncoding(tls, _535_pName, int32(1))
 53789  	if _rc != 0 {
 53790  		goto _abort_due_to_error
 53791  	}
 53792  	_rc = func() func(*crt.TLS, *Xsqlite3_vtab, *int8) int32 {
 53793  		v := (*Xsqlite3_module)(_535_pVtab.XpModule).XxRename
 53794  		return *(*func(*crt.TLS, *Xsqlite3_vtab, *int8) int32)(unsafe.Pointer(&v))
 53795  	}()(tls, _535_pVtab, _535_pName.Xz)
 53796  	_sqlite3VtabImportErrmsg(tls, _p, _535_pVtab)
 53797  	storebits26(&_p.Xexpired, 0, 1, 0)
 53798  	if _rc != 0 {
 53799  		goto _abort_due_to_error
 53800  	}
 53801  	goto _250
 53802  _239:
 53803  	func() {
 53804  		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) {
 53805  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85197), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70310)))
 53806  			crt.X__builtin_abort(tls)
 53807  		}
 53808  	}()
 53809  	func() {
 53810  		if int32((uint32(_p.Xexpired>>7)<<31)>>31) != int32(0) {
 53811  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85200), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(65412)))
 53812  			crt.X__builtin_abort(tls)
 53813  		}
 53814  	}()
 53815  	_536_pVtab = (*Xsqlite3_vtab)((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))).XpVtab)
 53816  	if (_536_pVtab == nil) || func() int32 {
 53817  		if (*Xsqlite3_module)(_536_pVtab.XpModule) == nil {
 53818  			return func() int32 {
 53819  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85202), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(4809)))
 53820  				crt.X__builtin_abort(tls)
 53821  				return int32(1)
 53822  			}()
 53823  		}
 53824  		return int32(0)
 53825  	}() != 0 {
 53826  		_rc = int32(6)
 53827  		goto _abort_due_to_error
 53828  	}
 53829  	_536_pModule = (*Xsqlite3_module)(_536_pVtab.XpModule)
 53830  	_536_nArg = _pOp.Xp2
 53831  	func() {
 53832  		if int32(_pOp.Xp4type) != int32(-8) {
 53833  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85208), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70431)))
 53834  			crt.X__builtin_abort(tls)
 53835  		}
 53836  	}()
 53837  	if func() int32 {
 53838  		if _536_pModule.XxUpdate != nil {
 53839  			return int32(1)
 53840  		}
 53841  		return func() int32 {
 53842  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85209), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(4809)))
 53843  			crt.X__builtin_abort(tls)
 53844  			return int32(0)
 53845  		}()
 53846  	}() == 0 {
 53847  		goto _2112
 53848  	}
 53849  	_538_vtabOnConflict = _db.XvtabOnConflict
 53850  	_536_apArg = (**XMem)(unsafe.Pointer(_p.XapArg))
 53851  	_536_pX = elem25(_aMem, uintptr(_pOp.Xp3))
 53852  	_536_i = int32(0)
 53853  _2113:
 53854  	if _536_i >= _536_nArg {
 53855  		goto _2116
 53856  	}
 53857  	func() {
 53858  		if (int32(_536_pX.Xflags) & int32(128)) != int32(0) {
 53859  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85214), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70452)))
 53860  			crt.X__builtin_abort(tls)
 53861  		}
 53862  	}()
 53863  	_sqlite3VdbeMemAboutToChange(tls, _p, _536_pX)
 53864  	*elem19(_536_apArg, uintptr(_536_i)) = _536_pX
 53865  	*(*uintptr)(unsafe.Pointer(&_536_pX)) += uintptr(48)
 53866  	_536_i += 1
 53867  	goto _2113
 53868  _2116:
 53869  	_db.XvtabOnConflict = uint8(_pOp.Xp5)
 53870  	_rc = func() func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32 {
 53871  		v := _536_pModule.XxUpdate
 53872  		return *(*func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32)(unsafe.Pointer(&v))
 53873  	}()(tls, _536_pVtab, _536_nArg, _536_apArg, &_536_rowid)
 53874  	_db.XvtabOnConflict = _538_vtabOnConflict
 53875  	_sqlite3VtabImportErrmsg(tls, _p, _536_pVtab)
 53876  	if (_rc == int32(0)) && _pOp.Xp1 != 0 {
 53877  		func() {
 53878  			if _536_nArg <= int32(1) || (*elem19(_536_apArg, 0)) == nil || (int32((*elem19(_536_apArg, 0)).Xflags)&int32(1)) == 0 {
 53879  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85224), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70467)))
 53880  				crt.X__builtin_abort(tls)
 53881  			}
 53882  		}()
 53883  		_db.XlastRowid = _536_rowid
 53884  	}
 53885  	if (_rc&int32(255)) != int32(19) || ((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4))).XbConstraint) == 0 {
 53886  		goto _2126
 53887  	}
 53888  	if int32(_pOp.Xp5) == int32(4) {
 53889  		_rc = int32(0)
 53890  		goto _2128
 53891  	}
 53892  	_p.XerrorAction = uint8(func() int32 {
 53893  		if int32(_pOp.Xp5) == int32(5) {
 53894  			return int32(2)
 53895  		}
 53896  		return int32(_pOp.Xp5)
 53897  	}())
 53898  _2128:
 53899  	goto _2131
 53900  _2126:
 53901  	_p.XnChange += 1
 53902  _2131:
 53903  	if _rc != 0 {
 53904  		goto _abort_due_to_error
 53905  	}
 53906  _2112:
 53907  	goto _250
 53908  _240:
 53909  	_pOut = _out2Prerelease(tls, _p, _pOp)
 53910  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = int64(_sqlite3BtreeLastPage(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_pOp.Xp1)).XpBt)))
 53911  	goto _250
 53912  _241:
 53913  	_pOut = _out2Prerelease(tls, _p, _pOp)
 53914  	_546_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_pOp.Xp1)).XpBt)
 53915  	_546_newMax = 0
 53916  	if _pOp.Xp3 == 0 {
 53917  		goto _2133
 53918  	}
 53919  	_546_newMax = _sqlite3BtreeLastPage(tls, _546_pBt)
 53920  	if _546_newMax < uint32(_pOp.Xp3) {
 53921  		_546_newMax = uint32(_pOp.Xp3)
 53922  	}
 53923  _2133:
 53924  	*(*int64)(unsafe.Pointer(&_pOut.Xu)) = int64(_sqlite3BtreeMaxPageCount(tls, _546_pBt, int32(_546_newMax)))
 53925  	goto _250
 53926  _242:
 53927  	func() {
 53928  		if (*(**int8)(unsafe.Pointer(&_pOp.Xp4))) != nil && crt.Xstrncmp(tls, *(**int8)(unsafe.Pointer(&_pOp.Xp4)), str(70516), uint32(3)) != int32(0) {
 53929  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85309), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70520)))
 53930  			crt.X__builtin_abort(tls)
 53931  		}
 53932  	}()
 53933  	func() {
 53934  		if _pOp != (*XVdbeOp)(_p.XaOp) {
 53935  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85310), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70571)))
 53936  			crt.X__builtin_abort(tls)
 53937  		}
 53938  	}()
 53939  	if (int32(_db.XmTrace)&int32(129)) == int32(0) || ((uint32(_p.Xexpired>>1)<<31)>>31) != 0 || store1(&_548_zTrace, func() *int8 {
 53940  		if (*(**int8)(unsafe.Pointer(&_pOp.Xp4))) != nil {
 53941  			return (*(**int8)(unsafe.Pointer(&_pOp.Xp4)))
 53942  		}
 53943  		return _p.XzSql
 53944  	}()) == nil {
 53945  		goto _2144
 53946  	}
 53947  	if (int32(_db.XmTrace) & int32(128)) != 0 {
 53948  		_550_x = func() func(*crt.TLS, unsafe.Pointer, *int8) {
 53949  			v := _db.XxTrace
 53950  			return *(*func(*crt.TLS, unsafe.Pointer, *int8))(unsafe.Pointer(&v))
 53951  		}()
 53952  		_550_z = _sqlite3VdbeExpandSql(tls, _p, _548_zTrace)
 53953  		_550_x(tls, _db.XpTraceArg, _550_z)
 53954  		Xsqlite3_free(tls, unsafe.Pointer(_550_z))
 53955  		goto _2148
 53956  	}
 53957  	if _db.XnVdbeExec > int32(1) {
 53958  		_551_z = _sqlite3MPrintf(tls, _db, str(70583), unsafe.Pointer(_548_zTrace))
 53959  		_db.XxTrace(tls, uint32(1), _db.XpTraceArg, unsafe.Pointer(_p), unsafe.Pointer(_551_z))
 53960  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_551_z))
 53961  		goto _2148
 53962  	}
 53963  	_db.XxTrace(tls, uint32(1), _db.XpTraceArg, unsafe.Pointer(_p), unsafe.Pointer(_548_zTrace))
 53964  _2148:
 53965  _2144:
 53966  	if ((_db.Xflags & int32(512)) != int32(0)) && (store1(&_548_zTrace, func() *int8 {
 53967  		if (*(**int8)(unsafe.Pointer(&_pOp.Xp4))) != nil {
 53968  			return (*(**int8)(unsafe.Pointer(&_pOp.Xp4)))
 53969  		}
 53970  		return _p.XzSql
 53971  	}()) != nil) {
 53972  		_sqlite3DebugPrintf(tls, str(70589), unsafe.Pointer(_548_zTrace))
 53973  	}
 53974  	func() {
 53975  		if _pOp.Xp2 <= int32(0) {
 53976  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85351), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(61037)))
 53977  			crt.X__builtin_abort(tls)
 53978  		}
 53979  	}()
 53980  	if _pOp.Xp1 < _sqlite3Config.XiOnceResetThreshold {
 53981  		goto _2155
 53982  	}
 53983  	_548_i = int32(1)
 53984  _2156:
 53985  	if _548_i >= _p.XnOp {
 53986  		goto _2159
 53987  	}
 53988  	if int32(elem61((*XVdbeOp)(_p.XaOp), uintptr(_548_i)).Xopcode) == int32(20) {
 53989  		elem61((*XVdbeOp)(_p.XaOp), uintptr(_548_i)).Xp1 = int32(0)
 53990  	}
 53991  	_548_i += 1
 53992  	goto _2156
 53993  _2159:
 53994  	_pOp.Xp1 = int32(0)
 53995  _2155:
 53996  	_pOp.Xp1 += 1
 53997  	goto _jump_to_p2
 53998  _243:
 53999  	func() {
 54000  		if int32(_pOp.Xopcode) != int32(164) && int32(_pOp.Xopcode) != int32(165) {
 54001  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85397), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70604)))
 54002  			crt.X__builtin_abort(tls)
 54003  		}
 54004  	}()
 54005  	goto _250
 54006  _250:
 54007  	func() {
 54008  		if crt.P2U(unsafe.Pointer(_pOp)) < crt.P2U(unsafe.Pointer(elem61(_aOp, uintptr(4294967295)))) || crt.P2U(unsafe.Pointer(_pOp)) >= crt.P2U(unsafe.Pointer(elem61(_aOp, uintptr(_p.XnOp-int32(1))))) {
 54009  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85423), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70652)))
 54010  			crt.X__builtin_abort(tls)
 54011  		}
 54012  	}()
 54013  	if (_db.Xflags & int32(1)) == 0 {
 54014  		goto _2167
 54015  	}
 54016  	_557_opProperty = *elem15((*uint8)(unsafe.Pointer(&_sqlite3OpcodeProperty)), uintptr(_pOrigOp.Xopcode))
 54017  	if _rc != int32(0) {
 54018  		crt.Xprintf(tls, str(70688), _rc)
 54019  	}
 54020  	if (int32(_557_opProperty) & int32(16)) != 0 {
 54021  		_registerTrace(tls, _pOrigOp.Xp2, elem25(_aMem, uintptr(_pOrigOp.Xp2)))
 54022  	}
 54023  	if (int32(_557_opProperty) & int32(32)) != 0 {
 54024  		_registerTrace(tls, _pOrigOp.Xp3, elem25(_aMem, uintptr(_pOrigOp.Xp3)))
 54025  	}
 54026  _2167:
 54027  	*(*uintptr)(unsafe.Pointer(&_pOp)) += uintptr(24)
 54028  	goto _30
 54029  _abort_due_to_error:
 54030  	if _db.XmallocFailed != 0 {
 54031  		_rc = _sqlite3NomemError(tls, int32(85444))
 54032  	}
 54033  	func() {
 54034  		if _rc == 0 {
 54035  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85445), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70695)))
 54036  			crt.X__builtin_abort(tls)
 54037  		}
 54038  	}()
 54039  	if (_p.XzErrMsg == nil) && (_rc != int32(3082)) {
 54040  		_sqlite3VdbeError(tls, _p, str(24531), unsafe.Pointer(_sqlite3ErrStr(tls, _rc)))
 54041  	}
 54042  	_p.Xrc = _rc
 54043  	_sqlite3SystemError(tls, _db, _rc)
 54044  	Xsqlite3_log(tls, _rc, str(70698), int32((uintptr(unsafe.Pointer(_pOp))-uintptr(unsafe.Pointer(_aOp)))/24), unsafe.Pointer(_p.XzSql), unsafe.Pointer(_p.XzErrMsg))
 54045  	_sqlite3VdbeHalt(tls, _p)
 54046  	if _rc == int32(3082) {
 54047  		_sqlite3OomFault(tls, _db)
 54048  	}
 54049  	_rc = int32(1)
 54050  	if int32(_resetSchemaOnFault) > int32(0) {
 54051  		_sqlite3ResetOneSchema(tls, _db, int32(_resetSchemaOnFault)-int32(1))
 54052  	}
 54053  _vdbe_return:
 54054  	*elem7((*uint32)(unsafe.Pointer(&_p.XaCounter)), uintptr(4)) += uint32(int32(_nVmStep))
 54055  	_sqlite3VdbeLeave(tls, _p)
 54056  	func() {
 54057  		if _rc == int32(0) && _nExtraDelete != int32(0) && Xsqlite3_strlike(tls, str(70730), _p.XzSql, 0) == int32(0) {
 54058  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85468), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70738)))
 54059  			crt.X__builtin_abort(tls)
 54060  		}
 54061  	}()
 54062  	return _rc
 54063  
 54064  _too_big:
 54065  	_sqlite3VdbeError(tls, _p, str(6711))
 54066  	_rc = int32(18)
 54067  	goto _abort_due_to_error
 54068  _no_mem:
 54069  	_sqlite3OomFault(tls, _db)
 54070  	_sqlite3VdbeError(tls, _p, str(59395))
 54071  	_rc = _sqlite3NomemError(tls, int32(85486))
 54072  	goto _abort_due_to_error
 54073  _abort_due_to_interrupt:
 54074  	func() {
 54075  		if (*(*int32)(unsafe.Pointer(&_db.Xu1))) == 0 {
 54076  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85493), unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000), unsafe.Pointer(str(70814)))
 54077  			crt.X__builtin_abort(tls)
 54078  		}
 54079  	}()
 54080  	_rc = func() int32 {
 54081  		if _db.XmallocFailed != 0 {
 54082  			return _sqlite3NomemError(tls, int32(85494))
 54083  		}
 54084  		return int32(9)
 54085  	}()
 54086  	_p.Xrc = _rc
 54087  	_sqlite3VdbeError(tls, _p, str(24531), unsafe.Pointer(_sqlite3ErrStr(tls, _rc)))
 54088  	goto _abort_due_to_error
 54089  	_ = _94_uA
 54090  	_ = _340_cnt
 54091  	_ = _496_aRes
 54092  	panic(0)
 54093  }
 54094  
 54095  var _sqlite3VdbeExecØ00__func__Ø000 [16]int8
 54096  
 54097  func init() {
 54098  	crt.Xstrncpy(nil, &_sqlite3VdbeExecØ00__func__Ø000[0], str(70835), 16)
 54099  }
 54100  
 54101  // C comment
 54102  //  /*
 54103  //  ** Print the SQL that was used to generate a VDBE program.
 54104  //  */
 54105  func _sqlite3VdbePrintSql(tls *crt.TLS, _p *TVdbe) {
 54106  	var _z *int8
 54107  	var _2_pOp *XVdbeOp
 54108  	_z = nil
 54109  	if _p.XzSql != nil {
 54110  		_z = _p.XzSql
 54111  		goto _2
 54112  	}
 54113  	if _p.XnOp < int32(1) {
 54114  		goto _2
 54115  	}
 54116  	_2_pOp = elem61((*XVdbeOp)(_p.XaOp), 0)
 54117  	if int32(_2_pOp.Xopcode) != int32(51) || (*(**int8)(unsafe.Pointer(&_2_pOp.Xp4))) == nil {
 54118  		goto _4
 54119  	}
 54120  	_z = *(**int8)(unsafe.Pointer(&_2_pOp.Xp4))
 54121  _5:
 54122  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_z)))) & int32(1)) != 0 {
 54123  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
 54124  		goto _5
 54125  	}
 54126  _4:
 54127  _2:
 54128  	if _z != nil {
 54129  		crt.Xprintf(tls, str(70851), unsafe.Pointer(_z))
 54130  	}
 54131  }
 54132  
 54133  func _registerTrace(tls *crt.TLS, _iReg int32, _p *XMem) {
 54134  	crt.Xprintf(tls, str(70862), _iReg)
 54135  	_memTracePrint(tls, _p)
 54136  	crt.Xprintf(tls, str(37655))
 54137  	_sqlite3VdbeCheckMemInvariants(tls, _p)
 54138  }
 54139  
 54140  // C comment
 54141  //  /*
 54142  //  ** Print the value of a register for tracing purposes:
 54143  //  */
 54144  func _memTracePrint(tls *crt.TLS, _p *XMem) {
 54145  	var _7_zBuf [200]int8
 54146  	if (int32(_p.Xflags) & int32(128)) != 0 {
 54147  		crt.Xprintf(tls, str(70873))
 54148  		goto _11
 54149  	}
 54150  	if (int32(_p.Xflags) & int32(1)) != 0 {
 54151  		crt.Xprintf(tls, str(70884))
 54152  		goto _11
 54153  	}
 54154  	if (int32(_p.Xflags) & int32(6)) == int32(6) {
 54155  		crt.Xprintf(tls, str(70890), *(*int64)(unsafe.Pointer(&_p.Xu)))
 54156  		goto _11
 54157  	}
 54158  	if (int32(_p.Xflags) & int32(4)) != 0 {
 54159  		crt.Xprintf(tls, str(70899), *(*int64)(unsafe.Pointer(&_p.Xu)))
 54160  		goto _11
 54161  	}
 54162  	if (int32(_p.Xflags) & int32(8)) != 0 {
 54163  		crt.Xprintf(tls, str(70907), *(*float64)(unsafe.Pointer(&_p.Xu)))
 54164  		goto _11
 54165  	}
 54166  	if (int32(_p.Xflags) & int32(32)) != 0 {
 54167  		crt.Xprintf(tls, str(70913))
 54168  		goto _11
 54169  	}
 54170  	_sqlite3VdbeMemPrettyPrint(tls, _p, (*int8)(unsafe.Pointer(&_7_zBuf)))
 54171  	crt.Xprintf(tls, str(46992), unsafe.Pointer(&_7_zBuf))
 54172  _11:
 54173  	if (int32(_p.Xflags) & int32(32768)) != 0 {
 54174  		crt.Xprintf(tls, str(70923), int32(_p.XeSubtype))
 54175  	}
 54176  	_ = _7_zBuf
 54177  }
 54178  
 54179  // C comment
 54180  //  /*
 54181  //  ** Write a nice string representation of the contents of cell pMem
 54182  //  ** into buffer zBuf, length nBuf.
 54183  //  */
 54184  func _sqlite3VdbeMemPrettyPrint(tls *crt.TLS, _pMem *XMem, _zBuf *int8) {
 54185  	var _f, _1_i, _9_j, _9_k int32
 54186  	var _1_c, _7_z int8
 54187  	var _zCsr *int8
 54188  	var _14_c uint8
 54189  	_zCsr = _zBuf
 54190  	_f = int32(_pMem.Xflags)
 54191  	if (_f & int32(16)) == 0 {
 54192  		goto _0
 54193  	}
 54194  	if (_f & int32(1024)) != 0 {
 54195  		_1_c = int8(122)
 54196  		func() {
 54197  			if (_f & int32(6144)) != int32(0) {
 54198  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78597), unsafe.Pointer(&_sqlite3VdbeMemPrettyPrintØ00__func__Ø000), unsafe.Pointer(str(70939)))
 54199  				crt.X__builtin_abort(tls)
 54200  			}
 54201  		}()
 54202  		goto _12
 54203  	}
 54204  	if (_f & int32(2048)) != 0 {
 54205  		_1_c = int8(116)
 54206  		func() {
 54207  			if (_f & int32(5120)) != int32(0) {
 54208  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78600), unsafe.Pointer(&_sqlite3VdbeMemPrettyPrintØ00__func__Ø000), unsafe.Pointer(str(70971)))
 54209  				crt.X__builtin_abort(tls)
 54210  			}
 54211  		}()
 54212  		goto _12
 54213  	}
 54214  	if (_f & int32(4096)) != 0 {
 54215  		_1_c = int8(101)
 54216  		func() {
 54217  			if (_f & int32(3072)) != int32(0) {
 54218  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78603), unsafe.Pointer(&_sqlite3VdbeMemPrettyPrintØ00__func__Ø000), unsafe.Pointer(str(71000)))
 54219  				crt.X__builtin_abort(tls)
 54220  			}
 54221  		}()
 54222  		goto _12
 54223  	}
 54224  	_1_c = int8(115)
 54225  _12:
 54226  	*postInc1(&_zCsr, 1) = _1_c
 54227  	Xsqlite3_snprintf(tls, int32(100), _zCsr, str(71030), _pMem.Xn)
 54228  	*(*uintptr)(unsafe.Pointer(&_zCsr)) += uintptr(_sqlite3Strlen30(tls, _zCsr))
 54229  	_1_i = int32(0)
 54230  _13:
 54231  	if _1_i >= int32(16) || _1_i >= _pMem.Xn {
 54232  		goto _17
 54233  	}
 54234  	Xsqlite3_snprintf(tls, int32(100), _zCsr, str(71034), int32(*elem1(_pMem.Xz, uintptr(_1_i)))&int32(255))
 54235  	*(*uintptr)(unsafe.Pointer(&_zCsr)) += uintptr(_sqlite3Strlen30(tls, _zCsr))
 54236  	_1_i += 1
 54237  	goto _13
 54238  _17:
 54239  	_1_i = int32(0)
 54240  _18:
 54241  	if _1_i >= int32(16) || _1_i >= _pMem.Xn {
 54242  		goto _22
 54243  	}
 54244  	_7_z = *elem1(_pMem.Xz, uintptr(_1_i))
 54245  	if (int32(_7_z) < int32(32)) || (int32(_7_z) > int32(126)) {
 54246  		*postInc1(&_zCsr, 1) = int8(46)
 54247  		goto _25
 54248  	}
 54249  	*postInc1(&_zCsr, 1) = _7_z
 54250  _25:
 54251  	_1_i += 1
 54252  	goto _18
 54253  _22:
 54254  	*postInc1(&_zCsr, 1) = int8(93)
 54255  	if (_f & int32(16384)) != 0 {
 54256  		Xsqlite3_snprintf(tls, int32(100), _zCsr, str(71039), *(*int32)(unsafe.Pointer(&_pMem.Xu)))
 54257  		*(*uintptr)(unsafe.Pointer(&_zCsr)) += uintptr(_sqlite3Strlen30(tls, _zCsr))
 54258  	}
 54259  	*_zCsr = 0
 54260  	goto _28
 54261  _0:
 54262  	if (_f & int32(2)) == 0 {
 54263  		goto _28
 54264  	}
 54265  	*elem1(_zBuf, 0) = int8(32)
 54266  	if (_f & int32(1024)) != 0 {
 54267  		*elem1(_zBuf, uintptr(1)) = int8(122)
 54268  		func() {
 54269  			if (_f & int32(6144)) != int32(0) {
 54270  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78630), unsafe.Pointer(&_sqlite3VdbeMemPrettyPrintØ00__func__Ø000), unsafe.Pointer(str(70939)))
 54271  				crt.X__builtin_abort(tls)
 54272  			}
 54273  		}()
 54274  		goto _40
 54275  	}
 54276  	if (_f & int32(2048)) != 0 {
 54277  		*elem1(_zBuf, uintptr(1)) = int8(116)
 54278  		func() {
 54279  			if (_f & int32(5120)) != int32(0) {
 54280  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78633), unsafe.Pointer(&_sqlite3VdbeMemPrettyPrintØ00__func__Ø000), unsafe.Pointer(str(70971)))
 54281  				crt.X__builtin_abort(tls)
 54282  			}
 54283  		}()
 54284  		goto _40
 54285  	}
 54286  	if (_f & int32(4096)) != 0 {
 54287  		*elem1(_zBuf, uintptr(1)) = int8(101)
 54288  		func() {
 54289  			if (_f & int32(3072)) != int32(0) {
 54290  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78636), unsafe.Pointer(&_sqlite3VdbeMemPrettyPrintØ00__func__Ø000), unsafe.Pointer(str(71000)))
 54291  				crt.X__builtin_abort(tls)
 54292  			}
 54293  		}()
 54294  		goto _40
 54295  	}
 54296  	*elem1(_zBuf, uintptr(1)) = int8(115)
 54297  _40:
 54298  	_9_k = int32(2)
 54299  	Xsqlite3_snprintf(tls, int32(100), elem1(_zBuf, uintptr(_9_k)), str(37870), _pMem.Xn)
 54300  	_9_k += _sqlite3Strlen30(tls, elem1(_zBuf, uintptr(_9_k)))
 54301  	*elem1(_zBuf, uintptr(postInc2(&_9_k, 1))) = int8(91)
 54302  	_9_j = int32(0)
 54303  _41:
 54304  	if _9_j >= int32(15) || _9_j >= _pMem.Xn {
 54305  		goto _45
 54306  	}
 54307  	_14_c = uint8(*elem1(_pMem.Xz, uintptr(_9_j)))
 54308  	if (int32(_14_c) >= int32(32)) && (int32(_14_c) < int32(127)) {
 54309  		*elem1(_zBuf, uintptr(postInc2(&_9_k, 1))) = int8(_14_c)
 54310  		goto _48
 54311  	}
 54312  	*elem1(_zBuf, uintptr(postInc2(&_9_k, 1))) = int8(46)
 54313  _48:
 54314  	_9_j += 1
 54315  	goto _41
 54316  _45:
 54317  	*elem1(_zBuf, uintptr(postInc2(&_9_k, 1))) = int8(93)
 54318  	Xsqlite3_snprintf(tls, int32(100), elem1(_zBuf, uintptr(_9_k)), *elem0((**int8)(unsafe.Pointer(&_sqlite3VdbeMemPrettyPrintØ00encnamesØ001)), uintptr(_pMem.Xenc)))
 54319  	_9_k += _sqlite3Strlen30(tls, elem1(_zBuf, uintptr(_9_k)))
 54320  	*elem1(_zBuf, uintptr(postInc2(&_9_k, 1))) = 0
 54321  _28:
 54322  }
 54323  
 54324  var _sqlite3VdbeMemPrettyPrintØ00__func__Ø000 [26]int8
 54325  
 54326  func init() {
 54327  	crt.Xstrncpy(nil, &_sqlite3VdbeMemPrettyPrintØ00__func__Ø000[0], str(71044), 26)
 54328  }
 54329  
 54330  var _sqlite3VdbeMemPrettyPrintØ00encnamesØ001 [4]*int8
 54331  
 54332  func init() {
 54333  	_sqlite3VdbeMemPrettyPrintØ00encnamesØ001 = [4]*int8{str(71070), str(71074), str(71078), str(71085)}
 54334  }
 54335  
 54336  // C comment
 54337  //  /*
 54338  //  ** This routine prepares a memory cell for modification by breaking
 54339  //  ** its link to a shallow copy and by marking any current shallow
 54340  //  ** copies of this cell as invalid.
 54341  //  **
 54342  //  ** This is used for testing and debugging only - to make sure shallow
 54343  //  ** copies are not misused.
 54344  //  */
 54345  func _sqlite3VdbeMemAboutToChange(tls *crt.TLS, _pVdbe *TVdbe, _pMem *XMem) {
 54346  	var _i int32
 54347  	var _pX *XMem
 54348  	*func() **XMem { _i = int32(0); return &_pX }() = (*XMem)(_pVdbe.XaMem)
 54349  _0:
 54350  	if _i >= _pVdbe.XnMem {
 54351  		goto _3
 54352  	}
 54353  	if (*XMem)(_pX.XpScopyFrom) == _pMem {
 54354  		{
 54355  			p := &_pX.Xflags
 54356  			*p = uint16(int32(*p) | int32(128))
 54357  		}
 54358  		*(**XMem)(unsafe.Pointer(&_pX.XpScopyFrom)) = nil
 54359  	}
 54360  	*(*uintptr)(unsafe.Pointer(func() **XMem { _i += 1; return &_pX }())) += uintptr(48)
 54361  	goto _0
 54362  _3:
 54363  	*(**XMem)(unsafe.Pointer(&_pMem.XpScopyFrom)) = nil
 54364  }
 54365  
 54366  var _sqlite3VdbeExecØ00azTypeØ001 [4]*int8
 54367  
 54368  func init() {
 54369  	_sqlite3VdbeExecØ00azTypeØ001 = [4]*int8{str(71092), str(25545), str(25552), str(71101)}
 54370  }
 54371  
 54372  func _out2Prerelease(tls *crt.TLS, _p *TVdbe, _pOp *XVdbeOp) (r0 *XMem) {
 54373  	var _pOut *XMem
 54374  	func() {
 54375  		if _pOp.Xp2 <= int32(0) {
 54376  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78831), unsafe.Pointer(&_out2PrereleaseØ00__func__Ø000), unsafe.Pointer(str(61037)))
 54377  			crt.X__builtin_abort(tls)
 54378  		}
 54379  	}()
 54380  	func() {
 54381  		if _pOp.Xp2 > ((_p.XnMem + int32(1)) - _p.XnCursor) {
 54382  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78832), unsafe.Pointer(&_out2PrereleaseØ00__func__Ø000), unsafe.Pointer(str(61047)))
 54383  			crt.X__builtin_abort(tls)
 54384  		}
 54385  	}()
 54386  	_pOut = elem25((*XMem)(_p.XaMem), uintptr(_pOp.Xp2))
 54387  	_sqlite3VdbeMemAboutToChange(tls, _p, _pOut)
 54388  	if (int32(_pOut.Xflags) & int32(9312)) != int32(0) {
 54389  		return _out2PrereleaseWithClear(tls, _pOut)
 54390  	}
 54391  	_pOut.Xflags = uint16(4)
 54392  	return _pOut
 54393  }
 54394  
 54395  var _out2PrereleaseØ00__func__Ø000 [15]int8
 54396  
 54397  func init() {
 54398  	crt.Xstrncpy(nil, &_out2PrereleaseØ00__func__Ø000[0], str(71113), 15)
 54399  }
 54400  
 54401  // C comment
 54402  //  /*
 54403  //  ** Return the register of pOp->p2 after first preparing it to be
 54404  //  ** overwritten with an integer value.
 54405  //  */
 54406  func _out2PrereleaseWithClear(tls *crt.TLS, _pOut *XMem) (r0 *XMem) {
 54407  	_sqlite3VdbeMemSetNull(tls, _pOut)
 54408  	_pOut.Xflags = uint16(4)
 54409  	return _pOut
 54410  }
 54411  
 54412  // C comment
 54413  //  /*
 54414  //  ** Return true if the Mem object contains a TEXT or BLOB that is
 54415  //  ** too large - whose size exceeds SQLITE_MAX_LENGTH.
 54416  //  */
 54417  func _sqlite3VdbeMemTooBig(tls *crt.TLS, _p *XMem) (r0 int32) {
 54418  	var _1_n int32
 54419  	func() {
 54420  		if (*Xsqlite3)(_p.Xdb) == nil {
 54421  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70450), unsafe.Pointer(&_sqlite3VdbeMemTooBigØ00__func__Ø000), unsafe.Pointer(str(23631)))
 54422  			crt.X__builtin_abort(tls)
 54423  		}
 54424  	}()
 54425  	if (int32(_p.Xflags) & int32(18)) == 0 {
 54426  		goto _2
 54427  	}
 54428  	_1_n = _p.Xn
 54429  	if (int32(_p.Xflags) & int32(16384)) != 0 {
 54430  		_1_n += *(*int32)(unsafe.Pointer(&_p.Xu))
 54431  	}
 54432  	return bool2int(_1_n > (*elem8((*int32)(unsafe.Pointer(&((*Xsqlite3)(_p.Xdb).XaLimit))), 0)))
 54433  
 54434  _2:
 54435  	return int32(0)
 54436  }
 54437  
 54438  var _sqlite3VdbeMemTooBigØ00__func__Ø000 [21]int8
 54439  
 54440  func init() {
 54441  	crt.Xstrncpy(nil, &_sqlite3VdbeMemTooBigØ00__func__Ø000[0], str(71128), 21)
 54442  }
 54443  
 54444  func _sqlite3VdbeMemShallowCopy(tls *crt.TLS, _pTo *XMem, _pFrom *XMem, _srcType int32) {
 54445  	func() {
 54446  		if (int32(_pFrom.Xflags) & int32(32)) != int32(0) {
 54447  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70496), unsafe.Pointer(&_sqlite3VdbeMemShallowCopyØ00__func__Ø000), unsafe.Pointer(str(71149)))
 54448  			crt.X__builtin_abort(tls)
 54449  		}
 54450  	}()
 54451  	func() {
 54452  		if (*Xsqlite3)(_pTo.Xdb) != (*Xsqlite3)(_pFrom.Xdb) {
 54453  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70497), unsafe.Pointer(&_sqlite3VdbeMemShallowCopyØ00__func__Ø000), unsafe.Pointer(str(71180)))
 54454  			crt.X__builtin_abort(tls)
 54455  		}
 54456  	}()
 54457  	if (int32(_pTo.Xflags) & int32(9312)) != int32(0) {
 54458  		_vdbeClrCopy(tls, _pTo, _pFrom, _srcType)
 54459  		return
 54460  	}
 54461  	crt.Xmemcpy(tls, unsafe.Pointer(_pTo), unsafe.Pointer(_pFrom), uint32(20))
 54462  	if (int32(_pFrom.Xflags) & int32(2048)) == int32(0) {
 54463  		{
 54464  			p := &_pTo.Xflags
 54465  			*p = uint16(int32(*p) & int32(-7169))
 54466  		}
 54467  		func() {
 54468  			if _srcType != int32(4096) && _srcType != int32(2048) {
 54469  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70502), unsafe.Pointer(&_sqlite3VdbeMemShallowCopyØ00__func__Ø000), unsafe.Pointer(str(71199)))
 54470  				crt.X__builtin_abort(tls)
 54471  			}
 54472  		}()
 54473  		{
 54474  			p := &_pTo.Xflags
 54475  			*p = uint16(int32(*p) | _srcType)
 54476  		}
 54477  	}
 54478  }
 54479  
 54480  var _sqlite3VdbeMemShallowCopyØ00__func__Ø000 [26]int8
 54481  
 54482  func init() {
 54483  	crt.Xstrncpy(nil, &_sqlite3VdbeMemShallowCopyØ00__func__Ø000[0], str(71241), 26)
 54484  }
 54485  
 54486  // C comment
 54487  //  /*
 54488  //  ** Make an shallow copy of pFrom into pTo.  Prior contents of
 54489  //  ** pTo are freed.  The pFrom->z field is not duplicated.  If
 54490  //  ** pFrom->z is used, then pTo->z points to the same thing as pFrom->z
 54491  //  ** and flags gets srcType (either MEM_Ephem or MEM_Static).
 54492  //  */
 54493  func _vdbeClrCopy(tls *crt.TLS, _pTo *XMem, _pFrom *XMem, _eType int32) {
 54494  	_vdbeMemClearExternAndSetNull(tls, _pTo)
 54495  	func() {
 54496  		if (int32(_pTo.Xflags) & int32(9312)) != int32(0) {
 54497  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70492), unsafe.Pointer(&_vdbeClrCopyØ00__func__Ø000), unsafe.Pointer(str(71267)))
 54498  			crt.X__builtin_abort(tls)
 54499  		}
 54500  	}()
 54501  	_sqlite3VdbeMemShallowCopy(tls, _pTo, _pFrom, _eType)
 54502  }
 54503  
 54504  var _vdbeClrCopyØ00__func__Ø000 [12]int8
 54505  
 54506  func init() {
 54507  	crt.Xstrncpy(nil, &_vdbeClrCopyØ00__func__Ø000[0], str(71288), 12)
 54508  }
 54509  
 54510  // C comment
 54511  //  /*
 54512  //  ** Transfer the contents of pFrom to pTo. Any existing value in pTo is
 54513  //  ** freed. If pFrom contains ephemeral data, a copy is made.
 54514  //  **
 54515  //  ** pFrom contains an SQL NULL when this routine returns.
 54516  //  */
 54517  func _sqlite3VdbeMemMove(tls *crt.TLS, _pTo *XMem, _pFrom *XMem) {
 54518  	func() {
 54519  		if (*Xsqlite3)(_pFrom.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pFrom.Xdb).Xmutex)) == 0 {
 54520  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70535), unsafe.Pointer(&_sqlite3VdbeMemMoveØ00__func__Ø000), unsafe.Pointer(str(71300)))
 54521  			crt.X__builtin_abort(tls)
 54522  		}
 54523  	}()
 54524  	func() {
 54525  		if (*Xsqlite3)(_pTo.Xdb) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pTo.Xdb).Xmutex)) == 0 {
 54526  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70536), unsafe.Pointer(&_sqlite3VdbeMemMoveØ00__func__Ø000), unsafe.Pointer(str(71353)))
 54527  			crt.X__builtin_abort(tls)
 54528  		}
 54529  	}()
 54530  	func() {
 54531  		if (*Xsqlite3)(_pFrom.Xdb) != nil && (*Xsqlite3)(_pTo.Xdb) != nil && (*Xsqlite3)(_pFrom.Xdb) != (*Xsqlite3)(_pTo.Xdb) {
 54532  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70537), unsafe.Pointer(&_sqlite3VdbeMemMoveØ00__func__Ø000), unsafe.Pointer(str(71402)))
 54533  			crt.X__builtin_abort(tls)
 54534  		}
 54535  	}()
 54536  	_sqlite3VdbeMemRelease(tls, _pTo)
 54537  	crt.Xmemcpy(tls, unsafe.Pointer(_pTo), unsafe.Pointer(_pFrom), uint32(48))
 54538  	_pFrom.Xflags = uint16(1)
 54539  	_pFrom.XszMalloc = int32(0)
 54540  }
 54541  
 54542  var _sqlite3VdbeMemMoveØ00__func__Ø000 [19]int8
 54543  
 54544  func init() {
 54545  	crt.Xstrncpy(nil, &_sqlite3VdbeMemMoveØ00__func__Ø000[0], str(71451), 19)
 54546  }
 54547  
 54548  // C comment
 54549  //  /*
 54550  //  ** Return the numeric type for pMem, either MEM_Int or MEM_Real or both or
 54551  //  ** none.
 54552  //  **
 54553  //  ** Unlike applyNumericAffinity(), this routine does not modify pMem->flags.
 54554  //  ** But it does set pMem->u.r and pMem->u.i appropriately.
 54555  //  */
 54556  func _numericType(tls *crt.TLS, _pMem *XMem) (r0 uint16) {
 54557  	if (int32(_pMem.Xflags) & int32(12)) != 0 {
 54558  		return uint16(int32(_pMem.Xflags) & int32(12))
 54559  	}
 54560  	if (int32(_pMem.Xflags) & int32(18)) != 0 {
 54561  		return _computeNumericType(tls, _pMem)
 54562  	}
 54563  	return 0
 54564  }
 54565  
 54566  // C comment
 54567  //  /*
 54568  //  ** pMem currently only holds a string type (or maybe a BLOB that we can
 54569  //  ** interpret as a string if we want to).  Compute its corresponding
 54570  //  ** numeric type, if has one.  Set the pMem->u.r and pMem->u.i fields
 54571  //  ** accordingly.
 54572  //  */
 54573  func _computeNumericType(tls *crt.TLS, _pMem *XMem) (r0 uint16) {
 54574  	func() {
 54575  		if (int32(_pMem.Xflags) & int32(12)) != int32(0) {
 54576  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78553), unsafe.Pointer(&_computeNumericTypeØ00__func__Ø000), unsafe.Pointer(str(71470)))
 54577  			crt.X__builtin_abort(tls)
 54578  		}
 54579  	}()
 54580  	func() {
 54581  		if (int32(_pMem.Xflags) & int32(18)) == int32(0) {
 54582  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78554), unsafe.Pointer(&_computeNumericTypeØ00__func__Ø000), unsafe.Pointer(str(71508)))
 54583  			crt.X__builtin_abort(tls)
 54584  		}
 54585  	}()
 54586  	if _sqlite3AtoF(tls, _pMem.Xz, (*float64)(unsafe.Pointer(&_pMem.Xu)), _pMem.Xn, _pMem.Xenc) == int32(0) {
 54587  		return 0
 54588  	}
 54589  	if _sqlite3Atoi64(tls, _pMem.Xz, (*int64)(unsafe.Pointer(&_pMem.Xu)), _pMem.Xn, _pMem.Xenc) == int32(0) {
 54590  		return uint16(4)
 54591  	}
 54592  	return uint16(8)
 54593  }
 54594  
 54595  var _computeNumericTypeØ00__func__Ø000 [19]int8
 54596  
 54597  func init() {
 54598  	crt.Xstrncpy(nil, &_computeNumericTypeØ00__func__Ø000[0], str(71546), 19)
 54599  }
 54600  
 54601  // C comment
 54602  //  /*
 54603  //  ** Attempt to add, substract, or multiply the 64-bit signed value iB against
 54604  //  ** the other 64-bit signed integer at *pA and store the result in *pA.
 54605  //  ** Return 0 on success.  Or if the operation would have resulted in an
 54606  //  ** overflow, leave *pA unchanged and return 1.
 54607  //  */
 54608  func _sqlite3AddInt64(tls *crt.TLS, _pA *int64, _iB int64) (r0 int32) {
 54609  	var _iA int64
 54610  	_iA = *_pA
 54611  	if _iB < (0) {
 54612  		goto _0
 54613  	}
 54614  	if (_iA > (0)) && ((int64(9223372036854775807) - _iA) < _iB) {
 54615  		return int32(1)
 54616  	}
 54617  	goto _3
 54618  _0:
 54619  	if (_iA < (0)) && ((-(_iA + int64(9223372036854775807))) > (_iB + int64(1))) {
 54620  		return int32(1)
 54621  	}
 54622  _3:
 54623  	*_pA += _iB
 54624  	return int32(0)
 54625  }
 54626  
 54627  func _sqlite3SubInt64(tls *crt.TLS, _pA *int64, _iB int64) (r0 int32) {
 54628  	if _iB != int64(-9223372036854775808) {
 54629  		goto _0
 54630  	}
 54631  	if (*_pA) >= (0) {
 54632  		return int32(1)
 54633  	}
 54634  	*_pA -= _iB
 54635  	return int32(0)
 54636  
 54637  _0:
 54638  	return _sqlite3AddInt64(tls, _pA, -_iB)
 54639  }
 54640  
 54641  func _sqlite3MulInt64(tls *crt.TLS, _pA *int64, _iB int64) (r0 int32) {
 54642  	var _iA int64
 54643  	_iA = *_pA
 54644  	if _iB <= (0) {
 54645  		goto _0
 54646  	}
 54647  	if _iA > (int64(9223372036854775807) / _iB) {
 54648  		return int32(1)
 54649  	}
 54650  	if _iA < (int64(-9223372036854775808) / _iB) {
 54651  		return int32(1)
 54652  	}
 54653  	goto _4
 54654  _0:
 54655  	if _iB >= (0) {
 54656  		goto _4
 54657  	}
 54658  	if _iA <= (0) {
 54659  		goto _5
 54660  	}
 54661  	if _iB < (int64(-9223372036854775808) / _iA) {
 54662  		return int32(1)
 54663  	}
 54664  	goto _8
 54665  _5:
 54666  	if _iA >= (0) {
 54667  		goto _8
 54668  	}
 54669  	if _iB == int64(-9223372036854775808) {
 54670  		return int32(1)
 54671  	}
 54672  	if _iA == int64(-9223372036854775808) {
 54673  		return int32(1)
 54674  	}
 54675  	if (-_iA) > (int64(9223372036854775807) / (-_iB)) {
 54676  		return int32(1)
 54677  	}
 54678  _8:
 54679  _4:
 54680  	*_pA = _iA * _iB
 54681  	return int32(0)
 54682  }
 54683  
 54684  // C comment
 54685  //  /*
 54686  //  ** Compare the values contained by the two memory cells, returning
 54687  //  ** negative, zero or positive if pMem1 is less than, equal to, or greater
 54688  //  ** than pMem2. Sorting order is NULL's first, followed by numbers (integers
 54689  //  ** and reals) sorted numerically, followed by text ordered by the collating
 54690  //  ** sequence pColl and finally blob's ordered by memcmp().
 54691  //  **
 54692  //  ** Two NULL values are considered equal by this function.
 54693  //  */
 54694  func _sqlite3MemCompare(tls *crt.TLS, _pMem1 *XMem, _pMem2 *XMem, _pColl *XCollSeq) (r0 int32) {
 54695  	var _f1, _f2, _combined_flags int32
 54696  	_f1 = int32(_pMem1.Xflags)
 54697  	_f2 = int32(_pMem2.Xflags)
 54698  	_combined_flags = _f1 | _f2
 54699  	func() {
 54700  		if (_combined_flags & int32(32)) != int32(0) {
 54701  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75263), unsafe.Pointer(&_sqlite3MemCompareØ00__func__Ø000), unsafe.Pointer(str(71565)))
 54702  			crt.X__builtin_abort(tls)
 54703  		}
 54704  	}()
 54705  	if (_combined_flags & int32(1)) != 0 {
 54706  		return (_f2 & int32(1)) - (_f1 & int32(1))
 54707  	}
 54708  	if (_combined_flags & int32(12)) == 0 {
 54709  		goto _3
 54710  	}
 54711  	if ((_f1 & _f2) & int32(4)) == int32(0) {
 54712  		goto _4
 54713  	}
 54714  	if (*(*int64)(unsafe.Pointer(&_pMem1.Xu))) < (*(*int64)(unsafe.Pointer(&_pMem2.Xu))) {
 54715  		return int32(-1)
 54716  	}
 54717  	if (*(*int64)(unsafe.Pointer(&_pMem1.Xu))) > (*(*int64)(unsafe.Pointer(&_pMem2.Xu))) {
 54718  		return int32(1)
 54719  	}
 54720  	return int32(0)
 54721  
 54722  _4:
 54723  	if ((_f1 & _f2) & int32(8)) == int32(0) {
 54724  		goto _7
 54725  	}
 54726  	if (*(*float64)(unsafe.Pointer(&_pMem1.Xu))) < (*(*float64)(unsafe.Pointer(&_pMem2.Xu))) {
 54727  		return int32(-1)
 54728  	}
 54729  	if (*(*float64)(unsafe.Pointer(&_pMem1.Xu))) > (*(*float64)(unsafe.Pointer(&_pMem2.Xu))) {
 54730  		return int32(1)
 54731  	}
 54732  	return int32(0)
 54733  
 54734  _7:
 54735  	if (_f1 & int32(4)) == int32(0) {
 54736  		goto _10
 54737  	}
 54738  	if (_f2 & int32(8)) != int32(0) {
 54739  		return _sqlite3IntFloatCompare(tls, *(*int64)(unsafe.Pointer(&_pMem1.Xu)), *(*float64)(unsafe.Pointer(&_pMem2.Xu)))
 54740  	}
 54741  	return int32(-1)
 54742  
 54743  _10:
 54744  	if (_f1 & int32(8)) == int32(0) {
 54745  		goto _13
 54746  	}
 54747  	if (_f2 & int32(4)) != int32(0) {
 54748  		return -_sqlite3IntFloatCompare(tls, *(*int64)(unsafe.Pointer(&_pMem2.Xu)), *(*float64)(unsafe.Pointer(&_pMem1.Xu)))
 54749  	}
 54750  	return int32(-1)
 54751  
 54752  _13:
 54753  	return int32(1)
 54754  
 54755  _3:
 54756  	if (_combined_flags & int32(2)) == 0 {
 54757  		goto _16
 54758  	}
 54759  	if (_f1 & int32(2)) == int32(0) {
 54760  		return int32(1)
 54761  	}
 54762  	if (_f2 & int32(2)) == int32(0) {
 54763  		return int32(-1)
 54764  	}
 54765  	func() {
 54766  		if int32(_pMem1.Xenc) != int32(_pMem2.Xenc) && ((*Xsqlite3)(_pMem1.Xdb).XmallocFailed) == 0 {
 54767  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75313), unsafe.Pointer(&_sqlite3MemCompareØ00__func__Ø000), unsafe.Pointer(str(71598)))
 54768  			crt.X__builtin_abort(tls)
 54769  		}
 54770  	}()
 54771  	func() {
 54772  		if int32(_pMem1.Xenc) != int32(1) && int32(_pMem1.Xenc) != int32(2) && int32(_pMem1.Xenc) != int32(3) {
 54773  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75314), unsafe.Pointer(&_sqlite3MemCompareØ00__func__Ø000), unsafe.Pointer(str(71648)))
 54774  			crt.X__builtin_abort(tls)
 54775  		}
 54776  	}()
 54777  	func() {
 54778  		if _pColl != nil && _pColl.XxCmp == nil {
 54779  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75321), unsafe.Pointer(&_sqlite3MemCompareØ00__func__Ø000), unsafe.Pointer(str(71732)))
 54780  			crt.X__builtin_abort(tls)
 54781  		}
 54782  	}()
 54783  	if _pColl != nil {
 54784  		return _vdbeCompareMemString(tls, _pMem1, _pMem2, _pColl, nil)
 54785  	}
 54786  _16:
 54787  	return _sqlite3BlobCompare(tls, _pMem1, _pMem2)
 54788  }
 54789  
 54790  var _sqlite3MemCompareØ00__func__Ø000 [18]int8
 54791  
 54792  func init() {
 54793  	crt.Xstrncpy(nil, &_sqlite3MemCompareØ00__func__Ø000[0], str(71754), 18)
 54794  }
 54795  
 54796  // C comment
 54797  //  /*
 54798  //  ** Do a comparison between a 64-bit signed integer and a 64-bit floating-point
 54799  //  ** number.  Return negative, zero, or positive if the first (i64) is less than,
 54800  //  ** equal to, or greater than the second (double).
 54801  //  */
 54802  func _sqlite3IntFloatCompare(tls *crt.TLS, _i int64, _r float64) (r0 int32) {
 54803  	var _2_y int64
 54804  	var _1_x, _2_s float64
 54805  	goto _0
 54806  _0:
 54807  	if _r < (-9.223372036854776e+18) {
 54808  		return int32(1)
 54809  	}
 54810  	if _r > (9.223372036854776e+18) {
 54811  		return int32(-1)
 54812  	}
 54813  	_2_y = int64(_r)
 54814  	if _i < _2_y {
 54815  		return int32(-1)
 54816  	}
 54817  	if _i <= _2_y {
 54818  		goto _7
 54819  	}
 54820  	if (_2_y == int64(-9223372036854775808)) && (_r > float64(0)) {
 54821  		return int32(-1)
 54822  	}
 54823  	return int32(1)
 54824  
 54825  _7:
 54826  	_2_s = float64(_i)
 54827  	if _2_s < _r {
 54828  		return int32(-1)
 54829  	}
 54830  	if _2_s > _r {
 54831  		return int32(1)
 54832  	}
 54833  	return int32(0)
 54834  
 54835  	_ = _1_x
 54836  	panic(0)
 54837  }
 54838  
 54839  // C comment
 54840  //  /*
 54841  //  ** Both *pMem1 and *pMem2 contain string values. Compare the two values
 54842  //  ** using the collation sequence pColl. As usual, return a negative , zero
 54843  //  ** or positive value if *pMem1 is less than, equal to or greater than
 54844  //  ** *pMem2, respectively. Similar in spirit to "rc = (*pMem1) - (*pMem2);".
 54845  //  */
 54846  func _vdbeCompareMemString(tls *crt.TLS, _pMem1 *XMem, _pMem2 *XMem, _pColl *XCollSeq, _prcErr *uint8) (r0 int32) {
 54847  	var _2_rc, _2_n1, _2_n2 int32
 54848  	var _2_v1, _2_v2 unsafe.Pointer
 54849  	var _2_c1, _2_c2 XMem
 54850  	if int32(_pMem1.Xenc) == int32(_pColl.Xenc) {
 54851  		return _pColl.XxCmp(tls, _pColl.XpUser, _pMem1.Xn, unsafe.Pointer(_pMem1.Xz), _pMem2.Xn, unsafe.Pointer(_pMem2.Xz))
 54852  	}
 54853  	_sqlite3VdbeMemInit(tls, &_2_c1, (*Xsqlite3)(_pMem1.Xdb), uint16(1))
 54854  	_sqlite3VdbeMemInit(tls, &_2_c2, (*Xsqlite3)(_pMem1.Xdb), uint16(1))
 54855  	_sqlite3VdbeMemShallowCopy(tls, &_2_c1, _pMem1, int32(4096))
 54856  	_sqlite3VdbeMemShallowCopy(tls, &_2_c2, _pMem2, int32(4096))
 54857  	_2_v1 = _sqlite3ValueText(tls, &_2_c1, _pColl.Xenc)
 54858  	_2_n1 = func() int32 {
 54859  		if _2_v1 == nil {
 54860  			return int32(0)
 54861  		}
 54862  		return _2_c1.Xn
 54863  	}()
 54864  	_2_v2 = _sqlite3ValueText(tls, &_2_c2, _pColl.Xenc)
 54865  	_2_n2 = func() int32 {
 54866  		if _2_v2 == nil {
 54867  			return int32(0)
 54868  		}
 54869  		return _2_c2.Xn
 54870  	}()
 54871  	_2_rc = _pColl.XxCmp(tls, _pColl.XpUser, _2_n1, _2_v1, _2_n2, _2_v2)
 54872  	if ((_2_v1 == nil) || (_2_v2 == nil)) && (_prcErr != nil) {
 54873  		*_prcErr = uint8(_sqlite3NomemError(tls, int32(75166)))
 54874  	}
 54875  	_sqlite3VdbeMemRelease(tls, &_2_c1)
 54876  	_sqlite3VdbeMemRelease(tls, &_2_c2)
 54877  	return _2_rc
 54878  }
 54879  
 54880  // C comment
 54881  //  /*
 54882  //  ** Initialize bulk memory to be a consistent Mem object.
 54883  //  **
 54884  //  ** The minimum amount of initialization feasible is performed.
 54885  //  */
 54886  func _sqlite3VdbeMemInit(tls *crt.TLS, _pMem *XMem, _db *Xsqlite3, _flags uint16) {
 54887  	func() {
 54888  		if (int32(_flags) & int32(-33280)) != int32(0) {
 54889  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70341), unsafe.Pointer(&_sqlite3VdbeMemInitØ00__func__Ø000), unsafe.Pointer(str(71772)))
 54890  			crt.X__builtin_abort(tls)
 54891  		}
 54892  	}()
 54893  	_pMem.Xflags = _flags
 54894  	*(**Xsqlite3)(unsafe.Pointer(&_pMem.Xdb)) = _db
 54895  	_pMem.XszMalloc = int32(0)
 54896  }
 54897  
 54898  var _sqlite3VdbeMemInitØ00__func__Ø000 [19]int8
 54899  
 54900  func init() {
 54901  	crt.Xstrncpy(nil, &_sqlite3VdbeMemInitØ00__func__Ø000[0], str(71799), 19)
 54902  }
 54903  
 54904  // C comment
 54905  //  /*
 54906  //  ** Compare two blobs.  Return negative, zero, or positive if the first
 54907  //  ** is less than, equal to, or greater than the second, respectively.
 54908  //  ** If one blob is a prefix of the other, then the shorter is the lessor.
 54909  //  */
 54910  func _sqlite3BlobCompare(tls *crt.TLS, _pB1 *XMem, _pB2 *XMem) (r0 int32) {
 54911  	var _c, _n1, _n2 int32
 54912  	_n1 = _pB1.Xn
 54913  	_n2 = _pB2.Xn
 54914  	func() {
 54915  		if (int32(_pB1.Xflags)&int32(16384)) != int32(0) && _n1 != int32(0) {
 54916  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75199), unsafe.Pointer(&_sqlite3BlobCompareØ00__func__Ø000), unsafe.Pointer(str(71818)))
 54917  			crt.X__builtin_abort(tls)
 54918  		}
 54919  	}()
 54920  	func() {
 54921  		if (int32(_pB2.Xflags)&int32(16384)) != int32(0) && _n2 != int32(0) {
 54922  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75200), unsafe.Pointer(&_sqlite3BlobCompareØ00__func__Ø000), unsafe.Pointer(str(71854)))
 54923  			crt.X__builtin_abort(tls)
 54924  		}
 54925  	}()
 54926  	if ((int32(_pB1.Xflags) | int32(_pB2.Xflags)) & int32(16384)) == 0 {
 54927  		goto _6
 54928  	}
 54929  	if ((int32(_pB1.Xflags) & int32(_pB2.Xflags)) & int32(16384)) != 0 {
 54930  		return (*(*int32)(unsafe.Pointer(&_pB1.Xu))) - (*(*int32)(unsafe.Pointer(&_pB2.Xu)))
 54931  	}
 54932  	if (int32(_pB1.Xflags) & int32(16384)) == 0 {
 54933  		goto _9
 54934  	}
 54935  	if _isAllZero(tls, _pB2.Xz, _pB2.Xn) == 0 {
 54936  		return int32(-1)
 54937  	}
 54938  	return (*(*int32)(unsafe.Pointer(&_pB1.Xu))) - _n2
 54939  
 54940  _9:
 54941  	if _isAllZero(tls, _pB1.Xz, _pB1.Xn) == 0 {
 54942  		return int32(1)
 54943  	}
 54944  	return _n1 - (*(*int32)(unsafe.Pointer(&_pB2.Xu)))
 54945  
 54946  _6:
 54947  	_c = crt.Xmemcmp(tls, unsafe.Pointer(_pB1.Xz), unsafe.Pointer(_pB2.Xz), uint32(func() int32 {
 54948  		if _n1 > _n2 {
 54949  			return _n2
 54950  		}
 54951  		return _n1
 54952  	}()))
 54953  	if _c != 0 {
 54954  		return _c
 54955  	}
 54956  	return _n1 - _n2
 54957  }
 54958  
 54959  var _sqlite3BlobCompareØ00__func__Ø000 [19]int8
 54960  
 54961  func init() {
 54962  	crt.Xstrncpy(nil, &_sqlite3BlobCompareØ00__func__Ø000[0], str(71890), 19)
 54963  }
 54964  
 54965  // C comment
 54966  //  /*
 54967  //  ** The input pBlob is guaranteed to be a Blob that is not marked
 54968  //  ** with MEM_Zero.  Return true if it could be a zero-blob.
 54969  //  */
 54970  func _isAllZero(tls *crt.TLS, _z *int8, _n int32) (r0 int32) {
 54971  	var _i int32
 54972  	_i = int32(0)
 54973  _0:
 54974  	if _i >= _n {
 54975  		goto _3
 54976  	}
 54977  	if (*elem1(_z, uintptr(_i))) != 0 {
 54978  		return int32(0)
 54979  	}
 54980  	_i += 1
 54981  	goto _0
 54982  _3:
 54983  	return int32(1)
 54984  }
 54985  
 54986  var _sqlite3VdbeExecØ00and_logicØ002 [9]uint8
 54987  
 54988  func init() {
 54989  	_sqlite3VdbeExecØ00and_logicØ002 = [9]uint8{0, 0, 0, 0, 1, 2, 0, 2, 2}
 54990  }
 54991  
 54992  var _sqlite3VdbeExecØ00or_logicØ003 [9]uint8
 54993  
 54994  func init() {
 54995  	_sqlite3VdbeExecØ00or_logicØ003 = [9]uint8{0, 1, 2, 1, 1, 1, 2, 1, 2}
 54996  }
 54997  
 54998  // C comment
 54999  //  /*
 55000  //  ** Make sure the cursor p is ready to read or write the row to which it
 55001  //  ** was last positioned.  Return an error code if an OOM fault or I/O error
 55002  //  ** prevents us from positioning the cursor to its correct position.
 55003  //  **
 55004  //  ** If a MoveTo operation is pending on the given cursor, then do that
 55005  //  ** MoveTo now.  If no move is pending, check to see if the row has been
 55006  //  ** deleted out from under the cursor and if it has, mark the row as
 55007  //  ** a NULL row.
 55008  //  **
 55009  //  ** If the cursor is already pointing to the correct row and that row has
 55010  //  ** not been deleted out from under the cursor, then this routine is a no-op.
 55011  //  */
 55012  func _sqlite3VdbeCursorMoveto(tls *crt.TLS, _pp **XVdbeCursor, _piCol *int32) (r0 int32) {
 55013  	var _2_iMap int32
 55014  	var _p *XVdbeCursor
 55015  	_p = *_pp
 55016  	if int32(_p.XeCurType) != int32(0) {
 55017  		goto _0
 55018  	}
 55019  	if _p.XdeferredMoveto == 0 {
 55020  		goto _1
 55021  	}
 55022  	if (_p.XaAltMap != nil) && (store2(&_2_iMap, *elem8(_p.XaAltMap, uintptr(int32(1)+(*_piCol)))) > int32(0)) {
 55023  		*_pp = (*XVdbeCursor)(_p.XpAltCursor)
 55024  		*_piCol = _2_iMap - int32(1)
 55025  		return int32(0)
 55026  	}
 55027  	return _handleDeferredMoveto(tls, _p)
 55028  
 55029  _1:
 55030  	if _sqlite3BtreeCursorHasMoved(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xuc)))) != 0 {
 55031  		return _handleMovedCursor(tls, _p)
 55032  	}
 55033  _0:
 55034  	return int32(0)
 55035  }
 55036  
 55037  // C comment
 55038  //  /*
 55039  //  ** The cursor "p" has a pending seek operation that has not yet been
 55040  //  ** carried out.  Seek the cursor now.  If an error occurs, return
 55041  //  ** the appropriate error code.
 55042  //  */
 55043  func _handleDeferredMoveto(tls *crt.TLS, _p *XVdbeCursor) (r0 int32) {
 55044  	var _res, _rc int32
 55045  	func() {
 55046  		if _p.XdeferredMoveto == 0 {
 55047  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74477), unsafe.Pointer(&_handleDeferredMovetoØ00__func__Ø000), unsafe.Pointer(str(71909)))
 55048  			crt.X__builtin_abort(tls)
 55049  		}
 55050  	}()
 55051  	func() {
 55052  		if _p.XisTable == 0 {
 55053  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74478), unsafe.Pointer(&_handleDeferredMovetoØ00__func__Ø000), unsafe.Pointer(str(71927)))
 55054  			crt.X__builtin_abort(tls)
 55055  		}
 55056  	}()
 55057  	func() {
 55058  		if int32(_p.XeCurType) != int32(0) {
 55059  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74479), unsafe.Pointer(&_handleDeferredMovetoØ00__func__Ø000), unsafe.Pointer(str(71938)))
 55060  			crt.X__builtin_abort(tls)
 55061  		}
 55062  	}()
 55063  	_rc = _sqlite3BtreeMovetoUnpacked(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xuc))), nil, _p.XmovetoTarget, int32(0), &_res)
 55064  	if _rc != 0 {
 55065  		return _rc
 55066  	}
 55067  	if _res != int32(0) {
 55068  		return _sqlite3CorruptError(tls, int32(74482))
 55069  	}
 55070  	_p.XdeferredMoveto = 0
 55071  	_p.XcacheStatus = 0
 55072  	return int32(0)
 55073  }
 55074  
 55075  var _handleDeferredMovetoØ00__func__Ø000 [21]int8
 55076  
 55077  func init() {
 55078  	crt.Xstrncpy(nil, &_handleDeferredMovetoØ00__func__Ø000[0], str(71965), 21)
 55079  }
 55080  
 55081  // C comment
 55082  //  /* Move the cursor so that it points to an entry near the key
 55083  //  ** specified by pIdxKey or intKey.   Return a success code.
 55084  //  **
 55085  //  ** For INTKEY tables, the intKey parameter is used.  pIdxKey
 55086  //  ** must be NULL.  For index tables, pIdxKey is used and intKey
 55087  //  ** is ignored.
 55088  //  **
 55089  //  ** If an exact match is not found, then the cursor is always
 55090  //  ** left pointing at a leaf page which would hold the entry if it
 55091  //  ** were present.  The cursor might point to an entry that comes
 55092  //  ** before or after the key.
 55093  //  **
 55094  //  ** An integer is written into *pRes which is the result of
 55095  //  ** comparing the key with the entry to which the cursor is
 55096  //  ** pointing.  The meaning of the integer written into
 55097  //  ** *pRes is as follows:
 55098  //  **
 55099  //  **     *pRes<0      The cursor is left pointing at an entry that
 55100  //  **                  is smaller than intKey/pIdxKey or if the table is empty
 55101  //  **                  and the cursor is therefore left point to nothing.
 55102  //  **
 55103  //  **     *pRes==0     The cursor is left pointing at an entry that
 55104  //  **                  exactly matches intKey/pIdxKey.
 55105  //  **
 55106  //  **     *pRes>0      The cursor is left pointing at an entry that
 55107  //  **                  is larger than intKey/pIdxKey.
 55108  //  **
 55109  //  ** For index tables, the pIdxKey->eqSeen field is set to 1 if there
 55110  //  ** exists an entry in the table that exactly matches pIdxKey.
 55111  //  */
 55112  func _sqlite3BtreeMovetoUnpacked(tls *crt.TLS, _pCur *XBtCursor, _pIdxKey *XUnpackedRecord, _intKey int64, _biasRight int32, _pRes *int32) (r0 int32) {
 55113  	var _rc, _12_lwr, _12_upr, _12_idx, _12_c, _25_nCell int32
 55114  	var _14_nCellKey int64
 55115  	var _12_chldPg uint32
 55116  	var _28_pCellKey unsafe.Pointer
 55117  	var _12_pCell, _28_pCellBody *uint8
 55118  	var _12_pPage *XMemPage
 55119  	var _xRecordCompare func(*crt.TLS, int32, unsafe.Pointer, *XUnpackedRecord) int32
 55120  	func() {
 55121  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 55122  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64180), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(71986)))
 55123  			crt.X__builtin_abort(tls)
 55124  		}
 55125  	}()
 55126  	func() {
 55127  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XBtree)(_pCur.XpBtree).Xdb).Xmutex)) == 0 {
 55128  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64181), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72011)))
 55129  			crt.X__builtin_abort(tls)
 55130  		}
 55131  	}()
 55132  	func() {
 55133  		if _pRes == nil {
 55134  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64182), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72055)))
 55135  			crt.X__builtin_abort(tls)
 55136  		}
 55137  	}()
 55138  	func() {
 55139  		if (_pIdxKey == nil) != ((*XKeyInfo)(_pCur.XpKeyInfo) == nil) {
 55140  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64183), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72060)))
 55141  			crt.X__builtin_abort(tls)
 55142  		}
 55143  	}()
 55144  	func() {
 55145  		if int32(_pCur.XeState) == int32(1) && (_pIdxKey == nil) != (int32(_pCur.XcurIntKey) != int32(0)) {
 55146  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64184), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72094)))
 55147  			crt.X__builtin_abort(tls)
 55148  		}
 55149  	}()
 55150  	if _pIdxKey != nil || int32(_pCur.XeState) != int32(1) || (int32(_pCur.XcurFlags)&int32(2)) == int32(0) {
 55151  		goto _13
 55152  	}
 55153  	if (_pCur.Xinfo.XnKey) == _intKey {
 55154  		*_pRes = int32(0)
 55155  		return int32(0)
 55156  	}
 55157  	if (_pCur.Xinfo.XnKey) >= _intKey {
 55158  		goto _15
 55159  	}
 55160  	if (int32(_pCur.XcurFlags) & int32(8)) != int32(0) {
 55161  		*_pRes = int32(-1)
 55162  		return int32(0)
 55163  	}
 55164  	if ((_pCur.Xinfo.XnKey)+int64(1)) != _intKey || _pCur.XskipNext != 0 {
 55165  		goto _18
 55166  	}
 55167  	*_pRes = int32(0)
 55168  	_rc = _sqlite3BtreeNext(tls, _pCur, _pRes)
 55169  	if _rc != 0 {
 55170  		return _rc
 55171  	}
 55172  	if (*_pRes) != int32(0) {
 55173  		goto _20
 55174  	}
 55175  	_getCellInfo(tls, _pCur)
 55176  	if (_pCur.Xinfo.XnKey) == _intKey {
 55177  		return int32(0)
 55178  	}
 55179  _20:
 55180  _18:
 55181  _15:
 55182  _13:
 55183  	if _pIdxKey != nil {
 55184  		_xRecordCompare = _sqlite3VdbeFindCompare(tls, _pIdxKey)
 55185  		_pIdxKey.XerrCode = 0
 55186  		func() {
 55187  			if int32(_pIdxKey.Xdefault_rc) != int32(1) && int32(_pIdxKey.Xdefault_rc) != int32(0) && int32(_pIdxKey.Xdefault_rc) != int32(-1) {
 55188  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64221), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72159)))
 55189  				crt.X__builtin_abort(tls)
 55190  			}
 55191  		}()
 55192  		goto _27
 55193  	}
 55194  	_xRecordCompare = nil
 55195  _27:
 55196  	_rc = _moveToRoot(tls, _pCur)
 55197  	if _rc != 0 {
 55198  		return _rc
 55199  	}
 55200  	func() {
 55201  		if _pCur.XpgnoRoot != (0) && (*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))) == nil {
 55202  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64233), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72235)))
 55203  			crt.X__builtin_abort(tls)
 55204  		}
 55205  	}()
 55206  	func() {
 55207  		if _pCur.XpgnoRoot != (0) && ((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XisInit) == 0 {
 55208  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64234), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72282)))
 55209  			crt.X__builtin_abort(tls)
 55210  		}
 55211  	}()
 55212  	func() {
 55213  		if int32(_pCur.XeState) != int32(0) && int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnCell) <= int32(0) {
 55214  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64235), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72337)))
 55215  			crt.X__builtin_abort(tls)
 55216  		}
 55217  	}()
 55218  	if int32(_pCur.XeState) == int32(0) {
 55219  		*_pRes = int32(-1)
 55220  		func() {
 55221  			if _pCur.XpgnoRoot != (0) && int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnCell) != int32(0) {
 55222  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64238), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72404)))
 55223  				crt.X__builtin_abort(tls)
 55224  			}
 55225  		}()
 55226  		return int32(0)
 55227  	}
 55228  	func() {
 55229  		if int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), 0)).XintKey) != int32(_pCur.XcurIntKey) {
 55230  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64241), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72461)))
 55231  			crt.X__builtin_abort(tls)
 55232  		}
 55233  	}()
 55234  	func() {
 55235  		if _pCur.XcurIntKey == 0 && _pIdxKey == nil {
 55236  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64242), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72502)))
 55237  			crt.X__builtin_abort(tls)
 55238  		}
 55239  	}()
 55240  _47:
 55241  	_12_pPage = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))
 55242  	func() {
 55243  		if int32(_12_pPage.XnCell) <= int32(0) {
 55244  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64255), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72529)))
 55245  			crt.X__builtin_abort(tls)
 55246  		}
 55247  	}()
 55248  	func() {
 55249  		if int32(_12_pPage.XintKey) != bool2int(_pIdxKey == nil) {
 55250  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64256), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72544)))
 55251  			crt.X__builtin_abort(tls)
 55252  		}
 55253  	}()
 55254  	_12_lwr = int32(0)
 55255  	_12_upr = int32(_12_pPage.XnCell) - int32(1)
 55256  	func() {
 55257  		if _biasRight != int32(0) && _biasRight != int32(1) {
 55258  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64259), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72572)))
 55259  			crt.X__builtin_abort(tls)
 55260  		}
 55261  	}()
 55262  	_12_idx = _12_upr >> uint(int32(1)-_biasRight)
 55263  	_pCur.Xix = uint16(_12_idx)
 55264  	if _xRecordCompare != nil {
 55265  		goto _57
 55266  	}
 55267  _58:
 55268  	_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)))))))
 55269  	if _12_pPage.XintKeyLeaf == 0 {
 55270  		goto _61
 55271  	}
 55272  _62:
 55273  	if int32(128) > int32(*postInc15(&_12_pCell, 1)) {
 55274  		goto _63
 55275  	}
 55276  	if crt.P2U(unsafe.Pointer(_12_pCell)) >= crt.P2U(unsafe.Pointer(_12_pPage.XaDataEnd)) {
 55277  		return _sqlite3CorruptError(tls, int32(64268))
 55278  	}
 55279  	goto _62
 55280  _63:
 55281  _61:
 55282  	_sqlite3GetVarint(tls, _12_pCell, (*uint64)(unsafe.Pointer(&_14_nCellKey)))
 55283  	if _14_nCellKey >= _intKey {
 55284  		goto _65
 55285  	}
 55286  	_12_lwr = _12_idx + int32(1)
 55287  	if _12_lwr > _12_upr {
 55288  		_12_c = int32(-1)
 55289  		goto _60
 55290  	}
 55291  	goto _70
 55292  _65:
 55293  	if _14_nCellKey <= _intKey {
 55294  		goto _68
 55295  	}
 55296  	_12_upr = _12_idx - int32(1)
 55297  	if _12_lwr > _12_upr {
 55298  		_12_c = int32(1)
 55299  		goto _60
 55300  	}
 55301  	goto _70
 55302  _68:
 55303  	func() {
 55304  		if _14_nCellKey != _intKey {
 55305  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64279), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72601)))
 55306  			crt.X__builtin_abort(tls)
 55307  		}
 55308  	}()
 55309  	_pCur.Xix = uint16(_12_idx)
 55310  	if _12_pPage.Xleaf == 0 {
 55311  		_12_lwr = _12_idx
 55312  		goto _moveto_next_layer
 55313  	}
 55314  	{
 55315  		p := &_pCur.XcurFlags
 55316  		*p = uint8(int32(*p) | int32(2))
 55317  	}
 55318  	_pCur.Xinfo.XnKey = _14_nCellKey
 55319  	_pCur.Xinfo.XnSize = 0
 55320  	*_pRes = int32(0)
 55321  	return int32(0)
 55322  
 55323  _70:
 55324  	func() {
 55325  		if (_12_lwr + _12_upr) < int32(0) {
 55326  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64292), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72618)))
 55327  			crt.X__builtin_abort(tls)
 55328  		}
 55329  	}()
 55330  	_12_idx = (_12_lwr + _12_upr) >> 1
 55331  	goto _58
 55332  _60:
 55333  	goto _77
 55334  _57:
 55335  _78:
 55336  	_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)))))))
 55337  	_25_nCell = int32(*elem15(_12_pCell, 0))
 55338  	if _25_nCell <= int32(_12_pPage.Xmax1bytePayload) {
 55339  		_12_c = _xRecordCompare(tls, _25_nCell, unsafe.Pointer(elem15(_12_pCell, uintptr(1))), _pIdxKey)
 55340  		goto _85
 55341  	}
 55342  	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)) {
 55343  		_12_c = _xRecordCompare(tls, _25_nCell, unsafe.Pointer(elem15(_12_pCell, uintptr(2))), _pIdxKey)
 55344  		goto _85
 55345  	}
 55346  	_28_pCellBody = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pCell)) - uintptr(_12_pPage.XchildPtrSize)))
 55347  	func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) {
 55348  		v := _12_pPage.XxParseCell
 55349  		return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v))
 55350  	}()(tls, _12_pPage, _28_pCellBody, &_pCur.Xinfo)
 55351  	_25_nCell = int32(_pCur.Xinfo.XnKey)
 55352  	if _25_nCell < int32(2) {
 55353  		_rc = _sqlite3CorruptError(tls, int32(64341))
 55354  		goto _moveto_finish
 55355  	}
 55356  	_28_pCellKey = _sqlite3Malloc(tls, uint64(_25_nCell+int32(18)))
 55357  	if _28_pCellKey == nil {
 55358  		_rc = _sqlite3NomemError(tls, int32(64346))
 55359  		goto _moveto_finish
 55360  	}
 55361  	_pCur.Xix = uint16(_12_idx)
 55362  	_rc = _accessPayload(tls, _pCur, 0, uint32(_25_nCell), (*uint8)(_28_pCellKey), int32(0))
 55363  	{
 55364  		p := &_pCur.XcurFlags
 55365  		*p = uint8(int32(*p) & int32(-5))
 55366  	}
 55367  	if _rc != 0 {
 55368  		Xsqlite3_free(tls, _28_pCellKey)
 55369  		goto _moveto_finish
 55370  	}
 55371  	_12_c = _xRecordCompare(tls, _25_nCell, _28_pCellKey, _pIdxKey)
 55372  	Xsqlite3_free(tls, _28_pCellKey)
 55373  _85:
 55374  	func() {
 55375  		if int32(_pIdxKey.XerrCode) == int32(11) && _12_c != int32(0) || int32(_pIdxKey.XerrCode) == int32(7) && ((*Xsqlite3)((*XBtree)(_pCur.XpBtree).Xdb).XmallocFailed) == 0 {
 55376  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64359), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72629)))
 55377  			crt.X__builtin_abort(tls)
 55378  		}
 55379  	}()
 55380  	if _12_c < int32(0) {
 55381  		_12_lwr = _12_idx + int32(1)
 55382  		goto _97
 55383  	}
 55384  	if _12_c > int32(0) {
 55385  		_12_upr = _12_idx - int32(1)
 55386  		goto _97
 55387  	}
 55388  	func() {
 55389  		if _12_c != int32(0) {
 55390  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64368), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72742)))
 55391  			crt.X__builtin_abort(tls)
 55392  		}
 55393  	}()
 55394  	*_pRes = int32(0)
 55395  	_rc = int32(0)
 55396  	_pCur.Xix = uint16(_12_idx)
 55397  	if _pIdxKey.XerrCode != 0 {
 55398  		_rc = int32(11)
 55399  	}
 55400  	goto _moveto_finish
 55401  _97:
 55402  	if _12_lwr > _12_upr {
 55403  		goto _80
 55404  	}
 55405  	func() {
 55406  		if (_12_lwr + _12_upr) < int32(0) {
 55407  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64376), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72618)))
 55408  			crt.X__builtin_abort(tls)
 55409  		}
 55410  	}()
 55411  	_12_idx = (_12_lwr + _12_upr) >> 1
 55412  	goto _78
 55413  _80:
 55414  _77:
 55415  	func() {
 55416  		if _12_lwr != (_12_upr+int32(1)) && (_12_pPage.XintKey == 0 || _12_pPage.Xleaf != 0) {
 55417  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64380), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72747)))
 55418  			crt.X__builtin_abort(tls)
 55419  		}
 55420  	}()
 55421  	func() {
 55422  		if _12_pPage.XisInit == 0 {
 55423  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64381), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72793)))
 55424  			crt.X__builtin_abort(tls)
 55425  		}
 55426  	}()
 55427  	if _12_pPage.Xleaf != 0 {
 55428  		func() {
 55429  			if int32(_pCur.Xix) >= int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnCell) {
 55430  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64383), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(10552)))
 55431  				crt.X__builtin_abort(tls)
 55432  			}
 55433  		}()
 55434  		_pCur.Xix = uint16(_12_idx)
 55435  		*_pRes = _12_c
 55436  		_rc = int32(0)
 55437  		goto _moveto_finish
 55438  	}
 55439  _moveto_next_layer:
 55440  	if _12_lwr >= int32(_12_pPage.XnCell) {
 55441  		_12_chldPg = _sqlite3Get4byte(tls, elem15(_12_pPage.XaData, uintptr(int32(_12_pPage.XhdrOffset)+int32(8))))
 55442  		goto _114
 55443  	}
 55444  	_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))))))))
 55445  _114:
 55446  	_pCur.Xix = uint16(_12_lwr)
 55447  	_rc = _moveToChild(tls, _pCur, _12_chldPg)
 55448  	if _rc != 0 {
 55449  		goto _moveto_finish
 55450  	}
 55451  	goto _47
 55452  _moveto_finish:
 55453  	_pCur.Xinfo.XnSize = 0
 55454  	func() {
 55455  		if (int32(_pCur.XcurFlags) & int32(4)) != int32(0) {
 55456  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64401), unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000), unsafe.Pointer(str(72807)))
 55457  			crt.X__builtin_abort(tls)
 55458  		}
 55459  	}()
 55460  	return _rc
 55461  }
 55462  
 55463  // C comment
 55464  //  /* Verify that the cursor and the BtShared agree about what is the current
 55465  //  ** database connetion. This is important in shared-cache mode. If the database
 55466  //  ** connection pointers get out-of-sync, it is possible for routines like
 55467  //  ** btreeInitPage() to reference an stale connection pointer that references a
 55468  //  ** a connection that has already closed.  This routine is used inside assert()
 55469  //  ** statements only and for the purpose of double-checking that the btree code
 55470  //  ** does keep the database connection pointers up-to-date.
 55471  //  */
 55472  func _cursorOwnsBtShared(tls *crt.TLS, _p *XBtCursor) (r0 int32) {
 55473  	func() {
 55474  		if _cursorHoldsMutex(tls, _p) == 0 {
 55475  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59497), unsafe.Pointer(&_cursorOwnsBtSharedØ00__func__Ø000), unsafe.Pointer(str(72844)))
 55476  			crt.X__builtin_abort(tls)
 55477  		}
 55478  	}()
 55479  	return bool2int((*Xsqlite3)((*XBtree)(_p.XpBtree).Xdb) == (*Xsqlite3)((*XBtShared)(_p.XpBt).Xdb))
 55480  }
 55481  
 55482  var _cursorOwnsBtSharedØ00__func__Ø000 [19]int8
 55483  
 55484  func init() {
 55485  	crt.Xstrncpy(nil, &_cursorOwnsBtSharedØ00__func__Ø000[0], str(72864), 19)
 55486  }
 55487  
 55488  var _sqlite3BtreeMovetoUnpackedØ00__func__Ø000 [27]int8
 55489  
 55490  func init() {
 55491  	crt.Xstrncpy(nil, &_sqlite3BtreeMovetoUnpackedØ00__func__Ø000[0], str(72883), 27)
 55492  }
 55493  
 55494  func _sqlite3BtreeNext(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) {
 55495  	var _pPage *XMemPage
 55496  	func() {
 55497  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 55498  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64535), unsafe.Pointer(&_sqlite3BtreeNextØ00__func__Ø000), unsafe.Pointer(str(71986)))
 55499  			crt.X__builtin_abort(tls)
 55500  		}
 55501  	}()
 55502  	func() {
 55503  		if _pRes == nil {
 55504  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64536), unsafe.Pointer(&_sqlite3BtreeNextØ00__func__Ø000), unsafe.Pointer(str(72910)))
 55505  			crt.X__builtin_abort(tls)
 55506  		}
 55507  	}()
 55508  	func() {
 55509  		if (*_pRes) != int32(0) && (*_pRes) != int32(1) {
 55510  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64537), unsafe.Pointer(&_sqlite3BtreeNextØ00__func__Ø000), unsafe.Pointer(str(72918)))
 55511  			crt.X__builtin_abort(tls)
 55512  		}
 55513  	}()
 55514  	func() {
 55515  		if _pCur.XskipNext != int32(0) && int32(_pCur.XeState) == int32(1) {
 55516  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64538), unsafe.Pointer(&_sqlite3BtreeNextØ00__func__Ø000), unsafe.Pointer(str(72939)))
 55517  			crt.X__builtin_abort(tls)
 55518  		}
 55519  	}()
 55520  	_pCur.Xinfo.XnSize = 0
 55521  	{
 55522  		p := &_pCur.XcurFlags
 55523  		*p = uint8(int32(*p) & int32(-7))
 55524  	}
 55525  	*_pRes = int32(0)
 55526  	if int32(_pCur.XeState) != int32(1) {
 55527  		return _btreeNext(tls, _pCur, _pRes)
 55528  	}
 55529  	_pPage = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))
 55530  	if int32(preInc76(&_pCur.Xix, uint16(1))) >= int32(_pPage.XnCell) {
 55531  		_pCur.Xix -= 1
 55532  		return _btreeNext(tls, _pCur, _pRes)
 55533  	}
 55534  	if _pPage.Xleaf != 0 {
 55535  		return int32(0)
 55536  	}
 55537  	return _moveToLeftmost(tls, _pCur)
 55538  }
 55539  
 55540  var _sqlite3BtreeNextØ00__func__Ø000 [17]int8
 55541  
 55542  func init() {
 55543  	crt.Xstrncpy(nil, &_sqlite3BtreeNextØ00__func__Ø000[0], str(72987), 17)
 55544  }
 55545  
 55546  // C comment
 55547  //  /*
 55548  //  ** Advance the cursor to the next entry in the database.  If
 55549  //  ** successful then set *pRes=0.  If the cursor
 55550  //  ** was already pointing to the last entry in the database before
 55551  //  ** this routine was called, then set *pRes=1.
 55552  //  **
 55553  //  ** The main entry point is sqlite3BtreeNext().  That routine is optimized
 55554  //  ** for the common case of merely incrementing the cell counter BtCursor.aiIdx
 55555  //  ** to the next cell on the current page.  The (slower) btreeNext() helper
 55556  //  ** routine is called when it is necessary to move to a different page or
 55557  //  ** to restore the cursor.
 55558  //  **
 55559  //  ** The calling function will set *pRes to 0 or 1.  The initial *pRes value
 55560  //  ** will be 1 if the cursor being stepped corresponds to an SQL index and
 55561  //  ** if this routine could have been skipped if that SQL index had been
 55562  //  ** a unique index.  Otherwise the caller will have set *pRes to zero.
 55563  //  ** Zero is the common case. The btree implementation is free to use the
 55564  //  ** initial *pRes value as a hint to improve performance, but the current
 55565  //  ** SQLite btree implementation does not. (Note that the comdb2 btree
 55566  //  ** implementation does use this hint, however.)
 55567  //  */
 55568  func _btreeNext(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) {
 55569  	var _rc, _idx int32
 55570  	var _pPage *XMemPage
 55571  	func() {
 55572  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 55573  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64471), unsafe.Pointer(&_btreeNextØ00__func__Ø000), unsafe.Pointer(str(71986)))
 55574  			crt.X__builtin_abort(tls)
 55575  		}
 55576  	}()
 55577  	func() {
 55578  		if _pCur.XskipNext != int32(0) && int32(_pCur.XeState) == int32(1) {
 55579  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64472), unsafe.Pointer(&_btreeNextØ00__func__Ø000), unsafe.Pointer(str(72939)))
 55580  			crt.X__builtin_abort(tls)
 55581  		}
 55582  	}()
 55583  	func() {
 55584  		if (*_pRes) != int32(0) {
 55585  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64473), unsafe.Pointer(&_btreeNextØ00__func__Ø000), unsafe.Pointer(str(73004)))
 55586  			crt.X__builtin_abort(tls)
 55587  		}
 55588  	}()
 55589  	if int32(_pCur.XeState) == int32(1) {
 55590  		goto _7
 55591  	}
 55592  	func() {
 55593  		if (int32(_pCur.XcurFlags) & int32(4)) != int32(0) {
 55594  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64475), unsafe.Pointer(&_btreeNextØ00__func__Ø000), unsafe.Pointer(str(72807)))
 55595  			crt.X__builtin_abort(tls)
 55596  		}
 55597  	}()
 55598  	_rc = func() int32 {
 55599  		if int32(_pCur.XeState) >= int32(3) {
 55600  			return _btreeRestoreCursorPosition(tls, _pCur)
 55601  		}
 55602  		return int32(0)
 55603  	}()
 55604  	if _rc != int32(0) {
 55605  		return _rc
 55606  	}
 55607  	if int32(0) == int32(_pCur.XeState) {
 55608  		*_pRes = int32(1)
 55609  		return int32(0)
 55610  	}
 55611  	if _pCur.XskipNext == 0 {
 55612  		goto _14
 55613  	}
 55614  	func() {
 55615  		if int32(_pCur.XeState) != int32(1) && int32(_pCur.XeState) != int32(2) {
 55616  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64485), unsafe.Pointer(&_btreeNextØ00__func__Ø000), unsafe.Pointer(str(73013)))
 55617  			crt.X__builtin_abort(tls)
 55618  		}
 55619  	}()
 55620  	_pCur.XeState = uint8(1)
 55621  	if _pCur.XskipNext > int32(0) {
 55622  		_pCur.XskipNext = int32(0)
 55623  		return int32(0)
 55624  	}
 55625  	_pCur.XskipNext = int32(0)
 55626  _14:
 55627  _7:
 55628  	_pPage = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))
 55629  	_idx = int32(preInc76(&_pCur.Xix, uint16(1)))
 55630  	func() {
 55631  		if _pPage.XisInit == 0 {
 55632  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64497), unsafe.Pointer(&_btreeNextØ00__func__Ø000), unsafe.Pointer(str(72793)))
 55633  			crt.X__builtin_abort(tls)
 55634  		}
 55635  	}()
 55636  	if _idx < int32(_pPage.XnCell) {
 55637  		goto _21
 55638  	}
 55639  	if _pPage.Xleaf != 0 {
 55640  		goto _22
 55641  	}
 55642  	_rc = _moveToChild(tls, _pCur, _sqlite3Get4byte(tls, elem15(_pPage.XaData, uintptr(int32(_pPage.XhdrOffset)+int32(8)))))
 55643  	if _rc != 0 {
 55644  		return _rc
 55645  	}
 55646  	return _moveToLeftmost(tls, _pCur)
 55647  
 55648  _22:
 55649  	if int32(_pCur.XiPage) == int32(0) {
 55650  		*_pRes = int32(1)
 55651  		_pCur.XeState = 0
 55652  		return int32(0)
 55653  	}
 55654  	_moveToParent(tls, _pCur)
 55655  	_pPage = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))
 55656  	if int32(_pCur.Xix) >= int32(_pPage.XnCell) {
 55657  		goto _22
 55658  	}
 55659  	if _pPage.XintKey != 0 {
 55660  		return _sqlite3BtreeNext(tls, _pCur, _pRes)
 55661  	}
 55662  	return int32(0)
 55663  
 55664  _21:
 55665  	if _pPage.Xleaf != 0 {
 55666  		return int32(0)
 55667  	}
 55668  	return _moveToLeftmost(tls, _pCur)
 55669  }
 55670  
 55671  var _btreeNextØ00__func__Ø000 [10]int8
 55672  
 55673  func init() {
 55674  	crt.Xstrncpy(nil, &_btreeNextØ00__func__Ø000[0], str(73073), 10)
 55675  }
 55676  
 55677  // C comment
 55678  //  /*
 55679  //  ** Restore the cursor to the position it was in (or as close to as possible)
 55680  //  ** when saveCursorPosition() was called. Note that this call deletes the
 55681  //  ** saved position info stored by saveCursorPosition(), so there can be
 55682  //  ** at most one effective restoreCursorPosition() call after each
 55683  //  ** saveCursorPosition().
 55684  //  */
 55685  func _btreeRestoreCursorPosition(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 55686  	var _rc, _skipNext int32
 55687  	func() {
 55688  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 55689  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59832), unsafe.Pointer(&_btreeRestoreCursorPositionØ00__func__Ø000), unsafe.Pointer(str(71986)))
 55690  			crt.X__builtin_abort(tls)
 55691  		}
 55692  	}()
 55693  	func() {
 55694  		if int32(_pCur.XeState) < int32(3) {
 55695  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59833), unsafe.Pointer(&_btreeRestoreCursorPositionØ00__func__Ø000), unsafe.Pointer(str(73083)))
 55696  			crt.X__builtin_abort(tls)
 55697  		}
 55698  	}()
 55699  	if int32(_pCur.XeState) == int32(4) {
 55700  		return _pCur.XskipNext
 55701  	}
 55702  	_pCur.XeState = 0
 55703  	_rc = _btreeMoveto(tls, _pCur, _pCur.XpKey, _pCur.XnKey, int32(0), &_skipNext)
 55704  	if _rc != int32(0) {
 55705  		goto _5
 55706  	}
 55707  	Xsqlite3_free(tls, _pCur.XpKey)
 55708  	_pCur.XpKey = nil
 55709  	func() {
 55710  		if int32(_pCur.XeState) != int32(1) && int32(_pCur.XeState) != int32(0) {
 55711  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59842), unsafe.Pointer(&_btreeRestoreCursorPositionØ00__func__Ø000), unsafe.Pointer(str(73116)))
 55712  			crt.X__builtin_abort(tls)
 55713  		}
 55714  	}()
 55715  	_pCur.XskipNext |= _skipNext
 55716  	if _pCur.XskipNext != 0 && (int32(_pCur.XeState) == int32(1)) {
 55717  		_pCur.XeState = uint8(2)
 55718  	}
 55719  _5:
 55720  	return _rc
 55721  }
 55722  
 55723  var _btreeRestoreCursorPositionØ00__func__Ø000 [27]int8
 55724  
 55725  func init() {
 55726  	crt.Xstrncpy(nil, &_btreeRestoreCursorPositionØ00__func__Ø000[0], str(73175), 27)
 55727  }
 55728  
 55729  // C comment
 55730  //  /*
 55731  //  ** In this version of BtreeMoveto, pKey is a packed index record
 55732  //  ** such as is generated by the OP_MakeRecord opcode.  Unpack the
 55733  //  ** record and then call BtreeMovetoUnpacked() to do the work.
 55734  //  */
 55735  func _btreeMoveto(tls *crt.TLS, _pCur *XBtCursor, _pKey unsafe.Pointer, _nKey int64, _bias int32, _pRes *int32) (r0 int32) {
 55736  	var _rc int32
 55737  	var _pIdxKey *XUnpackedRecord
 55738  	if _pKey == nil {
 55739  		goto _0
 55740  	}
 55741  	func() {
 55742  		if _nKey != int64(int32(_nKey)) {
 55743  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59803), unsafe.Pointer(&_btreeMovetoØ00__func__Ø000), unsafe.Pointer(str(73202)))
 55744  			crt.X__builtin_abort(tls)
 55745  		}
 55746  	}()
 55747  	_pIdxKey = _sqlite3VdbeAllocUnpackedRecord(tls, (*XKeyInfo)(_pCur.XpKeyInfo))
 55748  	if _pIdxKey == nil {
 55749  		return _sqlite3NomemError(tls, int32(59805))
 55750  	}
 55751  	_sqlite3VdbeRecordUnpack(tls, (*XKeyInfo)(_pCur.XpKeyInfo), int32(_nKey), _pKey, _pIdxKey)
 55752  	if int32(_pIdxKey.XnField) == int32(0) {
 55753  		_rc = _sqlite3CorruptError(tls, int32(59808))
 55754  		goto _moveto_done
 55755  	}
 55756  	goto _5
 55757  _0:
 55758  	_pIdxKey = nil
 55759  _5:
 55760  	_rc = _sqlite3BtreeMovetoUnpacked(tls, _pCur, _pIdxKey, _nKey, _bias, _pRes)
 55761  _moveto_done:
 55762  	if _pIdxKey != nil {
 55763  		_sqlite3DbFree(tls, (*Xsqlite3)((*XKeyInfo)(_pCur.XpKeyInfo).Xdb), unsafe.Pointer(_pIdxKey))
 55764  	}
 55765  	return _rc
 55766  }
 55767  
 55768  var _btreeMovetoØ00__func__Ø000 [12]int8
 55769  
 55770  func init() {
 55771  	crt.Xstrncpy(nil, &_btreeMovetoØ00__func__Ø000[0], str(73223), 12)
 55772  }
 55773  
 55774  // C comment
 55775  //  /*
 55776  //  ** This routine is used to allocate sufficient space for an UnpackedRecord
 55777  //  ** structure large enough to be used with sqlite3VdbeRecordUnpack() if
 55778  //  ** the first argument is a pointer to KeyInfo structure pKeyInfo.
 55779  //  **
 55780  //  ** The space is either allocated using sqlite3DbMallocRaw() or from within
 55781  //  ** the unaligned buffer passed via the second and third arguments (presumably
 55782  //  ** stack space). If the former, then *ppFree is set to a pointer that should
 55783  //  ** be eventually freed by the caller using sqlite3DbFree(). Or, if the
 55784  //  ** allocation comes from the pSpace/szSpace buffer, *ppFree is set to NULL
 55785  //  ** before returning.
 55786  //  **
 55787  //  ** If an OOM error occurs, NULL is returned.
 55788  //  */
 55789  func _sqlite3VdbeAllocUnpackedRecord(tls *crt.TLS, _pKeyInfo *XKeyInfo) (r0 *XUnpackedRecord) {
 55790  	var _nByte int32
 55791  	var _p *XUnpackedRecord
 55792  	_nByte = int32(uint32(16) + (uint32(48) * uint32(int32(_pKeyInfo.XnField)+int32(1))))
 55793  	_p = (*XUnpackedRecord)(_sqlite3DbMallocRaw(tls, (*Xsqlite3)(_pKeyInfo.Xdb), uint64(_nByte)))
 55794  	if _p == nil {
 55795  		return nil
 55796  	}
 55797  	*(**XMem)(unsafe.Pointer(&_p.XaMem)) = (*XMem)(unsafe.Pointer(elem1((*int8)(unsafe.Pointer(_p)), uintptr(16))))
 55798  	func() {
 55799  		if _pKeyInfo.XaSortOrder == nil {
 55800  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74948), unsafe.Pointer(&_sqlite3VdbeAllocUnpackedRecordØ00__func__Ø000), unsafe.Pointer(str(37807)))
 55801  			crt.X__builtin_abort(tls)
 55802  		}
 55803  	}()
 55804  	*(**XKeyInfo)(unsafe.Pointer(&_p.XpKeyInfo)) = _pKeyInfo
 55805  	_p.XnField = uint16(int32(_pKeyInfo.XnField) + int32(1))
 55806  	return _p
 55807  }
 55808  
 55809  var _sqlite3VdbeAllocUnpackedRecordØ00__func__Ø000 [31]int8
 55810  
 55811  func init() {
 55812  	crt.Xstrncpy(nil, &_sqlite3VdbeAllocUnpackedRecordØ00__func__Ø000[0], str(73235), 31)
 55813  }
 55814  
 55815  func _sqlite3VdbeRecordUnpack(tls *crt.TLS, _pKeyInfo *XKeyInfo, _nKey int32, _pKey unsafe.Pointer, _p *XUnpackedRecord) {
 55816  	var _d int32
 55817  	var _idx, _szHdr, _1_serial_type uint32
 55818  	var _u uint16
 55819  	var _aKey *uint8
 55820  	var _pMem *XMem
 55821  	_aKey = (*uint8)(_pKey)
 55822  	_pMem = (*XMem)(_p.XaMem)
 55823  	_p.Xdefault_rc = 0
 55824  	func() {
 55825  		if (int32(uintptr(unsafe.Pointer(_pMem))) & int32(7)) != int32(0) {
 55826  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74973), unsafe.Pointer(&_sqlite3VdbeRecordUnpackØ00__func__Ø000), unsafe.Pointer(str(6222)))
 55827  			crt.X__builtin_abort(tls)
 55828  		}
 55829  	}()
 55830  	_idx = uint32(uint8(func() int32 {
 55831  		if int32(*_aKey) < int32(128) {
 55832  			return func() int32 { _szHdr = uint32(*_aKey); return int32(1) }()
 55833  		}
 55834  		return int32(_sqlite3GetVarint32(tls, _aKey, &_szHdr))
 55835  	}()))
 55836  	_d = int32(_szHdr)
 55837  	_u = 0
 55838  _4:
 55839  	if _idx >= _szHdr || _d > _nKey {
 55840  		goto _5
 55841  	}
 55842  	_idx += uint32(uint8(func() int32 {
 55843  		if int32(*elem15(_aKey, uintptr(_idx))) < int32(128) {
 55844  			return func() int32 { _1_serial_type = uint32(*elem15(_aKey, uintptr(_idx))); return int32(1) }()
 55845  		}
 55846  		return int32(_sqlite3GetVarint32(tls, elem15(_aKey, uintptr(_idx)), &_1_serial_type))
 55847  	}()))
 55848  	_pMem.Xenc = _pKeyInfo.Xenc
 55849  	*(**Xsqlite3)(unsafe.Pointer(&_pMem.Xdb)) = (*Xsqlite3)(_pKeyInfo.Xdb)
 55850  	_pMem.XszMalloc = int32(0)
 55851  	_pMem.Xz = nil
 55852  	{
 55853  		p := &_d
 55854  		*p = int32(uint32(*p) + _sqlite3VdbeSerialGet(tls, elem15(_aKey, uintptr(_d)), _1_serial_type, _pMem))
 55855  	}
 55856  	*(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(48)
 55857  	if int32(preInc76(&_u, uint16(1))) >= int32(_p.XnField) {
 55858  		goto _5
 55859  	}
 55860  	goto _4
 55861  _5:
 55862  	func() {
 55863  		if int32(_u) > (int32(_pKeyInfo.XnField) + int32(1)) {
 55864  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74990), unsafe.Pointer(&_sqlite3VdbeRecordUnpackØ00__func__Ø000), unsafe.Pointer(str(73266)))
 55865  			crt.X__builtin_abort(tls)
 55866  		}
 55867  	}()
 55868  	_p.XnField = _u
 55869  }
 55870  
 55871  var _sqlite3VdbeRecordUnpackØ00__func__Ø000 [24]int8
 55872  
 55873  func init() {
 55874  	crt.Xstrncpy(nil, &_sqlite3VdbeRecordUnpackØ00__func__Ø000[0], str(73290), 24)
 55875  }
 55876  
 55877  // C comment
 55878  //  /*
 55879  //  ** Read a 32-bit variable-length integer from memory starting at p[0].
 55880  //  ** Return the number of bytes read.  The value is stored in *v.
 55881  //  **
 55882  //  ** If the varint stored in p[0] is larger than can fit in a 32-bit unsigned
 55883  //  ** integer, then set *v to 0xffffffff.
 55884  //  **
 55885  //  ** A MACRO version, getVarint32, is provided which inlines the
 55886  //  ** single-byte case.  All code should use the MACRO version as
 55887  //  ** this function assumes the single-byte case has already been handled.
 55888  //  */
 55889  func _sqlite3GetVarint32(tls *crt.TLS, _p *uint8, _v *uint32) (r0 uint8) {
 55890  	var _a, _b uint32
 55891  	var _3_v64 uint64
 55892  	var _3_n uint8
 55893  	_a = uint32(*_p)
 55894  	*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
 55895  	_b = uint32(*_p)
 55896  	if (_b & uint32(128)) == 0 {
 55897  		_a &= uint32(127)
 55898  		_a = _a << 7
 55899  		*_v = _a | _b
 55900  		return uint8(2)
 55901  	}
 55902  	*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
 55903  	_a = _a << 14
 55904  	_a |= uint32(*_p)
 55905  	if (_a & uint32(128)) == 0 {
 55906  		_a &= uint32(2080895)
 55907  		_b &= uint32(127)
 55908  		_b = _b << 7
 55909  		*_v = _a | _b
 55910  		return uint8(3)
 55911  	}
 55912  	*(*uintptr)(unsafe.Pointer(&_p)) -= uintptr(int32(2))
 55913  	_3_n = _sqlite3GetVarint(tls, _p, &_3_v64)
 55914  	func() {
 55915  		if int32(_3_n) <= int32(3) || int32(_3_n) > int32(9) {
 55916  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(28722), unsafe.Pointer(&_sqlite3GetVarint32Ø00__func__Ø000), unsafe.Pointer(str(73314)))
 55917  			crt.X__builtin_abort(tls)
 55918  		}
 55919  	}()
 55920  	if (_3_v64 & uint64(4294967295)) != _3_v64 {
 55921  		*_v = uint32(4294967295)
 55922  		goto _6
 55923  	}
 55924  	*_v = uint32(_3_v64)
 55925  _6:
 55926  	return _3_n
 55927  }
 55928  
 55929  var _sqlite3GetVarint32Ø00__func__Ø000 [19]int8
 55930  
 55931  func init() {
 55932  	crt.Xstrncpy(nil, &_sqlite3GetVarint32Ø00__func__Ø000[0], str(73326), 19)
 55933  }
 55934  
 55935  func _sqlite3VdbeSerialGet(tls *crt.TLS, _buf *uint8, _serial_type uint32, _pMem *XMem) (r0 uint32) {
 55936  	switch _serial_type {
 55937  	case uint32(0):
 55938  		goto _1
 55939  	case uint32(1):
 55940  		goto _4
 55941  	case uint32(2):
 55942  		goto _5
 55943  	case uint32(3):
 55944  		goto _6
 55945  	case uint32(4):
 55946  		goto _7
 55947  	case uint32(5):
 55948  		goto _8
 55949  	case uint32(6):
 55950  		goto _9
 55951  	case uint32(7):
 55952  		goto _9
 55953  	case uint32(8):
 55954  		goto _11
 55955  	case uint32(9):
 55956  		goto _11
 55957  	case uint32(10):
 55958  		goto _1
 55959  	case uint32(11):
 55960  		goto _1
 55961  	default:
 55962  		goto _13
 55963  	}
 55964  
 55965  _1:
 55966  	_pMem.Xflags = uint16(1)
 55967  	goto _14
 55968  _4:
 55969  	*(*int64)(unsafe.Pointer(&_pMem.Xu)) = int64(int8(*elem15(_buf, 0)))
 55970  	_pMem.Xflags = uint16(4)
 55971  	return uint32(1)
 55972  
 55973  _5:
 55974  	*(*int64)(unsafe.Pointer(&_pMem.Xu)) = int64((int32(256) * int32(int8(*elem15(_buf, 0)))) | int32(*elem15(_buf, uintptr(1))))
 55975  	_pMem.Xflags = uint16(4)
 55976  	return uint32(2)
 55977  
 55978  _6:
 55979  	*(*int64)(unsafe.Pointer(&_pMem.Xu)) = int64(((int32(65536) * int32(int8(*elem15(_buf, 0)))) | (int32(*elem15(_buf, uintptr(1))) << 8)) | int32(*elem15(_buf, uintptr(2))))
 55980  	_pMem.Xflags = uint16(4)
 55981  	return uint32(3)
 55982  
 55983  _7:
 55984  	*(*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))))
 55985  	_pMem.Xflags = uint16(4)
 55986  	return uint32(4)
 55987  
 55988  _8:
 55989  	*(*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)))))
 55990  	_pMem.Xflags = uint16(4)
 55991  	return uint32(6)
 55992  
 55993  _9:
 55994  	return _serialGet(tls, _buf, _serial_type, _pMem)
 55995  
 55996  _11:
 55997  	*(*int64)(unsafe.Pointer(&_pMem.Xu)) = int64(_serial_type - uint32(8))
 55998  	_pMem.Xflags = uint16(4)
 55999  	return 0
 56000  
 56001  _13:
 56002  	_pMem.Xz = (*int8)(unsafe.Pointer(_buf))
 56003  	_pMem.Xn = int32((_serial_type - uint32(12)) / uint32(2))
 56004  	_pMem.Xflags = *elem20((*uint16)(unsafe.Pointer(&_sqlite3VdbeSerialGetØ00aFlagØ001)), uintptr(_serial_type&uint32(1)))
 56005  	return uint32(_pMem.Xn)
 56006  
 56007  _14:
 56008  	return 0
 56009  }
 56010  
 56011  func _serialGet(tls *crt.TLS, _buf *uint8, _serial_type uint32, _pMem *XMem) (r0 uint32) {
 56012  	var _y uint32
 56013  	var _x, _2_t2 uint64
 56014  	_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))))
 56015  	_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)))
 56016  	_x = (_x << 32) + uint64(_y)
 56017  	if _serial_type == uint32(6) {
 56018  		*(*int64)(unsafe.Pointer(&_pMem.Xu)) = *(*int64)(unsafe.Pointer(&_x))
 56019  		_pMem.Xflags = uint16(4)
 56020  		goto _1
 56021  	}
 56022  	_2_t2 = _serialGetØ00t1Ø001
 56023  	func() {
 56024  		if int32(1) == 0 || crt.Xmemcmp(tls, unsafe.Pointer(&_serialGetØ00r1Ø002), unsafe.Pointer(&_2_t2), uint32(8)) != int32(0) {
 56025  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74831), unsafe.Pointer(&_serialGetØ00__func__Ø000), unsafe.Pointer(str(73345)))
 56026  			crt.X__builtin_abort(tls)
 56027  		}
 56028  	}()
 56029  
 56030  	crt.Xmemcpy(tls, unsafe.Pointer((*float64)(unsafe.Pointer(&_pMem.Xu))), unsafe.Pointer(&_x), uint32(8))
 56031  	_pMem.Xflags = uint16(func() int32 {
 56032  		if _sqlite3IsNaN(tls, *(*float64)(unsafe.Pointer(&_pMem.Xu))) != 0 {
 56033  			return int32(1)
 56034  		}
 56035  		return int32(8)
 56036  	}())
 56037  _1:
 56038  	return uint32(8)
 56039  
 56040  	_ = _2_t2
 56041  	panic(0)
 56042  }
 56043  
 56044  var _serialGetØ00t1Ø001 uint64
 56045  
 56046  func init() {
 56047  	_serialGetØ00t1Ø001 = uint64(4607182418800017408)
 56048  }
 56049  
 56050  var _serialGetØ00r1Ø002 float64
 56051  
 56052  func init() {
 56053  	_serialGetØ00r1Ø002 = 1
 56054  }
 56055  
 56056  var _serialGetØ00__func__Ø000 [10]int8
 56057  
 56058  func init() {
 56059  	crt.Xstrncpy(nil, &_serialGetØ00__func__Ø000[0], str(73403), 10)
 56060  }
 56061  
 56062  var _sqlite3VdbeSerialGetØ00aFlagØ001 [2]uint16
 56063  
 56064  func init() {
 56065  	_sqlite3VdbeSerialGetØ00aFlagØ001 = [2]uint16{uint16(4112), uint16(4098)}
 56066  }
 56067  
 56068  // C comment
 56069  //  /*
 56070  //  ** Move the cursor down to a new child page.  The newPgno argument is the
 56071  //  ** page number of the child page to move to.
 56072  //  **
 56073  //  ** This function returns SQLITE_CORRUPT if the page-header flags field of
 56074  //  ** the new child page does not match the flags field of the parent (i.e.
 56075  //  ** if an intkey page appears to be the parent of a non-intkey page, or
 56076  //  ** vice-versa).
 56077  //  */
 56078  func _moveToChild(tls *crt.TLS, _pCur *XBtCursor, _newPgno uint32) (r0 int32) {
 56079  	var _pBt *XBtShared
 56080  	_pBt = (*XBtShared)(_pCur.XpBt)
 56081  	func() {
 56082  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 56083  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63862), unsafe.Pointer(&_moveToChildØ00__func__Ø000), unsafe.Pointer(str(71986)))
 56084  			crt.X__builtin_abort(tls)
 56085  		}
 56086  	}()
 56087  	func() {
 56088  		if int32(_pCur.XeState) != int32(1) {
 56089  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63863), unsafe.Pointer(&_moveToChildØ00__func__Ø000), unsafe.Pointer(str(10345)))
 56090  			crt.X__builtin_abort(tls)
 56091  		}
 56092  	}()
 56093  	func() {
 56094  		if int32(_pCur.XiPage) >= int32(20) {
 56095  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63864), unsafe.Pointer(&_moveToChildØ00__func__Ø000), unsafe.Pointer(str(73413)))
 56096  			crt.X__builtin_abort(tls)
 56097  		}
 56098  	}()
 56099  	func() {
 56100  		if int32(_pCur.XiPage) < int32(0) {
 56101  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63865), unsafe.Pointer(&_moveToChildØ00__func__Ø000), unsafe.Pointer(str(73444)))
 56102  			crt.X__builtin_abort(tls)
 56103  		}
 56104  	}()
 56105  	if int32(_pCur.XiPage) >= int32(19) {
 56106  		return _sqlite3CorruptError(tls, int32(63867))
 56107  	}
 56108  	_pCur.Xinfo.XnSize = 0
 56109  	{
 56110  		p := &_pCur.XcurFlags
 56111  		*p = uint8(int32(*p) & int32(-7))
 56112  	}
 56113  	*elem20((*uint16)(unsafe.Pointer(&_pCur.XaiIdx)), uintptr(postInc5(&_pCur.XiPage, 1))) = _pCur.Xix
 56114  	_pCur.Xix = 0
 56115  	return _getAndInitPage(tls, _pBt, _newPgno, elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage)), _pCur, int32(_pCur.XcurPagerFlags))
 56116  }
 56117  
 56118  var _moveToChildØ00__func__Ø000 [12]int8
 56119  
 56120  func init() {
 56121  	crt.Xstrncpy(nil, &_moveToChildØ00__func__Ø000[0], str(73459), 12)
 56122  }
 56123  
 56124  // C comment
 56125  //  /*
 56126  //  ** Get a page from the pager and initialize it.
 56127  //  **
 56128  //  ** If pCur!=0 then the page is being fetched as part of a moveToChild()
 56129  //  ** call.  Do additional sanity checking on the page in this case.
 56130  //  ** And if the fetch fails, this routine must decrement pCur->iPage.
 56131  //  **
 56132  //  ** The page is fetched as read-write unless pCur is not NULL and is
 56133  //  ** a read-only cursor.
 56134  //  **
 56135  //  ** If an error occurs, then *ppPage is undefined. It
 56136  //  ** may remain unchanged, or it may be set to an invalid value.
 56137  //  */
 56138  func _getAndInitPage(tls *crt.TLS, _pBt *XBtShared, _pgno uint32, _ppPage **XMemPage, _pCur *XBtCursor, _bReadOnly int32) (r0 int32) {
 56139  	var _rc int32
 56140  	var _pDbPage *XPgHdr
 56141  	func() {
 56142  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 56143  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61081), unsafe.Pointer(&_getAndInitPageØ00__func__Ø000), unsafe.Pointer(str(9235)))
 56144  			crt.X__builtin_abort(tls)
 56145  		}
 56146  	}()
 56147  	func() {
 56148  		if _pCur != nil && _ppPage != elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage)) {
 56149  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61082), unsafe.Pointer(&_getAndInitPageØ00__func__Ø000), unsafe.Pointer(str(73471)))
 56150  			crt.X__builtin_abort(tls)
 56151  		}
 56152  	}()
 56153  	func() {
 56154  		if _pCur != nil && _bReadOnly != int32(_pCur.XcurPagerFlags) {
 56155  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61083), unsafe.Pointer(&_getAndInitPageØ00__func__Ø000), unsafe.Pointer(str(73517)))
 56156  			crt.X__builtin_abort(tls)
 56157  		}
 56158  	}()
 56159  	func() {
 56160  		if _pCur != nil && int32(_pCur.XiPage) <= int32(0) {
 56161  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61084), unsafe.Pointer(&_getAndInitPageØ00__func__Ø000), unsafe.Pointer(str(73559)))
 56162  			crt.X__builtin_abort(tls)
 56163  		}
 56164  	}()
 56165  	if _pgno > _btreePagecount(tls, _pBt) {
 56166  		_rc = _sqlite3CorruptError(tls, int32(61087))
 56167  		goto _getAndInitPage_error
 56168  	}
 56169  	_rc = _sqlite3PagerGet(tls, (*XPager)(_pBt.XpPager), _pgno, &_pDbPage, _bReadOnly)
 56170  	if _rc != 0 {
 56171  		goto _getAndInitPage_error
 56172  	}
 56173  	*_ppPage = (*XMemPage)(_sqlite3PagerGetExtra(tls, _pDbPage))
 56174  	if int32((*_ppPage).XisInit) != int32(0) {
 56175  		goto _13
 56176  	}
 56177  	_btreePageFromDbPage(tls, _pDbPage, _pgno, _pBt)
 56178  	_rc = _btreeInitPage(tls, *_ppPage)
 56179  	if _rc != int32(0) {
 56180  		_releasePage(tls, *_ppPage)
 56181  		goto _getAndInitPage_error
 56182  	}
 56183  _13:
 56184  	func() {
 56185  		if ((*_ppPage).Xpgno) != _pgno {
 56186  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61103), unsafe.Pointer(&_getAndInitPageØ00__func__Ø000), unsafe.Pointer(str(73584)))
 56187  			crt.X__builtin_abort(tls)
 56188  		}
 56189  	}()
 56190  	func() {
 56191  		if ((*_ppPage).XaData) != (*uint8)(_sqlite3PagerGetData(tls, _pDbPage)) {
 56192  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61104), unsafe.Pointer(&_getAndInitPageØ00__func__Ø000), unsafe.Pointer(str(73606)))
 56193  			crt.X__builtin_abort(tls)
 56194  		}
 56195  	}()
 56196  	if (_pCur != nil) && ((int32((*_ppPage).XnCell) < int32(1)) || (int32((*_ppPage).XintKey) != int32(_pCur.XcurIntKey))) {
 56197  		_rc = _sqlite3CorruptError(tls, int32(61109))
 56198  		_releasePage(tls, *_ppPage)
 56199  		goto _getAndInitPage_error
 56200  	}
 56201  	return int32(0)
 56202  
 56203  _getAndInitPage_error:
 56204  	if _pCur != nil {
 56205  		_pCur.XiPage -= 1
 56206  	}
 56207  	func() {
 56208  		if _pgno == (0) && _rc != int32(11) {
 56209  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61118), unsafe.Pointer(&_getAndInitPageØ00__func__Ø000), unsafe.Pointer(str(73653)))
 56210  			crt.X__builtin_abort(tls)
 56211  		}
 56212  	}()
 56213  	return _rc
 56214  }
 56215  
 56216  var _getAndInitPageØ00__func__Ø000 [15]int8
 56217  
 56218  func init() {
 56219  	crt.Xstrncpy(nil, &_getAndInitPageØ00__func__Ø000[0], str(73683), 15)
 56220  }
 56221  
 56222  // C comment
 56223  //  /*
 56224  //  ** Move the cursor down to the left-most leaf entry beneath the
 56225  //  ** entry to which it is currently pointing.
 56226  //  **
 56227  //  ** The left-most leaf is the one with the smallest key - the first
 56228  //  ** in ascending order.
 56229  //  */
 56230  func _moveToLeftmost(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 56231  	var _rc int32
 56232  	var _pgno uint32
 56233  	var _pPage *XMemPage
 56234  	_rc = int32(0)
 56235  	func() {
 56236  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 56237  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64033), unsafe.Pointer(&_moveToLeftmostØ00__func__Ø000), unsafe.Pointer(str(71986)))
 56238  			crt.X__builtin_abort(tls)
 56239  		}
 56240  	}()
 56241  	func() {
 56242  		if int32(_pCur.XeState) != int32(1) {
 56243  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64034), unsafe.Pointer(&_moveToLeftmostØ00__func__Ø000), unsafe.Pointer(str(10345)))
 56244  			crt.X__builtin_abort(tls)
 56245  		}
 56246  	}()
 56247  _4:
 56248  	if (_rc == int32(0)) && ((store84(&_pPage, *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).Xleaf) == 0) {
 56249  		func() {
 56250  			if int32(_pCur.Xix) >= int32(_pPage.XnCell) {
 56251  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64036), unsafe.Pointer(&_moveToLeftmostØ00__func__Ø000), unsafe.Pointer(str(10637)))
 56252  				crt.X__builtin_abort(tls)
 56253  			}
 56254  		}()
 56255  		_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))))))))
 56256  		_rc = _moveToChild(tls, _pCur, _pgno)
 56257  		goto _4
 56258  	}
 56259  	return _rc
 56260  }
 56261  
 56262  var _moveToLeftmostØ00__func__Ø000 [15]int8
 56263  
 56264  func init() {
 56265  	crt.Xstrncpy(nil, &_moveToLeftmostØ00__func__Ø000[0], str(73698), 15)
 56266  }
 56267  
 56268  // C comment
 56269  //  /*
 56270  //  ** Move the cursor up to the parent page.
 56271  //  **
 56272  //  ** pCur->idx is set to the cell index that contains the pointer
 56273  //  ** to the page we are coming from.  If we are coming from the
 56274  //  ** right-most child page then pCur->idx is set to one more than
 56275  //  ** the largest cell index.
 56276  //  */
 56277  func _moveToParent(tls *crt.TLS, _pCur *XBtCursor) {
 56278  	func() {
 56279  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 56280  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63908), unsafe.Pointer(&_moveToParentØ00__func__Ø000), unsafe.Pointer(str(71986)))
 56281  			crt.X__builtin_abort(tls)
 56282  		}
 56283  	}()
 56284  	func() {
 56285  		if int32(_pCur.XeState) != int32(1) {
 56286  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63909), unsafe.Pointer(&_moveToParentØ00__func__Ø000), unsafe.Pointer(str(10345)))
 56287  			crt.X__builtin_abort(tls)
 56288  		}
 56289  	}()
 56290  	func() {
 56291  		if int32(_pCur.XiPage) <= int32(0) {
 56292  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63910), unsafe.Pointer(&_moveToParentØ00__func__Ø000), unsafe.Pointer(str(73713)))
 56293  			crt.X__builtin_abort(tls)
 56294  		}
 56295  	}()
 56296  	func() {
 56297  		if (*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))) == nil {
 56298  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63911), unsafe.Pointer(&_moveToParentØ00__func__Ø000), unsafe.Pointer(str(73727)))
 56299  			crt.X__builtin_abort(tls)
 56300  		}
 56301  	}()
 56302  	_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)
 56303  	_pCur.Xinfo.XnSize = 0
 56304  	{
 56305  		p := &_pCur.XcurFlags
 56306  		*p = uint8(int32(*p) & int32(-7))
 56307  	}
 56308  	_pCur.Xix = *elem20((*uint16)(unsafe.Pointer(&_pCur.XaiIdx)), uintptr(int32(_pCur.XiPage)-int32(1)))
 56309  	_releasePageNotNull(tls, *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(postInc5(&_pCur.XiPage, -1))))
 56310  }
 56311  
 56312  var _moveToParentØ00__func__Ø000 [13]int8
 56313  
 56314  func init() {
 56315  	crt.Xstrncpy(nil, &_moveToParentØ00__func__Ø000[0], str(73753), 13)
 56316  }
 56317  
 56318  // C comment
 56319  //  /*
 56320  //  ** Page pParent is an internal (non-leaf) tree page. This function
 56321  //  ** asserts that page number iChild is the left-child if the iIdx'th
 56322  //  ** cell in page pParent. Or, if iIdx is equal to the total number of
 56323  //  ** cells in pParent, that page number iChild is the right-child of
 56324  //  ** the page.
 56325  //  */
 56326  func _assertParentIndex(tls *crt.TLS, _pParent *XMemPage, _iIdx int32, _iChild uint32) {
 56327  	if _sqlite3Config.XneverCorrupt == int32(0) {
 56328  		return
 56329  	}
 56330  	func() {
 56331  		if _iIdx > int32(_pParent.XnCell) {
 56332  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63888), unsafe.Pointer(&_assertParentIndexØ00__func__Ø000), unsafe.Pointer(str(73766)))
 56333  			crt.X__builtin_abort(tls)
 56334  		}
 56335  	}()
 56336  	if _iIdx == int32(_pParent.XnCell) {
 56337  		func() {
 56338  			if _sqlite3Get4byte(tls, elem15(_pParent.XaData, uintptr(int32(_pParent.XhdrOffset)+int32(8)))) != _iChild {
 56339  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63890), unsafe.Pointer(&_assertParentIndexØ00__func__Ø000), unsafe.Pointer(str(73787)))
 56340  				crt.X__builtin_abort(tls)
 56341  			}
 56342  		}()
 56343  		goto _6
 56344  	}
 56345  	func() {
 56346  		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 {
 56347  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63892), unsafe.Pointer(&_assertParentIndexØ00__func__Ø000), unsafe.Pointer(str(73843)))
 56348  			crt.X__builtin_abort(tls)
 56349  		}
 56350  	}()
 56351  _6:
 56352  }
 56353  
 56354  var _assertParentIndexØ00__func__Ø000 [18]int8
 56355  
 56356  func init() {
 56357  	crt.Xstrncpy(nil, &_assertParentIndexØ00__func__Ø000[0], str(73885), 18)
 56358  }
 56359  
 56360  // C comment
 56361  //  /*
 56362  //  ** Return a pointer to an sqlite3VdbeRecordCompare() compatible function
 56363  //  ** suitable for comparing serialized records to the unpacked record passed
 56364  //  ** as the only argument.
 56365  //  */
 56366  func _sqlite3VdbeFindCompare(tls *crt.TLS, _p *XUnpackedRecord) (r0 func(*crt.TLS, int32, unsafe.Pointer, *XUnpackedRecord) int32) {
 56367  	var _1_flags int32
 56368  	if (int32((*XKeyInfo)(_p.XpKeyInfo).XnField) + int32((*XKeyInfo)(_p.XpKeyInfo).XnXField)) > int32(13) {
 56369  		goto _0
 56370  	}
 56371  	_1_flags = int32(elem25((*XMem)(_p.XaMem), 0).Xflags)
 56372  	if (*elem15((*XKeyInfo)(_p.XpKeyInfo).XaSortOrder, 0)) != 0 {
 56373  		_p.Xr1 = int8(1)
 56374  		_p.Xr2 = int8(-1)
 56375  		goto _2
 56376  	}
 56377  	_p.Xr1 = int8(-1)
 56378  	_p.Xr2 = int8(1)
 56379  _2:
 56380  	if (_1_flags & int32(4)) != 0 {
 56381  		return _vdbeRecordCompareInt
 56382  	}
 56383  	if ((_1_flags & int32(25)) == int32(0)) && ((*elem62((**XCollSeq)(unsafe.Pointer(&((*XKeyInfo)(_p.XpKeyInfo).XaColl))), 0)) == nil) {
 56384  		func() {
 56385  			if (_1_flags & int32(2)) == 0 {
 56386  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75785), unsafe.Pointer(&_sqlite3VdbeFindCompareØ00__func__Ø000), unsafe.Pointer(str(73903)))
 56387  				crt.X__builtin_abort(tls)
 56388  			}
 56389  		}()
 56390  		return _vdbeRecordCompareString
 56391  	}
 56392  _0:
 56393  	return _sqlite3VdbeRecordCompare
 56394  }
 56395  
 56396  // C comment
 56397  //  /*
 56398  //  ** This function is an optimized version of sqlite3VdbeRecordCompare()
 56399  //  ** that (a) the first field of pPKey2 is an integer, and (b) the
 56400  //  ** size-of-header varint at the start of (pKey1/nKey1) fits in a single
 56401  //  ** byte (i.e. is less than 128).
 56402  //  **
 56403  //  ** To avoid concerns about buffer overreads, this routine is only used
 56404  //  ** on schemas where the maximum valid header size is 63 bytes or less.
 56405  //  */
 56406  func _vdbeRecordCompareInt(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, _pPKey2 *XUnpackedRecord) (r0 int32) {
 56407  	var _serial_type, _res int32
 56408  	var _v, _lhs int64
 56409  	var _y uint32
 56410  	var _x uint64
 56411  	var _aKey *uint8
 56412  	_aKey = elem15((*uint8)(_pKey1), uintptr(int32(*(*uint8)(_pKey1))&int32(63)))
 56413  	_serial_type = int32(*elem15((*uint8)(_pKey1), uintptr(1)))
 56414  	_vdbeAssertFieldCountWithinLimits(tls, _nKey1, _pKey1, (*XKeyInfo)(_pPKey2.XpKeyInfo))
 56415  	func() {
 56416  		if int32(*(*uint8)(_pKey1)) > int32(63) && _sqlite3Config.XneverCorrupt != int32(0) {
 56417  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75613), unsafe.Pointer(&_vdbeRecordCompareIntØ00__func__Ø000), unsafe.Pointer(str(73919)))
 56418  			crt.X__builtin_abort(tls)
 56419  		}
 56420  	}()
 56421  	switch _serial_type {
 56422  	case int32(0):
 56423  		goto _12
 56424  	case int32(1):
 56425  		goto _4
 56426  	case int32(2):
 56427  		goto _5
 56428  	case int32(3):
 56429  		goto _6
 56430  	case int32(4):
 56431  		goto _7
 56432  	case int32(5):
 56433  		goto _8
 56434  	case int32(6):
 56435  		goto _9
 56436  	case int32(7):
 56437  		goto _12
 56438  	case int32(8):
 56439  		goto _10
 56440  	case int32(9):
 56441  		goto _11
 56442  	default:
 56443  		goto _14
 56444  	}
 56445  
 56446  _4:
 56447  	_lhs = int64(int8(*elem15(_aKey, 0)))
 56448  	goto _15
 56449  _5:
 56450  	_lhs = int64((int32(256) * int32(int8(*elem15(_aKey, 0)))) | int32(*elem15(_aKey, uintptr(1))))
 56451  	goto _15
 56452  _6:
 56453  	_lhs = int64(((int32(65536) * int32(int8(*elem15(_aKey, 0)))) | (int32(*elem15(_aKey, uintptr(1))) << 8)) | int32(*elem15(_aKey, uintptr(2))))
 56454  	goto _15
 56455  _7:
 56456  	_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)))
 56457  	_lhs = int64(*(*int32)(unsafe.Pointer(&_y)))
 56458  	goto _15
 56459  _8:
 56460  	_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)))))
 56461  	goto _15
 56462  _9:
 56463  	_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))))
 56464  	_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))))
 56465  	_lhs = *(*int64)(unsafe.Pointer(&_x))
 56466  	goto _15
 56467  _10:
 56468  	_lhs = 0
 56469  	goto _15
 56470  _11:
 56471  	_lhs = int64(1)
 56472  	goto _15
 56473  _12:
 56474  	return _sqlite3VdbeRecordCompare(tls, _nKey1, _pKey1, _pPKey2)
 56475  
 56476  _14:
 56477  	return _sqlite3VdbeRecordCompare(tls, _nKey1, _pKey1, _pPKey2)
 56478  
 56479  _15:
 56480  	_v = *(*int64)(unsafe.Pointer(&(elem25((*XMem)(_pPKey2.XaMem), 0).Xu)))
 56481  	if _v > _lhs {
 56482  		_res = int32(_pPKey2.Xr1)
 56483  		goto _21
 56484  	}
 56485  	if _v < _lhs {
 56486  		_res = int32(_pPKey2.Xr2)
 56487  		goto _21
 56488  	}
 56489  	if int32(_pPKey2.XnField) > int32(1) {
 56490  		_res = _sqlite3VdbeRecordCompareWithSkip(tls, _nKey1, _pKey1, _pPKey2, int32(1))
 56491  		goto _21
 56492  	}
 56493  	_res = int32(_pPKey2.Xdefault_rc)
 56494  	_pPKey2.XeqSeen = uint8(1)
 56495  _21:
 56496  	func() {
 56497  		if _vdbeRecordCompareDebug(tls, _nKey1, _pKey1, _pPKey2, _res) == 0 {
 56498  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75684), unsafe.Pointer(&_vdbeRecordCompareIntØ00__func__Ø000), unsafe.Pointer(str(73953)))
 56499  			crt.X__builtin_abort(tls)
 56500  		}
 56501  	}()
 56502  	return _res
 56503  
 56504  	_ = _y
 56505  	panic(0)
 56506  }
 56507  
 56508  // C comment
 56509  //  /*
 56510  //  ** Count the number of fields (a.k.a. columns) in the record given by
 56511  //  ** pKey,nKey.  The verify that this count is less than or equal to the
 56512  //  ** limit given by pKeyInfo->nField + pKeyInfo->nXField.
 56513  //  **
 56514  //  ** If this constraint is not satisfied, it means that the high-speed
 56515  //  ** vdbeRecordCompareInt() and vdbeRecordCompareString() routines will
 56516  //  ** not work correctly.  If this assert() ever fires, it probably means
 56517  //  ** that the KeyInfo.nField or KeyInfo.nXField values were computed
 56518  //  ** incorrectly.
 56519  //  */
 56520  func _vdbeAssertFieldCountWithinLimits(tls *crt.TLS, _nKey int32, _pKey unsafe.Pointer, _pKeyInfo *XKeyInfo) {
 56521  	var _nField int32
 56522  	var _szHdr, _idx, _notUsed uint32
 56523  	var _aKey *uint8
 56524  	_nField = int32(0)
 56525  	_aKey = (*uint8)(_pKey)
 56526  	if _sqlite3Config.XneverCorrupt == int32(0) {
 56527  		return
 56528  	}
 56529  	_idx = uint32(uint8(func() int32 {
 56530  		if int32(*_aKey) < int32(128) {
 56531  			return func() int32 { _szHdr = uint32(*_aKey); return int32(1) }()
 56532  		}
 56533  		return int32(_sqlite3GetVarint32(tls, _aKey, &_szHdr))
 56534  	}()))
 56535  	func() {
 56536  		if _nKey < int32(0) {
 56537  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75123), unsafe.Pointer(&_vdbeAssertFieldCountWithinLimitsØ00__func__Ø000), unsafe.Pointer(str(74003)))
 56538  			crt.X__builtin_abort(tls)
 56539  		}
 56540  	}()
 56541  	func() {
 56542  		if _szHdr > uint32(_nKey) {
 56543  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75124), unsafe.Pointer(&_vdbeAssertFieldCountWithinLimitsØ00__func__Ø000), unsafe.Pointer(str(74011)))
 56544  			crt.X__builtin_abort(tls)
 56545  		}
 56546  	}()
 56547  _7:
 56548  	if _idx < _szHdr {
 56549  		_idx += uint32(uint8(func() int32 {
 56550  			if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + uintptr(_idx)))) < int32(128) {
 56551  				return func() int32 {
 56552  					_notUsed = uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + uintptr(_idx))))
 56553  					return int32(1)
 56554  				}()
 56555  			}
 56556  			return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(_idx))), &_notUsed))
 56557  		}()))
 56558  		_nField += 1
 56559  		goto _7
 56560  	}
 56561  	func() {
 56562  		if _nField > (int32(_pKeyInfo.XnField) + int32(_pKeyInfo.XnXField)) {
 56563  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75129), unsafe.Pointer(&_vdbeAssertFieldCountWithinLimitsØ00__func__Ø000), unsafe.Pointer(str(74028)))
 56564  			crt.X__builtin_abort(tls)
 56565  		}
 56566  	}()
 56567  }
 56568  
 56569  var _vdbeAssertFieldCountWithinLimitsØ00__func__Ø000 [33]int8
 56570  
 56571  func init() {
 56572  	crt.Xstrncpy(nil, &_vdbeAssertFieldCountWithinLimitsØ00__func__Ø000[0], str(74073), 33)
 56573  }
 56574  
 56575  var _vdbeRecordCompareIntØ00__func__Ø000 [21]int8
 56576  
 56577  func init() {
 56578  	crt.Xstrncpy(nil, &_vdbeRecordCompareIntØ00__func__Ø000[0], str(74106), 21)
 56579  }
 56580  
 56581  func _sqlite3VdbeRecordCompare(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, _pPKey2 *XUnpackedRecord) (r0 int32) {
 56582  	return _sqlite3VdbeRecordCompareWithSkip(tls, _nKey1, _pKey1, _pPKey2, int32(0))
 56583  }
 56584  
 56585  // C comment
 56586  //  /*
 56587  //  ** This function compares the two table rows or index records
 56588  //  ** specified by {nKey1, pKey1} and pPKey2.  It returns a negative, zero
 56589  //  ** or positive integer if key1 is less than, equal to or
 56590  //  ** greater than key2.  The {nKey1, pKey1} key must be a blob
 56591  //  ** created by the OP_MakeRecord opcode of the VDBE.  The pPKey2
 56592  //  ** key must be a parsed key such as obtained from
 56593  //  ** sqlite3VdbeParseRecord.
 56594  //  **
 56595  //  ** If argument bSkip is non-zero, it is assumed that the caller has already
 56596  //  ** determined that the first fields of the keys are equal.
 56597  //  **
 56598  //  ** Key1 and Key2 do not have to contain the same number of fields. If all
 56599  //  ** fields that appear in both keys are equal, then pPKey2->default_rc is
 56600  //  ** returned.
 56601  //  **
 56602  //  ** If database corruption is discovered, set pPKey2->errCode to
 56603  //  ** SQLITE_CORRUPT and return 0. If an OOM error is encountered,
 56604  //  ** pPKey2->errCode is set to SQLITE_NOMEM and, if it is not NULL, the
 56605  //  ** malloc-failed flag set on database handle (pPKey2->pKeyInfo->db).
 56606  //  */
 56607  func _sqlite3VdbeRecordCompareWithSkip(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, _pPKey2 *XUnpackedRecord, _bSkip int32) (r0 int32) {
 56608  	var _i, _rc, _26_nCmp, _29_nStr, _34_nCmp int32
 56609  	var _9_lhs, _9_rhs int64
 56610  	var _d1, _szHdr1, _idx1, _1_s1, _4_serial_type uint32
 56611  	var _aKey1 *uint8
 56612  	var _mem1 XMem
 56613  	var _pRhs *XMem
 56614  	var _pKeyInfo *XKeyInfo
 56615  	_rc = int32(0)
 56616  	_pRhs = (*XMem)(_pPKey2.XaMem)
 56617  	_pKeyInfo = (*XKeyInfo)(_pPKey2.XpKeyInfo)
 56618  	_aKey1 = (*uint8)(_pKey1)
 56619  	if _bSkip != 0 {
 56620  		_idx1 = uint32(int32(1) + int32(uint8(func() int32 {
 56621  			if int32(*elem15(_aKey1, uintptr(1))) < int32(128) {
 56622  				return func() int32 { _1_s1 = uint32(*elem15(_aKey1, uintptr(1))); return int32(1) }()
 56623  			}
 56624  			return int32(_sqlite3GetVarint32(tls, elem15(_aKey1, uintptr(1)), &_1_s1))
 56625  		}())))
 56626  		_szHdr1 = uint32(*elem15(_aKey1, 0))
 56627  		_d1 = _szHdr1 + _sqlite3VdbeSerialTypeLen(tls, _1_s1)
 56628  		_i = int32(1)
 56629  		*(*uintptr)(unsafe.Pointer(&_pRhs)) += uintptr(48)
 56630  		goto _3
 56631  	}
 56632  	_idx1 = uint32(uint8(func() int32 {
 56633  		if int32(*_aKey1) < int32(128) {
 56634  			return func() int32 { _szHdr1 = uint32(*_aKey1); return int32(1) }()
 56635  		}
 56636  		return int32(_sqlite3GetVarint32(tls, _aKey1, &_szHdr1))
 56637  	}()))
 56638  	_d1 = _szHdr1
 56639  	if _d1 > uint32(_nKey1) {
 56640  		_pPKey2.XerrCode = uint8(_sqlite3CorruptError(tls, int32(75426)))
 56641  		return int32(0)
 56642  	}
 56643  	_i = int32(0)
 56644  _3:
 56645  	_mem1.XszMalloc = int32(0)
 56646  	func() {
 56647  		if (int32((*XKeyInfo)(_pPKey2.XpKeyInfo).XnField)+int32((*XKeyInfo)(_pPKey2.XpKeyInfo).XnXField)) < int32(_pPKey2.XnField) && _sqlite3Config.XneverCorrupt != int32(0) {
 56648  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75433), unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000), unsafe.Pointer(str(74127)))
 56649  			crt.X__builtin_abort(tls)
 56650  		}
 56651  	}()
 56652  	func() {
 56653  		if ((*XKeyInfo)(_pPKey2.XpKeyInfo).XaSortOrder) == nil {
 56654  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75435), unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000), unsafe.Pointer(str(74208)))
 56655  			crt.X__builtin_abort(tls)
 56656  		}
 56657  	}()
 56658  	func() {
 56659  		if int32((*XKeyInfo)(_pPKey2.XpKeyInfo).XnField) <= int32(0) {
 56660  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75436), unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000), unsafe.Pointer(str(74240)))
 56661  			crt.X__builtin_abort(tls)
 56662  		}
 56663  	}()
 56664  	func() {
 56665  		if _idx1 > _szHdr1 && _sqlite3Config.XneverCorrupt != int32(0) {
 56666  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75437), unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000), unsafe.Pointer(str(74267)))
 56667  			crt.X__builtin_abort(tls)
 56668  		}
 56669  	}()
 56670  _17:
 56671  	if (int32(_pRhs.Xflags) & int32(4)) == 0 {
 56672  		goto _18
 56673  	}
 56674  	_4_serial_type = uint32(*elem15(_aKey1, uintptr(_idx1)))
 56675  	if _4_serial_type >= uint32(10) {
 56676  		_rc = int32(1)
 56677  		goto _24
 56678  	}
 56679  	if _4_serial_type == (0) {
 56680  		_rc = int32(-1)
 56681  		goto _24
 56682  	}
 56683  	if _4_serial_type == uint32(7) {
 56684  		_sqlite3VdbeSerialGet(tls, elem15(_aKey1, uintptr(_d1)), _4_serial_type, &_mem1)
 56685  		_rc = -_sqlite3IntFloatCompare(tls, *(*int64)(unsafe.Pointer(&_pRhs.Xu)), *(*float64)(unsafe.Pointer(&_mem1.Xu)))
 56686  		goto _24
 56687  	}
 56688  	_9_lhs = _vdbeRecordDecodeInt(tls, _4_serial_type, elem15(_aKey1, uintptr(_d1)))
 56689  	_9_rhs = *(*int64)(unsafe.Pointer(&_pRhs.Xu))
 56690  	if _9_lhs < _9_rhs {
 56691  		_rc = int32(-1)
 56692  		goto _27
 56693  	}
 56694  	if _9_lhs > _9_rhs {
 56695  		_rc = int32(1)
 56696  	}
 56697  _27:
 56698  _24:
 56699  	goto _73
 56700  _18:
 56701  	if (int32(_pRhs.Xflags) & int32(8)) == 0 {
 56702  		goto _29
 56703  	}
 56704  	_4_serial_type = uint32(*elem15(_aKey1, uintptr(_idx1)))
 56705  	if _4_serial_type >= uint32(10) {
 56706  		_rc = int32(1)
 56707  		goto _33
 56708  	}
 56709  	if _4_serial_type == (0) {
 56710  		_rc = int32(-1)
 56711  		goto _33
 56712  	}
 56713  	_sqlite3VdbeSerialGet(tls, elem15(_aKey1, uintptr(_d1)), _4_serial_type, &_mem1)
 56714  	if _4_serial_type != uint32(7) {
 56715  		goto _34
 56716  	}
 56717  	if (*(*float64)(unsafe.Pointer(&_mem1.Xu))) < (*(*float64)(unsafe.Pointer(&_pRhs.Xu))) {
 56718  		_rc = int32(-1)
 56719  		goto _37
 56720  	}
 56721  	if (*(*float64)(unsafe.Pointer(&_mem1.Xu))) > (*(*float64)(unsafe.Pointer(&_pRhs.Xu))) {
 56722  		_rc = int32(1)
 56723  	}
 56724  _37:
 56725  	goto _38
 56726  _34:
 56727  	_rc = _sqlite3IntFloatCompare(tls, *(*int64)(unsafe.Pointer(&_mem1.Xu)), *(*float64)(unsafe.Pointer(&_pRhs.Xu)))
 56728  _38:
 56729  _33:
 56730  	goto _73
 56731  _29:
 56732  	if (int32(_pRhs.Xflags) & int32(2)) == 0 {
 56733  		goto _40
 56734  	}
 56735  	func() int32 {
 56736  		if int32(*elem15(_aKey1, uintptr(_idx1))) < int32(128) {
 56737  			return func() int32 { _4_serial_type = uint32(*elem15(_aKey1, uintptr(_idx1))); return int32(1) }()
 56738  		}
 56739  		return int32(_sqlite3GetVarint32(tls, elem15(_aKey1, uintptr(_idx1)), &_4_serial_type))
 56740  	}()
 56741  	if _4_serial_type < uint32(12) {
 56742  		_rc = int32(-1)
 56743  		goto _46
 56744  	}
 56745  	if (_4_serial_type & uint32(1)) == 0 {
 56746  		_rc = int32(1)
 56747  		goto _46
 56748  	}
 56749  	_mem1.Xn = int32((_4_serial_type - uint32(12)) / uint32(2))
 56750  	if (_d1 + uint32(_mem1.Xn)) > uint32(_nKey1) {
 56751  		_pPKey2.XerrCode = uint8(_sqlite3CorruptError(tls, int32(75501)))
 56752  		return int32(0)
 56753  	}
 56754  	if (*elem62((**XCollSeq)(unsafe.Pointer(&_pKeyInfo.XaColl)), uintptr(_i))) != nil {
 56755  		_mem1.Xenc = _pKeyInfo.Xenc
 56756  		*(**Xsqlite3)(unsafe.Pointer(&_mem1.Xdb)) = (*Xsqlite3)(_pKeyInfo.Xdb)
 56757  		_mem1.Xflags = uint16(2)
 56758  		_mem1.Xz = (*int8)(unsafe.Pointer(elem15(_aKey1, uintptr(_d1))))
 56759  		_rc = _vdbeCompareMemString(tls, &_mem1, _pRhs, *elem62((**XCollSeq)(unsafe.Pointer(&_pKeyInfo.XaColl)), uintptr(_i)), &_pPKey2.XerrCode)
 56760  		goto _50
 56761  	}
 56762  	_26_nCmp = func() int32 {
 56763  		if _mem1.Xn < _pRhs.Xn {
 56764  			return _mem1.Xn
 56765  		}
 56766  		return _pRhs.Xn
 56767  	}()
 56768  	_rc = crt.Xmemcmp(tls, unsafe.Pointer(elem15(_aKey1, uintptr(_d1))), unsafe.Pointer(_pRhs.Xz), uint32(_26_nCmp))
 56769  	if _rc == int32(0) {
 56770  		_rc = _mem1.Xn - _pRhs.Xn
 56771  	}
 56772  _50:
 56773  _46:
 56774  	goto _73
 56775  _40:
 56776  	if (int32(_pRhs.Xflags) & int32(16)) == 0 {
 56777  		goto _55
 56778  	}
 56779  	func() {
 56780  		if (int32(_pRhs.Xflags)&int32(16384)) != int32(0) && _pRhs.Xn != int32(0) {
 56781  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75521), unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000), unsafe.Pointer(str(74294)))
 56782  			crt.X__builtin_abort(tls)
 56783  		}
 56784  	}()
 56785  	func() int32 {
 56786  		if int32(*elem15(_aKey1, uintptr(_idx1))) < int32(128) {
 56787  			return func() int32 { _4_serial_type = uint32(*elem15(_aKey1, uintptr(_idx1))); return int32(1) }()
 56788  		}
 56789  		return int32(_sqlite3GetVarint32(tls, elem15(_aKey1, uintptr(_idx1)), &_4_serial_type))
 56790  	}()
 56791  	if (_4_serial_type < uint32(12)) || ((_4_serial_type & uint32(1)) != 0) {
 56792  		_rc = int32(-1)
 56793  		goto _63
 56794  	}
 56795  	_29_nStr = int32((_4_serial_type - uint32(12)) / uint32(2))
 56796  	if (_d1 + uint32(_29_nStr)) > uint32(_nKey1) {
 56797  		_pPKey2.XerrCode = uint8(_sqlite3CorruptError(tls, int32(75531)))
 56798  		return int32(0)
 56799  	}
 56800  	if (int32(_pRhs.Xflags) & int32(16384)) == 0 {
 56801  		goto _66
 56802  	}
 56803  	if _isAllZero(tls, (*int8)(unsafe.Pointer(elem15(_aKey1, uintptr(_d1)))), _29_nStr) == 0 {
 56804  		_rc = int32(1)
 56805  		goto _68
 56806  	}
 56807  	_rc = _29_nStr - (*(*int32)(unsafe.Pointer(&_pRhs.Xu)))
 56808  _68:
 56809  	goto _69
 56810  _66:
 56811  	_34_nCmp = func() int32 {
 56812  		if _29_nStr < _pRhs.Xn {
 56813  			return _29_nStr
 56814  		}
 56815  		return _pRhs.Xn
 56816  	}()
 56817  	_rc = crt.Xmemcmp(tls, unsafe.Pointer(elem15(_aKey1, uintptr(_d1))), unsafe.Pointer(_pRhs.Xz), uint32(_34_nCmp))
 56818  	if _rc == int32(0) {
 56819  		_rc = _29_nStr - _pRhs.Xn
 56820  	}
 56821  _69:
 56822  _63:
 56823  	goto _73
 56824  _55:
 56825  	_4_serial_type = uint32(*elem15(_aKey1, uintptr(_idx1)))
 56826  	_rc = bool2int(_4_serial_type != (0))
 56827  _73:
 56828  	if _rc == int32(0) {
 56829  		goto _74
 56830  	}
 56831  	if (*elem15(_pKeyInfo.XaSortOrder, uintptr(_i))) != 0 {
 56832  		_rc = -_rc
 56833  	}
 56834  	func() {
 56835  		if _vdbeRecordCompareDebug(tls, _nKey1, _pKey1, _pPKey2, _rc) == 0 {
 56836  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75557), unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000), unsafe.Pointer(str(74336)))
 56837  			crt.X__builtin_abort(tls)
 56838  		}
 56839  	}()
 56840  	func() {
 56841  		if _mem1.XszMalloc != int32(0) {
 56842  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75558), unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000), unsafe.Pointer(str(74385)))
 56843  			crt.X__builtin_abort(tls)
 56844  		}
 56845  	}()
 56846  	return _rc
 56847  
 56848  _74:
 56849  	_i += 1
 56850  	*(*uintptr)(unsafe.Pointer(&_pRhs)) += uintptr(48)
 56851  	_d1 += _sqlite3VdbeSerialTypeLen(tls, _4_serial_type)
 56852  	_idx1 += uint32(_sqlite3VarintLen(tls, uint64(_4_serial_type)))
 56853  	if ((_idx1 < _szHdr1) && (_i < int32(_pPKey2.XnField))) && (_d1 <= uint32(_nKey1)) {
 56854  		goto _17
 56855  	}
 56856  	func() {
 56857  		if _mem1.XszMalloc != int32(0) {
 56858  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75571), unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000), unsafe.Pointer(str(74385)))
 56859  			crt.X__builtin_abort(tls)
 56860  		}
 56861  	}()
 56862  	func() {
 56863  		if _sqlite3Config.XneverCorrupt != int32(0) && _vdbeRecordCompareDebug(tls, _nKey1, _pKey1, _pPKey2, int32(_pPKey2.Xdefault_rc)) == 0 && ((*Xsqlite3)(_pKeyInfo.Xdb).XmallocFailed) == 0 {
 56864  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75576), unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000), unsafe.Pointer(str(74402)))
 56865  			crt.X__builtin_abort(tls)
 56866  		}
 56867  	}()
 56868  	_pPKey2.XeqSeen = uint8(1)
 56869  	return int32(_pPKey2.Xdefault_rc)
 56870  }
 56871  
 56872  // C comment
 56873  //  /*
 56874  //  ** Return the length of the data corresponding to the supplied serial-type.
 56875  //  */
 56876  func _sqlite3VdbeSerialTypeLen(tls *crt.TLS, _serial_type uint32) (r0 uint32) {
 56877  	if _serial_type >= uint32(128) {
 56878  		return (_serial_type - uint32(12)) / uint32(2)
 56879  	}
 56880  	func() {
 56881  		if _serial_type >= uint32(12) && uint32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3SmallTypeSizes)), uintptr(_serial_type))) != ((_serial_type-uint32(12))/uint32(2)) {
 56882  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74674), unsafe.Pointer(&_sqlite3VdbeSerialTypeLenØ00__func__Ø000), unsafe.Pointer(str(74511)))
 56883  			crt.X__builtin_abort(tls)
 56884  		}
 56885  	}()
 56886  	return uint32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3SmallTypeSizes)), uintptr(_serial_type)))
 56887  }
 56888  
 56889  // C comment
 56890  //  /*
 56891  //  ** The sizes for serial types less than 128
 56892  //  */
 56893  var _sqlite3SmallTypeSizes [128]uint8
 56894  
 56895  func init() {
 56896  	_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}
 56897  }
 56898  
 56899  var _sqlite3VdbeSerialTypeLenØ00__func__Ø000 [25]int8
 56900  
 56901  func init() {
 56902  	crt.Xstrncpy(nil, &_sqlite3VdbeSerialTypeLenØ00__func__Ø000[0], str(74586), 25)
 56903  }
 56904  
 56905  var _sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000 [33]int8
 56906  
 56907  func init() {
 56908  	crt.Xstrncpy(nil, &_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000[0], str(74611), 33)
 56909  }
 56910  
 56911  // C comment
 56912  //  /*
 56913  //  ** The first argument passed to this function is a serial-type that
 56914  //  ** corresponds to an integer - all values between 1 and 9 inclusive
 56915  //  ** except 7. The second points to a buffer containing an integer value
 56916  //  ** serialized according to serial_type. This function deserializes
 56917  //  ** and returns the value.
 56918  //  */
 56919  func _vdbeRecordDecodeInt(tls *crt.TLS, _serial_type uint32, _aKey *uint8) (r0 int64) {
 56920  	var _y uint32
 56921  	var _4_x uint64
 56922  	func() {
 56923  		if _sqlite3Config.XneverCorrupt != int32(0) && (_serial_type < uint32(1) || _serial_type > uint32(9) || _serial_type == uint32(7)) {
 56924  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75344), unsafe.Pointer(&_vdbeRecordDecodeIntØ00__func__Ø000), unsafe.Pointer(str(74644)))
 56925  			crt.X__builtin_abort(tls)
 56926  		}
 56927  	}()
 56928  	switch _serial_type {
 56929  	case uint32(0):
 56930  		goto _6
 56931  	case uint32(1):
 56932  		goto _6
 56933  	case uint32(2):
 56934  		goto _8
 56935  	case uint32(3):
 56936  		goto _9
 56937  	case uint32(4):
 56938  		goto _10
 56939  	case uint32(5):
 56940  		goto _11
 56941  	case uint32(6):
 56942  		goto _12
 56943  	default:
 56944  		goto _13
 56945  	}
 56946  
 56947  _6:
 56948  	return int64(int8(*elem15(_aKey, 0)))
 56949  
 56950  _8:
 56951  	return int64((int32(256) * int32(int8(*elem15(_aKey, 0)))) | int32(*elem15(_aKey, uintptr(1))))
 56952  
 56953  _9:
 56954  	return int64(((int32(65536) * int32(int8(*elem15(_aKey, 0)))) | (int32(*elem15(_aKey, uintptr(1))) << 8)) | int32(*elem15(_aKey, uintptr(2))))
 56955  
 56956  _10:
 56957  	_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)))
 56958  	return int64(*(*int32)(unsafe.Pointer(&_y)))
 56959  
 56960  _11:
 56961  	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)))))
 56962  
 56963  _12:
 56964  	_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))))
 56965  	_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))))
 56966  	return *(*int64)(unsafe.Pointer(&_4_x))
 56967  
 56968  _13:
 56969  	return int64(_serial_type - uint32(8))
 56970  
 56971  	_ = _y
 56972  	panic(0)
 56973  }
 56974  
 56975  var _vdbeRecordDecodeIntØ00__func__Ø000 [20]int8
 56976  
 56977  func init() {
 56978  	crt.Xstrncpy(nil, &_vdbeRecordDecodeIntØ00__func__Ø000[0], str(74711), 20)
 56979  }
 56980  
 56981  // C comment
 56982  //  /*
 56983  //  ** This function compares two index or table record keys in the same way
 56984  //  ** as the sqlite3VdbeRecordCompare() routine. Unlike VdbeRecordCompare(),
 56985  //  ** this function deserializes and compares values using the
 56986  //  ** sqlite3VdbeSerialGet() and sqlite3MemCompare() functions. It is used
 56987  //  ** in assert() statements to ensure that the optimized code in
 56988  //  ** sqlite3VdbeRecordCompare() returns results with these two primitives.
 56989  //  **
 56990  //  ** Return true if the result of comparison is equivalent to desiredResult.
 56991  //  ** Return false if there is a disagreement.
 56992  //  */
 56993  func _vdbeRecordCompareDebug(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, _pPKey2 *XUnpackedRecord, _desiredResult int32) (r0 int32) {
 56994  	var _i, _rc int32
 56995  	var _d1, _idx1, _szHdr1, _1_serial_type1 uint32
 56996  	var _aKey1 *uint8
 56997  	var _mem1 XMem
 56998  	var _pKeyInfo *XKeyInfo
 56999  	_i = int32(0)
 57000  	_rc = int32(0)
 57001  	_aKey1 = (*uint8)(_pKey1)
 57002  	_pKeyInfo = (*XKeyInfo)(_pPKey2.XpKeyInfo)
 57003  	if (*Xsqlite3)(_pKeyInfo.Xdb) == nil {
 57004  		return int32(1)
 57005  	}
 57006  	_mem1.Xenc = _pKeyInfo.Xenc
 57007  	*(**Xsqlite3)(unsafe.Pointer(&_mem1.Xdb)) = (*Xsqlite3)(_pKeyInfo.Xdb)
 57008  	_mem1.XszMalloc = int32(0)
 57009  	_idx1 = uint32(uint8(func() int32 {
 57010  		if int32(*_aKey1) < int32(128) {
 57011  			return func() int32 { _szHdr1 = uint32(*_aKey1); return int32(1) }()
 57012  		}
 57013  		return int32(_sqlite3GetVarint32(tls, _aKey1, &_szHdr1))
 57014  	}()))
 57015  	if _szHdr1 > uint32(98307) {
 57016  		return int32(11)
 57017  	}
 57018  	_d1 = _szHdr1
 57019  	func() {
 57020  		if (int32(_pKeyInfo.XnField)+int32(_pKeyInfo.XnXField)) < int32(_pPKey2.XnField) && _sqlite3Config.XneverCorrupt != int32(0) {
 57021  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75039), unsafe.Pointer(&_vdbeRecordCompareDebugØ00__func__Ø000), unsafe.Pointer(str(74731)))
 57022  			crt.X__builtin_abort(tls)
 57023  		}
 57024  	}()
 57025  	func() {
 57026  		if _pKeyInfo.XaSortOrder == nil {
 57027  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75040), unsafe.Pointer(&_vdbeRecordCompareDebugØ00__func__Ø000), unsafe.Pointer(str(37807)))
 57028  			crt.X__builtin_abort(tls)
 57029  		}
 57030  	}()
 57031  	func() {
 57032  		if int32(_pKeyInfo.XnField) <= int32(0) {
 57033  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75041), unsafe.Pointer(&_vdbeRecordCompareDebugØ00__func__Ø000), unsafe.Pointer(str(74796)))
 57034  			crt.X__builtin_abort(tls)
 57035  		}
 57036  	}()
 57037  	func() {
 57038  		if _idx1 > _szHdr1 && _sqlite3Config.XneverCorrupt != int32(0) {
 57039  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75042), unsafe.Pointer(&_vdbeRecordCompareDebugØ00__func__Ø000), unsafe.Pointer(str(74267)))
 57040  			crt.X__builtin_abort(tls)
 57041  		}
 57042  	}()
 57043  _14:
 57044  	_idx1 += uint32(uint8(func() int32 {
 57045  		if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1)) + uintptr(_idx1)))) < int32(128) {
 57046  			return func() int32 {
 57047  				_1_serial_type1 = uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1)) + uintptr(_idx1))))
 57048  				return int32(1)
 57049  			}()
 57050  		}
 57051  		return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1))+uintptr(_idx1))), &_1_serial_type1))
 57052  	}()))
 57053  	if (((_d1 + _1_serial_type1) + uint32(2)) > uint32(_nKey1)) && ((_d1 + _sqlite3VdbeSerialTypeLen(tls, _1_serial_type1)) > uint32(_nKey1)) {
 57054  		goto _19
 57055  	}
 57056  	_d1 += _sqlite3VdbeSerialGet(tls, elem15(_aKey1, uintptr(_d1)), _1_serial_type1, &_mem1)
 57057  	_rc = _sqlite3MemCompare(tls, &_mem1, elem25((*XMem)(_pPKey2.XaMem), uintptr(_i)), *elem62((**XCollSeq)(unsafe.Pointer(&_pKeyInfo.XaColl)), uintptr(_i)))
 57058  	if _rc == int32(0) {
 57059  		goto _20
 57060  	}
 57061  	func() {
 57062  		if _mem1.XszMalloc != int32(0) {
 57063  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75069), unsafe.Pointer(&_vdbeRecordCompareDebugØ00__func__Ø000), unsafe.Pointer(str(74385)))
 57064  			crt.X__builtin_abort(tls)
 57065  		}
 57066  	}()
 57067  	if (*elem15(_pKeyInfo.XaSortOrder, uintptr(_i))) != 0 {
 57068  		_rc = -_rc
 57069  	}
 57070  	goto _debugCompareEnd
 57071  _20:
 57072  	_i += 1
 57073  	if (_idx1 < _szHdr1) && (_i < int32(_pPKey2.XnField)) {
 57074  		goto _14
 57075  	}
 57076  _19:
 57077  	func() {
 57078  		if _mem1.XszMalloc != int32(0) {
 57079  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75082), unsafe.Pointer(&_vdbeRecordCompareDebugØ00__func__Ø000), unsafe.Pointer(str(74385)))
 57080  			crt.X__builtin_abort(tls)
 57081  		}
 57082  	}()
 57083  	_rc = int32(_pPKey2.Xdefault_rc)
 57084  _debugCompareEnd:
 57085  	if (_desiredResult == int32(0)) && (_rc == int32(0)) {
 57086  		return int32(1)
 57087  	}
 57088  	if (_desiredResult < int32(0)) && (_rc < int32(0)) {
 57089  		return int32(1)
 57090  	}
 57091  	if (_desiredResult > int32(0)) && (_rc > int32(0)) {
 57092  		return int32(1)
 57093  	}
 57094  	if _sqlite3Config.XneverCorrupt == int32(0) {
 57095  		return int32(1)
 57096  	}
 57097  	if ((*Xsqlite3)(_pKeyInfo.Xdb).XmallocFailed) != 0 {
 57098  		return int32(1)
 57099  	}
 57100  	return int32(0)
 57101  }
 57102  
 57103  var _vdbeRecordCompareDebugØ00__func__Ø000 [23]int8
 57104  
 57105  func init() {
 57106  	crt.Xstrncpy(nil, &_vdbeRecordCompareDebugØ00__func__Ø000[0], str(74815), 23)
 57107  }
 57108  
 57109  // C comment
 57110  //  /*
 57111  //  ** Return the number of bytes that will be needed to store the given
 57112  //  ** 64-bit integer.
 57113  //  */
 57114  func _sqlite3VarintLen(tls *crt.TLS, _v uint64) (r0 int32) {
 57115  	var _i int32
 57116  	_i = int32(1)
 57117  _0:
 57118  	if store85(func() (*uint64, uint64) { p := &_v; return p, ((*p) >> 7) }()) == (0) {
 57119  		goto _3
 57120  	}
 57121  	func() {
 57122  		if _i >= int32(10) {
 57123  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(28787), unsafe.Pointer(&_sqlite3VarintLenØ00__func__Ø000), unsafe.Pointer(str(74838)))
 57124  			crt.X__builtin_abort(tls)
 57125  		}
 57126  	}()
 57127  	_i += 1
 57128  	goto _0
 57129  _3:
 57130  	return _i
 57131  }
 57132  
 57133  var _sqlite3VarintLenØ00__func__Ø000 [17]int8
 57134  
 57135  func init() {
 57136  	crt.Xstrncpy(nil, &_sqlite3VarintLenØ00__func__Ø000[0], str(74843), 17)
 57137  }
 57138  
 57139  var _sqlite3VdbeFindCompareØ00__func__Ø000 [23]int8
 57140  
 57141  func init() {
 57142  	crt.Xstrncpy(nil, &_sqlite3VdbeFindCompareØ00__func__Ø000[0], str(74860), 23)
 57143  }
 57144  
 57145  // C comment
 57146  //  /*
 57147  //  ** This function is an optimized version of sqlite3VdbeRecordCompare()
 57148  //  ** that (a) the first field of pPKey2 is a string, that (b) the first field
 57149  //  ** uses the collation sequence BINARY and (c) that the size-of-header varint
 57150  //  ** at the start of (pKey1/nKey1) fits in a single byte.
 57151  //  */
 57152  func _vdbeRecordCompareString(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, _pPKey2 *XUnpackedRecord) (r0 int32) {
 57153  	var _serial_type, _res, _3_nCmp, _3_nStr, _3_szHdr int32
 57154  	var _aKey1 *uint8
 57155  	_aKey1 = (*uint8)(_pKey1)
 57156  	func() {
 57157  		if (int32(elem25((*XMem)(_pPKey2.XaMem), 0).Xflags) & int32(2)) == 0 {
 57158  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75702), unsafe.Pointer(&_vdbeRecordCompareStringØ00__func__Ø000), unsafe.Pointer(str(74883)))
 57159  			crt.X__builtin_abort(tls)
 57160  		}
 57161  	}()
 57162  	_vdbeAssertFieldCountWithinLimits(tls, _nKey1, _pKey1, (*XKeyInfo)(_pPKey2.XpKeyInfo))
 57163  	func() int32 {
 57164  		if int32(*elem15(_aKey1, uintptr(1))) < int32(128) {
 57165  			return func() int32 { _serial_type = int32(uint32(*elem15(_aKey1, uintptr(1)))); return int32(1) }()
 57166  		}
 57167  		return int32(_sqlite3GetVarint32(tls, elem15(_aKey1, uintptr(1)), (*uint32)(unsafe.Pointer(&_serial_type))))
 57168  	}()
 57169  	if _serial_type < int32(12) {
 57170  		_res = int32(_pPKey2.Xr1)
 57171  		goto _7
 57172  	}
 57173  	if (_serial_type & int32(1)) == 0 {
 57174  		_res = int32(_pPKey2.Xr2)
 57175  		goto _7
 57176  	}
 57177  	_3_szHdr = int32(*elem15(_aKey1, 0))
 57178  	_3_nStr = (_serial_type - int32(12)) / int32(2)
 57179  	if (_3_szHdr + _3_nStr) > _nKey1 {
 57180  		_pPKey2.XerrCode = uint8(_sqlite3CorruptError(tls, int32(75716)))
 57181  		return int32(0)
 57182  	}
 57183  	_3_nCmp = func() int32 {
 57184  		if (elem25((*XMem)(_pPKey2.XaMem), 0).Xn) < _3_nStr {
 57185  			return (elem25((*XMem)(_pPKey2.XaMem), 0).Xn)
 57186  		}
 57187  		return _3_nStr
 57188  	}()
 57189  	_res = crt.Xmemcmp(tls, unsafe.Pointer(elem15(_aKey1, uintptr(_3_szHdr))), unsafe.Pointer(elem25((*XMem)(_pPKey2.XaMem), 0).Xz), uint32(_3_nCmp))
 57190  	if _res != int32(0) {
 57191  		goto _11
 57192  	}
 57193  	_res = _3_nStr - (elem25((*XMem)(_pPKey2.XaMem), 0).Xn)
 57194  	if _res != int32(0) {
 57195  		goto _12
 57196  	}
 57197  	if int32(_pPKey2.XnField) > int32(1) {
 57198  		_res = _sqlite3VdbeRecordCompareWithSkip(tls, _nKey1, _pKey1, _pPKey2, int32(1))
 57199  		goto _14
 57200  	}
 57201  	_res = int32(_pPKey2.Xdefault_rc)
 57202  	_pPKey2.XeqSeen = uint8(1)
 57203  _14:
 57204  	goto _17
 57205  _12:
 57206  	if _res > int32(0) {
 57207  		_res = int32(_pPKey2.Xr2)
 57208  		goto _17
 57209  	}
 57210  	_res = int32(_pPKey2.Xr1)
 57211  _17:
 57212  	goto _20
 57213  _11:
 57214  	if _res > int32(0) {
 57215  		_res = int32(_pPKey2.Xr2)
 57216  		goto _20
 57217  	}
 57218  	_res = int32(_pPKey2.Xr1)
 57219  _20:
 57220  _7:
 57221  	func() {
 57222  		if _vdbeRecordCompareDebug(tls, _nKey1, _pKey1, _pPKey2, _res) == 0 && _sqlite3Config.XneverCorrupt != int32(0) && ((*Xsqlite3)((*XKeyInfo)(_pPKey2.XpKeyInfo).Xdb).XmallocFailed) == 0 {
 57223  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75743), unsafe.Pointer(&_vdbeRecordCompareStringØ00__func__Ø000), unsafe.Pointer(str(74915)))
 57224  			crt.X__builtin_abort(tls)
 57225  		}
 57226  	}()
 57227  	return _res
 57228  }
 57229  
 57230  var _vdbeRecordCompareStringØ00__func__Ø000 [24]int8
 57231  
 57232  func init() {
 57233  	crt.Xstrncpy(nil, &_vdbeRecordCompareStringØ00__func__Ø000[0], str(75017), 24)
 57234  }
 57235  
 57236  // C comment
 57237  //  /*
 57238  //  ** Move the cursor to point to the root page of its b-tree structure.
 57239  //  **
 57240  //  ** If the table has a virtual root page, then the cursor is moved to point
 57241  //  ** to the virtual root page instead of the actual root page. A table has a
 57242  //  ** virtual root page when the actual root page contains no cells and a
 57243  //  ** single child page. This can only happen with the table rooted at page 1.
 57244  //  **
 57245  //  ** If the b-tree structure is empty, the cursor state is set to
 57246  //  ** CURSOR_INVALID. Otherwise, the cursor is set to point to the first
 57247  //  ** cell located on the root (or virtual root) page and the cursor state
 57248  //  ** is set to CURSOR_VALID.
 57249  //  **
 57250  //  ** If this function returns successfully, it may be assumed that the
 57251  //  ** page-header flags indicate that the [virtual] root-page is the expected
 57252  //  ** kind of b-tree page (i.e. if when opening the cursor the caller did not
 57253  //  ** specify a KeyInfo structure the flags byte is set to 0x05 or 0x0D,
 57254  //  ** indicating a table b-tree, or if the caller did specify a KeyInfo
 57255  //  ** structure the flags byte is set to 0x02 or 0x0A, indicating an index
 57256  //  ** b-tree).
 57257  //  */
 57258  func _moveToRoot(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 57259  	var _rc int32
 57260  	var _11_subpage uint32
 57261  	var _pRoot *XMemPage
 57262  	_rc = int32(0)
 57263  	func() {
 57264  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 57265  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63949), unsafe.Pointer(&_moveToRootØ00__func__Ø000), unsafe.Pointer(str(71986)))
 57266  			crt.X__builtin_abort(tls)
 57267  		}
 57268  	}()
 57269  
 57270  	if int32(_pCur.XeState) < int32(3) {
 57271  		goto _2
 57272  	}
 57273  	if int32(_pCur.XeState) == int32(4) {
 57274  		func() {
 57275  			if _pCur.XskipNext == int32(0) {
 57276  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63955), unsafe.Pointer(&_moveToRootØ00__func__Ø000), unsafe.Pointer(str(75041)))
 57277  				crt.X__builtin_abort(tls)
 57278  			}
 57279  		}()
 57280  		return _pCur.XskipNext
 57281  	}
 57282  	_sqlite3BtreeClearCursor(tls, _pCur)
 57283  _2:
 57284  	if int32(_pCur.XiPage) < int32(0) {
 57285  		goto _6
 57286  	}
 57287  	if _pCur.XiPage == 0 {
 57288  		goto _7
 57289  	}
 57290  _8:
 57291  	func() {
 57292  		if (*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))) == nil {
 57293  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63964), unsafe.Pointer(&_moveToRootØ00__func__Ø000), unsafe.Pointer(str(75067)))
 57294  			crt.X__builtin_abort(tls)
 57295  		}
 57296  	}()
 57297  	_releasePageNotNull(tls, *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(postInc5(&_pCur.XiPage, -1))))
 57298  	if _pCur.XiPage != 0 {
 57299  		goto _8
 57300  	}
 57301  	goto _skip_init
 57302  _7:
 57303  	goto _13
 57304  _6:
 57305  	if _pCur.XpgnoRoot == (0) {
 57306  		_pCur.XeState = 0
 57307  		return int32(0)
 57308  	}
 57309  	func() {
 57310  		if int32(_pCur.XiPage) != int32(-1) {
 57311  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63973), unsafe.Pointer(&_moveToRootØ00__func__Ø000), unsafe.Pointer(str(75096)))
 57312  			crt.X__builtin_abort(tls)
 57313  		}
 57314  	}()
 57315  	_rc = _getAndInitPage(tls, (*XBtShared)((*XBtree)(_pCur.XpBtree).XpBt), _pCur.XpgnoRoot, elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), 0), nil, int32(_pCur.XcurPagerFlags))
 57316  	if _rc != int32(0) {
 57317  		_pCur.XeState = 0
 57318  		return _rc
 57319  	}
 57320  	_pCur.XiPage = 0
 57321  	_pCur.XcurIntKey = (*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), 0)).XintKey
 57322  _13:
 57323  	_pRoot = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), 0)
 57324  	func() {
 57325  		if _pRoot.Xpgno != _pCur.XpgnoRoot {
 57326  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63984), unsafe.Pointer(&_moveToRootØ00__func__Ø000), unsafe.Pointer(str(75114)))
 57327  			crt.X__builtin_abort(tls)
 57328  		}
 57329  	}()
 57330  	func() {
 57331  		if int32(_pRoot.XintKey) != int32(1) && int32(_pRoot.XintKey) != int32(0) {
 57332  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63996), unsafe.Pointer(&_moveToRootØ00__func__Ø000), unsafe.Pointer(str(75142)))
 57333  			crt.X__builtin_abort(tls)
 57334  		}
 57335  	}()
 57336  	if (int32(_pRoot.XisInit) == int32(0)) || (bool2int((*XKeyInfo)(_pCur.XpKeyInfo) == nil) != int32(_pRoot.XintKey)) {
 57337  		return _sqlite3CorruptError(tls, int32(63998))
 57338  	}
 57339  _skip_init:
 57340  	_pCur.Xix = 0
 57341  	_pCur.Xinfo.XnSize = 0
 57342  	{
 57343  		p := &_pCur.XcurFlags
 57344  		*p = uint8(int32(*p) & int32(-15))
 57345  	}
 57346  	_pRoot = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), 0)
 57347  	if int32(_pRoot.XnCell) > int32(0) {
 57348  		_pCur.XeState = uint8(1)
 57349  		goto _28
 57350  	}
 57351  	if _pRoot.Xleaf != 0 {
 57352  		goto _26
 57353  	}
 57354  	if _pRoot.Xpgno != uint32(1) {
 57355  		return _sqlite3CorruptError(tls, int32(64011))
 57356  	}
 57357  	_11_subpage = _sqlite3Get4byte(tls, elem15(_pRoot.XaData, uintptr(int32(_pRoot.XhdrOffset)+int32(8))))
 57358  	_pCur.XeState = uint8(1)
 57359  	_rc = _moveToChild(tls, _pCur, _11_subpage)
 57360  	goto _28
 57361  _26:
 57362  	_pCur.XeState = 0
 57363  _28:
 57364  	return _rc
 57365  }
 57366  
 57367  var _moveToRootØ00__func__Ø000 [11]int8
 57368  
 57369  func init() {
 57370  	crt.Xstrncpy(nil, &_moveToRootØ00__func__Ø000[0], str(75179), 11)
 57371  }
 57372  
 57373  // C comment
 57374  //  /*
 57375  //  ** Determine whether or not a cursor has moved from the position where
 57376  //  ** it was last placed, or has been invalidated for any other reason.
 57377  //  ** Cursors can move when the row they are pointing at is deleted out
 57378  //  ** from under them, for example.  Cursor might also move if a btree
 57379  //  ** is rebalanced.
 57380  //  **
 57381  //  ** Calling this routine with a NULL cursor pointer returns false.
 57382  //  **
 57383  //  ** Use the separate sqlite3BtreeCursorRestore() routine to restore a cursor
 57384  //  ** back to where it ought to be if this routine returns true.
 57385  //  */
 57386  func _sqlite3BtreeCursorHasMoved(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 57387  	return bool2int(int32(_pCur.XeState) != int32(1))
 57388  }
 57389  
 57390  // C comment
 57391  //  /*
 57392  //  ** Something has moved cursor "p" out of place.  Maybe the row it was
 57393  //  ** pointed to was deleted out from under it.  Or maybe the btree was
 57394  //  ** rebalanced.  Whatever the cause, try to restore "p" to the place it
 57395  //  ** is supposed to be pointing.  If the row was deleted out from under the
 57396  //  ** cursor, set the cursor to point to a NULL row.
 57397  //  */
 57398  func _handleMovedCursor(tls *crt.TLS, _p *XVdbeCursor) (r0 int32) {
 57399  	var _isDifferentRow, _rc int32
 57400  	func() {
 57401  		if int32(_p.XeCurType) != int32(0) {
 57402  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74500), unsafe.Pointer(&_handleMovedCursorØ00__func__Ø000), unsafe.Pointer(str(71938)))
 57403  			crt.X__builtin_abort(tls)
 57404  		}
 57405  	}()
 57406  	func() {
 57407  		if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xuc))) == nil {
 57408  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74501), unsafe.Pointer(&_handleMovedCursorØ00__func__Ø000), unsafe.Pointer(str(75190)))
 57409  			crt.X__builtin_abort(tls)
 57410  		}
 57411  	}()
 57412  	func() {
 57413  		if _sqlite3BtreeCursorHasMoved(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xuc)))) == 0 {
 57414  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74502), unsafe.Pointer(&_handleMovedCursorØ00__func__Ø000), unsafe.Pointer(str(75207)))
 57415  			crt.X__builtin_abort(tls)
 57416  		}
 57417  	}()
 57418  	_rc = _sqlite3BtreeCursorRestore(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xuc))), &_isDifferentRow)
 57419  	_p.XcacheStatus = 0
 57420  	if _isDifferentRow != 0 {
 57421  		_p.XnullRow = uint8(1)
 57422  	}
 57423  	return _rc
 57424  }
 57425  
 57426  var _handleMovedCursorØ00__func__Ø000 [18]int8
 57427  
 57428  func init() {
 57429  	crt.Xstrncpy(nil, &_handleMovedCursorØ00__func__Ø000[0], str(75249), 18)
 57430  }
 57431  
 57432  // C comment
 57433  //  /*
 57434  //  ** This routine restores a cursor back to its original position after it
 57435  //  ** has been moved by some outside activity (such as a btree rebalance or
 57436  //  ** a row having been deleted out from under the cursor).
 57437  //  **
 57438  //  ** On success, the *pDifferentRow parameter is false if the cursor is left
 57439  //  ** pointing at exactly the same row.  *pDifferntRow is the row the cursor
 57440  //  ** was pointing to has been deleted, forcing the cursor to point to some
 57441  //  ** nearby row.
 57442  //  **
 57443  //  ** This routine should only be called for a cursor that just returned
 57444  //  ** TRUE from sqlite3BtreeCursorHasMoved().
 57445  //  */
 57446  func _sqlite3BtreeCursorRestore(tls *crt.TLS, _pCur *XBtCursor, _pDifferentRow *int32) (r0 int32) {
 57447  	var _rc int32
 57448  	func() {
 57449  		if _pCur == nil {
 57450  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59888), unsafe.Pointer(&_sqlite3BtreeCursorRestoreØ00__func__Ø000), unsafe.Pointer(str(75267)))
 57451  			crt.X__builtin_abort(tls)
 57452  		}
 57453  	}()
 57454  	func() {
 57455  		if int32(_pCur.XeState) == int32(1) {
 57456  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59889), unsafe.Pointer(&_sqlite3BtreeCursorRestoreØ00__func__Ø000), unsafe.Pointer(str(75275)))
 57457  			crt.X__builtin_abort(tls)
 57458  		}
 57459  	}()
 57460  	_rc = func() int32 {
 57461  		if int32(_pCur.XeState) >= int32(3) {
 57462  			return _btreeRestoreCursorPosition(tls, _pCur)
 57463  		}
 57464  		return int32(0)
 57465  	}()
 57466  	if _rc != 0 {
 57467  		*_pDifferentRow = int32(1)
 57468  		return _rc
 57469  	}
 57470  	if int32(_pCur.XeState) != int32(1) {
 57471  		*_pDifferentRow = int32(1)
 57472  		goto _8
 57473  	}
 57474  	func() {
 57475  		if _pCur.XskipNext != int32(0) {
 57476  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59898), unsafe.Pointer(&_sqlite3BtreeCursorRestoreØ00__func__Ø000), unsafe.Pointer(str(75302)))
 57477  			crt.X__builtin_abort(tls)
 57478  		}
 57479  	}()
 57480  	*_pDifferentRow = int32(0)
 57481  _8:
 57482  	return int32(0)
 57483  }
 57484  
 57485  var _sqlite3BtreeCursorRestoreØ00__func__Ø000 [26]int8
 57486  
 57487  func init() {
 57488  	crt.Xstrncpy(nil, &_sqlite3BtreeCursorRestoreØ00__func__Ø000[0], str(75320), 26)
 57489  }
 57490  
 57491  // C comment
 57492  //  /* The next routine used only within assert() statements */
 57493  //  /*
 57494  //  ** Return true if the given BtCursor is valid.  A valid cursor is one
 57495  //  ** that is currently pointing to a row in a (non-empty) table.
 57496  //  ** This is a verification routine is used only within assert() statements.
 57497  //  */
 57498  func _sqlite3BtreeCursorIsValid(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 57499  	return bool2int((_pCur != nil) && (int32(_pCur.XeState) == int32(1)))
 57500  }
 57501  
 57502  // C comment
 57503  //  /*
 57504  //  ** For the entry that cursor pCur is point to, return as
 57505  //  ** many bytes of the key or data as are available on the local
 57506  //  ** b-tree page.  Write the number of available bytes into *pAmt.
 57507  //  **
 57508  //  ** The pointer returned is ephemeral.  The key/data may move
 57509  //  ** or be destroyed on the next call to any Btree routine,
 57510  //  ** including calls from other threads against the same cache.
 57511  //  ** Hence, a mutex on the BtShared should be held prior to calling
 57512  //  ** this routine.
 57513  //  **
 57514  //  ** These routines is used to get quick access to key and data
 57515  //  ** in the common case where no overflow pages are used.
 57516  //  */
 57517  func _sqlite3BtreePayloadFetch(tls *crt.TLS, _pCur *XBtCursor, _pAmt *uint32) (r0 unsafe.Pointer) {
 57518  	return _fetchPayload(tls, _pCur, _pAmt)
 57519  }
 57520  
 57521  // C comment
 57522  //  /*
 57523  //  ** Return a pointer to payload information from the entry that the
 57524  //  ** pCur cursor is pointing to.  The pointer is to the beginning of
 57525  //  ** the key if index btrees (pPage->intKey==0) and is the data for
 57526  //  ** table btrees (pPage->intKey==1). The number of bytes of available
 57527  //  ** key/data is written into *pAmt.  If *pAmt==0, then the value
 57528  //  ** returned will not be a valid pointer.
 57529  //  **
 57530  //  ** This routine is an optimization.  It is common for the entire key
 57531  //  ** and data to fit on the local page and for there to be no overflow
 57532  //  ** pages.  When that is so, this routine can be used to access the
 57533  //  ** key and data without making a copy.  If the key and/or data spills
 57534  //  ** onto overflow pages, then accessPayload() must be used to reassemble
 57535  //  ** the key/data and copy it into a preallocated buffer.
 57536  //  **
 57537  //  ** The pointer returned by this routine looks directly into the cached
 57538  //  ** page of the database.  The data might change or move the next time
 57539  //  ** any btree routine is called.
 57540  //  */
 57541  func _fetchPayload(tls *crt.TLS, _pCur *XBtCursor, _pAmt *uint32) (r0 unsafe.Pointer) {
 57542  	var _amt uint32
 57543  	func() {
 57544  		if _pCur == nil || int32(_pCur.XiPage) < int32(0) || (*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))) == nil {
 57545  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63816), unsafe.Pointer(&_fetchPayloadØ00__func__Ø000), unsafe.Pointer(str(75346)))
 57546  			crt.X__builtin_abort(tls)
 57547  		}
 57548  	}()
 57549  	func() {
 57550  		if int32(_pCur.XeState) != int32(1) {
 57551  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63817), unsafe.Pointer(&_fetchPayloadØ00__func__Ø000), unsafe.Pointer(str(10345)))
 57552  			crt.X__builtin_abort(tls)
 57553  		}
 57554  	}()
 57555  	func() {
 57556  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XBtree)(_pCur.XpBtree).Xdb).Xmutex)) == 0 {
 57557  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63818), unsafe.Pointer(&_fetchPayloadØ00__func__Ø000), unsafe.Pointer(str(72011)))
 57558  			crt.X__builtin_abort(tls)
 57559  		}
 57560  	}()
 57561  	func() {
 57562  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 57563  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63819), unsafe.Pointer(&_fetchPayloadØ00__func__Ø000), unsafe.Pointer(str(71986)))
 57564  			crt.X__builtin_abort(tls)
 57565  		}
 57566  	}()
 57567  	func() {
 57568  		if int32(_pCur.Xix) >= int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnCell) {
 57569  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63820), unsafe.Pointer(&_fetchPayloadØ00__func__Ø000), unsafe.Pointer(str(10552)))
 57570  			crt.X__builtin_abort(tls)
 57571  		}
 57572  	}()
 57573  	func() {
 57574  		if int32(_pCur.Xinfo.XnSize) <= int32(0) {
 57575  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63821), unsafe.Pointer(&_fetchPayloadØ00__func__Ø000), unsafe.Pointer(str(75401)))
 57576  			crt.X__builtin_abort(tls)
 57577  		}
 57578  	}()
 57579  	func() {
 57580  		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) {
 57581  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63822), unsafe.Pointer(&_fetchPayloadØ00__func__Ø000), unsafe.Pointer(str(75420)))
 57582  			crt.X__builtin_abort(tls)
 57583  		}
 57584  	}()
 57585  	func() {
 57586  		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) {
 57587  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63823), unsafe.Pointer(&_fetchPayloadØ00__func__Ø000), unsafe.Pointer(str(75487)))
 57588  			crt.X__builtin_abort(tls)
 57589  		}
 57590  	}()
 57591  	_amt = uint32(int32(uintptr(unsafe.Pointer((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XaDataEnd)) - uintptr(unsafe.Pointer(_pCur.Xinfo.XpPayload))))
 57592  	if uint32(_pCur.Xinfo.XnLocal) < _amt {
 57593  		_amt = uint32(_pCur.Xinfo.XnLocal)
 57594  	}
 57595  	*_pAmt = _amt
 57596  	return unsafe.Pointer(_pCur.Xinfo.XpPayload)
 57597  }
 57598  
 57599  var _fetchPayloadØ00__func__Ø000 [13]int8
 57600  
 57601  func init() {
 57602  	crt.Xstrncpy(nil, &_fetchPayloadØ00__func__Ø000[0], str(75556), 13)
 57603  }
 57604  
 57605  func _sqlite3VdbeMemFromBtree(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt uint32, _pMem *XMem) (r0 int32) {
 57606  	var _rc int32
 57607  	var _available uint32
 57608  	var _zData *int8
 57609  	_available = uint32(0)
 57610  	_rc = int32(0)
 57611  	func() {
 57612  		if _sqlite3BtreeCursorIsValid(tls, _pCur) == 0 {
 57613  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70690), unsafe.Pointer(&_sqlite3VdbeMemFromBtreeØ00__func__Ø000), unsafe.Pointer(str(75569)))
 57614  			crt.X__builtin_abort(tls)
 57615  		}
 57616  	}()
 57617  	func() {
 57618  		if (int32(_pMem.Xflags) & int32(9312)) != int32(0) {
 57619  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70691), unsafe.Pointer(&_sqlite3VdbeMemFromBtreeØ00__func__Ø000), unsafe.Pointer(str(75601)))
 57620  			crt.X__builtin_abort(tls)
 57621  		}
 57622  	}()
 57623  	func() {
 57624  		if (int32(_pMem.Xflags) & int32(32)) != int32(0) {
 57625  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70695), unsafe.Pointer(&_sqlite3VdbeMemFromBtreeØ00__func__Ø000), unsafe.Pointer(str(6629)))
 57626  			crt.X__builtin_abort(tls)
 57627  		}
 57628  	}()
 57629  	_zData = (*int8)(_sqlite3BtreePayloadFetch(tls, _pCur, &_available))
 57630  	func() {
 57631  		if _zData == nil {
 57632  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70697), unsafe.Pointer(&_sqlite3VdbeMemFromBtreeØ00__func__Ø000), unsafe.Pointer(str(75623)))
 57633  			crt.X__builtin_abort(tls)
 57634  		}
 57635  	}()
 57636  	if (_offset + _amt) <= _available {
 57637  		_pMem.Xz = elem1(_zData, uintptr(_offset))
 57638  		_pMem.Xflags = uint16(4112)
 57639  		_pMem.Xn = int32(_amt)
 57640  		goto _9
 57641  	}
 57642  	_rc = _vdbeMemFromBtreeResize(tls, _pCur, _offset, _amt, _pMem)
 57643  _9:
 57644  	return _rc
 57645  }
 57646  
 57647  var _sqlite3VdbeMemFromBtreeØ00__func__Ø000 [24]int8
 57648  
 57649  func init() {
 57650  	crt.Xstrncpy(nil, &_sqlite3VdbeMemFromBtreeØ00__func__Ø000[0], str(75632), 24)
 57651  }
 57652  
 57653  // C comment
 57654  //  /*
 57655  //  ** Move data out of a btree key or data field and into a Mem structure.
 57656  //  ** The data is payload from the entry that pCur is currently pointing
 57657  //  ** to.  offset and amt determine what portion of the data or key to retrieve.
 57658  //  ** The result is written into the pMem element.
 57659  //  **
 57660  //  ** The pMem object must have been initialized.  This routine will use
 57661  //  ** pMem->zMalloc to hold the content from the btree, if possible.  New
 57662  //  ** pMem->zMalloc space will be allocated if necessary.  The calling routine
 57663  //  ** is responsible for making sure that the pMem object is eventually
 57664  //  ** destroyed.
 57665  //  **
 57666  //  ** If this routine fails for any reason (malloc returns NULL or unable
 57667  //  ** to read from the disk) then the pMem is left in an inconsistent state.
 57668  //  */
 57669  func _vdbeMemFromBtreeResize(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt uint32, _pMem *XMem) (r0 int32) {
 57670  	var _rc int32
 57671  	_pMem.Xflags = uint16(1)
 57672  	if int32(0) != store2(&_rc, _sqlite3VdbeMemClearAndResize(tls, _pMem, int32(_amt+uint32(2)))) {
 57673  		goto _0
 57674  	}
 57675  	_rc = _sqlite3BtreePayload(tls, _pCur, _offset, _amt, unsafe.Pointer(_pMem.Xz))
 57676  	if _rc == int32(0) {
 57677  		*elem1(_pMem.Xz, uintptr(_amt)) = 0
 57678  		*elem1(_pMem.Xz, uintptr(_amt+uint32(1))) = 0
 57679  		_pMem.Xflags = uint16(528)
 57680  		_pMem.Xn = int32(_amt)
 57681  		goto _2
 57682  	}
 57683  	_sqlite3VdbeMemRelease(tls, _pMem)
 57684  _2:
 57685  _0:
 57686  	return _rc
 57687  }
 57688  
 57689  func _sqlite3VdbeOneByteSerialTypeLen(tls *crt.TLS, _serial_type uint8) (r0 uint8) {
 57690  	func() {
 57691  		if int32(_serial_type) >= int32(128) {
 57692  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74680), unsafe.Pointer(&_sqlite3VdbeOneByteSerialTypeLenØ00__func__Ø000), unsafe.Pointer(str(75656)))
 57693  			crt.X__builtin_abort(tls)
 57694  		}
 57695  	}()
 57696  	return *elem15((*uint8)(unsafe.Pointer(&_sqlite3SmallTypeSizes)), uintptr(_serial_type))
 57697  }
 57698  
 57699  var _sqlite3VdbeOneByteSerialTypeLenØ00__func__Ø000 [32]int8
 57700  
 57701  func init() {
 57702  	crt.Xstrncpy(nil, &_sqlite3VdbeOneByteSerialTypeLenØ00__func__Ø000[0], str(75672), 32)
 57703  }
 57704  
 57705  var _sqlite3VdbeExecØ00aFlagØ004 [2]uint16
 57706  
 57707  func init() {
 57708  	_sqlite3VdbeExecØ00aFlagØ004 = [2]uint16{uint16(16), uint16(514)}
 57709  }
 57710  
 57711  var _sqlite3VdbeExecØ00aZeroØ005 [16]uint8
 57712  
 57713  // C comment
 57714  //  /*
 57715  //  ** Return the serial-type for the value stored in pMem.
 57716  //  */
 57717  func _sqlite3VdbeSerialType(tls *crt.TLS, _pMem *XMem, _file_format int32, _pLen *uint32) (r0 uint32) {
 57718  	var _flags int32
 57719  	var _2_i int64
 57720  	var _n uint32
 57721  	var _2_u uint64
 57722  	_flags = int32(_pMem.Xflags)
 57723  	func() {
 57724  		if _pLen == nil {
 57725  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74602), unsafe.Pointer(&_sqlite3VdbeSerialTypeØ00__func__Ø000), unsafe.Pointer(str(75704)))
 57726  			crt.X__builtin_abort(tls)
 57727  		}
 57728  	}()
 57729  	if (_flags & int32(1)) != 0 {
 57730  		*_pLen = 0
 57731  		return 0
 57732  	}
 57733  	if (_flags & int32(4)) == 0 {
 57734  		goto _3
 57735  	}
 57736  	_2_i = *(*int64)(unsafe.Pointer(&_pMem.Xu))
 57737  	if _2_i < (0) {
 57738  		_2_u = uint64(^_2_i)
 57739  		goto _5
 57740  	}
 57741  	_2_u = uint64(_2_i)
 57742  _5:
 57743  	if _2_u > uint64(127) {
 57744  		goto _6
 57745  	}
 57746  	if ((_2_i & int64(1)) == _2_i) && (_file_format >= int32(4)) {
 57747  		*_pLen = 0
 57748  		return uint32(8) + uint32(_2_u)
 57749  	}
 57750  	*_pLen = uint32(1)
 57751  	return uint32(1)
 57752  
 57753  _6:
 57754  	if _2_u <= uint64(32767) {
 57755  		*_pLen = uint32(2)
 57756  		return uint32(2)
 57757  	}
 57758  	if _2_u <= uint64(8388607) {
 57759  		*_pLen = uint32(3)
 57760  		return uint32(3)
 57761  	}
 57762  	if _2_u <= uint64(2147483647) {
 57763  		*_pLen = uint32(4)
 57764  		return uint32(4)
 57765  	}
 57766  	if _2_u <= uint64(140737488355327) {
 57767  		*_pLen = uint32(6)
 57768  		return uint32(5)
 57769  	}
 57770  	*_pLen = uint32(8)
 57771  	return uint32(6)
 57772  
 57773  _3:
 57774  	if (_flags & int32(8)) != 0 {
 57775  		*_pLen = uint32(8)
 57776  		return uint32(7)
 57777  	}
 57778  	func() {
 57779  		if ((*Xsqlite3)(_pMem.Xdb).XmallocFailed) == 0 && (_flags&int32(18)) == 0 {
 57780  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74637), unsafe.Pointer(&_sqlite3VdbeSerialTypeØ00__func__Ø000), unsafe.Pointer(str(75712)))
 57781  			crt.X__builtin_abort(tls)
 57782  		}
 57783  	}()
 57784  	func() {
 57785  		if _pMem.Xn < int32(0) {
 57786  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74638), unsafe.Pointer(&_sqlite3VdbeSerialTypeØ00__func__Ø000), unsafe.Pointer(str(5902)))
 57787  			crt.X__builtin_abort(tls)
 57788  		}
 57789  	}()
 57790  	_n = uint32(_pMem.Xn)
 57791  	if (_flags & int32(16384)) != 0 {
 57792  		_n += uint32(*(*int32)(unsafe.Pointer(&_pMem.Xu)))
 57793  	}
 57794  	*_pLen = _n
 57795  	return ((_n * uint32(2)) + uint32(12)) + uint32(bool2int((_flags&int32(2)) != int32(0)))
 57796  }
 57797  
 57798  var _sqlite3VdbeSerialTypeØ00__func__Ø000 [22]int8
 57799  
 57800  func init() {
 57801  	crt.Xstrncpy(nil, &_sqlite3VdbeSerialTypeØ00__func__Ø000[0], str(75763), 22)
 57802  }
 57803  
 57804  // C comment
 57805  //  /*
 57806  //  ** Routines to read and write variable-length integers.  These used to
 57807  //  ** be defined locally, but now we use the varint routines in the util.c
 57808  //  ** file.
 57809  //  */
 57810  func _sqlite3PutVarint(tls *crt.TLS, _p *uint8, _v uint64) (r0 int32) {
 57811  	if _v <= uint64(127) {
 57812  		*elem15(_p, 0) = uint8(_v & uint64(127))
 57813  		return int32(1)
 57814  	}
 57815  	if _v <= uint64(16383) {
 57816  		*elem15(_p, 0) = uint8(((_v >> 7) & uint64(127)) | uint64(128))
 57817  		*elem15(_p, uintptr(1)) = uint8(_v & uint64(127))
 57818  		return int32(2)
 57819  	}
 57820  	return _putVarint64(tls, _p, _v)
 57821  }
 57822  
 57823  // C comment
 57824  //  /*
 57825  //  ** Write a 64-bit variable-length integer to memory starting at p[0].
 57826  //  ** The length of data write will be between 1 and 9 bytes.  The number
 57827  //  ** of bytes written is returned.
 57828  //  **
 57829  //  ** A variable-length integer consists of the lower 7 bits of each byte
 57830  //  ** for all bytes that have the 8th bit set and one byte with the 8th
 57831  //  ** bit clear.  Except, if we get to the 9th byte, it stores the full
 57832  //  ** 8 bits and is the last byte.
 57833  //  */
 57834  func _putVarint64(tls *crt.TLS, _p *uint8, _v uint64) (r0 int32) {
 57835  	var _i, _j, _n int32
 57836  	var _buf [10]uint8
 57837  	if (_v & uint64(18374686479671623680)) == 0 {
 57838  		goto _0
 57839  	}
 57840  	*elem15(_p, uintptr(8)) = uint8(_v)
 57841  	_v >>= 8
 57842  	_i = int32(7)
 57843  _1:
 57844  	if _i < int32(0) {
 57845  		goto _4
 57846  	}
 57847  	*elem15(_p, uintptr(_i)) = uint8((_v & uint64(127)) | uint64(128))
 57848  	_v >>= 7
 57849  	_i -= 1
 57850  	goto _1
 57851  _4:
 57852  	return int32(9)
 57853  
 57854  _0:
 57855  	_n = int32(0)
 57856  _5:
 57857  	*elem15((*uint8)(unsafe.Pointer(&_buf)), uintptr(postInc2(&_n, 1))) = uint8((_v & uint64(127)) | uint64(128))
 57858  	_v >>= 7
 57859  	if _v != (0) {
 57860  		goto _5
 57861  	}
 57862  	{
 57863  		p := elem15((*uint8)(unsafe.Pointer(&_buf)), 0)
 57864  		*p = uint8(int32(*p) & int32(127))
 57865  	}
 57866  	func() {
 57867  		if _n > int32(9) {
 57868  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(28455), unsafe.Pointer(&_putVarint64Ø00__func__Ø000), unsafe.Pointer(str(75785)))
 57869  			crt.X__builtin_abort(tls)
 57870  		}
 57871  	}()
 57872  	*func() *int32 { _i = int32(0); return &_j }() = _n - int32(1)
 57873  _8:
 57874  	if _j < int32(0) {
 57875  		goto _11
 57876  	}
 57877  	*elem15(_p, uintptr(_i)) = *elem15((*uint8)(unsafe.Pointer(&_buf)), uintptr(_j))
 57878  	*func() *int32 { _j -= 1; return &_i }() += 1
 57879  	goto _8
 57880  _11:
 57881  	return _n
 57882  
 57883  	_ = _buf
 57884  	panic(0)
 57885  }
 57886  
 57887  var _putVarint64Ø00__func__Ø000 [12]int8
 57888  
 57889  func init() {
 57890  	crt.Xstrncpy(nil, &_putVarint64Ø00__func__Ø000[0], str(75790), 12)
 57891  }
 57892  
 57893  func _sqlite3VdbeSerialPut(tls *crt.TLS, _buf *uint8, _pMem *XMem, _serial_type uint32) (r0 uint32) {
 57894  	var _len, _1_i uint32
 57895  	var _1_v uint64
 57896  	if _serial_type > uint32(7) || _serial_type <= (0) {
 57897  		goto _1
 57898  	}
 57899  	if _serial_type == uint32(7) {
 57900  		crt.Xmemcpy(tls, unsafe.Pointer(&_1_v), unsafe.Pointer((*float64)(unsafe.Pointer(&_pMem.Xu))), uint32(8))
 57901  		goto _3
 57902  	}
 57903  	_1_v = uint64(*(*int64)(unsafe.Pointer(&_pMem.Xu)))
 57904  _3:
 57905  	_len = store23(&_1_i, uint32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3SmallTypeSizes)), uintptr(_serial_type))))
 57906  	func() {
 57907  		if _1_i <= (0) {
 57908  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74765), unsafe.Pointer(&_sqlite3VdbeSerialPutØ00__func__Ø000), unsafe.Pointer(str(12925)))
 57909  			crt.X__builtin_abort(tls)
 57910  		}
 57911  	}()
 57912  _6:
 57913  	*elem15(_buf, uintptr(preInc23(&_1_i, uint32(4294967295)))) = uint8(_1_v & uint64(255))
 57914  	_1_v >>= 8
 57915  	if _1_i != 0 {
 57916  		goto _6
 57917  	}
 57918  	return _len
 57919  
 57920  _1:
 57921  	if _serial_type < uint32(12) {
 57922  		goto _7
 57923  	}
 57924  	func() {
 57925  		if (_pMem.Xn + func() int32 {
 57926  			if (int32(_pMem.Xflags) & int32(16384)) != 0 {
 57927  				return (*(*int32)(unsafe.Pointer(&_pMem.Xu)))
 57928  			}
 57929  			return int32(0)
 57930  		}()) != int32(_sqlite3VdbeSerialTypeLen(tls, _serial_type)) {
 57931  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74775), unsafe.Pointer(&_sqlite3VdbeSerialPutØ00__func__Ø000), unsafe.Pointer(str(75802)))
 57932  			crt.X__builtin_abort(tls)
 57933  		}
 57934  	}()
 57935  	_len = uint32(_pMem.Xn)
 57936  	if _len > (0) {
 57937  		crt.Xmemcpy(tls, unsafe.Pointer(_buf), unsafe.Pointer(_pMem.Xz), _len)
 57938  	}
 57939  	return _len
 57940  
 57941  _7:
 57942  	return 0
 57943  }
 57944  
 57945  var _sqlite3VdbeSerialPutØ00__func__Ø000 [21]int8
 57946  
 57947  func init() {
 57948  	crt.Xstrncpy(nil, &_sqlite3VdbeSerialPutØ00__func__Ø000[0], str(75901), 21)
 57949  }
 57950  
 57951  // C comment
 57952  //  /*
 57953  //  ** The first argument, pCur, is a cursor opened on some b-tree. Count the
 57954  //  ** number of entries in the b-tree and write the result to *pnEntry.
 57955  //  **
 57956  //  ** SQLITE_OK is returned if the operation is successfully executed.
 57957  //  ** Otherwise, if an error is encountered (i.e. an IO error or database
 57958  //  ** corruption) an SQLite error code is returned.
 57959  //  */
 57960  func _sqlite3BtreeCount(tls *crt.TLS, _pCur *XBtCursor, _pnEntry *int64) (r0 int32) {
 57961  	var _rc, _2_iIdx int32
 57962  	var _nEntry int64
 57963  	var _2_pPage *XMemPage
 57964  	_nEntry = int64(0)
 57965  	if _pCur.XpgnoRoot == (0) {
 57966  		*_pnEntry = 0
 57967  		return int32(0)
 57968  	}
 57969  	_rc = _moveToRoot(tls, _pCur)
 57970  _1:
 57971  	if _rc != int32(0) {
 57972  		goto _2
 57973  	}
 57974  	_2_pPage = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))
 57975  	if (_2_pPage.Xleaf != 0) || (_2_pPage.XintKey == 0) {
 57976  		_nEntry += int64(_2_pPage.XnCell)
 57977  	}
 57978  	if _2_pPage.Xleaf == 0 {
 57979  		goto _5
 57980  	}
 57981  _6:
 57982  	if int32(_pCur.XiPage) == int32(0) {
 57983  		*_pnEntry = _nEntry
 57984  		return _moveToRoot(tls, _pCur)
 57985  	}
 57986  	_moveToParent(tls, _pCur)
 57987  	if int32(_pCur.Xix) >= int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnCell) {
 57988  		goto _6
 57989  	}
 57990  	_pCur.Xix += 1
 57991  	_2_pPage = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))
 57992  _5:
 57993  	_2_iIdx = int32(_pCur.Xix)
 57994  	if _2_iIdx == int32(_2_pPage.XnCell) {
 57995  		_rc = _moveToChild(tls, _pCur, _sqlite3Get4byte(tls, elem15(_2_pPage.XaData, uintptr(int32(_2_pPage.XhdrOffset)+int32(8)))))
 57996  		goto _9
 57997  	}
 57998  	_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)))))))))
 57999  _9:
 58000  	goto _1
 58001  _2:
 58002  	return _rc
 58003  }
 58004  
 58005  // C comment
 58006  //  /*
 58007  //  ** This function is only called from within an assert() expression. It
 58008  //  ** checks that the sqlite3.nTransaction variable is correctly set to
 58009  //  ** the number of non-transaction savepoints currently in the
 58010  //  ** linked list starting at sqlite3.pSavepoint.
 58011  //  **
 58012  //  ** Usage:
 58013  //  **
 58014  //  **     assert( checkSavepointCount(db) );
 58015  //  */
 58016  func _checkSavepointCount(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 58017  	var _n int32
 58018  	var _p *XSavepoint
 58019  	_n = int32(0)
 58020  	_p = (*XSavepoint)(_db.XpSavepoint)
 58021  _0:
 58022  	if _p == nil {
 58023  		goto _3
 58024  	}
 58025  	_n += 1
 58026  	_p = (*XSavepoint)(_p.XpNext)
 58027  	goto _0
 58028  _3:
 58029  	func() {
 58030  		if _n != (_db.XnSavepoint + int32(_db.XisTransactionSavepoint)) {
 58031  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78815), unsafe.Pointer(&_checkSavepointCountØ00__func__Ø000), unsafe.Pointer(str(75922)))
 58032  			crt.X__builtin_abort(tls)
 58033  		}
 58034  	}()
 58035  	return int32(1)
 58036  }
 58037  
 58038  var _checkSavepointCountØ00__func__Ø000 [20]int8
 58039  
 58040  func init() {
 58041  	crt.Xstrncpy(nil, &_checkSavepointCountØ00__func__Ø000[0], str(75971), 20)
 58042  }
 58043  
 58044  // C comment
 58045  //  /*
 58046  //  ** Start a statement subtransaction. The subtransaction can be rolled
 58047  //  ** back independently of the main transaction. You must start a transaction
 58048  //  ** before starting a subtransaction. The subtransaction is ended automatically
 58049  //  ** if the main transaction commits or rolls back.
 58050  //  **
 58051  //  ** Statement subtransactions are used around individual SQL statements
 58052  //  ** that are contained within a BEGIN...COMMIT block.  If a constraint
 58053  //  ** error occurs within the statement, the effect of that one statement
 58054  //  ** can be rolled back without having to rollback the entire transaction.
 58055  //  **
 58056  //  ** A statement sub-transaction is implemented as an anonymous savepoint. The
 58057  //  ** value passed as the second parameter is the total number of savepoints,
 58058  //  ** including the new anonymous savepoint, open on the B-Tree. i.e. if there
 58059  //  ** are no active savepoints and no other statement-transactions open,
 58060  //  ** iStatement is 1. This anonymous savepoint can be released or rolled back
 58061  //  ** using the sqlite3BtreeSavepoint() function.
 58062  //  */
 58063  func _sqlite3BtreeBeginStmt(tls *crt.TLS, _p *XBtree, _iStatement int32) (r0 int32) {
 58064  	var _rc int32
 58065  	var _pBt *XBtShared
 58066  	_pBt = (*XBtShared)(_p.XpBt)
 58067  	_sqlite3BtreeEnter(tls, _p)
 58068  	func() {
 58069  		if int32(_p.XinTrans) != int32(2) {
 58070  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63105), unsafe.Pointer(&_sqlite3BtreeBeginStmtØ00__func__Ø000), unsafe.Pointer(str(75991)))
 58071  			crt.X__builtin_abort(tls)
 58072  		}
 58073  	}()
 58074  	func() {
 58075  		if (int32(_pBt.XbtsFlags) & int32(1)) != int32(0) {
 58076  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63106), unsafe.Pointer(&_sqlite3BtreeBeginStmtØ00__func__Ø000), unsafe.Pointer(str(76015)))
 58077  			crt.X__builtin_abort(tls)
 58078  		}
 58079  	}()
 58080  	func() {
 58081  		if _iStatement <= int32(0) {
 58082  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63107), unsafe.Pointer(&_sqlite3BtreeBeginStmtØ00__func__Ø000), unsafe.Pointer(str(76050)))
 58083  			crt.X__builtin_abort(tls)
 58084  		}
 58085  	}()
 58086  	func() {
 58087  		if _iStatement <= ((*Xsqlite3)(_p.Xdb).XnSavepoint) {
 58088  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63108), unsafe.Pointer(&_sqlite3BtreeBeginStmtØ00__func__Ø000), unsafe.Pointer(str(76063)))
 58089  			crt.X__builtin_abort(tls)
 58090  		}
 58091  	}()
 58092  	func() {
 58093  		if int32(_pBt.XinTransaction) != int32(2) {
 58094  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63109), unsafe.Pointer(&_sqlite3BtreeBeginStmtØ00__func__Ø000), unsafe.Pointer(str(56904)))
 58095  			crt.X__builtin_abort(tls)
 58096  		}
 58097  	}()
 58098  	_rc = _sqlite3PagerOpenSavepoint(tls, (*XPager)(_pBt.XpPager), _iStatement)
 58099  	_sqlite3BtreeLeave(tls, _p)
 58100  	return _rc
 58101  }
 58102  
 58103  var _sqlite3BtreeBeginStmtØ00__func__Ø000 [22]int8
 58104  
 58105  func init() {
 58106  	crt.Xstrncpy(nil, &_sqlite3BtreeBeginStmtØ00__func__Ø000[0], str(76092), 22)
 58107  }
 58108  
 58109  // C comment
 58110  //  /*
 58111  //  ** Write meta-information back into the database.  Meta[0] is
 58112  //  ** read-only and may not be written.
 58113  //  */
 58114  func _sqlite3BtreeUpdateMeta(tls *crt.TLS, _p *XBtree, _idx int32, _iMeta uint32) (r0 int32) {
 58115  	var _rc int32
 58116  	var _pP1 *uint8
 58117  	var _pBt *XBtShared
 58118  	_pBt = (*XBtShared)(_p.XpBt)
 58119  	func() {
 58120  		if _idx < int32(1) || _idx > int32(15) {
 58121  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67891), unsafe.Pointer(&_sqlite3BtreeUpdateMetaØ00__func__Ø000), unsafe.Pointer(str(76114)))
 58122  			crt.X__builtin_abort(tls)
 58123  		}
 58124  	}()
 58125  	_sqlite3BtreeEnter(tls, _p)
 58126  	func() {
 58127  		if int32(_p.XinTrans) != int32(2) {
 58128  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67893), unsafe.Pointer(&_sqlite3BtreeUpdateMetaØ00__func__Ø000), unsafe.Pointer(str(75991)))
 58129  			crt.X__builtin_abort(tls)
 58130  		}
 58131  	}()
 58132  	func() {
 58133  		if (*XMemPage)(_pBt.XpPage1) == nil {
 58134  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67894), unsafe.Pointer(&_sqlite3BtreeUpdateMetaØ00__func__Ø000), unsafe.Pointer(str(76132)))
 58135  			crt.X__builtin_abort(tls)
 58136  		}
 58137  	}()
 58138  	_pP1 = (*XMemPage)(_pBt.XpPage1).XaData
 58139  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)((*XMemPage)(_pBt.XpPage1).XpDbPage))
 58140  	if _rc != int32(0) {
 58141  		goto _7
 58142  	}
 58143  	_sqlite3Put4byte(tls, elem15(_pP1, uintptr(int32(36)+(_idx*int32(4)))), _iMeta)
 58144  	if _idx == int32(7) {
 58145  		func() {
 58146  			if _pBt.XautoVacuum == 0 && _iMeta != (0) {
 58147  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67901), unsafe.Pointer(&_sqlite3BtreeUpdateMetaØ00__func__Ø000), unsafe.Pointer(str(76147)))
 58148  				crt.X__builtin_abort(tls)
 58149  			}
 58150  		}()
 58151  		func() {
 58152  			if _iMeta != (0) && _iMeta != uint32(1) {
 58153  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67902), unsafe.Pointer(&_sqlite3BtreeUpdateMetaØ00__func__Ø000), unsafe.Pointer(str(76175)))
 58154  				crt.X__builtin_abort(tls)
 58155  			}
 58156  		}()
 58157  		_pBt.XincrVacuum = uint8(_iMeta)
 58158  	}
 58159  _7:
 58160  	_sqlite3BtreeLeave(tls, _p)
 58161  	return _rc
 58162  }
 58163  
 58164  var _sqlite3BtreeUpdateMetaØ00__func__Ø000 [23]int8
 58165  
 58166  func init() {
 58167  	crt.Xstrncpy(nil, &_sqlite3BtreeUpdateMetaØ00__func__Ø000[0], str(76196), 23)
 58168  }
 58169  
 58170  // C comment
 58171  //  /*
 58172  //  ** Allocate VdbeCursor number iCur.  Return a pointer to it.  Return NULL
 58173  //  ** if we run out of memory.
 58174  //  */
 58175  func _allocateCursor(tls *crt.TLS, _p *TVdbe, _iCur int32, _nField int32, _iDb int32, _eCurType uint8) (r0 *XVdbeCursor) {
 58176  	var _nByte int32
 58177  	var _pMem *XMem
 58178  	var _pCx *XVdbeCursor
 58179  	_pMem = func() *XMem {
 58180  		if _iCur > int32(0) {
 58181  			return elem25((*XMem)(_p.XaMem), uintptr(_p.XnMem-_iCur))
 58182  		}
 58183  		return (*XMem)(_p.XaMem)
 58184  	}()
 58185  	_pCx = nil
 58186  	_nByte = int32((uint32(88) + (uint32(8) * uint32(_nField))) + uint32(func() int32 {
 58187  		if int32(_eCurType) == int32(0) {
 58188  			return _sqlite3BtreeCursorSize(tls)
 58189  		}
 58190  		return int32(0)
 58191  	}()))
 58192  	func() {
 58193  		if _iCur < int32(0) || _iCur >= _p.XnCursor {
 58194  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78418), unsafe.Pointer(&_allocateCursorØ00__func__Ø000), unsafe.Pointer(str(76219)))
 58195  			crt.X__builtin_abort(tls)
 58196  		}
 58197  	}()
 58198  	if (*elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_iCur))) != nil {
 58199  		_sqlite3VdbeFreeCursor(tls, _p, *elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_iCur)))
 58200  		*elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_iCur)) = nil
 58201  	}
 58202  	if int32(0) != _sqlite3VdbeMemClearAndResize(tls, _pMem, _nByte) {
 58203  		goto _8
 58204  	}
 58205  	*elem77((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_iCur)) = store86(&_pCx, (*XVdbeCursor)(unsafe.Pointer(_pMem.Xz)))
 58206  	crt.Xmemset(tls, unsafe.Pointer(_pCx), int32(0), uint32(32))
 58207  	_pCx.XeCurType = _eCurType
 58208  	_pCx.XiDb = int8(_iDb)
 58209  	_pCx.XnField = int16(_nField)
 58210  	_pCx.XaOffset = elem7((*uint32)(unsafe.Pointer(&_pCx.XaType)), uintptr(_nField))
 58211  	if int32(_eCurType) == int32(0) {
 58212  		*(**XBtCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pCx.Xuc)))) = (*XBtCursor)(unsafe.Pointer(elem1(_pMem.Xz, uintptr(uint32(88)+(uint32(8)*uint32(_nField))))))
 58213  		_sqlite3BtreeCursorZero(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_pCx.Xuc))))
 58214  	}
 58215  _8:
 58216  	return _pCx
 58217  }
 58218  
 58219  // C comment
 58220  //  /*
 58221  //  ** Return the size of a BtCursor object in bytes.
 58222  //  **
 58223  //  ** This interfaces is needed so that users of cursors can preallocate
 58224  //  ** sufficient storage to hold a cursor.  The BtCursor object is opaque
 58225  //  ** to users so they cannot do the sizeof() themselves - they must call
 58226  //  ** this routine.
 58227  //  */
 58228  func _sqlite3BtreeCursorSize(tls *crt.TLS) (r0 int32) {
 58229  	return int32(192)
 58230  }
 58231  
 58232  var _allocateCursorØ00__func__Ø000 [15]int8
 58233  
 58234  func init() {
 58235  	crt.Xstrncpy(nil, &_allocateCursorØ00__func__Ø000[0], str(76246), 15)
 58236  }
 58237  
 58238  // C comment
 58239  //  /*
 58240  //  ** Initialize memory that will be converted into a BtCursor object.
 58241  //  **
 58242  //  ** The simple approach here would be to memset() the entire object
 58243  //  ** to zero.  But it turns out that the apPage[] and aiIdx[] arrays
 58244  //  ** do not need to be zeroed and they are large, so we can save a lot
 58245  //  ** of run-time by skipping the initialization of those elements.
 58246  //  */
 58247  func _sqlite3BtreeCursorZero(tls *crt.TLS, _p *XBtCursor) {
 58248  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint32(64))
 58249  }
 58250  
 58251  func _sqlite3BtreeCursor(tls *crt.TLS, _p *XBtree, _iTable int32, _wrFlag int32, _pKeyInfo *XKeyInfo, _pCur *XBtCursor) (r0 int32) {
 58252  	var _rc int32
 58253  	if _iTable < int32(1) {
 58254  		_rc = _sqlite3CorruptError(tls, int32(63273))
 58255  		goto _1
 58256  	}
 58257  	_sqlite3BtreeEnter(tls, _p)
 58258  	_rc = _btreeCursor(tls, _p, _iTable, _wrFlag, _pKeyInfo, _pCur)
 58259  	_sqlite3BtreeLeave(tls, _p)
 58260  _1:
 58261  	return _rc
 58262  }
 58263  
 58264  // C comment
 58265  //  /*
 58266  //  ** Create a new cursor for the BTree whose root is on the page
 58267  //  ** iTable. If a read-only cursor is requested, it is assumed that
 58268  //  ** the caller already has at least a read-only transaction open
 58269  //  ** on the database already. If a write-cursor is requested, then
 58270  //  ** the caller is assumed to have an open write transaction.
 58271  //  **
 58272  //  ** If the BTREE_WRCSR bit of wrFlag is clear, then the cursor can only
 58273  //  ** be used for reading.  If the BTREE_WRCSR bit is set, then the cursor
 58274  //  ** can be used for reading or for writing if other conditions for writing
 58275  //  ** are also met.  These are the conditions that must be met in order
 58276  //  ** for writing to be allowed:
 58277  //  **
 58278  //  ** 1:  The cursor must have been opened with wrFlag containing BTREE_WRCSR
 58279  //  **
 58280  //  ** 2:  Other database connections that share the same pager cache
 58281  //  **     but which are not in the READ_UNCOMMITTED state may not have
 58282  //  **     cursors open with wrFlag==0 on the same table.  Otherwise
 58283  //  **     the changes made by this write cursor would be visible to
 58284  //  **     the read cursors in the other database connection.
 58285  //  **
 58286  //  ** 3:  The database must be writable (not on read-only media)
 58287  //  **
 58288  //  ** 4:  There must be an active transaction.
 58289  //  **
 58290  //  ** The BTREE_FORDELETE bit of wrFlag may optionally be set if BTREE_WRCSR
 58291  //  ** is set.  If FORDELETE is set, that is a hint to the implementation that
 58292  //  ** this cursor will only be used to seek to and delete entries of an index
 58293  //  ** as part of a larger DELETE statement.  The FORDELETE hint is not used by
 58294  //  ** this implementation.  But in a hypothetical alternative storage engine
 58295  //  ** in which index entries are automatically deleted when corresponding table
 58296  //  ** rows are deleted, the FORDELETE flag is a hint that all SEEK and DELETE
 58297  //  ** operations on this cursor can be no-ops and all READ operations can
 58298  //  ** return a null row (2-bytes: 0x01 0x00).
 58299  //  **
 58300  //  ** No checking is done to make sure that page iTable really is the
 58301  //  ** root page of a b-tree.  If it is not, then the cursor acquired
 58302  //  ** will not work correctly.
 58303  //  **
 58304  //  ** It is assumed that the sqlite3BtreeCursorZero() has been called
 58305  //  ** on pCur to initialize the memory space prior to invoking this routine.
 58306  //  */
 58307  func _btreeCursor(tls *crt.TLS, _p *XBtree, _iTable int32, _wrFlag int32, _pKeyInfo *XKeyInfo, _pCur *XBtCursor) (r0 int32) {
 58308  	var _pBt *XBtShared
 58309  	var _pX *XBtCursor
 58310  	_pBt = (*XBtShared)(_p.XpBt)
 58311  	func() {
 58312  		if _sqlite3BtreeHoldsMutex(tls, _p) == 0 {
 58313  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63214), unsafe.Pointer(&_btreeCursorØ00__func__Ø000), unsafe.Pointer(str(17442)))
 58314  			crt.X__builtin_abort(tls)
 58315  		}
 58316  	}()
 58317  	func() {
 58318  		if _wrFlag != int32(0) && _wrFlag != int32(4) && _wrFlag != int32(12) {
 58319  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63215), unsafe.Pointer(&_btreeCursorØ00__func__Ø000), unsafe.Pointer(str(76261)))
 58320  			crt.X__builtin_abort(tls)
 58321  		}
 58322  	}()
 58323  	func() {
 58324  		if _hasSharedCacheTableLock(tls, _p, uint32(_iTable), bool2int(_pKeyInfo != nil), func() int32 {
 58325  			if _wrFlag != 0 {
 58326  				return int32(2)
 58327  			}
 58328  			return int32(1)
 58329  		}()) == 0 {
 58330  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63224), unsafe.Pointer(&_btreeCursorØ00__func__Ø000), unsafe.Pointer(str(76335)))
 58331  			crt.X__builtin_abort(tls)
 58332  		}
 58333  	}()
 58334  	func() {
 58335  		if _wrFlag != int32(0) && _hasReadConflicts(tls, _p, uint32(_iTable)) != 0 {
 58336  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63225), unsafe.Pointer(&_btreeCursorØ00__func__Ø000), unsafe.Pointer(str(76397)))
 58337  			crt.X__builtin_abort(tls)
 58338  		}
 58339  	}()
 58340  	func() {
 58341  		if int32(_p.XinTrans) <= int32(0) {
 58342  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63228), unsafe.Pointer(&_btreeCursorØ00__func__Ø000), unsafe.Pointer(str(54118)))
 58343  			crt.X__builtin_abort(tls)
 58344  		}
 58345  	}()
 58346  	func() {
 58347  		if _wrFlag != int32(0) && int32(_p.XinTrans) != int32(2) {
 58348  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63229), unsafe.Pointer(&_btreeCursorØ00__func__Ø000), unsafe.Pointer(str(76439)))
 58349  			crt.X__builtin_abort(tls)
 58350  		}
 58351  	}()
 58352  	func() {
 58353  		if _pBt.XpPage1 == nil || ((*XMemPage)(_pBt.XpPage1).XaData) == nil {
 58354  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63230), unsafe.Pointer(&_btreeCursorØ00__func__Ø000), unsafe.Pointer(str(76476)))
 58355  			crt.X__builtin_abort(tls)
 58356  		}
 58357  	}()
 58358  	func() {
 58359  		if _wrFlag != int32(0) && (int32(_pBt.XbtsFlags)&int32(1)) != int32(0) {
 58360  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63231), unsafe.Pointer(&_btreeCursorØ00__func__Ø000), unsafe.Pointer(str(76510)))
 58361  			crt.X__builtin_abort(tls)
 58362  		}
 58363  	}()
 58364  	if _wrFlag == 0 {
 58365  		goto _24
 58366  	}
 58367  	_allocateTempSpace(tls, _pBt)
 58368  	if _pBt.XpTmpSpace == nil {
 58369  		return _sqlite3NomemError(tls, int32(63235))
 58370  	}
 58371  _24:
 58372  	if (_iTable == int32(1)) && (_btreePagecount(tls, _pBt) == (0)) {
 58373  		func() {
 58374  			if _wrFlag != int32(0) {
 58375  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63238), unsafe.Pointer(&_btreeCursorØ00__func__Ø000), unsafe.Pointer(str(76558)))
 58376  				crt.X__builtin_abort(tls)
 58377  			}
 58378  		}()
 58379  		_iTable = int32(0)
 58380  	}
 58381  	_pCur.XpgnoRoot = uint32(_iTable)
 58382  	_pCur.XiPage = int8(-1)
 58383  	*(**XKeyInfo)(unsafe.Pointer(&_pCur.XpKeyInfo)) = _pKeyInfo
 58384  	*(**XBtree)(unsafe.Pointer(&_pCur.XpBtree)) = _p
 58385  	*(**XBtShared)(unsafe.Pointer(&_pCur.XpBt)) = _pBt
 58386  	_pCur.XcurFlags = uint8(func() int32 {
 58387  		if _wrFlag != 0 {
 58388  			return int32(1)
 58389  		}
 58390  		return int32(0)
 58391  	}())
 58392  	_pCur.XcurPagerFlags = uint8(func() int32 {
 58393  		if _wrFlag != 0 {
 58394  			return int32(0)
 58395  		}
 58396  		return int32(2)
 58397  	}())
 58398  	_pX = (*XBtCursor)(_pBt.XpCursor)
 58399  _34:
 58400  	if _pX == nil {
 58401  		goto _37
 58402  	}
 58403  	if _pX.XpgnoRoot == uint32(_iTable) {
 58404  		{
 58405  			p := &_pX.XcurFlags
 58406  			*p = uint8(int32(*p) | int32(32))
 58407  		}
 58408  		{
 58409  			p := &_pCur.XcurFlags
 58410  			*p = uint8(int32(*p) | int32(32))
 58411  		}
 58412  	}
 58413  	_pX = (*XBtCursor)(_pX.XpNext)
 58414  	goto _34
 58415  _37:
 58416  	*(**XBtCursor)(unsafe.Pointer(&_pCur.XpNext)) = (*XBtCursor)(_pBt.XpCursor)
 58417  	*(**XBtCursor)(unsafe.Pointer(&_pBt.XpCursor)) = _pCur
 58418  	_pCur.XeState = 0
 58419  	return int32(0)
 58420  }
 58421  
 58422  var _btreeCursorØ00__func__Ø000 [12]int8
 58423  
 58424  func init() {
 58425  	crt.Xstrncpy(nil, &_btreeCursorØ00__func__Ø000[0], str(76568), 12)
 58426  }
 58427  
 58428  // C comment
 58429  //  /*
 58430  //  **** This function is only used as part of an assert() statement. ***
 58431  //  **
 58432  //  ** Check to see if pBtree holds the required locks to read or write to the
 58433  //  ** table with root page iRoot.   Return 1 if it does and 0 if not.
 58434  //  **
 58435  //  ** For example, when writing to a table with root-page iRoot via
 58436  //  ** Btree connection pBtree:
 58437  //  **
 58438  //  **    assert( hasSharedCacheTableLock(pBtree, iRoot, 0, WRITE_LOCK) );
 58439  //  **
 58440  //  ** When writing to an index that resides in a sharable database, the
 58441  //  ** caller should have first obtained a lock specifying the root page of
 58442  //  ** the corresponding table. This makes things a bit more complicated,
 58443  //  ** as this module treats each table as a separate structure. To determine
 58444  //  ** the table corresponding to the index being written, this
 58445  //  ** function has to search through the database schema.
 58446  //  **
 58447  //  ** Instead of a lock on the table/index rooted at page iRoot, the caller may
 58448  //  ** hold a write-lock on the schema table (root page 1). This is also
 58449  //  ** acceptable.
 58450  //  */
 58451  func _hasSharedCacheTableLock(tls *crt.TLS, _pBtree *XBtree, _iRoot uint32, _isIndex int32, _eLockType int32) (r0 int32) {
 58452  	var _iTab uint32
 58453  	var _pSchema *XSchema
 58454  	var _3_p *XHashElem
 58455  	var _pLock *XBtLock
 58456  	var _4_pIdx *XIndex
 58457  	_pSchema = (*XSchema)((*XBtShared)(_pBtree.XpBt).XpSchema)
 58458  	_iTab = uint32(0)
 58459  	if (int32(_pBtree.Xsharable) == int32(0)) || ((_eLockType == int32(1)) && (((*Xsqlite3)(_pBtree.Xdb).Xflags)&int32(16384)) != 0) {
 58460  		return int32(1)
 58461  	}
 58462  	if _isIndex != 0 && ((_pSchema == nil) || ((int32(_pSchema.XschemaFlags) & int32(1)) == int32(0))) {
 58463  		return int32(1)
 58464  	}
 58465  	if _isIndex == 0 {
 58466  		goto _6
 58467  	}
 58468  	_3_p = (*XHashElem)(_pSchema.XidxHash.Xfirst)
 58469  _7:
 58470  	if _3_p == nil {
 58471  		goto _10
 58472  	}
 58473  	_4_pIdx = (*XIndex)(_3_p.Xdata)
 58474  	if _4_pIdx.Xtnum != int32(_iRoot) {
 58475  		goto _11
 58476  	}
 58477  	if _iTab != 0 {
 58478  		return int32(1)
 58479  	}
 58480  	_iTab = uint32((*XTable)(_4_pIdx.XpTable).Xtnum)
 58481  _11:
 58482  	_3_p = (*XHashElem)(_3_p.Xnext)
 58483  	goto _7
 58484  _10:
 58485  	goto _13
 58486  _6:
 58487  	_iTab = _iRoot
 58488  _13:
 58489  	_pLock = (*XBtLock)((*XBtShared)(_pBtree.XpBt).XpLock)
 58490  _14:
 58491  	if _pLock == nil {
 58492  		goto _17
 58493  	}
 58494  	if (((*XBtree)(_pLock.XpBtree) == _pBtree) && ((_pLock.XiTable == _iTab) || ((int32(_pLock.XeLock) == int32(2)) && (_pLock.XiTable == uint32(1))))) && (int32(_pLock.XeLock) >= _eLockType) {
 58495  		return int32(1)
 58496  	}
 58497  	_pLock = (*XBtLock)(_pLock.XpNext)
 58498  	goto _14
 58499  _17:
 58500  	return int32(0)
 58501  }
 58502  
 58503  // C comment
 58504  //  /*
 58505  //  **** This function may be used as part of assert() statements only. ****
 58506  //  **
 58507  //  ** Return true if it would be illegal for pBtree to write into the
 58508  //  ** table or index rooted at iRoot because other shared connections are
 58509  //  ** simultaneously reading that same table or index.
 58510  //  **
 58511  //  ** It is illegal for pBtree to write if some other Btree object that
 58512  //  ** shares the same BtShared object is currently reading or writing
 58513  //  ** the iRoot table.  Except, if the other Btree object has the
 58514  //  ** read-uncommitted flag set, then it is OK for the other object to
 58515  //  ** have a read cursor.
 58516  //  **
 58517  //  ** For example, before writing to any part of the table or index
 58518  //  ** rooted at page iRoot, one should call:
 58519  //  **
 58520  //  **    assert( !hasReadConflicts(pBtree, iRoot) );
 58521  //  */
 58522  func _hasReadConflicts(tls *crt.TLS, _pBtree *XBtree, _iRoot uint32) (r0 int32) {
 58523  	var _p *XBtCursor
 58524  	_p = (*XBtCursor)((*XBtShared)(_pBtree.XpBt).XpCursor)
 58525  _0:
 58526  	if _p == nil {
 58527  		goto _3
 58528  	}
 58529  	if ((_p.XpgnoRoot == _iRoot) && ((*XBtree)(_p.XpBtree) != _pBtree)) && (int32(0) == (((*Xsqlite3)((*XBtree)(_p.XpBtree).Xdb).Xflags) & int32(16384))) {
 58530  		return int32(1)
 58531  	}
 58532  	_p = (*XBtCursor)(_p.XpNext)
 58533  	goto _0
 58534  _3:
 58535  	return int32(0)
 58536  }
 58537  
 58538  // C comment
 58539  //  /*
 58540  //  ** Make sure pBt->pTmpSpace points to an allocation of
 58541  //  ** MX_CELL_SIZE(pBt) bytes with a 4-byte prefix for a left-child
 58542  //  ** pointer.
 58543  //  */
 58544  func _allocateTempSpace(tls *crt.TLS, _pBt *XBtShared) {
 58545  	if _pBt.XpTmpSpace != nil {
 58546  		goto _0
 58547  	}
 58548  	_pBt.XpTmpSpace = (*uint8)(_sqlite3PageMalloc(tls, int32(_pBt.XpageSize)))
 58549  	if _pBt.XpTmpSpace != nil {
 58550  		crt.Xmemset(tls, unsafe.Pointer(_pBt.XpTmpSpace), int32(0), uint32(8))
 58551  		*(*uintptr)(unsafe.Pointer(&_pBt.XpTmpSpace)) += uintptr(int32(4))
 58552  	}
 58553  _0:
 58554  }
 58555  
 58556  // C comment
 58557  //  /*
 58558  //  ** Provide flag hints to the cursor.
 58559  //  */
 58560  func _sqlite3BtreeCursorHintFlags(tls *crt.TLS, _pCur *XBtCursor, _x uint32) {
 58561  	func() {
 58562  		if _x != uint32(2) && _x != uint32(1) && _x != (0) {
 58563  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59919), unsafe.Pointer(&_sqlite3BtreeCursorHintFlagsØ00__func__Ø000), unsafe.Pointer(str(76580)))
 58564  			crt.X__builtin_abort(tls)
 58565  		}
 58566  	}()
 58567  	_pCur.Xhints = uint8(_x)
 58568  }
 58569  
 58570  var _sqlite3BtreeCursorHintFlagsØ00__func__Ø000 [28]int8
 58571  
 58572  func init() {
 58573  	crt.Xstrncpy(nil, &_sqlite3BtreeCursorHintFlagsØ00__func__Ø000[0], str(76626), 28)
 58574  }
 58575  
 58576  // C comment
 58577  //  /*
 58578  //  ** Open a database file.
 58579  //  **
 58580  //  ** zFilename is the name of the database file.  If zFilename is NULL
 58581  //  ** then an ephemeral database is created.  The ephemeral database might
 58582  //  ** be exclusively in memory, or it might use a disk-based memory cache.
 58583  //  ** Either way, the ephemeral database will be automatically deleted
 58584  //  ** when sqlite3BtreeClose() is called.
 58585  //  **
 58586  //  ** If zFilename is ":memory:" then an in-memory database is created
 58587  //  ** that is automatically destroyed when it is closed.
 58588  //  **
 58589  //  ** The "flags" parameter is a bitmask that might contain bits like
 58590  //  ** BTREE_OMIT_JOURNAL and/or BTREE_MEMORY.
 58591  //  **
 58592  //  ** If the database is already opened in the same database connection
 58593  //  ** and we are in shared cache mode, then the open will fail with an
 58594  //  ** SQLITE_CONSTRAINT error.  We cannot allow two or more BtShared
 58595  //  ** objects in the same database connection since doing so will lead
 58596  //  ** to problems with locking.
 58597  //  */
 58598  func _sqlite3BtreeOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zFilename *int8, _db *Xsqlite3, _ppBtree **XBtree, _flags int32, _vfsFlags int32) (r0 int32) {
 58599  	var _rc, _isTempDb, _isMemdb, _5_nFilename, _5_nFullPathname, _11_iDb, _25_i int32
 58600  	var _5_zFullPathname *int8
 58601  	var _nReserve uint8
 58602  	var _mutexOpen, _5_mutexShared, _22_mutexShared *Xsqlite3_mutex
 58603  	var _p, _12_pExisting, _25_pSib *XBtree
 58604  	var _35_pFile *Xsqlite3_file
 58605  	var _zDbHeader [100]uint8
 58606  	var _pBt *XBtShared
 58607  	_pBt = nil
 58608  	_mutexOpen = nil
 58609  	_rc = int32(0)
 58610  	_isTempDb = bool2int((_zFilename == nil) || (int32(*elem1(_zFilename, 0)) == int32(0)))
 58611  	_isMemdb = bool2int((((_zFilename != nil) && (crt.Xstrcmp(tls, _zFilename, str(76654)) == int32(0))) || (_isTempDb != 0 && _sqlite3TempInMemory(tls, _db) != 0)) || ((_vfsFlags & int32(128)) != int32(0)))
 58612  	func() {
 58613  		if _db == nil {
 58614  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61256), unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000), unsafe.Pointer(str(1219)))
 58615  			crt.X__builtin_abort(tls)
 58616  		}
 58617  	}()
 58618  	func() {
 58619  		if _pVfs == nil {
 58620  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61257), unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000), unsafe.Pointer(str(76663)))
 58621  			crt.X__builtin_abort(tls)
 58622  		}
 58623  	}()
 58624  	func() {
 58625  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 58626  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61258), unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000), unsafe.Pointer(str(881)))
 58627  			crt.X__builtin_abort(tls)
 58628  		}
 58629  	}()
 58630  	func() {
 58631  		if (_flags & int32(255)) != _flags {
 58632  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61259), unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000), unsafe.Pointer(str(76671)))
 58633  			crt.X__builtin_abort(tls)
 58634  		}
 58635  	}()
 58636  	func() {
 58637  		if (_flags&int32(8)) != int32(0) && (_flags&int32(4)) == int32(0) {
 58638  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61262), unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000), unsafe.Pointer(str(76691)))
 58639  			crt.X__builtin_abort(tls)
 58640  		}
 58641  	}()
 58642  	func() {
 58643  		if (_flags&int32(4)) != int32(0) && _isTempDb == 0 {
 58644  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61265), unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000), unsafe.Pointer(str(76749)))
 58645  			crt.X__builtin_abort(tls)
 58646  		}
 58647  	}()
 58648  	if _isMemdb != 0 {
 58649  		_flags |= int32(2)
 58650  	}
 58651  	if ((_vfsFlags & int32(256)) != int32(0)) && (_isMemdb != 0 || _isTempDb != 0) {
 58652  		_vfsFlags = (_vfsFlags & int32(-257)) | int32(512)
 58653  	}
 58654  	_p = (*XBtree)(_sqlite3MallocZero(tls, uint64(48)))
 58655  	if _p == nil {
 58656  		return _sqlite3NomemError(tls, int32(61275))
 58657  	}
 58658  	_p.XinTrans = 0
 58659  	*(**Xsqlite3)(unsafe.Pointer(&_p.Xdb)) = _db
 58660  	*(**XBtree)(unsafe.Pointer(&(_p.Xlock.XpBtree))) = _p
 58661  	_p.Xlock.XiTable = uint32(1)
 58662  	if _isTempDb != int32(0) || _isMemdb != int32(0) && (_vfsFlags&int32(64)) == int32(0) {
 58663  		goto _26
 58664  	}
 58665  	if (_vfsFlags & int32(131072)) == 0 {
 58666  		goto _27
 58667  	}
 58668  	_5_nFilename = _sqlite3Strlen30(tls, _zFilename) + int32(1)
 58669  	_5_nFullPathname = _pVfs.XmxPathname + int32(1)
 58670  	_5_zFullPathname = (*int8)(_sqlite3Malloc(tls, uint64(func() int32 {
 58671  		if _5_nFullPathname > _5_nFilename {
 58672  			return _5_nFullPathname
 58673  		}
 58674  		return _5_nFilename
 58675  	}())))
 58676  	_p.Xsharable = uint8(1)
 58677  	if _5_zFullPathname == nil {
 58678  		Xsqlite3_free(tls, unsafe.Pointer(_p))
 58679  		return _sqlite3NomemError(tls, int32(61299))
 58680  	}
 58681  	if _isMemdb != 0 {
 58682  		crt.Xmemcpy(tls, unsafe.Pointer(_5_zFullPathname), unsafe.Pointer(_zFilename), uint32(_5_nFilename))
 58683  		goto _32
 58684  	}
 58685  	_rc = _sqlite3OsFullPathname(tls, _pVfs, _zFilename, _5_nFullPathname, _5_zFullPathname)
 58686  	if _rc != 0 {
 58687  		Xsqlite3_free(tls, unsafe.Pointer(_5_zFullPathname))
 58688  		Xsqlite3_free(tls, unsafe.Pointer(_p))
 58689  		return _rc
 58690  	}
 58691  _32:
 58692  	_mutexOpen = _sqlite3MutexAlloc(tls, int32(4))
 58693  	Xsqlite3_mutex_enter(tls, _mutexOpen)
 58694  	_5_mutexShared = _sqlite3MutexAlloc(tls, int32(2))
 58695  	Xsqlite3_mutex_enter(tls, _5_mutexShared)
 58696  	_pBt = _sqlite3SharedCacheList
 58697  _34:
 58698  	if _pBt == nil {
 58699  		goto _37
 58700  	}
 58701  	func() {
 58702  		if _pBt.XnRef <= int32(0) {
 58703  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61319), unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000), unsafe.Pointer(str(76787)))
 58704  			crt.X__builtin_abort(tls)
 58705  		}
 58706  	}()
 58707  	if int32(0) != crt.Xstrcmp(tls, _5_zFullPathname, _sqlite3PagerFilename(tls, (*XPager)(_pBt.XpPager), int32(0))) || _sqlite3PagerVfs(tls, (*XPager)(_pBt.XpPager)) != _pVfs {
 58708  		goto _41
 58709  	}
 58710  	_11_iDb = _db.XnDb - int32(1)
 58711  _42:
 58712  	if _11_iDb < int32(0) {
 58713  		goto _45
 58714  	}
 58715  	_12_pExisting = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_11_iDb)).XpBt)
 58716  	if (_12_pExisting != nil) && ((*XBtShared)(_12_pExisting.XpBt) == _pBt) {
 58717  		Xsqlite3_mutex_leave(tls, _5_mutexShared)
 58718  		Xsqlite3_mutex_leave(tls, _mutexOpen)
 58719  		Xsqlite3_free(tls, unsafe.Pointer(_5_zFullPathname))
 58720  		Xsqlite3_free(tls, unsafe.Pointer(_p))
 58721  		return int32(19)
 58722  	}
 58723  	_11_iDb -= 1
 58724  	goto _42
 58725  _45:
 58726  	*(**XBtShared)(unsafe.Pointer(&_p.XpBt)) = _pBt
 58727  	_pBt.XnRef += 1
 58728  	goto _37
 58729  _41:
 58730  	_pBt = (*XBtShared)(_pBt.XpNext)
 58731  	goto _34
 58732  _37:
 58733  	Xsqlite3_mutex_leave(tls, _5_mutexShared)
 58734  	Xsqlite3_free(tls, unsafe.Pointer(_5_zFullPathname))
 58735  	goto _48
 58736  _27:
 58737  	_p.Xsharable = uint8(1)
 58738  _48:
 58739  _26:
 58740  	if _pBt != nil {
 58741  		goto _49
 58742  	}
 58743  
 58744  	_pBt = (*XBtShared)(_sqlite3MallocZero(tls, uint64(84)))
 58745  	if _pBt == nil {
 58746  		_rc = _sqlite3NomemError(tls, int32(61367))
 58747  		goto _btree_open_out
 58748  	}
 58749  	_rc = _sqlite3PagerOpen(tls, _pVfs, (**XPager)(unsafe.Pointer(&_pBt.XpPager)), _zFilename, int32(84), _flags, _vfsFlags, _pageReinit)
 58750  	if _rc == int32(0) {
 58751  		_sqlite3PagerSetMmapLimit(tls, (*XPager)(_pBt.XpPager), _db.XszMmap)
 58752  		_rc = _sqlite3PagerReadFileheader(tls, (*XPager)(_pBt.XpPager), int32(100), (*uint8)(unsafe.Pointer(&_zDbHeader)))
 58753  	}
 58754  	if _rc != int32(0) {
 58755  		goto _btree_open_out
 58756  	}
 58757  	_pBt.XopenFlags = uint8(_flags)
 58758  	*(**Xsqlite3)(unsafe.Pointer(&_pBt.Xdb)) = _db
 58759  	_sqlite3PagerSetBusyhandler(tls, (*XPager)(_pBt.XpPager), _btreeInvokeBusyHandler, unsafe.Pointer(_pBt))
 58760  	*(**XBtShared)(unsafe.Pointer(&_p.XpBt)) = _pBt
 58761  	*(**XBtCursor)(unsafe.Pointer(&_pBt.XpCursor)) = nil
 58762  	*(**XMemPage)(unsafe.Pointer(&_pBt.XpPage1)) = nil
 58763  	if _sqlite3PagerIsreadonly(tls, (*XPager)(_pBt.XpPager)) != 0 {
 58764  		{
 58765  			p := &_pBt.XbtsFlags
 58766  			*p = uint16(int32(*p) | int32(1))
 58767  		}
 58768  	}
 58769  	_pBt.XpageSize = uint32((int32(*elem15((*uint8)(unsafe.Pointer(&_zDbHeader)), uintptr(16))) << 8) | (int32(*elem15((*uint8)(unsafe.Pointer(&_zDbHeader)), uintptr(17))) << 16))
 58770  	if _pBt.XpageSize >= uint32(512) && _pBt.XpageSize <= uint32(65536) && ((_pBt.XpageSize-uint32(1))&_pBt.XpageSize) == (0) {
 58771  		goto _56
 58772  	}
 58773  	_pBt.XpageSize = 0
 58774  	if (_zFilename != nil) && (_isMemdb == 0) {
 58775  		_pBt.XautoVacuum = 0
 58776  		_pBt.XincrVacuum = 0
 58777  	}
 58778  	_nReserve = 0
 58779  	goto _59
 58780  _56:
 58781  	_nReserve = *elem15((*uint8)(unsafe.Pointer(&_zDbHeader)), uintptr(20))
 58782  	{
 58783  		p := &_pBt.XbtsFlags
 58784  		*p = uint16(int32(*p) | int32(2))
 58785  	}
 58786  	_pBt.XautoVacuum = uint8(func() int32 {
 58787  		if _sqlite3Get4byte(tls, elem15((*uint8)(unsafe.Pointer(&_zDbHeader)), uintptr(52))) != 0 {
 58788  			return int32(1)
 58789  		}
 58790  		return int32(0)
 58791  	}())
 58792  	_pBt.XincrVacuum = uint8(func() int32 {
 58793  		if _sqlite3Get4byte(tls, elem15((*uint8)(unsafe.Pointer(&_zDbHeader)), uintptr(64))) != 0 {
 58794  			return int32(1)
 58795  		}
 58796  		return int32(0)
 58797  	}())
 58798  _59:
 58799  	_rc = _sqlite3PagerSetPagesize(tls, (*XPager)(_pBt.XpPager), &_pBt.XpageSize, int32(_nReserve))
 58800  	if _rc != 0 {
 58801  		goto _btree_open_out
 58802  	}
 58803  	_pBt.XusableSize = _pBt.XpageSize - uint32(_nReserve)
 58804  	func() {
 58805  		if (_pBt.XpageSize & uint32(7)) != (0) {
 58806  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61424), unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000), unsafe.Pointer(str(76799)))
 58807  			crt.X__builtin_abort(tls)
 58808  		}
 58809  	}()
 58810  	_pBt.XnRef = int32(1)
 58811  	if _p.Xsharable == 0 {
 58812  		goto _67
 58813  	}
 58814  	_22_mutexShared = _sqlite3MutexAlloc(tls, int32(2))
 58815  	if int32(1) == 0 || _sqlite3Config.XbCoreMutex == 0 {
 58816  		goto _69
 58817  	}
 58818  	*(**Xsqlite3_mutex)(unsafe.Pointer(&_pBt.Xmutex)) = _sqlite3MutexAlloc(tls, int32(0))
 58819  	if (*Xsqlite3_mutex)(_pBt.Xmutex) == nil {
 58820  		_rc = _sqlite3NomemError(tls, int32(61436))
 58821  		goto _btree_open_out
 58822  	}
 58823  _69:
 58824  	Xsqlite3_mutex_enter(tls, _22_mutexShared)
 58825  	*(**XBtShared)(unsafe.Pointer(&_pBt.XpNext)) = _sqlite3SharedCacheList
 58826  	_sqlite3SharedCacheList = _pBt
 58827  	bug20530(_sqlite3SharedCacheList)
 58828  	Xsqlite3_mutex_leave(tls, _22_mutexShared)
 58829  _67:
 58830  _49:
 58831  	if _p.Xsharable == 0 {
 58832  		goto _71
 58833  	}
 58834  	_25_i = int32(0)
 58835  _72:
 58836  	if _25_i >= _db.XnDb {
 58837  		goto _75
 58838  	}
 58839  	if store87(&_25_pSib, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_25_i)).XpBt)) == nil || _25_pSib.Xsharable == 0 {
 58840  		goto _77
 58841  	}
 58842  _78:
 58843  	if _25_pSib.XpPrev != nil {
 58844  		_25_pSib = (*XBtree)(_25_pSib.XpPrev)
 58845  		goto _78
 58846  	}
 58847  	if uint32(crt.P2U(_p.XpBt)) < uint32(crt.P2U(_25_pSib.XpBt)) {
 58848  		*(**XBtree)(unsafe.Pointer(&_p.XpNext)) = _25_pSib
 58849  		*(**XBtree)(unsafe.Pointer(&_p.XpPrev)) = nil
 58850  		*(**XBtree)(unsafe.Pointer(&_25_pSib.XpPrev)) = _p
 58851  		goto _81
 58852  	}
 58853  _82:
 58854  	if (_25_pSib.XpNext != nil) && (uint32(crt.P2U((*XBtree)(_25_pSib.XpNext).XpBt)) < uint32(crt.P2U(_p.XpBt))) {
 58855  		_25_pSib = (*XBtree)(_25_pSib.XpNext)
 58856  		goto _82
 58857  	}
 58858  	*(**XBtree)(unsafe.Pointer(&_p.XpNext)) = (*XBtree)(_25_pSib.XpNext)
 58859  	*(**XBtree)(unsafe.Pointer(&_p.XpPrev)) = _25_pSib
 58860  	if _p.XpNext != nil {
 58861  		*(**XBtree)(unsafe.Pointer(&((*XBtree)(_p.XpNext).XpPrev))) = _p
 58862  	}
 58863  	*(**XBtree)(unsafe.Pointer(&_25_pSib.XpNext)) = _p
 58864  _81:
 58865  	goto _75
 58866  _77:
 58867  	_25_i += 1
 58868  	goto _72
 58869  _75:
 58870  _71:
 58871  	*_ppBtree = _p
 58872  _btree_open_out:
 58873  	if _rc == int32(0) {
 58874  		goto _86
 58875  	}
 58876  	if (_pBt != nil) && (_pBt.XpPager != nil) {
 58877  		_sqlite3PagerClose(tls, (*XPager)(_pBt.XpPager), nil)
 58878  	}
 58879  	Xsqlite3_free(tls, unsafe.Pointer(_pBt))
 58880  	Xsqlite3_free(tls, unsafe.Pointer(_p))
 58881  	*_ppBtree = nil
 58882  	goto _89
 58883  _86:
 58884  	if _sqlite3BtreeSchema(tls, _p, int32(0), nil) == nil {
 58885  		_sqlite3PagerSetCachesize(tls, (*XPager)((*XBtShared)(_p.XpBt).XpPager), int32(-2000))
 58886  	}
 58887  	_35_pFile = _sqlite3PagerFile(tls, (*XPager)(_pBt.XpPager))
 58888  	if _35_pFile.XpMethods != nil {
 58889  		_sqlite3OsFileControlHint(tls, _35_pFile, int32(30), unsafe.Pointer(&_pBt.Xdb))
 58890  	}
 58891  _89:
 58892  	if _mutexOpen != nil {
 58893  		func() {
 58894  			if Xsqlite3_mutex_held(tls, _mutexOpen) == 0 {
 58895  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61506), unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000), unsafe.Pointer(str(76822)))
 58896  				crt.X__builtin_abort(tls)
 58897  			}
 58898  		}()
 58899  		Xsqlite3_mutex_leave(tls, _mutexOpen)
 58900  	}
 58901  	func() {
 58902  		if _rc == int32(0) && _sqlite3BtreeConnectionCount(tls, *_ppBtree) <= int32(0) {
 58903  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61509), unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000), unsafe.Pointer(str(76852)))
 58904  			crt.X__builtin_abort(tls)
 58905  		}
 58906  	}()
 58907  	return _rc
 58908  
 58909  	_ = _zDbHeader
 58910  	panic(0)
 58911  }
 58912  
 58913  var _sqlite3BtreeOpenØ00__func__Ø000 [17]int8
 58914  
 58915  func init() {
 58916  	crt.Xstrncpy(nil, &_sqlite3BtreeOpenØ00__func__Ø000[0], str(76909), 17)
 58917  }
 58918  
 58919  func _sqlite3OsFullPathname(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _nPathOut int32, _zPathOut *int8) (r0 int32) {
 58920  	*elem1(_zPathOut, 0) = 0
 58921  	return func() func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int8) int32 {
 58922  		v := _pVfs.XxFullPathname
 58923  		return *(*func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int8) int32)(unsafe.Pointer(&v))
 58924  	}()(tls, _pVfs, _zPath, _nPathOut, _zPathOut)
 58925  }
 58926  
 58927  // C comment
 58928  //  /*
 58929  //  ** Return the VFS structure for the pager.
 58930  //  */
 58931  func _sqlite3PagerVfs(tls *crt.TLS, _pPager *XPager) (r0 *Xsqlite3_vfs) {
 58932  	return (*Xsqlite3_vfs)(_pPager.XpVfs)
 58933  }
 58934  
 58935  // C comment
 58936  //  /*
 58937  //  ** Allocate and initialize a new Pager object and put a pointer to it
 58938  //  ** in *ppPager. The pager should eventually be freed by passing it
 58939  //  ** to sqlite3PagerClose().
 58940  //  **
 58941  //  ** The zFilename argument is the path to the database file to open.
 58942  //  ** If zFilename is NULL then a randomly-named temporary file is created
 58943  //  ** and used as the file to be cached. Temporary files are be deleted
 58944  //  ** automatically when they are closed. If zFilename is ":memory:" then
 58945  //  ** all information is held in cache. It is never written to disk.
 58946  //  ** This can be used to implement an in-memory database.
 58947  //  **
 58948  //  ** The nExtra parameter specifies the number of bytes of space allocated
 58949  //  ** along with each page reference. This space is available to the user
 58950  //  ** via the sqlite3PagerGetExtra() API.  When a new page is allocated, the
 58951  //  ** first 8 bytes of this space are zeroed but the remainder is uninitialized.
 58952  //  ** (The extra space is used by btree as the MemPage object.)
 58953  //  **
 58954  //  ** The flags argument is used to specify properties that affect the
 58955  //  ** operation of the pager. It should be passed some bitwise combination
 58956  //  ** of the PAGER_* flags.
 58957  //  **
 58958  //  ** The vfsFlags parameter is a bitmask to pass to the flags parameter
 58959  //  ** of the xOpen() method of the supplied VFS when opening files.
 58960  //  **
 58961  //  ** If the pager object is allocated and the specified file opened
 58962  //  ** successfully, SQLITE_OK is returned and *ppPager set to point to
 58963  //  ** the new pager object. If an error occurs, *ppPager is set to NULL
 58964  //  ** and error code returned. This function may return SQLITE_NOMEM
 58965  //  ** (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or
 58966  //  ** various SQLITE_IO_XXX errors.
 58967  //  */
 58968  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) {
 58969  	var _rc, _tempFile, _memDb, _readOnly, _journalFileSize, _nPathname, _useJournal, _pcacheSize, _nUri, _10_fout, _11_iDc int32
 58970  	var _szPageDflt uint32
 58971  	var _zPathname, _zUri, _3_z *int8
 58972  	var _pPtr *uint8
 58973  	var _pPager *XPager
 58974  	_pPager = nil
 58975  	_rc = int32(0)
 58976  	_tempFile = int32(0)
 58977  	_memDb = int32(0)
 58978  	_readOnly = int32(0)
 58979  	_zPathname = nil
 58980  	_nPathname = int32(0)
 58981  	_useJournal = bool2int((_flags & int32(1)) == int32(0))
 58982  	_pcacheSize = _sqlite3PcacheSize(tls)
 58983  	_szPageDflt = uint32(4096)
 58984  	_zUri = nil
 58985  	_nUri = int32(0)
 58986  	_journalFileSize = (_sqlite3JournalSize(tls, _pVfs) + int32(7)) & int32(-8)
 58987  	*_ppPager = nil
 58988  	if (_flags & int32(2)) == 0 {
 58989  		goto _0
 58990  	}
 58991  	_memDb = int32(1)
 58992  	if _zFilename == nil || (*elem1(_zFilename, 0)) == 0 {
 58993  		goto _2
 58994  	}
 58995  	_zPathname = _sqlite3DbStrDup(tls, nil, _zFilename)
 58996  	if _zPathname == nil {
 58997  		return _sqlite3NomemError(tls, int32(51601))
 58998  	}
 58999  	_nPathname = _sqlite3Strlen30(tls, _zPathname)
 59000  	_zFilename = nil
 59001  _2:
 59002  _0:
 59003  	if _zFilename == nil || (*elem1(_zFilename, 0)) == 0 {
 59004  		goto _5
 59005  	}
 59006  	_nPathname = _pVfs.XmxPathname + int32(1)
 59007  	_zPathname = (*int8)(_sqlite3DbMallocRaw(tls, nil, uint64(_nPathname*int32(2))))
 59008  	if _zPathname == nil {
 59009  		return _sqlite3NomemError(tls, int32(51617))
 59010  	}
 59011  	*elem1(_zPathname, 0) = 0
 59012  	_rc = _sqlite3OsFullPathname(tls, _pVfs, _zFilename, _nPathname, _zPathname)
 59013  	_nPathname = _sqlite3Strlen30(tls, _zPathname)
 59014  	_3_z = store1(&_zUri, elem1(_zFilename, uintptr(_sqlite3Strlen30(tls, _zFilename)+int32(1))))
 59015  _7:
 59016  	if (*_3_z) != 0 {
 59017  		*(*uintptr)(unsafe.Pointer(&_3_z)) += uintptr(_sqlite3Strlen30(tls, _3_z) + int32(1))
 59018  		*(*uintptr)(unsafe.Pointer(&_3_z)) += uintptr(_sqlite3Strlen30(tls, _3_z) + int32(1))
 59019  		goto _7
 59020  	}
 59021  	_nUri = int32(uintptr(unsafe.Pointer(elem1(_3_z, uintptr(1)))) - uintptr(unsafe.Pointer(_zUri)))
 59022  	func() {
 59023  		if _nUri < int32(0) {
 59024  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51628), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(76926)))
 59025  			crt.X__builtin_abort(tls)
 59026  		}
 59027  	}()
 59028  	if (_rc == int32(0)) && ((_nPathname + int32(8)) > _pVfs.XmxPathname) {
 59029  		_rc = _sqlite3CantopenError(tls, int32(51636))
 59030  	}
 59031  	if _rc != int32(0) {
 59032  		_sqlite3DbFree(tls, nil, unsafe.Pointer(_zPathname))
 59033  		return _rc
 59034  	}
 59035  _5:
 59036  	_pPtr = (*uint8)(_sqlite3MallocZero(tls, uint64((((((((((((uint32(224)+uint32((_pcacheSize+int32(7))&int32(-8)))+uint32((_pVfs.XszOsFile+int32(7))&int32(-8)))+uint32(_journalFileSize*int32(2)))+uint32(_nPathname))+uint32(1))+uint32(_nUri))+uint32(_nPathname))+uint32(8))+uint32(2))+uint32(_nPathname))+uint32(4))+uint32(2))))
 59037  	func() {
 59038  		if (int32(uintptr(crt.U2P(uintptr(_journalFileSize)))) & int32(7)) != int32(0) {
 59039  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51667), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(76934)))
 59040  			crt.X__builtin_abort(tls)
 59041  		}
 59042  	}()
 59043  	if _pPtr == nil {
 59044  		_sqlite3DbFree(tls, nil, unsafe.Pointer(_zPathname))
 59045  		return _sqlite3NomemError(tls, int32(51670))
 59046  	}
 59047  	_pPager = (*XPager)(unsafe.Pointer(_pPtr))
 59048  	*(**XPCache)(unsafe.Pointer(&_pPager.XpPCache)) = (*XPCache)(unsafe.Pointer(store15(func() (**uint8, *uint8) { p := &_pPtr; return p, elem15(*p, uintptr(224)) }())))
 59049  	*(**Xsqlite3_file)(unsafe.Pointer(&_pPager.Xfd)) = (*Xsqlite3_file)(unsafe.Pointer(store15(func() (**uint8, *uint8) {
 59050  		p := &_pPtr
 59051  		return p, elem15(*p, uintptr((_pcacheSize+int32(7))&int32(-8)))
 59052  	}())))
 59053  	*(**Xsqlite3_file)(unsafe.Pointer(&_pPager.Xsjfd)) = (*Xsqlite3_file)(unsafe.Pointer(store15(func() (**uint8, *uint8) {
 59054  		p := &_pPtr
 59055  		return p, elem15(*p, uintptr((_pVfs.XszOsFile+int32(7))&int32(-8)))
 59056  	}())))
 59057  	*(**Xsqlite3_file)(unsafe.Pointer(&_pPager.Xjfd)) = (*Xsqlite3_file)(unsafe.Pointer(store15(func() (**uint8, *uint8) { p := &_pPtr; return p, elem15(*p, uintptr(_journalFileSize)) }())))
 59058  	_pPager.XzFilename = (*int8)(unsafe.Pointer(store15(func() (**uint8, *uint8) { p := &_pPtr; return p, elem15(*p, uintptr(_journalFileSize)) }())))
 59059  	func() {
 59060  		if (int32(uintptr(_pPager.Xjfd)) & int32(7)) != int32(0) {
 59061  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51678), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(76991)))
 59062  			crt.X__builtin_abort(tls)
 59063  		}
 59064  	}()
 59065  	if _zPathname == nil {
 59066  		goto _19
 59067  	}
 59068  	func() {
 59069  		if _nPathname <= int32(0) {
 59070  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51682), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(77025)))
 59071  			crt.X__builtin_abort(tls)
 59072  		}
 59073  	}()
 59074  	_pPager.XzJournal = (*int8)(unsafe.Pointer(store15(func() (**uint8, *uint8) { p := &_pPtr; return p, elem15(*p, uintptr((_nPathname+int32(1))+_nUri)) }())))
 59075  	crt.Xmemcpy(tls, unsafe.Pointer(_pPager.XzFilename), unsafe.Pointer(_zPathname), uint32(_nPathname))
 59076  	if _nUri != 0 {
 59077  		crt.Xmemcpy(tls, unsafe.Pointer(elem1(_pPager.XzFilename, uintptr(_nPathname+int32(1)))), unsafe.Pointer(_zUri), uint32(_nUri))
 59078  	}
 59079  	crt.Xmemcpy(tls, unsafe.Pointer(_pPager.XzJournal), unsafe.Pointer(_zPathname), uint32(_nPathname))
 59080  	crt.Xmemcpy(tls, unsafe.Pointer(elem1(_pPager.XzJournal, uintptr(_nPathname))), unsafe.Pointer(str(77037)), uint32(10))
 59081  	_pPager.XzWal = elem1(_pPager.XzJournal, uintptr((_nPathname+int32(8))+int32(1)))
 59082  	crt.Xmemcpy(tls, unsafe.Pointer(_pPager.XzWal), unsafe.Pointer(_zPathname), uint32(_nPathname))
 59083  	crt.Xmemcpy(tls, unsafe.Pointer(elem1(_pPager.XzWal, uintptr(_nPathname))), unsafe.Pointer(str(77047)), uint32(5))
 59084  	_sqlite3DbFree(tls, nil, unsafe.Pointer(_zPathname))
 59085  _19:
 59086  	*(**Xsqlite3_vfs)(unsafe.Pointer(&_pPager.XpVfs)) = _pVfs
 59087  	_pPager.XvfsFlags = uint32(_vfsFlags)
 59088  	if _zFilename == nil || (*elem1(_zFilename, 0)) == 0 {
 59089  		goto _24
 59090  	}
 59091  	_10_fout = int32(0)
 59092  	_rc = _sqlite3OsOpen(tls, _pVfs, _pPager.XzFilename, (*Xsqlite3_file)(_pPager.Xfd), _vfsFlags, &_10_fout)
 59093  	func() {
 59094  		if _memDb != 0 {
 59095  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51705), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(77053)))
 59096  			crt.X__builtin_abort(tls)
 59097  		}
 59098  	}()
 59099  	_readOnly = _10_fout & int32(1)
 59100  	if _rc != int32(0) {
 59101  		goto _27
 59102  	}
 59103  	_11_iDc = _sqlite3OsDeviceCharacteristics(tls, (*Xsqlite3_file)(_pPager.Xfd))
 59104  	if _readOnly != 0 {
 59105  		goto _28
 59106  	}
 59107  	_setSectorSize(tls, _pPager)
 59108  
 59109  	if _szPageDflt >= _pPager.XsectorSize {
 59110  		goto _29
 59111  	}
 59112  	if _pPager.XsectorSize > uint32(8192) {
 59113  		_szPageDflt = uint32(8192)
 59114  		goto _31
 59115  	}
 59116  	_szPageDflt = _pPager.XsectorSize
 59117  _31:
 59118  _29:
 59119  _28:
 59120  	_pPager.XnoLock = uint8(Xsqlite3_uri_boolean(tls, _zFilename, str(77060), int32(0)))
 59121  	if ((_11_iDc & int32(8192)) != int32(0)) || Xsqlite3_uri_boolean(tls, _zFilename, str(77067), int32(0)) != 0 {
 59122  		_vfsFlags |= int32(1)
 59123  		goto _act_like_temp_file
 59124  	}
 59125  _27:
 59126  	goto _34
 59127  _24:
 59128  _act_like_temp_file:
 59129  	_tempFile = int32(1)
 59130  	_pPager.XeState = uint8(1)
 59131  	_pPager.XeLock = uint8(4)
 59132  	_pPager.XnoLock = uint8(1)
 59133  	_readOnly = _vfsFlags & int32(1)
 59134  _34:
 59135  	if _rc == int32(0) {
 59136  		func() {
 59137  			if int32(_pPager.XmemDb) != int32(0) {
 59138  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51772), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(77077)))
 59139  				crt.X__builtin_abort(tls)
 59140  			}
 59141  		}()
 59142  		_rc = _sqlite3PagerSetPagesize(tls, _pPager, &_szPageDflt, int32(-1))
 59143  	}
 59144  	if _rc == int32(0) {
 59145  		_nExtra = (_nExtra + int32(7)) & int32(-8)
 59146  		func() {
 59147  			if _nExtra < int32(8) || _nExtra >= int32(1000) {
 59148  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51780), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(77094)))
 59149  				crt.X__builtin_abort(tls)
 59150  			}
 59151  		}()
 59152  		_rc = _sqlite3PcacheOpen(tls, int32(_szPageDflt), _nExtra, bool2int(_memDb == 0), func() func(*crt.TLS, unsafe.Pointer, *XPgHdr) int32 {
 59153  			if _memDb == 0 {
 59154  				return _pagerStress
 59155  			}
 59156  			return nil
 59157  		}(), unsafe.Pointer(_pPager), (*XPCache)(_pPager.XpPCache))
 59158  	}
 59159  	if _rc != int32(0) {
 59160  		_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.Xfd))
 59161  		_sqlite3PageFree(tls, unsafe.Pointer(_pPager.XpTmpSpace))
 59162  		Xsqlite3_free(tls, unsafe.Pointer(_pPager))
 59163  		return _rc
 59164  	}
 59165  	_pPager.XuseJournal = uint8(_useJournal)
 59166  	_pPager.XmxPgno = uint32(1073741823)
 59167  	_pPager.XtempFile = uint8(_tempFile)
 59168  	func() {
 59169  		if _tempFile != int32(0) && _tempFile != int32(1) {
 59170  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51808), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(77119)))
 59171  			crt.X__builtin_abort(tls)
 59172  		}
 59173  	}()
 59174  
 59175  	_pPager.XexclusiveMode = uint8(_tempFile)
 59176  	_pPager.XchangeCountDone = _pPager.XtempFile
 59177  	_pPager.XmemDb = uint8(_memDb)
 59178  	_pPager.XreadOnly = uint8(_readOnly)
 59179  	func() {
 59180  		if _useJournal == 0 && _pPager.XtempFile == 0 {
 59181  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51815), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(77195)))
 59182  			crt.X__builtin_abort(tls)
 59183  		}
 59184  	}()
 59185  	_pPager.XnoSync = _pPager.XtempFile
 59186  	if _pPager.XnoSync != 0 {
 59187  		func() {
 59188  			if int32(_pPager.XfullSync) != int32(0) {
 59189  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51818), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(77226)))
 59190  				crt.X__builtin_abort(tls)
 59191  			}
 59192  		}()
 59193  		func() {
 59194  			if int32(_pPager.XextraSync) != int32(0) {
 59195  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51819), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(77246)))
 59196  				crt.X__builtin_abort(tls)
 59197  			}
 59198  		}()
 59199  		func() {
 59200  			if int32(_pPager.XsyncFlags) != int32(0) {
 59201  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51820), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(77267)))
 59202  				crt.X__builtin_abort(tls)
 59203  			}
 59204  		}()
 59205  		func() {
 59206  			if int32(_pPager.XwalSyncFlags) != int32(0) {
 59207  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51821), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(77288)))
 59208  				crt.X__builtin_abort(tls)
 59209  			}
 59210  		}()
 59211  		func() {
 59212  			if int32(_pPager.XckptSyncFlags) != int32(0) {
 59213  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51822), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(77312)))
 59214  				crt.X__builtin_abort(tls)
 59215  			}
 59216  		}()
 59217  		goto _62
 59218  	}
 59219  	_pPager.XfullSync = uint8(1)
 59220  	_pPager.XextraSync = 0
 59221  	_pPager.XsyncFlags = uint8(2)
 59222  	_pPager.XwalSyncFlags = uint8(34)
 59223  	_pPager.XckptSyncFlags = uint8(2)
 59224  _62:
 59225  	_pPager.XnExtra = uint16(_nExtra)
 59226  	_pPager.XjournalSizeLimit = int64(-1)
 59227  	func() {
 59228  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil && _tempFile == 0 {
 59229  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51835), unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000), unsafe.Pointer(str(77337)))
 59230  			crt.X__builtin_abort(tls)
 59231  		}
 59232  	}()
 59233  	_setSectorSize(tls, _pPager)
 59234  	if _useJournal == 0 {
 59235  		_pPager.XjournalMode = uint8(2)
 59236  		goto _68
 59237  	}
 59238  	if _memDb != 0 {
 59239  		_pPager.XjournalMode = uint8(4)
 59240  	}
 59241  _68:
 59242  	*(*func(*crt.TLS, *XPgHdr))(unsafe.Pointer(&_pPager.XxReiniter)) = _xReinit
 59243  	_setGetterMethod(tls, _pPager)
 59244  	*_ppPager = _pPager
 59245  	return int32(0)
 59246  }
 59247  
 59248  // C comment
 59249  //  /*
 59250  //  ** Return the size in bytes of a PCache object.
 59251  //  */
 59252  func _sqlite3PcacheSize(tls *crt.TLS) (r0 int32) {
 59253  	return int32(48)
 59254  }
 59255  
 59256  // C comment
 59257  //  /*
 59258  //  ** Return the number of bytes required to store a JournalFile that uses vfs
 59259  //  ** pVfs to create the underlying on-disk files.
 59260  //  */
 59261  func _sqlite3JournalSize(tls *crt.TLS, _pVfs *Xsqlite3_vfs) (r0 int32) {
 59262  	return func() int32 {
 59263  		if _pVfs.XszOsFile > int32(56) {
 59264  			return _pVfs.XszOsFile
 59265  		}
 59266  		return int32(56)
 59267  	}()
 59268  }
 59269  
 59270  var _sqlite3PagerOpenØ00__func__Ø000 [17]int8
 59271  
 59272  func init() {
 59273  	crt.Xstrncpy(nil, &_sqlite3PagerOpenØ00__func__Ø000[0], str(77368), 17)
 59274  }
 59275  
 59276  // C comment
 59277  //  /*
 59278  //  ** Return a boolean value for a query parameter.
 59279  //  */
 59280  func Xsqlite3_uri_boolean(tls *crt.TLS, _zFilename *int8, _zParam *int8, _bDflt int32) (r0 int32) {
 59281  	var _z *int8
 59282  	_z = Xsqlite3_uri_parameter(tls, _zFilename, _zParam)
 59283  	_bDflt = bool2int(_bDflt != int32(0))
 59284  	return func() int32 {
 59285  		if _z != nil {
 59286  			return int32(_sqlite3GetBoolean(tls, _z, uint8(_bDflt)))
 59287  		}
 59288  		return _bDflt
 59289  	}()
 59290  }
 59291  
 59292  // C comment
 59293  //  /*
 59294  //  ** This is a utility routine, useful to VFS implementations, that checks
 59295  //  ** to see if a database file was a URI that contained a specific query
 59296  //  ** parameter, and if so obtains the value of the query parameter.
 59297  //  **
 59298  //  ** The zFilename argument is the filename pointer passed into the xOpen()
 59299  //  ** method of a VFS implementation.  The zParam argument is the name of the
 59300  //  ** query parameter we seek.  This routine returns the value of the zParam
 59301  //  ** parameter if it exists.  If the parameter does not exist, this routine
 59302  //  ** returns a NULL pointer.
 59303  //  */
 59304  func Xsqlite3_uri_parameter(tls *crt.TLS, _zFilename *int8, _zParam *int8) (r0 *int8) {
 59305  	var _1_x int32
 59306  	if (_zFilename == nil) || (_zParam == nil) {
 59307  		return nil
 59308  	}
 59309  	*(*uintptr)(unsafe.Pointer(&_zFilename)) += uintptr(_sqlite3Strlen30(tls, _zFilename) + int32(1))
 59310  _2:
 59311  	if (*elem1(_zFilename, 0)) == 0 {
 59312  		goto _3
 59313  	}
 59314  	_1_x = crt.Xstrcmp(tls, _zFilename, _zParam)
 59315  	*(*uintptr)(unsafe.Pointer(&_zFilename)) += uintptr(_sqlite3Strlen30(tls, _zFilename) + int32(1))
 59316  	if _1_x == int32(0) {
 59317  		return _zFilename
 59318  	}
 59319  	*(*uintptr)(unsafe.Pointer(&_zFilename)) += uintptr(_sqlite3Strlen30(tls, _zFilename) + int32(1))
 59320  	goto _2
 59321  _3:
 59322  	return nil
 59323  }
 59324  
 59325  // C comment
 59326  //  /*
 59327  //  ** Interpret the given string as a boolean value.
 59328  //  */
 59329  func _sqlite3GetBoolean(tls *crt.TLS, _z *int8, _dflt uint8) (r0 uint8) {
 59330  	return uint8(bool2int(int32(_getSafetyLevel(tls, _z, int32(1), _dflt)) != int32(0)))
 59331  }
 59332  
 59333  // C comment
 59334  //  /*
 59335  //  ** Interpret the given string as a safety level.  Return 0 for OFF,
 59336  //  ** 1 for ON or NORMAL, 2 for FULL, and 3 for EXTRA.  Return 1 for an empty or
 59337  //  ** unrecognized string argument.  The FULL and EXTRA option is disallowed
 59338  //  ** if the omitFull parameter it 1.
 59339  //  **
 59340  //  ** Note that the values returned are one less that the values that
 59341  //  ** should be passed into sqlite3BtreeSetSafetyLevel().  The is done
 59342  //  ** to support legacy SQL code.  The safety level used to be boolean
 59343  //  ** and older scripts may have used numbers 0 for OFF and 1 for ON.
 59344  //  */
 59345  func _getSafetyLevel(tls *crt.TLS, _z *int8, _omitFull int32, _dflt uint8) (r0 uint8) {
 59346  	var _i, _n int32
 59347  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*_z)))) & int32(4)) != 0 {
 59348  		return uint8(_sqlite3Atoi(tls, _z))
 59349  	}
 59350  	_n = _sqlite3Strlen30(tls, _z)
 59351  	_i = int32(0)
 59352  _1:
 59353  	if _i >= int32(8) {
 59354  		goto _4
 59355  	}
 59356  	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))) {
 59357  		return *elem15((*uint8)(unsafe.Pointer(&_getSafetyLevelØ00iValueØ004)), uintptr(_i))
 59358  	}
 59359  	_i += 1
 59360  	goto _1
 59361  _4:
 59362  	return _dflt
 59363  }
 59364  
 59365  var _getSafetyLevelØ00iLengthØ003 [8]uint8
 59366  
 59367  func init() {
 59368  	_getSafetyLevelØ00iLengthØ003 = [8]uint8{2, 2, 3, 5, 3, 4, 5, 4}
 59369  }
 59370  
 59371  var _getSafetyLevelØ00zTextØ001 [25]int8
 59372  
 59373  func init() {
 59374  	crt.Xstrncpy(nil, &_getSafetyLevelØ00zTextØ001[0], str(77385), 25)
 59375  }
 59376  
 59377  var _getSafetyLevelØ00iOffsetØ002 [8]uint8
 59378  
 59379  func init() {
 59380  	_getSafetyLevelØ00iOffsetØ002 = [8]uint8{0, 1, 2, 4, 9, 12, 15, 20}
 59381  }
 59382  
 59383  var _getSafetyLevelØ00iValueØ004 [8]uint8
 59384  
 59385  func init() {
 59386  	_getSafetyLevelØ00iValueØ004 = [8]uint8{1, 0, 0, 0, 1, 1, 3, 2}
 59387  }
 59388  
 59389  // C comment
 59390  //  /*
 59391  //  ** Create a new PCache object. Storage space to hold the object
 59392  //  ** has already been allocated and is passed in as the p pointer.
 59393  //  ** The caller discovers how much space needs to be allocated by
 59394  //  ** calling sqlite3PcacheSize().
 59395  //  **
 59396  //  ** szExtra is some extra space allocated for each page.  The first
 59397  //  ** 8 bytes of the extra space will be zeroed as the page is allocated,
 59398  //  ** but remaining content will be uninitialized.  Though it is opaque
 59399  //  ** to this module, the extra space really ends up being the MemPage
 59400  //  ** structure in the pager.
 59401  //  */
 59402  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) {
 59403  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint32(48))
 59404  	_p.XszPage = int32(1)
 59405  	_p.XszExtra = _szExtra
 59406  	func() {
 59407  		if _szExtra < int32(8) {
 59408  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44428), unsafe.Pointer(&_sqlite3PcacheOpenØ00__func__Ø000), unsafe.Pointer(str(77410)))
 59409  			crt.X__builtin_abort(tls)
 59410  		}
 59411  	}()
 59412  	_p.XbPurgeable = uint8(_bPurgeable)
 59413  	_p.XeCreate = uint8(2)
 59414  	*(*func(*crt.TLS, unsafe.Pointer, *XPgHdr) int32)(unsafe.Pointer(&_p.XxStress)) = _xStress
 59415  	_p.XpStress = _pStress
 59416  	_p.XszCache = int32(100)
 59417  	_p.XszSpill = int32(1)
 59418  	return _sqlite3PcacheSetPageSize(tls, _p, _szPage)
 59419  }
 59420  
 59421  var _sqlite3PcacheOpenØ00__func__Ø000 [18]int8
 59422  
 59423  func init() {
 59424  	crt.Xstrncpy(nil, &_sqlite3PcacheOpenØ00__func__Ø000[0], str(77421), 18)
 59425  }
 59426  
 59427  // C comment
 59428  //  /*
 59429  //  ** This function is called by the pcache layer when it has reached some
 59430  //  ** soft memory limit. The first argument is a pointer to a Pager object
 59431  //  ** (cast as a void*). The pager is always 'purgeable' (not an in-memory
 59432  //  ** database). The second argument is a reference to a page that is
 59433  //  ** currently dirty but has no outstanding references. The page
 59434  //  ** is always associated with the Pager object passed as the first
 59435  //  ** argument.
 59436  //  **
 59437  //  ** The job of this function is to make pPg clean by writing its contents
 59438  //  ** out to the database file, if possible. This may involve syncing the
 59439  //  ** journal file.
 59440  //  **
 59441  //  ** If successful, sqlite3PcacheMakeClean() is called on the page and
 59442  //  ** SQLITE_OK returned. If an IO error occurs while trying to make the
 59443  //  ** page clean, the IO error code is returned. If the page cannot be
 59444  //  ** made clean for some other reason, but no error occurs, then SQLITE_OK
 59445  //  ** is returned by sqlite3PcacheMakeClean() is not called.
 59446  //  */
 59447  func _pagerStress(tls *crt.TLS, _p unsafe.Pointer, _pPg *XPgHdr) (r0 int32) {
 59448  	var _rc int32
 59449  	var _pPager *XPager
 59450  	_pPager = (*XPager)(_p)
 59451  	_rc = int32(0)
 59452  	func() {
 59453  		if (*XPager)(_pPg.XpPager) != _pPager {
 59454  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51451), unsafe.Pointer(&_pagerStressØ00__func__Ø000), unsafe.Pointer(str(18447)))
 59455  			crt.X__builtin_abort(tls)
 59456  		}
 59457  	}()
 59458  	func() {
 59459  		if (int32(_pPg.Xflags) & int32(2)) == 0 {
 59460  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51452), unsafe.Pointer(&_pagerStressØ00__func__Ø000), unsafe.Pointer(str(54011)))
 59461  			crt.X__builtin_abort(tls)
 59462  		}
 59463  	}()
 59464  	if func() int32 {
 59465  		if _pPager.XerrCode != 0 {
 59466  			return func() int32 {
 59467  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51470), unsafe.Pointer(&_pagerStressØ00__func__Ø000), unsafe.Pointer(str(4809)))
 59468  				crt.X__builtin_abort(tls)
 59469  				return int32(1)
 59470  			}()
 59471  		}
 59472  		return int32(0)
 59473  	}() != 0 {
 59474  		return int32(0)
 59475  	}
 59476  	if (_pPager.XdoNotSpill != 0) && (((int32(_pPager.XdoNotSpill) & int32(3)) != int32(0)) || ((int32(_pPg.Xflags) & int32(8)) != int32(0))) {
 59477  		return int32(0)
 59478  	}
 59479  	*(**XPgHdr)(unsafe.Pointer(&_pPg.XpDirty)) = nil
 59480  	if (*XWal)(_pPager.XpWal) == nil {
 59481  		goto _10
 59482  	}
 59483  	_rc = _subjournalPageIfRequired(tls, _pPg)
 59484  	if _rc == int32(0) {
 59485  		_rc = _pagerWalFrames(tls, _pPager, _pPg, 0, int32(0))
 59486  	}
 59487  	goto _12
 59488  _10:
 59489  	if (int32(_pPg.Xflags)&int32(8)) != 0 || (int32(_pPager.XeState) == int32(3)) {
 59490  		_rc = _syncJournal(tls, _pPager, int32(1))
 59491  	}
 59492  	if _rc == int32(0) {
 59493  		func() {
 59494  			if (int32(_pPg.Xflags) & int32(8)) != int32(0) {
 59495  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51499), unsafe.Pointer(&_pagerStressØ00__func__Ø000), unsafe.Pointer(str(77439)))
 59496  				crt.X__builtin_abort(tls)
 59497  			}
 59498  		}()
 59499  		_rc = _pager_write_pagelist(tls, _pPager, _pPg)
 59500  	}
 59501  _12:
 59502  	if _rc == int32(0) {
 59503  		_sqlite3PcacheMakeClean(tls, _pPg)
 59504  	}
 59505  	return _pager_error(tls, _pPager, _rc)
 59506  }
 59507  
 59508  var _pagerStressØ00__func__Ø000 [12]int8
 59509  
 59510  func init() {
 59511  	crt.Xstrncpy(nil, &_pagerStressØ00__func__Ø000[0], str(77471), 12)
 59512  }
 59513  
 59514  // C comment
 59515  //  /*
 59516  //  ** During a rollback, when the pager reloads information into the cache
 59517  //  ** so that the cache is restored to its original state at the start of
 59518  //  ** the transaction, for each page restored this routine is called.
 59519  //  **
 59520  //  ** This routine needs to reset the extra data section at the end of the
 59521  //  ** page to agree with the restored data.
 59522  //  */
 59523  func _pageReinit(tls *crt.TLS, _pData *XPgHdr) {
 59524  	var _pPage *XMemPage
 59525  	_pPage = (*XMemPage)(_sqlite3PagerGetExtra(tls, _pData))
 59526  	func() {
 59527  		if _sqlite3PagerPageRefcount(tls, _pData) <= int32(0) {
 59528  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61180), unsafe.Pointer(&_pageReinitØ00__func__Ø000), unsafe.Pointer(str(77483)))
 59529  			crt.X__builtin_abort(tls)
 59530  		}
 59531  	}()
 59532  	if _pPage.XisInit == 0 {
 59533  		goto _2
 59534  	}
 59535  	func() {
 59536  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 59537  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61182), unsafe.Pointer(&_pageReinitØ00__func__Ø000), unsafe.Pointer(str(20394)))
 59538  			crt.X__builtin_abort(tls)
 59539  		}
 59540  	}()
 59541  	_pPage.XisInit = 0
 59542  	if _sqlite3PagerPageRefcount(tls, _pData) > int32(1) {
 59543  		_btreeInitPage(tls, _pPage)
 59544  	}
 59545  _2:
 59546  }
 59547  
 59548  var _pageReinitØ00__func__Ø000 [11]int8
 59549  
 59550  func init() {
 59551  	crt.Xstrncpy(nil, &_pageReinitØ00__func__Ø000[0], str(77517), 11)
 59552  }
 59553  
 59554  // C comment
 59555  //  /*
 59556  //  ** Change the maximum size of any memory mapping made of the database file.
 59557  //  */
 59558  func _sqlite3PagerSetMmapLimit(tls *crt.TLS, _pPager *XPager, _szMmap int64) {
 59559  	_pPager.XszMmap = _szMmap
 59560  	_pagerFixMaplimit(tls, _pPager)
 59561  }
 59562  
 59563  // C comment
 59564  //  /*
 59565  //  ** Read the first N bytes from the beginning of the file into memory
 59566  //  ** that pDest points to.
 59567  //  **
 59568  //  ** If the pager was opened on a transient file (zFilename==""), or
 59569  //  ** opened on a file less than N bytes in size, the output buffer is
 59570  //  ** zeroed and SQLITE_OK returned. The rationale for this is that this
 59571  //  ** function is used to read database headers, and a new transient or
 59572  //  ** zero sized database has a header than consists entirely of zeroes.
 59573  //  **
 59574  //  ** If any IO error apart from SQLITE_IOERR_SHORT_READ is encountered,
 59575  //  ** the error code is returned to the caller and the contents of the
 59576  //  ** output buffer undefined.
 59577  //  */
 59578  func _sqlite3PagerReadFileheader(tls *crt.TLS, _pPager *XPager, _N int32, _pDest *uint8) (r0 int32) {
 59579  	var _rc int32
 59580  	_rc = int32(0)
 59581  	crt.Xmemset(tls, unsafe.Pointer(_pDest), int32(0), uint32(_N))
 59582  	func() {
 59583  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil && _pPager.XtempFile == 0 {
 59584  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50765), unsafe.Pointer(&_sqlite3PagerReadFileheaderØ00__func__Ø000), unsafe.Pointer(str(19520)))
 59585  			crt.X__builtin_abort(tls)
 59586  		}
 59587  	}()
 59588  	func() {
 59589  		if (*XWal)(_pPager.XpWal) != nil {
 59590  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50771), unsafe.Pointer(&_sqlite3PagerReadFileheaderØ00__func__Ø000), unsafe.Pointer(str(12123)))
 59591  			crt.X__builtin_abort(tls)
 59592  		}
 59593  	}()
 59594  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil {
 59595  		goto _5
 59596  	}
 59597  	_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.Xfd), unsafe.Pointer(_pDest), _N, 0)
 59598  	if _rc == int32(522) {
 59599  		_rc = int32(0)
 59600  	}
 59601  _5:
 59602  	return _rc
 59603  }
 59604  
 59605  var _sqlite3PagerReadFileheaderØ00__func__Ø000 [27]int8
 59606  
 59607  func init() {
 59608  	crt.Xstrncpy(nil, &_sqlite3PagerReadFileheaderØ00__func__Ø000[0], str(77528), 27)
 59609  }
 59610  
 59611  // C comment
 59612  //  /*
 59613  //  ** Set the busy handler function.
 59614  //  **
 59615  //  ** The pager invokes the busy-handler if sqlite3OsLock() returns
 59616  //  ** SQLITE_BUSY when trying to upgrade from no-lock to a SHARED lock,
 59617  //  ** or when trying to upgrade from a RESERVED lock to an EXCLUSIVE
 59618  //  ** lock. It does *not* invoke the busy handler when upgrading from
 59619  //  ** SHARED to RESERVED, or when upgrading from SHARED to EXCLUSIVE
 59620  //  ** (which occurs during hot-journal rollback). Summary:
 59621  //  **
 59622  //  **   Transition                        | Invokes xBusyHandler
 59623  //  **   --------------------------------------------------------
 59624  //  **   NO_LOCK       -> SHARED_LOCK      | Yes
 59625  //  **   SHARED_LOCK   -> RESERVED_LOCK    | No
 59626  //  **   SHARED_LOCK   -> EXCLUSIVE_LOCK   | No
 59627  //  **   RESERVED_LOCK -> EXCLUSIVE_LOCK   | Yes
 59628  //  **
 59629  //  ** If the busy-handler callback returns non-zero, the lock is
 59630  //  ** retried. If it returns zero, then the SQLITE_BUSY error is
 59631  //  ** returned to the caller of the pager API function.
 59632  //  */
 59633  func _sqlite3PagerSetBusyhandler(tls *crt.TLS, _pPager *XPager, _xBusyHandler func(*crt.TLS, unsafe.Pointer) int32, _pBusyHandlerArg unsafe.Pointer) {
 59634  	var _1_ap *unsafe.Pointer
 59635  	_pPager.XxBusyHandler = _xBusyHandler
 59636  	_pPager.XpBusyHandlerArg = _pBusyHandlerArg
 59637  	if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) != nil {
 59638  		_1_ap = (*unsafe.Pointer)(unsafe.Pointer(&_pPager.XxBusyHandler))
 59639  		func() {
 59640  			if *(*uintptr)(unsafe.Pointer(&struct {
 59641  				f func(*crt.TLS, unsafe.Pointer) int32
 59642  			}{func() func(*crt.TLS, unsafe.Pointer) int32 {
 59643  				v := *elem24(_1_ap, 0)
 59644  				return *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&v))
 59645  			}()})) != *(*uintptr)(unsafe.Pointer(&struct {
 59646  				f func(*crt.TLS, unsafe.Pointer) int32
 59647  			}{_xBusyHandler})) {
 59648  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50605), unsafe.Pointer(&_sqlite3PagerSetBusyhandlerØ00__func__Ø000), unsafe.Pointer(str(77555)))
 59649  				crt.X__builtin_abort(tls)
 59650  			}
 59651  		}()
 59652  		func() {
 59653  			if (*elem24(_1_ap, uintptr(1))) != _pBusyHandlerArg {
 59654  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50606), unsafe.Pointer(&_sqlite3PagerSetBusyhandlerØ00__func__Ø000), unsafe.Pointer(str(77595)))
 59655  				crt.X__builtin_abort(tls)
 59656  			}
 59657  		}()
 59658  		_sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pPager.Xfd), int32(15), unsafe.Pointer(_1_ap))
 59659  	}
 59660  }
 59661  
 59662  var _sqlite3PagerSetBusyhandlerØ00__func__Ø000 [27]int8
 59663  
 59664  func init() {
 59665  	crt.Xstrncpy(nil, &_sqlite3PagerSetBusyhandlerØ00__func__Ø000[0], str(77618), 27)
 59666  }
 59667  
 59668  // C comment
 59669  //  /*
 59670  //  ** Return TRUE if the database file is opened read-only.  Return FALSE
 59671  //  ** if the database is (in theory) writable.
 59672  //  */
 59673  func _sqlite3PagerIsreadonly(tls *crt.TLS, _pPager *XPager) (r0 uint8) {
 59674  	return _pPager.XreadOnly
 59675  }
 59676  
 59677  // C comment
 59678  //  /*
 59679  //  ** This function returns a pointer to a blob of memory associated with
 59680  //  ** a single shared-btree. The memory is used by client code for its own
 59681  //  ** purposes (for example, to store a high-level schema associated with
 59682  //  ** the shared-btree). The btree layer manages reference counting issues.
 59683  //  **
 59684  //  ** The first time this is called on a shared-btree, nBytes bytes of memory
 59685  //  ** are allocated, zeroed, and returned to the caller. For each subsequent
 59686  //  ** call the nBytes parameter is ignored and a pointer to the same blob
 59687  //  ** of memory returned.
 59688  //  **
 59689  //  ** If the nBytes parameter is 0 and the blob of memory has not yet been
 59690  //  ** allocated, a null pointer is returned. If the blob has already been
 59691  //  ** allocated, it is returned as normal.
 59692  //  **
 59693  //  ** Just before the shared-btree is closed, the function passed as the
 59694  //  ** xFree argument when the memory allocation was made is invoked on the
 59695  //  ** blob of allocated memory. The xFree function should not call sqlite3_free()
 59696  //  ** on the memory, the btree layer does that.
 59697  //  */
 59698  func _sqlite3BtreeSchema(tls *crt.TLS, _p *XBtree, _nBytes int32, _xFree func(*crt.TLS, unsafe.Pointer)) (r0 unsafe.Pointer) {
 59699  	var _pBt *XBtShared
 59700  	_pBt = (*XBtShared)(_p.XpBt)
 59701  	_sqlite3BtreeEnter(tls, _p)
 59702  	if (_pBt.XpSchema == nil) && _nBytes != 0 {
 59703  		_pBt.XpSchema = _sqlite3DbMallocZero(tls, nil, uint64(_nBytes))
 59704  		_pBt.XxFreeSchema = _xFree
 59705  	}
 59706  	_sqlite3BtreeLeave(tls, _p)
 59707  	return _pBt.XpSchema
 59708  }
 59709  
 59710  // C comment
 59711  //  /*
 59712  //  ** Return the file handle for the database file associated
 59713  //  ** with the pager.  This might return NULL if the file has
 59714  //  ** not yet been opened.
 59715  //  */
 59716  func _sqlite3PagerFile(tls *crt.TLS, _pPager *XPager) (r0 *Xsqlite3_file) {
 59717  	return (*Xsqlite3_file)(_pPager.Xfd)
 59718  }
 59719  
 59720  // C comment
 59721  //  /*
 59722  //  ** Return the number of connections to the BtShared object accessed by
 59723  //  ** the Btree handle passed as the only argument. For private caches
 59724  //  ** this is always 1. For shared caches it may be 1 or greater.
 59725  //  */
 59726  func _sqlite3BtreeConnectionCount(tls *crt.TLS, _p *XBtree) (r0 int32) {
 59727  	return (*XBtShared)(_p.XpBt).XnRef
 59728  }
 59729  
 59730  var _sqlite3VdbeExecØ00vfsFlagsØ006 int32
 59731  
 59732  func init() {
 59733  	_sqlite3VdbeExecØ00vfsFlagsØ006 = int32(1054)
 59734  }
 59735  
 59736  func _sqlite3BtreeCreateTable(tls *crt.TLS, _p *XBtree, _piTable *int32, _flags int32) (r0 int32) {
 59737  	var _rc int32
 59738  	_sqlite3BtreeEnter(tls, _p)
 59739  	_rc = _btreeCreateTable(tls, _p, _piTable, _flags)
 59740  	_sqlite3BtreeLeave(tls, _p)
 59741  	return _rc
 59742  }
 59743  
 59744  // C comment
 59745  //  /*
 59746  //  ** Create a new BTree table.  Write into *piTable the page
 59747  //  ** number for the root page of the new table.
 59748  //  **
 59749  //  ** The type of type is determined by the flags parameter.  Only the
 59750  //  ** following values of flags are currently in use.  Other values for
 59751  //  ** flags might not work:
 59752  //  **
 59753  //  **     BTREE_INTKEY|BTREE_LEAFDATA     Used for SQL tables with rowid keys
 59754  //  **     BTREE_ZERODATA                  Used for SQL indices
 59755  //  */
 59756  func _btreeCreateTable(tls *crt.TLS, _p *XBtree, _piTable *int32, _createTabFlags int32) (r0 int32) {
 59757  	var _rc, _ptfFlags int32
 59758  	var _pgnoRoot, _1_pgnoMove, _4_iPtrPage uint32
 59759  	var _4_eType uint8
 59760  	var _pBt *XBtShared
 59761  	var _pRoot, _1_pPageMove *XMemPage
 59762  	_pBt = (*XBtShared)(_p.XpBt)
 59763  	func() {
 59764  		if _sqlite3BtreeHoldsMutex(tls, _p) == 0 {
 59765  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67483), unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000), unsafe.Pointer(str(17442)))
 59766  			crt.X__builtin_abort(tls)
 59767  		}
 59768  	}()
 59769  	func() {
 59770  		if int32(_pBt.XinTransaction) != int32(2) {
 59771  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67484), unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000), unsafe.Pointer(str(56904)))
 59772  			crt.X__builtin_abort(tls)
 59773  		}
 59774  	}()
 59775  	func() {
 59776  		if (int32(_pBt.XbtsFlags) & int32(1)) != int32(0) {
 59777  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67485), unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000), unsafe.Pointer(str(76015)))
 59778  			crt.X__builtin_abort(tls)
 59779  		}
 59780  	}()
 59781  	if _pBt.XautoVacuum == 0 {
 59782  		goto _6
 59783  	}
 59784  	_invalidateAllOverflowCache(tls, _pBt)
 59785  	_sqlite3BtreeGetMeta(tls, _p, int32(4), &_pgnoRoot)
 59786  	_pgnoRoot += 1
 59787  _7:
 59788  	if (_pgnoRoot == _ptrmapPageno(tls, _pBt, _pgnoRoot)) || (_pgnoRoot == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1))) {
 59789  		_pgnoRoot += 1
 59790  		goto _7
 59791  	}
 59792  	func() {
 59793  		if _pgnoRoot < uint32(3) && _sqlite3Config.XneverCorrupt != int32(0) {
 59794  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67518), unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000), unsafe.Pointer(str(77645)))
 59795  			crt.X__builtin_abort(tls)
 59796  		}
 59797  	}()
 59798  	_rc = _allocateBtreePage(tls, _pBt, &_1_pPageMove, &_1_pgnoMove, _pgnoRoot, uint8(1))
 59799  	if _rc != int32(0) {
 59800  		return _rc
 59801  	}
 59802  	if _1_pgnoMove == _pgnoRoot {
 59803  		goto _14
 59804  	}
 59805  	_4_eType = uint8(0)
 59806  	_4_iPtrPage = uint32(0)
 59807  	_rc = _saveAllCursors(tls, _pBt, 0, nil)
 59808  	_releasePage(tls, _1_pPageMove)
 59809  	if _rc != int32(0) {
 59810  		return _rc
 59811  	}
 59812  	_rc = _btreeGetPage(tls, _pBt, _pgnoRoot, &_pRoot, int32(0))
 59813  	if _rc != int32(0) {
 59814  		return _rc
 59815  	}
 59816  	_rc = _ptrmapGet(tls, _pBt, _pgnoRoot, &_4_eType, &_4_iPtrPage)
 59817  	if (int32(_4_eType) == int32(1)) || (int32(_4_eType) == int32(2)) {
 59818  		_rc = _sqlite3CorruptError(tls, int32(67556))
 59819  	}
 59820  	if _rc != int32(0) {
 59821  		_releasePage(tls, _pRoot)
 59822  		return _rc
 59823  	}
 59824  	func() {
 59825  		if int32(_4_eType) == int32(1) {
 59826  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67562), unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000), unsafe.Pointer(str(77671)))
 59827  			crt.X__builtin_abort(tls)
 59828  		}
 59829  	}()
 59830  	func() {
 59831  		if int32(_4_eType) == int32(2) {
 59832  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67563), unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000), unsafe.Pointer(str(77694)))
 59833  			crt.X__builtin_abort(tls)
 59834  		}
 59835  	}()
 59836  	_rc = _relocatePage(tls, _pBt, _pRoot, _4_eType, _4_iPtrPage, _1_pgnoMove, int32(0))
 59837  	_releasePage(tls, _pRoot)
 59838  	if _rc != int32(0) {
 59839  		return _rc
 59840  	}
 59841  	_rc = _btreeGetPage(tls, _pBt, _pgnoRoot, &_pRoot, int32(0))
 59842  	if _rc != int32(0) {
 59843  		return _rc
 59844  	}
 59845  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pRoot.XpDbPage))
 59846  	if _rc != int32(0) {
 59847  		_releasePage(tls, _pRoot)
 59848  		return _rc
 59849  	}
 59850  	goto _27
 59851  _14:
 59852  	_pRoot = _1_pPageMove
 59853  _27:
 59854  	_ptrmapPut(tls, _pBt, _pgnoRoot, uint8(1), 0, &_rc)
 59855  	if _rc != 0 {
 59856  		_releasePage(tls, _pRoot)
 59857  		return _rc
 59858  	}
 59859  	func() {
 59860  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)((*XMemPage)(_pBt.XpPage1).XpDbPage)) == 0 {
 59861  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67595), unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000), unsafe.Pointer(str(77717)))
 59862  			crt.X__builtin_abort(tls)
 59863  		}
 59864  	}()
 59865  	_rc = _sqlite3BtreeUpdateMeta(tls, _p, int32(4), _pgnoRoot)
 59866  	if func() int32 {
 59867  		if _rc != 0 {
 59868  			return func() int32 {
 59869  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67597), unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000), unsafe.Pointer(str(4809)))
 59870  				crt.X__builtin_abort(tls)
 59871  				return int32(1)
 59872  			}()
 59873  		}
 59874  		return int32(0)
 59875  	}() != 0 {
 59876  		_releasePage(tls, _pRoot)
 59877  		return _rc
 59878  	}
 59879  	goto _34
 59880  _6:
 59881  	_rc = _allocateBtreePage(tls, _pBt, &_pRoot, &_pgnoRoot, uint32(1), 0)
 59882  	if _rc != 0 {
 59883  		return _rc
 59884  	}
 59885  _34:
 59886  	func() {
 59887  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pRoot.XpDbPage)) == 0 {
 59888  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67607), unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000), unsafe.Pointer(str(77763)))
 59889  			crt.X__builtin_abort(tls)
 59890  		}
 59891  	}()
 59892  	if (_createTabFlags & int32(1)) != 0 {
 59893  		_ptfFlags = int32(13)
 59894  		goto _39
 59895  	}
 59896  	_ptfFlags = int32(10)
 59897  _39:
 59898  	_zeroPage(tls, _pRoot, _ptfFlags)
 59899  	_sqlite3PagerUnref(tls, (*XPgHdr)(_pRoot.XpDbPage))
 59900  	func() {
 59901  		if (int32(_pBt.XopenFlags)&int32(4)) != int32(0) && _pgnoRoot != uint32(2) {
 59902  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67615), unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000), unsafe.Pointer(str(77803)))
 59903  			crt.X__builtin_abort(tls)
 59904  		}
 59905  	}()
 59906  	*_piTable = int32(_pgnoRoot)
 59907  	return int32(0)
 59908  }
 59909  
 59910  var _btreeCreateTableØ00__func__Ø000 [17]int8
 59911  
 59912  func init() {
 59913  	crt.Xstrncpy(nil, &_btreeCreateTableØ00__func__Ø000[0], str(77853), 17)
 59914  }
 59915  
 59916  // C comment
 59917  //  /*
 59918  //  ** Initialize the temporary index cursor just opened as a sorter cursor.
 59919  //  **
 59920  //  ** Usually, the sorter module uses the value of (pCsr->pKeyInfo->nField)
 59921  //  ** to determine the number of fields that should be compared from the
 59922  //  ** records being sorted. However, if the value passed as argument nField
 59923  //  ** is non-zero and the sorter is able to guarantee a stable sort, nField
 59924  //  ** is used instead. This is used when sorting records for a CREATE INDEX
 59925  //  ** statement. In this case, keys are always delivered to the sorter in
 59926  //  ** order of the primary key, which happens to be make up the final part
 59927  //  ** of the records being sorted. So if the sort is stable, there is never
 59928  //  ** any reason to compare PK fields and they can be ignored for a small
 59929  //  ** performance boost.
 59930  //  **
 59931  //  ** The sorter can guarantee a stable sort when running in single-threaded
 59932  //  ** mode, but not in multi-threaded mode.
 59933  //  **
 59934  //  ** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
 59935  //  */
 59936  func _sqlite3VdbeSorterInit(tls *crt.TLS, _db *Xsqlite3, _nField int32, _pCsr *XVdbeCursor) (r0 int32) {
 59937  	var _pgsz, _i, _szKeyInfo, _sz, _rc, _nWorker int32
 59938  	var _7_mxCache int64
 59939  	var _7_szPma uint32
 59940  	var _pKeyInfo *XKeyInfo
 59941  	var _pSorter *XVdbeSorter
 59942  	var _6_pTask *XSortSubtask
 59943  	_rc = int32(0)
 59944  	if _sqlite3TempInMemory(tls, _db) != 0 || (_sqlite3Config.XbCoreMutex == int32(0)) {
 59945  		_nWorker = int32(0)
 59946  		goto _2
 59947  	}
 59948  	_nWorker = *elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(11))
 59949  _2:
 59950  	func() {
 59951  		if _pCsr.XpKeyInfo == nil || (*XBtree)(_pCsr.XpBtx) != nil {
 59952  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86975), unsafe.Pointer(&_sqlite3VdbeSorterInitØ00__func__Ø000), unsafe.Pointer(str(77870)))
 59953  			crt.X__builtin_abort(tls)
 59954  		}
 59955  	}()
 59956  	func() {
 59957  		if int32(_pCsr.XeCurType) != int32(1) {
 59958  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86976), unsafe.Pointer(&_sqlite3VdbeSorterInitØ00__func__Ø000), unsafe.Pointer(str(57837)))
 59959  			crt.X__builtin_abort(tls)
 59960  		}
 59961  	}()
 59962  	_szKeyInfo = int32(uint32(24) + (uint32(int32((*XKeyInfo)(_pCsr.XpKeyInfo).XnField)-int32(1)) * uint32(4)))
 59963  	_sz = int32(uint32(124) + (uint32(_nWorker) * uint32(60)))
 59964  	_pSorter = (*XVdbeSorter)(_sqlite3DbMallocZero(tls, _db, uint64(_sz+_szKeyInfo)))
 59965  	*(**XVdbeSorter)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pCsr.Xuc)))) = _pSorter
 59966  	if _pSorter == nil {
 59967  		_rc = _sqlite3NomemError(tls, int32(86983))
 59968  		goto _9
 59969  	}
 59970  	*(**XKeyInfo)(unsafe.Pointer(&_pSorter.XpKeyInfo)) = store65(&_pKeyInfo, (*XKeyInfo)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pSorter))+uintptr(_sz))))))
 59971  	crt.Xmemcpy(tls, unsafe.Pointer(_pKeyInfo), _pCsr.XpKeyInfo, uint32(_szKeyInfo))
 59972  	*(**Xsqlite3)(unsafe.Pointer(&_pKeyInfo.Xdb)) = nil
 59973  	if _nField != 0 && (_nWorker == int32(0)) {
 59974  		{
 59975  			p := &_pKeyInfo.XnXField
 59976  			*p = uint16(int32(*p) + (int32(_pKeyInfo.XnField) - _nField))
 59977  		}
 59978  		_pKeyInfo.XnField = uint16(_nField)
 59979  	}
 59980  	_pSorter.Xpgsz = store2(&_pgsz, _sqlite3BtreeGetPageSize(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), 0).XpBt)))
 59981  	_pSorter.XnTask = uint8(_nWorker + int32(1))
 59982  	_pSorter.XiPrev = uint8(_nWorker - int32(1))
 59983  	_pSorter.XbUseThreads = uint8(bool2int(int32(_pSorter.XnTask) > int32(1)))
 59984  	*(**Xsqlite3)(unsafe.Pointer(&_pSorter.Xdb)) = _db
 59985  	_i = int32(0)
 59986  _12:
 59987  	if _i >= int32(_pSorter.XnTask) {
 59988  		goto _15
 59989  	}
 59990  	_6_pTask = elem78((*XSortSubtask)(unsafe.Pointer(&_pSorter.XaTask)), uintptr(_i))
 59991  	*(**XVdbeSorter)(unsafe.Pointer(&_6_pTask.XpSorter)) = _pSorter
 59992  	_i += 1
 59993  	goto _12
 59994  _15:
 59995  	if _sqlite3TempInMemory(tls, _db) != 0 {
 59996  		goto _16
 59997  	}
 59998  	_7_szPma = _sqlite3Config.XszPma
 59999  	_pSorter.XmnPmaSize = int32(_7_szPma * uint32(_pgsz))
 60000  	_7_mxCache = int64((*XSchema)(elem27((*XDb)(_db.XaDb), 0).XpSchema).Xcache_size)
 60001  	if _7_mxCache < (0) {
 60002  		_7_mxCache = _7_mxCache * int64(-1024)
 60003  		goto _18
 60004  	}
 60005  	_7_mxCache = _7_mxCache * int64(_pgsz)
 60006  _18:
 60007  	_7_mxCache = func() int64 {
 60008  		if _7_mxCache < int64(536870912) {
 60009  			return _7_mxCache
 60010  		}
 60011  		return int64(536870912)
 60012  	}()
 60013  	_pSorter.XmxPmaSize = func() int32 {
 60014  		if _pSorter.XmnPmaSize > int32(_7_mxCache) {
 60015  			return _pSorter.XmnPmaSize
 60016  		}
 60017  		return int32(_7_mxCache)
 60018  	}()
 60019  	if _sqlite3Config.XpScratch != nil {
 60020  		goto _23
 60021  	}
 60022  	func() {
 60023  		if _pSorter.XiMemory != int32(0) {
 60024  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87023), unsafe.Pointer(&_sqlite3VdbeSorterInitØ00__func__Ø000), unsafe.Pointer(str(77902)))
 60025  			crt.X__builtin_abort(tls)
 60026  		}
 60027  	}()
 60028  	_pSorter.XnMemory = _pgsz
 60029  	_pSorter.Xlist.XaMemory = (*uint8)(_sqlite3Malloc(tls, uint64(_pgsz)))
 60030  	if (_pSorter.Xlist.XaMemory) == nil {
 60031  		_rc = _sqlite3NomemError(tls, int32(87026))
 60032  	}
 60033  _23:
 60034  _16:
 60035  	if ((int32(_pKeyInfo.XnField) + int32(_pKeyInfo.XnXField)) < int32(13)) && (((*elem62((**XCollSeq)(unsafe.Pointer(&_pKeyInfo.XaColl)), 0)) == nil) || ((*elem62((**XCollSeq)(unsafe.Pointer(&_pKeyInfo.XaColl)), 0)) == (*XCollSeq)(_db.XpDfltColl))) {
 60036  		_pSorter.XtypeMask = uint8(3)
 60037  	}
 60038  _9:
 60039  	return _rc
 60040  }
 60041  
 60042  var _sqlite3VdbeSorterInitØ00__func__Ø000 [22]int8
 60043  
 60044  func init() {
 60045  	crt.Xstrncpy(nil, &_sqlite3VdbeSorterInitØ00__func__Ø000[0], str(77922), 22)
 60046  }
 60047  
 60048  // C comment
 60049  //  /*
 60050  //  ** Return true if the cursor has a hint specified.  This routine is
 60051  //  ** only used from within assert() statements
 60052  //  */
 60053  func _sqlite3BtreeCursorHasHint(tls *crt.TLS, _pCsr *XBtCursor, _mask uint32) (r0 int32) {
 60054  	return bool2int((uint32(_pCsr.Xhints) & _mask) != (0))
 60055  }
 60056  
 60057  func _sqlite3BtreePrevious(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) {
 60058  	func() {
 60059  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 60060  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64636), unsafe.Pointer(&_sqlite3BtreePreviousØ00__func__Ø000), unsafe.Pointer(str(71986)))
 60061  			crt.X__builtin_abort(tls)
 60062  		}
 60063  	}()
 60064  	func() {
 60065  		if _pRes == nil {
 60066  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64637), unsafe.Pointer(&_sqlite3BtreePreviousØ00__func__Ø000), unsafe.Pointer(str(72910)))
 60067  			crt.X__builtin_abort(tls)
 60068  		}
 60069  	}()
 60070  	func() {
 60071  		if (*_pRes) != int32(0) && (*_pRes) != int32(1) {
 60072  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64638), unsafe.Pointer(&_sqlite3BtreePreviousØ00__func__Ø000), unsafe.Pointer(str(72918)))
 60073  			crt.X__builtin_abort(tls)
 60074  		}
 60075  	}()
 60076  	func() {
 60077  		if _pCur.XskipNext != int32(0) && int32(_pCur.XeState) == int32(1) {
 60078  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64639), unsafe.Pointer(&_sqlite3BtreePreviousØ00__func__Ø000), unsafe.Pointer(str(72939)))
 60079  			crt.X__builtin_abort(tls)
 60080  		}
 60081  	}()
 60082  	*_pRes = int32(0)
 60083  	{
 60084  		p := &_pCur.XcurFlags
 60085  		*p = uint8(int32(*p) & int32(-15))
 60086  	}
 60087  	_pCur.Xinfo.XnSize = 0
 60088  	if ((int32(_pCur.XeState) != int32(1)) || (int32(_pCur.Xix) == int32(0))) || (int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).Xleaf) == int32(0)) {
 60089  		return _btreePrevious(tls, _pCur, _pRes)
 60090  	}
 60091  	_pCur.Xix -= 1
 60092  	return int32(0)
 60093  }
 60094  
 60095  var _sqlite3BtreePreviousØ00__func__Ø000 [21]int8
 60096  
 60097  func init() {
 60098  	crt.Xstrncpy(nil, &_sqlite3BtreePreviousØ00__func__Ø000[0], str(77944), 21)
 60099  }
 60100  
 60101  // C comment
 60102  //  /*
 60103  //  ** Step the cursor to the back to the previous entry in the database.  If
 60104  //  ** successful then set *pRes=0.  If the cursor
 60105  //  ** was already pointing to the first entry in the database before
 60106  //  ** this routine was called, then set *pRes=1.
 60107  //  **
 60108  //  ** The main entry point is sqlite3BtreePrevious().  That routine is optimized
 60109  //  ** for the common case of merely decrementing the cell counter BtCursor.aiIdx
 60110  //  ** to the previous cell on the current page.  The (slower) btreePrevious()
 60111  //  ** helper routine is called when it is necessary to move to a different page
 60112  //  ** or to restore the cursor.
 60113  //  **
 60114  //  ** The calling function will set *pRes to 0 or 1.  The initial *pRes value
 60115  //  ** will be 1 if the cursor being stepped corresponds to an SQL index and
 60116  //  ** if this routine could have been skipped if that SQL index had been
 60117  //  ** a unique index.  Otherwise the caller will have set *pRes to zero.
 60118  //  ** Zero is the common case. The btree implementation is free to use the
 60119  //  ** initial *pRes value as a hint to improve performance, but the current
 60120  //  ** SQLite btree implementation does not. (Note that the comdb2 btree
 60121  //  ** implementation does use this hint, however.)
 60122  //  */
 60123  func _btreePrevious(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) {
 60124  	var _rc, _6_idx int32
 60125  	var _pPage *XMemPage
 60126  	func() {
 60127  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 60128  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64580), unsafe.Pointer(&_btreePreviousØ00__func__Ø000), unsafe.Pointer(str(71986)))
 60129  			crt.X__builtin_abort(tls)
 60130  		}
 60131  	}()
 60132  	func() {
 60133  		if _pRes == nil {
 60134  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64581), unsafe.Pointer(&_btreePreviousØ00__func__Ø000), unsafe.Pointer(str(72910)))
 60135  			crt.X__builtin_abort(tls)
 60136  		}
 60137  	}()
 60138  	func() {
 60139  		if (*_pRes) != int32(0) {
 60140  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64582), unsafe.Pointer(&_btreePreviousØ00__func__Ø000), unsafe.Pointer(str(73004)))
 60141  			crt.X__builtin_abort(tls)
 60142  		}
 60143  	}()
 60144  	func() {
 60145  		if _pCur.XskipNext != int32(0) && int32(_pCur.XeState) == int32(1) {
 60146  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64583), unsafe.Pointer(&_btreePreviousØ00__func__Ø000), unsafe.Pointer(str(72939)))
 60147  			crt.X__builtin_abort(tls)
 60148  		}
 60149  	}()
 60150  	func() {
 60151  		if (int32(_pCur.XcurFlags) & int32(14)) != int32(0) {
 60152  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64584), unsafe.Pointer(&_btreePreviousØ00__func__Ø000), unsafe.Pointer(str(77965)))
 60153  			crt.X__builtin_abort(tls)
 60154  		}
 60155  	}()
 60156  	func() {
 60157  		if int32(_pCur.Xinfo.XnSize) != int32(0) {
 60158  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64585), unsafe.Pointer(&_btreePreviousØ00__func__Ø000), unsafe.Pointer(str(78031)))
 60159  			crt.X__builtin_abort(tls)
 60160  		}
 60161  	}()
 60162  	if int32(_pCur.XeState) == int32(1) {
 60163  		goto _13
 60164  	}
 60165  	_rc = func() int32 {
 60166  		if int32(_pCur.XeState) >= int32(3) {
 60167  			return _btreeRestoreCursorPosition(tls, _pCur)
 60168  		}
 60169  		return int32(0)
 60170  	}()
 60171  	if _rc != int32(0) {
 60172  		return _rc
 60173  	}
 60174  	if int32(0) == int32(_pCur.XeState) {
 60175  		*_pRes = int32(1)
 60176  		return int32(0)
 60177  	}
 60178  	if _pCur.XskipNext == 0 {
 60179  		goto _18
 60180  	}
 60181  	func() {
 60182  		if int32(_pCur.XeState) != int32(1) && int32(_pCur.XeState) != int32(2) {
 60183  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64596), unsafe.Pointer(&_btreePreviousØ00__func__Ø000), unsafe.Pointer(str(73013)))
 60184  			crt.X__builtin_abort(tls)
 60185  		}
 60186  	}()
 60187  	_pCur.XeState = uint8(1)
 60188  	if _pCur.XskipNext < int32(0) {
 60189  		_pCur.XskipNext = int32(0)
 60190  		return int32(0)
 60191  	}
 60192  	_pCur.XskipNext = int32(0)
 60193  _18:
 60194  _13:
 60195  	_pPage = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))
 60196  	func() {
 60197  		if _pPage.XisInit == 0 {
 60198  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64607), unsafe.Pointer(&_btreePreviousØ00__func__Ø000), unsafe.Pointer(str(72793)))
 60199  			crt.X__builtin_abort(tls)
 60200  		}
 60201  	}()
 60202  	if _pPage.Xleaf != 0 {
 60203  		goto _25
 60204  	}
 60205  	_6_idx = int32(_pCur.Xix)
 60206  	_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)))))))))
 60207  	if _rc != 0 {
 60208  		return _rc
 60209  	}
 60210  	_rc = _moveToRightmost(tls, _pCur)
 60211  	goto _27
 60212  _25:
 60213  _28:
 60214  	if int32(_pCur.Xix) != int32(0) {
 60215  		goto _29
 60216  	}
 60217  	if int32(_pCur.XiPage) == int32(0) {
 60218  		_pCur.XeState = 0
 60219  		*_pRes = int32(1)
 60220  		return int32(0)
 60221  	}
 60222  	_moveToParent(tls, _pCur)
 60223  	goto _28
 60224  _29:
 60225  	func() {
 60226  		if int32(_pCur.Xinfo.XnSize) != int32(0) {
 60227  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64622), unsafe.Pointer(&_btreePreviousØ00__func__Ø000), unsafe.Pointer(str(78031)))
 60228  			crt.X__builtin_abort(tls)
 60229  		}
 60230  	}()
 60231  	func() {
 60232  		if (int32(_pCur.XcurFlags) & int32(4)) != int32(0) {
 60233  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64623), unsafe.Pointer(&_btreePreviousØ00__func__Ø000), unsafe.Pointer(str(78051)))
 60234  			crt.X__builtin_abort(tls)
 60235  		}
 60236  	}()
 60237  	_pCur.Xix -= 1
 60238  	_pPage = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))
 60239  	if (_pPage.XintKey != 0) && (_pPage.Xleaf == 0) {
 60240  		_rc = _sqlite3BtreePrevious(tls, _pCur, _pRes)
 60241  		goto _37
 60242  	}
 60243  	_rc = int32(0)
 60244  _37:
 60245  _27:
 60246  	return _rc
 60247  }
 60248  
 60249  var _btreePreviousØ00__func__Ø000 [14]int8
 60250  
 60251  func init() {
 60252  	crt.Xstrncpy(nil, &_btreePreviousØ00__func__Ø000[0], str(78090), 14)
 60253  }
 60254  
 60255  // C comment
 60256  //  /*
 60257  //  ** Move the cursor down to the right-most leaf entry beneath the
 60258  //  ** page to which it is currently pointing.  Notice the difference
 60259  //  ** between moveToLeftmost() and moveToRightmost().  moveToLeftmost()
 60260  //  ** finds the left-most entry beneath the *entry* whereas moveToRightmost()
 60261  //  ** finds the right-most entry beneath the *page*.
 60262  //  **
 60263  //  ** The right-most entry is the one with the largest key - the last
 60264  //  ** key in ascending order.
 60265  //  */
 60266  func _moveToRightmost(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 60267  	var _rc int32
 60268  	var _pgno uint32
 60269  	var _pPage *XMemPage
 60270  	_rc = int32(0)
 60271  	_pPage = nil
 60272  	func() {
 60273  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 60274  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64058), unsafe.Pointer(&_moveToRightmostØ00__func__Ø000), unsafe.Pointer(str(71986)))
 60275  			crt.X__builtin_abort(tls)
 60276  		}
 60277  	}()
 60278  	func() {
 60279  		if int32(_pCur.XeState) != int32(1) {
 60280  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64059), unsafe.Pointer(&_moveToRightmostØ00__func__Ø000), unsafe.Pointer(str(10345)))
 60281  			crt.X__builtin_abort(tls)
 60282  		}
 60283  	}()
 60284  _4:
 60285  	if (store84(&_pPage, *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).Xleaf) != 0 {
 60286  		goto _5
 60287  	}
 60288  	_pgno = _sqlite3Get4byte(tls, elem15(_pPage.XaData, uintptr(int32(_pPage.XhdrOffset)+int32(8))))
 60289  	_pCur.Xix = _pPage.XnCell
 60290  	_rc = _moveToChild(tls, _pCur, _pgno)
 60291  	if _rc != 0 {
 60292  		return _rc
 60293  	}
 60294  	goto _4
 60295  _5:
 60296  	_pCur.Xix = uint16(int32(_pPage.XnCell) - int32(1))
 60297  	func() {
 60298  		if int32(_pCur.Xinfo.XnSize) != int32(0) {
 60299  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64067), unsafe.Pointer(&_moveToRightmostØ00__func__Ø000), unsafe.Pointer(str(78031)))
 60300  			crt.X__builtin_abort(tls)
 60301  		}
 60302  	}()
 60303  	func() {
 60304  		if (int32(_pCur.XcurFlags) & int32(2)) != int32(0) {
 60305  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64068), unsafe.Pointer(&_moveToRightmostØ00__func__Ø000), unsafe.Pointer(str(78104)))
 60306  			crt.X__builtin_abort(tls)
 60307  		}
 60308  	}()
 60309  	return int32(0)
 60310  }
 60311  
 60312  var _moveToRightmostØ00__func__Ø000 [16]int8
 60313  
 60314  func init() {
 60315  	crt.Xstrncpy(nil, &_moveToRightmostØ00__func__Ø000[0], str(78141), 16)
 60316  }
 60317  
 60318  // C comment
 60319  //  /*
 60320  //  ** Return TRUE if the cursor is not pointing at an entry of the table.
 60321  //  **
 60322  //  ** TRUE will be returned after a call to sqlite3BtreeNext() moves
 60323  //  ** past the last entry in the table or sqlite3BtreePrev() moves past
 60324  //  ** the first entry.  TRUE is also returned if the table is empty.
 60325  //  */
 60326  func _sqlite3BtreeEof(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 60327  	return bool2int(int32(1) != int32(_pCur.XeState))
 60328  }
 60329  
 60330  // C comment
 60331  //  /* Move the cursor to the last entry in the table.  Return SQLITE_OK
 60332  //  ** on success.  Set *pRes to 0 if the cursor actually points to something
 60333  //  ** or set *pRes to 1 if the table is empty.
 60334  //  */
 60335  func _sqlite3BtreeLast(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) {
 60336  	var _rc, _1_ii int32
 60337  	func() {
 60338  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 60339  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64102), unsafe.Pointer(&_sqlite3BtreeLastØ00__func__Ø000), unsafe.Pointer(str(71986)))
 60340  			crt.X__builtin_abort(tls)
 60341  		}
 60342  	}()
 60343  	func() {
 60344  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XBtree)(_pCur.XpBtree).Xdb).Xmutex)) == 0 {
 60345  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64103), unsafe.Pointer(&_sqlite3BtreeLastØ00__func__Ø000), unsafe.Pointer(str(72011)))
 60346  			crt.X__builtin_abort(tls)
 60347  		}
 60348  	}()
 60349  	if int32(1) != int32(_pCur.XeState) || (int32(_pCur.XcurFlags)&int32(8)) == int32(0) {
 60350  		goto _5
 60351  	}
 60352  	_1_ii = int32(0)
 60353  _6:
 60354  	if _1_ii >= int32(_pCur.XiPage) {
 60355  		goto _9
 60356  	}
 60357  	func() {
 60358  		if int32(*elem20((*uint16)(unsafe.Pointer(&_pCur.XaiIdx)), uintptr(_1_ii))) != int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_1_ii))).XnCell) {
 60359  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64112), unsafe.Pointer(&_sqlite3BtreeLastØ00__func__Ø000), unsafe.Pointer(str(78157)))
 60360  			crt.X__builtin_abort(tls)
 60361  		}
 60362  	}()
 60363  	_1_ii += 1
 60364  	goto _6
 60365  _9:
 60366  	func() {
 60367  		if int32(_pCur.Xix) != (int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnCell) - int32(1)) {
 60368  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64114), unsafe.Pointer(&_sqlite3BtreeLastØ00__func__Ø000), unsafe.Pointer(str(78198)))
 60369  			crt.X__builtin_abort(tls)
 60370  		}
 60371  	}()
 60372  	func() {
 60373  		if ((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).Xleaf) == 0 {
 60374  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64115), unsafe.Pointer(&_sqlite3BtreeLastØ00__func__Ø000), unsafe.Pointer(str(78243)))
 60375  			crt.X__builtin_abort(tls)
 60376  		}
 60377  	}()
 60378  	return int32(0)
 60379  
 60380  _5:
 60381  	_rc = _moveToRoot(tls, _pCur)
 60382  	if _rc != int32(0) {
 60383  		goto _16
 60384  	}
 60385  	if int32(0) == int32(_pCur.XeState) {
 60386  		func() {
 60387  			if _pCur.XpgnoRoot != (0) && int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnCell) != int32(0) {
 60388  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64123), unsafe.Pointer(&_sqlite3BtreeLastØ00__func__Ø000), unsafe.Pointer(str(72404)))
 60389  				crt.X__builtin_abort(tls)
 60390  			}
 60391  		}()
 60392  		*_pRes = int32(1)
 60393  		goto _21
 60394  	}
 60395  	func() {
 60396  		if int32(_pCur.XeState) != int32(1) {
 60397  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64126), unsafe.Pointer(&_sqlite3BtreeLastØ00__func__Ø000), unsafe.Pointer(str(10345)))
 60398  			crt.X__builtin_abort(tls)
 60399  		}
 60400  	}()
 60401  	*_pRes = int32(0)
 60402  	_rc = _moveToRightmost(tls, _pCur)
 60403  	if _rc == int32(0) {
 60404  		{
 60405  			p := &_pCur.XcurFlags
 60406  			*p = uint8(int32(*p) | int32(8))
 60407  		}
 60408  		goto _25
 60409  	}
 60410  	{
 60411  		p := &_pCur.XcurFlags
 60412  		*p = uint8(int32(*p) & int32(-9))
 60413  	}
 60414  _25:
 60415  _21:
 60416  _16:
 60417  	return _rc
 60418  }
 60419  
 60420  var _sqlite3BtreeLastØ00__func__Ø000 [17]int8
 60421  
 60422  func init() {
 60423  	crt.Xstrncpy(nil, &_sqlite3BtreeLastØ00__func__Ø000[0], str(78275), 17)
 60424  }
 60425  
 60426  // C comment
 60427  //  /*
 60428  //  ** Insert a new record into the BTree.  The content of the new record
 60429  //  ** is described by the pX object.  The pCur cursor is used only to
 60430  //  ** define what table the record should be inserted into, and is left
 60431  //  ** pointing at a random location.
 60432  //  **
 60433  //  ** For a table btree (used for rowid tables), only the pX.nKey value of
 60434  //  ** the key is used. The pX.pKey value must be NULL.  The pX.nKey is the
 60435  //  ** rowid or INTEGER PRIMARY KEY of the row.  The pX.nData,pData,nZero fields
 60436  //  ** hold the content of the row.
 60437  //  **
 60438  //  ** For an index btree (used for indexes and WITHOUT ROWID tables), the
 60439  //  ** key is an arbitrary byte sequence stored in pX.pKey,nKey.  The
 60440  //  ** pX.pData,nData,nZero fields must be zero.
 60441  //  **
 60442  //  ** If the seekResult parameter is non-zero, then a successful call to
 60443  //  ** MovetoUnpacked() to seek cursor pCur to (pKey,nKey) has already
 60444  //  ** been performed.  In other words, if seekResult!=0 then the cursor
 60445  //  ** is currently pointing to a cell that will be adjacent to the cell
 60446  //  ** to be inserted.  If seekResult<0 then pCur points to a cell that is
 60447  //  ** smaller then (pKey,nKey).  If seekResult>0 then pCur points to a cell
 60448  //  ** that is larger than (pKey,nKey).
 60449  //  **
 60450  //  ** If seekResult==0, that means pCur is pointing at some unknown location.
 60451  //  ** In that case, this routine must seek the cursor to the correct insertion
 60452  //  ** point for (pKey,nKey) before doing the insertion.  For index btrees,
 60453  //  ** if pX->nMem is non-zero, then pX->aMem contains pointers to the unpacked
 60454  //  ** key values and pX->aMem can be used instead of pX->pKey to avoid having
 60455  //  ** to decode the key.
 60456  //  */
 60457  func _sqlite3BtreeInsert(tls *crt.TLS, _pCur *XBtCursor, _pX *XBtreePayload, _flags int32, _seekResult int32) (r0 int32) {
 60458  	var _rc, _loc, _szNew, _idx int32
 60459  	var _oldCell, _newCell *uint8
 60460  	var _p *XBtree
 60461  	var _pBt *XBtShared
 60462  	var _9_info XCellInfo
 60463  	var _pPage *XMemPage
 60464  	var _7_r XUnpackedRecord
 60465  	_loc = _seekResult
 60466  	_szNew = int32(0)
 60467  	_p = (*XBtree)(_pCur.XpBtree)
 60468  	_pBt = (*XBtShared)(_p.XpBt)
 60469  	_newCell = nil
 60470  	func() {
 60471  		if (_flags & int32(10)) != _flags {
 60472  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67109), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78292)))
 60473  			crt.X__builtin_abort(tls)
 60474  		}
 60475  	}()
 60476  	if int32(_pCur.XeState) == int32(4) {
 60477  		func() {
 60478  			if _pCur.XskipNext == int32(0) {
 60479  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67112), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(75041)))
 60480  				crt.X__builtin_abort(tls)
 60481  			}
 60482  		}()
 60483  		return _pCur.XskipNext
 60484  	}
 60485  	func() {
 60486  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 60487  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67116), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(71986)))
 60488  			crt.X__builtin_abort(tls)
 60489  		}
 60490  	}()
 60491  	func() {
 60492  		if (int32(_pCur.XcurFlags)&int32(1)) == int32(0) || int32(_pBt.XinTransaction) != int32(2) || (int32(_pBt.XbtsFlags)&int32(1)) != int32(0) {
 60493  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67117), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78343)))
 60494  			crt.X__builtin_abort(tls)
 60495  		}
 60496  	}()
 60497  	func() {
 60498  		if _hasSharedCacheTableLock(tls, _p, _pCur.XpgnoRoot, bool2int((*XKeyInfo)(_pCur.XpKeyInfo) != nil), int32(2)) == 0 {
 60499  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67120), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78453)))
 60500  			crt.X__builtin_abort(tls)
 60501  		}
 60502  	}()
 60503  	func() {
 60504  		if (_pX.XpKey == nil) != ((*XKeyInfo)(_pCur.XpKeyInfo) == nil) {
 60505  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67127), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78518)))
 60506  			crt.X__builtin_abort(tls)
 60507  		}
 60508  	}()
 60509  	if (int32(_pCur.XcurFlags) & int32(32)) == 0 {
 60510  		goto _15
 60511  	}
 60512  	_rc = _saveAllCursors(tls, _pBt, _pCur.XpgnoRoot, _pCur)
 60513  	if _rc != 0 {
 60514  		return _rc
 60515  	}
 60516  _15:
 60517  	if (*XKeyInfo)(_pCur.XpKeyInfo) != nil {
 60518  		goto _17
 60519  	}
 60520  	func() {
 60521  		if _pX.XpKey != nil {
 60522  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67146), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78553)))
 60523  			crt.X__builtin_abort(tls)
 60524  		}
 60525  	}()
 60526  	_invalidateIncrblobCursors(tls, _p, _pCur.XpgnoRoot, _pX.XnKey, int32(0))
 60527  	func() {
 60528  		if (_flags&int32(2)) != int32(0) && ((int32(_pCur.XcurFlags)&int32(2)) == int32(0) || _pX.XnKey != (_pCur.Xinfo.XnKey)) {
 60529  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67153), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78565)))
 60530  			crt.X__builtin_abort(tls)
 60531  		}
 60532  	}()
 60533  	if ((int32(_pCur.XcurFlags) & int32(2)) != int32(0)) && (_pX.XnKey == (_pCur.Xinfo.XnKey)) {
 60534  		_loc = int32(0)
 60535  		goto _27
 60536  	}
 60537  	if _loc != int32(0) {
 60538  		goto _27
 60539  	}
 60540  	_rc = _sqlite3BtreeMovetoUnpacked(tls, _pCur, nil, _pX.XnKey, bool2int(_flags != int32(0)), &_loc)
 60541  	if _rc != 0 {
 60542  		return _rc
 60543  	}
 60544  _27:
 60545  	goto _31
 60546  _17:
 60547  	if _loc != int32(0) || (_flags&int32(2)) != int32(0) {
 60548  		goto _31
 60549  	}
 60550  	if _pX.XnMem != 0 {
 60551  		*(**XKeyInfo)(unsafe.Pointer(&_7_r.XpKeyInfo)) = (*XKeyInfo)(_pCur.XpKeyInfo)
 60552  		*(**XMem)(unsafe.Pointer(&_7_r.XaMem)) = (*XMem)(_pX.XaMem)
 60553  		_7_r.XnField = _pX.XnMem
 60554  		_7_r.Xdefault_rc = 0
 60555  		_7_r.XerrCode = 0
 60556  		_7_r.Xr1 = 0
 60557  		_7_r.Xr2 = 0
 60558  		_7_r.XeqSeen = 0
 60559  		_rc = _sqlite3BtreeMovetoUnpacked(tls, _pCur, &_7_r, 0, bool2int(_flags != int32(0)), &_loc)
 60560  		goto _33
 60561  	}
 60562  	_rc = _btreeMoveto(tls, _pCur, _pX.XpKey, _pX.XnKey, bool2int(_flags != int32(0)), &_loc)
 60563  _33:
 60564  	if _rc != 0 {
 60565  		return _rc
 60566  	}
 60567  _31:
 60568  	func() {
 60569  		if int32(_pCur.XeState) != int32(1) && (int32(_pCur.XeState) != int32(0) || _loc == 0) {
 60570  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67182), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78666)))
 60571  			crt.X__builtin_abort(tls)
 60572  		}
 60573  	}()
 60574  	_pPage = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))
 60575  	func() {
 60576  		if _pPage.XintKey == 0 && _pX.XnKey < (0) {
 60577  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67185), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78734)))
 60578  			crt.X__builtin_abort(tls)
 60579  		}
 60580  	}()
 60581  	func() {
 60582  		if _pPage.Xleaf == 0 && _pPage.XintKey != 0 {
 60583  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67186), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78763)))
 60584  			crt.X__builtin_abort(tls)
 60585  		}
 60586  	}()
 60587  	func() {
 60588  		if _pPage.XisInit == 0 {
 60589  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67191), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(72793)))
 60590  			crt.X__builtin_abort(tls)
 60591  		}
 60592  	}()
 60593  	_newCell = _pBt.XpTmpSpace
 60594  	func() {
 60595  		if _newCell == nil {
 60596  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67193), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78793)))
 60597  			crt.X__builtin_abort(tls)
 60598  		}
 60599  	}()
 60600  	_rc = _fillInCell(tls, _pPage, _newCell, _pX, &_szNew)
 60601  	if _rc != 0 {
 60602  		goto _end_insert
 60603  	}
 60604  	func() {
 60605  		if _szNew != int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 60606  			v := _pPage.XxCellSize
 60607  			return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 60608  		}()(tls, _pPage, _newCell)) {
 60609  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67196), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78804)))
 60610  			crt.X__builtin_abort(tls)
 60611  		}
 60612  	}()
 60613  	func() {
 60614  		if _szNew > int32(_pBt.XpageSize-uint32(8)) {
 60615  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67197), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78844)))
 60616  			crt.X__builtin_abort(tls)
 60617  		}
 60618  	}()
 60619  	_idx = int32(_pCur.Xix)
 60620  	if _loc != int32(0) {
 60621  		goto _54
 60622  	}
 60623  	func() {
 60624  		if _idx >= int32(_pPage.XnCell) {
 60625  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67201), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78871)))
 60626  			crt.X__builtin_abort(tls)
 60627  		}
 60628  	}()
 60629  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage.XpDbPage))
 60630  	if _rc != 0 {
 60631  		goto _end_insert
 60632  	}
 60633  	_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)))))))
 60634  	if _pPage.Xleaf == 0 {
 60635  		crt.Xmemcpy(tls, unsafe.Pointer(_newCell), unsafe.Pointer(_oldCell), uint32(4))
 60636  	}
 60637  	_rc = _clearCell(tls, _pPage, _oldCell, &_9_info)
 60638  	if int32(_9_info.XnSize) != _szNew || uint32(_9_info.XnLocal) != _9_info.XnPayload || _pBt.XautoVacuum != 0 && _szNew >= int32(_pPage.XminLocal) {
 60639  		goto _62
 60640  	}
 60641  	func() {
 60642  		if _rc != int32(0) {
 60643  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67223), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(14967)))
 60644  			crt.X__builtin_abort(tls)
 60645  		}
 60646  	}()
 60647  	if crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_oldCell))+uintptr(_szNew))))) > crt.P2U(unsafe.Pointer(_pPage.XaDataEnd)) {
 60648  		return _sqlite3CorruptError(tls, int32(67224))
 60649  	}
 60650  	crt.Xmemcpy(tls, unsafe.Pointer(_oldCell), unsafe.Pointer(_newCell), uint32(_szNew))
 60651  	return int32(0)
 60652  
 60653  _62:
 60654  	_dropCell(tls, _pPage, _idx, int32(_9_info.XnSize), &_rc)
 60655  	if _rc != 0 {
 60656  		goto _end_insert
 60657  	}
 60658  	goto _72
 60659  _54:
 60660  	if (_loc < int32(0)) && (int32(_pPage.XnCell) > int32(0)) {
 60661  		func() {
 60662  			if _pPage.Xleaf == 0 {
 60663  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67231), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78888)))
 60664  				crt.X__builtin_abort(tls)
 60665  			}
 60666  		}()
 60667  		_idx = int32(preInc76(&_pCur.Xix, uint16(1)))
 60668  		{
 60669  			p := &_pCur.XcurFlags
 60670  			*p = uint8(int32(*p) & int32(-3))
 60671  		}
 60672  		goto _72
 60673  	}
 60674  	func() {
 60675  		if _pPage.Xleaf == 0 {
 60676  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67235), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78888)))
 60677  			crt.X__builtin_abort(tls)
 60678  		}
 60679  	}()
 60680  _72:
 60681  	_insertCell(tls, _pPage, _idx, _newCell, _szNew, nil, 0, &_rc)
 60682  	func() {
 60683  		if int32(_pPage.XnOverflow) != int32(0) && _rc != int32(0) {
 60684  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67238), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78900)))
 60685  			crt.X__builtin_abort(tls)
 60686  		}
 60687  	}()
 60688  	func() {
 60689  		if _rc == int32(0) && int32(_pPage.XnCell) <= int32(0) && int32(_pPage.XnOverflow) <= int32(0) {
 60690  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67239), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78937)))
 60691  			crt.X__builtin_abort(tls)
 60692  		}
 60693  	}()
 60694  	_pCur.Xinfo.XnSize = 0
 60695  	if _pPage.XnOverflow == 0 {
 60696  		goto _82
 60697  	}
 60698  	func() {
 60699  		if _rc != int32(0) {
 60700  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67263), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(14967)))
 60701  			crt.X__builtin_abort(tls)
 60702  		}
 60703  	}()
 60704  	{
 60705  		p := &_pCur.XcurFlags
 60706  		*p = uint8(int32(*p) & int32(-3))
 60707  	}
 60708  	_rc = _balance(tls, _pCur)
 60709  	(*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnOverflow = 0
 60710  	_pCur.XeState = 0
 60711  	if (_flags&int32(2)) == 0 || _rc != int32(0) {
 60712  		goto _86
 60713  	}
 60714  	_rc = _moveToRoot(tls, _pCur)
 60715  	if _pCur.XpKeyInfo == nil {
 60716  		goto _87
 60717  	}
 60718  	func() {
 60719  		if _pCur.XpKey != nil {
 60720  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67276), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(78991)))
 60721  			crt.X__builtin_abort(tls)
 60722  		}
 60723  	}()
 60724  	_pCur.XpKey = _sqlite3Malloc(tls, uint64(_pX.XnKey))
 60725  	if _pCur.XpKey == nil {
 60726  		_rc = int32(7)
 60727  		goto _91
 60728  	}
 60729  	crt.Xmemcpy(tls, _pCur.XpKey, _pX.XpKey, uint32(_pX.XnKey))
 60730  _91:
 60731  _87:
 60732  	_pCur.XeState = uint8(3)
 60733  	_pCur.XnKey = _pX.XnKey
 60734  _86:
 60735  _82:
 60736  	func() {
 60737  		if int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnOverflow) != int32(0) {
 60738  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67288), unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000), unsafe.Pointer(str(79005)))
 60739  			crt.X__builtin_abort(tls)
 60740  		}
 60741  	}()
 60742  _end_insert:
 60743  	return _rc
 60744  }
 60745  
 60746  var _sqlite3BtreeInsertØ00__func__Ø000 [19]int8
 60747  
 60748  func init() {
 60749  	crt.Xstrncpy(nil, &_sqlite3BtreeInsertØ00__func__Ø000[0], str(79045), 19)
 60750  }
 60751  
 60752  // C comment
 60753  //  /*
 60754  //  ** This function is called before modifying the contents of a table
 60755  //  ** to invalidate any incrblob cursors that are open on the
 60756  //  ** row or one of the rows being modified.
 60757  //  **
 60758  //  ** If argument isClearTable is true, then the entire contents of the
 60759  //  ** table is about to be deleted. In this case invalidate all incrblob
 60760  //  ** cursors open on any row within the table with root-page pgnoRoot.
 60761  //  **
 60762  //  ** Otherwise, if argument isClearTable is false, then the row with
 60763  //  ** rowid iRow is being replaced or deleted. In this case invalidate
 60764  //  ** only those incrblob cursors open on that specific row.
 60765  //  */
 60766  func _invalidateIncrblobCursors(tls *crt.TLS, _pBtree *XBtree, _pgnoRoot uint32, _iRow int64, _isClearTable int32) {
 60767  	var _p *XBtCursor
 60768  	if int32(_pBtree.XhasIncrblobCur) == int32(0) {
 60769  		return
 60770  	}
 60771  	func() {
 60772  		if _sqlite3BtreeHoldsMutex(tls, _pBtree) == 0 {
 60773  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59542), unsafe.Pointer(&_invalidateIncrblobCursorsØ00__func__Ø000), unsafe.Pointer(str(79064)))
 60774  			crt.X__builtin_abort(tls)
 60775  		}
 60776  	}()
 60777  	_pBtree.XhasIncrblobCur = 0
 60778  	_p = (*XBtCursor)((*XBtShared)(_pBtree.XpBt).XpCursor)
 60779  _3:
 60780  	if _p == nil {
 60781  		goto _6
 60782  	}
 60783  	if (int32(_p.XcurFlags) & int32(16)) == int32(0) {
 60784  		goto _7
 60785  	}
 60786  	_pBtree.XhasIncrblobCur = uint8(1)
 60787  	if (_p.XpgnoRoot == _pgnoRoot) && (_isClearTable != 0 || ((_p.Xinfo.XnKey) == _iRow)) {
 60788  		_p.XeState = 0
 60789  	}
 60790  _7:
 60791  	_p = (*XBtCursor)(_p.XpNext)
 60792  	goto _3
 60793  _6:
 60794  }
 60795  
 60796  var _invalidateIncrblobCursorsØ00__func__Ø000 [26]int8
 60797  
 60798  func init() {
 60799  	crt.Xstrncpy(nil, &_invalidateIncrblobCursorsØ00__func__Ø000[0], str(79095), 26)
 60800  }
 60801  
 60802  // C comment
 60803  //  /*
 60804  //  ** Create the byte sequence used to represent a cell on page pPage
 60805  //  ** and write that byte sequence into pCell[].  Overflow pages are
 60806  //  ** allocated and filled in as necessary.  The calling procedure
 60807  //  ** is responsible for making sure sufficient space has been allocated
 60808  //  ** for pCell[].
 60809  //  **
 60810  //  ** Note that pCell does not necessary need to point to the pPage->aData
 60811  //  ** area.  pCell might point to some temporary storage.  The cell will
 60812  //  ** be constructed in this temporary area then copied into pPage->aData
 60813  //  ** later.
 60814  //  */
 60815  func _fillInCell(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pX *XBtreePayload, _pnSize *int32) (r0 int32) {
 60816  	var _nPayload, _nSrc, _n, _rc, _spaceLeft, _nHeader, _4_mn int32
 60817  	var _pgnoOvfl, _7_pgnoPtrmap uint32
 60818  	var _10_eType uint8
 60819  	var _pSrc, _pPrior, _pPayload *uint8
 60820  	var _pBt *XBtShared
 60821  	var _5_info XCellInfo
 60822  	var _pOvfl, _pToRelease *XMemPage
 60823  	_pOvfl = nil
 60824  	_pToRelease = nil
 60825  	_pBt = (*XBtShared)(_pPage.XpBt)
 60826  	_pgnoOvfl = uint32(0)
 60827  	func() {
 60828  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 60829  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65233), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(20394)))
 60830  			crt.X__builtin_abort(tls)
 60831  		}
 60832  	}()
 60833  	func() {
 60834  		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 {
 60835  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65237), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(79121)))
 60836  			crt.X__builtin_abort(tls)
 60837  		}
 60838  	}()
 60839  	_nHeader = int32(_pPage.XchildPtrSize)
 60840  	if _pPage.XintKey != 0 {
 60841  		_nPayload = _pX.XnData + _pX.XnZero
 60842  		_pSrc = (*uint8)(_pX.XpData)
 60843  		_nSrc = _pX.XnData
 60844  		func() {
 60845  			if _pPage.XintKeyLeaf == 0 {
 60846  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65246), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(53541)))
 60847  				crt.X__builtin_abort(tls)
 60848  			}
 60849  		}()
 60850  		_nHeader += int32(uint8(func() int32 {
 60851  			if uint32(_nPayload) < uint32(128) {
 60852  				return func() int32 { *elem15(_pCell, uintptr(_nHeader)) = uint8(_nPayload); return int32(1) }()
 60853  			}
 60854  			return _sqlite3PutVarint(tls, elem15(_pCell, uintptr(_nHeader)), uint64(_nPayload))
 60855  		}()))
 60856  		_nHeader += _sqlite3PutVarint(tls, elem15(_pCell, uintptr(_nHeader)), *(*uint64)(unsafe.Pointer(&_pX.XnKey)))
 60857  		goto _11
 60858  	}
 60859  	func() {
 60860  		if _pX.XnKey > int64(2147483647) || _pX.XpKey == nil {
 60861  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65250), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(79222)))
 60862  			crt.X__builtin_abort(tls)
 60863  		}
 60864  	}()
 60865  	_nSrc = store2(&_nPayload, int32(_pX.XnKey))
 60866  	_pSrc = (*uint8)(_pX.XpKey)
 60867  	_nHeader += int32(uint8(func() int32 {
 60868  		if uint32(_nPayload) < uint32(128) {
 60869  			return func() int32 { *elem15(_pCell, uintptr(_nHeader)) = uint8(_nPayload); return int32(1) }()
 60870  		}
 60871  		return _sqlite3PutVarint(tls, elem15(_pCell, uintptr(_nHeader)), uint64(_nPayload))
 60872  	}()))
 60873  _11:
 60874  	if _nPayload > int32(_pPage.XmaxLocal) {
 60875  		goto _17
 60876  	}
 60877  	_n = _nHeader + _nPayload
 60878  	if _n < int32(4) {
 60879  		_n = int32(4)
 60880  	}
 60881  	*_pnSize = _n
 60882  	_spaceLeft = _nPayload
 60883  	_pPrior = _pCell
 60884  	goto _19
 60885  _17:
 60886  	_4_mn = int32(_pPage.XminLocal)
 60887  	_n = int32(uint32(_4_mn) + (uint32(_nPayload-_4_mn) % (((*XBtShared)(_pPage.XpBt).XusableSize) - uint32(4))))
 60888  	if _n > int32(_pPage.XmaxLocal) {
 60889  		_n = _4_mn
 60890  	}
 60891  	_spaceLeft = _n
 60892  	*_pnSize = (_n + _nHeader) + int32(4)
 60893  	_pPrior = elem15(_pCell, uintptr(_nHeader+_n))
 60894  _19:
 60895  	_pPayload = elem15(_pCell, uintptr(_nHeader))
 60896  	func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) {
 60897  		v := _pPage.XxParseCell
 60898  		return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v))
 60899  	}()(tls, _pPage, _pCell, &_5_info)
 60900  	func() {
 60901  		if _nHeader != int32(uintptr(unsafe.Pointer(_5_info.XpPayload))-uintptr(unsafe.Pointer(_pCell))) {
 60902  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65293), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(79258)))
 60903  			crt.X__builtin_abort(tls)
 60904  		}
 60905  	}()
 60906  	func() {
 60907  		if _5_info.XnKey != _pX.XnKey {
 60908  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65294), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(79296)))
 60909  			crt.X__builtin_abort(tls)
 60910  		}
 60911  	}()
 60912  	func() {
 60913  		if (*_pnSize) != int32(_5_info.XnSize) {
 60914  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65295), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(79316)))
 60915  			crt.X__builtin_abort(tls)
 60916  		}
 60917  	}()
 60918  	func() {
 60919  		if _spaceLeft != int32(_5_info.XnLocal) {
 60920  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65296), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(79338)))
 60921  			crt.X__builtin_abort(tls)
 60922  		}
 60923  	}()
 60924  _29:
 60925  	if _nPayload <= int32(0) {
 60926  		goto _30
 60927  	}
 60928  	if _spaceLeft != int32(0) {
 60929  		goto _31
 60930  	}
 60931  	_7_pgnoPtrmap = _pgnoOvfl
 60932  	if _pBt.XautoVacuum == 0 {
 60933  		goto _32
 60934  	}
 60935  _33:
 60936  	_pgnoOvfl += 1
 60937  	if (_ptrmapPageno(tls, _pBt, _pgnoOvfl) == _pgnoOvfl) || (_pgnoOvfl == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1))) {
 60938  		goto _33
 60939  	}
 60940  _32:
 60941  	_rc = _allocateBtreePage(tls, _pBt, &_pOvfl, &_pgnoOvfl, _pgnoOvfl, 0)
 60942  	if _pBt.XautoVacuum == 0 || _rc != int32(0) {
 60943  		goto _36
 60944  	}
 60945  	_10_eType = uint8(func() int32 {
 60946  		if _7_pgnoPtrmap != 0 {
 60947  			return int32(4)
 60948  		}
 60949  		return int32(3)
 60950  	}())
 60951  	_ptrmapPut(tls, _pBt, _pgnoOvfl, _10_eType, _7_pgnoPtrmap, &_rc)
 60952  	if _rc != 0 {
 60953  		_releasePage(tls, _pOvfl)
 60954  	}
 60955  _36:
 60956  	if _rc != 0 {
 60957  		_releasePage(tls, _pToRelease)
 60958  		return _rc
 60959  	}
 60960  	func() {
 60961  		if _pToRelease != nil && _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pToRelease.XpDbPage)) == 0 {
 60962  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65340), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(79363)))
 60963  			crt.X__builtin_abort(tls)
 60964  		}
 60965  	}()
 60966  	func() {
 60967  		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 {
 60968  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65344), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(79425)))
 60969  			crt.X__builtin_abort(tls)
 60970  		}
 60971  	}()
 60972  	_sqlite3Put4byte(tls, _pPrior, _pgnoOvfl)
 60973  	_releasePage(tls, _pToRelease)
 60974  	_pToRelease = _pOvfl
 60975  	_pPrior = _pOvfl.XaData
 60976  	_sqlite3Put4byte(tls, _pPrior, 0)
 60977  	_pPayload = elem15(_pOvfl.XaData, uintptr(4))
 60978  	_spaceLeft = int32(_pBt.XusableSize - uint32(4))
 60979  _31:
 60980  	_n = _nPayload
 60981  	if _n > _spaceLeft {
 60982  		_n = _spaceLeft
 60983  	}
 60984  	func() {
 60985  		if _pToRelease != nil && _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pToRelease.XpDbPage)) == 0 {
 60986  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65360), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(79363)))
 60987  			crt.X__builtin_abort(tls)
 60988  		}
 60989  	}()
 60990  	func() {
 60991  		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 {
 60992  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65364), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(79528)))
 60993  			crt.X__builtin_abort(tls)
 60994  		}
 60995  	}()
 60996  	if _nSrc <= int32(0) {
 60997  		goto _56
 60998  	}
 60999  	if _n > _nSrc {
 61000  		_n = _nSrc
 61001  	}
 61002  	func() {
 61003  		if _pSrc == nil {
 61004  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65369), unsafe.Pointer(&_fillInCellØ00__func__Ø000), unsafe.Pointer(str(79635)))
 61005  			crt.X__builtin_abort(tls)
 61006  		}
 61007  	}()
 61008  	crt.Xmemcpy(tls, unsafe.Pointer(_pPayload), unsafe.Pointer(_pSrc), uint32(_n))
 61009  	goto _60
 61010  _56:
 61011  	crt.Xmemset(tls, unsafe.Pointer(_pPayload), int32(0), uint32(_n))
 61012  _60:
 61013  	_nPayload -= _n
 61014  	*(*uintptr)(unsafe.Pointer(&_pPayload)) += uintptr(_n)
 61015  	*(*uintptr)(unsafe.Pointer(&_pSrc)) += uintptr(_n)
 61016  	_nSrc -= _n
 61017  	_spaceLeft -= _n
 61018  	goto _29
 61019  _30:
 61020  	_releasePage(tls, _pToRelease)
 61021  	return int32(0)
 61022  }
 61023  
 61024  var _fillInCellØ00__func__Ø000 [11]int8
 61025  
 61026  func init() {
 61027  	crt.Xstrncpy(nil, &_fillInCellØ00__func__Ø000[0], str(79640), 11)
 61028  }
 61029  
 61030  // C comment
 61031  //  /*
 61032  //  ** Free any overflow pages associated with the given Cell.  Write the
 61033  //  ** local Cell size (the number of bytes on the original page, omitting
 61034  //  ** overflow) into *pnSize.
 61035  //  */
 61036  func _clearCell(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pInfo *XCellInfo) (r0 int32) {
 61037  	var _rc, _nOvfl int32
 61038  	var _ovflPgno, _ovflPageSize, _3_iNext uint32
 61039  	var _pBt *XBtShared
 61040  	var _3_pOvfl *XMemPage
 61041  	_pBt = (*XBtShared)(_pPage.XpBt)
 61042  	func() {
 61043  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 61044  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65147), unsafe.Pointer(&_clearCellØ00__func__Ø000), unsafe.Pointer(str(20394)))
 61045  			crt.X__builtin_abort(tls)
 61046  		}
 61047  	}()
 61048  	func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) {
 61049  		v := _pPage.XxParseCell
 61050  		return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v))
 61051  	}()(tls, _pPage, _pCell, _pInfo)
 61052  	if uint32(_pInfo.XnLocal) == _pInfo.XnPayload {
 61053  		return int32(0)
 61054  	}
 61055  	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))))) {
 61056  		return _sqlite3CorruptError(tls, int32(65153))
 61057  	}
 61058  	_ovflPgno = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell))+uintptr(_pInfo.XnSize)))))-uintptr(int32(4)))))
 61059  	func() {
 61060  		if _pBt.XusableSize <= uint32(4) {
 61061  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65156), unsafe.Pointer(&_clearCellØ00__func__Ø000), unsafe.Pointer(str(79651)))
 61062  			crt.X__builtin_abort(tls)
 61063  		}
 61064  	}()
 61065  	_ovflPageSize = _pBt.XusableSize - uint32(4)
 61066  	_nOvfl = int32((((_pInfo.XnPayload - uint32(_pInfo.XnLocal)) + _ovflPageSize) - uint32(1)) / _ovflPageSize)
 61067  	func() {
 61068  		if _nOvfl <= int32(0) && (_sqlite3Config.XneverCorrupt != int32(0) || (_pInfo.XnPayload+_ovflPageSize) >= _ovflPageSize) {
 61069  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65159), unsafe.Pointer(&_clearCellØ00__func__Ø000), unsafe.Pointer(str(79671)))
 61070  			crt.X__builtin_abort(tls)
 61071  		}
 61072  	}()
 61073  _10:
 61074  	if postInc2(&_nOvfl, -1) == 0 {
 61075  		goto _11
 61076  	}
 61077  	_3_iNext = 0
 61078  	_3_pOvfl = nil
 61079  	if (_ovflPgno < uint32(2)) || (_ovflPgno > _btreePagecount(tls, _pBt)) {
 61080  		return _sqlite3CorruptError(tls, int32(65169))
 61081  	}
 61082  	if _nOvfl == 0 {
 61083  		goto _14
 61084  	}
 61085  	_rc = _getOverflowPage(tls, _pBt, _ovflPgno, &_3_pOvfl, &_3_iNext)
 61086  	if _rc != 0 {
 61087  		return _rc
 61088  	}
 61089  _14:
 61090  	if ((_3_pOvfl != nil) || (store84(&_3_pOvfl, _btreePageLookup(tls, _pBt, _ovflPgno)) != nil)) && (_sqlite3PagerPageRefcount(tls, (*XPgHdr)(_3_pOvfl.XpDbPage)) != int32(1)) {
 61091  		_rc = _sqlite3CorruptError(tls, int32(65189))
 61092  		goto _19
 61093  	}
 61094  	_rc = _freePage2(tls, _pBt, _3_pOvfl, _ovflPgno)
 61095  _19:
 61096  	if _3_pOvfl != nil {
 61097  		_sqlite3PagerUnref(tls, (*XPgHdr)(_3_pOvfl.XpDbPage))
 61098  	}
 61099  	if _rc != 0 {
 61100  		return _rc
 61101  	}
 61102  	_ovflPgno = _3_iNext
 61103  	goto _10
 61104  _11:
 61105  	return int32(0)
 61106  }
 61107  
 61108  var _clearCellØ00__func__Ø000 [10]int8
 61109  
 61110  func init() {
 61111  	crt.Xstrncpy(nil, &_clearCellØ00__func__Ø000[0], str(79744), 10)
 61112  }
 61113  
 61114  // C comment
 61115  //  /*
 61116  //  ** Retrieve a page from the pager cache. If the requested page is not
 61117  //  ** already in the pager cache return NULL. Initialize the MemPage.pBt and
 61118  //  ** MemPage.aData elements if needed.
 61119  //  */
 61120  func _btreePageLookup(tls *crt.TLS, _pBt *XBtShared, _pgno uint32) (r0 *XMemPage) {
 61121  	var _pDbPage *XPgHdr
 61122  	func() {
 61123  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 61124  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61038), unsafe.Pointer(&_btreePageLookupØ00__func__Ø000), unsafe.Pointer(str(9235)))
 61125  			crt.X__builtin_abort(tls)
 61126  		}
 61127  	}()
 61128  	_pDbPage = _sqlite3PagerLookup(tls, (*XPager)(_pBt.XpPager), _pgno)
 61129  	if _pDbPage != nil {
 61130  		return _btreePageFromDbPage(tls, _pDbPage, _pgno, _pBt)
 61131  	}
 61132  	return nil
 61133  }
 61134  
 61135  var _btreePageLookupØ00__func__Ø000 [16]int8
 61136  
 61137  func init() {
 61138  	crt.Xstrncpy(nil, &_btreePageLookupØ00__func__Ø000[0], str(79754), 16)
 61139  }
 61140  
 61141  // C comment
 61142  //  /*
 61143  //  ** This function is used to add page iPage to the database file free-list.
 61144  //  ** It is assumed that the page is not already a part of the free-list.
 61145  //  **
 61146  //  ** The value passed as the second argument to this function is optional.
 61147  //  ** If the caller happens to have a pointer to the MemPage object
 61148  //  ** corresponding to page iPage handy, it may pass it as the second value.
 61149  //  ** Otherwise, it may pass NULL.
 61150  //  **
 61151  //  ** If a pointer to a MemPage object is passed as the second argument,
 61152  //  ** its reference count is not altered by this function.
 61153  //  */
 61154  func _freePage2(tls *crt.TLS, _pBt *XBtShared, _pMemPage *XMemPage, _iPage uint32) (r0 int32) {
 61155  	var _rc, _nFree int32
 61156  	var _iTrunk, _6_nLeaf uint32
 61157  	var _pTrunk, _pPage1, _pPage *XMemPage
 61158  	_pTrunk = nil
 61159  	_iTrunk = uint32(0)
 61160  	_pPage1 = (*XMemPage)(_pBt.XpPage1)
 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(65005), unsafe.Pointer(&_freePage2Ø00__func__Ø000), unsafe.Pointer(str(9235)))
 61164  			crt.X__builtin_abort(tls)
 61165  		}
 61166  	}()
 61167  	func() {
 61168  		if _sqlite3Config.XneverCorrupt != int32(0) && _iPage <= uint32(1) {
 61169  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65006), unsafe.Pointer(&_freePage2Ø00__func__Ø000), unsafe.Pointer(str(79770)))
 61170  			crt.X__builtin_abort(tls)
 61171  		}
 61172  	}()
 61173  	func() {
 61174  		if _pMemPage != nil && _pMemPage.Xpgno != _iPage {
 61175  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65007), unsafe.Pointer(&_freePage2Ø00__func__Ø000), unsafe.Pointer(str(79792)))
 61176  			crt.X__builtin_abort(tls)
 61177  		}
 61178  	}()
 61179  	if _iPage < uint32(2) {
 61180  		return _sqlite3CorruptError(tls, int32(65009))
 61181  	}
 61182  	if _pMemPage != nil {
 61183  		_pPage = _pMemPage
 61184  		_sqlite3PagerRef(tls, (*XPgHdr)(_pPage.XpDbPage))
 61185  		goto _10
 61186  	}
 61187  	_pPage = _btreePageLookup(tls, _pBt, _iPage)
 61188  _10:
 61189  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage1.XpDbPage))
 61190  	if _rc != 0 {
 61191  		goto _freepage_out
 61192  	}
 61193  	_nFree = int32(_sqlite3Get4byte(tls, elem15(_pPage1.XaData, uintptr(36))))
 61194  	_sqlite3Put4byte(tls, elem15(_pPage1.XaData, uintptr(36)), uint32(_nFree+int32(1)))
 61195  	if (int32(_pBt.XbtsFlags) & int32(4)) == 0 {
 61196  		goto _12
 61197  	}
 61198  	if ((_pPage == nil) && (store2(&_rc, _btreeGetPage(tls, _pBt, _iPage, &_pPage, int32(0))) != int32(0))) || (store2(&_rc, _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage.XpDbPage))) != int32(0)) {
 61199  		goto _freepage_out
 61200  	}
 61201  	crt.Xmemset(tls, unsafe.Pointer(_pPage.XaData), int32(0), (*XBtShared)(_pPage.XpBt).XpageSize)
 61202  _12:
 61203  	if _pBt.XautoVacuum == 0 {
 61204  		goto _16
 61205  	}
 61206  	_ptrmapPut(tls, _pBt, _iPage, uint8(2), 0, &_rc)
 61207  	if _rc != 0 {
 61208  		goto _freepage_out
 61209  	}
 61210  _16:
 61211  	if _nFree == int32(0) {
 61212  		goto _18
 61213  	}
 61214  	_iTrunk = _sqlite3Get4byte(tls, elem15(_pPage1.XaData, uintptr(32)))
 61215  	_rc = _btreeGetPage(tls, _pBt, _iTrunk, &_pTrunk, int32(0))
 61216  	if _rc != int32(0) {
 61217  		goto _freepage_out
 61218  	}
 61219  	_6_nLeaf = _sqlite3Get4byte(tls, elem15(_pTrunk.XaData, uintptr(4)))
 61220  	func() {
 61221  		if _pBt.XusableSize <= uint32(32) {
 61222  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65060), unsafe.Pointer(&_freePage2Ø00__func__Ø000), unsafe.Pointer(str(79827)))
 61223  			crt.X__builtin_abort(tls)
 61224  		}
 61225  	}()
 61226  	if _6_nLeaf > ((_pBt.XusableSize / uint32(4)) - uint32(2)) {
 61227  		_rc = _sqlite3CorruptError(tls, int32(65062))
 61228  		goto _freepage_out
 61229  	}
 61230  	if _6_nLeaf >= ((_pBt.XusableSize / uint32(4)) - uint32(8)) {
 61231  		goto _23
 61232  	}
 61233  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pTrunk.XpDbPage))
 61234  	if _rc != int32(0) {
 61235  		goto _24
 61236  	}
 61237  	_sqlite3Put4byte(tls, elem15(_pTrunk.XaData, uintptr(4)), _6_nLeaf+uint32(1))
 61238  	_sqlite3Put4byte(tls, elem15(_pTrunk.XaData, uintptr(uint32(8)+(_6_nLeaf*uint32(4)))), _iPage)
 61239  	if (_pPage != nil) && ((int32(_pBt.XbtsFlags) & int32(4)) == int32(0)) {
 61240  		_sqlite3PagerDontWrite(tls, (*XPgHdr)(_pPage.XpDbPage))
 61241  	}
 61242  	_rc = _btreeSetHasContent(tls, _pBt, _iPage)
 61243  _24:
 61244  	goto _freepage_out
 61245  _23:
 61246  _18:
 61247  	if (_pPage == nil) && (int32(0) != store2(&_rc, _btreeGetPage(tls, _pBt, _iPage, &_pPage, int32(0)))) {
 61248  		goto _freepage_out
 61249  	}
 61250  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage.XpDbPage))
 61251  	if _rc != int32(0) {
 61252  		goto _freepage_out
 61253  	}
 61254  	_sqlite3Put4byte(tls, _pPage.XaData, _iTrunk)
 61255  	_sqlite3Put4byte(tls, elem15(_pPage.XaData, uintptr(4)), 0)
 61256  	_sqlite3Put4byte(tls, elem15(_pPage1.XaData, uintptr(32)), _iPage)
 61257  _freepage_out:
 61258  	if _pPage != nil {
 61259  		_pPage.XisInit = 0
 61260  	}
 61261  	_releasePage(tls, _pPage)
 61262  	_releasePage(tls, _pTrunk)
 61263  	return _rc
 61264  }
 61265  
 61266  var _freePage2Ø00__func__Ø000 [10]int8
 61267  
 61268  func init() {
 61269  	crt.Xstrncpy(nil, &_freePage2Ø00__func__Ø000[0], str(79846), 10)
 61270  }
 61271  
 61272  // C comment
 61273  //  /*
 61274  //  ** Increment the reference count for page pPg.
 61275  //  */
 61276  func _sqlite3PagerRef(tls *crt.TLS, _pPg *XPgHdr) {
 61277  	_sqlite3PcacheRef(tls, _pPg)
 61278  }
 61279  
 61280  // C comment
 61281  //  /*
 61282  //  ** Increase the reference count of a supplied page by 1.
 61283  //  */
 61284  func _sqlite3PcacheRef(tls *crt.TLS, _p *XPgHdr) {
 61285  	func() {
 61286  		if int32(_p.XnRef) <= int32(0) {
 61287  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44653), unsafe.Pointer(&_sqlite3PcacheRefØ00__func__Ø000), unsafe.Pointer(str(13812)))
 61288  			crt.X__builtin_abort(tls)
 61289  		}
 61290  	}()
 61291  	func() {
 61292  		if _sqlite3PcachePageSanity(tls, _p) == 0 {
 61293  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44654), unsafe.Pointer(&_sqlite3PcacheRefØ00__func__Ø000), unsafe.Pointer(str(13822)))
 61294  			crt.X__builtin_abort(tls)
 61295  		}
 61296  	}()
 61297  	_p.XnRef += 1
 61298  	(*XPCache)(_p.XpCache).XnRefSum += 1
 61299  }
 61300  
 61301  var _sqlite3PcacheRefØ00__func__Ø000 [17]int8
 61302  
 61303  func init() {
 61304  	crt.Xstrncpy(nil, &_sqlite3PcacheRefØ00__func__Ø000[0], str(79856), 17)
 61305  }
 61306  
 61307  // C comment
 61308  //  /*
 61309  //  ** A call to this routine tells the pager that it is not necessary to
 61310  //  ** write the information on page pPg back to the disk, even though
 61311  //  ** that page might be marked as dirty.  This happens, for example, when
 61312  //  ** the page has been added as a leaf of the freelist and so its
 61313  //  ** content no longer matters.
 61314  //  **
 61315  //  ** The overlying software layer calls this routine when all of the data
 61316  //  ** on the given page is unused. The pager marks the page as clean so
 61317  //  ** that it does not get written to disk.
 61318  //  **
 61319  //  ** Tests show that this optimization can quadruple the speed of large
 61320  //  ** DELETE operations.
 61321  //  **
 61322  //  ** This optimization cannot be used with a temp-file, as the page may
 61323  //  ** have been dirty at the start of the transaction. In that case, if
 61324  //  ** memory pressure forces page pPg out of the cache, the data does need
 61325  //  ** to be written out to disk so that it may be read back in if the
 61326  //  ** current transaction is rolled back.
 61327  //  */
 61328  func _sqlite3PagerDontWrite(tls *crt.TLS, _pPg *XPgHdr) {
 61329  	var _pPager *XPager
 61330  	_pPager = (*XPager)(_pPg.XpPager)
 61331  	if ((_pPager.XtempFile == 0) && (int32(_pPg.Xflags)&int32(2)) != 0) && (_pPager.XnSavepoint == int32(0)) {
 61332  		{
 61333  			p := &_pPg.Xflags
 61334  			*p = uint16(int32(*p) | int32(16))
 61335  		}
 61336  		{
 61337  			p := &_pPg.Xflags
 61338  			*p = uint16(int32(*p) & int32(-5))
 61339  		}
 61340  	}
 61341  }
 61342  
 61343  // C comment
 61344  //  /*
 61345  //  ** Set bit pgno of the BtShared.pHasContent bitvec. This is called
 61346  //  ** when a page that previously contained data becomes a free-list leaf
 61347  //  ** page.
 61348  //  **
 61349  //  ** The BtShared.pHasContent bitvec exists to work around an obscure
 61350  //  ** bug caused by the interaction of two useful IO optimizations surrounding
 61351  //  ** free-list leaf pages:
 61352  //  **
 61353  //  **   1) When all data is deleted from a page and the page becomes
 61354  //  **      a free-list leaf page, the page is not written to the database
 61355  //  **      (as free-list leaf pages contain no meaningful data). Sometimes
 61356  //  **      such a page is not even journalled (as it will not be modified,
 61357  //  **      why bother journalling it?).
 61358  //  **
 61359  //  **   2) When a free-list leaf page is reused, its content is not read
 61360  //  **      from the database or written to the journal file (why should it
 61361  //  **      be, if it is not at all meaningful?).
 61362  //  **
 61363  //  ** By themselves, these optimizations work fine and provide a handy
 61364  //  ** performance boost to bulk delete or insert operations. However, if
 61365  //  ** a page is moved to the free-list and then reused within the same
 61366  //  ** transaction, a problem comes up. If the page is not journalled when
 61367  //  ** it is moved to the free-list and it is also not journalled when it
 61368  //  ** is extracted from the free-list and reused, then the original data
 61369  //  ** may be lost. In the event of a rollback, it may not be possible
 61370  //  ** to restore the database to its original configuration.
 61371  //  **
 61372  //  ** The solution is the BtShared.pHasContent bitvec. Whenever a page is
 61373  //  ** moved to become a free-list leaf page, the corresponding bit is
 61374  //  ** set in the bitvec. Whenever a leaf page is extracted from the free-list,
 61375  //  ** optimization 2 above is omitted if the corresponding bit is already
 61376  //  ** set in BtShared.pHasContent. The contents of the bitvec are cleared
 61377  //  ** at the end of every transaction.
 61378  //  */
 61379  func _btreeSetHasContent(tls *crt.TLS, _pBt *XBtShared, _pgno uint32) (r0 int32) {
 61380  	var _rc int32
 61381  	_rc = int32(0)
 61382  	if _pBt.XpHasContent != nil {
 61383  		goto _0
 61384  	}
 61385  	func() {
 61386  		if _pgno > _pBt.XnPage {
 61387  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59597), unsafe.Pointer(&_btreeSetHasContentØ00__func__Ø000), unsafe.Pointer(str(79873)))
 61388  			crt.X__builtin_abort(tls)
 61389  		}
 61390  	}()
 61391  	*(**XBitvec)(unsafe.Pointer(&_pBt.XpHasContent)) = _sqlite3BitvecCreate(tls, _pBt.XnPage)
 61392  	if _pBt.XpHasContent == nil {
 61393  		_rc = _sqlite3NomemError(tls, int32(59600))
 61394  	}
 61395  _0:
 61396  	if (_rc == int32(0)) && (_pgno <= _sqlite3BitvecSize(tls, (*XBitvec)(_pBt.XpHasContent))) {
 61397  		_rc = _sqlite3BitvecSet(tls, (*XBitvec)(_pBt.XpHasContent), _pgno)
 61398  	}
 61399  	return _rc
 61400  }
 61401  
 61402  var _btreeSetHasContentØ00__func__Ø000 [19]int8
 61403  
 61404  func init() {
 61405  	crt.Xstrncpy(nil, &_btreeSetHasContentØ00__func__Ø000[0], str(79890), 19)
 61406  }
 61407  
 61408  // C comment
 61409  //  /*
 61410  //  ** Remove the i-th cell from pPage.  This routine effects pPage only.
 61411  //  ** The cell content is not freed or deallocated.  It is assumed that
 61412  //  ** the cell content has been copied someplace else.  This routine just
 61413  //  ** removes the reference to the cell from pPage.
 61414  //  **
 61415  //  ** "sz" must be the number of bytes in the cell.
 61416  //  */
 61417  func _dropCell(tls *crt.TLS, _pPage *XMemPage, _idx int32, _sz int32, _pRC *int32) {
 61418  	var _rc, _hdr int32
 61419  	var _pc uint32
 61420  	var _data, _ptr *uint8
 61421  	if (*_pRC) != 0 {
 61422  		return
 61423  	}
 61424  	func() {
 61425  		if _idx < int32(0) || _idx >= int32(_pPage.XnCell) {
 61426  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65400), unsafe.Pointer(&_dropCellØ00__func__Ø000), unsafe.Pointer(str(79909)))
 61427  			crt.X__builtin_abort(tls)
 61428  		}
 61429  	}()
 61430  	func() {
 61431  		if _sqlite3Config.XneverCorrupt != int32(0) && _sz != int32(_cellSize(tls, _pPage, _idx)) {
 61432  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65401), unsafe.Pointer(&_dropCellØ00__func__Ø000), unsafe.Pointer(str(79936)))
 61433  			crt.X__builtin_abort(tls)
 61434  		}
 61435  	}()
 61436  	func() {
 61437  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.XpDbPage)) == 0 {
 61438  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65402), unsafe.Pointer(&_dropCellØ00__func__Ø000), unsafe.Pointer(str(53310)))
 61439  			crt.X__builtin_abort(tls)
 61440  		}
 61441  	}()
 61442  	func() {
 61443  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 61444  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65403), unsafe.Pointer(&_dropCellØ00__func__Ø000), unsafe.Pointer(str(20394)))
 61445  			crt.X__builtin_abort(tls)
 61446  		}
 61447  	}()
 61448  	_data = _pPage.XaData
 61449  	_ptr = elem15(_pPage.XaCellIdx, uintptr(int32(2)*_idx))
 61450  	_pc = uint32((int32(*elem15(_ptr, 0)) << 8) | int32(*elem15(_ptr, uintptr(1))))
 61451  	_hdr = int32(_pPage.XhdrOffset)
 61452  	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)) {
 61453  		*_pRC = _sqlite3CorruptError(tls, int32(65411))
 61454  		return
 61455  	}
 61456  	_rc = _freeSpace(tls, _pPage, uint16(_pc), uint16(_sz))
 61457  	if _rc != 0 {
 61458  		*_pRC = _rc
 61459  		return
 61460  	}
 61461  	_pPage.XnCell -= 1
 61462  	if int32(_pPage.XnCell) == int32(0) {
 61463  		crt.Xmemset(tls, unsafe.Pointer(elem15(_data, uintptr(_hdr+int32(1)))), int32(0), uint32(4))
 61464  		*elem15(_data, uintptr(_hdr+int32(7))) = 0
 61465  		*elem15(elem15(func() *uint8 {
 61466  			*elem15(elem15(_data, uintptr(_hdr+int32(5))), 0) = uint8(((*XBtShared)(_pPage.XpBt).XusableSize) >> 8)
 61467  			return _data
 61468  		}(), uintptr(_hdr+int32(5))), uintptr(1)) = uint8((*XBtShared)(_pPage.XpBt).XusableSize)
 61469  		_pPage.XnFree = uint16(((((*XBtShared)(_pPage.XpBt).XusableSize) - uint32(_pPage.XhdrOffset)) - uint32(_pPage.XchildPtrSize)) - uint32(8))
 61470  		goto _15
 61471  	}
 61472  	crt.Xmemmove(tls, unsafe.Pointer(_ptr), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_ptr))+uintptr(int32(2))))), uint32(int32(2)*(int32(_pPage.XnCell)-_idx)))
 61473  	*elem15(elem15(func() *uint8 {
 61474  		*elem15(elem15(_data, uintptr(_hdr+int32(3))), 0) = uint8(int32(_pPage.XnCell) >> 8)
 61475  		return _data
 61476  	}(), uintptr(_hdr+int32(3))), uintptr(1)) = uint8(_pPage.XnCell)
 61477  	{
 61478  		p := &_pPage.XnFree
 61479  		*p = uint16(int32(*p) + int32(2))
 61480  	}
 61481  _15:
 61482  }
 61483  
 61484  var _dropCellØ00__func__Ø000 [9]int8
 61485  
 61486  func init() {
 61487  	crt.Xstrncpy(nil, &_dropCellØ00__func__Ø000[0], str(79975), 9)
 61488  }
 61489  
 61490  // C comment
 61491  //  /* This variation on cellSizePtr() is used inside of assert() statements
 61492  //  ** only. */
 61493  func _cellSize(tls *crt.TLS, _pPage *XMemPage, _iCell int32) (r0 uint16) {
 61494  	return func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 61495  		v := _pPage.XxCellSize
 61496  		return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 61497  	}()(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))))))))
 61498  }
 61499  
 61500  // C comment
 61501  //  /*
 61502  //  ** Return a section of the pPage->aData to the freelist.
 61503  //  ** The first byte of the new free block is pPage->aData[iStart]
 61504  //  ** and the size of the block is iSize bytes.
 61505  //  **
 61506  //  ** Adjacent freeblocks are coalesced.
 61507  //  **
 61508  //  ** Note that even though the freeblock list was checked by btreeInitPage(),
 61509  //  ** that routine will not detect overlap between cells or freeblocks.  Nor
 61510  //  ** does it detect cells or freeblocks that encrouch into the reserved bytes
 61511  //  ** at the end of the page.  So do additional corruption checks inside this
 61512  //  ** routine and return SQLITE_CORRUPT if any problems are found.
 61513  //  */
 61514  func _freeSpace(tls *crt.TLS, _pPage *XMemPage, _iStart uint16, _iSize uint16) (r0 int32) {
 61515  	var _7_iPtrEnd int32
 61516  	var _iLast, _iEnd uint32
 61517  	var _iPtr, _iFreeBlk, _iOrigSize uint16
 61518  	var _hdr, _nFrag uint8
 61519  	var _data *uint8
 61520  	_nFrag = uint8(0)
 61521  	_iOrigSize = _iSize
 61522  	_iLast = ((*XBtShared)(_pPage.XpBt).XusableSize) - uint32(4)
 61523  	_iEnd = uint32(int32(_iStart) + int32(_iSize))
 61524  	_data = _pPage.XaData
 61525  	func() {
 61526  		if (*XBtShared)(_pPage.XpBt) == nil {
 61527  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60667), unsafe.Pointer(&_freeSpaceØ00__func__Ø000), unsafe.Pointer(str(55336)))
 61528  			crt.X__builtin_abort(tls)
 61529  		}
 61530  	}()
 61531  	func() {
 61532  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.XpDbPage)) == 0 {
 61533  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60668), unsafe.Pointer(&_freeSpaceØ00__func__Ø000), unsafe.Pointer(str(53310)))
 61534  			crt.X__builtin_abort(tls)
 61535  		}
 61536  	}()
 61537  	func() {
 61538  		if _sqlite3Config.XneverCorrupt != int32(0) && int32(_iStart) < ((int32(_pPage.XhdrOffset)+int32(6))+int32(_pPage.XchildPtrSize)) {
 61539  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60669), unsafe.Pointer(&_freeSpaceØ00__func__Ø000), unsafe.Pointer(str(79984)))
 61540  			crt.X__builtin_abort(tls)
 61541  		}
 61542  	}()
 61543  	func() {
 61544  		if _sqlite3Config.XneverCorrupt != int32(0) && _iEnd > ((*XBtShared)(_pPage.XpBt).XusableSize) {
 61545  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60670), unsafe.Pointer(&_freeSpaceØ00__func__Ø000), unsafe.Pointer(str(80045)))
 61546  			crt.X__builtin_abort(tls)
 61547  		}
 61548  	}()
 61549  	func() {
 61550  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 61551  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60671), unsafe.Pointer(&_freeSpaceØ00__func__Ø000), unsafe.Pointer(str(20394)))
 61552  			crt.X__builtin_abort(tls)
 61553  		}
 61554  	}()
 61555  	func() {
 61556  		if int32(_iSize) < int32(4) {
 61557  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60672), unsafe.Pointer(&_freeSpaceØ00__func__Ø000), unsafe.Pointer(str(80090)))
 61558  			crt.X__builtin_abort(tls)
 61559  		}
 61560  	}()
 61561  	func() {
 61562  		if uint32(_iStart) > _iLast {
 61563  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60673), unsafe.Pointer(&_freeSpaceØ00__func__Ø000), unsafe.Pointer(str(80099)))
 61564  			crt.X__builtin_abort(tls)
 61565  		}
 61566  	}()
 61567  	if (int32((*XBtShared)(_pPage.XpBt).XbtsFlags) & int32(4)) != 0 {
 61568  		crt.Xmemset(tls, unsafe.Pointer(elem15(_data, uintptr(_iStart))), int32(0), uint32(_iSize))
 61569  	}
 61570  	_hdr = _pPage.XhdrOffset
 61571  	_iPtr = uint16(int32(_hdr) + int32(1))
 61572  	if (int32(*elem15(_data, uintptr(int32(_iPtr)+int32(1)))) == int32(0)) && (int32(*elem15(_data, uintptr(_iPtr))) == int32(0)) {
 61573  		_iFreeBlk = 0
 61574  		goto _19
 61575  	}
 61576  _20:
 61577  	if int32(store76(&_iFreeBlk, uint16((int32(*elem15(elem15(_data, uintptr(_iPtr)), 0))<<8)|int32(*elem15(elem15(_data, uintptr(_iPtr)), uintptr(1)))))) >= int32(_iStart) {
 61578  		goto _21
 61579  	}
 61580  	if int32(_iFreeBlk) >= (int32(_iPtr) + int32(4)) {
 61581  		goto _22
 61582  	}
 61583  	if int32(_iFreeBlk) == int32(0) {
 61584  		goto _21
 61585  	}
 61586  	return _sqlite3CorruptError(tls, int32(60692))
 61587  
 61588  _22:
 61589  	_iPtr = _iFreeBlk
 61590  	goto _20
 61591  _21:
 61592  	if uint32(_iFreeBlk) > _iLast {
 61593  		return _sqlite3CorruptError(tls, int32(60696))
 61594  	}
 61595  	func() {
 61596  		if int32(_iFreeBlk) <= int32(_iPtr) && int32(_iFreeBlk) != int32(0) {
 61597  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60697), unsafe.Pointer(&_freeSpaceØ00__func__Ø000), unsafe.Pointer(str(80113)))
 61598  			crt.X__builtin_abort(tls)
 61599  		}
 61600  	}()
 61601  	if _iFreeBlk == 0 || (_iEnd+uint32(3)) < uint32(_iFreeBlk) {
 61602  		goto _29
 61603  	}
 61604  	_nFrag = uint8(uint32(_iFreeBlk) - _iEnd)
 61605  	if _iEnd > uint32(_iFreeBlk) {
 61606  		return _sqlite3CorruptError(tls, int32(60707))
 61607  	}
 61608  	_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)))))
 61609  	if _iEnd > ((*XBtShared)(_pPage.XpBt).XusableSize) {
 61610  		return _sqlite3CorruptError(tls, int32(60709))
 61611  	}
 61612  	_iSize = uint16(_iEnd - uint32(_iStart))
 61613  	_iFreeBlk = uint16((int32(*elem15(elem15(_data, uintptr(_iFreeBlk)), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_iFreeBlk)), uintptr(1))))
 61614  _29:
 61615  	if int32(_iPtr) <= (int32(_hdr) + int32(1)) {
 61616  		goto _32
 61617  	}
 61618  	_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))))
 61619  	if (_7_iPtrEnd + int32(3)) < int32(_iStart) {
 61620  		goto _33
 61621  	}
 61622  	if _7_iPtrEnd > int32(_iStart) {
 61623  		return _sqlite3CorruptError(tls, int32(60721))
 61624  	}
 61625  	{
 61626  		p := &_nFrag
 61627  		*p = uint8(int32(*p) + (int32(_iStart) - _7_iPtrEnd))
 61628  	}
 61629  	_iSize = uint16(_iEnd - uint32(_iPtr))
 61630  	_iStart = _iPtr
 61631  _33:
 61632  _32:
 61633  	if int32(_nFrag) > int32(*elem15(_data, uintptr(int32(_hdr)+int32(7)))) {
 61634  		return _sqlite3CorruptError(tls, int32(60727))
 61635  	}
 61636  	{
 61637  		p := elem15(_data, uintptr(int32(_hdr)+int32(7)))
 61638  		*p = uint8(int32(*p) - int32(_nFrag))
 61639  	}
 61640  _19:
 61641  	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)))) {
 61642  		goto _36
 61643  	}
 61644  	if int32(_iPtr) != (int32(_hdr) + int32(1)) {
 61645  		return _sqlite3CorruptError(tls, int32(60734))
 61646  	}
 61647  	*elem15(elem15(func() *uint8 {
 61648  		*elem15(elem15(_data, uintptr(int32(_hdr)+int32(1))), 0) = uint8(int32(_iFreeBlk) >> 8)
 61649  		return _data
 61650  	}(), uintptr(int32(_hdr)+int32(1))), uintptr(1)) = uint8(_iFreeBlk)
 61651  	*elem15(elem15(func() *uint8 {
 61652  		*elem15(elem15(_data, uintptr(int32(_hdr)+int32(5))), 0) = uint8(_iEnd >> 8)
 61653  		return _data
 61654  	}(), uintptr(int32(_hdr)+int32(5))), uintptr(1)) = uint8(_iEnd)
 61655  	goto _38
 61656  _36:
 61657  	*elem15(elem15(func() *uint8 { *elem15(elem15(_data, uintptr(_iPtr)), 0) = uint8(int32(_iStart) >> 8); return _data }(), uintptr(_iPtr)), uintptr(1)) = uint8(_iStart)
 61658  	*elem15(elem15(func() *uint8 {
 61659  		*elem15(elem15(_data, uintptr(_iStart)), 0) = uint8(int32(_iFreeBlk) >> 8)
 61660  		return _data
 61661  	}(), uintptr(_iStart)), uintptr(1)) = uint8(_iFreeBlk)
 61662  	*elem15(elem15(func() *uint8 {
 61663  		*elem15(elem15(_data, uintptr(int32(_iStart)+int32(2))), 0) = uint8(int32(_iSize) >> 8)
 61664  		return _data
 61665  	}(), uintptr(int32(_iStart)+int32(2))), uintptr(1)) = uint8(_iSize)
 61666  _38:
 61667  	{
 61668  		p := &_pPage.XnFree
 61669  		*p = uint16(int32(*p) + int32(_iOrigSize))
 61670  	}
 61671  	return int32(0)
 61672  }
 61673  
 61674  var _freeSpaceØ00__func__Ø000 [10]int8
 61675  
 61676  func init() {
 61677  	crt.Xstrncpy(nil, &_freeSpaceØ00__func__Ø000[0], str(80142), 10)
 61678  }
 61679  
 61680  // C comment
 61681  //  /*
 61682  //  ** Insert a new cell on pPage at cell index "i".  pCell points to the
 61683  //  ** content of the cell.
 61684  //  **
 61685  //  ** If the cell content will fit on the page, then put it there.  If it
 61686  //  ** will not fit, then make a copy of the cell content into pTemp if
 61687  //  ** pTemp is not null.  Regardless of pTemp, allocate a new entry
 61688  //  ** in pPage->apOvfl[] and make it point to the cell content (either
 61689  //  ** in pTemp or the original pCell) and also record its index.
 61690  //  ** Allocating a new entry in pPage->aCell[] implies that
 61691  //  ** pPage->nOverflow is incremented.
 61692  //  **
 61693  //  ** *pRC must be SQLITE_OK when this routine is called.
 61694  //  */
 61695  func _insertCell(tls *crt.TLS, _pPage *XMemPage, _i int32, _pCell *uint8, _sz int32, _pTemp *uint8, _iChild uint32, _pRC *int32) {
 61696  	var _idx, _j, _4_rc int32
 61697  	var _data, _pIns *uint8
 61698  	_idx = int32(0)
 61699  	func() {
 61700  		if (*_pRC) != int32(0) {
 61701  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65461), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80152)))
 61702  			crt.X__builtin_abort(tls)
 61703  		}
 61704  	}()
 61705  	func() {
 61706  		if _i < int32(0) || _i > (int32(_pPage.XnCell)+int32(_pPage.XnOverflow)) {
 61707  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65462), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80168)))
 61708  			crt.X__builtin_abort(tls)
 61709  		}
 61710  	}()
 61711  	func() {
 61712  		if ((((*XBtShared)(_pPage.XpBt).XpageSize) - uint32(8)) / uint32(6)) > uint32(10921) {
 61713  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65463), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80209)))
 61714  			crt.X__builtin_abort(tls)
 61715  		}
 61716  	}()
 61717  	func() {
 61718  		if uint32(_pPage.XnCell) > ((((*XBtShared)(_pPage.XpBt).XpageSize)-uint32(8))/uint32(6)) && _sqlite3Config.XneverCorrupt != int32(0) {
 61719  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65464), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80236)))
 61720  			crt.X__builtin_abort(tls)
 61721  		}
 61722  	}()
 61723  	func() {
 61724  		if int32(_pPage.XnOverflow) > int32(4) {
 61725  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65465), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80284)))
 61726  			crt.X__builtin_abort(tls)
 61727  		}
 61728  	}()
 61729  
 61730  	func() {
 61731  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 61732  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65467), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(20394)))
 61733  			crt.X__builtin_abort(tls)
 61734  		}
 61735  	}()
 61736  	func() {
 61737  		if _sz != int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 61738  			v := _pPage.XxCellSize
 61739  			return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 61740  		}()(tls, _pPage, _pCell)) && (_sz != int32(8) || _iChild <= (0)) {
 61741  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65473), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80327)))
 61742  			crt.X__builtin_abort(tls)
 61743  		}
 61744  	}()
 61745  	if _pPage.XnOverflow == 0 && (_sz+int32(2)) <= int32(_pPage.XnFree) {
 61746  		goto _19
 61747  	}
 61748  	if _pTemp != nil {
 61749  		crt.Xmemcpy(tls, unsafe.Pointer(_pTemp), unsafe.Pointer(_pCell), uint32(_sz))
 61750  		_pCell = _pTemp
 61751  	}
 61752  	if _iChild != 0 {
 61753  		_sqlite3Put4byte(tls, _pCell, _iChild)
 61754  	}
 61755  	_j = int32(postInc3(&_pPage.XnOverflow, byte(1)))
 61756  	func() {
 61757  		if _j >= int32(3) {
 61758  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65486), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80385)))
 61759  			crt.X__builtin_abort(tls)
 61760  		}
 61761  	}()
 61762  	*elem88((**uint8)(unsafe.Pointer(&_pPage.XapOvfl)), uintptr(_j)) = _pCell
 61763  	*elem20((*uint16)(unsafe.Pointer(&_pPage.XaiOvfl)), uintptr(_j)) = uint16(_i)
 61764  	func() {
 61765  		if _j != int32(0) && int32(*elem20((*uint16)(unsafe.Pointer(&_pPage.XaiOvfl)), uintptr(_j-int32(1)))) >= int32(uint16(_i)) {
 61766  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65495), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80416)))
 61767  			crt.X__builtin_abort(tls)
 61768  		}
 61769  	}()
 61770  	func() {
 61771  		if _j != int32(0) && _i != (int32(*elem20((*uint16)(unsafe.Pointer(&_pPage.XaiOvfl)), uintptr(_j-int32(1))))+int32(1)) {
 61772  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65496), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80450)))
 61773  			crt.X__builtin_abort(tls)
 61774  		}
 61775  	}()
 61776  	goto _30
 61777  _19:
 61778  	_4_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage.XpDbPage))
 61779  	if _4_rc != int32(0) {
 61780  		*_pRC = _4_rc
 61781  		return
 61782  	}
 61783  	func() {
 61784  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.XpDbPage)) == 0 {
 61785  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65503), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(53310)))
 61786  			crt.X__builtin_abort(tls)
 61787  		}
 61788  	}()
 61789  	_data = _pPage.XaData
 61790  	func() {
 61791  		if elem15(_data, uintptr(_pPage.XcellOffset)) != _pPage.XaCellIdx {
 61792  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65505), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80482)))
 61793  			crt.X__builtin_abort(tls)
 61794  		}
 61795  	}()
 61796  	_4_rc = _allocateSpace(tls, _pPage, _sz, &_idx)
 61797  	if _4_rc != 0 {
 61798  		*_pRC = _4_rc
 61799  		return
 61800  	}
 61801  	func() {
 61802  		if _idx < int32(0) {
 61803  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65510), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80524)))
 61804  			crt.X__builtin_abort(tls)
 61805  		}
 61806  	}()
 61807  	func() {
 61808  		if _idx < ((int32(_pPage.XcellOffset)+(int32(2)*int32(_pPage.XnCell)))+int32(2)) && _sqlite3Config.XneverCorrupt != int32(0) {
 61809  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65511), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80533)))
 61810  			crt.X__builtin_abort(tls)
 61811  		}
 61812  	}()
 61813  	func() {
 61814  		if (_idx + _sz) > int32((*XBtShared)(_pPage.XpBt).XusableSize) {
 61815  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65512), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80589)))
 61816  			crt.X__builtin_abort(tls)
 61817  		}
 61818  	}()
 61819  	{
 61820  		p := &_pPage.XnFree
 61821  		*p = uint16(int32(*p) - int32(uint16(int32(2)+_sz)))
 61822  	}
 61823  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_data, uintptr(_idx))), unsafe.Pointer(_pCell), uint32(_sz))
 61824  	if _iChild != 0 {
 61825  		_sqlite3Put4byte(tls, elem15(_data, uintptr(_idx)), _iChild)
 61826  	}
 61827  	_pIns = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.XaCellIdx)) + uintptr(_i*int32(2))))
 61828  	crt.Xmemmove(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIns))+uintptr(int32(2))))), unsafe.Pointer(_pIns), uint32(int32(2)*(int32(_pPage.XnCell)-_i)))
 61829  	*elem15(func() *uint8 { *elem15(_pIns, 0) = uint8(_idx >> 8); return _pIns }(), uintptr(1)) = uint8(_idx)
 61830  	_pPage.XnCell += 1
 61831  	if int32(preInc3(elem15(_data, uintptr(int32(_pPage.XhdrOffset)+int32(4))), byte(1))) == int32(0) {
 61832  		*elem15(_data, uintptr(int32(_pPage.XhdrOffset)+int32(3))) += 1
 61833  	}
 61834  	func() {
 61835  		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) {
 61836  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65524), unsafe.Pointer(&_insertCellØ00__func__Ø000), unsafe.Pointer(str(80627)))
 61837  			crt.X__builtin_abort(tls)
 61838  		}
 61839  	}()
 61840  	if ((*XBtShared)(_pPage.XpBt).XautoVacuum) != 0 {
 61841  		_ptrmapPutOvflPtr(tls, _pPage, _pCell, _pRC)
 61842  	}
 61843  _30:
 61844  }
 61845  
 61846  var _insertCellØ00__func__Ø000 [11]int8
 61847  
 61848  func init() {
 61849  	crt.Xstrncpy(nil, &_insertCellØ00__func__Ø000[0], str(80677), 11)
 61850  }
 61851  
 61852  // C comment
 61853  //  /*
 61854  //  ** Allocate nByte bytes of space from within the B-Tree page passed
 61855  //  ** as the first argument. Write into *pIdx the index into pPage->aData[]
 61856  //  ** of the first byte of allocated space. Return either SQLITE_OK or
 61857  //  ** an error code (usually SQLITE_CORRUPT).
 61858  //  **
 61859  //  ** The caller guarantees that there is sufficient space to make the
 61860  //  ** allocation.  This routine might need to defragment in order to bring
 61861  //  ** all the space together, however.  This routine will avoid using
 61862  //  ** the first two bytes past the cell pointer area since presumably this
 61863  //  ** allocation is being made in order to insert a new cell, so we will
 61864  //  ** also end up needing a new cell pointer.
 61865  //  */
 61866  func _allocateSpace(tls *crt.TLS, _pPage *XMemPage, _nByte int32, _pIdx *int32) (r0 int32) {
 61867  	var _hdr, _top, _rc, _gap int32
 61868  	var _data, _4_pSpace *uint8
 61869  	_hdr = int32(_pPage.XhdrOffset)
 61870  	_data = _pPage.XaData
 61871  	_rc = int32(0)
 61872  	func() {
 61873  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.XpDbPage)) == 0 {
 61874  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60574), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(53310)))
 61875  			crt.X__builtin_abort(tls)
 61876  		}
 61877  	}()
 61878  	func() {
 61879  		if _pPage.XpBt == nil {
 61880  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60575), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(20262)))
 61881  			crt.X__builtin_abort(tls)
 61882  		}
 61883  	}()
 61884  	func() {
 61885  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 61886  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60576), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(20394)))
 61887  			crt.X__builtin_abort(tls)
 61888  		}
 61889  	}()
 61890  	func() {
 61891  		if _nByte < int32(0) {
 61892  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60577), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(80688)))
 61893  			crt.X__builtin_abort(tls)
 61894  		}
 61895  	}()
 61896  	func() {
 61897  		if int32(_pPage.XnFree) < _nByte {
 61898  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60578), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(80697)))
 61899  			crt.X__builtin_abort(tls)
 61900  		}
 61901  	}()
 61902  	func() {
 61903  		if int32(_pPage.XnOverflow) != int32(0) {
 61904  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60579), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(80717)))
 61905  			crt.X__builtin_abort(tls)
 61906  		}
 61907  	}()
 61908  	func() {
 61909  		if _nByte >= int32(((*XBtShared)(_pPage.XpBt).XusableSize)-uint32(8)) {
 61910  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60580), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(80737)))
 61911  			crt.X__builtin_abort(tls)
 61912  		}
 61913  	}()
 61914  	func() {
 61915  		if int32(_pPage.XcellOffset) != ((_hdr + int32(12)) - (int32(4) * int32(_pPage.Xleaf))) {
 61916  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60582), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(80777)))
 61917  			crt.X__builtin_abort(tls)
 61918  		}
 61919  	}()
 61920  	_gap = int32(_pPage.XcellOffset) + (int32(2) * int32(_pPage.XnCell))
 61921  	func() {
 61922  		if _gap > int32(65536) {
 61923  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60584), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(80823)))
 61924  			crt.X__builtin_abort(tls)
 61925  		}
 61926  	}()
 61927  	_top = (int32(*elem15(elem15(_data, uintptr(_hdr+int32(5))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_hdr+int32(5))), uintptr(1)))
 61928  	func() {
 61929  		if _top > int32((*XBtShared)(_pPage.XpBt).XusableSize) {
 61930  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60591), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(80834)))
 61931  			crt.X__builtin_abort(tls)
 61932  		}
 61933  	}()
 61934  	if _gap <= _top {
 61935  		goto _20
 61936  	}
 61937  	if (_top == int32(0)) && (((*XBtShared)(_pPage.XpBt).XusableSize) == uint32(65536)) {
 61938  		_top = int32(65536)
 61939  		goto _23
 61940  	}
 61941  	return _sqlite3CorruptError(tls, int32(60596))
 61942  
 61943  _23:
 61944  _20:
 61945  	if (*elem15(_data, uintptr(_hdr+int32(2)))) == 0 && (*elem15(_data, uintptr(_hdr+int32(1)))) == 0 || (_gap+int32(2)) > _top {
 61946  		goto _26
 61947  	}
 61948  	_4_pSpace = _pageFindSlot(tls, _pPage, _nByte, &_rc)
 61949  	if _4_pSpace != nil {
 61950  		func() {
 61951  			if crt.P2U(unsafe.Pointer(_4_pSpace)) < crt.P2U(unsafe.Pointer(_data)) || int32(uintptr(unsafe.Pointer(_4_pSpace))-uintptr(unsafe.Pointer(_data))) >= int32(65536) {
 61952  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60610), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(80867)))
 61953  				crt.X__builtin_abort(tls)
 61954  			}
 61955  		}()
 61956  		*_pIdx = int32(uintptr(unsafe.Pointer(_4_pSpace)) - uintptr(unsafe.Pointer(_data)))
 61957  		return int32(0)
 61958  	}
 61959  	if _rc != 0 {
 61960  		return _rc
 61961  	}
 61962  _26:
 61963  	if ((_gap + int32(2)) + _nByte) <= _top {
 61964  		goto _33
 61965  	}
 61966  	func() {
 61967  		if int32(_pPage.XnCell) <= int32(0) && _sqlite3Config.XneverCorrupt != int32(0) {
 61968  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60623), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(80905)))
 61969  			crt.X__builtin_abort(tls)
 61970  		}
 61971  	}()
 61972  	_rc = _defragmentPage(tls, _pPage, func() int32 {
 61973  		if int32(4) < (int32(_pPage.XnFree) - (int32(2) + _nByte)) {
 61974  			return int32(4)
 61975  		}
 61976  		return (int32(_pPage.XnFree) - (int32(2) + _nByte))
 61977  	}())
 61978  	if _rc != 0 {
 61979  		return _rc
 61980  	}
 61981  	_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)
 61982  	func() {
 61983  		if ((_gap + int32(2)) + _nByte) > _top {
 61984  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60627), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(80934)))
 61985  			crt.X__builtin_abort(tls)
 61986  		}
 61987  	}()
 61988  _33:
 61989  	_top -= _nByte
 61990  	*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)
 61991  	func() {
 61992  		if (_top + _nByte) > int32((*XBtShared)(_pPage.XpBt).XusableSize) {
 61993  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60639), unsafe.Pointer(&_allocateSpaceØ00__func__Ø000), unsafe.Pointer(str(80951)))
 61994  			crt.X__builtin_abort(tls)
 61995  		}
 61996  	}()
 61997  	*_pIdx = _top
 61998  	return int32(0)
 61999  }
 62000  
 62001  var _allocateSpaceØ00__func__Ø000 [14]int8
 62002  
 62003  func init() {
 62004  	crt.Xstrncpy(nil, &_allocateSpaceØ00__func__Ø000[0], str(80992), 14)
 62005  }
 62006  
 62007  // C comment
 62008  //  /*
 62009  //  ** Search the free-list on page pPg for space to store a cell nByte bytes in
 62010  //  ** size. If one can be found, return a pointer to the space and remove it
 62011  //  ** from the free-list.
 62012  //  **
 62013  //  ** If no suitable space can be found on the free-list, return NULL.
 62014  //  **
 62015  //  ** This function may detect corruption within pPg.  If corruption is
 62016  //  ** detected then *pRc is set to SQLITE_CORRUPT and NULL is returned.
 62017  //  **
 62018  //  ** Slots on the free list that are between 1 and 3 bytes larger than nByte
 62019  //  ** will be ignored if adding the extra space to the fragmentation count
 62020  //  ** causes the fragmentation count to exceed 60.
 62021  //  */
 62022  func _pageFindSlot(tls *crt.TLS, _pPg *XMemPage, _nByte int32, _pRc *int32) (r0 *uint8) {
 62023  	var _hdr, _iAddr, _pc, _x, _usableSize, _1_size int32
 62024  	var _aData *uint8
 62025  	_hdr = int32(_pPg.XhdrOffset)
 62026  	_aData = _pPg.XaData
 62027  	_iAddr = _hdr + int32(1)
 62028  	_pc = (int32(*elem15(elem15(_aData, uintptr(_iAddr)), 0)) << 8) | int32(*elem15(elem15(_aData, uintptr(_iAddr)), uintptr(1)))
 62029  	_usableSize = int32((*XBtShared)(_pPg.XpBt).XusableSize)
 62030  	func() {
 62031  		if _pc <= int32(0) {
 62032  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60512), unsafe.Pointer(&_pageFindSlotØ00__func__Ø000), unsafe.Pointer(str(81006)))
 62033  			crt.X__builtin_abort(tls)
 62034  		}
 62035  	}()
 62036  _2:
 62037  	if (_pc > (_usableSize - int32(4))) || (_pc < (_iAddr + int32(4))) {
 62038  		*_pRc = _sqlite3CorruptError(tls, int32(60518))
 62039  		return nil
 62040  	}
 62041  	_1_size = (int32(*elem15(elem15(_aData, uintptr(_pc+int32(2))), 0)) << 8) | int32(*elem15(elem15(_aData, uintptr(_pc+int32(2))), uintptr(1)))
 62042  	if store2(&_x, _1_size-_nByte) < int32(0) {
 62043  		goto _5
 62044  	}
 62045  	if (_pc < (int32(_pPg.XcellOffset) + (int32(2) * int32(_pPg.XnCell)))) || ((_1_size + _pc) > _usableSize) {
 62046  		*_pRc = _sqlite3CorruptError(tls, int32(60529))
 62047  		return nil
 62048  	}
 62049  	if _x >= int32(4) {
 62050  		goto _9
 62051  	}
 62052  	if int32(*elem15(_aData, uintptr(_hdr+int32(7)))) > int32(57) {
 62053  		return nil
 62054  	}
 62055  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_aData, uintptr(_iAddr))), unsafe.Pointer(elem15(_aData, uintptr(_pc))), uint32(2))
 62056  	{
 62057  		p := elem15(_aData, uintptr(_hdr+int32(7)))
 62058  		*p = uint8(int32(*p) + int32(uint8(_x)))
 62059  	}
 62060  	goto _11
 62061  _9:
 62062  	*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)
 62063  _11:
 62064  	return elem15(_aData, uintptr(_pc+_x))
 62065  
 62066  _5:
 62067  	_iAddr = _pc
 62068  	_pc = (int32(*elem15(elem15(_aData, uintptr(_pc)), 0)) << 8) | int32(*elem15(elem15(_aData, uintptr(_pc)), uintptr(1)))
 62069  	if _pc != 0 {
 62070  		goto _2
 62071  	}
 62072  	return nil
 62073  }
 62074  
 62075  var _pageFindSlotØ00__func__Ø000 [13]int8
 62076  
 62077  func init() {
 62078  	crt.Xstrncpy(nil, &_pageFindSlotØ00__func__Ø000[0], str(81011), 13)
 62079  }
 62080  
 62081  // C comment
 62082  //  /*
 62083  //  ** Defragment the page given. This routine reorganizes cells within the
 62084  //  ** page so that there are no free-blocks on the free-block list.
 62085  //  **
 62086  //  ** Parameter nMaxFrag is the maximum amount of fragmented space that may be
 62087  //  ** present in the page after this routine returns.
 62088  //  **
 62089  //  ** EVIDENCE-OF: R-44582-60138 SQLite may from time to time reorganize a
 62090  //  ** b-tree page so that there are no freeblocks or fragment bytes, all
 62091  //  ** unused bytes are contained in the unallocated space region, and all
 62092  //  ** cells are packed tightly at the end of the page.
 62093  //  */
 62094  func _defragmentPage(tls *crt.TLS, _pPage *XMemPage, _nMaxFrag int32) (r0 int32) {
 62095  	var _i, _pc, _hdr, _size, _usableSize, _cellOffset, _cbrk, _nCell, _iCellFirst, _iCellLast, _1_iFree, _2_iFree2, _3_sz2, _3_sz, _3_top, _11_x int32
 62096  	var _data, _temp, _src, _3_pEnd, _3_pAddr, _8_pAddr *uint8
 62097  	func() {
 62098  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.XpDbPage)) == 0 {
 62099  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60381), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(53310)))
 62100  			crt.X__builtin_abort(tls)
 62101  		}
 62102  	}()
 62103  	func() {
 62104  		if (*XBtShared)(_pPage.XpBt) == nil {
 62105  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60382), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(55336)))
 62106  			crt.X__builtin_abort(tls)
 62107  		}
 62108  	}()
 62109  	func() {
 62110  		if ((*XBtShared)(_pPage.XpBt).XusableSize) > uint32(65536) {
 62111  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60383), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(81024)))
 62112  			crt.X__builtin_abort(tls)
 62113  		}
 62114  	}()
 62115  	func() {
 62116  		if int32(_pPage.XnOverflow) != int32(0) {
 62117  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60384), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(80717)))
 62118  			crt.X__builtin_abort(tls)
 62119  		}
 62120  	}()
 62121  	func() {
 62122  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 62123  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60385), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(20394)))
 62124  			crt.X__builtin_abort(tls)
 62125  		}
 62126  	}()
 62127  	_temp = nil
 62128  	_src = store15(&_data, _pPage.XaData)
 62129  	_hdr = int32(_pPage.XhdrOffset)
 62130  	_cellOffset = int32(_pPage.XcellOffset)
 62131  	_nCell = int32(_pPage.XnCell)
 62132  	func() {
 62133  		if _nCell != ((int32(*elem15(elem15(_data, uintptr(_hdr+int32(3))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_hdr+int32(3))), uintptr(1)))) {
 62134  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60391), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(81071)))
 62135  			crt.X__builtin_abort(tls)
 62136  		}
 62137  	}()
 62138  	_iCellFirst = _cellOffset + (int32(2) * _nCell)
 62139  	_usableSize = int32((*XBtShared)(_pPage.XpBt).XusableSize)
 62140  	if int32(*elem15(_data, uintptr(_hdr+int32(7)))) > _nMaxFrag {
 62141  		goto _12
 62142  	}
 62143  	_1_iFree = (int32(*elem15(elem15(_data, uintptr(_hdr+int32(1))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_hdr+int32(1))), uintptr(1)))
 62144  	if _1_iFree == 0 {
 62145  		goto _13
 62146  	}
 62147  	_2_iFree2 = (int32(*elem15(elem15(_data, uintptr(_1_iFree)), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_1_iFree)), uintptr(1)))
 62148  	func() {
 62149  		if _2_iFree2 != int32(0) && _2_iFree2 <= _1_iFree {
 62150  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60411), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(81101)))
 62151  			crt.X__builtin_abort(tls)
 62152  		}
 62153  	}()
 62154  	func() {
 62155  		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 {
 62156  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60412), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(81127)))
 62157  			crt.X__builtin_abort(tls)
 62158  		}
 62159  	}()
 62160  	func() {
 62161  		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 {
 62162  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60413), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(81172)))
 62163  			crt.X__builtin_abort(tls)
 62164  		}
 62165  	}()
 62166  	if int32(0) != _2_iFree2 && (int32(*elem15(_data, uintptr(_2_iFree2))) != int32(0) || int32(*elem15(_data, uintptr(_2_iFree2+int32(1)))) != int32(0)) {
 62167  		goto _24
 62168  	}
 62169  	_3_pEnd = elem15(_data, uintptr(_cellOffset+(_nCell*int32(2))))
 62170  	_3_sz2 = int32(0)
 62171  	_3_sz = (int32(*elem15(elem15(_data, uintptr(_1_iFree+int32(2))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_1_iFree+int32(2))), uintptr(1)))
 62172  	_3_top = (int32(*elem15(elem15(_data, uintptr(_hdr+int32(5))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_hdr+int32(5))), uintptr(1)))
 62173  	if _2_iFree2 == 0 {
 62174  		goto _25
 62175  	}
 62176  	if (_1_iFree + _3_sz) > _2_iFree2 {
 62177  		return _sqlite3CorruptError(tls, int32(60422))
 62178  	}
 62179  	_3_sz2 = (int32(*elem15(elem15(_data, uintptr(_2_iFree2+int32(2))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_2_iFree2+int32(2))), uintptr(1)))
 62180  	func() {
 62181  		if ((((_1_iFree + _3_sz) + _3_sz2) + _2_iFree2) - (_1_iFree + _3_sz)) > _usableSize {
 62182  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60424), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(81232)))
 62183  			crt.X__builtin_abort(tls)
 62184  		}
 62185  	}()
 62186  	crt.Xmemmove(tls, unsafe.Pointer(elem15(_data, uintptr((_1_iFree+_3_sz)+_3_sz2))), unsafe.Pointer(elem15(_data, uintptr(_1_iFree+_3_sz))), uint32(_2_iFree2-(_1_iFree+_3_sz)))
 62187  	_3_sz += _3_sz2
 62188  _25:
 62189  	_cbrk = _3_top + _3_sz
 62190  	func() {
 62191  		if (_cbrk + (_1_iFree - _3_top)) > _usableSize {
 62192  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60429), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(81277)))
 62193  			crt.X__builtin_abort(tls)
 62194  		}
 62195  	}()
 62196  	crt.Xmemmove(tls, unsafe.Pointer(elem15(_data, uintptr(_cbrk))), unsafe.Pointer(elem15(_data, uintptr(_3_top))), uint32(_1_iFree-_3_top))
 62197  	_3_pAddr = elem15(_data, uintptr(_cellOffset))
 62198  _31:
 62199  	if crt.P2U(unsafe.Pointer(_3_pAddr)) >= crt.P2U(unsafe.Pointer(_3_pEnd)) {
 62200  		goto _34
 62201  	}
 62202  	_pc = (int32(*elem15(_3_pAddr, 0)) << 8) | int32(*elem15(_3_pAddr, uintptr(1)))
 62203  	if _pc < _1_iFree {
 62204  		*elem15(func() *uint8 { *elem15(_3_pAddr, 0) = uint8((_pc + _3_sz) >> 8); return _3_pAddr }(), uintptr(1)) = uint8(_pc + _3_sz)
 62205  		goto _37
 62206  	}
 62207  	if _pc < _2_iFree2 {
 62208  		*elem15(func() *uint8 { *elem15(_3_pAddr, 0) = uint8((_pc + _3_sz2) >> 8); return _3_pAddr }(), uintptr(1)) = uint8(_pc + _3_sz2)
 62209  	}
 62210  _37:
 62211  	*(*uintptr)(unsafe.Pointer(&_3_pAddr)) += uintptr(int32(2))
 62212  	goto _31
 62213  _34:
 62214  	goto _defragment_out
 62215  _24:
 62216  _13:
 62217  _12:
 62218  	_cbrk = _usableSize
 62219  	_iCellLast = _usableSize - int32(4)
 62220  	_i = int32(0)
 62221  _38:
 62222  	if _i >= _nCell {
 62223  		goto _41
 62224  	}
 62225  	_8_pAddr = elem15(_data, uintptr(_cellOffset+(_i*int32(2))))
 62226  	_pc = (int32(*elem15(_8_pAddr, 0)) << 8) | int32(*elem15(_8_pAddr, uintptr(1)))
 62227  	if (_pc < _iCellFirst) || (_pc > _iCellLast) {
 62228  		return _sqlite3CorruptError(tls, int32(60453))
 62229  	}
 62230  	func() {
 62231  		if _pc < _iCellFirst || _pc > _iCellLast {
 62232  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60455), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(81308)))
 62233  			crt.X__builtin_abort(tls)
 62234  		}
 62235  	}()
 62236  	_size = int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 62237  		v := _pPage.XxCellSize
 62238  		return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 62239  	}()(tls, _pPage, elem15(_src, uintptr(_pc))))
 62240  	_cbrk -= _size
 62241  	if (_cbrk < _iCellFirst) || ((_pc + _size) > _usableSize) {
 62242  		return _sqlite3CorruptError(tls, int32(60459))
 62243  	}
 62244  	func() {
 62245  		if (_cbrk+_size) > _usableSize || _cbrk < _iCellFirst {
 62246  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60461), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(81340)))
 62247  			crt.X__builtin_abort(tls)
 62248  		}
 62249  	}()
 62250  	*elem15(func() *uint8 { *elem15(_8_pAddr, 0) = uint8(_cbrk >> 8); return _8_pAddr }(), uintptr(1)) = uint8(_cbrk)
 62251  	if _temp != nil {
 62252  		goto _52
 62253  	}
 62254  	if _cbrk == _pc {
 62255  		goto _39
 62256  	}
 62257  	_temp = (*uint8)(_sqlite3PagerTempSpace(tls, (*XPager)((*XBtShared)(_pPage.XpBt).XpPager)))
 62258  	_11_x = (int32(*elem15(elem15(_data, uintptr(_hdr+int32(5))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_hdr+int32(5))), uintptr(1)))
 62259  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_temp, uintptr(_11_x))), unsafe.Pointer(elem15(_data, uintptr(_11_x))), uint32((_cbrk+_size)-_11_x))
 62260  	_src = _temp
 62261  _52:
 62262  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_data, uintptr(_cbrk))), unsafe.Pointer(elem15(_src, uintptr(_pc))), uint32(_size))
 62263  _39:
 62264  	_i += 1
 62265  	goto _38
 62266  _41:
 62267  	*elem15(_data, uintptr(_hdr+int32(7))) = 0
 62268  _defragment_out:
 62269  	if ((int32(*elem15(_data, uintptr(_hdr+int32(7)))) + _cbrk) - _iCellFirst) != int32(_pPage.XnFree) {
 62270  		return _sqlite3CorruptError(tls, int32(60479))
 62271  	}
 62272  	func() {
 62273  		if _cbrk < _iCellFirst {
 62274  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60481), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(81382)))
 62275  			crt.X__builtin_abort(tls)
 62276  		}
 62277  	}()
 62278  	*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)
 62279  	*elem15(_data, uintptr(_hdr+int32(1))) = 0
 62280  	*elem15(_data, uintptr(_hdr+int32(2))) = 0
 62281  	crt.Xmemset(tls, unsafe.Pointer(elem15(_data, uintptr(_iCellFirst))), int32(0), uint32(_cbrk-_iCellFirst))
 62282  	func() {
 62283  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.XpDbPage)) == 0 {
 62284  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(60486), unsafe.Pointer(&_defragmentPageØ00__func__Ø000), unsafe.Pointer(str(53310)))
 62285  			crt.X__builtin_abort(tls)
 62286  		}
 62287  	}()
 62288  	return int32(0)
 62289  }
 62290  
 62291  var _defragmentPageØ00__func__Ø000 [15]int8
 62292  
 62293  func init() {
 62294  	crt.Xstrncpy(nil, &_defragmentPageØ00__func__Ø000[0], str(81399), 15)
 62295  }
 62296  
 62297  // C comment
 62298  //  /*
 62299  //  ** Return a pointer to the "temporary page" buffer held internally
 62300  //  ** by the pager.  This is a buffer that is big enough to hold the
 62301  //  ** entire content of a database page.  This buffer is used internally
 62302  //  ** during rollback and will be overwritten whenever a rollback
 62303  //  ** occurs.  But other modules are free to use it too, as long as
 62304  //  ** no rollbacks are happening.
 62305  //  */
 62306  func _sqlite3PagerTempSpace(tls *crt.TLS, _pPager *XPager) (r0 unsafe.Pointer) {
 62307  	return unsafe.Pointer(_pPager.XpTmpSpace)
 62308  }
 62309  
 62310  // C comment
 62311  //  /*
 62312  //  ** The page that pCur currently points to has just been modified in
 62313  //  ** some way. This function figures out if this modification means the
 62314  //  ** tree needs to be balanced, and if so calls the appropriate balancing
 62315  //  ** routine. Balancing routines are:
 62316  //  **
 62317  //  **   balance_quick()
 62318  //  **   balance_deeper()
 62319  //  **   balance_nonroot()
 62320  //  */
 62321  func _balance(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 62322  	var _rc, _nMin, _balance_quick_called, _balance_deeper_called, _1_iPage, _7_iIdx int32
 62323  	var _pFree, _10_pSpace *uint8
 62324  	var _1_pPage, _7_pParent *XMemPage
 62325  	var _aBalanceQuickSpace [13]uint8
 62326  	_rc = int32(0)
 62327  	_nMin = int32((((*XBtShared)(_pCur.XpBt).XusableSize) * uint32(2)) / uint32(3))
 62328  	_pFree = nil
 62329  	_balance_quick_called = int32(0)
 62330  	_balance_deeper_called = int32(0)
 62331  _0:
 62332  	_1_iPage = int32(_pCur.XiPage)
 62333  	_1_pPage = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_1_iPage))
 62334  	if _1_iPage != int32(0) {
 62335  		goto _1
 62336  	}
 62337  	if _1_pPage.XnOverflow == 0 {
 62338  		goto _2
 62339  	}
 62340  	func() {
 62341  		if _balance_deeper_called != int32(0) {
 62342  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66966), unsafe.Pointer(&_balanceØ00__func__Ø000), unsafe.Pointer(str(81414)))
 62343  			crt.X__builtin_abort(tls)
 62344  		}
 62345  	}()
 62346  	_balance_deeper_called += 1
 62347  	_rc = _balance_deeper(tls, _1_pPage, elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(1)))
 62348  	if _rc == int32(0) {
 62349  		_pCur.XiPage = int8(1)
 62350  		_pCur.Xix = 0
 62351  		*elem20((*uint16)(unsafe.Pointer(&_pCur.XaiIdx)), 0) = 0
 62352  		func() {
 62353  			if ((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(1))).XnOverflow) == 0 {
 62354  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66973), unsafe.Pointer(&_balanceØ00__func__Ø000), unsafe.Pointer(str(81439)))
 62355  				crt.X__builtin_abort(tls)
 62356  			}
 62357  		}()
 62358  	}
 62359  	goto _8
 62360  _2:
 62361  	goto _9
 62362  _8:
 62363  	goto _13
 62364  _1:
 62365  	if (int32(_1_pPage.XnOverflow) == int32(0)) && (int32(_1_pPage.XnFree) <= _nMin) {
 62366  		goto _9
 62367  	}
 62368  	_7_pParent = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_1_iPage-int32(1)))
 62369  	_7_iIdx = int32(*elem20((*uint16)(unsafe.Pointer(&_pCur.XaiIdx)), uintptr(_1_iPage-int32(1))))
 62370  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_7_pParent.XpDbPage))
 62371  	if _rc != int32(0) {
 62372  		goto _14
 62373  	}
 62374  	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) {
 62375  		func() {
 62376  			if _balance_quick_called != int32(0) {
 62377  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67006), unsafe.Pointer(&_balanceØ00__func__Ø000), unsafe.Pointer(str(81466)))
 62378  				crt.X__builtin_abort(tls)
 62379  			}
 62380  		}()
 62381  		_balance_quick_called += 1
 62382  		_rc = _balance_quick(tls, _7_pParent, _1_pPage, (*uint8)(unsafe.Pointer(&_aBalanceQuickSpace)))
 62383  		goto _22
 62384  	}
 62385  	_10_pSpace = (*uint8)(_sqlite3PageMalloc(tls, int32((*XBtShared)(_pCur.XpBt).XpageSize)))
 62386  	_rc = _balance_nonroot(tls, _7_pParent, _7_iIdx, _10_pSpace, bool2int(_1_iPage == int32(1)), int32(_pCur.Xhints)&int32(1))
 62387  	if _pFree != nil {
 62388  		_sqlite3PageFree(tls, unsafe.Pointer(_pFree))
 62389  	}
 62390  	_pFree = _10_pSpace
 62391  _22:
 62392  _14:
 62393  	_1_pPage.XnOverflow = 0
 62394  	_releasePage(tls, _1_pPage)
 62395  	_pCur.XiPage -= 1
 62396  	func() {
 62397  		if int32(_pCur.XiPage) < int32(0) {
 62398  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67052), unsafe.Pointer(&_balanceØ00__func__Ø000), unsafe.Pointer(str(73444)))
 62399  			crt.X__builtin_abort(tls)
 62400  		}
 62401  	}()
 62402  _13:
 62403  	if _rc == int32(0) {
 62404  		goto _0
 62405  	}
 62406  _9:
 62407  	if _pFree != nil {
 62408  		_sqlite3PageFree(tls, unsafe.Pointer(_pFree))
 62409  	}
 62410  	return _rc
 62411  
 62412  	_ = _aBalanceQuickSpace
 62413  	panic(0)
 62414  }
 62415  
 62416  var _balanceØ00__func__Ø000 [8]int8
 62417  
 62418  func init() {
 62419  	crt.Xstrncpy(nil, &_balanceØ00__func__Ø000[0], str(81490), 8)
 62420  }
 62421  
 62422  // C comment
 62423  //  /*
 62424  //  ** This function is called when the root page of a b-tree structure is
 62425  //  ** overfull (has one or more overflow pages).
 62426  //  **
 62427  //  ** A new child page is allocated and the contents of the current root
 62428  //  ** page, including overflow cells, are copied into the child. The root
 62429  //  ** page is then overwritten to make it an empty page with the right-child
 62430  //  ** pointer pointing to the new page.
 62431  //  **
 62432  //  ** Before returning, all pointer-map entries corresponding to pages
 62433  //  ** that the new child-page now contains pointers to are updated. The
 62434  //  ** entry corresponding to the new right-child pointer of the root
 62435  //  ** page is also updated.
 62436  //  **
 62437  //  ** If successful, *ppChild is set to contain a reference to the child
 62438  //  ** page and SQLITE_OK is returned. In this case the caller is required
 62439  //  ** to call releasePage() on *ppChild exactly once. If an error occurs,
 62440  //  ** an error code is returned and *ppChild is set to 0.
 62441  //  */
 62442  func _balance_deeper(tls *crt.TLS, _pRoot *XMemPage, _ppChild **XMemPage) (r0 int32) {
 62443  	var _rc int32
 62444  	var _pgnoChild uint32
 62445  	var _pBt *XBtShared
 62446  	var _pChild *XMemPage
 62447  	_pChild = nil
 62448  	_pgnoChild = uint32(0)
 62449  	_pBt = (*XBtShared)(_pRoot.XpBt)
 62450  	func() {
 62451  		if int32(_pRoot.XnOverflow) <= int32(0) {
 62452  			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)))
 62453  			crt.X__builtin_abort(tls)
 62454  		}
 62455  	}()
 62456  	func() {
 62457  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 62458  			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)))
 62459  			crt.X__builtin_abort(tls)
 62460  		}
 62461  	}()
 62462  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pRoot.XpDbPage))
 62463  	if _rc != int32(0) {
 62464  		goto _4
 62465  	}
 62466  	_rc = _allocateBtreePage(tls, _pBt, &_pChild, &_pgnoChild, _pRoot.Xpgno, 0)
 62467  	_copyNodeContent(tls, _pRoot, _pChild, &_rc)
 62468  	if _pBt.XautoVacuum != 0 {
 62469  		_ptrmapPut(tls, _pBt, _pgnoChild, uint8(5), _pRoot.Xpgno, &_rc)
 62470  	}
 62471  _4:
 62472  	if _rc != 0 {
 62473  		*_ppChild = nil
 62474  		_releasePage(tls, _pChild)
 62475  		return _rc
 62476  	}
 62477  	func() {
 62478  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pChild.XpDbPage)) == 0 {
 62479  			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)))
 62480  			crt.X__builtin_abort(tls)
 62481  		}
 62482  	}()
 62483  	func() {
 62484  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pRoot.XpDbPage)) == 0 {
 62485  			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)))
 62486  			crt.X__builtin_abort(tls)
 62487  		}
 62488  	}()
 62489  	func() {
 62490  		if int32(_pChild.XnCell) != int32(_pRoot.XnCell) {
 62491  			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)))
 62492  			crt.X__builtin_abort(tls)
 62493  		}
 62494  	}()
 62495  	crt.Xmemcpy(tls, unsafe.Pointer(&_pChild.XaiOvfl), unsafe.Pointer(&_pRoot.XaiOvfl), uint32(_pRoot.XnOverflow)*uint32(2))
 62496  	crt.Xmemcpy(tls, unsafe.Pointer(&_pChild.XapOvfl), unsafe.Pointer(&_pRoot.XapOvfl), uint32(_pRoot.XnOverflow)*uint32(4))
 62497  	_pChild.XnOverflow = _pRoot.XnOverflow
 62498  	_zeroPage(tls, _pRoot, int32(*elem15(_pChild.XaData, 0))&int32(-9))
 62499  	_sqlite3Put4byte(tls, elem15(_pRoot.XaData, uintptr(int32(_pRoot.XhdrOffset)+int32(8))), _pgnoChild)
 62500  	*_ppChild = _pChild
 62501  	return int32(0)
 62502  }
 62503  
 62504  var _balance_deeperØ00__func__Ø000 [15]int8
 62505  
 62506  func init() {
 62507  	crt.Xstrncpy(nil, &_balance_deeperØ00__func__Ø000[0], str(81586), 15)
 62508  }
 62509  
 62510  // C comment
 62511  //  /*
 62512  //  ** This function is used to copy the contents of the b-tree node stored
 62513  //  ** on page pFrom to page pTo. If page pFrom was not a leaf page, then
 62514  //  ** the pointer-map entries for each child page are updated so that the
 62515  //  ** parent page stored in the pointer map is page pTo. If pFrom contained
 62516  //  ** any cells with overflow page pointers, then the corresponding pointer
 62517  //  ** map entries are also updated so that the parent page is page pTo.
 62518  //  **
 62519  //  ** If pFrom is currently carrying any overflow cells (entries in the
 62520  //  ** MemPage.apOvfl[] array), they are not copied to pTo.
 62521  //  **
 62522  //  ** Before returning, page pTo is reinitialized using btreeInitPage().
 62523  //  **
 62524  //  ** The performance of this function is not critical. It is only used by
 62525  //  ** the balance_shallower() and balance_deeper() procedures, neither of
 62526  //  ** which are called often under normal circumstances.
 62527  //  */
 62528  func _copyNodeContent(tls *crt.TLS, _pFrom *XMemPage, _pTo *XMemPage, _pRC *int32) {
 62529  	var _1_iFromHdr, _1_iToHdr, _1_rc, _1_iData int32
 62530  	var _1_aFrom, _1_aTo *uint8
 62531  	var _1_pBt *XBtShared
 62532  	if (*_pRC) != int32(0) {
 62533  		goto _0
 62534  	}
 62535  	_1_pBt = (*XBtShared)(_pFrom.XpBt)
 62536  	_1_aFrom = _pFrom.XaData
 62537  	_1_aTo = _pTo.XaData
 62538  	_1_iFromHdr = int32(_pFrom.XhdrOffset)
 62539  	_1_iToHdr = func() int32 {
 62540  		if _pTo.Xpgno == uint32(1) {
 62541  			return int32(100)
 62542  		}
 62543  		return int32(0)
 62544  	}()
 62545  	func() {
 62546  		if _pFrom.XisInit == 0 {
 62547  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66056), unsafe.Pointer(&_copyNodeContentØ00__func__Ø000), unsafe.Pointer(str(81601)))
 62548  			crt.X__builtin_abort(tls)
 62549  		}
 62550  	}()
 62551  	func() {
 62552  		if int32(_pFrom.XnFree) < _1_iToHdr {
 62553  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66057), unsafe.Pointer(&_copyNodeContentØ00__func__Ø000), unsafe.Pointer(str(81615)))
 62554  			crt.X__builtin_abort(tls)
 62555  		}
 62556  	}()
 62557  	func() {
 62558  		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) {
 62559  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(66058), unsafe.Pointer(&_copyNodeContentØ00__func__Ø000), unsafe.Pointer(str(81636)))
 62560  			crt.X__builtin_abort(tls)
 62561  		}
 62562  	}()
 62563  	_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)))
 62564  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_1_aTo, uintptr(_1_iData))), unsafe.Pointer(elem15(_1_aFrom, uintptr(_1_iData))), _1_pBt.XusableSize-uint32(_1_iData))
 62565  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_1_aTo, uintptr(_1_iToHdr))), unsafe.Pointer(elem15(_1_aFrom, uintptr(_1_iFromHdr))), uint32(int32(_pFrom.XcellOffset)+(int32(2)*int32(_pFrom.XnCell))))
 62566  	_pTo.XisInit = 0
 62567  	_1_rc = _btreeInitPage(tls, _pTo)
 62568  	if _1_rc != int32(0) {
 62569  		*_pRC = _1_rc
 62570  		return
 62571  	}
 62572  	if _1_pBt.XautoVacuum != 0 {
 62573  		*_pRC = _setChildPtrmaps(tls, _pTo)
 62574  	}
 62575  _0:
 62576  }
 62577  
 62578  var _copyNodeContentØ00__func__Ø000 [16]int8
 62579  
 62580  func init() {
 62581  	crt.Xstrncpy(nil, &_copyNodeContentØ00__func__Ø000[0], str(81689), 16)
 62582  }
 62583  
 62584  // C comment
 62585  //  /*
 62586  //  ** This version of balance() handles the common special case where
 62587  //  ** a new entry is being inserted on the extreme right-end of the
 62588  //  ** tree, in other words, when the new entry will become the largest
 62589  //  ** entry in the tree.
 62590  //  **
 62591  //  ** Instead of trying to balance the 3 right-most leaf pages, just add
 62592  //  ** a new page to the right-hand side and put the one new entry in
 62593  //  ** that page.  This leaves the right side of the tree somewhat
 62594  //  ** unbalanced.  But odds are that we will be inserting new entries
 62595  //  ** at the end soon afterwards so the nearly empty page will quickly
 62596  //  ** fill up.  On average.
 62597  //  **
 62598  //  ** pPage is the leaf page which is the right-most page in the tree.
 62599  //  ** pParent is its parent.  pPage must have a single overflow entry
 62600  //  ** which is also the right-most entry on the page.
 62601  //  **
 62602  //  ** The pSpace buffer is used to store a temporary copy of the divider
 62603  //  ** cell that will be inserted into pParent. Such a cell consists of a 4
 62604  //  ** byte page number followed by a variable length integer. In other
 62605  //  ** words, at most 13 bytes. Hence the pSpace buffer must be at
 62606  //  ** least 13 bytes in size.
 62607  //  */
 62608  func _balance_quick(tls *crt.TLS, _pParent *XMemPage, _pPage *XMemPage, _pSpace *uint8) (r0 int32) {
 62609  	var _rc int32
 62610  	var _pgnoNew uint32
 62611  	var _1_szCell uint16
 62612  	var _1_pOut, _1_pCell, _1_pStop *uint8
 62613  	var _pBt *XBtShared
 62614  	var _pNew *XMemPage
 62615  	_pBt = (*XBtShared)(_pPage.XpBt)
 62616  	func() {
 62617  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.XpBt).Xmutex)) == 0 {
 62618  			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)))
 62619  			crt.X__builtin_abort(tls)
 62620  		}
 62621  	}()
 62622  	func() {
 62623  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pParent.XpDbPage)) == 0 {
 62624  			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)))
 62625  			crt.X__builtin_abort(tls)
 62626  		}
 62627  	}()
 62628  	func() {
 62629  		if int32(_pPage.XnOverflow) != int32(1) {
 62630  			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)))
 62631  			crt.X__builtin_abort(tls)
 62632  		}
 62633  	}()
 62634  	if func() int32 {
 62635  		if int32(_pPage.XnCell) == int32(0) {
 62636  			return func() int32 {
 62637  				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)))
 62638  				crt.X__builtin_abort(tls)
 62639  				return int32(1)
 62640  			}()
 62641  		}
 62642  		return int32(0)
 62643  	}() != 0 {
 62644  		return _sqlite3CorruptError(tls, int32(65912))
 62645  	}
 62646  	_rc = _allocateBtreePage(tls, _pBt, &_pNew, &_pgnoNew, 0, 0)
 62647  	if _rc != int32(0) {
 62648  		goto _9
 62649  	}
 62650  	_1_pOut = elem15(_pSpace, uintptr(4))
 62651  	_1_pCell = *elem88((**uint8)(unsafe.Pointer(&_pPage.XapOvfl)), 0)
 62652  	_1_szCell = func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 62653  		v := _pPage.XxCellSize
 62654  		return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 62655  	}()(tls, _pPage, _1_pCell)
 62656  	func() {
 62657  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pNew.XpDbPage)) == 0 {
 62658  			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)))
 62659  			crt.X__builtin_abort(tls)
 62660  		}
 62661  	}()
 62662  	func() {
 62663  		if int32(*elem15(_pPage.XaData, 0)) != int32(13) {
 62664  			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)))
 62665  			crt.X__builtin_abort(tls)
 62666  		}
 62667  	}()
 62668  	_zeroPage(tls, _pNew, int32(13))
 62669  	_rc = _rebuildPage(tls, _pNew, int32(1), &_1_pCell, &_1_szCell)
 62670  	if func() int32 {
 62671  		if _rc != 0 {
 62672  			return func() int32 {
 62673  				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)))
 62674  				crt.X__builtin_abort(tls)
 62675  				return int32(1)
 62676  			}()
 62677  		}
 62678  		return int32(0)
 62679  	}() != 0 {
 62680  		return _rc
 62681  	}
 62682  	_pNew.XnFree = uint16(((_pBt.XusableSize - uint32(_pNew.XcellOffset)) - uint32(2)) - uint32(_1_szCell))
 62683  	if _pBt.XautoVacuum == 0 {
 62684  		goto _17
 62685  	}
 62686  	_ptrmapPut(tls, _pBt, _pgnoNew, uint8(5), _pParent.Xpgno, &_rc)
 62687  	if int32(_1_szCell) > int32(_pNew.XminLocal) {
 62688  		_ptrmapPutOvflPtr(tls, _pNew, _1_pCell, &_rc)
 62689  	}
 62690  _17:
 62691  	_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)))))))
 62692  	_1_pStop = elem15(_1_pCell, uintptr(9))
 62693  _19:
 62694  	if (int32(*postInc15(&_1_pCell, 1))&int32(128)) != 0 && (crt.P2U(unsafe.Pointer(_1_pCell)) < crt.P2U(unsafe.Pointer(_1_pStop))) {
 62695  		goto _19
 62696  	}
 62697  	_1_pStop = elem15(_1_pCell, uintptr(9))
 62698  _22:
 62699  	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))) {
 62700  		goto _22
 62701  	}
 62702  	if _rc == int32(0) {
 62703  		_insertCell(tls, _pParent, int32(_pParent.XnCell), _pSpace, int32(uintptr(unsafe.Pointer(_1_pOut))-uintptr(unsafe.Pointer(_pSpace))), nil, _pPage.Xpgno, &_rc)
 62704  	}
 62705  	_sqlite3Put4byte(tls, elem15(_pParent.XaData, uintptr(int32(_pParent.XhdrOffset)+int32(8))), _pgnoNew)
 62706  	_releasePage(tls, _pNew)
 62707  _9:
 62708  	return _rc
 62709  }
 62710  
 62711  var _balance_quickØ00__func__Ø000 [14]int8
 62712  
 62713  func init() {
 62714  	crt.Xstrncpy(nil, &_balance_quickØ00__func__Ø000[0], str(81858), 14)
 62715  }
 62716  
 62717  // C comment
 62718  //  /*
 62719  //  ** Array apCell[] contains pointers to nCell b-tree page cells. The
 62720  //  ** szCell[] array contains the size in bytes of each cell. This function
 62721  //  ** replaces the current contents of page pPg with the contents of the cell
 62722  //  ** array.
 62723  //  **
 62724  //  ** Some of the cells in apCell[] may currently be stored in pPg. This
 62725  //  ** function works around problems caused by this by making a copy of any
 62726  //  ** such cells before overwriting the page data.
 62727  //  **
 62728  //  ** The MemPage.nFree field is invalidated by this function. It is the
 62729  //  ** responsibility of the caller to set it correctly.
 62730  //  */
 62731  func _rebuildPage(tls *crt.TLS, _pPg *XMemPage, _nCell int32, _apCell **uint8, _szCell *uint16) (r0 int32) {
 62732  	var _hdr, _usableSize, _i int32
 62733  	var _aData, _pEnd, _pCellptr, _pTmp, _pData, _1_pCell *uint8
 62734  	_hdr = int32(_pPg.XhdrOffset)
 62735  	_aData = _pPg.XaData
 62736  	_usableSize = int32((*XBtShared)(_pPg.XpBt).XusableSize)
 62737  	_pEnd = elem15(_aData, uintptr(_usableSize))
 62738  	_pCellptr = _pPg.XaCellIdx
 62739  	_pTmp = (*uint8)(_sqlite3PagerTempSpace(tls, (*XPager)((*XBtShared)(_pPg.XpBt).XpPager)))
 62740  	_i = (int32(*elem15(elem15(_aData, uintptr(_hdr+int32(5))), 0)) << 8) | int32(*elem15(elem15(_aData, uintptr(_hdr+int32(5))), uintptr(1)))
 62741  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_pTmp, uintptr(_i))), unsafe.Pointer(elem15(_aData, uintptr(_i))), uint32(_usableSize-_i))
 62742  	_pData = _pEnd
 62743  	_i = int32(0)
 62744  _0:
 62745  	if _i >= _nCell {
 62746  		goto _3
 62747  	}
 62748  	_1_pCell = *elem88(_apCell, uintptr(_i))
 62749  	if (uint32(crt.P2U(unsafe.Pointer(_1_pCell))) >= uint32(crt.P2U(unsafe.Pointer(_aData)))) && (uint32(crt.P2U(unsafe.Pointer(_1_pCell))) < uint32(crt.P2U(unsafe.Pointer(_pEnd)))) {
 62750  		_1_pCell = elem15(_pTmp, uintptr(int32(uintptr(unsafe.Pointer(_1_pCell))-uintptr(unsafe.Pointer(_aData)))))
 62751  	}
 62752  	*(*uintptr)(unsafe.Pointer(&_pData)) -= uintptr(*elem20(_szCell, uintptr(_i)))
 62753  	*elem15(func() *uint8 {
 62754  		*elem15(_pCellptr, 0) = uint8(int32(uintptr(unsafe.Pointer(_pData))-uintptr(unsafe.Pointer(_aData))) >> 8)
 62755  		return _pCellptr
 62756  	}(), uintptr(1)) = uint8(int32(uintptr(unsafe.Pointer(_pData)) - uintptr(unsafe.Pointer(_aData))))
 62757  	*(*uintptr)(unsafe.Pointer(&_pCellptr)) += uintptr(int32(2))
 62758  	if crt.P2U(unsafe.Pointer(_pData)) < crt.P2U(unsafe.Pointer(_pCellptr)) {
 62759  		return _sqlite3CorruptError(tls, int32(65622))
 62760  	}
 62761  	crt.Xmemcpy(tls, unsafe.Pointer(_pData), unsafe.Pointer(_1_pCell), uint32(*elem20(_szCell, uintptr(_i))))
 62762  	func() {
 62763  		if int32(*elem20(_szCell, uintptr(_i))) != int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 62764  			v := _pPg.XxCellSize
 62765  			return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 62766  		}()(tls, _pPg, _1_pCell)) && _sqlite3Config.XneverCorrupt != int32(0) {
 62767  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65624), unsafe.Pointer(&_rebuildPageØ00__func__Ø000), unsafe.Pointer(str(81872)))
 62768  			crt.X__builtin_abort(tls)
 62769  		}
 62770  	}()
 62771  	_i += 1
 62772  	goto _0
 62773  _3:
 62774  	_pPg.XnCell = uint16(_nCell)
 62775  	_pPg.XnOverflow = 0
 62776  	*elem15(elem15(func() *uint8 { *elem15(elem15(_aData, uintptr(_hdr+int32(1))), 0) = uint8(0); return _aData }(), uintptr(_hdr+int32(1))), uintptr(1)) = uint8(0)
 62777  	*elem15(elem15(func() *uint8 {
 62778  		*elem15(elem15(_aData, uintptr(_hdr+int32(3))), 0) = uint8(int32(_pPg.XnCell) >> 8)
 62779  		return _aData
 62780  	}(), uintptr(_hdr+int32(3))), uintptr(1)) = uint8(_pPg.XnCell)
 62781  	*elem15(elem15(func() *uint8 {
 62782  		*elem15(elem15(_aData, uintptr(_hdr+int32(5))), 0) = uint8(int32(uintptr(unsafe.Pointer(_pData))-uintptr(unsafe.Pointer(_aData))) >> 8)
 62783  		return _aData
 62784  	}(), uintptr(_hdr+int32(5))), uintptr(1)) = uint8(int32(uintptr(unsafe.Pointer(_pData)) - uintptr(unsafe.Pointer(_aData))))
 62785  	*elem15(_aData, uintptr(_hdr+int32(7))) = 0
 62786  	return int32(0)
 62787  }
 62788  
 62789  var _rebuildPageØ00__func__Ø000 [12]int8
 62790  
 62791  func init() {
 62792  	crt.Xstrncpy(nil, &_rebuildPageØ00__func__Ø000[0], str(81924), 12)
 62793  }
 62794  
 62795  // C comment
 62796  //  /*
 62797  //  ** This routine redistributes cells on the iParentIdx'th child of pParent
 62798  //  ** (hereafter "the page") and up to 2 siblings so that all pages have about the
 62799  //  ** same amount of free space. Usually a single sibling on either side of the
 62800  //  ** page are used in the balancing, though both siblings might come from one
 62801  //  ** side if the page is the first or last child of its parent. If the page
 62802  //  ** has fewer than 2 siblings (something which can only happen if the page
 62803  //  ** is a root page or a child of a root page) then all available siblings
 62804  //  ** participate in the balancing.
 62805  //  **
 62806  //  ** The number of siblings of the page might be increased or decreased by
 62807  //  ** one or two in an effort to keep pages nearly full but not over full.
 62808  //  **
 62809  //  ** Note that when this routine is called, some of the cells on the page
 62810  //  ** might not actually be stored in MemPage.aData[]. This can happen
 62811  //  ** if the page is overfull. This routine ensures that all cells allocated
 62812  //  ** to the page and its siblings fit into MemPage.aData[] before returning.
 62813  //  **
 62814  //  ** In the course of balancing the page and its siblings, cells may be
 62815  //  ** inserted into or removed from the parent page (pParent). Doing so
 62816  //  ** may cause the parent page to become overfull or underfull. If this
 62817  //  ** happens, it is the responsibility of the caller to invoke the correct
 62818  //  ** balancing routine to fix this problem (see the balance() routine).
 62819  //  **
 62820  //  ** If this routine fails for any reason, it might leave the database
 62821  //  ** in a corrupted state. So if this routine fails, the database should
 62822  //  ** be rolled back.
 62823  //  **
 62824  //  ** The third argument to this function, aOvflSpace, is a pointer to a
 62825  //  ** buffer big enough to hold one page. If while inserting cells into the parent
 62826  //  ** page (pParent) the parent page becomes overfull, this buffer is
 62827  //  ** used to store the parent's overflow cells. Because this function inserts
 62828  //  ** a maximum of four divider cells into the parent page, and the maximum
 62829  //  ** size of a cell stored within an internal node is always less than 1/4
 62830  //  ** of the page-size, the aOvflSpace[] buffer is guaranteed to be large
 62831  //  ** enough for all overflow cells.
 62832  //  **
 62833  //  ** If aOvflSpace is set to a null pointer, this function returns
 62834  //  ** SQLITE_NOMEM.
 62835  //  */
 62836  func _balance_nonroot(tls *crt.TLS, _pParent *XMemPage, _iParentIdx int32, _aOvflSpace *uint8, _isRoot int32, _bBulk int32) (r0 int32) {
 62837  	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
 62838  	var _pgno, _77_key uint32
 62839  	var _leafCorrection, _17_maskPage, _23_sz uint16
 62840  	var _pRight, _aSpace1, _17_aData, _17_piCell, _17_piEnd, _23_pTemp, _59_aOld, _60_pCell, _66_pCell, _66_pTemp *uint8
 62841  	var _aPgno, _aPgOrder [5]uint32
 62842  	var _pBt *XBtShared
 62843  	var _68_info XCellInfo
 62844  	var _17_pOld, _27_p, _46_pNew, _58_pOld, _59_pNew, _61_pOld, _66_pNew *XMemPage
 62845  	var _b XCellArray
 62846  	var _apOld [3]*XMemPage
 62847  	var _apNew [5]*XMemPage
 62848  	var _apDiv [2]*uint8
 62849  	var _cntNew, _cntOld, _szNew [5]int32
 62850  	var _abDone [5]uint8
 62851  	var _aPgFlags [5]uint16
 62852  	_nMaxCells = int32(0)
 62853  	_nNew = int32(0)
 62854  	_rc = int32(0)
 62855  	_iSpace1 = int32(0)
 62856  	_iOvflSpace = int32(0)
 62857  	crt.Xmemset(tls, unsafe.Pointer(&_abDone), int32(0), uint32(5))
 62858  	_b.XnCell = int32(0)
 62859  	_b.XapCell = nil
 62860  	_pBt = (*XBtShared)(_pParent.XpBt)
 62861  	func() {
 62862  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 62863  			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)))
 62864  			crt.X__builtin_abort(tls)
 62865  		}
 62866  	}()
 62867  	func() {
 62868  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pParent.XpDbPage)) == 0 {
 62869  			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)))
 62870  			crt.X__builtin_abort(tls)
 62871  		}
 62872  	}()
 62873  	func() {
 62874  		if int32(_pParent.XnOverflow) != int32(0) && int32(_pParent.XnOverflow) != int32(1) {
 62875  			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)))
 62876  			crt.X__builtin_abort(tls)
 62877  		}
 62878  	}()
 62879  	func() {
 62880  		if int32(_pParent.XnOverflow) != int32(0) && int32(*elem20((*uint16)(unsafe.Pointer(&_pParent.XaiOvfl)), 0)) != _iParentIdx {
 62881  			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)))
 62882  			crt.X__builtin_abort(tls)
 62883  		}
 62884  	}()
 62885  	if _aOvflSpace == nil {
 62886  		return _sqlite3NomemError(tls, int32(66182))
 62887  	}
 62888  	_i = int32(_pParent.XnOverflow) + int32(_pParent.XnCell)
 62889  	if _i < int32(2) {
 62890  		_nxDiv = int32(0)
 62891  		goto _12
 62892  	}
 62893  	func() {
 62894  		if _bBulk != int32(0) && _bBulk != int32(1) {
 62895  			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)))
 62896  			crt.X__builtin_abort(tls)
 62897  		}
 62898  	}()
 62899  	if _iParentIdx == int32(0) {
 62900  		_nxDiv = int32(0)
 62901  		goto _19
 62902  	}
 62903  	if _iParentIdx == _i {
 62904  		_nxDiv = (_i - int32(2)) + _bBulk
 62905  		goto _19
 62906  	}
 62907  	_nxDiv = _iParentIdx - int32(1)
 62908  _19:
 62909  	_i = int32(2) - _bBulk
 62910  _12:
 62911  	_nOld = _i + int32(1)
 62912  	if ((_i + _nxDiv) - int32(_pParent.XnOverflow)) == int32(_pParent.XnCell) {
 62913  		_pRight = elem15(_pParent.XaData, uintptr(int32(_pParent.XhdrOffset)+int32(8)))
 62914  		goto _21
 62915  	}
 62916  	_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)))))))
 62917  _21:
 62918  	_pgno = _sqlite3Get4byte(tls, _pRight)
 62919  _22:
 62920  	_rc = _getAndInitPage(tls, _pBt, _pgno, elem30((**XMemPage)(unsafe.Pointer(&_apOld)), uintptr(_i)), nil, int32(0))
 62921  	if _rc != 0 {
 62922  		crt.Xmemset(tls, unsafe.Pointer(&_apOld), int32(0), uint32(_i+int32(1))*uint32(4))
 62923  		goto _balance_cleanup
 62924  	}
 62925  	_nMaxCells += (int32(1) + int32((*elem30((**XMemPage)(unsafe.Pointer(&_apOld)), uintptr(_i))).XnCell)) + int32((*elem30((**XMemPage)(unsafe.Pointer(&_apOld)), uintptr(_i))).XnOverflow)
 62926  	if postInc2(&_i, -1) == int32(0) {
 62927  		goto _23
 62928  	}
 62929  	if (_pParent.XnOverflow != 0) && ((_i + _nxDiv) == int32(*elem20((*uint16)(unsafe.Pointer(&_pParent.XaiOvfl)), 0))) {
 62930  		*elem88((**uint8)(unsafe.Pointer(&_apDiv)), uintptr(_i)) = *elem88((**uint8)(unsafe.Pointer(&_pParent.XapOvfl)), 0)
 62931  		_pgno = _sqlite3Get4byte(tls, *elem88((**uint8)(unsafe.Pointer(&_apDiv)), uintptr(_i)))
 62932  		*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i)) = int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 62933  			v := _pParent.XxCellSize
 62934  			return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 62935  		}()(tls, _pParent, *elem88((**uint8)(unsafe.Pointer(&_apDiv)), uintptr(_i))))
 62936  		_pParent.XnOverflow = 0
 62937  		goto _28
 62938  	}
 62939  	*elem88((**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)))))))
 62940  	_pgno = _sqlite3Get4byte(tls, *elem88((**uint8)(unsafe.Pointer(&_apDiv)), uintptr(_i)))
 62941  	*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i)) = int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 62942  		v := _pParent.XxCellSize
 62943  		return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 62944  	}()(tls, _pParent, *elem88((**uint8)(unsafe.Pointer(&_apDiv)), uintptr(_i))))
 62945  	if (int32(_pBt.XbtsFlags) & int32(4)) == 0 {
 62946  		goto _29
 62947  	}
 62948  	_13_iOff = int32(crt.P2U(unsafe.Pointer(*elem88((**uint8)(unsafe.Pointer(&_apDiv)), uintptr(_i))))) - int32(crt.P2U(unsafe.Pointer(_pParent.XaData)))
 62949  	if (_13_iOff + (*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i)))) > int32(_pBt.XusableSize) {
 62950  		_rc = _sqlite3CorruptError(tls, int32(66253))
 62951  		crt.Xmemset(tls, unsafe.Pointer(&_apOld), int32(0), uint32(_i+int32(1))*uint32(4))
 62952  		goto _balance_cleanup
 62953  	}
 62954  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_aOvflSpace, uintptr(_13_iOff))), unsafe.Pointer(*elem88((**uint8)(unsafe.Pointer(&_apDiv)), uintptr(_i))), uint32(*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i))))
 62955  	*elem88((**uint8)(unsafe.Pointer(&_apDiv)), uintptr(_i)) = elem15(_aOvflSpace, uintptr(int32(uintptr(unsafe.Pointer(*elem88((**uint8)(unsafe.Pointer(&_apDiv)), uintptr(_i))))-uintptr(unsafe.Pointer(_pParent.XaData)))))
 62956  _29:
 62957  	_dropCell(tls, _pParent, (_i+_nxDiv)-int32(_pParent.XnOverflow), *elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i)), &_rc)
 62958  _28:
 62959  	goto _22
 62960  _23:
 62961  	_nMaxCells = (_nMaxCells + int32(3)) & int32(-4)
 62962  	_szScratch = int32(((uint32(_nMaxCells) * uint32(4)) + (uint32(_nMaxCells) * uint32(2))) + _pBt.XpageSize)
 62963  	func() {
 62964  		if _szScratch > (int32(6) * int32(_pBt.XpageSize)) {
 62965  			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)))
 62966  			crt.X__builtin_abort(tls)
 62967  		}
 62968  	}()
 62969  	_b.XapCell = (**uint8)(_sqlite3ScratchMalloc(tls, _szScratch))
 62970  	if _b.XapCell == nil {
 62971  		_rc = _sqlite3NomemError(tls, int32(66282))
 62972  		goto _balance_cleanup
 62973  	}
 62974  	_b.XszCell = (*uint16)(unsafe.Pointer(elem88(_b.XapCell, uintptr(_nMaxCells))))
 62975  	_aSpace1 = (*uint8)(unsafe.Pointer(elem20(_b.XszCell, uintptr(_nMaxCells))))
 62976  	func() {
 62977  		if (int32(uintptr(unsafe.Pointer(_aSpace1))) & int32(7)) != int32(0) {
 62978  			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)))
 62979  			crt.X__builtin_abort(tls)
 62980  		}
 62981  	}()
 62982  	*(**XMemPage)(unsafe.Pointer(&_b.XpRef)) = *elem30((**XMemPage)(unsafe.Pointer(&_apOld)), 0)
 62983  	_leafCorrection = uint16(int32((*XMemPage)(_b.XpRef).Xleaf) * int32(4))
 62984  	_leafData = int32((*XMemPage)(_b.XpRef).XintKeyLeaf)
 62985  	_i = int32(0)
 62986  _37:
 62987  	if _i >= _nOld {
 62988  		goto _40
 62989  	}
 62990  	_17_pOld = *elem30((**XMemPage)(unsafe.Pointer(&_apOld)), uintptr(_i))
 62991  	_17_limit = int32(_17_pOld.XnCell)
 62992  	_17_aData = _17_pOld.XaData
 62993  	_17_maskPage = _17_pOld.XmaskPage
 62994  	_17_piCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_17_aData)) + uintptr(_17_pOld.XcellOffset)))
 62995  	if int32(*elem15(_17_pOld.XaData, 0)) != int32(*elem15((*elem30((**XMemPage)(unsafe.Pointer(&_apOld)), 0)).XaData, 0)) {
 62996  		_rc = _sqlite3CorruptError(tls, int32(66320))
 62997  		goto _balance_cleanup
 62998  	}
 62999  	crt.Xmemset(tls, unsafe.Pointer(elem20(_b.XszCell, uintptr(_b.XnCell))), int32(0), uint32(2)*uint32(_17_limit+int32(_17_pOld.XnOverflow)))
 63000  	if int32(_17_pOld.XnOverflow) <= int32(0) {
 63001  		goto _42
 63002  	}
 63003  	_17_limit = int32(*elem20((*uint16)(unsafe.Pointer(&_17_pOld.XaiOvfl)), 0))
 63004  	_j = int32(0)
 63005  _43:
 63006  	if _j >= _17_limit {
 63007  		goto _46
 63008  	}
 63009  	*elem88(_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)))))))
 63010  	*(*uintptr)(unsafe.Pointer(&_17_piCell)) += uintptr(int32(2))
 63011  	_b.XnCell += 1
 63012  	_j += 1
 63013  	goto _43
 63014  _46:
 63015  	_k = int32(0)
 63016  _47:
 63017  	if _k >= int32(_17_pOld.XnOverflow) {
 63018  		goto _50
 63019  	}
 63020  	func() {
 63021  		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))) {
 63022  			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)))
 63023  			crt.X__builtin_abort(tls)
 63024  		}
 63025  	}()
 63026  	*elem88(_b.XapCell, uintptr(_b.XnCell)) = *elem88((**uint8)(unsafe.Pointer(&_17_pOld.XapOvfl)), uintptr(_k))
 63027  	_b.XnCell += 1
 63028  	_k += 1
 63029  	goto _47
 63030  _50:
 63031  _42:
 63032  	_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))))
 63033  _54:
 63034  	if crt.P2U(unsafe.Pointer(_17_piCell)) < crt.P2U(unsafe.Pointer(_17_piEnd)) {
 63035  		func() {
 63036  			if _b.XnCell >= _nMaxCells {
 63037  				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)))
 63038  				crt.X__builtin_abort(tls)
 63039  			}
 63040  		}()
 63041  		*elem88(_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)))))))
 63042  		*(*uintptr)(unsafe.Pointer(&_17_piCell)) += uintptr(int32(2))
 63043  		_b.XnCell += 1
 63044  		goto _54
 63045  	}
 63046  	*elem8((*int32)(unsafe.Pointer(&_cntOld)), uintptr(_i)) = _b.XnCell
 63047  	if _i >= (_nOld-int32(1)) || _leafData != 0 {
 63048  		goto _59
 63049  	}
 63050  	_23_sz = uint16(*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i)))
 63051  	func() {
 63052  		if _b.XnCell >= _nMaxCells {
 63053  			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)))
 63054  			crt.X__builtin_abort(tls)
 63055  		}
 63056  	}()
 63057  	*elem20(_b.XszCell, uintptr(_b.XnCell)) = _23_sz
 63058  	_23_pTemp = elem15(_aSpace1, uintptr(_iSpace1))
 63059  	_iSpace1 += int32(_23_sz)
 63060  	func() {
 63061  		if int32(_23_sz) > (int32(_pBt.XmaxLocal) + int32(23)) {
 63062  			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)))
 63063  			crt.X__builtin_abort(tls)
 63064  		}
 63065  	}()
 63066  	func() {
 63067  		if _iSpace1 > int32(_pBt.XpageSize) {
 63068  			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)))
 63069  			crt.X__builtin_abort(tls)
 63070  		}
 63071  	}()
 63072  	crt.Xmemcpy(tls, unsafe.Pointer(_23_pTemp), unsafe.Pointer(*elem88((**uint8)(unsafe.Pointer(&_apDiv)), uintptr(_i))), uint32(_23_sz))
 63073  	*elem88(_b.XapCell, uintptr(_b.XnCell)) = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_23_pTemp)) + uintptr(_leafCorrection)))
 63074  	func() {
 63075  		if int32(_leafCorrection) != int32(0) && int32(_leafCorrection) != int32(4) {
 63076  			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)))
 63077  			crt.X__builtin_abort(tls)
 63078  		}
 63079  	}()
 63080  	*elem20(_b.XszCell, uintptr(_b.XnCell)) = uint16(int32(*elem20(_b.XszCell, uintptr(_b.XnCell))) - int32(_leafCorrection))
 63081  	if _17_pOld.Xleaf == 0 {
 63082  		func() {
 63083  			if int32(_leafCorrection) != int32(0) {
 63084  				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)))
 63085  				crt.X__builtin_abort(tls)
 63086  			}
 63087  		}()
 63088  		func() {
 63089  			if int32(_17_pOld.XhdrOffset) != int32(0) {
 63090  				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)))
 63091  				crt.X__builtin_abort(tls)
 63092  			}
 63093  		}()
 63094  		crt.Xmemcpy(tls, unsafe.Pointer(*elem88(_b.XapCell, uintptr(_b.XnCell))), unsafe.Pointer(elem15(_17_pOld.XaData, uintptr(8))), uint32(4))
 63095  		goto _74
 63096  	}
 63097  	func() {
 63098  		if int32(_leafCorrection) != int32(4) {
 63099  			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)))
 63100  			crt.X__builtin_abort(tls)
 63101  		}
 63102  	}()
 63103  _77:
 63104  	if int32(*elem20(_b.XszCell, uintptr(_b.XnCell))) < int32(4) {
 63105  		func() {
 63106  			if int32(*elem20(_b.XszCell, uintptr(_b.XnCell))) != int32(3) && _sqlite3Config.XneverCorrupt != int32(0) {
 63107  				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)))
 63108  				crt.X__builtin_abort(tls)
 63109  			}
 63110  		}()
 63111  		func() {
 63112  			if (*elem88(_b.XapCell, uintptr(_b.XnCell))) != elem15(_aSpace1, uintptr(_iSpace1-int32(3))) && _sqlite3Config.XneverCorrupt != int32(0) {
 63113  				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)))
 63114  				crt.X__builtin_abort(tls)
 63115  			}
 63116  		}()
 63117  		*elem15(_aSpace1, uintptr(postInc2(&_iSpace1, 1))) = 0
 63118  		*elem20(_b.XszCell, uintptr(_b.XnCell)) += 1
 63119  		goto _77
 63120  	}
 63121  _74:
 63122  	_b.XnCell += 1
 63123  _59:
 63124  	_i += 1
 63125  	goto _37
 63126  _40:
 63127  	_usableSpace = int32((_pBt.XusableSize - uint32(12)) + uint32(_leafCorrection))
 63128  	_i = int32(0)
 63129  _85:
 63130  	if _i >= _nOld {
 63131  		goto _88
 63132  	}
 63133  	_27_p = *elem30((**XMemPage)(unsafe.Pointer(&_apOld)), uintptr(_i))
 63134  	*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i)) = _usableSpace - int32(_27_p.XnFree)
 63135  	_j = int32(0)
 63136  _89:
 63137  	if _j >= int32(_27_p.XnOverflow) {
 63138  		goto _92
 63139  	}
 63140  	*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i)) += int32(2) + int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 63141  		v := _27_p.XxCellSize
 63142  		return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 63143  	}()(tls, _27_p, *elem88((**uint8)(unsafe.Pointer(&_27_p.XapOvfl)), uintptr(_j))))
 63144  	_j += 1
 63145  	goto _89
 63146  _92:
 63147  	*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i)) = *elem8((*int32)(unsafe.Pointer(&_cntOld)), uintptr(_i))
 63148  	_i += 1
 63149  	goto _85
 63150  _88:
 63151  	_k = _nOld
 63152  	_i = int32(0)
 63153  _93:
 63154  	if _i >= _k {
 63155  		goto _96
 63156  	}
 63157  _97:
 63158  	if (*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i))) <= _usableSpace {
 63159  		goto _98
 63160  	}
 63161  	if (_i + int32(1)) < _k {
 63162  		goto _99
 63163  	}
 63164  	_k = _i + int32(2)
 63165  	if _k > int32(5) {
 63166  		_rc = _sqlite3CorruptError(tls, int32(66429))
 63167  		goto _balance_cleanup
 63168  	}
 63169  	*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_k-int32(1))) = int32(0)
 63170  	*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_k-int32(1))) = _b.XnCell
 63171  _99:
 63172  	_29_sz = int32(2) + int32(_cachedCellSize(tls, &_b, (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i)))-int32(1)))
 63173  	*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i)) -= _29_sz
 63174  	if _leafData != 0 {
 63175  		goto _101
 63176  	}
 63177  	if (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i))) < _b.XnCell {
 63178  		_29_sz = int32(2) + int32(_cachedCellSize(tls, &_b, *elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i))))
 63179  		goto _103
 63180  	}
 63181  	_29_sz = int32(0)
 63182  _103:
 63183  _101:
 63184  	*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i+int32(1))) += _29_sz
 63185  	*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i)) -= 1
 63186  	goto _97
 63187  _98:
 63188  	if (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i))) >= _b.XnCell {
 63189  		goto _105
 63190  	}
 63191  	_29_sz = int32(2) + int32(_cachedCellSize(tls, &_b, *elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i))))
 63192  	if ((*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i))) + _29_sz) > _usableSpace {
 63193  		goto _105
 63194  	}
 63195  	*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i)) += _29_sz
 63196  	*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i)) += 1
 63197  	if _leafData != 0 {
 63198  		goto _107
 63199  	}
 63200  	if (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i))) < _b.XnCell {
 63201  		_29_sz = int32(2) + int32(_cachedCellSize(tls, &_b, *elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i))))
 63202  		goto _109
 63203  	}
 63204  	_29_sz = int32(0)
 63205  _109:
 63206  _107:
 63207  	*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i+int32(1))) -= _29_sz
 63208  	goto _98
 63209  _105:
 63210  	if (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i))) >= _b.XnCell {
 63211  		_k = _i + int32(1)
 63212  		goto _114
 63213  	}
 63214  	if (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i))) <= func() int32 {
 63215  		if _i > int32(0) {
 63216  			return (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i-int32(1))))
 63217  		}
 63218  		return int32(0)
 63219  	}() {
 63220  		_rc = _sqlite3CorruptError(tls, int32(66462))
 63221  		goto _balance_cleanup
 63222  	}
 63223  _114:
 63224  	_i += 1
 63225  	goto _93
 63226  _96:
 63227  	_i = _k - int32(1)
 63228  _115:
 63229  	if _i <= int32(0) {
 63230  		goto _118
 63231  	}
 63232  	_42_szRight = *elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i))
 63233  	_42_szLeft = *elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i-int32(1)))
 63234  	_42_r = (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i-int32(1)))) - int32(1)
 63235  	_42_d = (_42_r + int32(1)) - _leafData
 63236  	_cachedCellSize(tls, &_b, _42_d)
 63237  _119:
 63238  	func() {
 63239  		if _42_d >= _nMaxCells {
 63240  			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)))
 63241  			crt.X__builtin_abort(tls)
 63242  		}
 63243  	}()
 63244  	func() {
 63245  		if _42_r >= _nMaxCells {
 63246  			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)))
 63247  			crt.X__builtin_abort(tls)
 63248  		}
 63249  	}()
 63250  	_cachedCellSize(tls, &_b, _42_r)
 63251  	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 {
 63252  		if _i == (_k - int32(1)) {
 63253  			return int32(0)
 63254  		}
 63255  		return int32(2)
 63256  	}())))) {
 63257  		goto _129
 63258  	}
 63259  	_42_szRight += int32(*elem20(_b.XszCell, uintptr(_42_d))) + int32(2)
 63260  	_42_szLeft -= int32(*elem20(_b.XszCell, uintptr(_42_r))) + int32(2)
 63261  	*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i-int32(1))) = _42_r
 63262  	_42_r -= 1
 63263  	_42_d -= 1
 63264  	if _42_r >= int32(0) {
 63265  		goto _119
 63266  	}
 63267  _129:
 63268  	*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i)) = _42_szRight
 63269  	*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_i-int32(1))) = _42_szLeft
 63270  	if (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i-int32(1)))) <= func() int32 {
 63271  		if _i > int32(1) {
 63272  			return (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i-int32(2))))
 63273  		}
 63274  		return int32(0)
 63275  	}() {
 63276  		_rc = _sqlite3CorruptError(tls, int32(66504))
 63277  		goto _balance_cleanup
 63278  	}
 63279  	_i -= 1
 63280  	goto _115
 63281  _118:
 63282  	func() {
 63283  		if (*elem8((*int32)(unsafe.Pointer(&_cntNew)), 0)) <= int32(0) && (_pParent.Xpgno != uint32(1) || int32(_pParent.XnCell) != int32(0)) && _sqlite3Config.XneverCorrupt != int32(0) {
 63284  			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)))
 63285  			crt.X__builtin_abort(tls)
 63286  		}
 63287  	}()
 63288  	_pageFlags = int32(*elem15((*elem30((**XMemPage)(unsafe.Pointer(&_apOld)), 0)).XaData, 0))
 63289  	_i = int32(0)
 63290  _138:
 63291  	if _i >= _k {
 63292  		goto _141
 63293  	}
 63294  	if _i >= _nOld {
 63295  		goto _142
 63296  	}
 63297  	_46_pNew = store84(elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_i)), *elem30((**XMemPage)(unsafe.Pointer(&_apOld)), uintptr(_i)))
 63298  	*elem30((**XMemPage)(unsafe.Pointer(&_apOld)), uintptr(_i)) = nil
 63299  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_46_pNew.XpDbPage))
 63300  	_nNew += 1
 63301  	if _rc != 0 {
 63302  		goto _balance_cleanup
 63303  	}
 63304  	goto _144
 63305  _142:
 63306  	func() {
 63307  		if _i <= int32(0) {
 63308  			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)))
 63309  			crt.X__builtin_abort(tls)
 63310  		}
 63311  	}()
 63312  	_rc = _allocateBtreePage(tls, _pBt, &_46_pNew, &_pgno, func() uint32 {
 63313  		if _bBulk != 0 {
 63314  			return uint32(1)
 63315  		}
 63316  		return _pgno
 63317  	}(), 0)
 63318  	if _rc != 0 {
 63319  		goto _balance_cleanup
 63320  	}
 63321  	_zeroPage(tls, _46_pNew, _pageFlags)
 63322  	*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_i)) = _46_pNew
 63323  	_nNew += 1
 63324  	*elem8((*int32)(unsafe.Pointer(&_cntOld)), uintptr(_i)) = _b.XnCell
 63325  	if _pBt.XautoVacuum == 0 {
 63326  		goto _150
 63327  	}
 63328  	_ptrmapPut(tls, _pBt, _46_pNew.Xpgno, uint8(5), _pParent.Xpgno, &_rc)
 63329  	if _rc != int32(0) {
 63330  		goto _balance_cleanup
 63331  	}
 63332  _150:
 63333  _144:
 63334  	_i += 1
 63335  	goto _138
 63336  _141:
 63337  	_i = int32(0)
 63338  _152:
 63339  	if _i >= _nNew {
 63340  		goto _155
 63341  	}
 63342  	*elem7((*uint32)(unsafe.Pointer(&_aPgOrder)), uintptr(_i)) = store23(elem7((*uint32)(unsafe.Pointer(&_aPgno)), uintptr(_i)), (*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_i))).Xpgno)
 63343  	*elem20((*uint16)(unsafe.Pointer(&_aPgFlags)), uintptr(_i)) = (*XPgHdr)((*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_i))).XpDbPage).Xflags
 63344  	_j = int32(0)
 63345  _156:
 63346  	if _j >= _i {
 63347  		goto _159
 63348  	}
 63349  	if (*elem7((*uint32)(unsafe.Pointer(&_aPgno)), uintptr(_j))) == (*elem7((*uint32)(unsafe.Pointer(&_aPgno)), uintptr(_i))) {
 63350  		func() {
 63351  			if _sqlite3Config.XneverCorrupt != int32(0) {
 63352  				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)))
 63353  				crt.X__builtin_abort(tls)
 63354  			}
 63355  		}()
 63356  		_rc = _sqlite3CorruptError(tls, int32(66578))
 63357  		goto _balance_cleanup
 63358  	}
 63359  	_j += 1
 63360  	goto _156
 63361  _159:
 63362  	_i += 1
 63363  	goto _152
 63364  _155:
 63365  	_i = int32(0)
 63366  _163:
 63367  	if _i >= _nNew {
 63368  		goto _166
 63369  	}
 63370  	_54_iBest = int32(0)
 63371  	_j = int32(1)
 63372  _167:
 63373  	if _j >= _nNew {
 63374  		goto _170
 63375  	}
 63376  	if (*elem7((*uint32)(unsafe.Pointer(&_aPgOrder)), uintptr(_j))) < (*elem7((*uint32)(unsafe.Pointer(&_aPgOrder)), uintptr(_54_iBest))) {
 63377  		_54_iBest = _j
 63378  	}
 63379  	_j += 1
 63380  	goto _167
 63381  _170:
 63382  	_pgno = *elem7((*uint32)(unsafe.Pointer(&_aPgOrder)), uintptr(_54_iBest))
 63383  	*elem7((*uint32)(unsafe.Pointer(&_aPgOrder)), uintptr(_54_iBest)) = uint32(4294967295)
 63384  	if _54_iBest == _i {
 63385  		goto _172
 63386  	}
 63387  	if _54_iBest > _i {
 63388  		_sqlite3PagerRekey(tls, (*XPgHdr)((*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_54_iBest))).XpDbPage), (_pBt.XnPage+uint32(_54_iBest))+uint32(1), 0)
 63389  	}
 63390  	_sqlite3PagerRekey(tls, (*XPgHdr)((*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_i))).XpDbPage), _pgno, *elem20((*uint16)(unsafe.Pointer(&_aPgFlags)), uintptr(_54_iBest)))
 63391  	(*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_i))).Xpgno = _pgno
 63392  _172:
 63393  	_i += 1
 63394  	goto _163
 63395  _166:
 63396  	func() {
 63397  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pParent.XpDbPage)) == 0 {
 63398  			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)))
 63399  			crt.X__builtin_abort(tls)
 63400  		}
 63401  	}()
 63402  	_sqlite3Put4byte(tls, _pRight, (*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_nNew-int32(1)))).Xpgno)
 63403  	if ((_pageFlags & int32(8)) == int32(0)) && (_nOld != _nNew) {
 63404  		_58_pOld = *elem30(func() **XMemPage {
 63405  			if _nNew > _nOld {
 63406  				return (**XMemPage)(unsafe.Pointer(&_apNew))
 63407  			}
 63408  			return (**XMemPage)(unsafe.Pointer(&_apOld))
 63409  		}(), uintptr(_nOld-int32(1)))
 63410  		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))), uint32(4))
 63411  	}
 63412  	if _pBt.XautoVacuum == 0 {
 63413  		goto _180
 63414  	}
 63415  	_59_pNew = *elem30((**XMemPage)(unsafe.Pointer(&_apNew)), 0)
 63416  	_59_aOld = _59_pNew.XaData
 63417  	_59_cntOldNext = int32(_59_pNew.XnCell) + int32(_59_pNew.XnOverflow)
 63418  	_59_usableSize = int32(_pBt.XusableSize)
 63419  	_59_iNew = int32(0)
 63420  	_59_iOld = int32(0)
 63421  	_i = int32(0)
 63422  _181:
 63423  	if _i >= _b.XnCell {
 63424  		goto _184
 63425  	}
 63426  	_60_pCell = *elem88(_b.XapCell, uintptr(_i))
 63427  	if _i == _59_cntOldNext {
 63428  		_61_pOld = func() *XMemPage {
 63429  			if preInc2(&_59_iOld, 1) < _nNew {
 63430  				return (*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_59_iOld)))
 63431  			}
 63432  			return (*elem30((**XMemPage)(unsafe.Pointer(&_apOld)), uintptr(_59_iOld)))
 63433  		}()
 63434  		_59_cntOldNext += (int32(_61_pOld.XnCell) + int32(_61_pOld.XnOverflow)) + bool2int(_leafData == 0)
 63435  		_59_aOld = _61_pOld.XaData
 63436  	}
 63437  	if _i != (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_59_iNew))) {
 63438  		goto _188
 63439  	}
 63440  	_59_pNew = *elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(preInc2(&_59_iNew, 1)))
 63441  	if _leafData == 0 {
 63442  		goto _182
 63443  	}
 63444  _188:
 63445  	if _59_iOld < _nNew && _59_pNew.Xpgno == (*elem7((*uint32)(unsafe.Pointer(&_aPgno)), uintptr(_59_iOld))) && (uint32(crt.P2U(unsafe.Pointer(_60_pCell))) >= uint32(crt.P2U(unsafe.Pointer(_59_aOld))) && uint32(crt.P2U(unsafe.Pointer(_60_pCell))) < uint32(crt.P2U(unsafe.Pointer(elem15(_59_aOld, uintptr(_59_usableSize)))))) {
 63446  		goto _193
 63447  	}
 63448  	if _leafCorrection == 0 {
 63449  		_ptrmapPut(tls, _pBt, _sqlite3Get4byte(tls, _60_pCell), uint8(5), _59_pNew.Xpgno, &_rc)
 63450  	}
 63451  	if int32(_cachedCellSize(tls, &_b, _i)) > int32(_59_pNew.XminLocal) {
 63452  		_ptrmapPutOvflPtr(tls, _59_pNew, _60_pCell, &_rc)
 63453  	}
 63454  	if _rc != 0 {
 63455  		goto _balance_cleanup
 63456  	}
 63457  _193:
 63458  _182:
 63459  	_i += 1
 63460  	goto _181
 63461  _184:
 63462  _180:
 63463  	_i = int32(0)
 63464  _197:
 63465  	if _i >= (_nNew - int32(1)) {
 63466  		goto _200
 63467  	}
 63468  	_66_pNew = *elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_i))
 63469  	_j = *elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_i))
 63470  	func() {
 63471  		if _j >= _nMaxCells {
 63472  			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)))
 63473  			crt.X__builtin_abort(tls)
 63474  		}
 63475  	}()
 63476  	func() {
 63477  		if (*elem88(_b.XapCell, uintptr(_j))) == nil {
 63478  			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)))
 63479  			crt.X__builtin_abort(tls)
 63480  		}
 63481  	}()
 63482  	_66_pCell = *elem88(_b.XapCell, uintptr(_j))
 63483  	_66_sz = int32(*elem20(_b.XszCell, uintptr(_j))) + int32(_leafCorrection)
 63484  	_66_pTemp = elem15(_aOvflSpace, uintptr(_iOvflSpace))
 63485  	if _66_pNew.Xleaf == 0 {
 63486  		crt.Xmemcpy(tls, unsafe.Pointer(elem15(_66_pNew.XaData, uintptr(8))), unsafe.Pointer(_66_pCell), uint32(4))
 63487  		goto _208
 63488  	}
 63489  	if _leafData != 0 {
 63490  		_j -= 1
 63491  		func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) {
 63492  			v := _66_pNew.XxParseCell
 63493  			return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v))
 63494  		}()(tls, _66_pNew, *elem88(_b.XapCell, uintptr(_j)), &_68_info)
 63495  		_66_pCell = _66_pTemp
 63496  		_66_sz = int32(4) + _sqlite3PutVarint(tls, elem15(_66_pCell, uintptr(4)), uint64(_68_info.XnKey))
 63497  		_66_pTemp = nil
 63498  		goto _208
 63499  	}
 63500  	*(*uintptr)(unsafe.Pointer(&_66_pCell)) -= uintptr(int32(4))
 63501  	if int32(*elem20(_b.XszCell, uintptr(_j))) == int32(4) {
 63502  		func() {
 63503  			if int32(_leafCorrection) != int32(4) {
 63504  				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)))
 63505  				crt.X__builtin_abort(tls)
 63506  			}
 63507  		}()
 63508  		_66_sz = int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 63509  			v := _pParent.XxCellSize
 63510  			return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 63511  		}()(tls, _pParent, _66_pCell))
 63512  	}
 63513  _208:
 63514  	_iOvflSpace += _66_sz
 63515  	func() {
 63516  		if _66_sz > (int32(_pBt.XmaxLocal) + int32(23)) {
 63517  			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)))
 63518  			crt.X__builtin_abort(tls)
 63519  		}
 63520  	}()
 63521  	func() {
 63522  		if _iOvflSpace > int32(_pBt.XpageSize) {
 63523  			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)))
 63524  			crt.X__builtin_abort(tls)
 63525  		}
 63526  	}()
 63527  	_insertCell(tls, _pParent, _nxDiv+_i, _66_pCell, _66_sz, _66_pTemp, _66_pNew.Xpgno, &_rc)
 63528  	if _rc != int32(0) {
 63529  		goto _balance_cleanup
 63530  	}
 63531  	func() {
 63532  		if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pParent.XpDbPage)) == 0 {
 63533  			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)))
 63534  			crt.X__builtin_abort(tls)
 63535  		}
 63536  	}()
 63537  	_i += 1
 63538  	goto _197
 63539  _200:
 63540  	_i = int32(1) - _nNew
 63541  _219:
 63542  	if _i >= _nNew {
 63543  		goto _222
 63544  	}
 63545  	_71_iPg = func() int32 {
 63546  		if _i < int32(0) {
 63547  			return (-_i)
 63548  		}
 63549  		return _i
 63550  	}()
 63551  	func() {
 63552  		if _71_iPg < int32(0) || _71_iPg >= _nNew {
 63553  			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)))
 63554  			crt.X__builtin_abort(tls)
 63555  		}
 63556  	}()
 63557  	if (*elem15((*uint8)(unsafe.Pointer(&_abDone)), uintptr(_71_iPg))) != 0 {
 63558  		goto _220
 63559  	}
 63560  	if _i < int32(0) && (*elem8((*int32)(unsafe.Pointer(&_cntOld)), uintptr(_71_iPg-int32(1)))) < (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_71_iPg-int32(1)))) {
 63561  		goto _230
 63562  	}
 63563  	func() {
 63564  		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 {
 63565  			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)))
 63566  			crt.X__builtin_abort(tls)
 63567  		}
 63568  	}()
 63569  	func() {
 63570  		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 {
 63571  			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)))
 63572  			crt.X__builtin_abort(tls)
 63573  		}
 63574  	}()
 63575  	if _71_iPg == int32(0) {
 63576  		_72_iNew = store2(&_72_iOld, int32(0))
 63577  		_72_nNewCell = *elem8((*int32)(unsafe.Pointer(&_cntNew)), 0)
 63578  		goto _239
 63579  	}
 63580  	_72_iOld = func() int32 {
 63581  		if _71_iPg < _nOld {
 63582  			return ((*elem8((*int32)(unsafe.Pointer(&_cntOld)), uintptr(_71_iPg-int32(1)))) + bool2int(_leafData == 0))
 63583  		}
 63584  		return _b.XnCell
 63585  	}()
 63586  	_72_iNew = (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_71_iPg-int32(1)))) + bool2int(_leafData == 0)
 63587  	_72_nNewCell = (*elem8((*int32)(unsafe.Pointer(&_cntNew)), uintptr(_71_iPg))) - _72_iNew
 63588  _239:
 63589  	_rc = _editPage(tls, *elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_71_iPg)), _72_iOld, _72_iNew, _72_nNewCell, &_b)
 63590  	if _rc != 0 {
 63591  		goto _balance_cleanup
 63592  	}
 63593  	*elem15((*uint8)(unsafe.Pointer(&_abDone)), uintptr(_71_iPg)) += 1
 63594  	(*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_71_iPg))).XnFree = uint16(_usableSpace - (*elem8((*int32)(unsafe.Pointer(&_szNew)), uintptr(_71_iPg))))
 63595  	func() {
 63596  		if int32((*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_71_iPg))).XnOverflow) != int32(0) {
 63597  			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)))
 63598  			crt.X__builtin_abort(tls)
 63599  		}
 63600  	}()
 63601  	func() {
 63602  		if int32((*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_71_iPg))).XnCell) != _72_nNewCell {
 63603  			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)))
 63604  			crt.X__builtin_abort(tls)
 63605  		}
 63606  	}()
 63607  _230:
 63608  _220:
 63609  	_i += 1
 63610  	goto _219
 63611  _222:
 63612  	func() {
 63613  		if crt.Xmemcmp(tls, unsafe.Pointer(&_abDone), unsafe.Pointer(str(82752)), uint32(_nNew)) != int32(0) {
 63614  			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)))
 63615  			crt.X__builtin_abort(tls)
 63616  		}
 63617  	}()
 63618  	func() {
 63619  		if _nOld <= int32(0) {
 63620  			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)))
 63621  			crt.X__builtin_abort(tls)
 63622  		}
 63623  	}()
 63624  	func() {
 63625  		if _nNew <= int32(0) {
 63626  			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)))
 63627  			crt.X__builtin_abort(tls)
 63628  		}
 63629  	}()
 63630  	if (_isRoot != 0 && (int32(_pParent.XnCell) == int32(0))) && (int32(_pParent.XhdrOffset) <= int32((*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), 0)).XnFree)) {
 63631  		func() {
 63632  			if _nNew != int32(1) && _sqlite3Config.XneverCorrupt != int32(0) {
 63633  				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)))
 63634  				crt.X__builtin_abort(tls)
 63635  			}
 63636  		}()
 63637  		_rc = _defragmentPage(tls, *elem30((**XMemPage)(unsafe.Pointer(&_apNew)), 0), int32(-1))
 63638  		func() {
 63639  			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) {
 63640  				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)))
 63641  				crt.X__builtin_abort(tls)
 63642  			}
 63643  		}()
 63644  		_copyNodeContent(tls, *elem30((**XMemPage)(unsafe.Pointer(&_apNew)), 0), _pParent, &_rc)
 63645  		_freePage(tls, *elem30((**XMemPage)(unsafe.Pointer(&_apNew)), 0), &_rc)
 63646  		goto _264
 63647  	}
 63648  	if _pBt.XautoVacuum == 0 || _leafCorrection != 0 {
 63649  		goto _264
 63650  	}
 63651  	_i = int32(0)
 63652  _265:
 63653  	if _i >= _nNew {
 63654  		goto _268
 63655  	}
 63656  	_77_key = _sqlite3Get4byte(tls, elem15((*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_i))).XaData, uintptr(8)))
 63657  	_ptrmapPut(tls, _pBt, _77_key, uint8(5), (*elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_i))).Xpgno, &_rc)
 63658  	_i += 1
 63659  	goto _265
 63660  _268:
 63661  _264:
 63662  	func() {
 63663  		if _pParent.XisInit == 0 {
 63664  			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)))
 63665  			crt.X__builtin_abort(tls)
 63666  		}
 63667  	}()
 63668  	_i = _nNew
 63669  _271:
 63670  	if _i >= _nOld {
 63671  		goto _balance_cleanup
 63672  	}
 63673  	_freePage(tls, *elem30((**XMemPage)(unsafe.Pointer(&_apOld)), uintptr(_i)), &_rc)
 63674  	_i += 1
 63675  	goto _271
 63676  _balance_cleanup:
 63677  	_sqlite3ScratchFree(tls, unsafe.Pointer(_b.XapCell))
 63678  	_i = int32(0)
 63679  _275:
 63680  	if _i >= _nOld {
 63681  		goto _278
 63682  	}
 63683  	_releasePage(tls, *elem30((**XMemPage)(unsafe.Pointer(&_apOld)), uintptr(_i)))
 63684  	_i += 1
 63685  	goto _275
 63686  _278:
 63687  	_i = int32(0)
 63688  _279:
 63689  	if _i >= _nNew {
 63690  		goto _282
 63691  	}
 63692  	_releasePage(tls, *elem30((**XMemPage)(unsafe.Pointer(&_apNew)), uintptr(_i)))
 63693  	_i += 1
 63694  	goto _279
 63695  _282:
 63696  	return _rc
 63697  
 63698  	_ = _apOld
 63699  	_ = _apNew
 63700  	_ = _apDiv
 63701  	_ = _cntNew
 63702  	_ = _cntOld
 63703  	_ = _szNew
 63704  	_ = _abDone
 63705  	_ = _aPgno
 63706  	_ = _aPgOrder
 63707  	_ = _aPgFlags
 63708  	panic(0)
 63709  }
 63710  
 63711  var _balance_nonrootØ00__func__Ø000 [16]int8
 63712  
 63713  func init() {
 63714  	crt.Xstrncpy(nil, &_balance_nonrootØ00__func__Ø000[0], str(82960), 16)
 63715  }
 63716  
 63717  // C comment
 63718  //  /*
 63719  //  ** Allocate memory that is to be used and released right away.
 63720  //  ** This routine is similar to alloca() in that it is not intended
 63721  //  ** for situations where the memory might be held long-term.  This
 63722  //  ** routine is intended to get memory to old large transient data
 63723  //  ** structures that would not normally fit on the stack of an
 63724  //  ** embedded processor.
 63725  //  */
 63726  func _sqlite3ScratchMalloc(tls *crt.TLS, _n int32) (r0 unsafe.Pointer) {
 63727  	var _p unsafe.Pointer
 63728  	func() {
 63729  		if _n <= int32(0) {
 63730  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24542), unsafe.Pointer(&_sqlite3ScratchMallocØ00__func__Ø000), unsafe.Pointer(str(1376)))
 63731  			crt.X__builtin_abort(tls)
 63732  		}
 63733  	}()
 63734  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
 63735  	_sqlite3StatusHighwater(tls, int32(8), _n)
 63736  	if (_mem0.XnScratchFree != 0) && (_sqlite3Config.XszScratch >= _n) {
 63737  		_p = _mem0.XpScratchFree
 63738  		*(**XScratchFreeslot)(unsafe.Pointer(&_mem0.XpScratchFree)) = (*XScratchFreeslot)((*XScratchFreeslot)(_mem0.XpScratchFree).XpNext)
 63739  		_mem0.XnScratchFree -= 1
 63740  		_sqlite3StatusUp(tls, int32(3), int32(1))
 63741  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
 63742  		goto _4
 63743  	}
 63744  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
 63745  	_p = _sqlite3Malloc(tls, uint64(_n))
 63746  	if _sqlite3Config.XbMemstat != 0 && (_p != nil) {
 63747  		Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
 63748  		_sqlite3StatusUp(tls, int32(4), _sqlite3MallocSize(tls, _p))
 63749  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
 63750  	}
 63751  _4:
 63752  	func() {
 63753  		if Xsqlite3_mutex_notheld(tls, (*Xsqlite3_mutex)(_mem0.Xmutex)) == 0 {
 63754  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24562), unsafe.Pointer(&_sqlite3ScratchMallocØ00__func__Ø000), unsafe.Pointer(str(82976)))
 63755  			crt.X__builtin_abort(tls)
 63756  		}
 63757  	}()
 63758  	return _p
 63759  }
 63760  
 63761  var _sqlite3ScratchMallocØ00__func__Ø000 [21]int8
 63762  
 63763  func init() {
 63764  	crt.Xstrncpy(nil, &_sqlite3ScratchMallocØ00__func__Ø000[0], str(83010), 21)
 63765  }
 63766  
 63767  func _cachedCellSize(tls *crt.TLS, _p *XCellArray, _N int32) (r0 uint16) {
 63768  	func() {
 63769  		if _N < int32(0) || _N >= _p.XnCell {
 63770  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65577), unsafe.Pointer(&_cachedCellSizeØ00__func__Ø000), unsafe.Pointer(str(83031)))
 63771  			crt.X__builtin_abort(tls)
 63772  		}
 63773  	}()
 63774  	if (*elem20(_p.XszCell, uintptr(_N))) != 0 {
 63775  		return *elem20(_p.XszCell, uintptr(_N))
 63776  	}
 63777  	return _computeCellSize(tls, _p, _N)
 63778  }
 63779  
 63780  var _cachedCellSizeØ00__func__Ø000 [15]int8
 63781  
 63782  func init() {
 63783  	crt.Xstrncpy(nil, &_cachedCellSizeØ00__func__Ø000[0], str(83050), 15)
 63784  }
 63785  
 63786  // C comment
 63787  //  /*
 63788  //  ** Return the size of the Nth element of the cell array
 63789  //  */
 63790  func _computeCellSize(tls *crt.TLS, _p *XCellArray, _N int32) (r0 uint16) {
 63791  	func() {
 63792  		if _N < int32(0) || _N >= _p.XnCell {
 63793  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65571), unsafe.Pointer(&_computeCellSizeØ00__func__Ø000), unsafe.Pointer(str(83031)))
 63794  			crt.X__builtin_abort(tls)
 63795  		}
 63796  	}()
 63797  	func() {
 63798  		if int32(*elem20(_p.XszCell, uintptr(_N))) != int32(0) {
 63799  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65572), unsafe.Pointer(&_computeCellSizeØ00__func__Ø000), unsafe.Pointer(str(83065)))
 63800  			crt.X__builtin_abort(tls)
 63801  		}
 63802  	}()
 63803  	*elem20(_p.XszCell, uintptr(_N)) = func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 63804  		v := (*XMemPage)(_p.XpRef).XxCellSize
 63805  		return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 63806  	}()(tls, (*XMemPage)(_p.XpRef), *elem88(_p.XapCell, uintptr(_N)))
 63807  	return *elem20(_p.XszCell, uintptr(_N))
 63808  }
 63809  
 63810  var _computeCellSizeØ00__func__Ø000 [16]int8
 63811  
 63812  func init() {
 63813  	crt.Xstrncpy(nil, &_computeCellSizeØ00__func__Ø000[0], str(83081), 16)
 63814  }
 63815  
 63816  // C comment
 63817  //  /*
 63818  //  ** The page handle passed as the first argument refers to a dirty page
 63819  //  ** with a page number other than iNew. This function changes the page's
 63820  //  ** page number to iNew and sets the value of the PgHdr.flags field to
 63821  //  ** the value passed as the third parameter.
 63822  //  */
 63823  func _sqlite3PagerRekey(tls *crt.TLS, _pPg *XPgHdr, _iNew uint32, _flags uint16) {
 63824  	func() {
 63825  		if _pPg.Xpgno == _iNew {
 63826  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54015), unsafe.Pointer(&_sqlite3PagerRekeyØ00__func__Ø000), unsafe.Pointer(str(83097)))
 63827  			crt.X__builtin_abort(tls)
 63828  		}
 63829  	}()
 63830  	_pPg.Xflags = _flags
 63831  	_sqlite3PcacheMove(tls, _pPg, _iNew)
 63832  }
 63833  
 63834  var _sqlite3PagerRekeyØ00__func__Ø000 [18]int8
 63835  
 63836  func init() {
 63837  	crt.Xstrncpy(nil, &_sqlite3PagerRekeyØ00__func__Ø000[0], str(83113), 18)
 63838  }
 63839  
 63840  // C comment
 63841  //  /*
 63842  //  ** apCell[] and szCell[] contains pointers to and sizes of all cells in the
 63843  //  ** pages being balanced.  The current page, pPg, has pPg->nCell cells starting
 63844  //  ** with apCell[iOld].  After balancing, this page should hold nNew cells
 63845  //  ** starting at apCell[iNew].
 63846  //  **
 63847  //  ** This routine makes the necessary adjustments to pPg so that it contains
 63848  //  ** the correct cells after being balanced.
 63849  //  **
 63850  //  ** The pPg->nFree field is invalid when this function returns. It is the
 63851  //  ** responsibility of the caller to set it correctly.
 63852  //  */
 63853  func _editPage(tls *crt.TLS, _pPg *XMemPage, _iOld int32, _iNew int32, _nNew int32, _pCArray *XCellArray) (r0 int32) {
 63854  	var _hdr, _nCell, _i, _iOldEnd, _iNewEnd, _1_nShift, _3_nAdd, _4_iCell, _6_iOff int32
 63855  	var _aData, _pBegin, _pData, _pCellptr, _pTmp, _6_pCell *uint8
 63856  	_aData = _pPg.XaData
 63857  	_hdr = int32(_pPg.XhdrOffset)
 63858  	_pBegin = elem15(_pPg.XaCellIdx, uintptr(_nNew*int32(2)))
 63859  	_nCell = int32(_pPg.XnCell)
 63860  	_iOldEnd = (_iOld + int32(_pPg.XnCell)) + int32(_pPg.XnOverflow)
 63861  	_iNewEnd = _iNew + _nNew
 63862  	_pTmp = (*uint8)(_sqlite3PagerTempSpace(tls, (*XPager)((*XBtShared)(_pPg.XpBt).XpPager)))
 63863  	crt.Xmemcpy(tls, unsafe.Pointer(_pTmp), unsafe.Pointer(_aData), (*XBtShared)(_pPg.XpBt).XusableSize)
 63864  	if _iOld < _iNew {
 63865  		_1_nShift = _pageFreeArray(tls, _pPg, _iOld, _iNew-_iOld, _pCArray)
 63866  		crt.Xmemmove(tls, unsafe.Pointer(_pPg.XaCellIdx), unsafe.Pointer(elem15(_pPg.XaCellIdx, uintptr(_1_nShift*int32(2)))), uint32(_nCell*int32(2)))
 63867  		_nCell -= _1_nShift
 63868  	}
 63869  	if _iNewEnd < _iOldEnd {
 63870  		_nCell -= _pageFreeArray(tls, _pPg, _iNewEnd, _iOldEnd-_iNewEnd, _pCArray)
 63871  	}
 63872  	_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)))
 63873  	if crt.P2U(unsafe.Pointer(_pData)) < crt.P2U(unsafe.Pointer(_pBegin)) {
 63874  		goto _editpage_fail
 63875  	}
 63876  	if _iNew >= _iOld {
 63877  		goto _3
 63878  	}
 63879  	_3_nAdd = func() int32 {
 63880  		if _nNew < (_iOld - _iNew) {
 63881  			return _nNew
 63882  		}
 63883  		return (_iOld - _iNew)
 63884  	}()
 63885  	func() {
 63886  		if (_iOld-_iNew) >= _nNew && _nCell != int32(0) && _sqlite3Config.XneverCorrupt != int32(0) {
 63887  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65805), unsafe.Pointer(&_editPageØ00__func__Ø000), unsafe.Pointer(str(83131)))
 63888  			crt.X__builtin_abort(tls)
 63889  		}
 63890  	}()
 63891  	_pCellptr = _pPg.XaCellIdx
 63892  	crt.Xmemmove(tls, unsafe.Pointer(elem15(_pCellptr, uintptr(_3_nAdd*int32(2)))), unsafe.Pointer(_pCellptr), uint32(_nCell*int32(2)))
 63893  	if _pageInsertArray(tls, _pPg, _pBegin, &_pData, _pCellptr, _iNew, _3_nAdd, _pCArray) != 0 {
 63894  		goto _editpage_fail
 63895  	}
 63896  	_nCell += _3_nAdd
 63897  _3:
 63898  	_i = int32(0)
 63899  _11:
 63900  	if _i >= int32(_pPg.XnOverflow) {
 63901  		goto _14
 63902  	}
 63903  	_4_iCell = (_iOld + int32(*elem20((*uint16)(unsafe.Pointer(&_pPg.XaiOvfl)), uintptr(_i)))) - _iNew
 63904  	if _4_iCell < int32(0) || _4_iCell >= _nNew {
 63905  		goto _16
 63906  	}
 63907  	_pCellptr = elem15(_pPg.XaCellIdx, uintptr(_4_iCell*int32(2)))
 63908  	crt.Xmemmove(tls, unsafe.Pointer(elem15(_pCellptr, uintptr(2))), unsafe.Pointer(_pCellptr), uint32((_nCell-_4_iCell)*int32(2)))
 63909  	_nCell += 1
 63910  	if _pageInsertArray(tls, _pPg, _pBegin, &_pData, _pCellptr, _4_iCell+_iNew, int32(1), _pCArray) != 0 {
 63911  		goto _editpage_fail
 63912  	}
 63913  _16:
 63914  	_i += 1
 63915  	goto _11
 63916  _14:
 63917  	_pCellptr = elem15(_pPg.XaCellIdx, uintptr(_nCell*int32(2)))
 63918  	if _pageInsertArray(tls, _pPg, _pBegin, &_pData, _pCellptr, _iNew+_nCell, _nNew-_nCell, _pCArray) != 0 {
 63919  		goto _editpage_fail
 63920  	}
 63921  	_pPg.XnCell = uint16(_nNew)
 63922  	_pPg.XnOverflow = 0
 63923  	*elem15(elem15(func() *uint8 {
 63924  		*elem15(elem15(_aData, uintptr(_hdr+int32(3))), 0) = uint8(int32(_pPg.XnCell) >> 8)
 63925  		return _aData
 63926  	}(), uintptr(_hdr+int32(3))), uintptr(1)) = uint8(_pPg.XnCell)
 63927  	*elem15(elem15(func() *uint8 {
 63928  		*elem15(elem15(_aData, uintptr(_hdr+int32(5))), 0) = uint8(int32(uintptr(unsafe.Pointer(_pData))-uintptr(unsafe.Pointer(_aData))) >> 8)
 63929  		return _aData
 63930  	}(), uintptr(_hdr+int32(5))), uintptr(1)) = uint8(int32(uintptr(unsafe.Pointer(_pData)) - uintptr(unsafe.Pointer(_aData))))
 63931  	_i = int32(0)
 63932  _19:
 63933  	if _i >= _nNew || _sqlite3Config.XneverCorrupt == int32(0) {
 63934  		goto _23
 63935  	}
 63936  	_6_pCell = *elem88(_pCArray.XapCell, uintptr(_i+_iNew))
 63937  	_6_iOff = (int32(*elem15(elem15(_pPg.XaCellIdx, uintptr(_i*int32(2))), 0)) << 8) | int32(*elem15(elem15(_pPg.XaCellIdx, uintptr(_i*int32(2))), uintptr(1)))
 63938  	if (uint32(crt.P2U(unsafe.Pointer(_6_pCell))) >= uint32(crt.P2U(unsafe.Pointer(_aData)))) && (uint32(crt.P2U(unsafe.Pointer(_6_pCell))) < uint32(crt.P2U(unsafe.Pointer(elem15(_aData, uintptr((*XBtShared)(_pPg.XpBt).XusableSize)))))) {
 63939  		_6_pCell = elem15(_pTmp, uintptr(int32(uintptr(unsafe.Pointer(_6_pCell))-uintptr(unsafe.Pointer(_aData)))))
 63940  	}
 63941  	func() {
 63942  		if int32(0) != crt.Xmemcmp(tls, unsafe.Pointer(_6_pCell), unsafe.Pointer(elem15(_aData, uintptr(_6_iOff))), uint32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 63943  			v := (*XMemPage)(_pCArray.XpRef).XxCellSize
 63944  			return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 63945  		}()(tls, (*XMemPage)(_pCArray.XpRef), *elem88(_pCArray.XapCell, uintptr(_i+_iNew))))) {
 63946  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65849), unsafe.Pointer(&_editPageØ00__func__Ø000), unsafe.Pointer(str(83174)))
 63947  			crt.X__builtin_abort(tls)
 63948  		}
 63949  	}()
 63950  	_i += 1
 63951  	goto _19
 63952  _23:
 63953  	return int32(0)
 63954  
 63955  _editpage_fail:
 63956  	_populateCellCache(tls, _pCArray, _iNew, _nNew)
 63957  	return _rebuildPage(tls, _pPg, _nNew, elem88(_pCArray.XapCell, uintptr(_iNew)), elem20(_pCArray.XszCell, uintptr(_iNew)))
 63958  }
 63959  
 63960  // C comment
 63961  //  /*
 63962  //  ** Array apCell[] contains nCell pointers to b-tree cells. Array szCell
 63963  //  ** contains the size in bytes of each such cell. This function adds the
 63964  //  ** space associated with each cell in the array that is currently stored
 63965  //  ** within the body of pPg to the pPg free-list. The cell-pointers and other
 63966  //  ** fields of the page are not updated.
 63967  //  **
 63968  //  ** This function returns the total number of cells added to the free-list.
 63969  //  */
 63970  func _pageFreeArray(tls *crt.TLS, _pPg *XMemPage, _iFirst int32, _nCell int32, _pCArray *XCellArray) (r0 int32) {
 63971  	var _nRet, _i, _iEnd, _szFree, _2_sz int32
 63972  	var _aData, _pEnd, _pStart, _pFree, _1_pCell *uint8
 63973  	_aData = _pPg.XaData
 63974  	_pEnd = elem15(_aData, uintptr((*XBtShared)(_pPg.XpBt).XusableSize))
 63975  	_pStart = elem15(_aData, uintptr((int32(_pPg.XhdrOffset)+int32(8))+int32(_pPg.XchildPtrSize)))
 63976  	_nRet = int32(0)
 63977  	_iEnd = _iFirst + _nCell
 63978  	_pFree = nil
 63979  	_szFree = int32(0)
 63980  	_i = _iFirst
 63981  _0:
 63982  	if _i >= _iEnd {
 63983  		goto _3
 63984  	}
 63985  	_1_pCell = *elem88(_pCArray.XapCell, uintptr(_i))
 63986  	if uint32(crt.P2U(unsafe.Pointer(_1_pCell))) < uint32(crt.P2U(unsafe.Pointer(_pStart))) || uint32(crt.P2U(unsafe.Pointer(_1_pCell))) >= uint32(crt.P2U(unsafe.Pointer(_pEnd))) {
 63987  		goto _5
 63988  	}
 63989  	_2_sz = int32(*elem20(_pCArray.XszCell, uintptr(_i)))
 63990  	func() {
 63991  		if _2_sz <= int32(0) {
 63992  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65732), unsafe.Pointer(&_pageFreeArrayØ00__func__Ø000), unsafe.Pointer(str(83271)))
 63993  			crt.X__builtin_abort(tls)
 63994  		}
 63995  	}()
 63996  	if _pFree == (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_pCell))+uintptr(_2_sz))) {
 63997  		goto _8
 63998  	}
 63999  	if _pFree != nil {
 64000  		func() {
 64001  			if crt.P2U(unsafe.Pointer(_pFree)) <= crt.P2U(unsafe.Pointer(_aData)) || int32(uintptr(unsafe.Pointer(_pFree))-uintptr(unsafe.Pointer(_aData))) >= int32(65536) {
 64002  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65735), unsafe.Pointer(&_pageFreeArrayØ00__func__Ø000), unsafe.Pointer(str(83276)))
 64003  				crt.X__builtin_abort(tls)
 64004  			}
 64005  		}()
 64006  		_freeSpace(tls, _pPg, uint16(int32(uintptr(unsafe.Pointer(_pFree))-uintptr(unsafe.Pointer(_aData)))), uint16(_szFree))
 64007  	}
 64008  	_pFree = _1_pCell
 64009  	_szFree = _2_sz
 64010  	if crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pFree))+uintptr(_2_sz))))) > crt.P2U(unsafe.Pointer(_pEnd)) {
 64011  		return int32(0)
 64012  	}
 64013  	goto _14
 64014  _8:
 64015  	_pFree = _1_pCell
 64016  	_szFree += _2_sz
 64017  _14:
 64018  	_nRet += 1
 64019  _5:
 64020  	_i += 1
 64021  	goto _0
 64022  _3:
 64023  	if _pFree != nil {
 64024  		func() {
 64025  			if crt.P2U(unsafe.Pointer(_pFree)) <= crt.P2U(unsafe.Pointer(_aData)) || int32(uintptr(unsafe.Pointer(_pFree))-uintptr(unsafe.Pointer(_aData))) >= int32(65536) {
 64026  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65749), unsafe.Pointer(&_pageFreeArrayØ00__func__Ø000), unsafe.Pointer(str(83276)))
 64027  				crt.X__builtin_abort(tls)
 64028  			}
 64029  		}()
 64030  		_freeSpace(tls, _pPg, uint16(int32(uintptr(unsafe.Pointer(_pFree))-uintptr(unsafe.Pointer(_aData)))), uint16(_szFree))
 64031  	}
 64032  	return _nRet
 64033  }
 64034  
 64035  var _pageFreeArrayØ00__func__Ø000 [14]int8
 64036  
 64037  func init() {
 64038  	crt.Xstrncpy(nil, &_pageFreeArrayØ00__func__Ø000[0], str(83313), 14)
 64039  }
 64040  
 64041  var _editPageØ00__func__Ø000 [9]int8
 64042  
 64043  func init() {
 64044  	crt.Xstrncpy(nil, &_editPageØ00__func__Ø000[0], str(83327), 9)
 64045  }
 64046  
 64047  // C comment
 64048  //  /*
 64049  //  ** Array apCell[] contains nCell pointers to b-tree cells. Array szCell
 64050  //  ** contains the size in bytes of each such cell. This function attempts to
 64051  //  ** add the cells stored in the array to page pPg. If it cannot (because
 64052  //  ** the page needs to be defragmented before the cells will fit), non-zero
 64053  //  ** is returned. Otherwise, if the cells are added successfully, zero is
 64054  //  ** returned.
 64055  //  **
 64056  //  ** Argument pCellptr points to the first entry in the cell-pointer array
 64057  //  ** (part of page pPg) to populate. After cell apCell[0] is written to the
 64058  //  ** page body, a 16-bit offset is written to pCellptr. And so on, for each
 64059  //  ** cell in the array. It is the responsibility of the caller to ensure
 64060  //  ** that it is safe to overwrite this part of the cell-pointer array.
 64061  //  **
 64062  //  ** When this function is called, *ppData points to the start of the
 64063  //  ** content area on page pPg. If the size of the content area is extended,
 64064  //  ** *ppData is updated to point to the new start of the content area
 64065  //  ** before returning.
 64066  //  **
 64067  //  ** Finally, argument pBegin points to the byte immediately following the
 64068  //  ** end of the space required by this page for the cell-pointer area (for
 64069  //  ** all cells - not just those inserted by the current call). If the content
 64070  //  ** area must be extended to before this point in order to accomodate all
 64071  //  ** cells in apCell[], then the cells do not fit and non-zero is returned.
 64072  //  */
 64073  func _pageInsertArray(tls *crt.TLS, _pPg *XMemPage, _pBegin *uint8, _ppData **uint8, _pCellptr *uint8, _iFirst int32, _nCell int32, _pCArray *XCellArray) (r0 int32) {
 64074  	var _i, _iEnd, _1_sz, _1_rc int32
 64075  	var _aData, _pData, _1_pSlot *uint8
 64076  	_aData = _pPg.XaData
 64077  	_pData = *_ppData
 64078  	_iEnd = _iFirst + _nCell
 64079  	func() {
 64080  		if _sqlite3Config.XneverCorrupt != int32(0) && int32(_pPg.XhdrOffset) != int32(0) {
 64081  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65677), unsafe.Pointer(&_pageInsertArrayØ00__func__Ø000), unsafe.Pointer(str(83336)))
 64082  			crt.X__builtin_abort(tls)
 64083  		}
 64084  	}()
 64085  	_i = _iFirst
 64086  _3:
 64087  	if _i >= _iEnd {
 64088  		goto _6
 64089  	}
 64090  	_1_sz = int32(_cachedCellSize(tls, _pCArray, _i))
 64091  	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 {
 64092  		goto _9
 64093  	}
 64094  	if int32(uintptr(unsafe.Pointer(_pData))-uintptr(unsafe.Pointer(_pBegin))) < _1_sz {
 64095  		return int32(1)
 64096  	}
 64097  	*(*uintptr)(unsafe.Pointer(&_pData)) -= uintptr(_1_sz)
 64098  	_1_pSlot = _pData
 64099  _9:
 64100  	func() {
 64101  		if crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_pSlot))+uintptr(_1_sz))))) > crt.P2U(unsafe.Pointer(*elem88(_pCArray.XapCell, uintptr(_i)))) && crt.P2U(unsafe.Pointer(_1_pSlot)) < crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*elem88(_pCArray.XapCell, uintptr(_i))))+uintptr(_1_sz))))) && _sqlite3Config.XneverCorrupt != int32(0) {
 64102  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65690), unsafe.Pointer(&_pageInsertArrayØ00__func__Ø000), unsafe.Pointer(str(83368)))
 64103  			crt.X__builtin_abort(tls)
 64104  		}
 64105  	}()
 64106  	crt.Xmemmove(tls, unsafe.Pointer(_1_pSlot), unsafe.Pointer(*elem88(_pCArray.XapCell, uintptr(_i))), uint32(_1_sz))
 64107  	*elem15(func() *uint8 {
 64108  		*elem15(_pCellptr, 0) = uint8(int32(uintptr(unsafe.Pointer(_1_pSlot))-uintptr(unsafe.Pointer(_aData))) >> 8)
 64109  		return _pCellptr
 64110  	}(), uintptr(1)) = uint8(int32(uintptr(unsafe.Pointer(_1_pSlot)) - uintptr(unsafe.Pointer(_aData))))
 64111  	*(*uintptr)(unsafe.Pointer(&_pCellptr)) += uintptr(int32(2))
 64112  	_i += 1
 64113  	goto _3
 64114  _6:
 64115  	*_ppData = _pData
 64116  	return int32(0)
 64117  }
 64118  
 64119  var _pageInsertArrayØ00__func__Ø000 [16]int8
 64120  
 64121  func init() {
 64122  	crt.Xstrncpy(nil, &_pageInsertArrayØ00__func__Ø000[0], str(83447), 16)
 64123  }
 64124  
 64125  // C comment
 64126  //  /*
 64127  //  ** Make sure the cell sizes at idx, idx+1, ..., idx+N-1 have been
 64128  //  ** computed.
 64129  //  */
 64130  func _populateCellCache(tls *crt.TLS, _p *XCellArray, _idx int32, _N int32) {
 64131  	func() {
 64132  		if _idx < int32(0) || (_idx+_N) > _p.XnCell {
 64133  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65553), unsafe.Pointer(&_populateCellCacheØ00__func__Ø000), unsafe.Pointer(str(83463)))
 64134  			crt.X__builtin_abort(tls)
 64135  		}
 64136  	}()
 64137  _3:
 64138  	if _N <= int32(0) {
 64139  		goto _4
 64140  	}
 64141  	func() {
 64142  		if (*elem88(_p.XapCell, uintptr(_idx))) == nil {
 64143  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65555), unsafe.Pointer(&_populateCellCacheØ00__func__Ø000), unsafe.Pointer(str(83489)))
 64144  			crt.X__builtin_abort(tls)
 64145  		}
 64146  	}()
 64147  	if int32(*elem20(_p.XszCell, uintptr(_idx))) == int32(0) {
 64148  		*elem20(_p.XszCell, uintptr(_idx)) = func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 64149  			v := (*XMemPage)(_p.XpRef).XxCellSize
 64150  			return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 64151  		}()(tls, (*XMemPage)(_p.XpRef), *elem88(_p.XapCell, uintptr(_idx)))
 64152  		goto _8
 64153  	}
 64154  	func() {
 64155  		if _sqlite3Config.XneverCorrupt != int32(0) && int32(*elem20(_p.XszCell, uintptr(_idx))) != int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 64156  			v := (*XMemPage)(_p.XpRef).XxCellSize
 64157  			return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 64158  		}()(tls, (*XMemPage)(_p.XpRef), *elem88(_p.XapCell, uintptr(_idx)))) {
 64159  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(65559), unsafe.Pointer(&_populateCellCacheØ00__func__Ø000), unsafe.Pointer(str(83507)))
 64160  			crt.X__builtin_abort(tls)
 64161  		}
 64162  	}()
 64163  _8:
 64164  	_idx += 1
 64165  	_N -= 1
 64166  	goto _3
 64167  _4:
 64168  }
 64169  
 64170  var _populateCellCacheØ00__func__Ø000 [18]int8
 64171  
 64172  func init() {
 64173  	crt.Xstrncpy(nil, &_populateCellCacheØ00__func__Ø000[0], str(83581), 18)
 64174  }
 64175  
 64176  func _freePage(tls *crt.TLS, _pPage *XMemPage, _pRC *int32) {
 64177  	if (*_pRC) == int32(0) {
 64178  		*_pRC = _freePage2(tls, (*XBtShared)(_pPage.XpBt), _pPage, _pPage.Xpgno)
 64179  	}
 64180  }
 64181  
 64182  func _sqlite3ScratchFree(tls *crt.TLS, _p unsafe.Pointer) {
 64183  	var _4_iSize int32
 64184  	var _2_pSlot *XScratchFreeslot
 64185  	if _p == nil {
 64186  		goto _0
 64187  	}
 64188  	if (uint32(crt.P2U(_p)) >= uint32(crt.P2U(_sqlite3Config.XpScratch))) && (uint32(crt.P2U(_p)) < uint32(crt.P2U(_mem0.XpScratchEnd))) {
 64189  		_2_pSlot = (*XScratchFreeslot)(_p)
 64190  		Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
 64191  		*(**XScratchFreeslot)(unsafe.Pointer(&_2_pSlot.XpNext)) = (*XScratchFreeslot)(_mem0.XpScratchFree)
 64192  		*(**XScratchFreeslot)(unsafe.Pointer(&_mem0.XpScratchFree)) = _2_pSlot
 64193  		_mem0.XnScratchFree += 1
 64194  		func() {
 64195  			if _mem0.XnScratchFree > uint32(_sqlite3Config.XnScratch) {
 64196  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(24597), unsafe.Pointer(&_sqlite3ScratchFreeØ00__func__Ø000), unsafe.Pointer(str(83599)))
 64197  				crt.X__builtin_abort(tls)
 64198  			}
 64199  		}()
 64200  		_sqlite3StatusDown(tls, int32(3), int32(1))
 64201  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
 64202  		goto _5
 64203  	}
 64204  
 64205  	if _sqlite3Config.XbMemstat != 0 {
 64206  		_4_iSize = _sqlite3MallocSize(tls, _p)
 64207  		Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
 64208  		_sqlite3StatusDown(tls, int32(4), _4_iSize)
 64209  		_sqlite3StatusDown(tls, int32(0), _4_iSize)
 64210  		_sqlite3StatusDown(tls, int32(9), int32(1))
 64211  		(_sqlite3Config.Xm.XxFree)(tls, _p)
 64212  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
 64213  		goto _7
 64214  	}
 64215  	(_sqlite3Config.Xm.XxFree)(tls, _p)
 64216  _7:
 64217  _5:
 64218  _0:
 64219  }
 64220  
 64221  var _sqlite3ScratchFreeØ00__func__Ø000 [19]int8
 64222  
 64223  func init() {
 64224  	crt.Xstrncpy(nil, &_sqlite3ScratchFreeØ00__func__Ø000[0], str(83654), 19)
 64225  }
 64226  
 64227  // C comment
 64228  //  /*
 64229  //  ** Delete the entry that the cursor is pointing to.
 64230  //  **
 64231  //  ** If the BTREE_SAVEPOSITION bit of the flags parameter is zero, then
 64232  //  ** the cursor is left pointing at an arbitrary location after the delete.
 64233  //  ** But if that bit is set, then the cursor is left in a state such that
 64234  //  ** the next call to BtreeNext() or BtreePrev() moves it to the same row
 64235  //  ** as it would have been on if the call to BtreeDelete() had been omitted.
 64236  //  **
 64237  //  ** The BTREE_AUXDELETE bit of flags indicates that is one of several deletes
 64238  //  ** associated with a single table entry and its indexes.  Only one of those
 64239  //  ** deletes is considered the "primary" delete.  The primary delete occurs
 64240  //  ** on a cursor that is not a BTREE_FORDELETE cursor.  All but one delete
 64241  //  ** operation on non-FORDELETE cursors is tagged with the AUXDELETE flag.
 64242  //  ** The BTREE_AUXDELETE bit is a hint that is not used by this implementation,
 64243  //  ** but which might be used by alternative storage engines.
 64244  //  */
 64245  func _sqlite3BtreeDelete(tls *crt.TLS, _pCur *XBtCursor, _flags uint8) (r0 int32) {
 64246  	var _rc, _iCellIdx, _iCellDepth, _bSkipnext, _4_notUsed, _7_nCell int32
 64247  	var _7_n uint32
 64248  	var _bPreserve uint8
 64249  	var _pCell, _7_pTmp *uint8
 64250  	var _p *XBtree
 64251  	var _pBt *XBtShared
 64252  	var _info XCellInfo
 64253  	var _pPage, _7_pLeaf *XMemPage
 64254  	_p = (*XBtree)(_pCur.XpBtree)
 64255  	_pBt = (*XBtShared)(_p.XpBt)
 64256  	_bSkipnext = int32(0)
 64257  	_bPreserve = uint8(int32(_flags) & int32(2))
 64258  	func() {
 64259  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 64260  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67323), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(71986)))
 64261  			crt.X__builtin_abort(tls)
 64262  		}
 64263  	}()
 64264  	func() {
 64265  		if int32(_pBt.XinTransaction) != int32(2) {
 64266  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67324), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(56904)))
 64267  			crt.X__builtin_abort(tls)
 64268  		}
 64269  	}()
 64270  	func() {
 64271  		if (int32(_pBt.XbtsFlags) & int32(1)) != int32(0) {
 64272  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67325), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(76015)))
 64273  			crt.X__builtin_abort(tls)
 64274  		}
 64275  	}()
 64276  	func() {
 64277  		if (int32(_pCur.XcurFlags) & int32(1)) == 0 {
 64278  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67326), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(83673)))
 64279  			crt.X__builtin_abort(tls)
 64280  		}
 64281  	}()
 64282  	func() {
 64283  		if _hasSharedCacheTableLock(tls, _p, _pCur.XpgnoRoot, bool2int((*XKeyInfo)(_pCur.XpKeyInfo) != nil), int32(2)) == 0 {
 64284  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67327), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(78453)))
 64285  			crt.X__builtin_abort(tls)
 64286  		}
 64287  	}()
 64288  	func() {
 64289  		if _hasReadConflicts(tls, _p, _pCur.XpgnoRoot) != 0 {
 64290  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67328), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(83705)))
 64291  			crt.X__builtin_abort(tls)
 64292  		}
 64293  	}()
 64294  	func() {
 64295  		if int32(_pCur.Xix) >= int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnCell) {
 64296  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67329), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(10552)))
 64297  			crt.X__builtin_abort(tls)
 64298  		}
 64299  	}()
 64300  	func() {
 64301  		if int32(_pCur.XeState) != int32(1) {
 64302  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67330), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(10345)))
 64303  			crt.X__builtin_abort(tls)
 64304  		}
 64305  	}()
 64306  	func() {
 64307  		if (int32(_flags) & int32(-7)) != int32(0) {
 64308  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67331), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(83742)))
 64309  			crt.X__builtin_abort(tls)
 64310  		}
 64311  	}()
 64312  	_iCellDepth = int32(_pCur.XiPage)
 64313  	_iCellIdx = int32(_pCur.Xix)
 64314  	_pPage = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_iCellDepth))
 64315  	_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)))))))
 64316  	if _bPreserve == 0 {
 64317  		goto _18
 64318  	}
 64319  	if _pPage.Xleaf != 0 && ((int32(_pPage.XnFree)+int32(_cellSizePtr(tls, _pPage, _pCell)))+int32(2)) <= int32((_pBt.XusableSize*uint32(2))/uint32(3)) {
 64320  		goto _20
 64321  	}
 64322  	_rc = _saveCursorKey(tls, _pCur)
 64323  	if _rc != 0 {
 64324  		return _rc
 64325  	}
 64326  	goto _22
 64327  _20:
 64328  	_bSkipnext = int32(1)
 64329  _22:
 64330  _18:
 64331  	if _pPage.Xleaf != 0 {
 64332  		goto _23
 64333  	}
 64334  	_4_notUsed = int32(0)
 64335  	_rc = _sqlite3BtreePrevious(tls, _pCur, &_4_notUsed)
 64336  	if _rc != 0 {
 64337  		return _rc
 64338  	}
 64339  _23:
 64340  	if (int32(_pCur.XcurFlags) & int32(32)) == 0 {
 64341  		goto _25
 64342  	}
 64343  	_rc = _saveAllCursors(tls, _pBt, _pCur.XpgnoRoot, _pCur)
 64344  	if _rc != 0 {
 64345  		return _rc
 64346  	}
 64347  _25:
 64348  	if (*XKeyInfo)(_pCur.XpKeyInfo) == nil {
 64349  		_invalidateIncrblobCursors(tls, _p, _pCur.XpgnoRoot, _pCur.Xinfo.XnKey, int32(0))
 64350  	}
 64351  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage.XpDbPage))
 64352  	if _rc != 0 {
 64353  		return _rc
 64354  	}
 64355  	_rc = _clearCell(tls, _pPage, _pCell, &_info)
 64356  	_dropCell(tls, _pPage, _iCellIdx, int32(_info.XnSize), &_rc)
 64357  	if _rc != 0 {
 64358  		return _rc
 64359  	}
 64360  	if _pPage.Xleaf != 0 {
 64361  		goto _30
 64362  	}
 64363  	_7_pLeaf = *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))
 64364  	_7_n = (*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_iCellDepth+int32(1)))).Xpgno
 64365  	_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)))))))
 64366  	if crt.P2U(unsafe.Pointer(_pCell)) < crt.P2U(unsafe.Pointer(elem15(_7_pLeaf.XaData, uintptr(4)))) {
 64367  		return _sqlite3CorruptError(tls, int32(67407))
 64368  	}
 64369  	_7_nCell = int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 64370  		v := _7_pLeaf.XxCellSize
 64371  		return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 64372  	}()(tls, _7_pLeaf, _pCell))
 64373  	func() {
 64374  		if int32(_pBt.XpageSize-uint32(8)) < _7_nCell {
 64375  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67409), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(83795)))
 64376  			crt.X__builtin_abort(tls)
 64377  		}
 64378  	}()
 64379  	_7_pTmp = _pBt.XpTmpSpace
 64380  	func() {
 64381  		if _7_pTmp == nil {
 64382  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67411), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(83822)))
 64383  			crt.X__builtin_abort(tls)
 64384  		}
 64385  	}()
 64386  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_7_pLeaf.XpDbPage))
 64387  	if _rc == int32(0) {
 64388  		_insertCell(tls, _pPage, _iCellIdx, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell))-uintptr(int32(4)))), _7_nCell+int32(4), _7_pTmp, _7_n, &_rc)
 64389  	}
 64390  	_dropCell(tls, _7_pLeaf, int32(_7_pLeaf.XnCell)-int32(1), _7_nCell, &_rc)
 64391  	if _rc != 0 {
 64392  		return _rc
 64393  	}
 64394  _30:
 64395  	_rc = _balance(tls, _pCur)
 64396  	if _rc != int32(0) || int32(_pCur.XiPage) <= _iCellDepth {
 64397  		goto _39
 64398  	}
 64399  _40:
 64400  	if int32(_pCur.XiPage) > _iCellDepth {
 64401  		_releasePage(tls, *elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(postInc5(&_pCur.XiPage, -1))))
 64402  		goto _40
 64403  	}
 64404  	_rc = _balance(tls, _pCur)
 64405  _39:
 64406  	if _rc != int32(0) {
 64407  		goto _42
 64408  	}
 64409  	if _bSkipnext == 0 {
 64410  		goto _43
 64411  	}
 64412  	func() {
 64413  		if _bPreserve == 0 || int32(_pCur.XiPage) != _iCellDepth && _sqlite3Config.XneverCorrupt != int32(0) {
 64414  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67445), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(83830)))
 64415  			crt.X__builtin_abort(tls)
 64416  		}
 64417  	}()
 64418  	func() {
 64419  		if _pPage != (*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))) && _sqlite3Config.XneverCorrupt != int32(0) {
 64420  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67446), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(83883)))
 64421  			crt.X__builtin_abort(tls)
 64422  		}
 64423  	}()
 64424  	func() {
 64425  		if int32(_pPage.XnCell) <= int32(0) && _sqlite3Config.XneverCorrupt != int32(0) || _iCellIdx > int32(_pPage.XnCell) {
 64426  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67447), unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000), unsafe.Pointer(str(83930)))
 64427  			crt.X__builtin_abort(tls)
 64428  		}
 64429  	}()
 64430  	_pCur.XeState = uint8(2)
 64431  	if _iCellIdx >= int32(_pPage.XnCell) {
 64432  		_pCur.XskipNext = int32(-1)
 64433  		_pCur.Xix = uint16(int32(_pPage.XnCell) - int32(1))
 64434  		goto _56
 64435  	}
 64436  	_pCur.XskipNext = int32(1)
 64437  _56:
 64438  	goto _57
 64439  _43:
 64440  	_rc = _moveToRoot(tls, _pCur)
 64441  	if _bPreserve != 0 {
 64442  		_pCur.XeState = uint8(3)
 64443  	}
 64444  _57:
 64445  _42:
 64446  	return _rc
 64447  }
 64448  
 64449  var _sqlite3BtreeDeleteØ00__func__Ø000 [19]int8
 64450  
 64451  func init() {
 64452  	crt.Xstrncpy(nil, &_sqlite3BtreeDeleteØ00__func__Ø000[0], str(83987), 19)
 64453  }
 64454  
 64455  // C comment
 64456  //  /*
 64457  //  ** Compare the key in memory cell pVal with the key that the sorter cursor
 64458  //  ** passed as the first argument currently points to. For the purposes of
 64459  //  ** the comparison, ignore the rowid field at the end of each record.
 64460  //  **
 64461  //  ** If the sorter cursor key contains any NULL values, consider it to be
 64462  //  ** less than pVal. Even if pVal also contains NULL values.
 64463  //  **
 64464  //  ** If an error occurs, return an SQLite error code (i.e. SQLITE_NOMEM).
 64465  //  ** Otherwise, set *pRes to a negative, zero or positive value if the
 64466  //  ** key in pVal is smaller than, equal to or larger than the current sorter
 64467  //  ** key.
 64468  //  **
 64469  //  ** This routine forms the core of the OP_SorterCompare opcode, which in
 64470  //  ** turn is used to verify uniqueness when constructing a UNIQUE INDEX.
 64471  //  */
 64472  func _sqlite3VdbeSorterCompare(tls *crt.TLS, _pCsr *XVdbeCursor, _pVal *XMem, _nKeyCol int32, _pRes *int32) (r0 int32) {
 64473  	var _i, _nKey int32
 64474  	var _pKey unsafe.Pointer
 64475  	var _r2 *XUnpackedRecord
 64476  	var _pKeyInfo *XKeyInfo
 64477  	var _pSorter *XVdbeSorter
 64478  	func() {
 64479  		if int32(_pCsr.XeCurType) != int32(1) {
 64480  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88740), unsafe.Pointer(&_sqlite3VdbeSorterCompareØ00__func__Ø000), unsafe.Pointer(str(57837)))
 64481  			crt.X__builtin_abort(tls)
 64482  		}
 64483  	}()
 64484  	_pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer(&_pCsr.Xuc)))
 64485  	_r2 = (*XUnpackedRecord)(_pSorter.XpUnpacked)
 64486  	_pKeyInfo = (*XKeyInfo)(_pCsr.XpKeyInfo)
 64487  	if _r2 != nil {
 64488  		goto _2
 64489  	}
 64490  	_r2 = store83((**XUnpackedRecord)(unsafe.Pointer(&_pSorter.XpUnpacked)), _sqlite3VdbeAllocUnpackedRecord(tls, _pKeyInfo))
 64491  	if _r2 == nil {
 64492  		return _sqlite3NomemError(tls, int32(88746))
 64493  	}
 64494  	_r2.XnField = uint16(_nKeyCol)
 64495  _2:
 64496  	func() {
 64497  		if int32(_r2.XnField) != _nKeyCol {
 64498  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88749), unsafe.Pointer(&_sqlite3VdbeSorterCompareØ00__func__Ø000), unsafe.Pointer(str(84006)))
 64499  			crt.X__builtin_abort(tls)
 64500  		}
 64501  	}()
 64502  	_pKey = _vdbeSorterRowkey(tls, _pSorter, &_nKey)
 64503  	_sqlite3VdbeRecordUnpack(tls, _pKeyInfo, _nKey, _pKey, _r2)
 64504  	_i = int32(0)
 64505  _6:
 64506  	if _i >= _nKeyCol {
 64507  		goto _9
 64508  	}
 64509  	if (int32(elem25((*XMem)(_r2.XaMem), uintptr(_i)).Xflags) & int32(1)) != 0 {
 64510  		*_pRes = int32(-1)
 64511  		return int32(0)
 64512  	}
 64513  	_i += 1
 64514  	goto _6
 64515  _9:
 64516  	*_pRes = _sqlite3VdbeRecordCompare(tls, _pVal.Xn, unsafe.Pointer(_pVal.Xz), _r2)
 64517  	return int32(0)
 64518  }
 64519  
 64520  var _sqlite3VdbeSorterCompareØ00__func__Ø000 [25]int8
 64521  
 64522  func init() {
 64523  	crt.Xstrncpy(nil, &_sqlite3VdbeSorterCompareØ00__func__Ø000[0], str(84026), 25)
 64524  }
 64525  
 64526  // C comment
 64527  //  /*
 64528  //  ** Return a pointer to a buffer owned by the sorter that contains the
 64529  //  ** current key.
 64530  //  */
 64531  func _vdbeSorterRowkey(tls *crt.TLS, _pSorter *XVdbeSorter, _pnKey *int32) (r0 unsafe.Pointer) {
 64532  	var _pKey unsafe.Pointer
 64533  	var _1_pReader *XPmaReader
 64534  	if _pSorter.XbUsePMA == 0 {
 64535  		goto _0
 64536  	}
 64537  	if _pSorter.XbUseThreads != 0 {
 64538  		_1_pReader = (*XPmaReader)(_pSorter.XpReader)
 64539  		goto _2
 64540  	}
 64541  	_1_pReader = elem80((*XPmaReader)((*XMergeEngine)(_pSorter.XpMerger).XaReadr), uintptr(*elem8((*XMergeEngine)(_pSorter.XpMerger).XaTree, uintptr(1))))
 64542  _2:
 64543  	*_pnKey = _1_pReader.XnKey
 64544  	_pKey = unsafe.Pointer(_1_pReader.XaKey)
 64545  	goto _3
 64546  _0:
 64547  	*_pnKey = (*XSorterRecord)(_pSorter.Xlist.XpList).XnVal
 64548  	_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(8))))))))))))
 64549  _3:
 64550  	return _pKey
 64551  }
 64552  
 64553  // C comment
 64554  //  /*
 64555  //  ** Copy the current sorter key into the memory cell pOut.
 64556  //  */
 64557  func _sqlite3VdbeSorterRowkey(tls *crt.TLS, _pCsr *XVdbeCursor, _pOut *XMem) (r0 int32) {
 64558  	var _nKey int32
 64559  	var _pKey unsafe.Pointer
 64560  	var _pSorter *XVdbeSorter
 64561  	func() {
 64562  		if int32(_pCsr.XeCurType) != int32(1) {
 64563  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88699), unsafe.Pointer(&_sqlite3VdbeSorterRowkeyØ00__func__Ø000), unsafe.Pointer(str(57837)))
 64564  			crt.X__builtin_abort(tls)
 64565  		}
 64566  	}()
 64567  	_pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer(&_pCsr.Xuc)))
 64568  	_pKey = _vdbeSorterRowkey(tls, _pSorter, &_nKey)
 64569  	if _sqlite3VdbeMemClearAndResize(tls, _pOut, _nKey) != 0 {
 64570  		return _sqlite3NomemError(tls, int32(88703))
 64571  	}
 64572  	_pOut.Xn = _nKey
 64573  	_pOut.Xflags = uint16((int32(_pOut.Xflags) & int32(-49664)) | int32(16))
 64574  	crt.Xmemcpy(tls, unsafe.Pointer(_pOut.Xz), _pKey, uint32(_nKey))
 64575  	return int32(0)
 64576  }
 64577  
 64578  var _sqlite3VdbeSorterRowkeyØ00__func__Ø000 [24]int8
 64579  
 64580  func init() {
 64581  	crt.Xstrncpy(nil, &_sqlite3VdbeSorterRowkeyØ00__func__Ø000[0], str(84051), 24)
 64582  }
 64583  
 64584  // C comment
 64585  //  /*
 64586  //  ** Check to ensure that the cursor is valid.  Restore the cursor
 64587  //  ** if need be.  Return any I/O error from the restore operation.
 64588  //  */
 64589  func _sqlite3VdbeCursorRestore(tls *crt.TLS, _p *XVdbeCursor) (r0 int32) {
 64590  	func() {
 64591  		if int32(_p.XeCurType) != int32(0) {
 64592  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(74514), unsafe.Pointer(&_sqlite3VdbeCursorRestoreØ00__func__Ø000), unsafe.Pointer(str(71938)))
 64593  			crt.X__builtin_abort(tls)
 64594  		}
 64595  	}()
 64596  	if _sqlite3BtreeCursorHasMoved(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xuc)))) != 0 {
 64597  		return _handleMovedCursor(tls, _p)
 64598  	}
 64599  	return int32(0)
 64600  }
 64601  
 64602  var _sqlite3VdbeCursorRestoreØ00__func__Ø000 [25]int8
 64603  
 64604  func init() {
 64605  	crt.Xstrncpy(nil, &_sqlite3VdbeCursorRestoreØ00__func__Ø000[0], str(84075), 25)
 64606  }
 64607  
 64608  // C comment
 64609  //  /* NDEBUG */
 64610  func _sqlite3BtreeCursorIsValidNN(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 64611  	func() {
 64612  		if _pCur == nil {
 64613  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63381), unsafe.Pointer(&_sqlite3BtreeCursorIsValidNNØ00__func__Ø000), unsafe.Pointer(str(75267)))
 64614  			crt.X__builtin_abort(tls)
 64615  		}
 64616  	}()
 64617  	return bool2int(int32(_pCur.XeState) == int32(1))
 64618  }
 64619  
 64620  var _sqlite3BtreeCursorIsValidNNØ00__func__Ø000 [28]int8
 64621  
 64622  func init() {
 64623  	crt.Xstrncpy(nil, &_sqlite3BtreeCursorIsValidNNØ00__func__Ø000[0], str(84100), 28)
 64624  }
 64625  
 64626  // C comment
 64627  //  /* Move the cursor to the first entry in the table.  Return SQLITE_OK
 64628  //  ** on success.  Set *pRes to 0 if the cursor actually points to something
 64629  //  ** or set *pRes to 1 if the table is empty.
 64630  //  */
 64631  func _sqlite3BtreeFirst(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) {
 64632  	var _rc int32
 64633  	func() {
 64634  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 64635  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64079), unsafe.Pointer(&_sqlite3BtreeFirstØ00__func__Ø000), unsafe.Pointer(str(71986)))
 64636  			crt.X__builtin_abort(tls)
 64637  		}
 64638  	}()
 64639  	func() {
 64640  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XBtree)(_pCur.XpBtree).Xdb).Xmutex)) == 0 {
 64641  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64080), unsafe.Pointer(&_sqlite3BtreeFirstØ00__func__Ø000), unsafe.Pointer(str(72011)))
 64642  			crt.X__builtin_abort(tls)
 64643  		}
 64644  	}()
 64645  	_rc = _moveToRoot(tls, _pCur)
 64646  	if _rc != int32(0) {
 64647  		goto _4
 64648  	}
 64649  	if int32(_pCur.XeState) == int32(0) {
 64650  		func() {
 64651  			if _pCur.XpgnoRoot != (0) && int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnCell) != int32(0) {
 64652  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64084), unsafe.Pointer(&_sqlite3BtreeFirstØ00__func__Ø000), unsafe.Pointer(str(72404)))
 64653  				crt.X__builtin_abort(tls)
 64654  			}
 64655  		}()
 64656  		*_pRes = int32(1)
 64657  		goto _9
 64658  	}
 64659  	func() {
 64660  		if int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).XnCell) <= int32(0) {
 64661  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64087), unsafe.Pointer(&_sqlite3BtreeFirstØ00__func__Ø000), unsafe.Pointer(str(84128)))
 64662  			crt.X__builtin_abort(tls)
 64663  		}
 64664  	}()
 64665  	*_pRes = int32(0)
 64666  	_rc = _moveToLeftmost(tls, _pCur)
 64667  _9:
 64668  _4:
 64669  	return _rc
 64670  }
 64671  
 64672  var _sqlite3BtreeFirstØ00__func__Ø000 [18]int8
 64673  
 64674  func init() {
 64675  	crt.Xstrncpy(nil, &_sqlite3BtreeFirstØ00__func__Ø000[0], str(84163), 18)
 64676  }
 64677  
 64678  // C comment
 64679  //  /*
 64680  //  ** Return an estimate for the number of rows in the table that pCur is
 64681  //  ** pointing to.  Return a negative number if no estimate is currently
 64682  //  ** available.
 64683  //  */
 64684  func _sqlite3BtreeRowCountEst(tls *crt.TLS, _pCur *XBtCursor) (r0 int64) {
 64685  	var _n int64
 64686  	var _i uint8
 64687  	func() {
 64688  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
 64689  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64430), unsafe.Pointer(&_sqlite3BtreeRowCountEstØ00__func__Ø000), unsafe.Pointer(str(71986)))
 64690  			crt.X__builtin_abort(tls)
 64691  		}
 64692  	}()
 64693  	func() {
 64694  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XBtree)(_pCur.XpBtree).Xdb).Xmutex)) == 0 {
 64695  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64431), unsafe.Pointer(&_sqlite3BtreeRowCountEstØ00__func__Ø000), unsafe.Pointer(str(72011)))
 64696  			crt.X__builtin_abort(tls)
 64697  		}
 64698  	}()
 64699  	if func() int32 {
 64700  		if int32(_pCur.XeState) != int32(1) {
 64701  			return func() int32 {
 64702  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64436), unsafe.Pointer(&_sqlite3BtreeRowCountEstØ00__func__Ø000), unsafe.Pointer(str(4809)))
 64703  				crt.X__builtin_abort(tls)
 64704  				return int32(1)
 64705  			}()
 64706  		}
 64707  		return int32(0)
 64708  	}() != 0 {
 64709  		return int64(-1)
 64710  	}
 64711  	if func() int32 {
 64712  		if int32((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_pCur.XiPage))).Xleaf) == int32(0) {
 64713  			return func() int32 {
 64714  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(64437), unsafe.Pointer(&_sqlite3BtreeRowCountEstØ00__func__Ø000), unsafe.Pointer(str(4809)))
 64715  				crt.X__builtin_abort(tls)
 64716  				return int32(1)
 64717  			}()
 64718  		}
 64719  		return int32(0)
 64720  	}() != 0 {
 64721  		return int64(-1)
 64722  	}
 64723  	*func() *uint8 { _n = int64(1); return &_i }() = 0
 64724  _10:
 64725  	if int32(_i) > int32(_pCur.XiPage) {
 64726  		goto _13
 64727  	}
 64728  	_n *= int64((*elem30((**XMemPage)(unsafe.Pointer(&_pCur.XapPage)), uintptr(_i))).XnCell)
 64729  	_i += 1
 64730  	goto _10
 64731  _13:
 64732  	return _n
 64733  }
 64734  
 64735  var _sqlite3BtreeRowCountEstØ00__func__Ø000 [24]int8
 64736  
 64737  func init() {
 64738  	crt.Xstrncpy(nil, &_sqlite3BtreeRowCountEstØ00__func__Ø000[0], str(84181), 24)
 64739  }
 64740  
 64741  // C comment
 64742  //  /*
 64743  //  ** Once the sorter has been populated by calls to sqlite3VdbeSorterWrite,
 64744  //  ** this function is called to prepare for iterating through the records
 64745  //  ** in sorted order.
 64746  //  */
 64747  func _sqlite3VdbeSorterRewind(tls *crt.TLS, _pCsr *XVdbeCursor, _pbEof *int32) (r0 int32) {
 64748  	var _rc int32
 64749  	var _pSorter *XVdbeSorter
 64750  	_rc = int32(0)
 64751  	func() {
 64752  		if int32(_pCsr.XeCurType) != int32(1) {
 64753  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88587), unsafe.Pointer(&_sqlite3VdbeSorterRewindØ00__func__Ø000), unsafe.Pointer(str(57837)))
 64754  			crt.X__builtin_abort(tls)
 64755  		}
 64756  	}()
 64757  	_pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer(&_pCsr.Xuc)))
 64758  	func() {
 64759  		if _pSorter == nil {
 64760  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88589), unsafe.Pointer(&_sqlite3VdbeSorterRewindØ00__func__Ø000), unsafe.Pointer(str(84205)))
 64761  			crt.X__builtin_abort(tls)
 64762  		}
 64763  	}()
 64764  	if int32(_pSorter.XbUsePMA) != int32(0) {
 64765  		goto _4
 64766  	}
 64767  	if (_pSorter.Xlist.XpList) != nil {
 64768  		*_pbEof = int32(0)
 64769  		_rc = _vdbeSorterSort(tls, elem78((*XSortSubtask)(unsafe.Pointer(&_pSorter.XaTask)), 0), &_pSorter.Xlist)
 64770  		goto _6
 64771  	}
 64772  	*_pbEof = int32(1)
 64773  _6:
 64774  	return _rc
 64775  
 64776  _4:
 64777  	func() {
 64778  		if (_pSorter.Xlist.XpList) == nil {
 64779  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88608), unsafe.Pointer(&_sqlite3VdbeSorterRewindØ00__func__Ø000), unsafe.Pointer(str(84213)))
 64780  			crt.X__builtin_abort(tls)
 64781  		}
 64782  	}()
 64783  	_rc = _vdbeSorterFlushPMA(tls, _pSorter)
 64784  	_rc = _vdbeSorterJoinAll(tls, _pSorter, _rc)
 64785  	func() {
 64786  		if (*XPmaReader)(_pSorter.XpReader) != nil {
 64787  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88618), unsafe.Pointer(&_sqlite3VdbeSorterRewindØ00__func__Ø000), unsafe.Pointer(str(84233)))
 64788  			crt.X__builtin_abort(tls)
 64789  		}
 64790  	}()
 64791  	if _rc == int32(0) {
 64792  		_rc = _vdbeSorterSetupMerge(tls, _pSorter)
 64793  		*_pbEof = int32(0)
 64794  	}
 64795  	return _rc
 64796  }
 64797  
 64798  var _sqlite3VdbeSorterRewindØ00__func__Ø000 [24]int8
 64799  
 64800  func init() {
 64801  	crt.Xstrncpy(nil, &_sqlite3VdbeSorterRewindØ00__func__Ø000[0], str(84253), 24)
 64802  }
 64803  
 64804  // C comment
 64805  //  /*
 64806  //  ** Sort the linked list of records headed at pTask->pList. Return
 64807  //  ** SQLITE_OK if successful, or an SQLite error code (i.e. SQLITE_NOMEM) if
 64808  //  ** an error occurs.
 64809  //  */
 64810  func _vdbeSorterSort(tls *crt.TLS, _pTask *XSortSubtask, _pList *t89) (r0 int32) {
 64811  	var _i, _rc int32
 64812  	var _p, _2_pNext *XSorterRecord
 64813  	var _aSlot **XSorterRecord
 64814  	_rc = _vdbeSortAllocUnpacked(tls, _pTask)
 64815  	if _rc != int32(0) {
 64816  		return _rc
 64817  	}
 64818  	_p = (*XSorterRecord)(_pList.XpList)
 64819  	*(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&_pTask.XxCompare)) = _vdbeSorterGetCompare(tls, (*XVdbeSorter)(_pTask.XpSorter))
 64820  	_aSlot = (**XSorterRecord)(_sqlite3MallocZero(tls, uint64(256)))
 64821  	if _aSlot == nil {
 64822  		return _sqlite3NomemError(tls, int32(87425))
 64823  	}
 64824  _1:
 64825  	if _p == nil {
 64826  		goto _3
 64827  	}
 64828  	if _pList.XaMemory == nil {
 64829  		goto _4
 64830  	}
 64831  	if (*uint8)(unsafe.Pointer(_p)) == _pList.XaMemory {
 64832  		_2_pNext = nil
 64833  		goto _6
 64834  	}
 64835  	func() {
 64836  		if (*(*int32)(unsafe.Pointer(&_p.Xu))) >= _sqlite3MallocSize(tls, unsafe.Pointer(_pList.XaMemory)) {
 64837  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87434), unsafe.Pointer(&_vdbeSorterSortØ00__func__Ø000), unsafe.Pointer(str(84277)))
 64838  			crt.X__builtin_abort(tls)
 64839  		}
 64840  	}()
 64841  	_2_pNext = (*XSorterRecord)(unsafe.Pointer(elem15(_pList.XaMemory, uintptr(*(*int32)(unsafe.Pointer(&_p.Xu))))))
 64842  _6:
 64843  	goto _9
 64844  _4:
 64845  	_2_pNext = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))
 64846  _9:
 64847  	*(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))) = nil
 64848  	_i = int32(0)
 64849  _10:
 64850  	if (*elem90(_aSlot, uintptr(_i))) == nil {
 64851  		goto _13
 64852  	}
 64853  	_p = _vdbeSorterMerge(tls, _pTask, _p, *elem90(_aSlot, uintptr(_i)))
 64854  	*elem90(_aSlot, uintptr(_i)) = nil
 64855  	_i += 1
 64856  	goto _10
 64857  _13:
 64858  	*elem90(_aSlot, uintptr(_i)) = _p
 64859  	_p = _2_pNext
 64860  	goto _1
 64861  _3:
 64862  	_p = nil
 64863  	_i = int32(0)
 64864  _14:
 64865  	if _i >= int32(64) {
 64866  		goto _17
 64867  	}
 64868  	if (*elem90(_aSlot, uintptr(_i))) == nil {
 64869  		goto _15
 64870  	}
 64871  	_p = func() *XSorterRecord {
 64872  		if _p != nil {
 64873  			return _vdbeSorterMerge(tls, _pTask, _p, *elem90(_aSlot, uintptr(_i)))
 64874  		}
 64875  		return (*elem90(_aSlot, uintptr(_i)))
 64876  	}()
 64877  _15:
 64878  	_i += 1
 64879  	goto _14
 64880  _17:
 64881  	*(**XSorterRecord)(unsafe.Pointer(&_pList.XpList)) = _p
 64882  	Xsqlite3_free(tls, unsafe.Pointer(_aSlot))
 64883  	func() {
 64884  		if int32((*XUnpackedRecord)(_pTask.XpUnpacked).XerrCode) != int32(0) && int32((*XUnpackedRecord)(_pTask.XpUnpacked).XerrCode) != int32(7) {
 64885  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87458), unsafe.Pointer(&_vdbeSorterSortØ00__func__Ø000), unsafe.Pointer(str(84322)))
 64886  			crt.X__builtin_abort(tls)
 64887  		}
 64888  	}()
 64889  	return int32((*XUnpackedRecord)(_pTask.XpUnpacked).XerrCode)
 64890  }
 64891  
 64892  // C comment
 64893  //  /*
 64894  //  ** If it has not already been allocated, allocate the UnpackedRecord
 64895  //  ** structure at pTask->pUnpacked. Return SQLITE_OK if successful (or
 64896  //  ** if no allocation was required), or SQLITE_NOMEM otherwise.
 64897  //  */
 64898  func _vdbeSortAllocUnpacked(tls *crt.TLS, _pTask *XSortSubtask) (r0 int32) {
 64899  	if (*XUnpackedRecord)(_pTask.XpUnpacked) != nil {
 64900  		goto _0
 64901  	}
 64902  	*(**XUnpackedRecord)(unsafe.Pointer(&_pTask.XpUnpacked)) = _sqlite3VdbeAllocUnpackedRecord(tls, (*XKeyInfo)((*XVdbeSorter)(_pTask.XpSorter).XpKeyInfo))
 64903  	if (*XUnpackedRecord)(_pTask.XpUnpacked) == nil {
 64904  		return _sqlite3NomemError(tls, int32(87344))
 64905  	}
 64906  	(*XUnpackedRecord)(_pTask.XpUnpacked).XnField = (*XKeyInfo)((*XVdbeSorter)(_pTask.XpSorter).XpKeyInfo).XnField
 64907  	(*XUnpackedRecord)(_pTask.XpUnpacked).XerrCode = 0
 64908  _0:
 64909  	return int32(0)
 64910  }
 64911  
 64912  // C comment
 64913  //  /*
 64914  //  ** Return the SorterCompare function to compare values collected by the
 64915  //  ** sorter object passed as the only argument.
 64916  //  */
 64917  func _vdbeSorterGetCompare(tls *crt.TLS, _p *XVdbeSorter) (r0 func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32) {
 64918  	if int32(_p.XtypeMask) == int32(1) {
 64919  		return _vdbeSorterCompareInt
 64920  	}
 64921  	if int32(_p.XtypeMask) == int32(2) {
 64922  		return _vdbeSorterCompareText
 64923  	}
 64924  	return _vdbeSorterCompare
 64925  }
 64926  
 64927  // C comment
 64928  //  /*
 64929  //  ** A specially optimized version of vdbeSorterCompare() that assumes that
 64930  //  ** the first field of each key is an INTEGER value.
 64931  //  */
 64932  func _vdbeSorterCompareInt(tls *crt.TLS, _pTask *XSortSubtask, _pbKey2Cached *int32, _pKey1 unsafe.Pointer, _nKey1 int32, _pKey2 unsafe.Pointer, _nKey2 int32) (r0 int32) {
 64933  	var _s1, _s2, _res, _1_i int32
 64934  	var _1_n uint8
 64935  	var _p1, _p2, _v1, _v2 *uint8
 64936  	_p1 = (*uint8)(_pKey1)
 64937  	_p2 = (*uint8)(_pKey2)
 64938  	_s1 = int32(*elem15(_p1, uintptr(1)))
 64939  	_s2 = int32(*elem15(_p2, uintptr(1)))
 64940  	_v1 = elem15(_p1, uintptr(*elem15(_p1, 0)))
 64941  	_v2 = elem15(_p2, uintptr(*elem15(_p2, 0)))
 64942  	func() {
 64943  		if (_s1 <= int32(0) || _s1 >= int32(7)) && _s1 != int32(8) && _s1 != int32(9) {
 64944  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86872), unsafe.Pointer(&_vdbeSorterCompareIntØ00__func__Ø000), unsafe.Pointer(str(84402)))
 64945  			crt.X__builtin_abort(tls)
 64946  		}
 64947  	}()
 64948  	func() {
 64949  		if (_s2 <= int32(0) || _s2 >= int32(7)) && _s2 != int32(8) && _s2 != int32(9) {
 64950  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86873), unsafe.Pointer(&_vdbeSorterCompareIntØ00__func__Ø000), unsafe.Pointer(str(84435)))
 64951  			crt.X__builtin_abort(tls)
 64952  		}
 64953  	}()
 64954  	if _s1 != _s2 {
 64955  		goto _10
 64956  	}
 64957  	_1_n = *elem15((*uint8)(unsafe.Pointer(&_vdbeSorterCompareIntØ00aLenØ001)), uintptr(_s1))
 64958  	_res = int32(0)
 64959  	_1_i = int32(0)
 64960  _11:
 64961  	if _1_i >= int32(_1_n) {
 64962  		goto _14
 64963  	}
 64964  	if store2(&_res, int32(*elem15(_v1, uintptr(_1_i)))-int32(*elem15(_v2, uintptr(_1_i)))) == int32(0) {
 64965  		goto _15
 64966  	}
 64967  	if ((int32(*elem15(_v1, 0)) ^ int32(*elem15(_v2, 0))) & int32(128)) != int32(0) {
 64968  		_res = func() int32 {
 64969  			if (int32(*elem15(_v1, 0)) & int32(128)) != 0 {
 64970  				return int32(-1)
 64971  			}
 64972  			return int32(1)
 64973  		}()
 64974  	}
 64975  	goto _14
 64976  _15:
 64977  	_1_i += 1
 64978  	goto _11
 64979  _14:
 64980  	goto _22
 64981  _10:
 64982  	if (_s1 > int32(7)) && (_s2 > int32(7)) {
 64983  		_res = _s1 - _s2
 64984  		goto _22
 64985  	}
 64986  	if _s2 > int32(7) {
 64987  		_res = int32(1)
 64988  		goto _26
 64989  	}
 64990  	if _s1 > int32(7) {
 64991  		_res = int32(-1)
 64992  		goto _26
 64993  	}
 64994  	_res = _s1 - _s2
 64995  _26:
 64996  	func() {
 64997  		if _res == int32(0) {
 64998  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86899), unsafe.Pointer(&_vdbeSorterCompareIntØ00__func__Ø000), unsafe.Pointer(str(66473)))
 64999  			crt.X__builtin_abort(tls)
 65000  		}
 65001  	}()
 65002  	if _res <= int32(0) {
 65003  		goto _29
 65004  	}
 65005  	if (int32(*_v1) & int32(128)) != 0 {
 65006  		_res = int32(-1)
 65007  	}
 65008  	goto _31
 65009  _29:
 65010  	if (int32(*_v2) & int32(128)) != 0 {
 65011  		_res = int32(1)
 65012  	}
 65013  _31:
 65014  _22:
 65015  	if _res != int32(0) {
 65016  		goto _33
 65017  	}
 65018  	if int32((*XKeyInfo)((*XVdbeSorter)(_pTask.XpSorter).XpKeyInfo).XnField) > int32(1) {
 65019  		_res = _vdbeSorterCompareTail(tls, _pTask, _pbKey2Cached, _pKey1, _nKey1, _pKey2, _nKey2)
 65020  	}
 65021  	goto _36
 65022  _33:
 65023  	if (*elem15((*XKeyInfo)((*XVdbeSorter)(_pTask.XpSorter).XpKeyInfo).XaSortOrder, 0)) != 0 {
 65024  		_res = _res * int32(-1)
 65025  	}
 65026  _36:
 65027  	return _res
 65028  }
 65029  
 65030  var _vdbeSorterCompareIntØ00__func__Ø000 [21]int8
 65031  
 65032  func init() {
 65033  	crt.Xstrncpy(nil, &_vdbeSorterCompareIntØ00__func__Ø000[0], str(84468), 21)
 65034  }
 65035  
 65036  var _vdbeSorterCompareIntØ00aLenØ001 [10]uint8
 65037  
 65038  func init() {
 65039  	_vdbeSorterCompareIntØ00aLenØ001 = [10]uint8{0, 1, 2, 3, 4, 6, 8, 0, 0, 0}
 65040  }
 65041  
 65042  // C comment
 65043  //  /*
 65044  //  ** A version of vdbeSorterCompare() that assumes that it has already been
 65045  //  ** determined that the first field of key1 is equal to the first field of
 65046  //  ** key2.
 65047  //  */
 65048  func _vdbeSorterCompareTail(tls *crt.TLS, _pTask *XSortSubtask, _pbKey2Cached *int32, _pKey1 unsafe.Pointer, _nKey1 int32, _pKey2 unsafe.Pointer, _nKey2 int32) (r0 int32) {
 65049  	var _r2 *XUnpackedRecord
 65050  	_r2 = (*XUnpackedRecord)(_pTask.XpUnpacked)
 65051  	if (*_pbKey2Cached) == int32(0) {
 65052  		_sqlite3VdbeRecordUnpack(tls, (*XKeyInfo)((*XVdbeSorter)(_pTask.XpSorter).XpKeyInfo), _nKey2, _pKey2, _r2)
 65053  		*_pbKey2Cached = int32(1)
 65054  	}
 65055  	return _sqlite3VdbeRecordCompareWithSkip(tls, _nKey1, _pKey1, _r2, int32(1))
 65056  }
 65057  
 65058  // C comment
 65059  //  /*
 65060  //  ** A specially optimized version of vdbeSorterCompare() that assumes that
 65061  //  ** the first field of each key is a TEXT value and that the collation
 65062  //  ** sequence to compare them with is BINARY.
 65063  //  */
 65064  func _vdbeSorterCompareText(tls *crt.TLS, _pTask *XSortSubtask, _pbKey2Cached *int32, _pKey1 unsafe.Pointer, _nKey1 int32, _pKey2 unsafe.Pointer, _nKey2 int32) (r0 int32) {
 65065  	var _n1, _n2, _res int32
 65066  	var _p1, _p2, _v1, _v2 *uint8
 65067  	_p1 = (*uint8)(_pKey1)
 65068  	_p2 = (*uint8)(_pKey2)
 65069  	_v1 = elem15(_p1, uintptr(*elem15(_p1, 0)))
 65070  	_v2 = elem15(_p2, uintptr(*elem15(_p2, 0)))
 65071  	func() int32 {
 65072  		if int32(*elem15(_p1, uintptr(1))) < int32(128) {
 65073  			return func() int32 { _n1 = int32(uint32(*elem15(_p1, uintptr(1)))); return int32(1) }()
 65074  		}
 65075  		return int32(_sqlite3GetVarint32(tls, elem15(_p1, uintptr(1)), (*uint32)(unsafe.Pointer(&_n1))))
 65076  	}()
 65077  	_n1 = (_n1 - int32(13)) / int32(2)
 65078  	func() int32 {
 65079  		if int32(*elem15(_p2, uintptr(1))) < int32(128) {
 65080  			return func() int32 { _n2 = int32(uint32(*elem15(_p2, uintptr(1)))); return int32(1) }()
 65081  		}
 65082  		return int32(_sqlite3GetVarint32(tls, elem15(_p2, uintptr(1)), (*uint32)(unsafe.Pointer(&_n2))))
 65083  	}()
 65084  	_n2 = (_n2 - int32(13)) / int32(2)
 65085  	_res = crt.Xmemcmp(tls, unsafe.Pointer(_v1), unsafe.Pointer(_v2), uint32(func() int32 {
 65086  		if _n1 < _n2 {
 65087  			return _n1
 65088  		}
 65089  		return _n2
 65090  	}()))
 65091  	if _res == int32(0) {
 65092  		_res = _n1 - _n2
 65093  	}
 65094  	if _res != int32(0) {
 65095  		goto _7
 65096  	}
 65097  	if int32((*XKeyInfo)((*XVdbeSorter)(_pTask.XpSorter).XpKeyInfo).XnField) > int32(1) {
 65098  		_res = _vdbeSorterCompareTail(tls, _pTask, _pbKey2Cached, _pKey1, _nKey1, _pKey2, _nKey2)
 65099  	}
 65100  	goto _9
 65101  _7:
 65102  	if (*elem15((*XKeyInfo)((*XVdbeSorter)(_pTask.XpSorter).XpKeyInfo).XaSortOrder, 0)) != 0 {
 65103  		_res = _res * int32(-1)
 65104  	}
 65105  _9:
 65106  	return _res
 65107  }
 65108  
 65109  // C comment
 65110  //  /*
 65111  //  ** Compare key1 (buffer pKey1, size nKey1 bytes) with key2 (buffer pKey2,
 65112  //  ** size nKey2 bytes). Use (pTask->pKeyInfo) for the collation sequences
 65113  //  ** used by the comparison. Return the result of the comparison.
 65114  //  **
 65115  //  ** If IN/OUT parameter *pbKey2Cached is true when this function is called,
 65116  //  ** it is assumed that (pTask->pUnpacked) contains the unpacked version
 65117  //  ** of key2. If it is false, (pTask->pUnpacked) is populated with the unpacked
 65118  //  ** version of key2 and *pbKey2Cached set to true before returning.
 65119  //  **
 65120  //  ** If an OOM error is encountered, (pTask->pUnpacked->error_rc) is set
 65121  //  ** to SQLITE_NOMEM.
 65122  //  */
 65123  func _vdbeSorterCompare(tls *crt.TLS, _pTask *XSortSubtask, _pbKey2Cached *int32, _pKey1 unsafe.Pointer, _nKey1 int32, _pKey2 unsafe.Pointer, _nKey2 int32) (r0 int32) {
 65124  	var _r2 *XUnpackedRecord
 65125  	_r2 = (*XUnpackedRecord)(_pTask.XpUnpacked)
 65126  	if (*_pbKey2Cached) == 0 {
 65127  		_sqlite3VdbeRecordUnpack(tls, (*XKeyInfo)((*XVdbeSorter)(_pTask.XpSorter).XpKeyInfo), _nKey2, _pKey2, _r2)
 65128  		*_pbKey2Cached = int32(1)
 65129  	}
 65130  	return _sqlite3VdbeRecordCompare(tls, _nKey1, _pKey1, _r2)
 65131  }
 65132  
 65133  var _vdbeSorterSortØ00__func__Ø000 [15]int8
 65134  
 65135  func init() {
 65136  	crt.Xstrncpy(nil, &_vdbeSorterSortØ00__func__Ø000[0], str(84489), 15)
 65137  }
 65138  
 65139  // C comment
 65140  //  /*
 65141  //  ** Merge the two sorted lists p1 and p2 into a single list.
 65142  //  */
 65143  func _vdbeSorterMerge(tls *crt.TLS, _pTask *XSortSubtask, _p1 *XSorterRecord, _p2 *XSorterRecord) (r0 *XSorterRecord) {
 65144  	var _bCached, _1_res int32
 65145  	var _pFinal *XSorterRecord
 65146  	var _pp **XSorterRecord
 65147  	_pFinal = nil
 65148  	_pp = &_pFinal
 65149  	_bCached = int32(0)
 65150  	func() {
 65151  		if _p1 == nil || _p2 == nil {
 65152  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87364), unsafe.Pointer(&_vdbeSorterMergeØ00__func__Ø000), unsafe.Pointer(str(84504)))
 65153  			crt.X__builtin_abort(tls)
 65154  		}
 65155  	}()
 65156  _3:
 65157  	_1_res = func() func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32 {
 65158  		v := _pTask.XxCompare
 65159  		return *(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&v))
 65160  	}()(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(8)))))))))))), _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(8)))))))))))), _p2.XnVal)
 65161  	if _1_res > int32(0) {
 65162  		goto _6
 65163  	}
 65164  	*_pp = _p1
 65165  	_pp = (**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p1.Xu))))
 65166  	_p1 = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer(&_p1.Xu)))
 65167  	if _p1 == nil {
 65168  		*_pp = _p2
 65169  		goto _5
 65170  	}
 65171  	goto _8
 65172  _6:
 65173  	*_pp = _p2
 65174  	_pp = (**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p2.Xu))))
 65175  	_p2 = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer(&_p2.Xu)))
 65176  	_bCached = int32(0)
 65177  	if _p2 == nil {
 65178  		*_pp = _p1
 65179  		goto _5
 65180  	}
 65181  _8:
 65182  	goto _3
 65183  _5:
 65184  	return _pFinal
 65185  }
 65186  
 65187  var _vdbeSorterMergeØ00__func__Ø000 [16]int8
 65188  
 65189  func init() {
 65190  	crt.Xstrncpy(nil, &_vdbeSorterMergeØ00__func__Ø000[0], str(84519), 16)
 65191  }
 65192  
 65193  // C comment
 65194  //  /*
 65195  //  ** Flush the current contents of VdbeSorter.list to a new PMA, possibly
 65196  //  ** using a background thread.
 65197  //  */
 65198  func _vdbeSorterFlushPMA(tls *crt.TLS, _pSorter *XVdbeSorter) (r0 int32) {
 65199  	var _rc, _i, _nWorker, _1_iTest int32
 65200  	var _5_pCtx unsafe.Pointer
 65201  	var _5_aMem *uint8
 65202  	var _pTask *XSortSubtask
 65203  	_rc = int32(0)
 65204  	_pTask = nil
 65205  	_nWorker = int32(_pSorter.XnTask) - int32(1)
 65206  	_pSorter.XbUsePMA = uint8(1)
 65207  	_i = int32(0)
 65208  _0:
 65209  	if _i >= _nWorker {
 65210  		goto _3
 65211  	}
 65212  	_1_iTest = ((int32(_pSorter.XiPrev) + _i) + int32(1)) % _nWorker
 65213  	_pTask = elem78((*XSortSubtask)(unsafe.Pointer(&_pSorter.XaTask)), uintptr(_1_iTest))
 65214  	if _pTask.XbDone != 0 {
 65215  		_rc = _vdbeSorterJoinThread(tls, _pTask)
 65216  	}
 65217  	if (_rc != int32(0)) || ((*XSQLiteThread)(_pTask.XpThread) == nil) {
 65218  		goto _3
 65219  	}
 65220  	_i += 1
 65221  	goto _0
 65222  _3:
 65223  	if _rc != int32(0) {
 65224  		goto _7
 65225  	}
 65226  	if _i == _nWorker {
 65227  		_rc = _vdbeSorterListToPMA(tls, elem78((*XSortSubtask)(unsafe.Pointer(&_pSorter.XaTask)), uintptr(_nWorker)), &_pSorter.Xlist)
 65228  		goto _9
 65229  	}
 65230  	_5_aMem = _pTask.Xlist.XaMemory
 65231  	_5_pCtx = unsafe.Pointer(_pTask)
 65232  	func() {
 65233  		if (*XSQLiteThread)(_pTask.XpThread) != nil || _pTask.XbDone != int32(0) {
 65234  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87751), unsafe.Pointer(&_vdbeSorterFlushPMAØ00__func__Ø000), unsafe.Pointer(str(84535)))
 65235  			crt.X__builtin_abort(tls)
 65236  		}
 65237  	}()
 65238  	func() {
 65239  		if (*XSorterRecord)(_pTask.Xlist.XpList) != nil {
 65240  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87752), unsafe.Pointer(&_vdbeSorterFlushPMAØ00__func__Ø000), unsafe.Pointer(str(84572)))
 65241  			crt.X__builtin_abort(tls)
 65242  		}
 65243  	}()
 65244  	func() {
 65245  		if (_pTask.Xlist.XaMemory) != nil && (_pSorter.Xlist.XaMemory) == nil {
 65246  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87753), unsafe.Pointer(&_vdbeSorterFlushPMAØ00__func__Ø000), unsafe.Pointer(str(84593)))
 65247  			crt.X__builtin_abort(tls)
 65248  		}
 65249  	}()
 65250  	_pSorter.XiPrev = uint8(int32((uintptr(unsafe.Pointer(_pTask)) - uintptr(unsafe.Pointer(&_pSorter.XaTask))) / 60))
 65251  	_pTask.Xlist = _pSorter.Xlist
 65252  	*(**XSorterRecord)(unsafe.Pointer(&(_pSorter.Xlist.XpList))) = nil
 65253  	_pSorter.Xlist.XszPMA = int32(0)
 65254  	if _5_aMem != nil {
 65255  		_pSorter.Xlist.XaMemory = _5_aMem
 65256  		_pSorter.XnMemory = _sqlite3MallocSize(tls, unsafe.Pointer(_5_aMem))
 65257  		goto _20
 65258  	}
 65259  	if (_pSorter.Xlist.XaMemory) == nil {
 65260  		goto _20
 65261  	}
 65262  	_pSorter.Xlist.XaMemory = (*uint8)(_sqlite3Malloc(tls, uint64(_pSorter.XnMemory)))
 65263  	if (_pSorter.Xlist.XaMemory) == nil {
 65264  		return _sqlite3NomemError(tls, int32(87764))
 65265  	}
 65266  _20:
 65267  	_rc = _vdbeSorterCreateThread(tls, _pTask, _vdbeSorterFlushThread, _5_pCtx)
 65268  _9:
 65269  _7:
 65270  	return _rc
 65271  }
 65272  
 65273  // C comment
 65274  //  /*
 65275  //  ** Write the current contents of in-memory linked-list pList to a level-0
 65276  //  ** PMA in the temp file belonging to sub-task pTask. Return SQLITE_OK if
 65277  //  ** successful, or an SQLite error code otherwise.
 65278  //  **
 65279  //  ** The format of a PMA is:
 65280  //  **
 65281  //  **     * A varint. This varint contains the total number of bytes of content
 65282  //  **       in the PMA (not including the varint itself).
 65283  //  **
 65284  //  **     * One or more records packed end-to-end in order of ascending keys.
 65285  //  **       Each record consists of a varint followed by a blob of data (the
 65286  //  **       key). The varint is the number of bytes in the blob of data.
 65287  //  */
 65288  func _vdbeSorterListToPMA(tls *crt.TLS, _pTask *XSortSubtask, _pList *t89) (r0 int32) {
 65289  	var _rc int32
 65290  	var _iSz int64
 65291  	var _db *Xsqlite3
 65292  	var _4_p, _4_pNext *XSorterRecord
 65293  	var _writer XPmaWriter
 65294  	_db = (*Xsqlite3)((*XVdbeSorter)(_pTask.XpSorter).Xdb)
 65295  	_rc = int32(0)
 65296  	_iSz = int64(_pList.XszPMA+_sqlite3VarintLen(tls, uint64(_pList.XszPMA))) + (_pTask.Xfile.XiEof)
 65297  	crt.Xmemset(tls, unsafe.Pointer(&_writer), int32(0), uint32(32))
 65298  	func() {
 65299  		if _pList.XszPMA <= int32(0) {
 65300  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87575), unsafe.Pointer(&_vdbeSorterListToPMAØ00__func__Ø000), unsafe.Pointer(str(84644)))
 65301  			crt.X__builtin_abort(tls)
 65302  		}
 65303  	}()
 65304  	if (*Xsqlite3_file)(_pTask.Xfile.XpFd) == nil {
 65305  		_rc = _vdbeSorterOpenTempFile(tls, _db, 0, (**Xsqlite3_file)(unsafe.Pointer(&(_pTask.Xfile.XpFd))))
 65306  		func() {
 65307  			if _rc == int32(0) && (_pTask.Xfile.XpFd) == nil {
 65308  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87580), unsafe.Pointer(&_vdbeSorterListToPMAØ00__func__Ø000), unsafe.Pointer(str(84659)))
 65309  				crt.X__builtin_abort(tls)
 65310  			}
 65311  		}()
 65312  		func() {
 65313  			if (_pTask.Xfile.XiEof) != (0) {
 65314  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87581), unsafe.Pointer(&_vdbeSorterListToPMAØ00__func__Ø000), unsafe.Pointer(str(84692)))
 65315  				crt.X__builtin_abort(tls)
 65316  			}
 65317  		}()
 65318  		func() {
 65319  			if _pTask.XnPMA != int32(0) {
 65320  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87582), unsafe.Pointer(&_vdbeSorterListToPMAØ00__func__Ø000), unsafe.Pointer(str(84712)))
 65321  				crt.X__builtin_abort(tls)
 65322  			}
 65323  		}()
 65324  	}
 65325  	if _rc == int32(0) {
 65326  		_vdbeSorterExtendFile(tls, _db, (*Xsqlite3_file)(_pTask.Xfile.XpFd), ((_pTask.Xfile.XiEof)+int64(_pList.XszPMA))+int64(9))
 65327  	}
 65328  	if _rc == int32(0) {
 65329  		_rc = _vdbeSorterSort(tls, _pTask, _pList)
 65330  	}
 65331  	if _rc != int32(0) {
 65332  		goto _12
 65333  	}
 65334  	_4_pNext = nil
 65335  	_vdbePmaWriterInit(tls, (*Xsqlite3_file)(_pTask.Xfile.XpFd), &_writer, (*XVdbeSorter)(_pTask.XpSorter).Xpgsz, _pTask.Xfile.XiEof)
 65336  	_pTask.XnPMA += 1
 65337  	_vdbePmaWriteVarint(tls, &_writer, uint64(_pList.XszPMA))
 65338  	_4_p = (*XSorterRecord)(_pList.XpList)
 65339  _13:
 65340  	if _4_p == nil {
 65341  		goto _16
 65342  	}
 65343  	_4_pNext = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer(&_4_p.Xu)))
 65344  	_vdbePmaWriteVarint(tls, &_writer, uint64(_4_p.XnVal))
 65345  	_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(8))))))))))))), _4_p.XnVal)
 65346  	if _pList.XaMemory == nil {
 65347  		Xsqlite3_free(tls, unsafe.Pointer(_4_p))
 65348  	}
 65349  	_4_p = _4_pNext
 65350  	goto _13
 65351  _16:
 65352  	*(**XSorterRecord)(unsafe.Pointer(&_pList.XpList)) = _4_p
 65353  	_rc = _vdbePmaWriterFinish(tls, &_writer, &(_pTask.Xfile.XiEof))
 65354  _12:
 65355  	func() {
 65356  		if _rc == int32(0) && (*XSorterRecord)(_pList.XpList) != nil {
 65357  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87614), unsafe.Pointer(&_vdbeSorterListToPMAØ00__func__Ø000), unsafe.Pointer(str(84727)))
 65358  			crt.X__builtin_abort(tls)
 65359  		}
 65360  	}()
 65361  	func() {
 65362  		if _rc == int32(0) && (_pTask.Xfile.XiEof) != _iSz {
 65363  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87615), unsafe.Pointer(&_vdbeSorterListToPMAØ00__func__Ø000), unsafe.Pointer(str(84760)))
 65364  			crt.X__builtin_abort(tls)
 65365  		}
 65366  	}()
 65367  	return _rc
 65368  }
 65369  
 65370  var _vdbeSorterListToPMAØ00__func__Ø000 [20]int8
 65371  
 65372  func init() {
 65373  	crt.Xstrncpy(nil, &_vdbeSorterListToPMAØ00__func__Ø000[0], str(84799), 20)
 65374  }
 65375  
 65376  // C comment
 65377  //  /*
 65378  //  ** Allocate space for a file-handle and open a temporary file. If successful,
 65379  //  ** set *ppFd to point to the malloc'd file-handle and return SQLITE_OK.
 65380  //  ** Otherwise, set *ppFd to 0 and return an SQLite error code.
 65381  //  */
 65382  func _vdbeSorterOpenTempFile(tls *crt.TLS, _db *Xsqlite3, _nExtend int64, _ppFd **Xsqlite3_file) (r0 int32) {
 65383  	var _rc int32
 65384  	var _1_max int64
 65385  	if _sqlite3FaultSim(tls, int32(202)) != 0 {
 65386  		return int32(3338)
 65387  	}
 65388  	_rc = _sqlite3OsOpenMalloc(tls, (*Xsqlite3_vfs)(_db.XpVfs), nil, _ppFd, int32(4126), &_rc)
 65389  	if _rc != int32(0) {
 65390  		goto _1
 65391  	}
 65392  	_1_max = int64(2147418112)
 65393  	_sqlite3OsFileControlHint(tls, *_ppFd, int32(18), unsafe.Pointer(&_1_max))
 65394  	if _nExtend > (0) {
 65395  		_vdbeSorterExtendFile(tls, _db, *_ppFd, _nExtend)
 65396  	}
 65397  _1:
 65398  	return _rc
 65399  
 65400  	_ = _1_max
 65401  	panic(0)
 65402  }
 65403  
 65404  // C comment
 65405  //  /*
 65406  //  ** The first argument is a file-handle open on a temporary file. The file
 65407  //  ** is guaranteed to be nByte bytes or smaller in size. This function
 65408  //  ** attempts to extend the file to nByte bytes in size and to ensure that
 65409  //  ** the VFS has memory mapped it.
 65410  //  **
 65411  //  ** Whether or not the file does end up memory mapped of course depends on
 65412  //  ** the specific VFS implementation.
 65413  //  */
 65414  func _vdbeSorterExtendFile(tls *crt.TLS, _db *Xsqlite3, _pFd *Xsqlite3_file, _nByte int64) {
 65415  	var _1_chunksize int32
 65416  	var _1_p unsafe.Pointer
 65417  	if (_nByte <= int64(_db.XnMaxSorterMmap)) && (((*Xsqlite3_io_methods)(_pFd.XpMethods).XiVersion) >= int32(3)) {
 65418  		_1_p = nil
 65419  		_1_chunksize = int32(4096)
 65420  		_sqlite3OsFileControlHint(tls, _pFd, int32(6), unsafe.Pointer(&_1_chunksize))
 65421  		_sqlite3OsFileControlHint(tls, _pFd, int32(5), unsafe.Pointer(&_nByte))
 65422  		_sqlite3OsFetch(tls, _pFd, 0, int32(_nByte), &_1_p)
 65423  		_sqlite3OsUnfetch(tls, _pFd, 0, _1_p)
 65424  	}
 65425  	_ = _1_chunksize
 65426  }
 65427  
 65428  // C comment
 65429  //  /*
 65430  //  ** Initialize a PMA-writer object.
 65431  //  */
 65432  func _vdbePmaWriterInit(tls *crt.TLS, _pFd *Xsqlite3_file, _p *XPmaWriter, _nBuf int32, _iStart int64) {
 65433  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint32(32))
 65434  	_p.XaBuffer = (*uint8)(_sqlite3Malloc(tls, uint64(_nBuf)))
 65435  	if _p.XaBuffer == nil {
 65436  		_p.XeFWErr = _sqlite3NomemError(tls, int32(87476))
 65437  		goto _1
 65438  	}
 65439  	_p.XiBufEnd = store2(&_p.XiBufStart, int32(_iStart%int64(_nBuf)))
 65440  	_p.XiWriteOff = _iStart - int64(_p.XiBufStart)
 65441  	_p.XnBuffer = _nBuf
 65442  	*(**Xsqlite3_file)(unsafe.Pointer(&_p.XpFd)) = _pFd
 65443  _1:
 65444  }
 65445  
 65446  // C comment
 65447  //  /*
 65448  //  ** Write value iVal encoded as a varint to the PMA. Return
 65449  //  ** SQLITE_OK if successful, or an SQLite error code if an error occurs.
 65450  //  */
 65451  func _vdbePmaWriteVarint(tls *crt.TLS, _p *XPmaWriter, _iVal uint64) {
 65452  	var _nByte int32
 65453  	var _aByte [10]uint8
 65454  	_nByte = _sqlite3PutVarint(tls, (*uint8)(unsafe.Pointer(&_aByte)), _iVal)
 65455  	_vdbePmaWriteBlob(tls, _p, (*uint8)(unsafe.Pointer(&_aByte)), _nByte)
 65456  	_ = _aByte
 65457  }
 65458  
 65459  // C comment
 65460  //  /*
 65461  //  ** Write nData bytes of data to the PMA. Return SQLITE_OK
 65462  //  ** if successful, or an SQLite error code if an error occurs.
 65463  //  */
 65464  func _vdbePmaWriteBlob(tls *crt.TLS, _p *XPmaWriter, _pData *uint8, _nData int32) {
 65465  	var _nRem, _1_nCopy int32
 65466  	_nRem = _nData
 65467  _0:
 65468  	if _nRem <= int32(0) || _p.XeFWErr != int32(0) {
 65469  		goto _1
 65470  	}
 65471  	_1_nCopy = _nRem
 65472  	if _1_nCopy > (_p.XnBuffer - _p.XiBufEnd) {
 65473  		_1_nCopy = _p.XnBuffer - _p.XiBufEnd
 65474  	}
 65475  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_p.XaBuffer, uintptr(_p.XiBufEnd))), unsafe.Pointer(elem15(_pData, uintptr(_nData-_nRem))), uint32(_1_nCopy))
 65476  	_p.XiBufEnd += _1_nCopy
 65477  	if _p.XiBufEnd == _p.XnBuffer {
 65478  		_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))
 65479  		_p.XiBufStart = store2(&_p.XiBufEnd, int32(0))
 65480  		_p.XiWriteOff += int64(_p.XnBuffer)
 65481  	}
 65482  	func() {
 65483  		if _p.XiBufEnd >= _p.XnBuffer {
 65484  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87507), unsafe.Pointer(&_vdbePmaWriteBlobØ00__func__Ø000), unsafe.Pointer(str(84819)))
 65485  			crt.X__builtin_abort(tls)
 65486  		}
 65487  	}()
 65488  	_nRem -= _1_nCopy
 65489  	goto _0
 65490  _1:
 65491  }
 65492  
 65493  var _vdbePmaWriteBlobØ00__func__Ø000 [17]int8
 65494  
 65495  func init() {
 65496  	crt.Xstrncpy(nil, &_vdbePmaWriteBlobØ00__func__Ø000[0], str(84841), 17)
 65497  }
 65498  
 65499  // C comment
 65500  //  /*
 65501  //  ** Flush any buffered data to disk and clean up the PMA-writer object.
 65502  //  ** The results of using the PMA-writer after this call are undefined.
 65503  //  ** Return SQLITE_OK if flushing the buffered data succeeds or is not
 65504  //  ** required. Otherwise, return an SQLite error code.
 65505  //  **
 65506  //  ** Before returning, set *piEof to the offset immediately following the
 65507  //  ** last byte written to the file.
 65508  //  */
 65509  func _vdbePmaWriterFinish(tls *crt.TLS, _p *XPmaWriter, _piEof *int64) (r0 int32) {
 65510  	var _rc int32
 65511  	if ((_p.XeFWErr == int32(0)) && func() int32 {
 65512  		if _p.XaBuffer != nil {
 65513  			return int32(1)
 65514  		}
 65515  		return func() int32 {
 65516  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87524), unsafe.Pointer(&_vdbePmaWriterFinishØ00__func__Ø000), unsafe.Pointer(str(4809)))
 65517  			crt.X__builtin_abort(tls)
 65518  			return int32(0)
 65519  		}()
 65520  	}() != 0) && (_p.XiBufEnd > _p.XiBufStart) {
 65521  		_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))
 65522  	}
 65523  	*_piEof = _p.XiWriteOff + int64(_p.XiBufEnd)
 65524  	Xsqlite3_free(tls, unsafe.Pointer(_p.XaBuffer))
 65525  	_rc = _p.XeFWErr
 65526  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint32(32))
 65527  	return _rc
 65528  }
 65529  
 65530  var _vdbePmaWriterFinishØ00__func__Ø000 [20]int8
 65531  
 65532  func init() {
 65533  	crt.Xstrncpy(nil, &_vdbePmaWriterFinishØ00__func__Ø000[0], str(84858), 20)
 65534  }
 65535  
 65536  var _vdbeSorterFlushPMAØ00__func__Ø000 [19]int8
 65537  
 65538  func init() {
 65539  	crt.Xstrncpy(nil, &_vdbeSorterFlushPMAØ00__func__Ø000[0], str(84878), 19)
 65540  }
 65541  
 65542  // C comment
 65543  //  /*
 65544  //  ** Launch a background thread to run xTask(pIn).
 65545  //  */
 65546  func _vdbeSorterCreateThread(tls *crt.TLS, _pTask *XSortSubtask, _xTask func(*crt.TLS, unsafe.Pointer) unsafe.Pointer, _pIn unsafe.Pointer) (r0 int32) {
 65547  	func() {
 65548  		if (*XSQLiteThread)(_pTask.XpThread) != nil || _pTask.XbDone != int32(0) {
 65549  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87148), unsafe.Pointer(&_vdbeSorterCreateThreadØ00__func__Ø000), unsafe.Pointer(str(84535)))
 65550  			crt.X__builtin_abort(tls)
 65551  		}
 65552  	}()
 65553  	return _sqlite3ThreadCreate(tls, (**XSQLiteThread)(unsafe.Pointer(&_pTask.XpThread)), _xTask, _pIn)
 65554  }
 65555  
 65556  var _vdbeSorterCreateThreadØ00__func__Ø000 [23]int8
 65557  
 65558  func init() {
 65559  	crt.Xstrncpy(nil, &_vdbeSorterCreateThreadØ00__func__Ø000[0], str(84897), 23)
 65560  }
 65561  
 65562  // C comment
 65563  //  /* Create a new thread */
 65564  func _sqlite3ThreadCreate(tls *crt.TLS, _ppThread **XSQLiteThread, _xTask func(*crt.TLS, unsafe.Pointer) unsafe.Pointer, _pIn unsafe.Pointer) (r0 int32) {
 65565  	var _rc int32
 65566  	var _p *XSQLiteThread
 65567  	func() {
 65568  		if _ppThread == nil {
 65569  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(26905), unsafe.Pointer(&_sqlite3ThreadCreateØ00__func__Ø000), unsafe.Pointer(str(84920)))
 65570  			crt.X__builtin_abort(tls)
 65571  		}
 65572  	}()
 65573  	func() {
 65574  		if _xTask == nil {
 65575  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(26906), unsafe.Pointer(&_sqlite3ThreadCreateØ00__func__Ø000), unsafe.Pointer(str(84932)))
 65576  			crt.X__builtin_abort(tls)
 65577  		}
 65578  	}()
 65579  	func() {
 65580  		if _sqlite3Config.XbCoreMutex == int32(0) {
 65581  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(26908), unsafe.Pointer(&_sqlite3ThreadCreateØ00__func__Ø000), unsafe.Pointer(str(84941)))
 65582  			crt.X__builtin_abort(tls)
 65583  		}
 65584  	}()
 65585  	*_ppThread = nil
 65586  	_p = (*XSQLiteThread)(_sqlite3Malloc(tls, uint64(20)))
 65587  	if _p == nil {
 65588  		return _sqlite3NomemError(tls, int32(26912))
 65589  	}
 65590  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint32(20))
 65591  	_p.XxTask = _xTask
 65592  	_p.XpIn = _pIn
 65593  	if _sqlite3FaultSim(tls, int32(200)) != 0 {
 65594  		_rc = int32(1)
 65595  		goto _8
 65596  	}
 65597  	_rc = crt.Xpthread_create(tls, &_p.Xtid, nil, _xTask, _pIn)
 65598  _8:
 65599  	if _rc != 0 {
 65600  		_p.Xdone = int32(1)
 65601  		_p.XpOut = _xTask(tls, _pIn)
 65602  	}
 65603  	*_ppThread = _p
 65604  	return int32(0)
 65605  }
 65606  
 65607  var _sqlite3ThreadCreateØ00__func__Ø000 [20]int8
 65608  
 65609  func init() {
 65610  	crt.Xstrncpy(nil, &_sqlite3ThreadCreateØ00__func__Ø000[0], str(84975), 20)
 65611  }
 65612  
 65613  // C comment
 65614  //  /*
 65615  //  ** The main routine for background threads that write level-0 PMAs.
 65616  //  */
 65617  func _vdbeSorterFlushThread(tls *crt.TLS, _pCtx unsafe.Pointer) (r0 unsafe.Pointer) {
 65618  	var _rc int32
 65619  	var _pTask *XSortSubtask
 65620  	_pTask = (*XSortSubtask)(_pCtx)
 65621  	func() {
 65622  		if _pTask.XbDone != int32(0) {
 65623  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87700), unsafe.Pointer(&_vdbeSorterFlushThreadØ00__func__Ø000), unsafe.Pointer(str(84995)))
 65624  			crt.X__builtin_abort(tls)
 65625  		}
 65626  	}()
 65627  	_rc = _vdbeSorterListToPMA(tls, _pTask, &_pTask.Xlist)
 65628  	_pTask.XbDone = int32(1)
 65629  	return crt.U2P(uintptr(_rc))
 65630  }
 65631  
 65632  var _vdbeSorterFlushThreadØ00__func__Ø000 [22]int8
 65633  
 65634  func init() {
 65635  	crt.Xstrncpy(nil, &_vdbeSorterFlushThreadØ00__func__Ø000[0], str(85011), 22)
 65636  }
 65637  
 65638  // C comment
 65639  //  /*
 65640  //  ** This function is called as part of an sqlite3VdbeSorterRewind() operation
 65641  //  ** on a sorter that has written two or more PMAs to temporary files. It sets
 65642  //  ** up either VdbeSorter.pMerger (for single threaded sorters) or pReader
 65643  //  ** (for multi-threaded sorters) so that it can be used to iterate through
 65644  //  ** all records stored in the sorter.
 65645  //  **
 65646  //  ** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
 65647  //  */
 65648  func _vdbeSorterSetupMerge(tls *crt.TLS, _pSorter *XVdbeSorter) (r0 int32) {
 65649  	var _rc, _i, _3_iTask int32
 65650  	var _db *Xsqlite3
 65651  	var _3_pReadr, _9_p *XPmaReader
 65652  	var _7_pIncr *XIncrMerger
 65653  	var _pTask0, _3_pLast *XSortSubtask
 65654  	var _xCompare func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32
 65655  	var _pMain *XMergeEngine
 65656  	_pTask0 = elem78((*XSortSubtask)(unsafe.Pointer(&_pSorter.XaTask)), 0)
 65657  	_pMain = nil
 65658  	_db = (*Xsqlite3)((*XVdbeSorter)(_pTask0.XpSorter).Xdb)
 65659  	_xCompare = _vdbeSorterGetCompare(tls, _pSorter)
 65660  	_i = int32(0)
 65661  _0:
 65662  	if _i >= int32(_pSorter.XnTask) {
 65663  		goto _3
 65664  	}
 65665  	*(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&(elem78((*XSortSubtask)(unsafe.Pointer(&_pSorter.XaTask)), uintptr(_i)).XxCompare))) = _xCompare
 65666  	_i += 1
 65667  	goto _0
 65668  _3:
 65669  	_rc = _vdbeSorterMergeTreeBuild(tls, _pSorter, &_pMain)
 65670  	if _rc != int32(0) {
 65671  		goto _4
 65672  	}
 65673  	func() {
 65674  		if int32(_pSorter.XbUseThreads) != int32(0) && int32(_pSorter.XnTask) <= int32(1) {
 65675  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88517), unsafe.Pointer(&_vdbeSorterSetupMergeØ00__func__Ø000), unsafe.Pointer(str(85033)))
 65676  			crt.X__builtin_abort(tls)
 65677  		}
 65678  	}()
 65679  	if _pSorter.XbUseThreads == 0 {
 65680  		goto _8
 65681  	}
 65682  	_3_pReadr = nil
 65683  	_3_pLast = elem78((*XSortSubtask)(unsafe.Pointer(&_pSorter.XaTask)), uintptr(int32(_pSorter.XnTask)-int32(1)))
 65684  	_rc = _vdbeSortAllocUnpacked(tls, _3_pLast)
 65685  	if _rc != int32(0) {
 65686  		goto _9
 65687  	}
 65688  	_3_pReadr = (*XPmaReader)(_sqlite3DbMallocZero(tls, _db, uint64(52)))
 65689  	*(**XPmaReader)(unsafe.Pointer(&_pSorter.XpReader)) = _3_pReadr
 65690  	if _3_pReadr == nil {
 65691  		_rc = _sqlite3NomemError(tls, int32(88526))
 65692  	}
 65693  _9:
 65694  	if _rc != int32(0) {
 65695  		goto _11
 65696  	}
 65697  	_rc = _vdbeIncrMergerNew(tls, _3_pLast, _pMain, (**XIncrMerger)(unsafe.Pointer(&_3_pReadr.XpIncr)))
 65698  	if _rc != int32(0) {
 65699  		goto _12
 65700  	}
 65701  	_vdbeIncrMergerSetThreads(tls, (*XIncrMerger)(_3_pReadr.XpIncr))
 65702  	_3_iTask = int32(0)
 65703  _13:
 65704  	if _3_iTask >= (int32(_pSorter.XnTask) - int32(1)) {
 65705  		goto _16
 65706  	}
 65707  	if store91(&_7_pIncr, (*XIncrMerger)(elem80((*XPmaReader)(_pMain.XaReadr), uintptr(_3_iTask)).XpIncr)) != nil {
 65708  		_vdbeIncrMergerSetThreads(tls, _7_pIncr)
 65709  		func() {
 65710  			if (*XSortSubtask)(_7_pIncr.XpTask) == _3_pLast {
 65711  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88536), unsafe.Pointer(&_vdbeSorterSetupMergeØ00__func__Ø000), unsafe.Pointer(str(85077)))
 65712  				crt.X__builtin_abort(tls)
 65713  			}
 65714  		}()
 65715  	}
 65716  	_3_iTask += 1
 65717  	goto _13
 65718  _16:
 65719  	_3_iTask = int32(0)
 65720  _20:
 65721  	if _rc != int32(0) || _3_iTask >= int32(_pSorter.XnTask) {
 65722  		goto _24
 65723  	}
 65724  	_9_p = elem80((*XPmaReader)(_pMain.XaReadr), uintptr(_3_iTask))
 65725  	func() {
 65726  		if (*XIncrMerger)(_9_p.XpIncr) != nil && ((*XSortSubtask)((*XIncrMerger)(_9_p.XpIncr).XpTask) != elem78((*XSortSubtask)(unsafe.Pointer(&_pSorter.XaTask)), uintptr(_3_iTask)) || _3_iTask == (int32(_pSorter.XnTask)-int32(1)) && ((*XIncrMerger)(_9_p.XpIncr).XbUseThread) != int32(0)) {
 65727  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88550), unsafe.Pointer(&_vdbeSorterSetupMergeØ00__func__Ø000), unsafe.Pointer(str(85097)))
 65728  			crt.X__builtin_abort(tls)
 65729  		}
 65730  	}()
 65731  	_rc = _vdbePmaReaderIncrInit(tls, _9_p, int32(1))
 65732  	_3_iTask += 1
 65733  	goto _20
 65734  _24:
 65735  _12:
 65736  	_pMain = nil
 65737  _11:
 65738  	if _rc == int32(0) {
 65739  		_rc = _vdbePmaReaderIncrMergeInit(tls, _3_pReadr, int32(2))
 65740  	}
 65741  	goto _31
 65742  _8:
 65743  	_rc = _vdbeMergeEngineInit(tls, _pTask0, _pMain, int32(0))
 65744  	*(**XMergeEngine)(unsafe.Pointer(&_pSorter.XpMerger)) = _pMain
 65745  	_pMain = nil
 65746  _31:
 65747  _4:
 65748  	if _rc != int32(0) {
 65749  		_vdbeMergeEngineFree(tls, _pMain)
 65750  	}
 65751  	return _rc
 65752  }
 65753  
 65754  // C comment
 65755  //  /*
 65756  //  ** This function is called as part of a SorterRewind() operation on a sorter
 65757  //  ** that has already written two or more level-0 PMAs to one or more temp
 65758  //  ** files. It builds a tree of MergeEngine/IncrMerger/PmaReader objects that
 65759  //  ** can be used to incrementally merge all PMAs on disk.
 65760  //  **
 65761  //  ** If successful, SQLITE_OK is returned and *ppOut set to point to the
 65762  //  ** MergeEngine object at the root of the tree before returning. Or, if an
 65763  //  ** error occurs, an SQLite error code is returned and the final value
 65764  //  ** of *ppOut is undefined.
 65765  //  */
 65766  func _vdbeSorterMergeTreeBuild(tls *crt.TLS, _pSorter *XVdbeSorter, _ppOut **XMergeEngine) (r0 int32) {
 65767  	var _rc, _iTask, _3_nDepth, _5_i, _5_iSeq, _6_nReader int32
 65768  	var _3_iReadOff int64
 65769  	var _2_pTask *XSortSubtask
 65770  	var _pMain, _3_pRoot, _6_pMerger *XMergeEngine
 65771  	_pMain = nil
 65772  	_rc = int32(0)
 65773  	func() {
 65774  		if _pSorter.XbUseThreads == 0 && int32(_pSorter.XnTask) != int32(1) {
 65775  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88434), unsafe.Pointer(&_vdbeSorterMergeTreeBuildØ00__func__Ø000), unsafe.Pointer(str(85214)))
 65776  			crt.X__builtin_abort(tls)
 65777  		}
 65778  	}()
 65779  	if int32(_pSorter.XnTask) <= int32(1) {
 65780  		goto _3
 65781  	}
 65782  	_pMain = _vdbeMergeEngineNew(tls, int32(_pSorter.XnTask))
 65783  	if _pMain == nil {
 65784  		_rc = _sqlite3NomemError(tls, int32(88437))
 65785  	}
 65786  _3:
 65787  	_iTask = int32(0)
 65788  _5:
 65789  	if _rc != int32(0) || _iTask >= int32(_pSorter.XnTask) {
 65790  		goto _9
 65791  	}
 65792  	_2_pTask = elem78((*XSortSubtask)(unsafe.Pointer(&_pSorter.XaTask)), uintptr(_iTask))
 65793  	func() {
 65794  		if _2_pTask.XnPMA <= int32(0) && int32(1) == 0 {
 65795  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88443), unsafe.Pointer(&_vdbeSorterMergeTreeBuildØ00__func__Ø000), unsafe.Pointer(str(85256)))
 65796  			crt.X__builtin_abort(tls)
 65797  		}
 65798  	}()
 65799  	if int32(0) == 0 && _2_pTask.XnPMA == 0 {
 65800  		goto _14
 65801  	}
 65802  	_3_pRoot = nil
 65803  	_3_nDepth = _vdbeSorterTreeDepth(tls, _2_pTask.XnPMA)
 65804  	_3_iReadOff = 0
 65805  	if _2_pTask.XnPMA <= int32(16) {
 65806  		_rc = _vdbeMergeEngineLevel0(tls, _2_pTask, _2_pTask.XnPMA, &_3_iReadOff, &_3_pRoot)
 65807  		goto _16
 65808  	}
 65809  	_5_iSeq = int32(0)
 65810  	_3_pRoot = _vdbeMergeEngineNew(tls, int32(16))
 65811  	if _3_pRoot == nil {
 65812  		_rc = _sqlite3NomemError(tls, int32(88455))
 65813  	}
 65814  	_5_i = int32(0)
 65815  _18:
 65816  	if _5_i >= _2_pTask.XnPMA || _rc != int32(0) {
 65817  		goto _22
 65818  	}
 65819  	_6_pMerger = nil
 65820  	_6_nReader = func() int32 {
 65821  		if (_2_pTask.XnPMA - _5_i) < int32(16) {
 65822  			return (_2_pTask.XnPMA - _5_i)
 65823  		}
 65824  		return int32(16)
 65825  	}()
 65826  	_rc = _vdbeMergeEngineLevel0(tls, _2_pTask, _6_nReader, &_3_iReadOff, &_6_pMerger)
 65827  	if _rc == int32(0) {
 65828  		_rc = _vdbeSorterAddToTree(tls, _2_pTask, _3_nDepth, postInc2(&_5_iSeq, 1), _3_pRoot, _6_pMerger)
 65829  	}
 65830  	_5_i += int32(16)
 65831  	goto _18
 65832  _22:
 65833  _16:
 65834  	if _rc != int32(0) {
 65835  		goto _26
 65836  	}
 65837  	if _pMain != nil {
 65838  		_rc = _vdbeIncrMergerNew(tls, _2_pTask, _3_pRoot, (**XIncrMerger)(unsafe.Pointer(&(elem80((*XPmaReader)(_pMain.XaReadr), uintptr(_iTask)).XpIncr))))
 65839  		goto _28
 65840  	}
 65841  	func() {
 65842  		if _pMain != nil {
 65843  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88475), unsafe.Pointer(&_vdbeSorterMergeTreeBuildØ00__func__Ø000), unsafe.Pointer(str(85301)))
 65844  			crt.X__builtin_abort(tls)
 65845  		}
 65846  	}()
 65847  	_pMain = _3_pRoot
 65848  _28:
 65849  	goto _31
 65850  _26:
 65851  	_vdbeMergeEngineFree(tls, _3_pRoot)
 65852  _31:
 65853  _14:
 65854  	_iTask += 1
 65855  	goto _5
 65856  _9:
 65857  	if _rc != int32(0) {
 65858  		_vdbeMergeEngineFree(tls, _pMain)
 65859  		_pMain = nil
 65860  	}
 65861  	*_ppOut = _pMain
 65862  	return _rc
 65863  
 65864  	_ = _5_iSeq
 65865  	panic(0)
 65866  }
 65867  
 65868  var _vdbeSorterMergeTreeBuildØ00__func__Ø000 [25]int8
 65869  
 65870  func init() {
 65871  	crt.Xstrncpy(nil, &_vdbeSorterMergeTreeBuildØ00__func__Ø000[0], str(85310), 25)
 65872  }
 65873  
 65874  // C comment
 65875  //  /*
 65876  //  ** Allocate a new MergeEngine object capable of handling up to
 65877  //  ** nReader PmaReader inputs.
 65878  //  **
 65879  //  ** nReader is automatically rounded up to the next power of two.
 65880  //  ** nReader may not exceed SORTER_MAX_MERGE_COUNT even after rounding up.
 65881  //  */
 65882  func _vdbeMergeEngineNew(tls *crt.TLS, _nReader int32) (r0 *XMergeEngine) {
 65883  	var _N, _nByte int32
 65884  	var _pNew *XMergeEngine
 65885  	_N = int32(2)
 65886  	func() {
 65887  		if _nReader > int32(16) {
 65888  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87191), unsafe.Pointer(&_vdbeMergeEngineNewØ00__func__Ø000), unsafe.Pointer(str(85335)))
 65889  			crt.X__builtin_abort(tls)
 65890  		}
 65891  	}()
 65892  _2:
 65893  	if _N < _nReader {
 65894  		_N += _N
 65895  		goto _2
 65896  	}
 65897  	_nByte = int32(uint32(16) + (uint32(_N) * uint32(56)))
 65898  	_pNew = func() *XMergeEngine {
 65899  		if _sqlite3FaultSim(tls, int32(100)) != 0 {
 65900  			return nil
 65901  		}
 65902  		return (*XMergeEngine)(_sqlite3MallocZero(tls, uint64(_nByte)))
 65903  	}()
 65904  	if _pNew != nil {
 65905  		_pNew.XnTree = _N
 65906  		*(**XSortSubtask)(unsafe.Pointer(&_pNew.XpTask)) = nil
 65907  		*(**XPmaReader)(unsafe.Pointer(&_pNew.XaReadr)) = (*XPmaReader)(unsafe.Pointer(elem92(_pNew, uintptr(1))))
 65908  		_pNew.XaTree = (*int32)(unsafe.Pointer(elem80((*XPmaReader)(_pNew.XaReadr), uintptr(_N))))
 65909  	}
 65910  	return _pNew
 65911  }
 65912  
 65913  var _vdbeMergeEngineNewØ00__func__Ø000 [19]int8
 65914  
 65915  func init() {
 65916  	crt.Xstrncpy(nil, &_vdbeMergeEngineNewØ00__func__Ø000[0], str(85367), 19)
 65917  }
 65918  
 65919  // C comment
 65920  //  /*
 65921  //  ** Return the depth of a tree comprising nPMA PMAs, assuming a fanout of
 65922  //  ** SORTER_MAX_MERGE_COUNT. The returned value does not include leaf nodes.
 65923  //  **
 65924  //  ** i.e.
 65925  //  **
 65926  //  **   nPMA<=16    -> TreeDepth() == 0
 65927  //  **   nPMA<=256   -> TreeDepth() == 1
 65928  //  **   nPMA<=65536 -> TreeDepth() == 2
 65929  //  */
 65930  func _vdbeSorterTreeDepth(tls *crt.TLS, _nPMA int32) (r0 int32) {
 65931  	var _nDepth int32
 65932  	var _nDiv int64
 65933  	_nDepth = int32(0)
 65934  	_nDiv = int64(16)
 65935  _0:
 65936  	if _nDiv < int64(_nPMA) {
 65937  		_nDiv = _nDiv * int64(16)
 65938  		_nDepth += 1
 65939  		goto _0
 65940  	}
 65941  	return _nDepth
 65942  }
 65943  
 65944  // C comment
 65945  //  /*
 65946  //  ** Allocate a new MergeEngine object to merge the contents of nPMA level-0
 65947  //  ** PMAs from pTask->file. If no error occurs, set *ppOut to point to
 65948  //  ** the new object and return SQLITE_OK. Or, if an error does occur, set *ppOut
 65949  //  ** to NULL and return an SQLite error code.
 65950  //  **
 65951  //  ** When this function is called, *piOffset is set to the offset of the
 65952  //  ** first PMA to read from pTask->file. Assuming no error occurs, it is
 65953  //  ** set to the offset immediately following the last byte of the last
 65954  //  ** PMA before returning. If an error does occur, then the final value of
 65955  //  ** *piOffset is undefined.
 65956  //  */
 65957  func _vdbeMergeEngineLevel0(tls *crt.TLS, _pTask *XSortSubtask, _nPMA int32, _piOffset *int64, _ppOut **XMergeEngine) (r0 int32) {
 65958  	var _i, _rc int32
 65959  	var _iOff, _1_nDummy int64
 65960  	var _1_pReadr *XPmaReader
 65961  	var _pNew *XMergeEngine
 65962  	_iOff = *_piOffset
 65963  	_rc = int32(0)
 65964  	*_ppOut = store92(&_pNew, _vdbeMergeEngineNew(tls, _nPMA))
 65965  	if _pNew == nil {
 65966  		_rc = _sqlite3NomemError(tls, int32(88321))
 65967  	}
 65968  	_i = int32(0)
 65969  _1:
 65970  	if _i >= _nPMA || _rc != int32(0) {
 65971  		goto _5
 65972  	}
 65973  	_1_nDummy = 0
 65974  	_1_pReadr = elem80((*XPmaReader)(_pNew.XaReadr), uintptr(_i))
 65975  	_rc = _vdbePmaReaderInit(tls, _pTask, &_pTask.Xfile, _iOff, _1_pReadr, &_1_nDummy)
 65976  	_iOff = _1_pReadr.XiEof
 65977  	_i += 1
 65978  	goto _1
 65979  _5:
 65980  	if _rc != int32(0) {
 65981  		_vdbeMergeEngineFree(tls, _pNew)
 65982  		*_ppOut = nil
 65983  	}
 65984  	*_piOffset = _iOff
 65985  	return _rc
 65986  }
 65987  
 65988  // C comment
 65989  //  /*
 65990  //  ** Initialize PmaReader pReadr to scan through the PMA stored in file pFile
 65991  //  ** starting at offset iStart and ending at offset iEof-1. This function
 65992  //  ** leaves the PmaReader pointing to the first key in the PMA (or EOF if the
 65993  //  ** PMA is empty).
 65994  //  **
 65995  //  ** If the pnByte parameter is NULL, then it is assumed that the file
 65996  //  ** contains a single PMA, and that that PMA omits the initial length varint.
 65997  //  */
 65998  func _vdbePmaReaderInit(tls *crt.TLS, _pTask *XSortSubtask, _pFile *XSorterFile, _iStart int64, _pReadr *XPmaReader, _pnByte *int64) (r0 int32) {
 65999  	var _rc int32
 66000  	var _1_nByte uint64
 66001  	func() {
 66002  		if _pFile.XiEof <= _iStart {
 66003  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86747), unsafe.Pointer(&_vdbePmaReaderInitØ00__func__Ø000), unsafe.Pointer(str(85386)))
 66004  			crt.X__builtin_abort(tls)
 66005  		}
 66006  	}()
 66007  	func() {
 66008  		if _pReadr.XaAlloc != nil || _pReadr.XnAlloc != int32(0) {
 66009  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86748), unsafe.Pointer(&_vdbePmaReaderInitØ00__func__Ø000), unsafe.Pointer(str(85405)))
 66010  			crt.X__builtin_abort(tls)
 66011  		}
 66012  	}()
 66013  	func() {
 66014  		if _pReadr.XaBuffer != nil {
 66015  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86749), unsafe.Pointer(&_vdbePmaReaderInitØ00__func__Ø000), unsafe.Pointer(str(85444)))
 66016  			crt.X__builtin_abort(tls)
 66017  		}
 66018  	}()
 66019  	func() {
 66020  		if _pReadr.XaMap != nil {
 66021  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86750), unsafe.Pointer(&_vdbePmaReaderInitØ00__func__Ø000), unsafe.Pointer(str(85463)))
 66022  			crt.X__builtin_abort(tls)
 66023  		}
 66024  	}()
 66025  	_rc = _vdbePmaReaderSeek(tls, _pTask, _pReadr, _pFile, _iStart)
 66026  	if _rc == int32(0) {
 66027  		_1_nByte = uint64(0)
 66028  		_rc = _vdbePmaReadVarint(tls, _pReadr, &_1_nByte)
 66029  		_pReadr.XiEof = int64(uint64(_pReadr.XiReadOff) + _1_nByte)
 66030  		{
 66031  			p := _pnByte
 66032  			*p = int64(uint64(*p) + _1_nByte)
 66033  		}
 66034  	}
 66035  	if _rc == int32(0) {
 66036  		_rc = _vdbePmaReaderNext(tls, _pReadr)
 66037  	}
 66038  	return _rc
 66039  }
 66040  
 66041  var _vdbePmaReaderInitØ00__func__Ø000 [18]int8
 66042  
 66043  func init() {
 66044  	crt.Xstrncpy(nil, &_vdbePmaReaderInitØ00__func__Ø000[0], str(85479), 18)
 66045  }
 66046  
 66047  // C comment
 66048  //  /*
 66049  //  ** Attach PmaReader pReadr to file pFile (if it is not already attached to
 66050  //  ** that file) and seek it to offset iOff within the file.  Return SQLITE_OK
 66051  //  ** if successful, or an SQLite error code if an error occurs.
 66052  //  */
 66053  func _vdbePmaReaderSeek(tls *crt.TLS, _pTask *XSortSubtask, _pReadr *XPmaReader, _pFile *XSorterFile, _iOff int64) (r0 int32) {
 66054  	var _rc, _2_pgsz, _2_iBuf, _4_nRead int32
 66055  	_rc = int32(0)
 66056  	func() {
 66057  		if (*XIncrMerger)(_pReadr.XpIncr) != nil && ((*XIncrMerger)(_pReadr.XpIncr).XbEof) != int32(0) {
 66058  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86652), unsafe.Pointer(&_vdbePmaReaderSeekØ00__func__Ø000), unsafe.Pointer(str(85497)))
 66059  			crt.X__builtin_abort(tls)
 66060  		}
 66061  	}()
 66062  	if _sqlite3FaultSim(tls, int32(201)) != 0 {
 66063  		return int32(266)
 66064  	}
 66065  	if _pReadr.XaMap != nil {
 66066  		_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pReadr.XpFd), 0, unsafe.Pointer(_pReadr.XaMap))
 66067  		_pReadr.XaMap = nil
 66068  	}
 66069  	_pReadr.XiReadOff = _iOff
 66070  	_pReadr.XiEof = _pFile.XiEof
 66071  	*(**Xsqlite3_file)(unsafe.Pointer(&_pReadr.XpFd)) = (*Xsqlite3_file)(_pFile.XpFd)
 66072  	_rc = _vdbeSorterMapFile(tls, _pTask, _pFile, &_pReadr.XaMap)
 66073  	if _rc != int32(0) || _pReadr.XaMap != nil {
 66074  		goto _6
 66075  	}
 66076  	_2_pgsz = (*XVdbeSorter)(_pTask.XpSorter).Xpgsz
 66077  	_2_iBuf = int32(_pReadr.XiReadOff % int64(_2_pgsz))
 66078  	if _pReadr.XaBuffer != nil {
 66079  		goto _7
 66080  	}
 66081  	_pReadr.XaBuffer = (*uint8)(_sqlite3Malloc(tls, uint64(_2_pgsz)))
 66082  	if _pReadr.XaBuffer == nil {
 66083  		_rc = _sqlite3NomemError(tls, int32(86669))
 66084  	}
 66085  	_pReadr.XnBuffer = _2_pgsz
 66086  _7:
 66087  	if _rc != int32(0) || _2_iBuf == 0 {
 66088  		goto _10
 66089  	}
 66090  	_4_nRead = _2_pgsz - _2_iBuf
 66091  	if (_pReadr.XiReadOff + int64(_4_nRead)) > _pReadr.XiEof {
 66092  		_4_nRead = int32(_pReadr.XiEof - _pReadr.XiReadOff)
 66093  	}
 66094  	_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pReadr.XpFd), unsafe.Pointer(elem15(_pReadr.XaBuffer, uintptr(_2_iBuf))), _4_nRead, _pReadr.XiReadOff)
 66095  _10:
 66096  _6:
 66097  	return _rc
 66098  }
 66099  
 66100  var _vdbePmaReaderSeekØ00__func__Ø000 [18]int8
 66101  
 66102  func init() {
 66103  	crt.Xstrncpy(nil, &_vdbePmaReaderSeekØ00__func__Ø000[0], str(85540), 18)
 66104  }
 66105  
 66106  // C comment
 66107  //  /*
 66108  //  ** Attempt to memory map file pFile. If successful, set *pp to point to the
 66109  //  ** new mapping and return SQLITE_OK. If the mapping is not attempted
 66110  //  ** (because the file is too large or the VFS layer is configured not to use
 66111  //  ** mmap), return SQLITE_OK and set *pp to NULL.
 66112  //  **
 66113  //  ** Or, if an error occurs, return an SQLite error code. The final value of
 66114  //  ** *pp is undefined in this case.
 66115  //  */
 66116  func _vdbeSorterMapFile(tls *crt.TLS, _pTask *XSortSubtask, _pFile *XSorterFile, _pp **uint8) (r0 int32) {
 66117  	var _rc int32
 66118  	var _1_pFd *Xsqlite3_file
 66119  	_rc = int32(0)
 66120  	if _pFile.XiEof > int64((*Xsqlite3)((*XVdbeSorter)(_pTask.XpSorter).Xdb).XnMaxSorterMmap) {
 66121  		goto _0
 66122  	}
 66123  	_1_pFd = (*Xsqlite3_file)(_pFile.XpFd)
 66124  	if ((*Xsqlite3_io_methods)(_1_pFd.XpMethods).XiVersion) >= int32(3) {
 66125  		_rc = _sqlite3OsFetch(tls, _1_pFd, 0, int32(_pFile.XiEof), (*unsafe.Pointer)(unsafe.Pointer(_pp)))
 66126  	}
 66127  _0:
 66128  	return _rc
 66129  }
 66130  
 66131  // C comment
 66132  //  /*
 66133  //  ** Read a varint from the stream of data accessed by p. Set *pnOut to
 66134  //  ** the value read.
 66135  //  */
 66136  func _vdbePmaReadVarint(tls *crt.TLS, _p *XPmaReader, _pnOut *uint64) (r0 int32) {
 66137  	var _iBuf, _4_i, _4_rc int32
 66138  	var _4_a *uint8
 66139  	var _4_aVarint [16]uint8
 66140  	if _p.XaMap != nil {
 66141  		_p.XiReadOff += int64(_sqlite3GetVarint(tls, elem15(_p.XaMap, uintptr(_p.XiReadOff)), _pnOut))
 66142  		goto _1
 66143  	}
 66144  	_iBuf = int32(_p.XiReadOff % int64(_p.XnBuffer))
 66145  	if _iBuf != 0 && ((_p.XnBuffer - _iBuf) >= int32(9)) {
 66146  		_p.XiReadOff += int64(_sqlite3GetVarint(tls, elem15(_p.XaBuffer, uintptr(_iBuf)), _pnOut))
 66147  		goto _4
 66148  	}
 66149  	_4_i = int32(0)
 66150  _5:
 66151  	_4_rc = _vdbePmaReadBlob(tls, _p, int32(1), &_4_a)
 66152  	if _4_rc != 0 {
 66153  		return _4_rc
 66154  	}
 66155  	*elem15((*uint8)(unsafe.Pointer(&_4_aVarint)), uintptr(postInc2(&_4_i, 1)&int32(15))) = *elem15(_4_a, 0)
 66156  	if (int32(*elem15(_4_a, 0)) & int32(128)) != int32(0) {
 66157  		goto _5
 66158  	}
 66159  	_sqlite3GetVarint(tls, (*uint8)(unsafe.Pointer(&_4_aVarint)), _pnOut)
 66160  _4:
 66161  _1:
 66162  	return int32(0)
 66163  
 66164  	_ = _4_aVarint
 66165  	_ = _4_i
 66166  	panic(0)
 66167  }
 66168  
 66169  // C comment
 66170  //  /*
 66171  //  ** Read the next nByte bytes of data from the PMA p.
 66172  //  ** If successful, set *ppOut to point to a buffer containing the data
 66173  //  ** and return SQLITE_OK. Otherwise, if an error occurs, return an SQLite
 66174  //  ** error code.
 66175  //  **
 66176  //  ** The buffer returned in *ppOut is only valid until the
 66177  //  ** next call to this function.
 66178  //  */
 66179  func _vdbePmaReadBlob(tls *crt.TLS, _p *XPmaReader, _nByte int32, _ppOut **uint8) (r0 int32) {
 66180  	var _iBuf, _nAvail, _2_nRead, _2_rc, _6_nRem, _7_nNew, _8_rc, _8_nCopy int32
 66181  	var _7_aNew, _8_aNext *uint8
 66182  	if _p.XaMap != nil {
 66183  		*_ppOut = elem15(_p.XaMap, uintptr(_p.XiReadOff))
 66184  		_p.XiReadOff += int64(_nByte)
 66185  		return int32(0)
 66186  	}
 66187  	func() {
 66188  		if _p.XaBuffer == nil {
 66189  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86514), unsafe.Pointer(&_vdbePmaReadBlobØ00__func__Ø000), unsafe.Pointer(str(85558)))
 66190  			crt.X__builtin_abort(tls)
 66191  		}
 66192  	}()
 66193  	_iBuf = int32(_p.XiReadOff % int64(_p.XnBuffer))
 66194  	if _iBuf != int32(0) {
 66195  		goto _3
 66196  	}
 66197  	if (_p.XiEof - _p.XiReadOff) > int64(_p.XnBuffer) {
 66198  		_2_nRead = _p.XnBuffer
 66199  		goto _5
 66200  	}
 66201  	_2_nRead = int32(_p.XiEof - _p.XiReadOff)
 66202  _5:
 66203  	func() {
 66204  		if _2_nRead <= int32(0) {
 66205  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86530), unsafe.Pointer(&_vdbePmaReadBlobØ00__func__Ø000), unsafe.Pointer(str(85569)))
 66206  			crt.X__builtin_abort(tls)
 66207  		}
 66208  	}()
 66209  	_2_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_p.XpFd), unsafe.Pointer(_p.XaBuffer), _2_nRead, _p.XiReadOff)
 66210  	func() {
 66211  		if _2_rc == int32(522) {
 66212  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86534), unsafe.Pointer(&_vdbePmaReadBlobØ00__func__Ø000), unsafe.Pointer(str(85577)))
 66213  			crt.X__builtin_abort(tls)
 66214  		}
 66215  	}()
 66216  	if _2_rc != int32(0) {
 66217  		return _2_rc
 66218  	}
 66219  _3:
 66220  	_nAvail = _p.XnBuffer - _iBuf
 66221  	if _nByte <= _nAvail {
 66222  		*_ppOut = elem15(_p.XaBuffer, uintptr(_iBuf))
 66223  		_p.XiReadOff += int64(_nByte)
 66224  		goto _12
 66225  	}
 66226  	if _p.XnAlloc >= _nByte {
 66227  		goto _13
 66228  	}
 66229  	_7_nNew = func() int32 {
 66230  		if int32(128) > (_p.XnAlloc * int32(2)) {
 66231  			return int32(128)
 66232  		}
 66233  		return (_p.XnAlloc * int32(2))
 66234  	}()
 66235  _16:
 66236  	if _nByte > _7_nNew {
 66237  		_7_nNew = _7_nNew * int32(2)
 66238  		goto _16
 66239  	}
 66240  	_7_aNew = (*uint8)(_sqlite3Realloc(tls, unsafe.Pointer(_p.XaAlloc), uint64(_7_nNew)))
 66241  	if _7_aNew == nil {
 66242  		return _sqlite3NomemError(tls, int32(86557))
 66243  	}
 66244  	_p.XnAlloc = _7_nNew
 66245  	_p.XaAlloc = _7_aNew
 66246  _13:
 66247  	crt.Xmemcpy(tls, unsafe.Pointer(_p.XaAlloc), unsafe.Pointer(elem15(_p.XaBuffer, uintptr(_iBuf))), uint32(_nAvail))
 66248  	_p.XiReadOff += int64(_nAvail)
 66249  	_6_nRem = _nByte - _nAvail
 66250  _19:
 66251  	if _6_nRem <= int32(0) {
 66252  		goto _20
 66253  	}
 66254  	_8_nCopy = _6_nRem
 66255  	if _6_nRem > _p.XnBuffer {
 66256  		_8_nCopy = _p.XnBuffer
 66257  	}
 66258  	_8_rc = _vdbePmaReadBlob(tls, _p, _8_nCopy, &_8_aNext)
 66259  	if _8_rc != int32(0) {
 66260  		return _8_rc
 66261  	}
 66262  	func() {
 66263  		if _8_aNext == _p.XaAlloc {
 66264  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(86579), unsafe.Pointer(&_vdbePmaReadBlobØ00__func__Ø000), unsafe.Pointer(str(85605)))
 66265  			crt.X__builtin_abort(tls)
 66266  		}
 66267  	}()
 66268  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_p.XaAlloc, uintptr(_nByte-_6_nRem))), unsafe.Pointer(_8_aNext), uint32(_8_nCopy))
 66269  	_6_nRem -= _8_nCopy
 66270  	goto _19
 66271  _20:
 66272  	*_ppOut = _p.XaAlloc
 66273  _12:
 66274  	return int32(0)
 66275  }
 66276  
 66277  var _vdbePmaReadBlobØ00__func__Ø000 [16]int8
 66278  
 66279  func init() {
 66280  	crt.Xstrncpy(nil, &_vdbePmaReadBlobØ00__func__Ø000[0], str(85622), 16)
 66281  }
 66282  
 66283  // C comment
 66284  //  /*
 66285  //  ** Advance PmaReader pReadr to the next key in its PMA. Return SQLITE_OK if
 66286  //  ** no error occurs, or an SQLite error code if one does.
 66287  //  */
 66288  func _vdbePmaReaderNext(tls *crt.TLS, _pReadr *XPmaReader) (r0 int32) {
 66289  	var _rc, _1_bEof int32
 66290  	var _nRec uint64
 66291  	var _1_pIncr *XIncrMerger
 66292  	_rc = int32(0)
 66293  	_nRec = uint64(0)
 66294  	if _pReadr.XiReadOff < _pReadr.XiEof {
 66295  		goto _0
 66296  	}
 66297  	_1_pIncr = (*XIncrMerger)(_pReadr.XpIncr)
 66298  	_1_bEof = int32(1)
 66299  	if _1_pIncr == nil {
 66300  		goto _1
 66301  	}
 66302  	_rc = _vdbeIncrSwap(tls, _1_pIncr)
 66303  	if (_rc == int32(0)) && (_1_pIncr.XbEof == int32(0)) {
 66304  		_rc = _vdbePmaReaderSeek(tls, (*XSortSubtask)(_1_pIncr.XpTask), _pReadr, elem79((*XSorterFile)(unsafe.Pointer(&_1_pIncr.XaFile)), 0), _1_pIncr.XiStartOff)
 66305  		_1_bEof = int32(0)
 66306  	}
 66307  _1:
 66308  	if _1_bEof != 0 {
 66309  		_vdbePmaReaderClear(tls, _pReadr)
 66310  		return _rc
 66311  	}
 66312  _0:
 66313  	if _rc == int32(0) {
 66314  		_rc = _vdbePmaReadVarint(tls, _pReadr, &_nRec)
 66315  	}
 66316  	if _rc == int32(0) {
 66317  		_pReadr.XnKey = int32(_nRec)
 66318  		_rc = _vdbePmaReadBlob(tls, _pReadr, int32(_nRec), &_pReadr.XaKey)
 66319  	}
 66320  	return _rc
 66321  }
 66322  
 66323  // C comment
 66324  //  /*
 66325  //  ** This function is called when the PmaReader corresponding to pIncr has
 66326  //  ** finished reading the contents of aFile[0]. Its purpose is to "refill"
 66327  //  ** aFile[0] such that the PmaReader should start rereading it from the
 66328  //  ** beginning.
 66329  //  **
 66330  //  ** For single-threaded objects, this is accomplished by literally reading
 66331  //  ** keys from pIncr->pMerger and repopulating aFile[0].
 66332  //  **
 66333  //  ** For multi-threaded objects, all that is required is to wait until the
 66334  //  ** background thread is finished (if it is not already) and then swap
 66335  //  ** aFile[0] and aFile[1] in place. If the contents of pMerger have not
 66336  //  ** been exhausted, this function also launches a new background thread
 66337  //  ** to populate the new aFile[1].
 66338  //  **
 66339  //  ** SQLITE_OK is returned on success, or an SQLite error code otherwise.
 66340  //  */
 66341  func _vdbeIncrSwap(tls *crt.TLS, _pIncr *XIncrMerger) (r0 int32) {
 66342  	var _rc int32
 66343  	var _2_f0 XSorterFile
 66344  	_rc = int32(0)
 66345  	if _pIncr.XbUseThread == 0 {
 66346  		goto _0
 66347  	}
 66348  	_rc = _vdbeSorterJoinThread(tls, (*XSortSubtask)(_pIncr.XpTask))
 66349  	if _rc == int32(0) {
 66350  		_2_f0 = *elem79((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), 0)
 66351  		*elem79((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), 0) = *elem79((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), uintptr(1))
 66352  		*elem79((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), uintptr(1)) = _2_f0
 66353  	}
 66354  	if _rc != int32(0) {
 66355  		goto _2
 66356  	}
 66357  	if (elem79((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), 0).XiEof) == _pIncr.XiStartOff {
 66358  		_pIncr.XbEof = int32(1)
 66359  		goto _4
 66360  	}
 66361  	_rc = _vdbeIncrBgPopulate(tls, _pIncr)
 66362  _4:
 66363  _2:
 66364  	goto _5
 66365  _0:
 66366  	_rc = _vdbeIncrPopulate(tls, _pIncr)
 66367  	*elem79((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), 0) = *elem79((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), uintptr(1))
 66368  	if (elem79((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), 0).XiEof) == _pIncr.XiStartOff {
 66369  		_pIncr.XbEof = int32(1)
 66370  	}
 66371  _5:
 66372  	return _rc
 66373  }
 66374  
 66375  // C comment
 66376  //  /*
 66377  //  ** Launch a background thread to populate aFile[1] of pIncr.
 66378  //  */
 66379  func _vdbeIncrBgPopulate(tls *crt.TLS, _pIncr *XIncrMerger) (r0 int32) {
 66380  	var _p unsafe.Pointer
 66381  	_p = unsafe.Pointer(_pIncr)
 66382  	func() {
 66383  		if _pIncr.XbUseThread == 0 {
 66384  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87940), unsafe.Pointer(&_vdbeIncrBgPopulateØ00__func__Ø000), unsafe.Pointer(str(85638)))
 66385  			crt.X__builtin_abort(tls)
 66386  		}
 66387  	}()
 66388  	return _vdbeSorterCreateThread(tls, (*XSortSubtask)(_pIncr.XpTask), _vdbeIncrPopulateThread, _p)
 66389  }
 66390  
 66391  var _vdbeIncrBgPopulateØ00__func__Ø000 [19]int8
 66392  
 66393  func init() {
 66394  	crt.Xstrncpy(nil, &_vdbeIncrBgPopulateØ00__func__Ø000[0], str(85656), 19)
 66395  }
 66396  
 66397  // C comment
 66398  //  /*
 66399  //  ** The main routine for background threads that populate aFile[1] of
 66400  //  ** multi-threaded IncrMerger objects.
 66401  //  */
 66402  func _vdbeIncrPopulateThread(tls *crt.TLS, _pCtx unsafe.Pointer) (r0 unsafe.Pointer) {
 66403  	var _pRet unsafe.Pointer
 66404  	var _pIncr *XIncrMerger
 66405  	_pIncr = (*XIncrMerger)(_pCtx)
 66406  	_pRet = crt.U2P(uintptr(_vdbeIncrPopulate(tls, _pIncr)))
 66407  	(*XSortSubtask)(_pIncr.XpTask).XbDone = int32(1)
 66408  	return _pRet
 66409  }
 66410  
 66411  // C comment
 66412  //  /*
 66413  //  ** Read keys from pIncr->pMerger and populate pIncr->aFile[1]. The format
 66414  //  ** of the data stored in aFile[1] is the same as that used by regular PMAs,
 66415  //  ** except that the number-of-bytes varint is omitted from the start.
 66416  //  */
 66417  func _vdbeIncrPopulate(tls *crt.TLS, _pIncr *XIncrMerger) (r0 int32) {
 66418  	var _rc, _rc2, _1_dummy, _1_nKey int32
 66419  	var _iStart, _1_iEof int64
 66420  	var _1_pReader *XPmaReader
 66421  	var _pTask *XSortSubtask
 66422  	var _pOut *XSorterFile
 66423  	var _pMerger *XMergeEngine
 66424  	var _writer XPmaWriter
 66425  	_rc = int32(0)
 66426  	_iStart = _pIncr.XiStartOff
 66427  	_pOut = elem79((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), uintptr(1))
 66428  	_pTask = (*XSortSubtask)(_pIncr.XpTask)
 66429  	_pMerger = (*XMergeEngine)(_pIncr.XpMerger)
 66430  	func() {
 66431  		if _pIncr.XbEof != int32(0) {
 66432  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87894), unsafe.Pointer(&_vdbeIncrPopulateØ00__func__Ø000), unsafe.Pointer(str(85675)))
 66433  			crt.X__builtin_abort(tls)
 66434  		}
 66435  	}()
 66436  	_vdbePmaWriterInit(tls, (*Xsqlite3_file)(_pOut.XpFd), &_writer, (*XVdbeSorter)(_pTask.XpSorter).Xpgsz, _iStart)
 66437  _2:
 66438  	if _rc != int32(0) {
 66439  		goto _3
 66440  	}
 66441  	_1_pReader = elem80((*XPmaReader)(_pMerger.XaReadr), uintptr(*elem8(_pMerger.XaTree, uintptr(1))))
 66442  	_1_nKey = _1_pReader.XnKey
 66443  	_1_iEof = _writer.XiWriteOff + int64(_writer.XiBufEnd)
 66444  	if (*Xsqlite3_file)(_1_pReader.XpFd) == nil {
 66445  		goto _3
 66446  	}
 66447  	if ((_1_iEof + int64(_1_nKey)) + int64(_sqlite3VarintLen(tls, uint64(_1_nKey)))) > (_iStart + int64(_pIncr.XmxSz)) {
 66448  		goto _3
 66449  	}
 66450  	_vdbePmaWriteVarint(tls, &_writer, uint64(_1_nKey))
 66451  	_vdbePmaWriteBlob(tls, &_writer, _1_pReader.XaKey, _1_nKey)
 66452  	func() {
 66453  		if (*XSortSubtask)((*XMergeEngine)(_pIncr.XpMerger).XpTask) != _pTask {
 66454  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87913), unsafe.Pointer(&_vdbeIncrPopulateØ00__func__Ø000), unsafe.Pointer(str(85690)))
 66455  			crt.X__builtin_abort(tls)
 66456  		}
 66457  	}()
 66458  	_rc = _vdbeMergeEngineStep(tls, (*XMergeEngine)(_pIncr.XpMerger), &_1_dummy)
 66459  	goto _2
 66460  _3:
 66461  	_rc2 = _vdbePmaWriterFinish(tls, &_writer, &_pOut.XiEof)
 66462  	if _rc == int32(0) {
 66463  		_rc = _rc2
 66464  	}
 66465  	return _rc
 66466  }
 66467  
 66468  var _vdbeIncrPopulateØ00__func__Ø000 [17]int8
 66469  
 66470  func init() {
 66471  	crt.Xstrncpy(nil, &_vdbeIncrPopulateØ00__func__Ø000[0], str(85719), 17)
 66472  }
 66473  
 66474  // C comment
 66475  //  /*
 66476  //  ** Advance the MergeEngine to its next entry.
 66477  //  ** Set *pbEof to true there is no next entry because
 66478  //  ** the MergeEngine has reached the end of all its inputs.
 66479  //  **
 66480  //  ** Return SQLITE_OK if successful or an error code if an error occurs.
 66481  //  */
 66482  func _vdbeMergeEngineStep(tls *crt.TLS, _pMerger *XMergeEngine, _pbEof *int32) (r0 int32) {
 66483  	var _rc, _iPrev, _1_i, _1_bCached, _2_iRes int32
 66484  	var _1_pReadr1, _1_pReadr2 *XPmaReader
 66485  	var _pTask *XSortSubtask
 66486  	_iPrev = *elem8(_pMerger.XaTree, uintptr(1))
 66487  	_pTask = (*XSortSubtask)(_pMerger.XpTask)
 66488  	_rc = _vdbePmaReaderNext(tls, elem80((*XPmaReader)(_pMerger.XaReadr), uintptr(_iPrev)))
 66489  	if _rc != int32(0) {
 66490  		goto _0
 66491  	}
 66492  	_1_bCached = int32(0)
 66493  	_1_pReadr1 = elem80((*XPmaReader)(_pMerger.XaReadr), uintptr(_iPrev&int32(65534)))
 66494  	_1_pReadr2 = elem80((*XPmaReader)(_pMerger.XaReadr), uintptr(_iPrev|int32(1)))
 66495  	_1_i = (_pMerger.XnTree + _iPrev) / int32(2)
 66496  _1:
 66497  	if _1_i <= int32(0) {
 66498  		goto _4
 66499  	}
 66500  	if (*Xsqlite3_file)(_1_pReadr1.XpFd) == nil {
 66501  		_2_iRes = int32(1)
 66502  		goto _8
 66503  	}
 66504  	if (*Xsqlite3_file)(_1_pReadr2.XpFd) == nil {
 66505  		_2_iRes = int32(-1)
 66506  		goto _8
 66507  	}
 66508  	_2_iRes = func() func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32 {
 66509  		v := _pTask.XxCompare
 66510  		return *(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&v))
 66511  	}()(tls, _pTask, &_1_bCached, unsafe.Pointer(_1_pReadr1.XaKey), _1_pReadr1.XnKey, unsafe.Pointer(_1_pReadr2.XaKey), _1_pReadr2.XnKey)
 66512  _8:
 66513  	if (_2_iRes < int32(0)) || ((_2_iRes == int32(0)) && (crt.P2U(unsafe.Pointer(_1_pReadr1)) < crt.P2U(unsafe.Pointer(_1_pReadr2)))) {
 66514  		*elem8(_pMerger.XaTree, uintptr(_1_i)) = int32((uintptr(unsafe.Pointer(_1_pReadr1)) - uintptr(_pMerger.XaReadr)) / 52)
 66515  		_1_pReadr2 = elem80((*XPmaReader)(_pMerger.XaReadr), uintptr(*elem8(_pMerger.XaTree, uintptr(_1_i^int32(1)))))
 66516  		_1_bCached = int32(0)
 66517  		goto _12
 66518  	}
 66519  	if _1_pReadr1.XpFd != nil {
 66520  		_1_bCached = int32(0)
 66521  	}
 66522  	*elem8(_pMerger.XaTree, uintptr(_1_i)) = int32((uintptr(unsafe.Pointer(_1_pReadr2)) - uintptr(_pMerger.XaReadr)) / 52)
 66523  	_1_pReadr1 = elem80((*XPmaReader)(_pMerger.XaReadr), uintptr(*elem8(_pMerger.XaTree, uintptr(_1_i^int32(1)))))
 66524  _12:
 66525  	_1_i = _1_i / int32(2)
 66526  	goto _1
 66527  _4:
 66528  	*_pbEof = bool2int((*Xsqlite3_file)(elem80((*XPmaReader)(_pMerger.XaReadr), uintptr(*elem8(_pMerger.XaTree, uintptr(1)))).XpFd) == nil)
 66529  _0:
 66530  	return func() int32 {
 66531  		if _rc == int32(0) {
 66532  			return int32((*XUnpackedRecord)(_pTask.XpUnpacked).XerrCode)
 66533  		}
 66534  		return _rc
 66535  	}()
 66536  }
 66537  
 66538  // C comment
 66539  //  /*
 66540  //  ** pRoot is the root of an incremental merge-tree with depth nDepth (according
 66541  //  ** to vdbeSorterTreeDepth()). pLeaf is the iSeq'th leaf to be added to the
 66542  //  ** tree, counting from zero. This function adds pLeaf to the tree.
 66543  //  **
 66544  //  ** If successful, SQLITE_OK is returned. If an error occurs, an SQLite error
 66545  //  ** code is returned and pLeaf is freed.
 66546  //  */
 66547  func _vdbeSorterAddToTree(tls *crt.TLS, _pTask *XSortSubtask, _nDepth int32, _iSeq int32, _pRoot *XMergeEngine, _pLeaf *XMergeEngine) (r0 int32) {
 66548  	var _rc, _nDiv, _i, _2_iIter int32
 66549  	var _2_pReadr *XPmaReader
 66550  	var _pIncr *XIncrMerger
 66551  	var _p, _3_pNew *XMergeEngine
 66552  	_rc = int32(0)
 66553  	_nDiv = int32(1)
 66554  	_p = _pRoot
 66555  	_rc = _vdbeIncrMergerNew(tls, _pTask, _pLeaf, &_pIncr)
 66556  	_i = int32(1)
 66557  _0:
 66558  	if _i >= _nDepth {
 66559  		goto _3
 66560  	}
 66561  	_nDiv = _nDiv * int32(16)
 66562  	_i += 1
 66563  	goto _0
 66564  _3:
 66565  	_i = int32(1)
 66566  _4:
 66567  	if _i >= _nDepth || _rc != int32(0) {
 66568  		goto _8
 66569  	}
 66570  	_2_iIter = (_iSeq / _nDiv) % int32(16)
 66571  	_2_pReadr = elem80((*XPmaReader)(_p.XaReadr), uintptr(_2_iIter))
 66572  	if (*XIncrMerger)(_2_pReadr.XpIncr) != nil {
 66573  		goto _9
 66574  	}
 66575  	_3_pNew = _vdbeMergeEngineNew(tls, int32(16))
 66576  	if _3_pNew == nil {
 66577  		_rc = _sqlite3NomemError(tls, int32(88392))
 66578  		goto _11
 66579  	}
 66580  	_rc = _vdbeIncrMergerNew(tls, _pTask, _3_pNew, (**XIncrMerger)(unsafe.Pointer(&_2_pReadr.XpIncr)))
 66581  _11:
 66582  _9:
 66583  	if _rc == int32(0) {
 66584  		_p = (*XMergeEngine)((*XIncrMerger)(_2_pReadr.XpIncr).XpMerger)
 66585  		_nDiv = _nDiv / int32(16)
 66586  	}
 66587  	_i += 1
 66588  	goto _4
 66589  _8:
 66590  	if _rc == int32(0) {
 66591  		*(**XIncrMerger)(unsafe.Pointer(&(elem80((*XPmaReader)(_p.XaReadr), uintptr(_iSeq%int32(16))).XpIncr))) = _pIncr
 66592  		goto _14
 66593  	}
 66594  	_vdbeIncrFree(tls, _pIncr)
 66595  _14:
 66596  	return _rc
 66597  }
 66598  
 66599  // C comment
 66600  //  /*
 66601  //  ** Allocate and return a new IncrMerger object to read data from pMerger.
 66602  //  **
 66603  //  ** If an OOM condition is encountered, return NULL. In this case free the
 66604  //  ** pMerger argument before returning.
 66605  //  */
 66606  func _vdbeIncrMergerNew(tls *crt.TLS, _pTask *XSortSubtask, _pMerger *XMergeEngine, _ppOut **XIncrMerger) (r0 int32) {
 66607  	var _rc int32
 66608  	var _pIncr *XIncrMerger
 66609  	_rc = int32(0)
 66610  	_pIncr = store91(_ppOut, (*XIncrMerger)(func() unsafe.Pointer {
 66611  		if _sqlite3FaultSim(tls, int32(100)) != 0 {
 66612  			return nil
 66613  		}
 66614  		return _sqlite3MallocZero(tls, uint64(52))
 66615  	}()))
 66616  	if _pIncr != nil {
 66617  		*(**XMergeEngine)(unsafe.Pointer(&_pIncr.XpMerger)) = _pMerger
 66618  		*(**XSortSubtask)(unsafe.Pointer(&_pIncr.XpTask)) = _pTask
 66619  		_pIncr.XmxSz = func() int32 {
 66620  			if (((*XVdbeSorter)(_pTask.XpSorter).XmxKeysize) + int32(9)) > (((*XVdbeSorter)(_pTask.XpSorter).XmxPmaSize) / int32(2)) {
 66621  				return (((*XVdbeSorter)(_pTask.XpSorter).XmxKeysize) + int32(9))
 66622  			}
 66623  			return (((*XVdbeSorter)(_pTask.XpSorter).XmxPmaSize) / int32(2))
 66624  		}()
 66625  		_pTask.Xfile2.XiEof += int64(_pIncr.XmxSz)
 66626  		goto _5
 66627  	}
 66628  	_vdbeMergeEngineFree(tls, _pMerger)
 66629  	_rc = _sqlite3NomemError(tls, int32(88016))
 66630  _5:
 66631  	return _rc
 66632  }
 66633  
 66634  var _vdbeSorterSetupMergeØ00__func__Ø000 [21]int8
 66635  
 66636  func init() {
 66637  	crt.Xstrncpy(nil, &_vdbeSorterSetupMergeØ00__func__Ø000[0], str(85736), 21)
 66638  }
 66639  
 66640  // C comment
 66641  //  /*
 66642  //  ** Set the "use-threads" flag on object pIncr.
 66643  //  */
 66644  func _vdbeIncrMergerSetThreads(tls *crt.TLS, _pIncr *XIncrMerger) {
 66645  	_pIncr.XbUseThread = int32(1)
 66646  	((*XSortSubtask)(_pIncr.XpTask).Xfile2).XiEof -= int64(_pIncr.XmxSz)
 66647  }
 66648  
 66649  // C comment
 66650  //  /*
 66651  //  ** If the PmaReader passed as the first argument is not an incremental-reader
 66652  //  ** (if pReadr->pIncr==0), then this function is a no-op. Otherwise, it invokes
 66653  //  ** the vdbePmaReaderIncrMergeInit() function with the parameters passed to
 66654  //  ** this routine to initialize the incremental merge.
 66655  //  **
 66656  //  ** If the IncrMerger object is multi-threaded (IncrMerger.bUseThread==1),
 66657  //  ** then a background thread is launched to call vdbePmaReaderIncrMergeInit().
 66658  //  ** Or, if the IncrMerger is single threaded, the same function is called
 66659  //  ** using the current thread.
 66660  //  */
 66661  func _vdbePmaReaderIncrInit(tls *crt.TLS, _pReadr *XPmaReader, _eMode int32) (r0 int32) {
 66662  	var _rc int32
 66663  	var _2_pCtx unsafe.Pointer
 66664  	var _pIncr *XIncrMerger
 66665  	_pIncr = (*XIncrMerger)(_pReadr.XpIncr)
 66666  	_rc = int32(0)
 66667  	if _pIncr == nil {
 66668  		goto _0
 66669  	}
 66670  	func() {
 66671  		if _pIncr.XbUseThread != int32(0) && _eMode != int32(1) {
 66672  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88284), unsafe.Pointer(&_vdbePmaReaderIncrInitØ00__func__Ø000), unsafe.Pointer(str(85757)))
 66673  			crt.X__builtin_abort(tls)
 66674  		}
 66675  	}()
 66676  	if _pIncr.XbUseThread != 0 {
 66677  		_2_pCtx = unsafe.Pointer(_pReadr)
 66678  		_rc = _vdbeSorterCreateThread(tls, (*XSortSubtask)(_pIncr.XpTask), _vdbePmaReaderBgIncrInit, _2_pCtx)
 66679  		goto _5
 66680  	}
 66681  	_rc = _vdbePmaReaderIncrMergeInit(tls, _pReadr, _eMode)
 66682  _5:
 66683  _0:
 66684  	return _rc
 66685  }
 66686  
 66687  var _vdbePmaReaderIncrInitØ00__func__Ø000 [22]int8
 66688  
 66689  func init() {
 66690  	crt.Xstrncpy(nil, &_vdbePmaReaderIncrInitØ00__func__Ø000[0], str(85802), 22)
 66691  }
 66692  
 66693  // C comment
 66694  //  /*
 66695  //  ** The main routine for vdbePmaReaderIncrMergeInit() operations run in
 66696  //  ** background threads.
 66697  //  */
 66698  func _vdbePmaReaderBgIncrInit(tls *crt.TLS, _pCtx unsafe.Pointer) (r0 unsafe.Pointer) {
 66699  	var _pRet unsafe.Pointer
 66700  	var _pReader *XPmaReader
 66701  	_pReader = (*XPmaReader)(_pCtx)
 66702  	_pRet = crt.U2P(uintptr(_vdbePmaReaderIncrMergeInit(tls, _pReader, int32(1))))
 66703  	(*XSortSubtask)((*XIncrMerger)(_pReader.XpIncr).XpTask).XbDone = int32(1)
 66704  	return _pRet
 66705  }
 66706  
 66707  // C comment
 66708  //  /*
 66709  //  ** The PmaReader passed as the first argument is guaranteed to be an
 66710  //  ** incremental-reader (pReadr->pIncr!=0). This function serves to open
 66711  //  ** and/or initialize the temp file related fields of the IncrMerge
 66712  //  ** object at (pReadr->pIncr).
 66713  //  **
 66714  //  ** If argument eMode is set to INCRINIT_NORMAL, then all PmaReaders
 66715  //  ** in the sub-tree headed by pReadr are also initialized. Data is then
 66716  //  ** loaded into the buffers belonging to pReadr and it is set to point to
 66717  //  ** the first key in its range.
 66718  //  **
 66719  //  ** If argument eMode is set to INCRINIT_TASK, then pReadr is guaranteed
 66720  //  ** to be a multi-threaded PmaReader and this function is being called in a
 66721  //  ** background thread. In this case all PmaReaders in the sub-tree are
 66722  //  ** initialized as for INCRINIT_NORMAL and the aFile[1] buffer belonging to
 66723  //  ** pReadr is populated. However, pReadr itself is not set up to point
 66724  //  ** to its first key. A call to vdbePmaReaderNext() is still required to do
 66725  //  ** that.
 66726  //  **
 66727  //  ** The reason this function does not call vdbePmaReaderNext() immediately
 66728  //  ** in the INCRINIT_TASK case is that vdbePmaReaderNext() assumes that it has
 66729  //  ** to block on thread (pTask->thread) before accessing aFile[1]. But, since
 66730  //  ** this entire function is being run by thread (pTask->thread), that will
 66731  //  ** lead to the current background thread attempting to join itself.
 66732  //  **
 66733  //  ** Finally, if argument eMode is set to INCRINIT_ROOT, it may be assumed
 66734  //  ** that pReadr->pIncr is a multi-threaded IncrMerge objects, and that all
 66735  //  ** child-trees have already been initialized using IncrInit(INCRINIT_TASK).
 66736  //  ** In this case vdbePmaReaderNext() is called on all child PmaReaders and
 66737  //  ** the current PmaReader set to point to the first key in its range.
 66738  //  **
 66739  //  ** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
 66740  //  */
 66741  func _vdbePmaReaderIncrMergeInit(tls *crt.TLS, _pReadr *XPmaReader, _eMode int32) (r0 int32) {
 66742  	var _rc, _1_mxSz int32
 66743  	var _db *Xsqlite3
 66744  	var _pIncr *XIncrMerger
 66745  	var _pTask *XSortSubtask
 66746  	_rc = int32(0)
 66747  	_pIncr = (*XIncrMerger)(_pReadr.XpIncr)
 66748  	_pTask = (*XSortSubtask)(_pIncr.XpTask)
 66749  	_db = (*Xsqlite3)((*XVdbeSorter)(_pTask.XpSorter).Xdb)
 66750  
 66751  	_rc = _vdbeMergeEngineInit(tls, _pTask, (*XMergeEngine)(_pIncr.XpMerger), _eMode)
 66752  	if _rc != int32(0) {
 66753  		goto _0
 66754  	}
 66755  	_1_mxSz = _pIncr.XmxSz
 66756  	if _pIncr.XbUseThread == 0 {
 66757  		goto _1
 66758  	}
 66759  	_rc = _vdbeSorterOpenTempFile(tls, _db, int64(_1_mxSz), (**Xsqlite3_file)(unsafe.Pointer(&(elem79((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), 0).XpFd))))
 66760  	if _rc == int32(0) {
 66761  		_rc = _vdbeSorterOpenTempFile(tls, _db, int64(_1_mxSz), (**Xsqlite3_file)(unsafe.Pointer(&(elem79((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), uintptr(1)).XpFd))))
 66762  	}
 66763  	goto _3
 66764  _1:
 66765  	if (*Xsqlite3_file)(_pTask.Xfile2.XpFd) == nil {
 66766  		func() {
 66767  			if (_pTask.Xfile2.XiEof) <= (0) {
 66768  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88217), unsafe.Pointer(&_vdbePmaReaderIncrMergeInitØ00__func__Ø000), unsafe.Pointer(str(85824)))
 66769  				crt.X__builtin_abort(tls)
 66770  			}
 66771  		}()
 66772  		_rc = _vdbeSorterOpenTempFile(tls, _db, _pTask.Xfile2.XiEof, (**Xsqlite3_file)(unsafe.Pointer(&(_pTask.Xfile2.XpFd))))
 66773  		_pTask.Xfile2.XiEof = 0
 66774  	}
 66775  	if _rc == int32(0) {
 66776  		*(**Xsqlite3_file)(unsafe.Pointer(&(elem79((*XSorterFile)(unsafe.Pointer(&_pIncr.XaFile)), uintptr(1)).XpFd))) = (*Xsqlite3_file)(_pTask.Xfile2.XpFd)
 66777  		_pIncr.XiStartOff = _pTask.Xfile2.XiEof
 66778  		_pTask.Xfile2.XiEof += int64(_1_mxSz)
 66779  	}
 66780  _3:
 66781  _0:
 66782  	if (_rc == int32(0)) && _pIncr.XbUseThread != 0 {
 66783  		func() {
 66784  			if _eMode != int32(2) && _eMode != int32(1) {
 66785  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88241), unsafe.Pointer(&_vdbePmaReaderIncrMergeInitØ00__func__Ø000), unsafe.Pointer(str(85844)))
 66786  				crt.X__builtin_abort(tls)
 66787  			}
 66788  		}()
 66789  		_rc = _vdbeIncrPopulate(tls, _pIncr)
 66790  	}
 66791  	if (_rc == int32(0)) && (int32(0) != 0 || (_eMode != int32(1))) {
 66792  		_rc = _vdbePmaReaderNext(tls, _pReadr)
 66793  	}
 66794  	return _rc
 66795  }
 66796  
 66797  // C comment
 66798  //  /*
 66799  //  ** Initialize the MergeEngine object passed as the second argument. Once this
 66800  //  ** function returns, the first key of merged data may be read from the
 66801  //  ** MergeEngine object in the usual fashion.
 66802  //  **
 66803  //  ** If argument eMode is INCRINIT_ROOT, then it is assumed that any IncrMerge
 66804  //  ** objects attached to the PmaReader objects that the merger reads from have
 66805  //  ** already been populated, but that they have not yet populated aFile[0] and
 66806  //  ** set the PmaReader objects up to read from it. In this case all that is
 66807  //  ** required is to call vdbePmaReaderNext() on each PmaReader to point it at
 66808  //  ** its first key.
 66809  //  **
 66810  //  ** Otherwise, if eMode is any value other than INCRINIT_ROOT, then use
 66811  //  ** vdbePmaReaderIncrMergeInit() to initialize each PmaReader that feeds data
 66812  //  ** to pMerger.
 66813  //  **
 66814  //  ** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
 66815  //  */
 66816  func _vdbeMergeEngineInit(tls *crt.TLS, _pTask *XSortSubtask, _pMerger *XMergeEngine, _eMode int32) (r0 int32) {
 66817  	var _rc, _i, _nTree int32
 66818  	_rc = int32(0)
 66819  	_nTree = _pMerger.XnTree
 66820  
 66821  	func() {
 66822  		if (*XSortSubtask)(_pMerger.XpTask) != nil {
 66823  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88133), unsafe.Pointer(&_vdbeMergeEngineInitØ00__func__Ø000), unsafe.Pointer(str(85889)))
 66824  			crt.X__builtin_abort(tls)
 66825  		}
 66826  	}()
 66827  	*(**XSortSubtask)(unsafe.Pointer(&_pMerger.XpTask)) = _pTask
 66828  	_i = int32(0)
 66829  _2:
 66830  	if _i >= _nTree {
 66831  		goto _5
 66832  	}
 66833  	if int32(1) != 0 && (_eMode == int32(2)) {
 66834  		_rc = _vdbePmaReaderNext(tls, elem80((*XPmaReader)(_pMerger.XaReadr), uintptr((_nTree-_i)-int32(1))))
 66835  		goto _8
 66836  	}
 66837  	_rc = _vdbePmaReaderIncrInit(tls, elem80((*XPmaReader)(_pMerger.XaReadr), uintptr(_i)), int32(0))
 66838  _8:
 66839  	if _rc != int32(0) {
 66840  		return _rc
 66841  	}
 66842  	_i += 1
 66843  	goto _2
 66844  _5:
 66845  	_i = _pMerger.XnTree - int32(1)
 66846  _10:
 66847  	if _i <= int32(0) {
 66848  		goto _13
 66849  	}
 66850  	_vdbeMergeEngineCompare(tls, _pMerger, _i)
 66851  	_i -= 1
 66852  	goto _10
 66853  _13:
 66854  	return int32((*XUnpackedRecord)(_pTask.XpUnpacked).XerrCode)
 66855  }
 66856  
 66857  var _vdbeMergeEngineInitØ00__func__Ø000 [20]int8
 66858  
 66859  func init() {
 66860  	crt.Xstrncpy(nil, &_vdbeMergeEngineInitØ00__func__Ø000[0], str(85907), 20)
 66861  }
 66862  
 66863  // C comment
 66864  //  /*
 66865  //  ** Recompute pMerger->aTree[iOut] by comparing the next keys on the
 66866  //  ** two PmaReaders that feed that entry.  Neither of the PmaReaders
 66867  //  ** are advanced.  This routine merely does the comparison.
 66868  //  */
 66869  func _vdbeMergeEngineCompare(tls *crt.TLS, _pMerger *XMergeEngine, _iOut int32) {
 66870  	var _i1, _i2, _iRes, _5_bCached, _5_res int32
 66871  	var _p1, _p2 *XPmaReader
 66872  	var _5_pTask *XSortSubtask
 66873  	func() {
 66874  		if _iOut >= _pMerger.XnTree || _iOut <= int32(0) {
 66875  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88048), unsafe.Pointer(&_vdbeMergeEngineCompareØ00__func__Ø000), unsafe.Pointer(str(85927)))
 66876  			crt.X__builtin_abort(tls)
 66877  		}
 66878  	}()
 66879  	if _iOut >= (_pMerger.XnTree / int32(2)) {
 66880  		_i1 = (_iOut - (_pMerger.XnTree / int32(2))) * int32(2)
 66881  		_i2 = _i1 + int32(1)
 66882  		goto _4
 66883  	}
 66884  	_i1 = *elem8(_pMerger.XaTree, uintptr(_iOut*int32(2)))
 66885  	_i2 = *elem8(_pMerger.XaTree, uintptr((_iOut*int32(2))+int32(1)))
 66886  _4:
 66887  	_p1 = elem80((*XPmaReader)(_pMerger.XaReadr), uintptr(_i1))
 66888  	_p2 = elem80((*XPmaReader)(_pMerger.XaReadr), uintptr(_i2))
 66889  	if (*Xsqlite3_file)(_p1.XpFd) == nil {
 66890  		_iRes = _i2
 66891  		goto _8
 66892  	}
 66893  	if (*Xsqlite3_file)(_p2.XpFd) == nil {
 66894  		_iRes = _i1
 66895  		goto _8
 66896  	}
 66897  	_5_pTask = (*XSortSubtask)(_pMerger.XpTask)
 66898  	_5_bCached = int32(0)
 66899  	func() {
 66900  		if (*XUnpackedRecord)(_5_pTask.XpUnpacked) == nil {
 66901  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88069), unsafe.Pointer(&_vdbeMergeEngineCompareØ00__func__Ø000), unsafe.Pointer(str(85957)))
 66902  			crt.X__builtin_abort(tls)
 66903  		}
 66904  	}()
 66905  	_5_res = func() func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32 {
 66906  		v := _5_pTask.XxCompare
 66907  		return *(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&v))
 66908  	}()(tls, _5_pTask, &_5_bCached, unsafe.Pointer(_p1.XaKey), _p1.XnKey, unsafe.Pointer(_p2.XaKey), _p2.XnKey)
 66909  	if _5_res <= int32(0) {
 66910  		_iRes = _i1
 66911  		goto _12
 66912  	}
 66913  	_iRes = _i2
 66914  _12:
 66915  _8:
 66916  	*elem8(_pMerger.XaTree, uintptr(_iOut)) = _iRes
 66917  }
 66918  
 66919  var _vdbeMergeEngineCompareØ00__func__Ø000 [23]int8
 66920  
 66921  func init() {
 66922  	crt.Xstrncpy(nil, &_vdbeMergeEngineCompareØ00__func__Ø000[0], str(85977), 23)
 66923  }
 66924  
 66925  var _vdbePmaReaderIncrMergeInitØ00__func__Ø000 [27]int8
 66926  
 66927  func init() {
 66928  	crt.Xstrncpy(nil, &_vdbePmaReaderIncrMergeInitØ00__func__Ø000[0], str(86000), 27)
 66929  }
 66930  
 66931  // C comment
 66932  //  /*
 66933  //  ** Advance to the next element in the sorter.
 66934  //  */
 66935  func _sqlite3VdbeSorterNext(tls *crt.TLS, _db *Xsqlite3, _pCsr *XVdbeCursor, _pbEof *int32) (r0 int32) {
 66936  	var _rc int32
 66937  	var _pSorter *XVdbeSorter
 66938  	var _4_pFree *XSorterRecord
 66939  	func() {
 66940  		if int32(_pCsr.XeCurType) != int32(1) {
 66941  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88635), unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000), unsafe.Pointer(str(57837)))
 66942  			crt.X__builtin_abort(tls)
 66943  		}
 66944  	}()
 66945  	_pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer(&_pCsr.Xuc)))
 66946  	func() {
 66947  		if _pSorter.XbUsePMA == 0 && ((*XPmaReader)(_pSorter.XpReader) != nil || (*XMergeEngine)(_pSorter.XpMerger) != nil) {
 66948  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88637), unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000), unsafe.Pointer(str(86027)))
 66949  			crt.X__builtin_abort(tls)
 66950  		}
 66951  	}()
 66952  	if _pSorter.XbUsePMA == 0 {
 66953  		goto _6
 66954  	}
 66955  	func() {
 66956  		if (*XPmaReader)(_pSorter.XpReader) != nil && (*XMergeEngine)(_pSorter.XpMerger) != nil {
 66957  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88639), unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000), unsafe.Pointer(str(86092)))
 66958  			crt.X__builtin_abort(tls)
 66959  		}
 66960  	}()
 66961  	func() {
 66962  		if int32(_pSorter.XbUseThreads) != int32(0) && _pSorter.XpReader == nil {
 66963  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88640), unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000), unsafe.Pointer(str(86135)))
 66964  			crt.X__builtin_abort(tls)
 66965  		}
 66966  	}()
 66967  	func() {
 66968  		if int32(_pSorter.XbUseThreads) != int32(1) && _pSorter.XpMerger == nil {
 66969  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88641), unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000), unsafe.Pointer(str(86179)))
 66970  			crt.X__builtin_abort(tls)
 66971  		}
 66972  	}()
 66973  	if _pSorter.XbUseThreads != 0 {
 66974  		_rc = _vdbePmaReaderNext(tls, (*XPmaReader)(_pSorter.XpReader))
 66975  		*_pbEof = bool2int((*Xsqlite3_file)((*XPmaReader)(_pSorter.XpReader).XpFd) == nil)
 66976  		goto _17
 66977  	}
 66978  	func() {
 66979  		if (*XMergeEngine)(_pSorter.XpMerger) == nil {
 66980  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88649), unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000), unsafe.Pointer(str(86223)))
 66981  			crt.X__builtin_abort(tls)
 66982  		}
 66983  	}()
 66984  	func() {
 66985  		if (*XSortSubtask)((*XMergeEngine)(_pSorter.XpMerger).XpTask) != elem78((*XSortSubtask)(unsafe.Pointer(&_pSorter.XaTask)), 0) {
 66986  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(88650), unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000), unsafe.Pointer(str(86243)))
 66987  			crt.X__builtin_abort(tls)
 66988  		}
 66989  	}()
 66990  	_rc = _vdbeMergeEngineStep(tls, (*XMergeEngine)(_pSorter.XpMerger), _pbEof)
 66991  _17:
 66992  	goto _22
 66993  _6:
 66994  	_4_pFree = (*XSorterRecord)(_pSorter.Xlist.XpList)
 66995  	*(**XSorterRecord)(unsafe.Pointer(&(_pSorter.Xlist.XpList))) = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer(&_4_pFree.Xu)))
 66996  	*(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_4_pFree.Xu)))) = nil
 66997  	if (_pSorter.Xlist.XaMemory) == nil {
 66998  		_vdbeSorterRecordFree(tls, _db, _4_pFree)
 66999  	}
 67000  	*_pbEof = bool2int((_pSorter.Xlist.XpList) == nil)
 67001  	_rc = int32(0)
 67002  _22:
 67003  	return _rc
 67004  }
 67005  
 67006  var _sqlite3VdbeSorterNextØ00__func__Ø000 [22]int8
 67007  
 67008  func init() {
 67009  	crt.Xstrncpy(nil, &_sqlite3VdbeSorterNextØ00__func__Ø000[0], str(86289), 22)
 67010  }
 67011  
 67012  // C comment
 67013  //  /*
 67014  //  ** Add a record to the sorter.
 67015  //  */
 67016  func _sqlite3VdbeSorterWrite(tls *crt.TLS, _pCsr *XVdbeCursor, _pVal *XMem) (r0 int32) {
 67017  	var _rc, _bFlush, _nReq, _nPMA, _t, _9_nMin, _10_iListOff, _10_nNew int32
 67018  	var _10_aNew *uint8
 67019  	var _pSorter *XVdbeSorter
 67020  	var _pNew *XSorterRecord
 67021  	_rc = int32(0)
 67022  	func() {
 67023  		if int32(_pCsr.XeCurType) != int32(1) {
 67024  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87790), unsafe.Pointer(&_sqlite3VdbeSorterWriteØ00__func__Ø000), unsafe.Pointer(str(57837)))
 67025  			crt.X__builtin_abort(tls)
 67026  		}
 67027  	}()
 67028  	_pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer(&_pCsr.Xuc)))
 67029  	func() int32 {
 67030  		if int32(*(*uint8)(unsafe.Pointer(elem1(_pVal.Xz, uintptr(1))))) < int32(128) {
 67031  			return func() int32 {
 67032  				_t = int32(uint32(*(*uint8)(unsafe.Pointer(elem1(_pVal.Xz, uintptr(1))))))
 67033  				return int32(1)
 67034  			}()
 67035  		}
 67036  		return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(elem1(_pVal.Xz, uintptr(1)))), (*uint32)(unsafe.Pointer(&_t))))
 67037  	}()
 67038  	if ((_t > int32(0)) && (_t < int32(10))) && (_t != int32(7)) {
 67039  		{
 67040  			p := &_pSorter.XtypeMask
 67041  			*p = uint8(int32(*p) & int32(1))
 67042  		}
 67043  		goto _10
 67044  	}
 67045  	if (_t > int32(10)) && (_t&int32(1)) != 0 {
 67046  		{
 67047  			p := &_pSorter.XtypeMask
 67048  			*p = uint8(int32(*p) & int32(2))
 67049  		}
 67050  		goto _10
 67051  	}
 67052  	_pSorter.XtypeMask = 0
 67053  _10:
 67054  	func() {
 67055  		if _pSorter == nil {
 67056  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87801), unsafe.Pointer(&_sqlite3VdbeSorterWriteØ00__func__Ø000), unsafe.Pointer(str(84205)))
 67057  			crt.X__builtin_abort(tls)
 67058  		}
 67059  	}()
 67060  	_nReq = int32(uint32(_pVal.Xn) + uint32(8))
 67061  	_nPMA = _pVal.Xn + _sqlite3VarintLen(tls, uint64(_pVal.Xn))
 67062  	if _pSorter.XmxPmaSize == 0 {
 67063  		goto _13
 67064  	}
 67065  	if (_pSorter.Xlist.XaMemory) != nil {
 67066  		_bFlush = bool2int(_pSorter.XiMemory != 0 && ((_pSorter.XiMemory + _nReq) > _pSorter.XmxPmaSize))
 67067  		goto _16
 67068  	}
 67069  	_bFlush = bool2int(((_pSorter.Xlist.XszPMA) > _pSorter.XmxPmaSize) || (((_pSorter.Xlist.XszPMA) > _pSorter.XmnPmaSize) && _sqlite3HeapNearlyFull(tls) != 0))
 67070  _16:
 67071  	if _bFlush != 0 {
 67072  		_rc = _vdbeSorterFlushPMA(tls, _pSorter)
 67073  		_pSorter.Xlist.XszPMA = int32(0)
 67074  		_pSorter.XiMemory = int32(0)
 67075  		func() {
 67076  			if _rc == int32(0) && (*XSorterRecord)(_pSorter.Xlist.XpList) != nil {
 67077  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(87834), unsafe.Pointer(&_sqlite3VdbeSorterWriteØ00__func__Ø000), unsafe.Pointer(str(86311)))
 67078  				crt.X__builtin_abort(tls)
 67079  			}
 67080  		}()
 67081  	}
 67082  _13:
 67083  	_pSorter.Xlist.XszPMA += _nPMA
 67084  	if _nPMA > _pSorter.XmxKeysize {
 67085  		_pSorter.XmxKeysize = _nPMA
 67086  	}
 67087  	if (_pSorter.Xlist.XaMemory) == nil {
 67088  		goto _24
 67089  	}
 67090  	_9_nMin = _pSorter.XiMemory + _nReq
 67091  	if _9_nMin <= _pSorter.XnMemory {
 67092  		goto _25
 67093  	}
 67094  	_10_iListOff = int32(uintptr(_pSorter.Xlist.XpList) - uintptr(unsafe.Pointer(_pSorter.Xlist.XaMemory)))
 67095  	_10_nNew = _pSorter.XnMemory * int32(2)
 67096  _26:
 67097  	if _10_nNew < _9_nMin {
 67098  		_10_nNew = _10_nNew * int32(2)
 67099  		goto _26
 67100  	}
 67101  	if _10_nNew > _pSorter.XmxPmaSize {
 67102  		_10_nNew = _pSorter.XmxPmaSize
 67103  	}
 67104  	if _10_nNew < _9_nMin {
 67105  		_10_nNew = _9_nMin
 67106  	}
 67107  	_10_aNew = (*uint8)(_sqlite3Realloc(tls, unsafe.Pointer(_pSorter.Xlist.XaMemory), uint64(_10_nNew)))
 67108  	if _10_aNew == nil {
 67109  		return _sqlite3NomemError(tls, int32(87855))
 67110  	}
 67111  	*(**XSorterRecord)(unsafe.Pointer(&(_pSorter.Xlist.XpList))) = (*XSorterRecord)(unsafe.Pointer(elem15(_10_aNew, uintptr(_10_iListOff))))
 67112  	_pSorter.Xlist.XaMemory = _10_aNew
 67113  	_pSorter.XnMemory = _10_nNew
 67114  _25:
 67115  	_pNew = (*XSorterRecord)(unsafe.Pointer(elem15(_pSorter.Xlist.XaMemory, uintptr(_pSorter.XiMemory))))
 67116  	_pSorter.XiMemory += (_nReq + int32(7)) & int32(-8)
 67117  	if (_pSorter.Xlist.XpList) != nil {
 67118  		*(*int32)(unsafe.Pointer(&_pNew.Xu)) = int32(uintptr(_pSorter.Xlist.XpList) - uintptr(unsafe.Pointer(_pSorter.Xlist.XaMemory)))
 67119  	}
 67120  	goto _32
 67121  _24:
 67122  	_pNew = (*XSorterRecord)(_sqlite3Malloc(tls, uint64(_nReq)))
 67123  	if _pNew == nil {
 67124  		return _sqlite3NomemError(tls, int32(87869))
 67125  	}
 67126  	*(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.Xu)))) = (*XSorterRecord)(_pSorter.Xlist.XpList)
 67127  _32:
 67128  	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(8)))))))))))), unsafe.Pointer(_pVal.Xz), uint32(_pVal.Xn))
 67129  	_pNew.XnVal = _pVal.Xn
 67130  	*(**XSorterRecord)(unsafe.Pointer(&(_pSorter.Xlist.XpList))) = _pNew
 67131  	return _rc
 67132  }
 67133  
 67134  var _sqlite3VdbeSorterWriteØ00__func__Ø000 [23]int8
 67135  
 67136  func init() {
 67137  	crt.Xstrncpy(nil, &_sqlite3VdbeSorterWriteØ00__func__Ø000[0], str(86351), 23)
 67138  }
 67139  
 67140  // C comment
 67141  //  /*
 67142  //  ** pCur points at an index entry created using the OP_MakeRecord opcode.
 67143  //  ** Read the rowid (the last field in the record) and store it in *rowid.
 67144  //  ** Return SQLITE_OK if everything works, or an error code otherwise.
 67145  //  **
 67146  //  ** pCur might be pointing to text obtained from a corrupt database file.
 67147  //  ** So the content cannot be trusted.  Do appropriate checks on the content.
 67148  //  */
 67149  func _sqlite3VdbeIdxRowid(tls *crt.TLS, _db *Xsqlite3, _pCur *XBtCursor, _rowid *int64) (r0 int32) {
 67150  	var _rc int32
 67151  	var _nCellKey int64
 67152  	var _szHdr, _typeRowid, _lenRowid uint32
 67153  	var _m, _v XMem
 67154  	_nCellKey = int64(0)
 67155  	func() {
 67156  		if _sqlite3BtreeCursorIsValid(tls, _pCur) == 0 {
 67157  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75814), unsafe.Pointer(&_sqlite3VdbeIdxRowidØ00__func__Ø000), unsafe.Pointer(str(75569)))
 67158  			crt.X__builtin_abort(tls)
 67159  		}
 67160  	}()
 67161  	_nCellKey = int64(_sqlite3BtreePayloadSize(tls, _pCur))
 67162  	func() {
 67163  		if (uint64(_nCellKey) & uint64(4294967295)) != uint64(_nCellKey) {
 67164  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75816), unsafe.Pointer(&_sqlite3VdbeIdxRowidØ00__func__Ø000), unsafe.Pointer(str(86374)))
 67165  			crt.X__builtin_abort(tls)
 67166  		}
 67167  	}()
 67168  	_sqlite3VdbeMemInit(tls, &_m, _db, 0)
 67169  	_rc = _sqlite3VdbeMemFromBtree(tls, _pCur, 0, uint32(_nCellKey), &_m)
 67170  	if _rc != 0 {
 67171  		return _rc
 67172  	}
 67173  	func() int32 {
 67174  		if int32(*(*uint8)(unsafe.Pointer(_m.Xz))) < int32(128) {
 67175  			return func() int32 { _szHdr = uint32(*(*uint8)(unsafe.Pointer(_m.Xz))); return int32(1) }()
 67176  		}
 67177  		return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(_m.Xz)), &_szHdr))
 67178  	}()
 67179  	if (_szHdr < uint32(3)) || (int32(_szHdr) > _m.Xn) {
 67180  		goto _idx_rowid_corruption
 67181  	}
 67182  	func() int32 {
 67183  		if int32(*(*uint8)(unsafe.Pointer(elem1(_m.Xz, uintptr(_szHdr-uint32(1)))))) < int32(128) {
 67184  			return func() int32 {
 67185  				_typeRowid = uint32(*(*uint8)(unsafe.Pointer(elem1(_m.Xz, uintptr(_szHdr-uint32(1))))))
 67186  				return int32(1)
 67187  			}()
 67188  		}
 67189  		return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(elem1(_m.Xz, uintptr(_szHdr-uint32(1))))), &_typeRowid))
 67190  	}()
 67191  	if ((_typeRowid < uint32(1)) || (_typeRowid > uint32(9))) || (_typeRowid == uint32(7)) {
 67192  		goto _idx_rowid_corruption
 67193  	}
 67194  	_lenRowid = uint32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3SmallTypeSizes)), uintptr(_typeRowid)))
 67195  	if uint32(_m.Xn) < (_szHdr + _lenRowid) {
 67196  		goto _idx_rowid_corruption
 67197  	}
 67198  	_sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer(elem1(_m.Xz, uintptr(uint32(_m.Xn)-_lenRowid)))), _typeRowid, &_v)
 67199  	*_rowid = *(*int64)(unsafe.Pointer(&_v.Xu))
 67200  	_sqlite3VdbeMemRelease(tls, &_m)
 67201  	return int32(0)
 67202  
 67203  _idx_rowid_corruption:
 67204  	_sqlite3VdbeMemRelease(tls, &_m)
 67205  	return _sqlite3CorruptError(tls, int32(75864))
 67206  }
 67207  
 67208  var _sqlite3VdbeIdxRowidØ00__func__Ø000 [20]int8
 67209  
 67210  func init() {
 67211  	crt.Xstrncpy(nil, &_sqlite3VdbeIdxRowidØ00__func__Ø000[0], str(86417), 20)
 67212  }
 67213  
 67214  // C comment
 67215  //  /*
 67216  //  ** Compare the key of the index entry that cursor pC is pointing to against
 67217  //  ** the key string in pUnpacked.  Write into *pRes a number
 67218  //  ** that is negative, zero, or positive if pC is less than, equal to,
 67219  //  ** or greater than pUnpacked.  Return SQLITE_OK on success.
 67220  //  **
 67221  //  ** pUnpacked is either created without a rowid or is truncated so that it
 67222  //  ** omits the rowid at the end.  The rowid at the end of the index entry
 67223  //  ** is ignored as well.  Hence, this routine only compares the prefixes
 67224  //  ** of the keys prior to the final rowid, not the entire key.
 67225  //  */
 67226  func _sqlite3VdbeIdxKeyCompare(tls *crt.TLS, _db *Xsqlite3, _pC *XVdbeCursor, _pUnpacked *XUnpackedRecord, _res *int32) (r0 int32) {
 67227  	var _rc int32
 67228  	var _nCellKey int64
 67229  	var _m XMem
 67230  	var _pCur *XBtCursor
 67231  	_nCellKey = int64(0)
 67232  	func() {
 67233  		if int32(_pC.XeCurType) != int32(0) {
 67234  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75889), unsafe.Pointer(&_sqlite3VdbeIdxKeyCompareØ00__func__Ø000), unsafe.Pointer(str(63921)))
 67235  			crt.X__builtin_abort(tls)
 67236  		}
 67237  	}()
 67238  	_pCur = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_pC.Xuc)))
 67239  	func() {
 67240  		if _sqlite3BtreeCursorIsValid(tls, _pCur) == 0 {
 67241  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75891), unsafe.Pointer(&_sqlite3VdbeIdxKeyCompareØ00__func__Ø000), unsafe.Pointer(str(75569)))
 67242  			crt.X__builtin_abort(tls)
 67243  		}
 67244  	}()
 67245  	_nCellKey = int64(_sqlite3BtreePayloadSize(tls, _pCur))
 67246  	if (_nCellKey <= (0)) || (_nCellKey > int64(2147483647)) {
 67247  		*_res = int32(0)
 67248  		return _sqlite3CorruptError(tls, int32(75897))
 67249  	}
 67250  	_sqlite3VdbeMemInit(tls, &_m, _db, 0)
 67251  	_rc = _sqlite3VdbeMemFromBtree(tls, _pCur, 0, uint32(_nCellKey), &_m)
 67252  	if _rc != 0 {
 67253  		return _rc
 67254  	}
 67255  	*_res = _sqlite3VdbeRecordCompare(tls, _m.Xn, unsafe.Pointer(_m.Xz), _pUnpacked)
 67256  	_sqlite3VdbeMemRelease(tls, &_m)
 67257  	return int32(0)
 67258  }
 67259  
 67260  var _sqlite3VdbeIdxKeyCompareØ00__func__Ø000 [25]int8
 67261  
 67262  func init() {
 67263  	crt.Xstrncpy(nil, &_sqlite3VdbeIdxKeyCompareØ00__func__Ø000[0], str(86437), 25)
 67264  }
 67265  
 67266  func _sqlite3BtreeDropTable(tls *crt.TLS, _p *XBtree, _iTable int32, _piMoved *int32) (r0 int32) {
 67267  	var _rc int32
 67268  	_sqlite3BtreeEnter(tls, _p)
 67269  	_rc = _btreeDropTable(tls, _p, uint32(_iTable), _piMoved)
 67270  	_sqlite3BtreeLeave(tls, _p)
 67271  	return _rc
 67272  }
 67273  
 67274  // C comment
 67275  //  /*
 67276  //  ** Erase all information in a table and add the root of the table to
 67277  //  ** the freelist.  Except, the root of the principle table (the one on
 67278  //  ** page 1) is never added to the freelist.
 67279  //  **
 67280  //  ** This routine will fail with SQLITE_LOCKED if there are any open
 67281  //  ** cursors on the table.
 67282  //  **
 67283  //  ** If AUTOVACUUM is enabled and the page at iTable is not the last
 67284  //  ** root page in the database file, then the last root page
 67285  //  ** in the database file is moved into the slot formerly occupied by
 67286  //  ** iTable and that last slot formerly occupied by the last root page
 67287  //  ** is added to the freelist instead of iTable.  In this say, all
 67288  //  ** root pages are kept at the beginning of the database file, which
 67289  //  ** is necessary for AUTOVACUUM to work right.  *piMoved is set to the
 67290  //  ** page number that used to be the last root page in the file before
 67291  //  ** the move.  If no page gets moved, *piMoved is set to 0.
 67292  //  ** The last root page is recorded in meta[3] and the value of
 67293  //  ** meta[3] is updated by this procedure.
 67294  //  */
 67295  func _btreeDropTable(tls *crt.TLS, _p *XBtree, _iTable uint32, _piMoved *int32) (r0 int32) {
 67296  	var _rc int32
 67297  	var _2_maxRootPgno uint32
 67298  	var _pBt *XBtShared
 67299  	var _pPage, _5_pMove *XMemPage
 67300  	_pPage = nil
 67301  	_pBt = (*XBtShared)(_p.XpBt)
 67302  	func() {
 67303  		if _sqlite3BtreeHoldsMutex(tls, _p) == 0 {
 67304  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67751), unsafe.Pointer(&_btreeDropTableØ00__func__Ø000), unsafe.Pointer(str(17442)))
 67305  			crt.X__builtin_abort(tls)
 67306  		}
 67307  	}()
 67308  	func() {
 67309  		if int32(_p.XinTrans) != int32(2) {
 67310  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67752), unsafe.Pointer(&_btreeDropTableØ00__func__Ø000), unsafe.Pointer(str(75991)))
 67311  			crt.X__builtin_abort(tls)
 67312  		}
 67313  	}()
 67314  	func() {
 67315  		if _iTable < uint32(2) {
 67316  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67753), unsafe.Pointer(&_btreeDropTableØ00__func__Ø000), unsafe.Pointer(str(86462)))
 67317  			crt.X__builtin_abort(tls)
 67318  		}
 67319  	}()
 67320  	_rc = _btreeGetPage(tls, _pBt, _iTable, &_pPage, int32(0))
 67321  	if _rc != 0 {
 67322  		return _rc
 67323  	}
 67324  	_rc = _sqlite3BtreeClearTable(tls, _p, int32(_iTable), nil)
 67325  	if _rc != 0 {
 67326  		_releasePage(tls, _pPage)
 67327  		return _rc
 67328  	}
 67329  	*_piMoved = int32(0)
 67330  	if _pBt.XautoVacuum == 0 {
 67331  		goto _8
 67332  	}
 67333  	_sqlite3BtreeGetMeta(tls, _p, int32(4), &_2_maxRootPgno)
 67334  	if _iTable != _2_maxRootPgno {
 67335  		goto _9
 67336  	}
 67337  	_freePage(tls, _pPage, &_rc)
 67338  	_releasePage(tls, _pPage)
 67339  	if _rc != int32(0) {
 67340  		return _rc
 67341  	}
 67342  	goto _11
 67343  _9:
 67344  	_releasePage(tls, _pPage)
 67345  	_rc = _btreeGetPage(tls, _pBt, _2_maxRootPgno, &_5_pMove, int32(0))
 67346  	if _rc != int32(0) {
 67347  		return _rc
 67348  	}
 67349  	_rc = _relocatePage(tls, _pBt, _5_pMove, uint8(1), 0, _iTable, int32(0))
 67350  	_releasePage(tls, _5_pMove)
 67351  	if _rc != int32(0) {
 67352  		return _rc
 67353  	}
 67354  	_5_pMove = nil
 67355  	_rc = _btreeGetPage(tls, _pBt, _2_maxRootPgno, &_5_pMove, int32(0))
 67356  	_freePage(tls, _5_pMove, &_rc)
 67357  	_releasePage(tls, _5_pMove)
 67358  	if _rc != int32(0) {
 67359  		return _rc
 67360  	}
 67361  	*_piMoved = int32(_2_maxRootPgno)
 67362  _11:
 67363  	_2_maxRootPgno -= 1
 67364  _15:
 67365  	if (_2_maxRootPgno == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1))) || (_ptrmapPageno(tls, _pBt, _2_maxRootPgno) == _2_maxRootPgno) {
 67366  		_2_maxRootPgno -= 1
 67367  		goto _15
 67368  	}
 67369  	func() {
 67370  		if _2_maxRootPgno == ((uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1)) {
 67371  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67818), unsafe.Pointer(&_btreeDropTableØ00__func__Ø000), unsafe.Pointer(str(86472)))
 67372  			crt.X__builtin_abort(tls)
 67373  		}
 67374  	}()
 67375  	_rc = _sqlite3BtreeUpdateMeta(tls, _p, int32(4), _2_maxRootPgno)
 67376  	goto _20
 67377  _8:
 67378  	_freePage(tls, _pPage, &_rc)
 67379  	_releasePage(tls, _pPage)
 67380  _20:
 67381  	return _rc
 67382  }
 67383  
 67384  var _btreeDropTableØ00__func__Ø000 [15]int8
 67385  
 67386  func init() {
 67387  	crt.Xstrncpy(nil, &_btreeDropTableØ00__func__Ø000[0], str(86508), 15)
 67388  }
 67389  
 67390  // C comment
 67391  //  /*
 67392  //  ** Delete all information from a single table in the database.  iTable is
 67393  //  ** the page number of the root of the table.  After this routine returns,
 67394  //  ** the root page is empty, but still exists.
 67395  //  **
 67396  //  ** This routine will fail with SQLITE_LOCKED if there are any open
 67397  //  ** read cursors on the table.  Open write cursors are moved to the
 67398  //  ** root of the table.
 67399  //  **
 67400  //  ** If pnChange is not NULL, then table iTable must be an intkey table. The
 67401  //  ** integer value pointed to by pnChange is incremented by the number of
 67402  //  ** entries in the table.
 67403  //  */
 67404  func _sqlite3BtreeClearTable(tls *crt.TLS, _p *XBtree, _iTable int32, _pnChange *int32) (r0 int32) {
 67405  	var _rc int32
 67406  	var _pBt *XBtShared
 67407  	_pBt = (*XBtShared)(_p.XpBt)
 67408  	_sqlite3BtreeEnter(tls, _p)
 67409  	func() {
 67410  		if int32(_p.XinTrans) != int32(2) {
 67411  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67702), unsafe.Pointer(&_sqlite3BtreeClearTableØ00__func__Ø000), unsafe.Pointer(str(75991)))
 67412  			crt.X__builtin_abort(tls)
 67413  		}
 67414  	}()
 67415  	_rc = _saveAllCursors(tls, _pBt, uint32(_iTable), nil)
 67416  	if int32(0) == _rc {
 67417  		_invalidateIncrblobCursors(tls, _p, uint32(_iTable), 0, int32(1))
 67418  		_rc = _clearDatabasePage(tls, _pBt, uint32(_iTable), int32(0), _pnChange)
 67419  	}
 67420  	_sqlite3BtreeLeave(tls, _p)
 67421  	return _rc
 67422  }
 67423  
 67424  var _sqlite3BtreeClearTableØ00__func__Ø000 [23]int8
 67425  
 67426  func init() {
 67427  	crt.Xstrncpy(nil, &_sqlite3BtreeClearTableØ00__func__Ø000[0], str(86523), 23)
 67428  }
 67429  
 67430  // C comment
 67431  //  /*
 67432  //  ** Erase the given database page and all its children.  Return
 67433  //  ** the page to the freelist.
 67434  //  */
 67435  func _clearDatabasePage(tls *crt.TLS, _pBt *XBtShared, _pgno uint32, _freePageFlag int32, _pnChange *int32) (r0 int32) {
 67436  	var _rc, _i, _hdr int32
 67437  	var _pCell *uint8
 67438  	var _info XCellInfo
 67439  	var _pPage *XMemPage
 67440  	func() {
 67441  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.Xmutex)) == 0 {
 67442  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67644), unsafe.Pointer(&_clearDatabasePageØ00__func__Ø000), unsafe.Pointer(str(9235)))
 67443  			crt.X__builtin_abort(tls)
 67444  		}
 67445  	}()
 67446  	if _pgno > _btreePagecount(tls, _pBt) {
 67447  		return _sqlite3CorruptError(tls, int32(67646))
 67448  	}
 67449  	_rc = _getAndInitPage(tls, _pBt, _pgno, &_pPage, nil, int32(0))
 67450  	if _rc != 0 {
 67451  		return _rc
 67452  	}
 67453  	if _pPage.XbBusy != 0 {
 67454  		_rc = _sqlite3CorruptError(tls, int32(67651))
 67455  		goto _cleardatabasepage_out
 67456  	}
 67457  	_pPage.XbBusy = uint8(1)
 67458  	_hdr = int32(_pPage.XhdrOffset)
 67459  	_i = int32(0)
 67460  _5:
 67461  	if _i >= int32(_pPage.XnCell) {
 67462  		goto _8
 67463  	}
 67464  	_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)))))))
 67465  	if _pPage.Xleaf != 0 {
 67466  		goto _9
 67467  	}
 67468  	_rc = _clearDatabasePage(tls, _pBt, _sqlite3Get4byte(tls, _pCell), int32(1), _pnChange)
 67469  	if _rc != 0 {
 67470  		goto _cleardatabasepage_out
 67471  	}
 67472  _9:
 67473  	_rc = _clearCell(tls, _pPage, _pCell, &_info)
 67474  	if _rc != 0 {
 67475  		goto _cleardatabasepage_out
 67476  	}
 67477  	_i += 1
 67478  	goto _5
 67479  _8:
 67480  	if _pPage.Xleaf != 0 {
 67481  		goto _12
 67482  	}
 67483  	_rc = _clearDatabasePage(tls, _pBt, _sqlite3Get4byte(tls, elem15(_pPage.XaData, uintptr(_hdr+int32(8)))), int32(1), _pnChange)
 67484  	if _rc != 0 {
 67485  		goto _cleardatabasepage_out
 67486  	}
 67487  	goto _15
 67488  _12:
 67489  	if _pnChange != nil {
 67490  		func() {
 67491  			if _pPage.XintKey == 0 && _sqlite3Config.XneverCorrupt != int32(0) {
 67492  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(67669), unsafe.Pointer(&_clearDatabasePageØ00__func__Ø000), unsafe.Pointer(str(86546)))
 67493  				crt.X__builtin_abort(tls)
 67494  			}
 67495  		}()
 67496  		*_pnChange += int32(_pPage.XnCell)
 67497  	}
 67498  _15:
 67499  	if _freePageFlag != 0 {
 67500  		_freePage(tls, _pPage, &_rc)
 67501  		goto _cleardatabasepage_out
 67502  	}
 67503  	if store2(&_rc, _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage.XpDbPage))) == int32(0) {
 67504  		_zeroPage(tls, _pPage, int32(*elem15(_pPage.XaData, uintptr(_hdr)))|int32(8))
 67505  	}
 67506  _cleardatabasepage_out:
 67507  	_pPage.XbBusy = 0
 67508  	_releasePage(tls, _pPage)
 67509  	return _rc
 67510  }
 67511  
 67512  var _clearDatabasePageØ00__func__Ø000 [18]int8
 67513  
 67514  func init() {
 67515  	crt.Xstrncpy(nil, &_clearDatabasePageØ00__func__Ø000[0], str(86574), 18)
 67516  }
 67517  
 67518  func _sqlite3RootPageMoved(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _iFrom int32, _iTo int32) {
 67519  	var _pDb *XDb
 67520  	var _pElem *XHashElem
 67521  	var _pHash *XHash
 67522  	var _1_pTab *XTable
 67523  	var _3_pIdx *XIndex
 67524  	func() {
 67525  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 67526  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101998), unsafe.Pointer(&_sqlite3RootPageMovedØ00__func__Ø000), unsafe.Pointer(str(51126)))
 67527  			crt.X__builtin_abort(tls)
 67528  		}
 67529  	}()
 67530  	_pDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb))
 67531  	_pHash = &((*XSchema)(_pDb.XpSchema).XtblHash)
 67532  	_pElem = (*XHashElem)(_pHash.Xfirst)
 67533  _2:
 67534  	if _pElem == nil {
 67535  		goto _5
 67536  	}
 67537  	_1_pTab = (*XTable)(_pElem.Xdata)
 67538  	if _1_pTab.Xtnum == _iFrom {
 67539  		_1_pTab.Xtnum = _iTo
 67540  	}
 67541  	_pElem = (*XHashElem)(_pElem.Xnext)
 67542  	goto _2
 67543  _5:
 67544  	_pHash = &((*XSchema)(_pDb.XpSchema).XidxHash)
 67545  	_pElem = (*XHashElem)(_pHash.Xfirst)
 67546  _7:
 67547  	if _pElem == nil {
 67548  		goto _10
 67549  	}
 67550  	_3_pIdx = (*XIndex)(_pElem.Xdata)
 67551  	if _3_pIdx.Xtnum == _iFrom {
 67552  		_3_pIdx.Xtnum = _iTo
 67553  	}
 67554  	_pElem = (*XHashElem)(_pElem.Xnext)
 67555  	goto _7
 67556  _10:
 67557  }
 67558  
 67559  var _sqlite3RootPageMovedØ00__func__Ø000 [21]int8
 67560  
 67561  func init() {
 67562  	crt.Xstrncpy(nil, &_sqlite3RootPageMovedØ00__func__Ø000[0], str(86592), 21)
 67563  }
 67564  
 67565  // C comment
 67566  //  /*
 67567  //  ** Delete all information from the single table that pCur is open on.
 67568  //  **
 67569  //  ** This routine only work for pCur on an ephemeral table.
 67570  //  */
 67571  func _sqlite3BtreeClearTableOfCursor(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
 67572  	return _sqlite3BtreeClearTable(tls, (*XBtree)(_pCur.XpBtree), int32(_pCur.XpgnoRoot), nil)
 67573  }
 67574  
 67575  // C comment
 67576  //  /*
 67577  //  ** Load the content of the sqlite_stat1 and sqlite_stat3/4 tables. The
 67578  //  ** contents of sqlite_stat1 are used to populate the Index.aiRowEst[]
 67579  //  ** arrays. The contents of sqlite_stat3/4 are used to populate the
 67580  //  ** Index.aSample[] arrays.
 67581  //  **
 67582  //  ** If the sqlite_stat1 table is not present in the database, SQLITE_ERROR
 67583  //  ** is returned. In this case, even if SQLITE_ENABLE_STAT3/4 was defined
 67584  //  ** during compilation and the sqlite_stat3/4 table is present, no data is
 67585  //  ** read from it.
 67586  //  **
 67587  //  ** If SQLITE_ENABLE_STAT3/4 was defined during compilation and the
 67588  //  ** sqlite_stat4 table is not present in the database, SQLITE_ERROR is
 67589  //  ** returned. However, in this case, data is read from the sqlite_stat1
 67590  //  ** table (if it is present) before returning.
 67591  //  **
 67592  //  ** If an OOM error occurs, this function always sets db->mallocFailed.
 67593  //  ** This means if the caller does not care about other errors, the return
 67594  //  ** code may be ignored.
 67595  //  */
 67596  func _sqlite3AnalysisLoad(tls *crt.TLS, _db *Xsqlite3, _iDb int32) (r0 int32) {
 67597  	var _rc int32
 67598  	var _zSql *int8
 67599  	var _pSchema *XSchema
 67600  	var _i *XHashElem
 67601  	var _1_pTab *XTable
 67602  	var _2_pIdx, _6_pIdx *XIndex
 67603  	var _sInfo XanalysisInfo
 67604  	_rc = int32(0)
 67605  	_pSchema = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema)
 67606  	func() {
 67607  		if _iDb < int32(0) || _iDb >= _db.XnDb {
 67608  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98771), unsafe.Pointer(&_sqlite3AnalysisLoadØ00__func__Ø000), unsafe.Pointer(str(21693)))
 67609  			crt.X__builtin_abort(tls)
 67610  		}
 67611  	}()
 67612  	func() {
 67613  		if (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpBt) == nil {
 67614  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98772), unsafe.Pointer(&_sqlite3AnalysisLoadØ00__func__Ø000), unsafe.Pointer(str(65334)))
 67615  			crt.X__builtin_abort(tls)
 67616  		}
 67617  	}()
 67618  	func() {
 67619  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 67620  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98775), unsafe.Pointer(&_sqlite3AnalysisLoadØ00__func__Ø000), unsafe.Pointer(str(51126)))
 67621  			crt.X__builtin_abort(tls)
 67622  		}
 67623  	}()
 67624  	_i = (*XHashElem)(_pSchema.XtblHash.Xfirst)
 67625  _7:
 67626  	if _i == nil {
 67627  		goto _10
 67628  	}
 67629  	_1_pTab = (*XTable)(_i.Xdata)
 67630  	_1_pTab.XtabFlags &= uint32(4294967279)
 67631  	_i = (*XHashElem)(_i.Xnext)
 67632  	goto _7
 67633  _10:
 67634  	_i = (*XHashElem)(_pSchema.XidxHash.Xfirst)
 67635  _11:
 67636  	if _i == nil {
 67637  		goto _14
 67638  	}
 67639  	_2_pIdx = (*XIndex)(_i.Xdata)
 67640  	storebits5(&_2_pIdx.XidxType, 0, 128, 7)
 67641  	_i = (*XHashElem)(_i.Xnext)
 67642  	goto _11
 67643  _14:
 67644  	*(**Xsqlite3)(unsafe.Pointer(&_sInfo.Xdb)) = _db
 67645  	_sInfo.XzDatabase = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
 67646  	if _sqlite3FindTable(tls, _db, str(86613), _sInfo.XzDatabase) == nil {
 67647  		goto _15
 67648  	}
 67649  	_zSql = _sqlite3MPrintf(tls, _db, str(86626), unsafe.Pointer(_sInfo.XzDatabase))
 67650  	if _zSql == nil {
 67651  		_rc = _sqlite3NomemError(tls, int32(98796))
 67652  		goto _17
 67653  	}
 67654  	_rc = Xsqlite3_exec(tls, _db, _zSql, _analysisLoader, unsafe.Pointer(&_sInfo), nil)
 67655  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zSql))
 67656  _17:
 67657  _15:
 67658  	func() {
 67659  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 67660  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98804), unsafe.Pointer(&_sqlite3AnalysisLoadØ00__func__Ø000), unsafe.Pointer(str(51126)))
 67661  			crt.X__builtin_abort(tls)
 67662  		}
 67663  	}()
 67664  	_i = (*XHashElem)(_pSchema.XidxHash.Xfirst)
 67665  _20:
 67666  	if _i == nil {
 67667  		goto _23
 67668  	}
 67669  	_6_pIdx = (*XIndex)(_i.Xdata)
 67670  	if ((uint32(_6_pIdx.XidxType>>7) << 31) >> 31) == 0 {
 67671  		_sqlite3DefaultRowEst(tls, _6_pIdx)
 67672  	}
 67673  	_i = (*XHashElem)(_i.Xnext)
 67674  	goto _20
 67675  _23:
 67676  	if _rc == int32(7) {
 67677  		_sqlite3OomFault(tls, _db)
 67678  	}
 67679  	return _rc
 67680  }
 67681  
 67682  var _sqlite3AnalysisLoadØ00__func__Ø000 [20]int8
 67683  
 67684  func init() {
 67685  	crt.Xstrncpy(nil, &_sqlite3AnalysisLoadØ00__func__Ø000[0], str(86667), 20)
 67686  }
 67687  
 67688  // C comment
 67689  //  /*
 67690  //  ** Locate the in-memory structure that describes a particular database
 67691  //  ** table given the name of that table and (optionally) the name of the
 67692  //  ** database containing the table.  Return NULL if not found.
 67693  //  **
 67694  //  ** If zDatabase is 0, all databases are searched for the table and the
 67695  //  ** first matching table is returned.  (No checking for duplicate table
 67696  //  ** names is done.)  The search order is TEMP first, then MAIN, then any
 67697  //  ** auxiliary databases added using the ATTACH command.
 67698  //  **
 67699  //  ** See also sqlite3LocateTable().
 67700  //  */
 67701  func _sqlite3FindTable(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _zDatabase *int8) (r0 *XTable) {
 67702  	var _i, _2_j int32
 67703  	var _p *XTable
 67704  	_p = nil
 67705  	func() {
 67706  		if _zDatabase == nil && _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
 67707  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99999), unsafe.Pointer(&_sqlite3FindTableØ00__func__Ø000), unsafe.Pointer(str(86687)))
 67708  			crt.X__builtin_abort(tls)
 67709  		}
 67710  	}()
 67711  _3:
 67712  	_i = int32(0)
 67713  _5:
 67714  	if _i >= _db.XnDb {
 67715  		goto _8
 67716  	}
 67717  	_2_j = func() int32 {
 67718  		if _i < int32(2) {
 67719  			return (_i ^ int32(1))
 67720  		}
 67721  		return _i
 67722  	}()
 67723  	if _zDatabase != nil && _sqlite3StrICmp(tls, _zDatabase, elem27((*XDb)(_db.XaDb), uintptr(_2_j)).XzDbSName) != int32(0) {
 67724  		goto _12
 67725  	}
 67726  	func() {
 67727  		if _sqlite3SchemaMutexHeld(tls, _db, _2_j, nil) == 0 {
 67728  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100011), unsafe.Pointer(&_sqlite3FindTableØ00__func__Ø000), unsafe.Pointer(str(59943)))
 67729  			crt.X__builtin_abort(tls)
 67730  		}
 67731  	}()
 67732  	_p = (*XTable)(_sqlite3HashFind(tls, &((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_2_j)).XpSchema).XtblHash), _zName))
 67733  	if _p != nil {
 67734  		return _p
 67735  	}
 67736  _12:
 67737  	_i += 1
 67738  	goto _5
 67739  _8:
 67740  	if _sqlite3StrICmp(tls, _zName, str(49981)) != int32(0) {
 67741  		goto _4
 67742  	}
 67743  	if Xsqlite3_stricmp(tls, _zDatabase, elem27((*XDb)(_db.XaDb), uintptr(1)).XzDbSName) != int32(0) {
 67744  		goto _4
 67745  	}
 67746  	_zName = str(49962)
 67747  	goto _3
 67748  _4:
 67749  	return nil
 67750  }
 67751  
 67752  var _sqlite3FindTableØ00__func__Ø000 [17]int8
 67753  
 67754  func init() {
 67755  	crt.Xstrncpy(nil, &_sqlite3FindTableØ00__func__Ø000[0], str(86735), 17)
 67756  }
 67757  
 67758  // C comment
 67759  //  /*
 67760  //  ** This callback is invoked once for each index when reading the
 67761  //  ** sqlite_stat1 table.
 67762  //  **
 67763  //  **     argv[0] = name of the table
 67764  //  **     argv[1] = name of the index (might be NULL)
 67765  //  **     argv[2] = results of analysis - on integer for each column
 67766  //  **
 67767  //  ** Entries for which argv[1]==NULL simply record the number of rows in
 67768  //  ** the table.
 67769  //  */
 67770  func _analysisLoader(tls *crt.TLS, _pData unsafe.Pointer, _argc int32, _argv **int8, _NotUsed **int8) (r0 int32) {
 67771  	var _6_nCol int32
 67772  	var _z *int8
 67773  	var _6_aiRowEst *uint32
 67774  	var _pTable *XTable
 67775  	var _pIndex *XIndex
 67776  	var _8_fakeIdx XIndex
 67777  	var _pInfo *XanalysisInfo
 67778  	_pInfo = (*XanalysisInfo)(_pData)
 67779  	func() {
 67780  		if _argc != int32(3) {
 67781  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98427), unsafe.Pointer(&_analysisLoaderØ00__func__Ø000), unsafe.Pointer(str(50249)))
 67782  			crt.X__builtin_abort(tls)
 67783  		}
 67784  	}()
 67785  	_ = _argc
 67786  
 67787  	if ((_argv == nil) || ((*elem0(_argv, 0)) == nil)) || ((*elem0(_argv, uintptr(2))) == nil) {
 67788  		return int32(0)
 67789  	}
 67790  	_pTable = _sqlite3FindTable(tls, (*Xsqlite3)(_pInfo.Xdb), *elem0(_argv, 0), _pInfo.XzDatabase)
 67791  	if _pTable == nil {
 67792  		return int32(0)
 67793  	}
 67794  	if (*elem0(_argv, uintptr(1))) == nil {
 67795  		_pIndex = nil
 67796  		goto _9
 67797  	}
 67798  	if Xsqlite3_stricmp(tls, *elem0(_argv, 0), *elem0(_argv, uintptr(1))) == int32(0) {
 67799  		_pIndex = _sqlite3PrimaryKeyIndex(tls, _pTable)
 67800  		goto _9
 67801  	}
 67802  	_pIndex = _sqlite3FindIndex(tls, (*Xsqlite3)(_pInfo.Xdb), *elem0(_argv, uintptr(1)), _pInfo.XzDatabase)
 67803  _9:
 67804  	_z = *elem0(_argv, uintptr(2))
 67805  	if _pIndex == nil {
 67806  		goto _10
 67807  	}
 67808  	_6_aiRowEst = nil
 67809  	_6_nCol = int32(_pIndex.XnKeyCol) + int32(1)
 67810  	storebits5(&_pIndex.XidxType, 0, 4, 2)
 67811  	_decodeIntArray(tls, _z, _6_nCol, _6_aiRowEst, _pIndex.XaiRowLogEst, _pIndex)
 67812  	storebits5(&_pIndex.XidxType, int8(1), 128, 7)
 67813  	if (*XExpr)(_pIndex.XpPartIdxWhere) == nil {
 67814  		_pTable.XnRowLogEst = *elem50(_pIndex.XaiRowLogEst, 0)
 67815  		_pTable.XtabFlags |= uint32(16)
 67816  	}
 67817  	goto _12
 67818  _10:
 67819  	_8_fakeIdx.XszIdxRow = _pTable.XszTabRow
 67820  	_decodeIntArray(tls, _z, int32(1), nil, &_pTable.XnRowLogEst, &_8_fakeIdx)
 67821  	_pTable.XszTabRow = _8_fakeIdx.XszIdxRow
 67822  	_pTable.XtabFlags |= uint32(16)
 67823  _12:
 67824  	return int32(0)
 67825  }
 67826  
 67827  var _analysisLoaderØ00__func__Ø000 [15]int8
 67828  
 67829  func init() {
 67830  	crt.Xstrncpy(nil, &_analysisLoaderØ00__func__Ø000[0], str(86752), 15)
 67831  }
 67832  
 67833  // C comment
 67834  //  /*
 67835  //  ** The first argument points to a nul-terminated string containing a
 67836  //  ** list of space separated integers. Read the first nOut of these into
 67837  //  ** the array aOut[].
 67838  //  */
 67839  func _decodeIntArray(tls *crt.TLS, _zIntArray *int8, _nOut int32, _aOut *uint32, _aLog *int16, _pIndex *XIndex) {
 67840  	var _c, _i int32
 67841  	var _v uint32
 67842  	var _z *int8
 67843  	_z = _zIntArray
 67844  	func() {
 67845  		if _z == nil {
 67846  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98365), unsafe.Pointer(&_decodeIntArrayØ00__func__Ø000), unsafe.Pointer(str(44406)))
 67847  			crt.X__builtin_abort(tls)
 67848  		}
 67849  	}()
 67850  	_i = int32(0)
 67851  _2:
 67852  	if (*_z) == 0 || _i >= _nOut {
 67853  		goto _6
 67854  	}
 67855  	_v = 0
 67856  _7:
 67857  	if (store2(&_c, int32(*elem1(_z, 0))) >= int32(48)) && (_c <= int32(57)) {
 67858  		_v = ((_v * uint32(10)) + uint32(_c)) - uint32(48)
 67859  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
 67860  		goto _7
 67861  	}
 67862  	func() {
 67863  		if _aOut != nil {
 67864  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98377), unsafe.Pointer(&_decodeIntArrayØ00__func__Ø000), unsafe.Pointer(str(86767)))
 67865  			crt.X__builtin_abort(tls)
 67866  		}
 67867  	}()
 67868  
 67869  	func() {
 67870  		if _aLog == nil {
 67871  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98379), unsafe.Pointer(&_decodeIntArrayØ00__func__Ø000), unsafe.Pointer(str(86775)))
 67872  			crt.X__builtin_abort(tls)
 67873  		}
 67874  	}()
 67875  	*elem50(_aLog, uintptr(_i)) = _sqlite3LogEst(tls, uint64(_v))
 67876  	if int32(*_z) == int32(32) {
 67877  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
 67878  	}
 67879  	_i += 1
 67880  	goto _2
 67881  _6:
 67882  	func() {
 67883  		if _pIndex == nil {
 67884  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98385), unsafe.Pointer(&_decodeIntArrayØ00__func__Ø000), unsafe.Pointer(str(86783)))
 67885  			crt.X__builtin_abort(tls)
 67886  		}
 67887  	}()
 67888  	storebits5(&_pIndex.XidxType, 0, 4, 2)
 67889  	storebits5(&_pIndex.XidxType, 0, 64, 6)
 67890  _17:
 67891  	if (*elem1(_z, 0)) == 0 {
 67892  		goto _18
 67893  	}
 67894  	if Xsqlite3_strglob(tls, str(86793), _z) == int32(0) {
 67895  		storebits5(&_pIndex.XidxType, int8(1), 4, 2)
 67896  		goto _23
 67897  	}
 67898  	if Xsqlite3_strglob(tls, str(86804), _z) == int32(0) {
 67899  		_pIndex.XszIdxRow = _sqlite3LogEst(tls, uint64(_sqlite3Atoi(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(int32(3)))))))
 67900  		goto _23
 67901  	}
 67902  	if Xsqlite3_strglob(tls, str(86814), _z) == int32(0) {
 67903  		storebits5(&_pIndex.XidxType, int8(1), 64, 6)
 67904  	}
 67905  _23:
 67906  	if (int32(*elem1(_z, 0)) != int32(0)) && (int32(*elem1(_z, 0)) != int32(32)) {
 67907  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
 67908  		goto _23
 67909  	}
 67910  _25:
 67911  	if int32(*elem1(_z, 0)) == int32(32) {
 67912  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
 67913  		goto _25
 67914  	}
 67915  	goto _17
 67916  _18:
 67917  }
 67918  
 67919  var _decodeIntArrayØ00__func__Ø000 [15]int8
 67920  
 67921  func init() {
 67922  	crt.Xstrncpy(nil, &_decodeIntArrayØ00__func__Ø000[0], str(86826), 15)
 67923  }
 67924  
 67925  // C comment
 67926  //  /*
 67927  //  ** The sqlite3_strglob() interface.  Return 0 on a match (like strcmp()) and
 67928  //  ** non-zero if there is no match.
 67929  //  */
 67930  func Xsqlite3_strglob(tls *crt.TLS, _zGlobPattern *int8, _zString *int8) (r0 int32) {
 67931  	return _patternCompare(tls, (*uint8)(unsafe.Pointer(_zGlobPattern)), (*uint8)(unsafe.Pointer(_zString)), &_globInfo, uint32(91))
 67932  }
 67933  
 67934  // C comment
 67935  //  /*
 67936  //  ** Compare two UTF-8 strings for equality where the first string is
 67937  //  ** a GLOB or LIKE expression.  Return values:
 67938  //  **
 67939  //  **    SQLITE_MATCH:            Match
 67940  //  **    SQLITE_NOMATCH:          No match
 67941  //  **    SQLITE_NOWILDCARDMATCH:  No match in spite of having * or % wildcards.
 67942  //  **
 67943  //  ** Globbing rules:
 67944  //  **
 67945  //  **      '*'       Matches any sequence of zero or more characters.
 67946  //  **
 67947  //  **      '?'       Matches exactly one character.
 67948  //  **
 67949  //  **     [...]      Matches one character from the enclosed list of
 67950  //  **                characters.
 67951  //  **
 67952  //  **     [^...]     Matches one character not in the enclosed list.
 67953  //  **
 67954  //  ** With the [...] and [^...] matching, a ']' character can be included
 67955  //  ** in the list by making it the first character after '[' or '^'.  A
 67956  //  ** range of characters can be specified using '-'.  Example:
 67957  //  ** "[a-z]" matches any single lower-case letter.  To match a '-', make
 67958  //  ** it the last character in the list.
 67959  //  **
 67960  //  ** Like matching rules:
 67961  //  **
 67962  //  **      '%'       Matches any sequence of zero or more characters
 67963  //  **
 67964  //  ***     '_'       Matches any one character
 67965  //  **
 67966  //  **      Ec        Where E is the "esc" character and c is any other
 67967  //  **                character, including '%', '_', and esc, match exactly c.
 67968  //  **
 67969  //  ** The comments within this routine usually assume glob matching.
 67970  //  **
 67971  //  ** This routine is usually quick, but can be N**2 in the worst case.
 67972  //  */
 67973  func _patternCompare(tls *crt.TLS, _zPattern *uint8, _zString *uint8, _pInfo *TcompareInfo, _matchOther uint32) (r0 int32) {
 67974  	var _9_bMatch, _13_bMatch, _17_bMatch, _21_seen, _21_invert int32
 67975  	var _c, _c2, _matchOne, _matchAll, _13_cx, _21_prior_c uint32
 67976  	var _noCase uint8
 67977  	var _zEscaped *uint8
 67978  	_matchOne = uint32(_pInfo.XmatchOne)
 67979  	_matchAll = uint32(_pInfo.XmatchAll)
 67980  	_noCase = _pInfo.XnoCase
 67981  	_zEscaped = nil
 67982  _0:
 67983  	if store23(&_c, func() uint32 {
 67984  		if int32(*elem15(_zPattern, 0)) < int32(128) {
 67985  			return uint32(*postInc15(&_zPattern, 1))
 67986  		}
 67987  		return _sqlite3Utf8Read(tls, &_zPattern)
 67988  	}()) == (0) {
 67989  		goto _1
 67990  	}
 67991  	if _c != _matchAll {
 67992  		goto _4
 67993  	}
 67994  _5:
 67995  	if store23(&_c, func() uint32 {
 67996  		if int32(*elem15(_zPattern, 0)) < int32(128) {
 67997  			return uint32(*postInc15(&_zPattern, 1))
 67998  		}
 67999  		return _sqlite3Utf8Read(tls, &_zPattern)
 68000  	}()) != _matchAll && _c != _matchOne {
 68001  		goto _6
 68002  	}
 68003  	if (_c == _matchOne) && (_sqlite3Utf8Read(tls, &_zString) == (0)) {
 68004  		return int32(2)
 68005  	}
 68006  	goto _5
 68007  _6:
 68008  	if _c == (0) {
 68009  		return int32(0)
 68010  	}
 68011  	if _c != _matchOther {
 68012  		goto _14
 68013  	}
 68014  	if int32(_pInfo.XmatchSet) != int32(0) {
 68015  		goto _15
 68016  	}
 68017  	_c = _sqlite3Utf8Read(tls, &_zPattern)
 68018  	if _c == (0) {
 68019  		return int32(2)
 68020  	}
 68021  	goto _17
 68022  _15:
 68023  	func() {
 68024  		if _matchOther >= uint32(128) {
 68025  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106217), unsafe.Pointer(&_patternCompareØ00__func__Ø000), unsafe.Pointer(str(86841)))
 68026  			crt.X__builtin_abort(tls)
 68027  		}
 68028  	}()
 68029  _20:
 68030  	if (*_zString) == 0 {
 68031  		goto _21
 68032  	}
 68033  	_9_bMatch = _patternCompare(tls, elem15(_zPattern, uintptr(4294967295)), _zString, _pInfo, _matchOther)
 68034  	if _9_bMatch != int32(1) {
 68035  		return _9_bMatch
 68036  	}
 68037  	if int32(*postInc15(&_zString, 1)) < int32(192) {
 68038  		goto _23
 68039  	}
 68040  _24:
 68041  	if (int32(*_zString) & int32(192)) == int32(128) {
 68042  		*(*uintptr)(unsafe.Pointer(&_zString)) += uintptr(1)
 68043  		goto _24
 68044  	}
 68045  _23:
 68046  	goto _20
 68047  _21:
 68048  	return int32(2)
 68049  
 68050  _17:
 68051  _14:
 68052  	if _c > uint32(128) {
 68053  		goto _26
 68054  	}
 68055  	if _noCase != 0 {
 68056  		_13_cx = _c & uint32(^(int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(_c)))) & int32(32)))
 68057  		_c = uint32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(uint8(_c))))
 68058  		goto _28
 68059  	}
 68060  	_13_cx = _c
 68061  _28:
 68062  	if store23(&_c2, uint32(*postInc15(&_zString, 1))) == (0) {
 68063  		goto _30
 68064  	}
 68065  	if (_c2 != _c) && (_c2 != _13_cx) {
 68066  		goto _28
 68067  	}
 68068  	_13_bMatch = _patternCompare(tls, _zPattern, _zString, _pInfo, _matchOther)
 68069  	if _13_bMatch != int32(1) {
 68070  		return _13_bMatch
 68071  	}
 68072  	goto _28
 68073  _30:
 68074  	goto _34
 68075  _26:
 68076  _35:
 68077  	if store23(&_c2, func() uint32 {
 68078  		if int32(*elem15(_zString, 0)) < int32(128) {
 68079  			return uint32(*postInc15(&_zString, 1))
 68080  		}
 68081  		return _sqlite3Utf8Read(tls, &_zString)
 68082  	}()) == (0) {
 68083  		goto _36
 68084  	}
 68085  	if _c2 != _c {
 68086  		goto _35
 68087  	}
 68088  	_17_bMatch = _patternCompare(tls, _zPattern, _zString, _pInfo, _matchOther)
 68089  	if _17_bMatch != int32(1) {
 68090  		return _17_bMatch
 68091  	}
 68092  	goto _35
 68093  _36:
 68094  _34:
 68095  	return int32(2)
 68096  
 68097  _4:
 68098  	if _c != _matchOther {
 68099  		goto _41
 68100  	}
 68101  	if int32(_pInfo.XmatchSet) != int32(0) {
 68102  		goto _42
 68103  	}
 68104  	_c = _sqlite3Utf8Read(tls, &_zPattern)
 68105  	if _c == (0) {
 68106  		return int32(1)
 68107  	}
 68108  	_zEscaped = _zPattern
 68109  	goto _44
 68110  _42:
 68111  	_21_prior_c = 0
 68112  	_21_seen = int32(0)
 68113  	_21_invert = int32(0)
 68114  	_c = _sqlite3Utf8Read(tls, &_zString)
 68115  	if _c == (0) {
 68116  		return int32(1)
 68117  	}
 68118  	_c2 = _sqlite3Utf8Read(tls, &_zPattern)
 68119  	if _c2 == uint32(94) {
 68120  		_21_invert = int32(1)
 68121  		_c2 = _sqlite3Utf8Read(tls, &_zPattern)
 68122  	}
 68123  	if _c2 != uint32(93) {
 68124  		goto _47
 68125  	}
 68126  	if _c == uint32(93) {
 68127  		_21_seen = int32(1)
 68128  	}
 68129  	_c2 = _sqlite3Utf8Read(tls, &_zPattern)
 68130  _47:
 68131  	if _c2 == 0 || _c2 == uint32(93) {
 68132  		goto _50
 68133  	}
 68134  	if _c2 != uint32(45) || int32(*elem15(_zPattern, 0)) == int32(93) || int32(*elem15(_zPattern, 0)) == int32(0) || _21_prior_c <= (0) {
 68135  		goto _55
 68136  	}
 68137  	_c2 = _sqlite3Utf8Read(tls, &_zPattern)
 68138  	if (_c >= _21_prior_c) && (_c <= _c2) {
 68139  		_21_seen = int32(1)
 68140  	}
 68141  	_21_prior_c = 0
 68142  	goto _58
 68143  _55:
 68144  	if _c == _c2 {
 68145  		_21_seen = int32(1)
 68146  	}
 68147  	_21_prior_c = _c2
 68148  _58:
 68149  	_c2 = _sqlite3Utf8Read(tls, &_zPattern)
 68150  	goto _47
 68151  _50:
 68152  	if (_c2 == (0)) || ((_21_seen ^ _21_invert) == int32(0)) {
 68153  		return int32(1)
 68154  	}
 68155  	goto _0
 68156  _44:
 68157  _41:
 68158  	_c2 = func() uint32 {
 68159  		if int32(*elem15(_zString, 0)) < int32(128) {
 68160  			return uint32(*postInc15(&_zString, 1))
 68161  		}
 68162  		return _sqlite3Utf8Read(tls, &_zString)
 68163  	}()
 68164  	if _c == _c2 {
 68165  		goto _0
 68166  	}
 68167  	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)) {
 68168  		goto _0
 68169  	}
 68170  	if ((_c == _matchOne) && (_zPattern != _zEscaped)) && (_c2 != (0)) {
 68171  		goto _0
 68172  	}
 68173  	return int32(1)
 68174  
 68175  _1:
 68176  	return func() int32 {
 68177  		if int32(*_zString) == int32(0) {
 68178  			return int32(0)
 68179  		}
 68180  		return int32(1)
 68181  	}()
 68182  }
 68183  
 68184  func _sqlite3Utf8Read(tls *crt.TLS, _pz **uint8) (r0 uint32) {
 68185  	var _c uint32
 68186  	_c = uint32(*postInc15(_pz, 1))
 68187  	if _c < uint32(192) {
 68188  		goto _0
 68189  	}
 68190  	_c = uint32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3Utf8Trans1)), uintptr(_c-uint32(192))))
 68191  _1:
 68192  	if (int32(*(*_pz)) & int32(192)) == int32(128) {
 68193  		_c = (_c << 6) + uint32(int32(63)&int32(*postInc15(_pz, 1)))
 68194  		goto _1
 68195  	}
 68196  	if ((_c < uint32(128)) || ((_c & uint32(4294965248)) == uint32(55296))) || ((_c & uint32(4294967294)) == uint32(65534)) {
 68197  		_c = uint32(65533)
 68198  	}
 68199  _0:
 68200  	return _c
 68201  }
 68202  
 68203  var _patternCompareØ00__func__Ø000 [15]int8
 68204  
 68205  func init() {
 68206  	crt.Xstrncpy(nil, &_patternCompareØ00__func__Ø000[0], str(86857), 15)
 68207  }
 68208  
 68209  var _globInfo TcompareInfo
 68210  
 68211  func init() {
 68212  	_globInfo = TcompareInfo{XmatchAll: uint8(42), XmatchOne: uint8(63), XmatchSet: uint8(91)}
 68213  }
 68214  
 68215  // C comment
 68216  //  /*
 68217  //  ** Fill the Index.aiRowEst[] array with default information - information
 68218  //  ** to be used when we have not run the ANALYZE command.
 68219  //  **
 68220  //  ** aiRowEst[0] is supposed to contain the number of elements in the index.
 68221  //  ** Since we do not know, guess 1 million.  aiRowEst[1] is an estimate of the
 68222  //  ** number of rows in the table that match any particular value of the
 68223  //  ** first column of the index.  aiRowEst[2] is an estimate of the number
 68224  //  ** of rows that match any particular combination of the first 2 columns
 68225  //  ** of the index.  And so forth.  It must always be the case that
 68226  //  *
 68227  //  **           aiRowEst[N]<=aiRowEst[N-1]
 68228  //  **           aiRowEst[N]>=1
 68229  //  **
 68230  //  ** Apart from that, we have little to go on besides intuition as to
 68231  //  ** how aiRowEst[] should be initialized.  The numbers generated here
 68232  //  ** are based on typical values found in actual indices.
 68233  //  */
 68234  func _sqlite3DefaultRowEst(tls *crt.TLS, _pIdx *XIndex) {
 68235  	var _nCopy, _i int32
 68236  	var _a *int16
 68237  	var _aVal [5]int16
 68238  	_aVal = [5]int16{int16(33), int16(32), int16(30), int16(28), int16(26)}
 68239  	_a = _pIdx.XaiRowLogEst
 68240  	_nCopy = func() int32 {
 68241  		if int32(5) < int32(_pIdx.XnKeyCol) {
 68242  			return int32(5)
 68243  		}
 68244  		return int32(_pIdx.XnKeyCol)
 68245  	}()
 68246  	func() {
 68247  		if ((uint32(_pIdx.XidxType>>7) << 31) >> 31) != 0 {
 68248  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103155), unsafe.Pointer(&_sqlite3DefaultRowEstØ00__func__Ø000), unsafe.Pointer(str(86872)))
 68249  			crt.X__builtin_abort(tls)
 68250  		}
 68251  	}()
 68252  	*elem50(_a, 0) = (*XTable)(_pIdx.XpTable).XnRowLogEst
 68253  	if (*XExpr)(_pIdx.XpPartIdxWhere) != nil {
 68254  		{
 68255  			p := elem50(_a, 0)
 68256  			*p = int16(int32(*p) - int32(10))
 68257  		}
 68258  	}
 68259  	func() {
 68260  		if int32(10) != int32(_sqlite3LogEst(tls, uint64(2))) {
 68261  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103161), unsafe.Pointer(&_sqlite3DefaultRowEstØ00__func__Ø000), unsafe.Pointer(str(86888)))
 68262  			crt.X__builtin_abort(tls)
 68263  		}
 68264  	}()
 68265  	if int32(*elem50(_a, 0)) < int32(33) {
 68266  		*elem50(_a, 0) = int16(33)
 68267  	}
 68268  	func() {
 68269  		if int32(33) != int32(_sqlite3LogEst(tls, uint64(10))) {
 68270  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103162), unsafe.Pointer(&_sqlite3DefaultRowEstØ00__func__Ø000), unsafe.Pointer(str(86909)))
 68271  			crt.X__builtin_abort(tls)
 68272  		}
 68273  	}()
 68274  	crt.Xmemcpy(tls, unsafe.Pointer(elem50(_a, uintptr(1))), unsafe.Pointer(&_aVal), uint32(_nCopy)*uint32(2))
 68275  	_i = _nCopy + int32(1)
 68276  _10:
 68277  	if _i > int32(_pIdx.XnKeyCol) {
 68278  		goto _13
 68279  	}
 68280  	*elem50(_a, uintptr(_i)) = int16(23)
 68281  	func() {
 68282  		if int32(23) != int32(_sqlite3LogEst(tls, uint64(5))) {
 68283  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103168), unsafe.Pointer(&_sqlite3DefaultRowEstØ00__func__Ø000), unsafe.Pointer(str(86931)))
 68284  			crt.X__builtin_abort(tls)
 68285  		}
 68286  	}()
 68287  	_i += 1
 68288  	goto _10
 68289  _13:
 68290  	func() {
 68291  		if int32(0) != int32(_sqlite3LogEst(tls, uint64(1))) {
 68292  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103171), unsafe.Pointer(&_sqlite3DefaultRowEstØ00__func__Ø000), unsafe.Pointer(str(46336)))
 68293  			crt.X__builtin_abort(tls)
 68294  		}
 68295  	}()
 68296  	if int32(_pIdx.XonError) != int32(0) {
 68297  		*elem50(_a, uintptr(_pIdx.XnKeyCol)) = 0
 68298  	}
 68299  	_ = _aVal
 68300  }
 68301  
 68302  var _sqlite3DefaultRowEstØ00__func__Ø000 [21]int8
 68303  
 68304  func init() {
 68305  	crt.Xstrncpy(nil, &_sqlite3DefaultRowEstØ00__func__Ø000[0], str(86952), 21)
 68306  }
 68307  
 68308  // C comment
 68309  //  /*
 68310  //  ** Unlink the given table from the hash tables and the delete the
 68311  //  ** table structure with all its indices and foreign keys.
 68312  //  */
 68313  func _sqlite3UnlinkAndDeleteTable(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _zTabName *int8) {
 68314  	var _pDb *XDb
 68315  	var _p *XTable
 68316  	func() {
 68317  		if _db == nil {
 68318  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100356), unsafe.Pointer(&_sqlite3UnlinkAndDeleteTableØ00__func__Ø000), unsafe.Pointer(str(1219)))
 68319  			crt.X__builtin_abort(tls)
 68320  		}
 68321  	}()
 68322  	func() {
 68323  		if _iDb < int32(0) || _iDb >= _db.XnDb {
 68324  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100357), unsafe.Pointer(&_sqlite3UnlinkAndDeleteTableØ00__func__Ø000), unsafe.Pointer(str(21693)))
 68325  			crt.X__builtin_abort(tls)
 68326  		}
 68327  	}()
 68328  	func() {
 68329  		if _zTabName == nil {
 68330  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100358), unsafe.Pointer(&_sqlite3UnlinkAndDeleteTableØ00__func__Ø000), unsafe.Pointer(str(86973)))
 68331  			crt.X__builtin_abort(tls)
 68332  		}
 68333  	}()
 68334  	func() {
 68335  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 68336  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100359), unsafe.Pointer(&_sqlite3UnlinkAndDeleteTableØ00__func__Ø000), unsafe.Pointer(str(51126)))
 68337  			crt.X__builtin_abort(tls)
 68338  		}
 68339  	}()
 68340  	_pDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb))
 68341  	_p = (*XTable)(_sqlite3HashInsert(tls, &((*XSchema)(_pDb.XpSchema).XtblHash), _zTabName, nil))
 68342  	_sqlite3DeleteTable(tls, _db, _p)
 68343  	_db.Xflags |= int32(2)
 68344  }
 68345  
 68346  var _sqlite3UnlinkAndDeleteTableØ00__func__Ø000 [28]int8
 68347  
 68348  func init() {
 68349  	crt.Xstrncpy(nil, &_sqlite3UnlinkAndDeleteTableØ00__func__Ø000[0], str(86982), 28)
 68350  }
 68351  
 68352  // C comment
 68353  //  /*
 68354  //  ** For the index called zIdxName which is found in the database iDb,
 68355  //  ** unlike that index from its Table then remove the index from
 68356  //  ** the index hash table and free all memory structures associated
 68357  //  ** with the index.
 68358  //  */
 68359  func _sqlite3UnlinkAndDeleteIndex(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _zIdxName *int8) {
 68360  	var _pHash *XHash
 68361  	var _pIndex, _3_p *XIndex
 68362  	func() {
 68363  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 68364  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100160), unsafe.Pointer(&_sqlite3UnlinkAndDeleteIndexØ00__func__Ø000), unsafe.Pointer(str(51126)))
 68365  			crt.X__builtin_abort(tls)
 68366  		}
 68367  	}()
 68368  	_pHash = &((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema).XidxHash)
 68369  	_pIndex = (*XIndex)(_sqlite3HashInsert(tls, _pHash, _zIdxName, nil))
 68370  	if func() int32 {
 68371  		if _pIndex != nil {
 68372  			return int32(1)
 68373  		}
 68374  		return func() int32 {
 68375  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100163), unsafe.Pointer(&_sqlite3UnlinkAndDeleteIndexØ00__func__Ø000), unsafe.Pointer(str(4809)))
 68376  			crt.X__builtin_abort(tls)
 68377  			return int32(0)
 68378  		}()
 68379  	}() == 0 {
 68380  		goto _4
 68381  	}
 68382  	if (*XIndex)((*XTable)(_pIndex.XpTable).XpIndex) == _pIndex {
 68383  		*(**XIndex)(unsafe.Pointer(&((*XTable)(_pIndex.XpTable).XpIndex))) = (*XIndex)(_pIndex.XpNext)
 68384  		goto _6
 68385  	}
 68386  	_3_p = (*XIndex)((*XTable)(_pIndex.XpTable).XpIndex)
 68387  _7:
 68388  	if func() int32 {
 68389  		if _3_p != nil {
 68390  			return int32(1)
 68391  		}
 68392  		return func() int32 {
 68393  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100171), unsafe.Pointer(&_sqlite3UnlinkAndDeleteIndexØ00__func__Ø000), unsafe.Pointer(str(4809)))
 68394  			crt.X__builtin_abort(tls)
 68395  			return int32(0)
 68396  		}()
 68397  	}() != 0 && ((*XIndex)(_3_p.XpNext) != _pIndex) {
 68398  		_3_p = (*XIndex)(_3_p.XpNext)
 68399  		goto _7
 68400  	}
 68401  	if func() int32 {
 68402  		if (_3_p != nil) && ((*XIndex)(_3_p.XpNext) == _pIndex) {
 68403  			return int32(1)
 68404  		}
 68405  		return func() int32 {
 68406  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100172), unsafe.Pointer(&_sqlite3UnlinkAndDeleteIndexØ00__func__Ø000), unsafe.Pointer(str(4809)))
 68407  			crt.X__builtin_abort(tls)
 68408  			return int32(0)
 68409  		}()
 68410  	}() != 0 {
 68411  		*(**XIndex)(unsafe.Pointer(&_3_p.XpNext)) = (*XIndex)(_pIndex.XpNext)
 68412  	}
 68413  _6:
 68414  	_freeIndex(tls, _db, _pIndex)
 68415  _4:
 68416  	_db.Xflags |= int32(2)
 68417  }
 68418  
 68419  var _sqlite3UnlinkAndDeleteIndexØ00__func__Ø000 [28]int8
 68420  
 68421  func init() {
 68422  	crt.Xstrncpy(nil, &_sqlite3UnlinkAndDeleteIndexØ00__func__Ø000[0], str(87010), 28)
 68423  }
 68424  
 68425  // C comment
 68426  //  /*
 68427  //  ** Remove a trigger from the hash tables of the sqlite* pointer.
 68428  //  */
 68429  func _sqlite3UnlinkAndDeleteTrigger(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _zName *int8) {
 68430  	var _pHash *XHash
 68431  	var _pTrigger *XTrigger
 68432  	var _2_pTab *XTable
 68433  	var _2_pp **XTrigger
 68434  	func() {
 68435  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 68436  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123220), unsafe.Pointer(&_sqlite3UnlinkAndDeleteTriggerØ00__func__Ø000), unsafe.Pointer(str(51126)))
 68437  			crt.X__builtin_abort(tls)
 68438  		}
 68439  	}()
 68440  	_pHash = &((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema).XtrigHash)
 68441  	_pTrigger = (*XTrigger)(_sqlite3HashInsert(tls, _pHash, _zName, nil))
 68442  	if func() int32 {
 68443  		if _pTrigger != nil {
 68444  			return int32(1)
 68445  		}
 68446  		return func() int32 {
 68447  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123223), unsafe.Pointer(&_sqlite3UnlinkAndDeleteTriggerØ00__func__Ø000), unsafe.Pointer(str(4809)))
 68448  			crt.X__builtin_abort(tls)
 68449  			return int32(0)
 68450  		}()
 68451  	}() == 0 {
 68452  		goto _4
 68453  	}
 68454  	if (*XSchema)(_pTrigger.XpSchema) != (*XSchema)(_pTrigger.XpTabSchema) {
 68455  		goto _5
 68456  	}
 68457  	_2_pTab = _tableOfTrigger(tls, _pTrigger)
 68458  	_2_pp = (**XTrigger)(unsafe.Pointer(&_2_pTab.XpTrigger))
 68459  _6:
 68460  	if (*_2_pp) == _pTrigger {
 68461  		goto _9
 68462  	}
 68463  	_2_pp = (**XTrigger)(unsafe.Pointer(&((*_2_pp).XpNext)))
 68464  	goto _6
 68465  _9:
 68466  	*_2_pp = (*XTrigger)((*_2_pp).XpNext)
 68467  _5:
 68468  	_sqlite3DeleteTrigger(tls, _db, _pTrigger)
 68469  	_db.Xflags |= int32(2)
 68470  _4:
 68471  }
 68472  
 68473  var _sqlite3UnlinkAndDeleteTriggerØ00__func__Ø000 [30]int8
 68474  
 68475  func init() {
 68476  	crt.Xstrncpy(nil, &_sqlite3UnlinkAndDeleteTriggerØ00__func__Ø000[0], str(87038), 30)
 68477  }
 68478  
 68479  // C comment
 68480  //  /*
 68481  //  ** Return a pointer to the Table structure for the table that a trigger
 68482  //  ** is set on.
 68483  //  */
 68484  func _tableOfTrigger(tls *crt.TLS, _pTrigger *XTrigger) (r0 *XTable) {
 68485  	return (*XTable)(_sqlite3HashFind(tls, &((*XSchema)(_pTrigger.XpTabSchema).XtblHash), _pTrigger.Xtable))
 68486  }
 68487  
 68488  // C comment
 68489  //  /*
 68490  //  ** This routine does a complete check of the given BTree file.  aRoot[] is
 68491  //  ** an array of pages numbers were each page number is the root page of
 68492  //  ** a table.  nRoot is the number of entries in aRoot.
 68493  //  **
 68494  //  ** A read-only or read-write transaction must be opened before calling
 68495  //  ** this function.
 68496  //  **
 68497  //  ** Write the number of error seen in *pnErr.  Except for some memory
 68498  //  ** allocation errors,  an error message held in memory obtained from
 68499  //  ** malloc is returned if *pnErr is non-zero.  If *pnErr==0 then NULL is
 68500  //  ** returned.  If a memory allocation error occurs, NULL is returned.
 68501  //  */
 68502  func _sqlite3BtreeIntegrityCheck(tls *crt.TLS, _p *XBtree, _aRoot *int32, _nRoot int32, _mxErr int32, _pnErr *int32) (r0 *int8) {
 68503  	var _savedDbFlags, _nRef int32
 68504  	var _4_notUsed int64
 68505  	var _i uint32
 68506  	var _zErr [100]int8
 68507  	var _pBt *XBtShared
 68508  	var _sCheck XIntegrityCk
 68509  	_pBt = (*XBtShared)(_p.XpBt)
 68510  	_savedDbFlags = (*Xsqlite3)(_pBt.Xdb).Xflags
 68511  	_sqlite3BtreeEnter(tls, _p)
 68512  	func() {
 68513  		if int32(_p.XinTrans) <= int32(0) || int32(_pBt.XinTransaction) <= int32(0) {
 68514  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68515), unsafe.Pointer(&_sqlite3BtreeIntegrityCheckØ00__func__Ø000), unsafe.Pointer(str(87068)))
 68515  			crt.X__builtin_abort(tls)
 68516  		}
 68517  	}()
 68518  	_nRef = _sqlite3PagerRefcount(tls, (*XPager)(_pBt.XpPager))
 68519  	func() {
 68520  		if _nRef < int32(0) {
 68521  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68517), unsafe.Pointer(&_sqlite3BtreeIntegrityCheckØ00__func__Ø000), unsafe.Pointer(str(87123)))
 68522  			crt.X__builtin_abort(tls)
 68523  		}
 68524  	}()
 68525  	*(**XBtShared)(unsafe.Pointer(&_sCheck.XpBt)) = _pBt
 68526  	*(**XPager)(unsafe.Pointer(&_sCheck.XpPager)) = (*XPager)(_pBt.XpPager)
 68527  	_sCheck.XnPage = _btreePagecount(tls, (*XBtShared)(_sCheck.XpBt))
 68528  	_sCheck.XmxErr = _mxErr
 68529  	_sCheck.XnErr = int32(0)
 68530  	_sCheck.XmallocFailed = int32(0)
 68531  	_sCheck.XzPfx = nil
 68532  	_sCheck.Xv1 = int32(0)
 68533  	_sCheck.Xv2 = int32(0)
 68534  	_sCheck.XaPgRef = nil
 68535  	_sCheck.Xheap = nil
 68536  	_sqlite3StrAccumInit(tls, &_sCheck.XerrMsg, nil, (*int8)(unsafe.Pointer(&_zErr)), int32(100), int32(1000000000))
 68537  	_sCheck.XerrMsg.XprintfFlags = uint8(1)
 68538  	if _sCheck.XnPage == (0) {
 68539  		goto _integrity_ck_cleanup
 68540  	}
 68541  	_sCheck.XaPgRef = (*uint8)(_sqlite3MallocZero(tls, uint64((_sCheck.XnPage/uint32(8))+uint32(1))))
 68542  	if _sCheck.XaPgRef == nil {
 68543  		_sCheck.XmallocFailed = int32(1)
 68544  		goto _integrity_ck_cleanup
 68545  	}
 68546  	_sCheck.Xheap = (*uint32)(_sqlite3PageMalloc(tls, int32(_pBt.XpageSize)))
 68547  	if _sCheck.Xheap == nil {
 68548  		_sCheck.XmallocFailed = int32(1)
 68549  		goto _integrity_ck_cleanup
 68550  	}
 68551  	_i = (uint32(_sqlite3PendingByte) / _pBt.XpageSize) + uint32(1)
 68552  	if _i <= _sCheck.XnPage {
 68553  		_setPageReferenced(tls, &_sCheck, _i)
 68554  	}
 68555  	_sCheck.XzPfx = str(87131)
 68556  	_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)))))
 68557  	_sCheck.XzPfx = nil
 68558  	(*Xsqlite3)(_pBt.Xdb).Xflags &= int32(-536870913)
 68559  	_i = 0
 68560  _9:
 68561  	if int32(_i) >= _nRoot || _sCheck.XmxErr == 0 {
 68562  		goto _13
 68563  	}
 68564  	if (*elem8(_aRoot, uintptr(_i))) == int32(0) {
 68565  		goto _10
 68566  	}
 68567  	if (_pBt.XautoVacuum != 0) && ((*elem8(_aRoot, uintptr(_i))) > int32(1)) {
 68568  		_checkPtrmap(tls, &_sCheck, uint32(*elem8(_aRoot, uintptr(_i))), uint8(1), 0)
 68569  	}
 68570  	_checkTreePage(tls, &_sCheck, *elem8(_aRoot, uintptr(_i)), &_4_notUsed, int64(9223372036854775807))
 68571  _10:
 68572  	_i += 1
 68573  	goto _9
 68574  _13:
 68575  	(*Xsqlite3)(_pBt.Xdb).Xflags = _savedDbFlags
 68576  	_i = uint32(1)
 68577  _17:
 68578  	if _i > _sCheck.XnPage || _sCheck.XmxErr == 0 {
 68579  		goto _integrity_ck_cleanup
 68580  	}
 68581  	if (_getPageReferenced(tls, &_sCheck, _i) == int32(0)) && ((_ptrmapPageno(tls, _pBt, _i) != _i) || (_pBt.XautoVacuum == 0)) {
 68582  		_checkAppendMsg(tls, &_sCheck, str(87147), _i)
 68583  	}
 68584  	if (_getPageReferenced(tls, &_sCheck, _i) != int32(0)) && ((_ptrmapPageno(tls, _pBt, _i) == _i) && (_pBt.XautoVacuum != 0)) {
 68585  		_checkAppendMsg(tls, &_sCheck, str(87169), _i)
 68586  	}
 68587  	_i += 1
 68588  	goto _17
 68589  _integrity_ck_cleanup:
 68590  	_sqlite3PageFree(tls, unsafe.Pointer(_sCheck.Xheap))
 68591  	Xsqlite3_free(tls, unsafe.Pointer(_sCheck.XaPgRef))
 68592  	if _sCheck.XmallocFailed != 0 {
 68593  		_sqlite3StrAccumReset(tls, &_sCheck.XerrMsg)
 68594  		_sCheck.XnErr += 1
 68595  	}
 68596  	*_pnErr = _sCheck.XnErr
 68597  	if _sCheck.XnErr == int32(0) {
 68598  		_sqlite3StrAccumReset(tls, &_sCheck.XerrMsg)
 68599  	}
 68600  	func() {
 68601  		if _nRef != _sqlite3PagerRefcount(tls, (*XPager)(_pBt.XpPager)) {
 68602  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68606), unsafe.Pointer(&_sqlite3BtreeIntegrityCheckØ00__func__Ø000), unsafe.Pointer(str(87203)))
 68603  			crt.X__builtin_abort(tls)
 68604  		}
 68605  	}()
 68606  	_sqlite3BtreeLeave(tls, _p)
 68607  	return _sqlite3StrAccumFinish(tls, &_sCheck.XerrMsg)
 68608  
 68609  	_ = _zErr
 68610  	panic(0)
 68611  }
 68612  
 68613  var _sqlite3BtreeIntegrityCheckØ00__func__Ø000 [27]int8
 68614  
 68615  func init() {
 68616  	crt.Xstrncpy(nil, &_sqlite3BtreeIntegrityCheckØ00__func__Ø000[0], str(87243), 27)
 68617  }
 68618  
 68619  // C comment
 68620  //  /*
 68621  //  ** Set the bit in the IntegrityCk.aPgRef[] array that corresponds to page iPg.
 68622  //  */
 68623  func _setPageReferenced(tls *crt.TLS, _pCheck *XIntegrityCk, _iPg uint32) {
 68624  	func() {
 68625  		if _iPg > _pCheck.XnPage || int32(1) == 0 {
 68626  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68037), unsafe.Pointer(&_setPageReferencedØ00__func__Ø000), unsafe.Pointer(str(87270)))
 68627  			crt.X__builtin_abort(tls)
 68628  		}
 68629  	}()
 68630  	{
 68631  		p := elem15(_pCheck.XaPgRef, uintptr(_iPg/uint32(8)))
 68632  		*p = uint8(int32(*p) | (int32(1) << uint(int32(_iPg&uint32(7)))))
 68633  	}
 68634  }
 68635  
 68636  var _setPageReferencedØ00__func__Ø000 [18]int8
 68637  
 68638  func init() {
 68639  	crt.Xstrncpy(nil, &_setPageReferencedØ00__func__Ø000[0], str(87321), 18)
 68640  }
 68641  
 68642  // C comment
 68643  //  /*
 68644  //  ** Check the integrity of the freelist or of an overflow page list.
 68645  //  ** Verify that the number of pages on the list is N.
 68646  //  */
 68647  func _checkList(tls *crt.TLS, _pCheck *XIntegrityCk, _isFreeList int32, _iPage int32, _N int32) {
 68648  	var _i, _expected, _iFirst, _4_n int32
 68649  	var _8_iFreePage uint32
 68650  	var _1_pOvflData *uint8
 68651  	var _1_pOvflPage *XPgHdr
 68652  	_expected = _N
 68653  	_iFirst = _iPage
 68654  _0:
 68655  	if postInc2(&_N, -1) <= int32(0) || _pCheck.XmxErr == 0 {
 68656  		goto _1
 68657  	}
 68658  	if _iPage < int32(1) {
 68659  		_checkAppendMsg(tls, _pCheck, str(87339), _N+int32(1), _expected, _iFirst)
 68660  		goto _1
 68661  	}
 68662  	if _checkRef(tls, _pCheck, uint32(_iPage)) != 0 {
 68663  		goto _1
 68664  	}
 68665  	if _sqlite3PagerGet(tls, (*XPager)(_pCheck.XpPager), uint32(_iPage), &_1_pOvflPage, int32(0)) != 0 {
 68666  		_checkAppendMsg(tls, _pCheck, str(87396), _iPage)
 68667  		goto _1
 68668  	}
 68669  	_1_pOvflData = (*uint8)(_sqlite3PagerGetData(tls, _1_pOvflPage))
 68670  	if _isFreeList == 0 {
 68671  		goto _6
 68672  	}
 68673  	_4_n = int32(_sqlite3Get4byte(tls, elem15(_1_pOvflData, uintptr(4))))
 68674  	if ((*XBtShared)(_pCheck.XpBt).XautoVacuum) != 0 {
 68675  		_checkPtrmap(tls, _pCheck, uint32(_iPage), uint8(2), 0)
 68676  	}
 68677  	if _4_n > ((int32((*XBtShared)(_pCheck.XpBt).XusableSize) / int32(4)) - int32(2)) {
 68678  		_checkAppendMsg(tls, _pCheck, str(87418), _iPage)
 68679  		_N -= 1
 68680  		goto _9
 68681  	}
 68682  	_i = int32(0)
 68683  _10:
 68684  	if _i >= _4_n {
 68685  		goto _13
 68686  	}
 68687  	_8_iFreePage = _sqlite3Get4byte(tls, elem15(_1_pOvflData, uintptr(int32(8)+(_i*int32(4)))))
 68688  	if ((*XBtShared)(_pCheck.XpBt).XautoVacuum) != 0 {
 68689  		_checkPtrmap(tls, _pCheck, _8_iFreePage, uint8(2), 0)
 68690  	}
 68691  	_checkRef(tls, _pCheck, _8_iFreePage)
 68692  	_i += 1
 68693  	goto _10
 68694  _13:
 68695  	_N -= _4_n
 68696  _9:
 68697  	goto _15
 68698  _6:
 68699  	if (((*XBtShared)(_pCheck.XpBt).XautoVacuum) != 0) && (_N > int32(0)) {
 68700  		_i = int32(_sqlite3Get4byte(tls, _1_pOvflData))
 68701  		_checkPtrmap(tls, _pCheck, uint32(_i), uint8(4), uint32(_iPage))
 68702  	}
 68703  _15:
 68704  	_iPage = int32(_sqlite3Get4byte(tls, _1_pOvflData))
 68705  	_sqlite3PagerUnref(tls, _1_pOvflPage)
 68706  	if _isFreeList != 0 && (_N < bool2int(_iPage != int32(0))) {
 68707  		_checkAppendMsg(tls, _pCheck, str(87457))
 68708  	}
 68709  	goto _0
 68710  _1:
 68711  }
 68712  
 68713  // C comment
 68714  //  /*
 68715  //  ** Append a message to the error message string.
 68716  //  */
 68717  func _checkAppendMsg(tls *crt.TLS, _pCheck *XIntegrityCk, _zFormat *int8, args ...interface{}) {
 68718  	var _ap []interface{}
 68719  	if _pCheck.XmxErr == 0 {
 68720  		return
 68721  	}
 68722  	_pCheck.XmxErr -= 1
 68723  	_pCheck.XnErr += 1
 68724  	_ap = args
 68725  	if (_pCheck.XerrMsg.XnChar) != 0 {
 68726  		_sqlite3StrAccumAppend(tls, &_pCheck.XerrMsg, str(37655), int32(1))
 68727  	}
 68728  	if _pCheck.XzPfx != nil {
 68729  		_sqlite3XPrintf(tls, &_pCheck.XerrMsg, _pCheck.XzPfx, _pCheck.Xv1, _pCheck.Xv2)
 68730  	}
 68731  	_sqlite3VXPrintf(tls, &_pCheck.XerrMsg, _zFormat, _ap)
 68732  	_ap = nil
 68733  	if int32(_pCheck.XerrMsg.XaccError) == int32(1) {
 68734  		_pCheck.XmallocFailed = int32(1)
 68735  	}
 68736  }
 68737  
 68738  // C comment
 68739  //  /*
 68740  //  ** Add 1 to the reference count for page iPage.  If this is the second
 68741  //  ** reference to the page, add an error message to pCheck->zErrMsg.
 68742  //  ** Return 1 if there are 2 or more references to the page and 0 if
 68743  //  ** if this is the first reference to the page.
 68744  //  **
 68745  //  ** Also check that the page number is in bounds.
 68746  //  */
 68747  func _checkRef(tls *crt.TLS, _pCheck *XIntegrityCk, _iPage uint32) (r0 int32) {
 68748  	if _iPage == (0) {
 68749  		return int32(1)
 68750  	}
 68751  	if _iPage > _pCheck.XnPage {
 68752  		_checkAppendMsg(tls, _pCheck, str(87496), _iPage)
 68753  		return int32(1)
 68754  	}
 68755  	if _getPageReferenced(tls, _pCheck, _iPage) != 0 {
 68756  		_checkAppendMsg(tls, _pCheck, str(87519), _iPage)
 68757  		return int32(1)
 68758  	}
 68759  	_setPageReferenced(tls, _pCheck, _iPage)
 68760  	return int32(0)
 68761  }
 68762  
 68763  // C comment
 68764  //  /*
 68765  //  ** Return non-zero if the bit in the IntegrityCk.aPgRef[] array that
 68766  //  ** corresponds to page iPg is already set.
 68767  //  */
 68768  func _getPageReferenced(tls *crt.TLS, _pCheck *XIntegrityCk, _iPg uint32) (r0 int32) {
 68769  	func() {
 68770  		if _iPg > _pCheck.XnPage || int32(1) == 0 {
 68771  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68029), unsafe.Pointer(&_getPageReferencedØ00__func__Ø000), unsafe.Pointer(str(87270)))
 68772  			crt.X__builtin_abort(tls)
 68773  		}
 68774  	}()
 68775  	return int32(*elem15(_pCheck.XaPgRef, uintptr(_iPg/uint32(8)))) & (int32(1) << uint(int32(_iPg&uint32(7))))
 68776  }
 68777  
 68778  var _getPageReferencedØ00__func__Ø000 [18]int8
 68779  
 68780  func init() {
 68781  	crt.Xstrncpy(nil, &_getPageReferencedØ00__func__Ø000[0], str(87544), 18)
 68782  }
 68783  
 68784  // C comment
 68785  //  /*
 68786  //  ** Check that the entry in the pointer-map for page iChild maps to
 68787  //  ** page iParent, pointer type ptrType. If not, append an error message
 68788  //  ** to pCheck.
 68789  //  */
 68790  func _checkPtrmap(tls *crt.TLS, _pCheck *XIntegrityCk, _iChild uint32, _eType uint8, _iParent uint32) {
 68791  	var _rc int32
 68792  	var _iPtrmapParent uint32
 68793  	var _ePtrmapType uint8
 68794  	_rc = _ptrmapGet(tls, (*XBtShared)(_pCheck.XpBt), _iChild, &_ePtrmapType, &_iPtrmapParent)
 68795  	if _rc == int32(0) {
 68796  		goto _0
 68797  	}
 68798  	if (_rc == int32(7)) || (_rc == int32(3082)) {
 68799  		_pCheck.XmallocFailed = int32(1)
 68800  	}
 68801  	_checkAppendMsg(tls, _pCheck, str(87562), _iChild)
 68802  	return
 68803  _0:
 68804  	if (int32(_ePtrmapType) != int32(_eType)) || (_iPtrmapParent != _iParent) {
 68805  		_checkAppendMsg(tls, _pCheck, str(87591), _iChild, int32(_eType), _iParent, int32(_ePtrmapType), _iPtrmapParent)
 68806  	}
 68807  }
 68808  
 68809  // C comment
 68810  //  /*
 68811  //  ** Do various sanity checks on a single page of a tree.  Return
 68812  //  ** the tree depth.  Root pages return 0.  Parents of root pages
 68813  //  ** return 1, and so forth.
 68814  //  **
 68815  //  ** These checks are done:
 68816  //  **
 68817  //  **      1.  Make sure that cells and freeblocks do not overlap
 68818  //  **          but combine to completely cover the page.
 68819  //  **      2.  Make sure integer cell keys are in order.
 68820  //  **      3.  Check the integrity of overflow pages.
 68821  //  **      4.  Recursively call checkTreePage on all children.
 68822  //  **      5.  Verify that the depth of all children is the same.
 68823  //  */
 68824  func _checkTreePage(tls *crt.TLS, _pCheck *XIntegrityCk, _iPage int32, _piMinKey *int64, _maxKey int64) (r0 int32) {
 68825  	var _i, _rc, _depth, _d2, _pgno, _nFrag, _hdr, _cellStart, _nCell, _doCoverageCheck, _keyCanBeEqual, _saved_v1, _saved_v2, _11_nPage, _20_size, _20_j int32
 68826  	var _pc, _usableSize, _contentOffset, _x, _prev, _11_pgnoOvfl, _19_size uint32
 68827  	var _saved_zPfx *int8
 68828  	var _savedIsInit uint8
 68829  	var _data, _pCell, _pCellIdx *uint8
 68830  	var _heap *uint32
 68831  	var _pBt *XBtShared
 68832  	var _6_info XCellInfo
 68833  	var _pPage *XMemPage
 68834  	_pPage = nil
 68835  	_depth = int32(-1)
 68836  	_doCoverageCheck = int32(1)
 68837  	_keyCanBeEqual = int32(1)
 68838  	_heap = nil
 68839  	_prev = uint32(0)
 68840  	_saved_zPfx = _pCheck.XzPfx
 68841  	_saved_v1 = _pCheck.Xv1
 68842  	_saved_v2 = _pCheck.Xv2
 68843  	_savedIsInit = uint8(0)
 68844  	_pBt = (*XBtShared)(_pCheck.XpBt)
 68845  	_usableSize = _pBt.XusableSize
 68846  	if _iPage == int32(0) {
 68847  		return int32(0)
 68848  	}
 68849  	if _checkRef(tls, _pCheck, uint32(_iPage)) != 0 {
 68850  		return int32(0)
 68851  	}
 68852  	_pCheck.XzPfx = str(87645)
 68853  	_pCheck.Xv1 = _iPage
 68854  	if store2(&_rc, _btreeGetPage(tls, _pBt, uint32(_iPage), &_pPage, int32(0))) != int32(0) {
 68855  		_checkAppendMsg(tls, _pCheck, str(87655), _rc)
 68856  		goto _end_of_check
 68857  	}
 68858  	_savedIsInit = _pPage.XisInit
 68859  	_pPage.XisInit = 0
 68860  	if store2(&_rc, _btreeInitPage(tls, _pPage)) != int32(0) {
 68861  		func() {
 68862  			if _rc != int32(11) {
 68863  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68286), unsafe.Pointer(&_checkTreePageØ00__func__Ø000), unsafe.Pointer(str(87693)))
 68864  				crt.X__builtin_abort(tls)
 68865  			}
 68866  		}()
 68867  		_checkAppendMsg(tls, _pCheck, str(87712), _rc)
 68868  		goto _end_of_check
 68869  	}
 68870  	_data = _pPage.XaData
 68871  	_hdr = int32(_pPage.XhdrOffset)
 68872  	_pCheck.XzPfx = str(87750)
 68873  	_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))
 68874  	func() {
 68875  		if _contentOffset > _usableSize {
 68876  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68297), unsafe.Pointer(&_checkTreePageØ00__func__Ø000), unsafe.Pointer(str(87776)))
 68877  			crt.X__builtin_abort(tls)
 68878  		}
 68879  	}()
 68880  	_nCell = (int32(*elem15(elem15(_data, uintptr(_hdr+int32(3))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_hdr+int32(3))), uintptr(1)))
 68881  	func() {
 68882  		if int32(_pPage.XnCell) != _nCell {
 68883  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68302), unsafe.Pointer(&_checkTreePageØ00__func__Ø000), unsafe.Pointer(str(87802)))
 68884  			crt.X__builtin_abort(tls)
 68885  		}
 68886  	}()
 68887  	_cellStart = (_hdr + int32(12)) - (int32(4) * int32(_pPage.Xleaf))
 68888  	func() {
 68889  		if _pPage.XaCellIdx != elem15(_data, uintptr(_cellStart)) {
 68890  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68307), unsafe.Pointer(&_checkTreePageØ00__func__Ø000), unsafe.Pointer(str(87822)))
 68891  			crt.X__builtin_abort(tls)
 68892  		}
 68893  	}()
 68894  	_pCellIdx = elem15(_data, uintptr(_cellStart+(int32(2)*(_nCell-int32(1)))))
 68895  	if _pPage.Xleaf != 0 {
 68896  		goto _12
 68897  	}
 68898  	_pgno = int32(_sqlite3Get4byte(tls, elem15(_data, uintptr(_hdr+int32(8)))))
 68899  	if _pBt.XautoVacuum != 0 {
 68900  		_pCheck.XzPfx = str(87856)
 68901  		_checkPtrmap(tls, _pCheck, uint32(_pgno), uint8(5), uint32(_iPage))
 68902  	}
 68903  	_depth = _checkTreePage(tls, _pCheck, _pgno, &_maxKey, _maxKey)
 68904  	_keyCanBeEqual = int32(0)
 68905  	goto _14
 68906  _12:
 68907  	_heap = _pCheck.Xheap
 68908  	*elem7(_heap, 0) = 0
 68909  _14:
 68910  	_i = _nCell - int32(1)
 68911  _15:
 68912  	if _i < int32(0) || _pCheck.XmxErr == 0 {
 68913  		goto _19
 68914  	}
 68915  	_pCheck.Xv2 = _i
 68916  	func() {
 68917  		if _pCellIdx != elem15(_data, uintptr(_cellStart+(_i*int32(2)))) {
 68918  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68335), unsafe.Pointer(&_checkTreePageØ00__func__Ø000), unsafe.Pointer(str(87884)))
 68919  			crt.X__builtin_abort(tls)
 68920  		}
 68921  	}()
 68922  	_pc = uint32((int32(*elem15(_pCellIdx, 0)) << 8) | int32(*elem15(_pCellIdx, uintptr(1))))
 68923  	*(*uintptr)(unsafe.Pointer(&_pCellIdx)) -= uintptr(int32(2))
 68924  	if (_pc < _contentOffset) || (_pc > (_usableSize - uint32(4))) {
 68925  		_checkAppendMsg(tls, _pCheck, str(87917), _pc, _contentOffset, _usableSize-uint32(4))
 68926  		_doCoverageCheck = int32(0)
 68927  		goto _16
 68928  	}
 68929  	_pCell = elem15(_data, uintptr(_pc))
 68930  	func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) {
 68931  		v := _pPage.XxParseCell
 68932  		return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v))
 68933  	}()(tls, _pPage, _pCell, &_6_info)
 68934  	if (_pc + uint32(_6_info.XnSize)) > _usableSize {
 68935  		_checkAppendMsg(tls, _pCheck, str(87947))
 68936  		_doCoverageCheck = int32(0)
 68937  		goto _16
 68938  	}
 68939  	if _pPage.XintKey == 0 {
 68940  		goto _25
 68941  	}
 68942  	if func() int32 {
 68943  		if _keyCanBeEqual != 0 {
 68944  			return bool2int(_6_info.XnKey > _maxKey)
 68945  		}
 68946  		return bool2int(_6_info.XnKey >= _maxKey)
 68947  	}() != 0 {
 68948  		_checkAppendMsg(tls, _pCheck, str(87971), _6_info.XnKey)
 68949  	}
 68950  	_maxKey = _6_info.XnKey
 68951  	_keyCanBeEqual = int32(0)
 68952  _25:
 68953  	if _6_info.XnPayload <= uint32(_6_info.XnLocal) {
 68954  		goto _29
 68955  	}
 68956  	func() {
 68957  		if ((_pc + uint32(_6_info.XnSize)) - uint32(4)) > _usableSize {
 68958  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68365), unsafe.Pointer(&_checkTreePageØ00__func__Ø000), unsafe.Pointer(str(87995)))
 68959  			crt.X__builtin_abort(tls)
 68960  		}
 68961  	}()
 68962  	_11_nPage = int32((((_6_info.XnPayload - uint32(_6_info.XnLocal)) + _usableSize) - uint32(5)) / (_usableSize - uint32(4)))
 68963  	_11_pgnoOvfl = _sqlite3Get4byte(tls, elem15(_pCell, uintptr(int32(_6_info.XnSize)-int32(4))))
 68964  	if _pBt.XautoVacuum != 0 {
 68965  		_checkPtrmap(tls, _pCheck, _11_pgnoOvfl, uint8(3), uint32(_iPage))
 68966  	}
 68967  	_checkList(tls, _pCheck, int32(0), int32(_11_pgnoOvfl), _11_nPage)
 68968  _29:
 68969  	if _pPage.Xleaf != 0 {
 68970  		goto _33
 68971  	}
 68972  	_pgno = int32(_sqlite3Get4byte(tls, _pCell))
 68973  	if _pBt.XautoVacuum != 0 {
 68974  		_checkPtrmap(tls, _pCheck, uint32(_pgno), uint8(5), uint32(_iPage))
 68975  	}
 68976  	_d2 = _checkTreePage(tls, _pCheck, _pgno, &_maxKey, _maxKey)
 68977  	_keyCanBeEqual = int32(0)
 68978  	if _d2 != _depth {
 68979  		_checkAppendMsg(tls, _pCheck, str(88029))
 68980  		_depth = _d2
 68981  	}
 68982  	goto _36
 68983  _33:
 68984  	_btreeHeapInsert(tls, _heap, (_pc<<16)|((_pc+uint32(_6_info.XnSize))-uint32(1)))
 68985  _36:
 68986  _16:
 68987  	_i -= 1
 68988  	goto _15
 68989  _19:
 68990  	*_piMinKey = _maxKey
 68991  	_pCheck.XzPfx = nil
 68992  	if _doCoverageCheck == 0 || _pCheck.XmxErr <= int32(0) {
 68993  		goto _end_of_check
 68994  	}
 68995  	if _pPage.Xleaf != 0 {
 68996  		goto _39
 68997  	}
 68998  	_heap = _pCheck.Xheap
 68999  	*elem7(_heap, 0) = 0
 69000  	_i = _nCell - int32(1)
 69001  _40:
 69002  	if _i < int32(0) {
 69003  		goto _43
 69004  	}
 69005  	_pc = uint32((int32(*elem15(elem15(_data, uintptr(_cellStart+(_i*int32(2)))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_cellStart+(_i*int32(2)))), uintptr(1))))
 69006  	_19_size = uint32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 {
 69007  		v := _pPage.XxCellSize
 69008  		return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v))
 69009  	}()(tls, _pPage, elem15(_data, uintptr(_pc))))
 69010  	_btreeHeapInsert(tls, _heap, (_pc<<16)|((_pc+_19_size)-uint32(1)))
 69011  	_i -= 1
 69012  	goto _40
 69013  _43:
 69014  _39:
 69015  	_i = (int32(*elem15(elem15(_data, uintptr(_hdr+int32(1))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_hdr+int32(1))), uintptr(1)))
 69016  _44:
 69017  	if _i > int32(0) {
 69018  		func() {
 69019  			if uint32(_i) > (_usableSize - uint32(4)) {
 69020  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68423), unsafe.Pointer(&_checkTreePageØ00__func__Ø000), unsafe.Pointer(str(88054)))
 69021  				crt.X__builtin_abort(tls)
 69022  			}
 69023  		}()
 69024  		_20_size = (int32(*elem15(elem15(_data, uintptr(_i+int32(2))), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_i+int32(2))), uintptr(1)))
 69025  		func() {
 69026  			if uint32(_i+_20_size) > _usableSize {
 69027  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68425), unsafe.Pointer(&_checkTreePageØ00__func__Ø000), unsafe.Pointer(str(88075)))
 69028  				crt.X__builtin_abort(tls)
 69029  			}
 69030  		}()
 69031  		_btreeHeapInsert(tls, _heap, (uint32(_i)<<16)|uint32((_i+_20_size)-int32(1)))
 69032  		_20_j = (int32(*elem15(elem15(_data, uintptr(_i)), 0)) << 8) | int32(*elem15(elem15(_data, uintptr(_i)), uintptr(1)))
 69033  		func() {
 69034  			if _20_j != int32(0) && _20_j <= (_i+_20_size) {
 69035  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68434), unsafe.Pointer(&_checkTreePageØ00__func__Ø000), unsafe.Pointer(str(88101)))
 69036  				crt.X__builtin_abort(tls)
 69037  			}
 69038  		}()
 69039  		func() {
 69040  			if uint32(_20_j) > (_usableSize - uint32(4)) {
 69041  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68435), unsafe.Pointer(&_checkTreePageØ00__func__Ø000), unsafe.Pointer(str(88118)))
 69042  				crt.X__builtin_abort(tls)
 69043  			}
 69044  		}()
 69045  		_i = _20_j
 69046  		goto _44
 69047  	}
 69048  	_nFrag = int32(0)
 69049  	_prev = _contentOffset - uint32(1)
 69050  _55:
 69051  	if _btreeHeapPull(tls, _heap, &_x) == 0 {
 69052  		goto _56
 69053  	}
 69054  	if (_prev & uint32(65535)) >= (_x >> 16) {
 69055  		_checkAppendMsg(tls, _pCheck, str(88139), _x>>16, _iPage)
 69056  		goto _56
 69057  	}
 69058  	{
 69059  		p := &_nFrag
 69060  		*p = int32(uint32(*p) + (((_x >> 16) - (_prev & uint32(65535))) - uint32(1)))
 69061  	}
 69062  	_prev = _x
 69063  	goto _55
 69064  _56:
 69065  	{
 69066  		p := &_nFrag
 69067  		*p = int32(uint32(*p) + ((_usableSize - (_prev & uint32(65535))) - uint32(1)))
 69068  	}
 69069  	if ((*elem7(_heap, 0)) == (0)) && (_nFrag != int32(*elem15(_data, uintptr(_hdr+int32(7))))) {
 69070  		_checkAppendMsg(tls, _pCheck, str(88176), _nFrag, int32(*elem15(_data, uintptr(_hdr+int32(7)))), _iPage)
 69071  	}
 69072  _end_of_check:
 69073  	if _doCoverageCheck == 0 {
 69074  		_pPage.XisInit = _savedIsInit
 69075  	}
 69076  	_releasePage(tls, _pPage)
 69077  	_pCheck.XzPfx = _saved_zPfx
 69078  	_pCheck.Xv1 = _saved_v1
 69079  	_pCheck.Xv2 = _saved_v2
 69080  	return _depth + int32(1)
 69081  }
 69082  
 69083  var _checkTreePageØ00__func__Ø000 [14]int8
 69084  
 69085  func init() {
 69086  	crt.Xstrncpy(nil, &_checkTreePageØ00__func__Ø000[0], str(88228), 14)
 69087  }
 69088  
 69089  // C comment
 69090  //  /*
 69091  //  ** An implementation of a min-heap.
 69092  //  **
 69093  //  ** aHeap[0] is the number of elements on the heap.  aHeap[1] is the
 69094  //  ** root element.  The daughter nodes of aHeap[N] are aHeap[N*2]
 69095  //  ** and aHeap[N*2+1].
 69096  //  **
 69097  //  ** The heap property is this:  Every node is less than or equal to both
 69098  //  ** of its daughter nodes.  A consequence of the heap property is that the
 69099  //  ** root node aHeap[1] is always the minimum value currently in the heap.
 69100  //  **
 69101  //  ** The btreeHeapInsert() routine inserts an unsigned 32-bit number onto
 69102  //  ** the heap, preserving the heap property.  The btreeHeapPull() routine
 69103  //  ** removes the root element from the heap (the minimum value in the heap)
 69104  //  ** and then moves other nodes around as necessary to preserve the heap
 69105  //  ** property.
 69106  //  **
 69107  //  ** This heap is used for cell overlap and coverage testing.  Each u32
 69108  //  ** entry represents the span of a cell or freeblock on a btree page.
 69109  //  ** The upper 16 bits are the index of the first byte of a range and the
 69110  //  ** lower 16 bits are the index of the last byte of that range.
 69111  //  */
 69112  func _btreeHeapInsert(tls *crt.TLS, _aHeap *uint32, _x uint32) {
 69113  	var _j, _i uint32
 69114  	_i = preInc23(elem7(_aHeap, 0), uint32(1))
 69115  	*elem7(_aHeap, uintptr(_i)) = _x
 69116  _0:
 69117  	if (store23(&_j, _i/uint32(2)) > (0)) && ((*elem7(_aHeap, uintptr(_j))) > (*elem7(_aHeap, uintptr(_i)))) {
 69118  		_x = *elem7(_aHeap, uintptr(_j))
 69119  		*elem7(_aHeap, uintptr(_j)) = *elem7(_aHeap, uintptr(_i))
 69120  		*elem7(_aHeap, uintptr(_i)) = _x
 69121  		_i = _j
 69122  		goto _0
 69123  	}
 69124  }
 69125  
 69126  func _btreeHeapPull(tls *crt.TLS, _aHeap *uint32, _pOut *uint32) (r0 int32) {
 69127  	var _j, _i, _x uint32
 69128  	if store23(&_x, *elem7(_aHeap, 0)) == (0) {
 69129  		return int32(0)
 69130  	}
 69131  	*_pOut = *elem7(_aHeap, uintptr(1))
 69132  	*elem7(_aHeap, uintptr(1)) = *elem7(_aHeap, uintptr(_x))
 69133  	*elem7(_aHeap, uintptr(_x)) = uint32(4294967295)
 69134  	*elem7(_aHeap, 0) -= 1
 69135  	_i = uint32(1)
 69136  _1:
 69137  	if store23(&_j, _i*uint32(2)) > (*elem7(_aHeap, 0)) {
 69138  		goto _2
 69139  	}
 69140  	if (*elem7(_aHeap, uintptr(_j))) > (*elem7(_aHeap, uintptr(_j+uint32(1)))) {
 69141  		_j += 1
 69142  	}
 69143  	if (*elem7(_aHeap, uintptr(_i))) < (*elem7(_aHeap, uintptr(_j))) {
 69144  		goto _2
 69145  	}
 69146  	_x = *elem7(_aHeap, uintptr(_i))
 69147  	*elem7(_aHeap, uintptr(_i)) = *elem7(_aHeap, uintptr(_j))
 69148  	*elem7(_aHeap, uintptr(_j)) = _x
 69149  	_i = _j
 69150  	goto _1
 69151  _2:
 69152  	return int32(1)
 69153  }
 69154  
 69155  // C comment
 69156  //  /*
 69157  //  ** Delete any previous value and set the value of pMem to be an
 69158  //  ** empty boolean index.
 69159  //  */
 69160  func _sqlite3VdbeMemSetRowSet(tls *crt.TLS, _pMem *XMem) {
 69161  	var _db *Xsqlite3
 69162  	_db = (*Xsqlite3)(_pMem.Xdb)
 69163  	func() {
 69164  		if _db == nil {
 69165  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70429), unsafe.Pointer(&_sqlite3VdbeMemSetRowSetØ00__func__Ø000), unsafe.Pointer(str(1219)))
 69166  			crt.X__builtin_abort(tls)
 69167  		}
 69168  	}()
 69169  	func() {
 69170  		if (int32(_pMem.Xflags) & int32(32)) != int32(0) {
 69171  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70430), unsafe.Pointer(&_sqlite3VdbeMemSetRowSetØ00__func__Ø000), unsafe.Pointer(str(6629)))
 69172  			crt.X__builtin_abort(tls)
 69173  		}
 69174  	}()
 69175  	_sqlite3VdbeMemRelease(tls, _pMem)
 69176  	_pMem.XzMalloc = (*int8)(_sqlite3DbMallocRawNN(tls, _db, uint64(64)))
 69177  	if _db.XmallocFailed != 0 {
 69178  		_pMem.Xflags = uint16(1)
 69179  		_pMem.XszMalloc = int32(0)
 69180  		goto _5
 69181  	}
 69182  	func() {
 69183  		if _pMem.XzMalloc == nil {
 69184  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70437), unsafe.Pointer(&_sqlite3VdbeMemSetRowSetØ00__func__Ø000), unsafe.Pointer(str(88242)))
 69185  			crt.X__builtin_abort(tls)
 69186  		}
 69187  	}()
 69188  	_pMem.XszMalloc = _sqlite3DbMallocSize(tls, _db, unsafe.Pointer(_pMem.XzMalloc))
 69189  	*(**XRowSet)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pMem.Xu)))) = _sqlite3RowSetInit(tls, _db, unsafe.Pointer(_pMem.XzMalloc), uint32(_pMem.XszMalloc))
 69190  	func() {
 69191  		if (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer(&_pMem.Xu))) == nil {
 69192  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70440), unsafe.Pointer(&_sqlite3VdbeMemSetRowSetØ00__func__Ø000), unsafe.Pointer(str(88256)))
 69193  			crt.X__builtin_abort(tls)
 69194  		}
 69195  	}()
 69196  	_pMem.Xflags = uint16(32)
 69197  _5:
 69198  }
 69199  
 69200  var _sqlite3VdbeMemSetRowSetØ00__func__Ø000 [24]int8
 69201  
 69202  func init() {
 69203  	crt.Xstrncpy(nil, &_sqlite3VdbeMemSetRowSetØ00__func__Ø000[0], str(88275), 24)
 69204  }
 69205  
 69206  // C comment
 69207  //  /*
 69208  //  ** Turn bulk memory into a RowSet object.  N bytes of memory
 69209  //  ** are available at pSpace.  The db pointer is used as a memory context
 69210  //  ** for any subsequent allocations that need to occur.
 69211  //  ** Return a pointer to the new RowSet object.
 69212  //  **
 69213  //  ** It must be the case that N is sufficient to make a Rowset.  If not
 69214  //  ** an assertion fault occurs.
 69215  //  **
 69216  //  ** If N is larger than the minimum, use the surplus as an initial
 69217  //  ** allocation of entries available to be filled.
 69218  //  */
 69219  func _sqlite3RowSetInit(tls *crt.TLS, _db *Xsqlite3, _pSpace unsafe.Pointer, _N uint32) (r0 *XRowSet) {
 69220  	var _p *XRowSet
 69221  	func() {
 69222  		if _N < uint32(32) {
 69223  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46404), unsafe.Pointer(&_sqlite3RowSetInitØ00__func__Ø000), unsafe.Pointer(str(88299)))
 69224  			crt.X__builtin_abort(tls)
 69225  		}
 69226  	}()
 69227  	_p = (*XRowSet)(_pSpace)
 69228  	*(**TRowSetChunk)(unsafe.Pointer(&_p.XpChunk)) = nil
 69229  	*(**Xsqlite3)(unsafe.Pointer(&_p.Xdb)) = _db
 69230  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpEntry)) = nil
 69231  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpLast)) = nil
 69232  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpForest)) = nil
 69233  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpFresh)) = (*TRowSetEntry)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(uint32(32)) + uintptr(unsafe.Pointer(_p))))))
 69234  	_p.XnFresh = uint16((_N - uint32(32)) / uint32(16))
 69235  	_p.XrsFlags = uint16(1)
 69236  	_p.XiBatch = int32(0)
 69237  	return _p
 69238  }
 69239  
 69240  var _sqlite3RowSetInitØ00__func__Ø000 [18]int8
 69241  
 69242  func init() {
 69243  	crt.Xstrncpy(nil, &_sqlite3RowSetInitØ00__func__Ø000[0], str(88323), 18)
 69244  }
 69245  
 69246  // C comment
 69247  //  /*
 69248  //  ** Insert a new value into a RowSet.
 69249  //  **
 69250  //  ** The mallocFailed flag of the database connection is set if a
 69251  //  ** memory allocation fails.
 69252  //  */
 69253  func _sqlite3RowSetInsert(tls *crt.TLS, _p *XRowSet, _rowid int64) {
 69254  	var _pEntry, _pLast *TRowSetEntry
 69255  	func() {
 69256  		if _p == nil || (int32(_p.XrsFlags)&int32(2)) != int32(0) {
 69257  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46475), unsafe.Pointer(&_sqlite3RowSetInsertØ00__func__Ø000), unsafe.Pointer(str(88341)))
 69258  			crt.X__builtin_abort(tls)
 69259  		}
 69260  	}()
 69261  	_pEntry = _rowSetEntryAlloc(tls, _p)
 69262  	if _pEntry == nil {
 69263  		return
 69264  	}
 69265  	_pEntry.Xv = _rowid
 69266  	*(**TRowSetEntry)(unsafe.Pointer(&_pEntry.XpRight)) = nil
 69267  	_pLast = (*TRowSetEntry)(_p.XpLast)
 69268  	if _pLast == nil {
 69269  		goto _4
 69270  	}
 69271  	if _rowid <= _pLast.Xv {
 69272  		{
 69273  			p := &_p.XrsFlags
 69274  			*p = uint16(int32(*p) & int32(-2))
 69275  		}
 69276  	}
 69277  	*(**TRowSetEntry)(unsafe.Pointer(&_pLast.XpRight)) = _pEntry
 69278  	goto _6
 69279  _4:
 69280  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpEntry)) = _pEntry
 69281  _6:
 69282  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpLast)) = _pEntry
 69283  }
 69284  
 69285  var _sqlite3RowSetInsertØ00__func__Ø000 [20]int8
 69286  
 69287  func init() {
 69288  	crt.Xstrncpy(nil, &_sqlite3RowSetInsertØ00__func__Ø000[0], str(88379), 20)
 69289  }
 69290  
 69291  // C comment
 69292  //  /*
 69293  //  ** Allocate a new RowSetEntry object that is associated with the
 69294  //  ** given RowSet.  Return a pointer to the new and completely uninitialized
 69295  //  ** objected.
 69296  //  **
 69297  //  ** In an OOM situation, the RowSet.db->mallocFailed flag is set and this
 69298  //  ** routine returns NULL.
 69299  //  */
 69300  func _rowSetEntryAlloc(tls *crt.TLS, _p *XRowSet) (r0 *TRowSetEntry) {
 69301  	var _1_pNew *TRowSetChunk
 69302  	func() {
 69303  		if _p == nil {
 69304  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46446), unsafe.Pointer(&_rowSetEntryAllocØ00__func__Ø000), unsafe.Pointer(str(807)))
 69305  			crt.X__builtin_abort(tls)
 69306  		}
 69307  	}()
 69308  	if int32(_p.XnFresh) != int32(0) {
 69309  		goto _2
 69310  	}
 69311  	_1_pNew = (*TRowSetChunk)(_sqlite3DbMallocRawNN(tls, (*Xsqlite3)(_p.Xdb), uint64(1012)))
 69312  	if _1_pNew == nil {
 69313  		return nil
 69314  	}
 69315  	*(**TRowSetChunk)(unsafe.Pointer(&_1_pNew.XpNextChunk)) = (*TRowSetChunk)(_p.XpChunk)
 69316  	*(**TRowSetChunk)(unsafe.Pointer(&_p.XpChunk)) = _1_pNew
 69317  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpFresh)) = (*TRowSetEntry)(unsafe.Pointer(&_1_pNew.XaEntry))
 69318  	_p.XnFresh = uint16(63)
 69319  _2:
 69320  	_p.XnFresh -= 1
 69321  	return postInc93((**TRowSetEntry)(unsafe.Pointer(&_p.XpFresh)), 16)
 69322  }
 69323  
 69324  var _rowSetEntryAllocØ00__func__Ø000 [17]int8
 69325  
 69326  func init() {
 69327  	crt.Xstrncpy(nil, &_rowSetEntryAllocØ00__func__Ø000[0], str(88399), 17)
 69328  }
 69329  
 69330  // C comment
 69331  //  /*
 69332  //  ** Extract the smallest element from the RowSet.
 69333  //  ** Write the element into *pRowid.  Return 1 on success.  Return
 69334  //  ** 0 if the RowSet is already empty.
 69335  //  **
 69336  //  ** After this routine has been called, the sqlite3RowSetInsert()
 69337  //  ** routine may not be called again.
 69338  //  **
 69339  //  ** This routine may not be called after sqlite3RowSetTest() has
 69340  //  ** been used.  Older versions of RowSet allowed that, but as the
 69341  //  ** capability was not used by the code generator, it was removed
 69342  //  ** for code economy.
 69343  //  */
 69344  func _sqlite3RowSetNext(tls *crt.TLS, _p *XRowSet, _pRowid *int64) (r0 int32) {
 69345  	func() {
 69346  		if _p == nil {
 69347  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46669), unsafe.Pointer(&_sqlite3RowSetNextØ00__func__Ø000), unsafe.Pointer(str(807)))
 69348  			crt.X__builtin_abort(tls)
 69349  		}
 69350  	}()
 69351  	func() {
 69352  		if (*TRowSetEntry)(_p.XpForest) != nil {
 69353  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46670), unsafe.Pointer(&_sqlite3RowSetNextØ00__func__Ø000), unsafe.Pointer(str(88416)))
 69354  			crt.X__builtin_abort(tls)
 69355  		}
 69356  	}()
 69357  	if (int32(_p.XrsFlags) & int32(2)) != int32(0) {
 69358  		goto _4
 69359  	}
 69360  	if (int32(_p.XrsFlags) & int32(1)) == int32(0) {
 69361  		*(**TRowSetEntry)(unsafe.Pointer(&_p.XpEntry)) = _rowSetEntrySort(tls, (*TRowSetEntry)(_p.XpEntry))
 69362  	}
 69363  	{
 69364  		p := &_p.XrsFlags
 69365  		*p = uint16(int32(*p) | int32(3))
 69366  	}
 69367  _4:
 69368  	if _p.XpEntry == nil {
 69369  		goto _6
 69370  	}
 69371  	*_pRowid = (*TRowSetEntry)(_p.XpEntry).Xv
 69372  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpEntry)) = (*TRowSetEntry)((*TRowSetEntry)(_p.XpEntry).XpRight)
 69373  	if (*TRowSetEntry)(_p.XpEntry) == nil {
 69374  		_sqlite3RowSetClear(tls, _p)
 69375  	}
 69376  	return int32(1)
 69377  
 69378  _6:
 69379  	return int32(0)
 69380  }
 69381  
 69382  var _sqlite3RowSetNextØ00__func__Ø000 [18]int8
 69383  
 69384  func init() {
 69385  	crt.Xstrncpy(nil, &_sqlite3RowSetNextØ00__func__Ø000[0], str(88430), 18)
 69386  }
 69387  
 69388  func _rowSetEntrySort(tls *crt.TLS, _pIn *TRowSetEntry) (r0 *TRowSetEntry) {
 69389  	var _i uint32
 69390  	var _pNext *TRowSetEntry
 69391  	var _aBucket [40]*TRowSetEntry
 69392  	crt.Xmemset(tls, unsafe.Pointer(&_aBucket), int32(0), uint32(160))
 69393  _0:
 69394  	if _pIn == nil {
 69395  		goto _1
 69396  	}
 69397  	_pNext = (*TRowSetEntry)(_pIn.XpRight)
 69398  	*(**TRowSetEntry)(unsafe.Pointer(&_pIn.XpRight)) = nil
 69399  	_i = 0
 69400  _2:
 69401  	if (*elem94((**TRowSetEntry)(unsafe.Pointer(&_aBucket)), uintptr(_i))) == nil {
 69402  		goto _5
 69403  	}
 69404  	_pIn = _rowSetEntryMerge(tls, *elem94((**TRowSetEntry)(unsafe.Pointer(&_aBucket)), uintptr(_i)), _pIn)
 69405  	*elem94((**TRowSetEntry)(unsafe.Pointer(&_aBucket)), uintptr(_i)) = nil
 69406  	_i += 1
 69407  	goto _2
 69408  _5:
 69409  	*elem94((**TRowSetEntry)(unsafe.Pointer(&_aBucket)), uintptr(_i)) = _pIn
 69410  	_pIn = _pNext
 69411  	goto _0
 69412  _1:
 69413  	_pIn = *elem94((**TRowSetEntry)(unsafe.Pointer(&_aBucket)), 0)
 69414  	_i = uint32(1)
 69415  _6:
 69416  	if _i >= uint32(40) {
 69417  		goto _9
 69418  	}
 69419  	if (*elem94((**TRowSetEntry)(unsafe.Pointer(&_aBucket)), uintptr(_i))) == nil {
 69420  		goto _7
 69421  	}
 69422  	_pIn = func() *TRowSetEntry {
 69423  		if _pIn != nil {
 69424  			return _rowSetEntryMerge(tls, _pIn, *elem94((**TRowSetEntry)(unsafe.Pointer(&_aBucket)), uintptr(_i)))
 69425  		}
 69426  		return (*elem94((**TRowSetEntry)(unsafe.Pointer(&_aBucket)), uintptr(_i)))
 69427  	}()
 69428  _7:
 69429  	_i += 1
 69430  	goto _6
 69431  _9:
 69432  	return _pIn
 69433  
 69434  	_ = _aBucket
 69435  	panic(0)
 69436  }
 69437  
 69438  // C comment
 69439  //  /*
 69440  //  ** Merge two lists of RowSetEntry objects.  Remove duplicates.
 69441  //  **
 69442  //  ** The input lists are connected via pRight pointers and are
 69443  //  ** assumed to each already be in sorted order.
 69444  //  */
 69445  func _rowSetEntryMerge(tls *crt.TLS, _pA *TRowSetEntry, _pB *TRowSetEntry) (r0 *TRowSetEntry) {
 69446  	var _head TRowSetEntry
 69447  	var _pTail *TRowSetEntry
 69448  	_pTail = &_head
 69449  	func() {
 69450  		if _pA == nil || _pB == nil {
 69451  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46509), unsafe.Pointer(&_rowSetEntryMergeØ00__func__Ø000), unsafe.Pointer(str(16574)))
 69452  			crt.X__builtin_abort(tls)
 69453  		}
 69454  	}()
 69455  _3:
 69456  	func() {
 69457  		if (*TRowSetEntry)(_pA.XpRight) != nil && _pA.Xv > ((*TRowSetEntry)(_pA.XpRight).Xv) {
 69458  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46511), unsafe.Pointer(&_rowSetEntryMergeØ00__func__Ø000), unsafe.Pointer(str(88448)))
 69459  			crt.X__builtin_abort(tls)
 69460  		}
 69461  	}()
 69462  	func() {
 69463  		if (*TRowSetEntry)(_pB.XpRight) != nil && _pB.Xv > ((*TRowSetEntry)(_pB.XpRight).Xv) {
 69464  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46512), unsafe.Pointer(&_rowSetEntryMergeØ00__func__Ø000), unsafe.Pointer(str(88486)))
 69465  			crt.X__builtin_abort(tls)
 69466  		}
 69467  	}()
 69468  	if _pA.Xv > _pB.Xv {
 69469  		goto _12
 69470  	}
 69471  	if _pA.Xv < _pB.Xv {
 69472  		_pTail = store93((**TRowSetEntry)(unsafe.Pointer(&_pTail.XpRight)), _pA)
 69473  	}
 69474  	_pA = (*TRowSetEntry)(_pA.XpRight)
 69475  	if _pA == nil {
 69476  		*(**TRowSetEntry)(unsafe.Pointer(&_pTail.XpRight)) = _pB
 69477  		goto _5
 69478  	}
 69479  	goto _15
 69480  _12:
 69481  	_pTail = store93((**TRowSetEntry)(unsafe.Pointer(&_pTail.XpRight)), _pB)
 69482  	_pB = (*TRowSetEntry)(_pB.XpRight)
 69483  	if _pB == nil {
 69484  		*(**TRowSetEntry)(unsafe.Pointer(&_pTail.XpRight)) = _pA
 69485  		goto _5
 69486  	}
 69487  _15:
 69488  	goto _3
 69489  _5:
 69490  	return (*TRowSetEntry)(_head.XpRight)
 69491  }
 69492  
 69493  var _rowSetEntryMergeØ00__func__Ø000 [17]int8
 69494  
 69495  func init() {
 69496  	crt.Xstrncpy(nil, &_rowSetEntryMergeØ00__func__Ø000[0], str(88524), 17)
 69497  }
 69498  
 69499  // C comment
 69500  //  /*
 69501  //  ** Check to see if element iRowid was inserted into the rowset as
 69502  //  ** part of any insert batch prior to iBatch.  Return 1 or 0.
 69503  //  **
 69504  //  ** If this is the first test of a new batch and if there exist entries
 69505  //  ** on pRowSet->pEntry, then sort those entries into the forest at
 69506  //  ** pRowSet->pForest so that they can be tested.
 69507  //  */
 69508  func _sqlite3RowSetTest(tls *crt.TLS, _pRowSet *XRowSet, _iBatch int32, _iRowid int64) (r0 int32) {
 69509  	var _p, _pTree, _6_pAux, _6_pTail *TRowSetEntry
 69510  	var _2_ppPrevTree **TRowSetEntry
 69511  	func() {
 69512  		if _pRowSet == nil || (int32(_pRowSet.XrsFlags)&int32(2)) != int32(0) {
 69513  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46706), unsafe.Pointer(&_sqlite3RowSetTestØ00__func__Ø000), unsafe.Pointer(str(88541)))
 69514  			crt.X__builtin_abort(tls)
 69515  		}
 69516  	}()
 69517  	if _iBatch == _pRowSet.XiBatch {
 69518  		goto _3
 69519  	}
 69520  	_p = (*TRowSetEntry)(_pRowSet.XpEntry)
 69521  	if _p == nil {
 69522  		goto _4
 69523  	}
 69524  	_2_ppPrevTree = (**TRowSetEntry)(unsafe.Pointer(&_pRowSet.XpForest))
 69525  	if (int32(_pRowSet.XrsFlags) & int32(1)) == int32(0) {
 69526  		_p = _rowSetEntrySort(tls, _p)
 69527  	}
 69528  	_pTree = (*TRowSetEntry)(_pRowSet.XpForest)
 69529  _6:
 69530  	if _pTree == nil {
 69531  		goto _9
 69532  	}
 69533  	_2_ppPrevTree = (**TRowSetEntry)(unsafe.Pointer(&_pTree.XpRight))
 69534  	if (*TRowSetEntry)(_pTree.XpLeft) == nil {
 69535  		*(**TRowSetEntry)(unsafe.Pointer(&_pTree.XpLeft)) = _rowSetListToTree(tls, _p)
 69536  		goto _9
 69537  	}
 69538  	_rowSetTreeToList(tls, (*TRowSetEntry)(_pTree.XpLeft), &_6_pAux, &_6_pTail)
 69539  	*(**TRowSetEntry)(unsafe.Pointer(&_pTree.XpLeft)) = nil
 69540  	_p = _rowSetEntryMerge(tls, _6_pAux, _p)
 69541  	_pTree = (*TRowSetEntry)(_pTree.XpRight)
 69542  	goto _6
 69543  _9:
 69544  	if _pTree != nil {
 69545  		goto _12
 69546  	}
 69547  	*_2_ppPrevTree = store93(&_pTree, _rowSetEntryAlloc(tls, _pRowSet))
 69548  	if _pTree != nil {
 69549  		_pTree.Xv = 0
 69550  		*(**TRowSetEntry)(unsafe.Pointer(&_pTree.XpRight)) = nil
 69551  		*(**TRowSetEntry)(unsafe.Pointer(&_pTree.XpLeft)) = _rowSetListToTree(tls, _p)
 69552  	}
 69553  _12:
 69554  	*(**TRowSetEntry)(unsafe.Pointer(&_pRowSet.XpEntry)) = nil
 69555  	*(**TRowSetEntry)(unsafe.Pointer(&_pRowSet.XpLast)) = nil
 69556  	{
 69557  		p := &_pRowSet.XrsFlags
 69558  		*p = uint16(int32(*p) | int32(1))
 69559  	}
 69560  _4:
 69561  	_pRowSet.XiBatch = _iBatch
 69562  _3:
 69563  	_pTree = (*TRowSetEntry)(_pRowSet.XpForest)
 69564  _14:
 69565  	if _pTree == nil {
 69566  		goto _17
 69567  	}
 69568  	_p = (*TRowSetEntry)(_pTree.XpLeft)
 69569  _18:
 69570  	if _p == nil {
 69571  		goto _19
 69572  	}
 69573  	if _p.Xv < _iRowid {
 69574  		_p = (*TRowSetEntry)(_p.XpRight)
 69575  		goto _23
 69576  	}
 69577  	if _p.Xv > _iRowid {
 69578  		_p = (*TRowSetEntry)(_p.XpLeft)
 69579  		goto _23
 69580  	}
 69581  	return int32(1)
 69582  
 69583  _23:
 69584  	goto _18
 69585  _19:
 69586  	_pTree = (*TRowSetEntry)(_pTree.XpRight)
 69587  	goto _14
 69588  _17:
 69589  	return int32(0)
 69590  }
 69591  
 69592  var _sqlite3RowSetTestØ00__func__Ø000 [18]int8
 69593  
 69594  func init() {
 69595  	crt.Xstrncpy(nil, &_sqlite3RowSetTestØ00__func__Ø000[0], str(88591), 18)
 69596  }
 69597  
 69598  // C comment
 69599  //  /*
 69600  //  ** Convert a sorted list of elements into a binary tree. Make the tree
 69601  //  ** as deep as it needs to be in order to contain the entire list.
 69602  //  */
 69603  func _rowSetListToTree(tls *crt.TLS, _pList *TRowSetEntry) (r0 *TRowSetEntry) {
 69604  	var _iDepth int32
 69605  	var _p, _pLeft *TRowSetEntry
 69606  	func() {
 69607  		if _pList == nil {
 69608  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46641), unsafe.Pointer(&_rowSetListToTreeØ00__func__Ø000), unsafe.Pointer(str(88609)))
 69609  			crt.X__builtin_abort(tls)
 69610  		}
 69611  	}()
 69612  	_p = _pList
 69613  	_pList = (*TRowSetEntry)(_p.XpRight)
 69614  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpLeft)) = store93((**TRowSetEntry)(unsafe.Pointer(&_p.XpRight)), nil)
 69615  	_iDepth = int32(1)
 69616  _2:
 69617  	if _pList == nil {
 69618  		goto _5
 69619  	}
 69620  	_pLeft = _p
 69621  	_p = _pList
 69622  	_pList = (*TRowSetEntry)(_p.XpRight)
 69623  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpLeft)) = _pLeft
 69624  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpRight)) = _rowSetNDeepTree(tls, &_pList, _iDepth)
 69625  	_iDepth += 1
 69626  	goto _2
 69627  _5:
 69628  	return _p
 69629  }
 69630  
 69631  var _rowSetListToTreeØ00__func__Ø000 [17]int8
 69632  
 69633  func init() {
 69634  	crt.Xstrncpy(nil, &_rowSetListToTreeØ00__func__Ø000[0], str(88618), 17)
 69635  }
 69636  
 69637  // C comment
 69638  //  /*
 69639  //  ** Convert a sorted list of elements (connected by pRight) into a binary
 69640  //  ** tree with depth of iDepth.  A depth of 1 means the tree contains a single
 69641  //  ** node taken from the head of *ppList.  A depth of 2 means a tree with
 69642  //  ** three nodes.  And so forth.
 69643  //  **
 69644  //  ** Use as many entries from the input list as required and update the
 69645  //  ** *ppList to point to the unused elements of the list.  If the input
 69646  //  ** list contains too few elements, then construct an incomplete tree
 69647  //  ** and leave *ppList set to NULL.
 69648  //  **
 69649  //  ** Return a pointer to the root of the constructed binary tree.
 69650  //  */
 69651  func _rowSetNDeepTree(tls *crt.TLS, _ppList **TRowSetEntry, _iDepth int32) (r0 *TRowSetEntry) {
 69652  	var _p, _pLeft *TRowSetEntry
 69653  	if (*_ppList) == nil {
 69654  		return nil
 69655  	}
 69656  	if _iDepth <= int32(1) {
 69657  		goto _1
 69658  	}
 69659  	_pLeft = _rowSetNDeepTree(tls, _ppList, _iDepth-int32(1))
 69660  	_p = *_ppList
 69661  	if _p == nil {
 69662  		return _pLeft
 69663  	}
 69664  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpLeft)) = _pLeft
 69665  	*_ppList = (*TRowSetEntry)(_p.XpRight)
 69666  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpRight)) = _rowSetNDeepTree(tls, _ppList, _iDepth-int32(1))
 69667  	goto _3
 69668  _1:
 69669  	_p = *_ppList
 69670  	*_ppList = (*TRowSetEntry)(_p.XpRight)
 69671  	*(**TRowSetEntry)(unsafe.Pointer(&_p.XpLeft)) = store93((**TRowSetEntry)(unsafe.Pointer(&_p.XpRight)), nil)
 69672  _3:
 69673  	return _p
 69674  }
 69675  
 69676  // C comment
 69677  //  /*
 69678  //  ** The input, pIn, is a binary tree (or subtree) of RowSetEntry objects.
 69679  //  ** Convert this tree into a linked list connected by the pRight pointers
 69680  //  ** and return pointers to the first and last elements of the new list.
 69681  //  */
 69682  func _rowSetTreeToList(tls *crt.TLS, _pIn *TRowSetEntry, _ppFirst **TRowSetEntry, _ppLast **TRowSetEntry) {
 69683  	var _1_p *TRowSetEntry
 69684  	func() {
 69685  		if _pIn == nil {
 69686  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46570), unsafe.Pointer(&_rowSetTreeToListØ00__func__Ø000), unsafe.Pointer(str(88635)))
 69687  			crt.X__builtin_abort(tls)
 69688  		}
 69689  	}()
 69690  	if _pIn.XpLeft != nil {
 69691  		_rowSetTreeToList(tls, (*TRowSetEntry)(_pIn.XpLeft), _ppFirst, &_1_p)
 69692  		*(**TRowSetEntry)(unsafe.Pointer(&_1_p.XpRight)) = _pIn
 69693  		goto _3
 69694  	}
 69695  	*_ppFirst = _pIn
 69696  _3:
 69697  	if _pIn.XpRight != nil {
 69698  		_rowSetTreeToList(tls, (*TRowSetEntry)(_pIn.XpRight), (**TRowSetEntry)(unsafe.Pointer(&_pIn.XpRight)), _ppLast)
 69699  		goto _5
 69700  	}
 69701  	*_ppLast = _pIn
 69702  _5:
 69703  	func() {
 69704  		if (*TRowSetEntry)((*_ppLast).XpRight) != nil {
 69705  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(46583), unsafe.Pointer(&_rowSetTreeToListØ00__func__Ø000), unsafe.Pointer(str(88642)))
 69706  			crt.X__builtin_abort(tls)
 69707  		}
 69708  	}()
 69709  }
 69710  
 69711  var _rowSetTreeToListØ00__func__Ø000 [17]int8
 69712  
 69713  func init() {
 69714  	crt.Xstrncpy(nil, &_rowSetTreeToListØ00__func__Ø000[0], str(88663), 17)
 69715  }
 69716  
 69717  // C comment
 69718  //  /*
 69719  //  ** Run a checkpoint on database iDb. This is a no-op if database iDb is
 69720  //  ** not currently open in WAL mode.
 69721  //  **
 69722  //  ** If a transaction is open on the database being checkpointed, this
 69723  //  ** function returns SQLITE_LOCKED and a checkpoint is not attempted. If
 69724  //  ** an error occurs while running the checkpoint, an SQLite error code is
 69725  //  ** returned (i.e. SQLITE_IOERR). Otherwise, SQLITE_OK.
 69726  //  **
 69727  //  ** The mutex on database handle db should be held by the caller. The mutex
 69728  //  ** associated with the specific b-tree being checkpointed is taken by
 69729  //  ** this function while the checkpoint is running.
 69730  //  **
 69731  //  ** If iDb is passed SQLITE_MAX_ATTACHED, then all attached databases are
 69732  //  ** checkpointed. If an error is encountered it is returned immediately -
 69733  //  ** no attempt is made to checkpoint any remaining databases.
 69734  //  **
 69735  //  ** Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART.
 69736  //  */
 69737  func _sqlite3Checkpoint(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _eMode int32, _pnLog *int32, _pnCkpt *int32) (r0 int32) {
 69738  	var _rc, _i, _bBusy int32
 69739  	_rc = int32(0)
 69740  	_bBusy = int32(0)
 69741  	func() {
 69742  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 69743  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142642), unsafe.Pointer(&_sqlite3CheckpointØ00__func__Ø000), unsafe.Pointer(str(881)))
 69744  			crt.X__builtin_abort(tls)
 69745  		}
 69746  	}()
 69747  	func() {
 69748  		if _pnLog != nil && (*_pnLog) != int32(-1) {
 69749  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142643), unsafe.Pointer(&_sqlite3CheckpointØ00__func__Ø000), unsafe.Pointer(str(88680)))
 69750  			crt.X__builtin_abort(tls)
 69751  		}
 69752  	}()
 69753  	func() {
 69754  		if _pnCkpt != nil && (*_pnCkpt) != int32(-1) {
 69755  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(142644), unsafe.Pointer(&_sqlite3CheckpointØ00__func__Ø000), unsafe.Pointer(str(88701)))
 69756  			crt.X__builtin_abort(tls)
 69757  		}
 69758  	}()
 69759  	_i = int32(0)
 69760  _8:
 69761  	if _i >= _db.XnDb || _rc != int32(0) {
 69762  		goto _12
 69763  	}
 69764  	if _i != _iDb && _iDb != int32(10) {
 69765  		goto _14
 69766  	}
 69767  	_rc = _sqlite3BtreeCheckpoint(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt), _eMode, _pnLog, _pnCkpt)
 69768  	_pnLog = nil
 69769  	_pnCkpt = nil
 69770  	if _rc == int32(5) {
 69771  		_bBusy = int32(1)
 69772  		_rc = int32(0)
 69773  	}
 69774  _14:
 69775  	_i += 1
 69776  	goto _8
 69777  _12:
 69778  	return func() int32 {
 69779  		if (_rc == int32(0)) && _bBusy != 0 {
 69780  			return int32(5)
 69781  		}
 69782  		return _rc
 69783  	}()
 69784  }
 69785  
 69786  var _sqlite3CheckpointØ00__func__Ø000 [18]int8
 69787  
 69788  func init() {
 69789  	crt.Xstrncpy(nil, &_sqlite3CheckpointØ00__func__Ø000[0], str(88724), 18)
 69790  }
 69791  
 69792  // C comment
 69793  //  /*
 69794  //  ** Run a checkpoint on the Btree passed as the first argument.
 69795  //  **
 69796  //  ** Return SQLITE_LOCKED if this or any other connection has an open
 69797  //  ** transaction on the shared-cache the argument Btree is connected to.
 69798  //  **
 69799  //  ** Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART.
 69800  //  */
 69801  func _sqlite3BtreeCheckpoint(tls *crt.TLS, _p *XBtree, _eMode int32, _pnLog *int32, _pnCkpt *int32) (r0 int32) {
 69802  	var _rc int32
 69803  	var _1_pBt *XBtShared
 69804  	_rc = int32(0)
 69805  	if _p == nil {
 69806  		goto _0
 69807  	}
 69808  	_1_pBt = (*XBtShared)(_p.XpBt)
 69809  	_sqlite3BtreeEnter(tls, _p)
 69810  	if int32(_1_pBt.XinTransaction) != int32(0) {
 69811  		_rc = int32(6)
 69812  		goto _2
 69813  	}
 69814  	_rc = _sqlite3PagerCheckpoint(tls, (*XPager)(_1_pBt.XpPager), (*Xsqlite3)(_p.Xdb), _eMode, _pnLog, _pnCkpt)
 69815  _2:
 69816  	_sqlite3BtreeLeave(tls, _p)
 69817  _0:
 69818  	return _rc
 69819  }
 69820  
 69821  // C comment
 69822  //  /*
 69823  //  ** This function is called when the user invokes "PRAGMA wal_checkpoint",
 69824  //  ** "PRAGMA wal_blocking_checkpoint" or calls the sqlite3_wal_checkpoint()
 69825  //  ** or wal_blocking_checkpoint() API functions.
 69826  //  **
 69827  //  ** Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART.
 69828  //  */
 69829  func _sqlite3PagerCheckpoint(tls *crt.TLS, _pPager *XPager, _db *Xsqlite3, _eMode int32, _pnLog *int32, _pnCkpt *int32) (r0 int32) {
 69830  	var _rc int32
 69831  	_rc = int32(0)
 69832  	if _pPager.XpWal != nil {
 69833  		_rc = _sqlite3WalCheckpoint(tls, (*XWal)(_pPager.XpWal), _db, _eMode, func() func(*crt.TLS, unsafe.Pointer) int32 {
 69834  			if _eMode == int32(0) {
 69835  				return nil
 69836  			}
 69837  			return _pPager.XxBusyHandler
 69838  		}(), _pPager.XpBusyHandlerArg, int32(_pPager.XckptSyncFlags), _pPager.XpageSize, (*uint8)(unsafe.Pointer(_pPager.XpTmpSpace)), _pnLog, _pnCkpt)
 69839  	}
 69840  	return _rc
 69841  }
 69842  
 69843  // C comment
 69844  //  /*
 69845  //  ** Return TRUE if the pager is in a state where it is OK to change the
 69846  //  ** journalmode.  Journalmode changes can only happen when the database
 69847  //  ** is unmodified.
 69848  //  */
 69849  func _sqlite3PagerOkToChangeJournalMode(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 69850  	func() {
 69851  		if _assert_pager_state(tls, _pPager) == 0 {
 69852  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54187), unsafe.Pointer(&_sqlite3PagerOkToChangeJournalModeØ00__func__Ø000), unsafe.Pointer(str(10971)))
 69853  			crt.X__builtin_abort(tls)
 69854  		}
 69855  	}()
 69856  	if int32(_pPager.XeState) >= int32(3) {
 69857  		return int32(0)
 69858  	}
 69859  	if func() int32 {
 69860  		if ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xjfd).XpMethods) != nil) && (_pPager.XjournalOff > (0)) {
 69861  			return func() int32 {
 69862  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54189), unsafe.Pointer(&_sqlite3PagerOkToChangeJournalModeØ00__func__Ø000), unsafe.Pointer(str(4809)))
 69863  				crt.X__builtin_abort(tls)
 69864  				return int32(1)
 69865  			}()
 69866  		}
 69867  		return int32(0)
 69868  	}() != 0 {
 69869  		return int32(0)
 69870  	}
 69871  	return int32(1)
 69872  }
 69873  
 69874  var _sqlite3PagerOkToChangeJournalModeØ00__func__Ø000 [34]int8
 69875  
 69876  func init() {
 69877  	crt.Xstrncpy(nil, &_sqlite3PagerOkToChangeJournalModeØ00__func__Ø000[0], str(88742), 34)
 69878  }
 69879  
 69880  // C comment
 69881  //  /*
 69882  //  ** This function is called to close the connection to the log file prior
 69883  //  ** to switching from WAL to rollback mode.
 69884  //  **
 69885  //  ** Before closing the log file, this function attempts to take an
 69886  //  ** EXCLUSIVE lock on the database file. If this cannot be obtained, an
 69887  //  ** error (SQLITE_BUSY) is returned and the log connection is not closed.
 69888  //  ** If successful, the EXCLUSIVE lock is not released before returning.
 69889  //  */
 69890  func _sqlite3PagerCloseWal(tls *crt.TLS, _pPager *XPager, _db *Xsqlite3) (r0 int32) {
 69891  	var _rc, _1_logexists int32
 69892  	_rc = int32(0)
 69893  	func() {
 69894  		if int32(_pPager.XjournalMode) != int32(5) {
 69895  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54380), unsafe.Pointer(&_sqlite3PagerCloseWalØ00__func__Ø000), unsafe.Pointer(str(88776)))
 69896  			crt.X__builtin_abort(tls)
 69897  		}
 69898  	}()
 69899  	if _pPager.XpWal != nil {
 69900  		goto _2
 69901  	}
 69902  	_1_logexists = int32(0)
 69903  	_rc = _pagerLockDb(tls, _pPager, int32(1))
 69904  	if _rc == int32(0) {
 69905  		_rc = _sqlite3OsAccess(tls, (*Xsqlite3_vfs)(_pPager.XpVfs), _pPager.XzWal, int32(0), &_1_logexists)
 69906  	}
 69907  	if (_rc == int32(0)) && _1_logexists != 0 {
 69908  		_rc = _pagerOpenWal(tls, _pPager)
 69909  	}
 69910  _2:
 69911  	if _rc != int32(0) || _pPager.XpWal == nil {
 69912  		goto _7
 69913  	}
 69914  	_rc = _pagerExclusiveLock(tls, _pPager)
 69915  	if _rc != int32(0) {
 69916  		goto _8
 69917  	}
 69918  	_rc = _sqlite3WalClose(tls, (*XWal)(_pPager.XpWal), _db, int32(_pPager.XckptSyncFlags), _pPager.XpageSize, (*uint8)(unsafe.Pointer(_pPager.XpTmpSpace)))
 69919  	*(**XWal)(unsafe.Pointer(&_pPager.XpWal)) = nil
 69920  	_pagerFixMaplimit(tls, _pPager)
 69921  	if _rc != 0 && (_pPager.XexclusiveMode == 0) {
 69922  		_pagerUnlockDb(tls, _pPager, int32(1))
 69923  	}
 69924  _8:
 69925  _7:
 69926  	return _rc
 69927  }
 69928  
 69929  var _sqlite3PagerCloseWalØ00__func__Ø000 [21]int8
 69930  
 69931  func init() {
 69932  	crt.Xstrncpy(nil, &_sqlite3PagerCloseWalØ00__func__Ø000[0], str(88819), 21)
 69933  }
 69934  
 69935  // C comment
 69936  //  /*
 69937  //  ** Set the journal-mode for this pager. Parameter eMode must be one of:
 69938  //  **
 69939  //  **    PAGER_JOURNALMODE_DELETE
 69940  //  **    PAGER_JOURNALMODE_TRUNCATE
 69941  //  **    PAGER_JOURNALMODE_PERSIST
 69942  //  **    PAGER_JOURNALMODE_OFF
 69943  //  **    PAGER_JOURNALMODE_MEMORY
 69944  //  **    PAGER_JOURNALMODE_WAL
 69945  //  **
 69946  //  ** The journalmode is set to the value specified if the change is allowed.
 69947  //  ** The change may be disallowed for the following reasons:
 69948  //  **
 69949  //  **   *  An in-memory database can only have its journal_mode set to _OFF
 69950  //  **      or _MEMORY.
 69951  //  **
 69952  //  **   *  Temporary databases cannot have _WAL journalmode.
 69953  //  **
 69954  //  ** The returned indicate the current (possibly updated) journal-mode.
 69955  //  */
 69956  func _sqlite3PagerSetJournalMode(tls *crt.TLS, _pPager *XPager, _eMode int32) (r0 int32) {
 69957  	var _6_rc, _6_state int32
 69958  	var _eOld uint8
 69959  	_eOld = _pPager.XjournalMode
 69960  	_print_pager_state(tls, _pPager)
 69961  	func() {
 69962  		if _eMode != int32(0) && _eMode != int32(3) && _eMode != int32(1) && _eMode != int32(2) && _eMode != int32(5) && _eMode != int32(4) {
 69963  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54090), unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000), unsafe.Pointer(str(88840)))
 69964  			crt.X__builtin_abort(tls)
 69965  		}
 69966  	}()
 69967  	func() {
 69968  		if int32(_pPager.XtempFile) != int32(0) && _eMode == int32(5) {
 69969  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54101), unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000), unsafe.Pointer(str(89044)))
 69970  			crt.X__builtin_abort(tls)
 69971  		}
 69972  	}()
 69973  	if _pPager.XmemDb == 0 {
 69974  		goto _10
 69975  	}
 69976  	func() {
 69977  		if int32(_eOld) != int32(4) && int32(_eOld) != int32(2) {
 69978  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54107), unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000), unsafe.Pointer(str(89096)))
 69979  			crt.X__builtin_abort(tls)
 69980  		}
 69981  	}()
 69982  	if (_eMode != int32(4)) && (_eMode != int32(2)) {
 69983  		_eMode = int32(_eOld)
 69984  	}
 69985  _10:
 69986  	if _eMode == int32(_eOld) {
 69987  		goto _16
 69988  	}
 69989  	func() {
 69990  		if int32(_pPager.XeState) == int32(6) {
 69991  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54116), unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000), unsafe.Pointer(str(15019)))
 69992  			crt.X__builtin_abort(tls)
 69993  		}
 69994  	}()
 69995  	_pPager.XjournalMode = uint8(_eMode)
 69996  
 69997  	func() {
 69998  		if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.Xfd).XpMethods) == nil && _pPager.XexclusiveMode == 0 {
 69999  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54130), unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000), unsafe.Pointer(str(89158)))
 70000  			crt.X__builtin_abort(tls)
 70001  		}
 70002  	}()
 70003  	if _pPager.XexclusiveMode != 0 || (int32(_eOld)&int32(5)) != int32(1) || (_eMode&int32(1)) != int32(0) {
 70004  		goto _24
 70005  	}
 70006  	_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.Xjfd))
 70007  	if int32(_pPager.XeLock) >= int32(2) {
 70008  		_sqlite3OsDelete(tls, (*Xsqlite3_vfs)(_pPager.XpVfs), _pPager.XzJournal, int32(0))
 70009  		goto _26
 70010  	}
 70011  	_6_rc = int32(0)
 70012  	_6_state = int32(_pPager.XeState)
 70013  	func() {
 70014  		if _6_state != int32(0) && _6_state != int32(1) {
 70015  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54147), unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000), unsafe.Pointer(str(89202)))
 70016  			crt.X__builtin_abort(tls)
 70017  		}
 70018  	}()
 70019  	if _6_state == int32(0) {
 70020  		_6_rc = _sqlite3PagerSharedLock(tls, _pPager)
 70021  	}
 70022  	if int32(_pPager.XeState) == int32(1) {
 70023  		func() {
 70024  			if _6_rc != int32(0) {
 70025  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54152), unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000), unsafe.Pointer(str(14967)))
 70026  				crt.X__builtin_abort(tls)
 70027  			}
 70028  		}()
 70029  		_6_rc = _pagerLockDb(tls, _pPager, int32(2))
 70030  	}
 70031  	if _6_rc == int32(0) {
 70032  		_sqlite3OsDelete(tls, (*Xsqlite3_vfs)(_pPager.XpVfs), _pPager.XzJournal, int32(0))
 70033  	}
 70034  	if (_6_rc == int32(0)) && (_6_state == int32(1)) {
 70035  		_pagerUnlockDb(tls, _pPager, int32(1))
 70036  		goto _38
 70037  	}
 70038  	if _6_state == int32(0) {
 70039  		_pager_unlock(tls, _pPager)
 70040  	}
 70041  _38:
 70042  	func() {
 70043  		if _6_state != int32(_pPager.XeState) {
 70044  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54163), unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000), unsafe.Pointer(str(89243)))
 70045  			crt.X__builtin_abort(tls)
 70046  		}
 70047  	}()
 70048  _26:
 70049  	goto _42
 70050  _24:
 70051  	if _eMode == int32(2) {
 70052  		_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.Xjfd))
 70053  	}
 70054  _42:
 70055  _16:
 70056  	return int32(_pPager.XjournalMode)
 70057  }
 70058  
 70059  // C comment
 70060  //  /*
 70061  //  ** Return a pointer to a human readable string in a static buffer
 70062  //  ** containing the state of the Pager object passed as an argument. This
 70063  //  ** is intended to be used within debuggers. For example, as an alternative
 70064  //  ** to "print *pPager" in gdb:
 70065  //  **
 70066  //  ** (gdb) printf "%s", print_pager_state(pPager)
 70067  //  */
 70068  func _print_pager_state(tls *crt.TLS, _p *XPager) (r0 *int8) {
 70069  	Xsqlite3_snprintf(tls, int32(1024), (*int8)(unsafe.Pointer(&_print_pager_stateØ00zRetØ001)), str(89265), unsafe.Pointer(_p.XzFilename), unsafe.Pointer(func() *int8 {
 70070  		if int32(_p.XeState) == int32(0) {
 70071  			return str(89543)
 70072  		}
 70073  		return func() *int8 {
 70074  			if int32(_p.XeState) == int32(1) {
 70075  				return str(89548)
 70076  			}
 70077  			return func() *int8 {
 70078  				if int32(_p.XeState) == int32(2) {
 70079  					return str(89555)
 70080  				}
 70081  				return func() *int8 {
 70082  					if int32(_p.XeState) == int32(3) {
 70083  						return str(89569)
 70084  					}
 70085  					return func() *int8 {
 70086  						if int32(_p.XeState) == int32(4) {
 70087  							return str(89585)
 70088  						}
 70089  						return func() *int8 {
 70090  							if int32(_p.XeState) == int32(5) {
 70091  								return str(89598)
 70092  							}
 70093  							return func() *int8 {
 70094  								if int32(_p.XeState) == int32(6) {
 70095  									return str(89614)
 70096  								}
 70097  								return str(89620)
 70098  							}()
 70099  						}()
 70100  					}()
 70101  				}()
 70102  			}()
 70103  		}()
 70104  	}()), _p.XerrCode, unsafe.Pointer(func() *int8 {
 70105  		if int32(_p.XeLock) == int32(0) {
 70106  			return str(89628)
 70107  		}
 70108  		return func() *int8 {
 70109  			if int32(_p.XeLock) == int32(2) {
 70110  				return str(89636)
 70111  			}
 70112  			return func() *int8 {
 70113  				if int32(_p.XeLock) == int32(4) {
 70114  					return str(24975)
 70115  				}
 70116  				return func() *int8 {
 70117  					if int32(_p.XeLock) == int32(1) {
 70118  						return str(89645)
 70119  					}
 70120  					return func() *int8 {
 70121  						if int32(_p.XeLock) == int32(5) {
 70122  							return str(89652)
 70123  						}
 70124  						return str(89620)
 70125  					}()
 70126  				}()
 70127  			}()
 70128  		}()
 70129  	}()), unsafe.Pointer(func() *int8 {
 70130  		if _p.XexclusiveMode != 0 {
 70131  			return str(89660)
 70132  		}
 70133  		return str(89670)
 70134  	}()), unsafe.Pointer(func() *int8 {
 70135  		if int32(_p.XjournalMode) == int32(4) {
 70136  			return str(89677)
 70137  		}
 70138  		return func() *int8 {
 70139  			if int32(_p.XjournalMode) == int32(2) {
 70140  				return str(89684)
 70141  			}
 70142  			return func() *int8 {
 70143  				if int32(_p.XjournalMode) == int32(0) {
 70144  					return str(89688)
 70145  				}
 70146  				return func() *int8 {
 70147  					if int32(_p.XjournalMode) == int32(1) {
 70148  						return str(89695)
 70149  					}
 70150  					return func() *int8 {
 70151  						if int32(_p.XjournalMode) == int32(3) {
 70152  							return str(89703)
 70153  						}
 70154  						return func() *int8 {
 70155  							if int32(_p.XjournalMode) == int32(5) {
 70156  								return str(89712)
 70157  							}
 70158  							return str(89620)
 70159  						}()
 70160  					}()
 70161  				}()
 70162  			}()
 70163  		}()
 70164  	}()), int32(_p.XtempFile), int32(_p.XmemDb), int32(_p.XuseJournal), _p.XjournalOff, _p.XjournalHdr, int32(_p.XdbSize), int32(_p.XdbOrigSize), int32(_p.XdbFileSize))
 70165  	return (*int8)(unsafe.Pointer(&_print_pager_stateØ00zRetØ001))
 70166  }
 70167  
 70168  var _print_pager_stateØ00zRetØ001 [1024]int8
 70169  
 70170  var _sqlite3PagerSetJournalModeØ00__func__Ø000 [27]int8
 70171  
 70172  func init() {
 70173  	crt.Xstrncpy(nil, &_sqlite3PagerSetJournalModeØ00__func__Ø000[0], str(89716), 27)
 70174  }
 70175  
 70176  // C comment
 70177  //  /*
 70178  //  ** Set both the "read version" (single byte at byte offset 18) and
 70179  //  ** "write version" (single byte at byte offset 19) fields in the database
 70180  //  ** header to iVersion.
 70181  //  */
 70182  func _sqlite3BtreeSetVersion(tls *crt.TLS, _pBtree *XBtree, _iVersion int32) (r0 int32) {
 70183  	var _rc int32
 70184  	var _1_aData *uint8
 70185  	var _pBt *XBtShared
 70186  	_pBt = (*XBtShared)(_pBtree.XpBt)
 70187  	func() {
 70188  		if _iVersion != int32(1) && _iVersion != int32(2) {
 70189  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68831), unsafe.Pointer(&_sqlite3BtreeSetVersionØ00__func__Ø000), unsafe.Pointer(str(89743)))
 70190  			crt.X__builtin_abort(tls)
 70191  		}
 70192  	}()
 70193  	{
 70194  		p := &_pBt.XbtsFlags
 70195  		*p = uint16(int32(*p) & int32(-17))
 70196  	}
 70197  	if _iVersion == int32(1) {
 70198  		{
 70199  			p := &_pBt.XbtsFlags
 70200  			*p = uint16(int32(*p) | int32(16))
 70201  		}
 70202  	}
 70203  	_rc = _sqlite3BtreeBeginTrans(tls, _pBtree, int32(0))
 70204  	if _rc != int32(0) {
 70205  		goto _4
 70206  	}
 70207  	_1_aData = (*XMemPage)(_pBt.XpPage1).XaData
 70208  	if int32(*elem15(_1_aData, uintptr(18))) == int32(uint8(_iVersion)) && int32(*elem15(_1_aData, uintptr(19))) == int32(uint8(_iVersion)) {
 70209  		goto _6
 70210  	}
 70211  	_rc = _sqlite3BtreeBeginTrans(tls, _pBtree, int32(2))
 70212  	if _rc != int32(0) {
 70213  		goto _7
 70214  	}
 70215  	_rc = _sqlite3PagerWrite(tls, (*XPgHdr)((*XMemPage)(_pBt.XpPage1).XpDbPage))
 70216  	if _rc == int32(0) {
 70217  		*elem15(_1_aData, uintptr(18)) = uint8(_iVersion)
 70218  		*elem15(_1_aData, uintptr(19)) = uint8(_iVersion)
 70219  	}
 70220  _7:
 70221  _6:
 70222  _4:
 70223  	{
 70224  		p := &_pBt.XbtsFlags
 70225  		*p = uint16(int32(*p) & int32(-17))
 70226  	}
 70227  	return _rc
 70228  }
 70229  
 70230  var _sqlite3BtreeSetVersionØ00__func__Ø000 [23]int8
 70231  
 70232  func init() {
 70233  	crt.Xstrncpy(nil, &_sqlite3BtreeSetVersionØ00__func__Ø000[0], str(89770), 23)
 70234  }
 70235  
 70236  // C comment
 70237  //  /*
 70238  //  ** Parameter eMode must be one of the PAGER_JOURNALMODE_XXX constants
 70239  //  ** defined in pager.h. This function returns the associated lowercase
 70240  //  ** journal-mode name.
 70241  //  */
 70242  func _sqlite3JournalModename(tls *crt.TLS, _eMode int32) (r0 *int8) {
 70243  	func() {
 70244  		if _eMode < int32(0) || _eMode > int32(6) {
 70245  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113499), unsafe.Pointer(&_sqlite3JournalModenameØ00__func__Ø000), unsafe.Pointer(str(89793)))
 70246  			crt.X__builtin_abort(tls)
 70247  		}
 70248  	}()
 70249  	if _eMode == int32(6) {
 70250  		return nil
 70251  	}
 70252  	return *elem0((**int8)(unsafe.Pointer(&_sqlite3JournalModenameØ00azModeNameØ001)), uintptr(_eMode))
 70253  }
 70254  
 70255  var _sqlite3JournalModenameØ00__func__Ø000 [23]int8
 70256  
 70257  func init() {
 70258  	crt.Xstrncpy(nil, &_sqlite3JournalModenameØ00__func__Ø000[0], str(89834), 23)
 70259  }
 70260  
 70261  var _sqlite3JournalModenameØ00azModeNameØ001 [6]*int8
 70262  
 70263  func init() {
 70264  	_sqlite3JournalModenameØ00azModeNameØ001 = [6]*int8{str(89688), str(89695), str(89684), str(89703), str(89677), str(89712)}
 70265  }
 70266  
 70267  // C comment
 70268  //  /*
 70269  //  ** This routine implements the OP_Vacuum opcode of the VDBE.
 70270  //  */
 70271  func _sqlite3RunVacuum(tls *crt.TLS, _pzErrMsg **int8, _db *Xsqlite3, _iDb int32) (r0 int32) {
 70272  	var _rc, _saved_flags, _saved_nChange, _saved_nTotalChange, _isMemDb, _nRes, _nDb, _5_i int32
 70273  	var _5_meta uint32
 70274  	var _zDbMain *int8
 70275  	var _saved_mTrace uint8
 70276  	var _pMain, _pTemp *XBtree
 70277  	var _pDb *XDb
 70278  	_rc = int32(0)
 70279  	_pDb = nil
 70280  	if _db.XautoCommit == 0 {
 70281  		_sqlite3SetString(tls, _pzErrMsg, _db, str(89857))
 70282  		return int32(1)
 70283  	}
 70284  	if _db.XnVdbeActive > int32(1) {
 70285  		_sqlite3SetString(tls, _pzErrMsg, _db, str(89897))
 70286  		return int32(1)
 70287  	}
 70288  	_saved_flags = _db.Xflags
 70289  	_saved_nChange = _db.XnChange
 70290  	_saved_nTotalChange = _db.XnTotalChange
 70291  	_saved_mTrace = _db.XmTrace
 70292  	_db.Xflags |= int32(270542848)
 70293  	_db.Xflags &= int32(-655489)
 70294  	_db.XmTrace = 0
 70295  	_zDbMain = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
 70296  	_pMain = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpBt)
 70297  	_isMemDb = _sqlite3PagerIsMemdb(tls, _sqlite3BtreePager(tls, _pMain))
 70298  	_nDb = _db.XnDb
 70299  	_rc = _execSql(tls, _db, _pzErrMsg, str(89940))
 70300  	if _rc != int32(0) {
 70301  		goto _end_of_vacuum
 70302  	}
 70303  	func() {
 70304  		if (_db.XnDb - int32(1)) != _nDb {
 70305  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124801), unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000), unsafe.Pointer(str(89961)))
 70306  			crt.X__builtin_abort(tls)
 70307  		}
 70308  	}()
 70309  	_pDb = elem27((*XDb)(_db.XaDb), uintptr(_nDb))
 70310  	func() {
 70311  		if crt.Xstrcmp(tls, _pDb.XzDbSName, str(89978)) != int32(0) {
 70312  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124803), unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000), unsafe.Pointer(str(89988)))
 70313  			crt.X__builtin_abort(tls)
 70314  		}
 70315  	}()
 70316  	_pTemp = (*XBtree)(_pDb.XpBt)
 70317  	_sqlite3BtreeCommit(tls, _pTemp)
 70318  	_nRes = _sqlite3BtreeGetOptimalReserve(tls, _pMain)
 70319  	_sqlite3BtreeSetCacheSize(tls, _pTemp, (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema).Xcache_size)
 70320  	_sqlite3BtreeSetSpillSize(tls, _pTemp, _sqlite3BtreeSetSpillSize(tls, _pMain, int32(0)))
 70321  	_sqlite3BtreeSetPagerFlags(tls, _pTemp, uint32(33))
 70322  	_rc = _execSql(tls, _db, _pzErrMsg, str(24938))
 70323  	if _rc != int32(0) {
 70324  		goto _end_of_vacuum
 70325  	}
 70326  	_rc = _sqlite3BtreeBeginTrans(tls, _pMain, int32(2))
 70327  	if _rc != int32(0) {
 70328  		goto _end_of_vacuum
 70329  	}
 70330  	if _sqlite3PagerGetJournalMode(tls, _sqlite3BtreePager(tls, _pMain)) == int32(5) {
 70331  		_db.XnextPagesize = int32(0)
 70332  	}
 70333  	if (_sqlite3BtreeSetPageSize(tls, _pTemp, _sqlite3BtreeGetPageSize(tls, _pMain), _nRes, int32(0)) != 0 || ((_isMemDb == 0) && _sqlite3BtreeSetPageSize(tls, _pTemp, _db.XnextPagesize, _nRes, int32(0)) != 0)) || func() int32 {
 70334  		if _db.XmallocFailed != 0 {
 70335  			return func() int32 {
 70336  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124846), unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000), unsafe.Pointer(str(4809)))
 70337  				crt.X__builtin_abort(tls)
 70338  				return int32(1)
 70339  			}()
 70340  		}
 70341  		return int32(0)
 70342  	}() != 0 {
 70343  		_rc = _sqlite3NomemError(tls, int32(124848))
 70344  		goto _end_of_vacuum
 70345  	}
 70346  	_sqlite3BtreeSetAutoVacuum(tls, _pTemp, func() int32 {
 70347  		if int32(_db.XnextAutovac) >= int32(0) {
 70348  			return int32(_db.XnextAutovac)
 70349  		}
 70350  		return _sqlite3BtreeGetAutoVacuum(tls, _pMain)
 70351  	}())
 70352  	_db.Xinit.XiDb = uint8(_nDb)
 70353  	_rc = _execSqlF(tls, _db, _pzErrMsg, str(90025), unsafe.Pointer(_zDbMain))
 70354  	if _rc != int32(0) {
 70355  		goto _end_of_vacuum
 70356  	}
 70357  	_rc = _execSqlF(tls, _db, _pzErrMsg, str(90133), unsafe.Pointer(_zDbMain))
 70358  	if _rc != int32(0) {
 70359  		goto _end_of_vacuum
 70360  	}
 70361  	_db.Xinit.XiDb = 0
 70362  	_rc = _execSqlF(tls, _db, _pzErrMsg, str(90206), unsafe.Pointer(_zDbMain))
 70363  	func() {
 70364  		if (_db.Xflags & int32(268435456)) == int32(0) {
 70365  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124887), unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000), unsafe.Pointer(str(90357)))
 70366  			crt.X__builtin_abort(tls)
 70367  		}
 70368  	}()
 70369  	_db.Xflags &= int32(-268435457)
 70370  	if _rc != int32(0) {
 70371  		goto _end_of_vacuum
 70372  	}
 70373  	_rc = _execSqlF(tls, _db, _pzErrMsg, str(90388), unsafe.Pointer(_zDbMain))
 70374  	if _rc != 0 {
 70375  		goto _end_of_vacuum
 70376  	}
 70377  	func() {
 70378  		if int32(1) != _sqlite3BtreeIsInTrans(tls, _pTemp) {
 70379  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124929), unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000), unsafe.Pointer(str(90518)))
 70380  			crt.X__builtin_abort(tls)
 70381  		}
 70382  	}()
 70383  	func() {
 70384  		if int32(1) != _sqlite3BtreeIsInTrans(tls, _pMain) {
 70385  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124930), unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000), unsafe.Pointer(str(90550)))
 70386  			crt.X__builtin_abort(tls)
 70387  		}
 70388  	}()
 70389  	_5_i = int32(0)
 70390  _28:
 70391  	if _5_i >= int32(10) {
 70392  		goto _31
 70393  	}
 70394  	_sqlite3BtreeGetMeta(tls, _pMain, int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3RunVacuumØ00aCopyØ001)), uintptr(_5_i))), &_5_meta)
 70395  	_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)))))
 70396  	if func() int32 {
 70397  		if _rc != int32(0) {
 70398  			return func() int32 {
 70399  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124938), unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000), unsafe.Pointer(str(4809)))
 70400  				crt.X__builtin_abort(tls)
 70401  				return int32(1)
 70402  			}()
 70403  		}
 70404  		return int32(0)
 70405  	}() != 0 {
 70406  		goto _end_of_vacuum
 70407  	}
 70408  	_5_i += int32(2)
 70409  	goto _28
 70410  _31:
 70411  	_rc = _sqlite3BtreeCopyFile(tls, _pMain, _pTemp)
 70412  	if _rc != int32(0) {
 70413  		goto _end_of_vacuum
 70414  	}
 70415  	_rc = _sqlite3BtreeCommit(tls, _pTemp)
 70416  	if _rc != int32(0) {
 70417  		goto _end_of_vacuum
 70418  	}
 70419  	_sqlite3BtreeSetAutoVacuum(tls, _pMain, _sqlite3BtreeGetAutoVacuum(tls, _pTemp))
 70420  	func() {
 70421  		if _rc != int32(0) {
 70422  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124950), unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000), unsafe.Pointer(str(14967)))
 70423  			crt.X__builtin_abort(tls)
 70424  		}
 70425  	}()
 70426  	_rc = _sqlite3BtreeSetPageSize(tls, _pMain, _sqlite3BtreeGetPageSize(tls, _pTemp), _nRes, int32(1))
 70427  _end_of_vacuum:
 70428  	_db.Xinit.XiDb = 0
 70429  	_db.Xflags = _saved_flags
 70430  	_db.XnChange = _saved_nChange
 70431  	_db.XnTotalChange = _saved_nTotalChange
 70432  	_db.XmTrace = _saved_mTrace
 70433  	_sqlite3BtreeSetPageSize(tls, _pMain, int32(-1), int32(-1), int32(1))
 70434  	_db.XautoCommit = uint8(1)
 70435  	if _pDb != nil {
 70436  		_sqlite3BtreeClose(tls, (*XBtree)(_pDb.XpBt))
 70437  		*(**XBtree)(unsafe.Pointer(&_pDb.XpBt)) = nil
 70438  		*(**XSchema)(unsafe.Pointer(&_pDb.XpSchema)) = nil
 70439  	}
 70440  	_sqlite3ResetAllSchemasOfConnection(tls, _db)
 70441  	return _rc
 70442  }
 70443  
 70444  // C comment
 70445  //  /*
 70446  //  ** Execute zSql on database db.
 70447  //  **
 70448  //  ** If zSql returns rows, then each row will have exactly one
 70449  //  ** column.  (This will only happen if zSql begins with "SELECT".)
 70450  //  ** Take each row of result and call execSql() again recursively.
 70451  //  **
 70452  //  ** The execSqlF() routine does the same thing, except it accepts
 70453  //  ** a format string as its third argument
 70454  //  */
 70455  func _execSql(tls *crt.TLS, _db *Xsqlite3, _pzErrMsg **int8, _zSql *int8) (r0 int32) {
 70456  	var _rc int32
 70457  	var _1_zSubSql *int8
 70458  	var _pStmt unsafe.Pointer
 70459  	_rc = Xsqlite3_prepare_v2(tls, _db, _zSql, int32(-1), &_pStmt, nil)
 70460  	if _rc != int32(0) {
 70461  		return _rc
 70462  	}
 70463  _0:
 70464  	if int32(100) != store2(&_rc, Xsqlite3_step(tls, _pStmt)) {
 70465  		goto _2
 70466  	}
 70467  	_1_zSubSql = (*int8)(unsafe.Pointer(Xsqlite3_column_text(tls, _pStmt, int32(0))))
 70468  	func() {
 70469  		if Xsqlite3_strnicmp(tls, _zSql, str(25657), int32(6)) != int32(0) {
 70470  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124657), unsafe.Pointer(&_execSqlØ00__func__Ø000), unsafe.Pointer(str(90582)))
 70471  			crt.X__builtin_abort(tls)
 70472  		}
 70473  	}()
 70474  	if _1_zSubSql == nil {
 70475  		goto _5
 70476  	}
 70477  	func() {
 70478  		if int32(*elem1(_1_zSubSql, 0)) == int32(83) {
 70479  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124659), unsafe.Pointer(&_execSqlØ00__func__Ø000), unsafe.Pointer(str(90619)))
 70480  			crt.X__builtin_abort(tls)
 70481  		}
 70482  	}()
 70483  	_rc = _execSql(tls, _db, _pzErrMsg, _1_zSubSql)
 70484  	if _rc != int32(0) {
 70485  		goto _2
 70486  	}
 70487  _5:
 70488  	goto _0
 70489  _2:
 70490  	func() {
 70491  		if _rc == int32(100) {
 70492  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124664), unsafe.Pointer(&_execSqlØ00__func__Ø000), unsafe.Pointer(str(90635)))
 70493  			crt.X__builtin_abort(tls)
 70494  		}
 70495  	}()
 70496  	if _rc == int32(101) {
 70497  		_rc = int32(0)
 70498  	}
 70499  	if _rc != 0 {
 70500  		_sqlite3SetString(tls, _pzErrMsg, _db, Xsqlite3_errmsg(tls, _db))
 70501  	}
 70502  	Xsqlite3_finalize(tls, _pStmt)
 70503  	return _rc
 70504  }
 70505  
 70506  var _execSqlØ00__func__Ø000 [8]int8
 70507  
 70508  func init() {
 70509  	crt.Xstrncpy(nil, &_execSqlØ00__func__Ø000[0], str(90650), 8)
 70510  }
 70511  
 70512  var _sqlite3RunVacuumØ00__func__Ø000 [17]int8
 70513  
 70514  func init() {
 70515  	crt.Xstrncpy(nil, &_sqlite3RunVacuumØ00__func__Ø000[0], str(90658), 17)
 70516  }
 70517  
 70518  // C comment
 70519  //  /*
 70520  //  ** Return the number of bytes of space at the end of every page that
 70521  //  ** are intentually left unused.  This is the "reserved" space that is
 70522  //  ** sometimes used by extensions.
 70523  //  **
 70524  //  ** If SQLITE_HAS_MUTEX is defined then the number returned is the
 70525  //  ** greater of the current reserved space and the maximum requested
 70526  //  ** reserve space.
 70527  //  */
 70528  func _sqlite3BtreeGetOptimalReserve(tls *crt.TLS, _p *XBtree) (r0 int32) {
 70529  	var _n int32
 70530  	_sqlite3BtreeEnter(tls, _p)
 70531  	_n = _sqlite3BtreeGetReserveNoMutex(tls, _p)
 70532  	_sqlite3BtreeLeave(tls, _p)
 70533  	return _n
 70534  }
 70535  
 70536  // C comment
 70537  //  /*
 70538  //  ** Change the "spill" limit on the number of pages in the cache.
 70539  //  ** If the number of pages exceeds this limit during a write transaction,
 70540  //  ** the pager might attempt to "spill" pages to the journal early in
 70541  //  ** order to free up memory.
 70542  //  **
 70543  //  ** The value returned is the current spill size.  If zero is passed
 70544  //  ** as an argument, no changes are made to the spill size setting, so
 70545  //  ** using mxPage of 0 is a way to query the current spill size.
 70546  //  */
 70547  func _sqlite3BtreeSetSpillSize(tls *crt.TLS, _p *XBtree, _mxPage int32) (r0 int32) {
 70548  	var _res int32
 70549  	var _pBt *XBtShared
 70550  	_pBt = (*XBtShared)(_p.XpBt)
 70551  	func() {
 70552  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 70553  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61682), unsafe.Pointer(&_sqlite3BtreeSetSpillSizeØ00__func__Ø000), unsafe.Pointer(str(8939)))
 70554  			crt.X__builtin_abort(tls)
 70555  		}
 70556  	}()
 70557  	_sqlite3BtreeEnter(tls, _p)
 70558  	_res = _sqlite3PagerSetSpillsize(tls, (*XPager)(_pBt.XpPager), _mxPage)
 70559  	_sqlite3BtreeLeave(tls, _p)
 70560  	return _res
 70561  }
 70562  
 70563  var _sqlite3BtreeSetSpillSizeØ00__func__Ø000 [25]int8
 70564  
 70565  func init() {
 70566  	crt.Xstrncpy(nil, &_sqlite3BtreeSetSpillSizeØ00__func__Ø000[0], str(90675), 25)
 70567  }
 70568  
 70569  // C comment
 70570  //  /*
 70571  //  ** Change the maximum number of in-memory pages that are allowed
 70572  //  ** before attempting to spill pages to journal.
 70573  //  */
 70574  func _sqlite3PagerSetSpillsize(tls *crt.TLS, _pPager *XPager, _mxPage int32) (r0 int32) {
 70575  	return _sqlite3PcacheSetSpillsize(tls, (*XPCache)(_pPager.XpPCache), _mxPage)
 70576  }
 70577  
 70578  // C comment
 70579  //  /*
 70580  //  ** Set the suggested cache-spill value.  Make no changes if if the
 70581  //  ** argument is zero.  Return the effective cache-spill size, which will
 70582  //  ** be the larger of the szSpill and szCache.
 70583  //  */
 70584  func _sqlite3PcacheSetSpillsize(tls *crt.TLS, _p *XPCache, _mxPage int32) (r0 int32) {
 70585  	var _res int32
 70586  	func() {
 70587  		if _p.XpCache == nil {
 70588  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44952), unsafe.Pointer(&_sqlite3PcacheSetSpillsizeØ00__func__Ø000), unsafe.Pointer(str(90700)))
 70589  			crt.X__builtin_abort(tls)
 70590  		}
 70591  	}()
 70592  	if _mxPage == 0 {
 70593  		goto _2
 70594  	}
 70595  	if _mxPage < int32(0) {
 70596  		_mxPage = int32((int64(-1024) * int64(_mxPage)) / int64(_p.XszPage+_p.XszExtra))
 70597  	}
 70598  	_p.XszSpill = _mxPage
 70599  _2:
 70600  	_res = _numberOfCachePages(tls, _p)
 70601  	if _res < _p.XszSpill {
 70602  		_res = _p.XszSpill
 70603  	}
 70604  	return _res
 70605  }
 70606  
 70607  var _sqlite3PcacheSetSpillsizeØ00__func__Ø000 [26]int8
 70608  
 70609  func init() {
 70610  	crt.Xstrncpy(nil, &_sqlite3PcacheSetSpillsizeØ00__func__Ø000[0], str(90713), 26)
 70611  }
 70612  
 70613  func _sqlite3BtreeSetPagerFlags(tls *crt.TLS, _p *XBtree, _pgFlags uint32) (r0 int32) {
 70614  	var _pBt *XBtShared
 70615  	_pBt = (*XBtShared)(_p.XpBt)
 70616  	func() {
 70617  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
 70618  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61718), unsafe.Pointer(&_sqlite3BtreeSetPagerFlagsØ00__func__Ø000), unsafe.Pointer(str(8939)))
 70619  			crt.X__builtin_abort(tls)
 70620  		}
 70621  	}()
 70622  	_sqlite3BtreeEnter(tls, _p)
 70623  	_sqlite3PagerSetFlags(tls, (*XPager)(_pBt.XpPager), _pgFlags)
 70624  	_sqlite3BtreeLeave(tls, _p)
 70625  	return int32(0)
 70626  }
 70627  
 70628  var _sqlite3BtreeSetPagerFlagsØ00__func__Ø000 [26]int8
 70629  
 70630  func init() {
 70631  	crt.Xstrncpy(nil, &_sqlite3BtreeSetPagerFlagsØ00__func__Ø000[0], str(90739), 26)
 70632  }
 70633  
 70634  func _sqlite3PagerSetFlags(tls *crt.TLS, _pPager *XPager, _pgFlags uint32) {
 70635  	var _level uint32
 70636  	_level = _pgFlags & uint32(7)
 70637  	if _pPager.XtempFile != 0 {
 70638  		_pPager.XnoSync = uint8(1)
 70639  		_pPager.XfullSync = 0
 70640  		_pPager.XextraSync = 0
 70641  		goto _1
 70642  	}
 70643  	_pPager.XnoSync = uint8(func() int32 {
 70644  		if _level == uint32(1) {
 70645  			return int32(1)
 70646  		}
 70647  		return int32(0)
 70648  	}())
 70649  	_pPager.XfullSync = uint8(func() int32 {
 70650  		if _level >= uint32(3) {
 70651  			return int32(1)
 70652  		}
 70653  		return int32(0)
 70654  	}())
 70655  	_pPager.XextraSync = uint8(func() int32 {
 70656  		if _level == uint32(4) {
 70657  			return int32(1)
 70658  		}
 70659  		return int32(0)
 70660  	}())
 70661  _1:
 70662  	if _pPager.XnoSync != 0 {
 70663  		_pPager.XsyncFlags = 0
 70664  		_pPager.XckptSyncFlags = 0
 70665  		goto _13
 70666  	}
 70667  	if (_pgFlags & uint32(8)) != 0 {
 70668  		_pPager.XsyncFlags = uint8(3)
 70669  		_pPager.XckptSyncFlags = uint8(3)
 70670  		goto _13
 70671  	}
 70672  	if (_pgFlags & uint32(16)) != 0 {
 70673  		_pPager.XsyncFlags = uint8(2)
 70674  		_pPager.XckptSyncFlags = uint8(3)
 70675  		goto _13
 70676  	}
 70677  	_pPager.XsyncFlags = uint8(2)
 70678  	_pPager.XckptSyncFlags = uint8(2)
 70679  _13:
 70680  	_pPager.XwalSyncFlags = _pPager.XsyncFlags
 70681  	if _pPager.XfullSync != 0 {
 70682  		{
 70683  			p := &_pPager.XwalSyncFlags
 70684  			*p = uint8(int32(*p) | int32(32))
 70685  		}
 70686  	}
 70687  	if (_pgFlags & uint32(32)) != 0 {
 70688  		{
 70689  			p := &_pPager.XdoNotSpill
 70690  			*p = uint8(int32(*p) & int32(-2))
 70691  		}
 70692  		goto _16
 70693  	}
 70694  	{
 70695  		p := &_pPager.XdoNotSpill
 70696  		*p = uint8(int32(*p) | int32(1))
 70697  	}
 70698  _16:
 70699  }
 70700  
 70701  // C comment
 70702  //  /*
 70703  //  ** Change the default pages size and the number of reserved bytes per page.
 70704  //  ** Or, if the page size has already been fixed, return SQLITE_READONLY
 70705  //  ** without changing anything.
 70706  //  **
 70707  //  ** The page size must be a power of 2 between 512 and 65536.  If the page
 70708  //  ** size supplied does not meet this constraint then the page size is not
 70709  //  ** changed.
 70710  //  **
 70711  //  ** Page sizes are constrained to be a power of two so that the region
 70712  //  ** of the database file used for locking (beginning at PENDING_BYTE,
 70713  //  ** the first byte past the 1GB boundary, 0x40000000) needs to occur
 70714  //  ** at the beginning of a page.
 70715  //  **
 70716  //  ** If parameter nReserve is less than zero, then the number of reserved
 70717  //  ** bytes per page is left unchanged.
 70718  //  **
 70719  //  ** If the iFix!=0 then the BTS_PAGESIZE_FIXED flag is set so that the page size
 70720  //  ** and autovacuum mode can no longer be changed.
 70721  //  */
 70722  func _sqlite3BtreeSetPageSize(tls *crt.TLS, _p *XBtree, _pageSize int32, _nReserve int32, _iFix int32) (r0 int32) {
 70723  	var _rc int32
 70724  	var _pBt *XBtShared
 70725  	_rc = int32(0)
 70726  	_pBt = (*XBtShared)(_p.XpBt)
 70727  	func() {
 70728  		if _nReserve < int32(-1) || _nReserve > int32(255) {
 70729  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61749), unsafe.Pointer(&_sqlite3BtreeSetPageSizeØ00__func__Ø000), unsafe.Pointer(str(90765)))
 70730  			crt.X__builtin_abort(tls)
 70731  		}
 70732  	}()
 70733  	_sqlite3BtreeEnter(tls, _p)
 70734  	if (int32(_pBt.XbtsFlags) & int32(2)) != 0 {
 70735  		_sqlite3BtreeLeave(tls, _p)
 70736  		return int32(8)
 70737  	}
 70738  	if _nReserve < int32(0) {
 70739  		_nReserve = int32(_pBt.XpageSize - _pBt.XusableSize)
 70740  	}
 70741  	func() {
 70742  		if _nReserve < int32(0) || _nReserve > int32(255) {
 70743  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61761), unsafe.Pointer(&_sqlite3BtreeSetPageSizeØ00__func__Ø000), unsafe.Pointer(str(90795)))
 70744  			crt.X__builtin_abort(tls)
 70745  		}
 70746  	}()
 70747  	if ((_pageSize >= int32(512)) && (_pageSize <= int32(65536))) && (((_pageSize - int32(1)) & _pageSize) == int32(0)) {
 70748  		func() {
 70749  			if (_pageSize & int32(7)) != int32(0) {
 70750  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61764), unsafe.Pointer(&_sqlite3BtreeSetPageSizeØ00__func__Ø000), unsafe.Pointer(str(51364)))
 70751  				crt.X__builtin_abort(tls)
 70752  			}
 70753  		}()
 70754  		func() {
 70755  			if _pBt.XpCursor != nil {
 70756  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61765), unsafe.Pointer(&_sqlite3BtreeSetPageSizeØ00__func__Ø000), unsafe.Pointer(str(22064)))
 70757  				crt.X__builtin_abort(tls)
 70758  			}
 70759  		}()
 70760  		_pBt.XpageSize = uint32(_pageSize)
 70761  		_freeTempSpace(tls, _pBt)
 70762  	}
 70763  	_rc = _sqlite3PagerSetPagesize(tls, (*XPager)(_pBt.XpPager), &_pBt.XpageSize, _nReserve)
 70764  	_pBt.XusableSize = _pBt.XpageSize - uint32(uint16(_nReserve))
 70765  	if _iFix != 0 {
 70766  		{
 70767  			p := &_pBt.XbtsFlags
 70768  			*p = uint16(int32(*p) | int32(2))
 70769  		}
 70770  	}
 70771  	_sqlite3BtreeLeave(tls, _p)
 70772  	return _rc
 70773  }
 70774  
 70775  var _sqlite3BtreeSetPageSizeØ00__func__Ø000 [24]int8
 70776  
 70777  func init() {
 70778  	crt.Xstrncpy(nil, &_sqlite3BtreeSetPageSizeØ00__func__Ø000[0], str(90824), 24)
 70779  }
 70780  
 70781  // C comment
 70782  //  /*
 70783  //  ** Change the 'auto-vacuum' property of the database. If the 'autoVacuum'
 70784  //  ** parameter is non-zero, then auto-vacuum mode is enabled. If zero, it
 70785  //  ** is disabled. The default value for the auto-vacuum property is
 70786  //  ** determined by the SQLITE_DEFAULT_AUTOVACUUM macro.
 70787  //  */
 70788  func _sqlite3BtreeSetAutoVacuum(tls *crt.TLS, _p *XBtree, _autoVacuum int32) (r0 int32) {
 70789  	var _rc int32
 70790  	var _av uint8
 70791  	var _pBt *XBtShared
 70792  	_pBt = (*XBtShared)(_p.XpBt)
 70793  	_rc = int32(0)
 70794  	_av = uint8(_autoVacuum)
 70795  	_sqlite3BtreeEnter(tls, _p)
 70796  	if ((int32(_pBt.XbtsFlags) & int32(2)) != int32(0)) && (func() int32 {
 70797  		if _av != 0 {
 70798  			return int32(1)
 70799  		}
 70800  		return int32(0)
 70801  	}() != int32(_pBt.XautoVacuum)) {
 70802  		_rc = int32(8)
 70803  		goto _4
 70804  	}
 70805  	_pBt.XautoVacuum = uint8(func() int32 {
 70806  		if _av != 0 {
 70807  			return int32(1)
 70808  		}
 70809  		return int32(0)
 70810  	}())
 70811  	_pBt.XincrVacuum = uint8(func() int32 {
 70812  		if int32(_av) == int32(2) {
 70813  			return int32(1)
 70814  		}
 70815  		return int32(0)
 70816  	}())
 70817  _4:
 70818  	_sqlite3BtreeLeave(tls, _p)
 70819  	return _rc
 70820  }
 70821  
 70822  // C comment
 70823  //  /*
 70824  //  ** Return the value of the 'auto-vacuum' property. If auto-vacuum is
 70825  //  ** enabled 1 is returned. Otherwise 0.
 70826  //  */
 70827  func _sqlite3BtreeGetAutoVacuum(tls *crt.TLS, _p *XBtree) (r0 int32) {
 70828  	var _rc int32
 70829  	_sqlite3BtreeEnter(tls, _p)
 70830  	_rc = func() int32 {
 70831  		if ((*XBtShared)(_p.XpBt).XautoVacuum) == 0 {
 70832  			return int32(0)
 70833  		}
 70834  		return func() int32 {
 70835  			if ((*XBtShared)(_p.XpBt).XincrVacuum) == 0 {
 70836  				return int32(1)
 70837  			}
 70838  			return int32(2)
 70839  		}()
 70840  	}()
 70841  	_sqlite3BtreeLeave(tls, _p)
 70842  	return _rc
 70843  }
 70844  
 70845  func _execSqlF(tls *crt.TLS, _db *Xsqlite3, _pzErrMsg **int8, _zSql *int8, args ...interface{}) (r0 int32) {
 70846  	var _rc int32
 70847  	var _z *int8
 70848  	var _ap []interface{}
 70849  	_ap = args
 70850  	_z = _sqlite3VMPrintf(tls, _db, _zSql, _ap)
 70851  	_ap = nil
 70852  	if _z == nil {
 70853  		return int32(7)
 70854  	}
 70855  	_rc = _execSql(tls, _db, _pzErrMsg, _z)
 70856  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_z))
 70857  	return _rc
 70858  }
 70859  
 70860  var _sqlite3RunVacuumØ00aCopyØ001 [10]uint8
 70861  
 70862  func init() {
 70863  	_sqlite3RunVacuumØ00aCopyØ001 = [10]uint8{1, 1, 3, 0, 5, 0, 6, 0, 8, 0}
 70864  }
 70865  
 70866  // C comment
 70867  //  /*
 70868  //  ** Copy the complete content of pBtFrom into pBtTo.  A transaction
 70869  //  ** must be active for both files.
 70870  //  **
 70871  //  ** The size of file pTo may be reduced by this operation. If anything
 70872  //  ** goes wrong, the transaction on pTo is rolled back. If successful, the
 70873  //  ** transaction is committed before returning.
 70874  //  */
 70875  func _sqlite3BtreeCopyFile(tls *crt.TLS, _pTo *XBtree, _pFrom *XBtree) (r0 int32) {
 70876  	var _rc int32
 70877  	var _1_nByte int64
 70878  	var _pFd *Xsqlite3_file
 70879  	var _b Xsqlite3_backup
 70880  	_sqlite3BtreeEnter(tls, _pTo)
 70881  	_sqlite3BtreeEnter(tls, _pFrom)
 70882  	func() {
 70883  		if _sqlite3BtreeIsInTrans(tls, _pTo) == 0 {
 70884  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69652), unsafe.Pointer(&_sqlite3BtreeCopyFileØ00__func__Ø000), unsafe.Pointer(str(90848)))
 70885  			crt.X__builtin_abort(tls)
 70886  		}
 70887  	}()
 70888  	_pFd = _sqlite3PagerFile(tls, _sqlite3BtreePager(tls, _pTo))
 70889  	if _pFd.XpMethods == nil {
 70890  		goto _2
 70891  	}
 70892  	_1_nByte = int64(_sqlite3BtreeGetPageSize(tls, _pFrom)) * int64(_sqlite3BtreeLastPage(tls, _pFrom))
 70893  	_rc = _sqlite3OsFileControl(tls, _pFd, int32(11), unsafe.Pointer(&_1_nByte))
 70894  	if _rc == int32(12) {
 70895  		_rc = int32(0)
 70896  	}
 70897  	if _rc != 0 {
 70898  		goto _copy_finished
 70899  	}
 70900  _2:
 70901  	crt.Xmemset(tls, unsafe.Pointer(&_b), int32(0), uint32(48))
 70902  	*(**Xsqlite3)(unsafe.Pointer(&_b.XpSrcDb)) = (*Xsqlite3)(_pFrom.Xdb)
 70903  	*(**XBtree)(unsafe.Pointer(&_b.XpSrc)) = _pFrom
 70904  	*(**XBtree)(unsafe.Pointer(&_b.XpDest)) = _pTo
 70905  	_b.XiNext = uint32(1)
 70906  	Xsqlite3_backup_step(tls, &_b, int32(2147483647))
 70907  	func() {
 70908  		if _b.Xrc == int32(0) {
 70909  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69683), unsafe.Pointer(&_sqlite3BtreeCopyFileØ00__func__Ø000), unsafe.Pointer(str(90875)))
 70910  			crt.X__builtin_abort(tls)
 70911  		}
 70912  	}()
 70913  	_rc = Xsqlite3_backup_finish(tls, &_b)
 70914  	if _rc == int32(0) {
 70915  		{
 70916  			p := &((*XBtShared)(_pTo.XpBt).XbtsFlags)
 70917  			*p = uint16(int32(*p) & int32(-3))
 70918  		}
 70919  		goto _8
 70920  	}
 70921  	_sqlite3PagerClearCache(tls, _sqlite3BtreePager(tls, (*XBtree)(_b.XpDest)))
 70922  _8:
 70923  	func() {
 70924  		if _sqlite3BtreeIsInTrans(tls, _pTo) != int32(0) {
 70925  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69692), unsafe.Pointer(&_sqlite3BtreeCopyFileØ00__func__Ø000), unsafe.Pointer(str(90891)))
 70926  			crt.X__builtin_abort(tls)
 70927  		}
 70928  	}()
 70929  _copy_finished:
 70930  	_sqlite3BtreeLeave(tls, _pFrom)
 70931  	_sqlite3BtreeLeave(tls, _pTo)
 70932  	return _rc
 70933  
 70934  	_ = _1_nByte
 70935  	panic(0)
 70936  }
 70937  
 70938  var _sqlite3BtreeCopyFileØ00__func__Ø000 [21]int8
 70939  
 70940  func init() {
 70941  	crt.Xstrncpy(nil, &_sqlite3BtreeCopyFileØ00__func__Ø000[0], str(90921), 21)
 70942  }
 70943  
 70944  // C comment
 70945  //  /*
 70946  //  ** Copy nPage pages from the source b-tree to the destination.
 70947  //  */
 70948  func Xsqlite3_backup_step(tls *crt.TLS, _p *Xsqlite3_backup, _nPage int32) (r0 int32) {
 70949  	var _rc, _destMode, _pgszSrc, _pgszDest, _2_ii, _2_nSrcPage, _2_bCloseTrans, _21_nDestTruncate, _22_ratio, _25_nDstPage, _36_rc2 int32
 70950  	var _25_iSize, _25_iOff, _25_iEnd int64
 70951  	var _9_iSrcPg, _25_iPg, _30_iSrcPg uint32
 70952  	var _31_zData *uint8
 70953  	var _2_pSrcPager, _2_pDestPager *XPager
 70954  	var _25_pFile *Xsqlite3_file
 70955  	var _10_pSrcPg, _27_pPg, _30_pSrcPg *XPgHdr
 70956  	_pgszSrc = int32(0)
 70957  	_pgszDest = int32(0)
 70958  	if _p == nil {
 70959  		return _sqlite3MisuseError(tls, int32(69253))
 70960  	}
 70961  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.XpSrcDb).Xmutex))
 70962  	_sqlite3BtreeEnter(tls, (*XBtree)(_p.XpSrc))
 70963  	if _p.XpDestDb != nil {
 70964  		Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.XpDestDb).Xmutex))
 70965  	}
 70966  	_rc = _p.Xrc
 70967  	if _isFatalError(tls, _rc) != 0 {
 70968  		goto _2
 70969  	}
 70970  	_2_pSrcPager = _sqlite3BtreePager(tls, (*XBtree)(_p.XpSrc))
 70971  	_2_pDestPager = _sqlite3BtreePager(tls, (*XBtree)(_p.XpDest))
 70972  	_2_nSrcPage = int32(-1)
 70973  	_2_bCloseTrans = int32(0)
 70974  	if (_p.XpDestDb != nil) && (int32((*XBtShared)((*XBtree)(_p.XpSrc).XpBt).XinTransaction) == int32(2)) {
 70975  		_rc = int32(5)
 70976  		goto _5
 70977  	}
 70978  	_rc = int32(0)
 70979  _5:
 70980  	if (_rc == int32(0)) && (int32(0) == _sqlite3BtreeIsInReadTrans(tls, (*XBtree)(_p.XpSrc))) {
 70981  		_rc = _sqlite3BtreeBeginTrans(tls, (*XBtree)(_p.XpSrc), int32(0))
 70982  		_2_bCloseTrans = int32(1)
 70983  	}
 70984  	if ((_p.XbDestLocked == int32(0)) && (_rc == int32(0))) && (_setDestPgsz(tls, _p) == int32(7)) {
 70985  		_rc = int32(7)
 70986  	}
 70987  	if ((int32(0) == _rc) && (_p.XbDestLocked == int32(0))) && (int32(0) == store2(&_rc, _sqlite3BtreeBeginTrans(tls, (*XBtree)(_p.XpDest), int32(2)))) {
 70988  		_p.XbDestLocked = int32(1)
 70989  		_sqlite3BtreeGetMeta(tls, (*XBtree)(_p.XpDest), int32(1), &_p.XiDestSchema)
 70990  	}
 70991  	_pgszSrc = _sqlite3BtreeGetPageSize(tls, (*XBtree)(_p.XpSrc))
 70992  	_pgszDest = _sqlite3BtreeGetPageSize(tls, (*XBtree)(_p.XpDest))
 70993  	_destMode = _sqlite3PagerGetJournalMode(tls, _sqlite3BtreePager(tls, (*XBtree)(_p.XpDest)))
 70994  	if ((int32(0) == _rc) && (_destMode == int32(5))) && (_pgszSrc != _pgszDest) {
 70995  		_rc = int32(8)
 70996  	}
 70997  	_2_nSrcPage = int32(_sqlite3BtreeLastPage(tls, (*XBtree)(_p.XpSrc)))
 70998  	func() {
 70999  		if _2_nSrcPage < int32(0) {
 71000  			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)))
 71001  			crt.X__builtin_abort(tls)
 71002  		}
 71003  	}()
 71004  	_2_ii = int32(0)
 71005  _19:
 71006  	if _nPage >= int32(0) && _2_ii >= _nPage || _p.XiNext > uint32(_2_nSrcPage) || _rc != 0 {
 71007  		goto _25
 71008  	}
 71009  	_9_iSrcPg = _p.XiNext
 71010  	if _9_iSrcPg == ((uint32(_sqlite3PendingByte) / ((*XBtShared)((*XBtree)(_p.XpSrc).XpBt).XpageSize)) + uint32(1)) {
 71011  		goto _26
 71012  	}
 71013  	_rc = _sqlite3PagerGet(tls, _2_pSrcPager, _9_iSrcPg, &_10_pSrcPg, int32(2))
 71014  	if _rc == int32(0) {
 71015  		_rc = _backupOnePage(tls, _p, _9_iSrcPg, (*uint8)(_sqlite3PagerGetData(tls, _10_pSrcPg)), int32(0))
 71016  		_sqlite3PagerUnref(tls, _10_pSrcPg)
 71017  	}
 71018  _26:
 71019  	_p.XiNext += 1
 71020  	_2_ii += 1
 71021  	goto _19
 71022  _25:
 71023  	if _rc != int32(0) {
 71024  		goto _28
 71025  	}
 71026  	_p.XnPagecount = uint32(_2_nSrcPage)
 71027  	_p.XnRemaining = uint32(_2_nSrcPage+int32(1)) - _p.XiNext
 71028  	if _p.XiNext > uint32(_2_nSrcPage) {
 71029  		_rc = int32(101)
 71030  		goto _31
 71031  	}
 71032  	if _p.XisAttached == 0 {
 71033  		_attachBackupObject(tls, _p)
 71034  	}
 71035  _31:
 71036  _28:
 71037  	if _rc != int32(101) {
 71038  		goto _32
 71039  	}
 71040  	if _2_nSrcPage == int32(0) {
 71041  		_rc = _sqlite3BtreeNewDb(tls, (*XBtree)(_p.XpDest))
 71042  		_2_nSrcPage = int32(1)
 71043  	}
 71044  	if (_rc == int32(0)) || (_rc == int32(101)) {
 71045  		_rc = _sqlite3BtreeUpdateMeta(tls, (*XBtree)(_p.XpDest), int32(1), _p.XiDestSchema+uint32(1))
 71046  	}
 71047  	if _rc != int32(0) {
 71048  		goto _36
 71049  	}
 71050  	if _p.XpDestDb != nil {
 71051  		_sqlite3ResetAllSchemasOfConnection(tls, (*Xsqlite3)(_p.XpDestDb))
 71052  	}
 71053  	if _destMode == int32(5) {
 71054  		_rc = _sqlite3BtreeSetVersion(tls, (*XBtree)(_p.XpDest), int32(2))
 71055  	}
 71056  _36:
 71057  	if _rc != int32(0) {
 71058  		goto _39
 71059  	}
 71060  	func() {
 71061  		if _pgszSrc != _sqlite3BtreeGetPageSize(tls, (*XBtree)(_p.XpSrc)) {
 71062  			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)))
 71063  			crt.X__builtin_abort(tls)
 71064  		}
 71065  	}()
 71066  	func() {
 71067  		if _pgszDest != _sqlite3BtreeGetPageSize(tls, (*XBtree)(_p.XpDest)) {
 71068  			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)))
 71069  			crt.X__builtin_abort(tls)
 71070  		}
 71071  	}()
 71072  	if _pgszSrc >= _pgszDest {
 71073  		goto _44
 71074  	}
 71075  	_22_ratio = _pgszDest / _pgszSrc
 71076  	_21_nDestTruncate = ((_2_nSrcPage + _22_ratio) - int32(1)) / _22_ratio
 71077  	if _21_nDestTruncate == int32((uint32(_sqlite3PendingByte)/((*XBtShared)((*XBtree)(_p.XpDest).XpBt).XpageSize))+uint32(1)) {
 71078  		_21_nDestTruncate -= 1
 71079  	}
 71080  	goto _46
 71081  _44:
 71082  	_21_nDestTruncate = _2_nSrcPage * (_pgszSrc / _pgszDest)
 71083  _46:
 71084  	func() {
 71085  		if _21_nDestTruncate <= int32(0) {
 71086  			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)))
 71087  			crt.X__builtin_abort(tls)
 71088  		}
 71089  	}()
 71090  	if _pgszSrc >= _pgszDest {
 71091  		goto _49
 71092  	}
 71093  	_25_iSize = int64(_pgszSrc) * int64(_2_nSrcPage)
 71094  	_25_pFile = _sqlite3PagerFile(tls, _2_pDestPager)
 71095  	func() {
 71096  		if _25_pFile == nil {
 71097  			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)))
 71098  			crt.X__builtin_abort(tls)
 71099  		}
 71100  	}()
 71101  	func() {
 71102  		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)) {
 71103  			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)))
 71104  			crt.X__builtin_abort(tls)
 71105  		}
 71106  	}()
 71107  	_sqlite3PagerPagecount(tls, _2_pDestPager, &_25_nDstPage)
 71108  	_25_iPg = uint32(_21_nDestTruncate)
 71109  _58:
 71110  	if _rc != int32(0) || _25_iPg > uint32(_25_nDstPage) {
 71111  		goto _62
 71112  	}
 71113  	if _25_iPg == ((uint32(_sqlite3PendingByte) / ((*XBtShared)((*XBtree)(_p.XpDest).XpBt).XpageSize)) + uint32(1)) {
 71114  		goto _63
 71115  	}
 71116  	_rc = _sqlite3PagerGet(tls, _2_pDestPager, _25_iPg, &_27_pPg, int32(0))
 71117  	if _rc == int32(0) {
 71118  		_rc = _sqlite3PagerWrite(tls, _27_pPg)
 71119  		_sqlite3PagerUnref(tls, _27_pPg)
 71120  	}
 71121  _63:
 71122  	_25_iPg += 1
 71123  	goto _58
 71124  _62:
 71125  	if _rc == int32(0) {
 71126  		_rc = _sqlite3PagerCommitPhaseOne(tls, _2_pDestPager, nil, int32(1))
 71127  	}
 71128  	_25_iEnd = func() int64 {
 71129  		if int64(_sqlite3PendingByte+_pgszDest) < _25_iSize {
 71130  			return int64(_sqlite3PendingByte + _pgszDest)
 71131  		}
 71132  		return _25_iSize
 71133  	}()
 71134  	_25_iOff = int64(_sqlite3PendingByte + _pgszSrc)
 71135  _68:
 71136  	if _rc != int32(0) || _25_iOff >= _25_iEnd {
 71137  		goto _72
 71138  	}
 71139  	_30_pSrcPg = nil
 71140  	_30_iSrcPg = uint32((_25_iOff / int64(_pgszSrc)) + int64(1))
 71141  	_rc = _sqlite3PagerGet(tls, _2_pSrcPager, _30_iSrcPg, &_30_pSrcPg, int32(0))
 71142  	if _rc == int32(0) {
 71143  		_31_zData = (*uint8)(_sqlite3PagerGetData(tls, _30_pSrcPg))
 71144  		_rc = _sqlite3OsWrite(tls, _25_pFile, unsafe.Pointer(_31_zData), _pgszSrc, _25_iOff)
 71145  	}
 71146  	_sqlite3PagerUnref(tls, _30_pSrcPg)
 71147  	_25_iOff += int64(_pgszSrc)
 71148  	goto _68
 71149  _72:
 71150  	if _rc == int32(0) {
 71151  		_rc = _backupTruncateFile(tls, _25_pFile, _25_iSize)
 71152  	}
 71153  	if _rc == int32(0) {
 71154  		_rc = _sqlite3PagerSync(tls, _2_pDestPager, nil)
 71155  	}
 71156  	goto _76
 71157  _49:
 71158  	_sqlite3PagerTruncateImage(tls, _2_pDestPager, uint32(_21_nDestTruncate))
 71159  	_rc = _sqlite3PagerCommitPhaseOne(tls, _2_pDestPager, nil, int32(0))
 71160  _76:
 71161  	if (int32(0) == _rc) && (int32(0) == store2(&_rc, _sqlite3BtreeCommitPhaseTwo(tls, (*XBtree)(_p.XpDest), int32(0)))) {
 71162  		_rc = int32(101)
 71163  	}
 71164  _39:
 71165  _32:
 71166  	if _2_bCloseTrans != 0 {
 71167  		_36_rc2 = _sqlite3BtreeCommitPhaseOne(tls, (*XBtree)(_p.XpSrc), nil)
 71168  		_36_rc2 |= _sqlite3BtreeCommitPhaseTwo(tls, (*XBtree)(_p.XpSrc), int32(0))
 71169  		func() {
 71170  			if _36_rc2 != int32(0) {
 71171  				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)))
 71172  				crt.X__builtin_abort(tls)
 71173  			}
 71174  		}()
 71175  	}
 71176  	if _rc == int32(3082) {
 71177  		_rc = _sqlite3NomemError(tls, int32(69485))
 71178  	}
 71179  	_p.Xrc = _rc
 71180  _2:
 71181  	if _p.XpDestDb != nil {
 71182  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.XpDestDb).Xmutex))
 71183  	}
 71184  	_sqlite3BtreeLeave(tls, (*XBtree)(_p.XpSrc))
 71185  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.XpSrcDb).Xmutex))
 71186  	return _rc
 71187  }
 71188  
 71189  // C comment
 71190  //  /*
 71191  //  ** Attempt to set the page size of the destination to match the page size
 71192  //  ** of the source.
 71193  //  */
 71194  func _setDestPgsz(tls *crt.TLS, _p *Xsqlite3_backup) (r0 int32) {
 71195  	var _rc int32
 71196  	_rc = _sqlite3BtreeSetPageSize(tls, (*XBtree)(_p.XpDest), _sqlite3BtreeGetPageSize(tls, (*XBtree)(_p.XpSrc)), int32(-1), int32(0))
 71197  	return _rc
 71198  }
 71199  
 71200  var _sqlite3_backup_stepØ00__func__Ø000 [20]int8
 71201  
 71202  func init() {
 71203  	crt.Xstrncpy(nil, &_sqlite3_backup_stepØ00__func__Ø000[0], str(91237), 20)
 71204  }
 71205  
 71206  // C comment
 71207  //  /*
 71208  //  ** Register this backup object with the associated source pager for
 71209  //  ** callbacks when pages are changed or the cache invalidated.
 71210  //  */
 71211  func _attachBackupObject(tls *crt.TLS, _p *Xsqlite3_backup) {
 71212  	var _pp **Xsqlite3_backup
 71213  	func() {
 71214  		if _sqlite3BtreeHoldsMutex(tls, (*XBtree)(_p.XpSrc)) == 0 {
 71215  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(69236), unsafe.Pointer(&_attachBackupObjectØ00__func__Ø000), unsafe.Pointer(str(91257)))
 71216  			crt.X__builtin_abort(tls)
 71217  		}
 71218  	}()
 71219  	_pp = _sqlite3PagerBackupPtr(tls, _sqlite3BtreePager(tls, (*XBtree)(_p.XpSrc)))
 71220  	*(**Xsqlite3_backup)(unsafe.Pointer(&_p.XpNext)) = *_pp
 71221  	*_pp = _p
 71222  	_p.XisAttached = int32(1)
 71223  }
 71224  
 71225  var _attachBackupObjectØ00__func__Ø000 [19]int8
 71226  
 71227  func init() {
 71228  	crt.Xstrncpy(nil, &_attachBackupObjectØ00__func__Ø000[0], str(91289), 19)
 71229  }
 71230  
 71231  // C comment
 71232  //  /*
 71233  //  ** Return a pointer to the pPager->pBackup variable. The backup module
 71234  //  ** in backup.c maintains the content of this variable. This module
 71235  //  ** uses it opaquely as an argument to sqlite3BackupRestart() and
 71236  //  ** sqlite3BackupUpdate() only.
 71237  //  */
 71238  func _sqlite3PagerBackupPtr(tls *crt.TLS, _pPager *XPager) (r0 **Xsqlite3_backup) {
 71239  	return (**Xsqlite3_backup)(unsafe.Pointer(&_pPager.XpBackup))
 71240  }
 71241  
 71242  // C comment
 71243  //  /*
 71244  //  ** Initialize the first page of the database file (creating a database
 71245  //  ** consisting of a single page and no schema objects). Return SQLITE_OK
 71246  //  ** if successful, or an SQLite error code otherwise.
 71247  //  */
 71248  func _sqlite3BtreeNewDb(tls *crt.TLS, _p *XBtree) (r0 int32) {
 71249  	var _rc int32
 71250  	_sqlite3BtreeEnter(tls, _p)
 71251  	(*XBtShared)(_p.XpBt).XnPage = 0
 71252  	_rc = _newDatabase(tls, (*XBtShared)(_p.XpBt))
 71253  	_sqlite3BtreeLeave(tls, _p)
 71254  	return _rc
 71255  }
 71256  
 71257  // C comment
 71258  //  /*
 71259  //  ** If pFile is currently larger than iSize bytes, then truncate it to
 71260  //  ** exactly iSize bytes. If pFile is not larger than iSize bytes, then
 71261  //  ** this function is a no-op.
 71262  //  **
 71263  //  ** Return SQLITE_OK if everything is successful, or an SQLite error
 71264  //  ** code if an error occurs.
 71265  //  */
 71266  func _backupTruncateFile(tls *crt.TLS, _pFile *Xsqlite3_file, _iSize int64) (r0 int32) {
 71267  	var _rc int32
 71268  	var _iCurrent int64
 71269  	_rc = _sqlite3OsFileSize(tls, _pFile, &_iCurrent)
 71270  	if (_rc == int32(0)) && (_iCurrent > _iSize) {
 71271  		_rc = _sqlite3OsTruncate(tls, _pFile, _iSize)
 71272  	}
 71273  	return _rc
 71274  }
 71275  
 71276  // C comment
 71277  //  /*
 71278  //  ** Release all resources associated with an sqlite3_backup* handle.
 71279  //  */
 71280  func Xsqlite3_backup_finish(tls *crt.TLS, _p *Xsqlite3_backup) (r0 int32) {
 71281  	var _rc int32
 71282  	var _pSrcDb *Xsqlite3
 71283  	var _pp **Xsqlite3_backup
 71284  	if _p == nil {
 71285  		return int32(0)
 71286  	}
 71287  	_pSrcDb = (*Xsqlite3)(_p.XpSrcDb)
 71288  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pSrcDb.Xmutex))
 71289  	_sqlite3BtreeEnter(tls, (*XBtree)(_p.XpSrc))
 71290  	if _p.XpDestDb != nil {
 71291  		Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.XpDestDb).Xmutex))
 71292  	}
 71293  	if _p.XpDestDb != nil {
 71294  		(*XBtree)(_p.XpSrc).XnBackup -= 1
 71295  	}
 71296  	if _p.XisAttached == 0 {
 71297  		goto _3
 71298  	}
 71299  	_pp = _sqlite3PagerBackupPtr(tls, _sqlite3BtreePager(tls, (*XBtree)(_p.XpSrc)))
 71300  _4:
 71301  	if (*_pp) != _p {
 71302  		_pp = (**Xsqlite3_backup)(unsafe.Pointer(&((*_pp).XpNext)))
 71303  		goto _4
 71304  	}
 71305  	*_pp = (*Xsqlite3_backup)(_p.XpNext)
 71306  _3:
 71307  	_sqlite3BtreeRollback(tls, (*XBtree)(_p.XpDest), int32(0), int32(0))
 71308  	_rc = func() int32 {
 71309  		if _p.Xrc == int32(101) {
 71310  			return int32(0)
 71311  		}
 71312  		return _p.Xrc
 71313  	}()
 71314  	if _p.XpDestDb != nil {
 71315  		_sqlite3Error(tls, (*Xsqlite3)(_p.XpDestDb), _rc)
 71316  		_sqlite3LeaveMutexAndCloseZombie(tls, (*Xsqlite3)(_p.XpDestDb))
 71317  	}
 71318  	_sqlite3BtreeLeave(tls, (*XBtree)(_p.XpSrc))
 71319  	if _p.XpDestDb != nil {
 71320  		Xsqlite3_free(tls, unsafe.Pointer(_p))
 71321  	}
 71322  	_sqlite3LeaveMutexAndCloseZombie(tls, _pSrcDb)
 71323  	return _rc
 71324  }
 71325  
 71326  // C comment
 71327  //  /*
 71328  //  ** Unless this is an in-memory or temporary database, clear the pager cache.
 71329  //  */
 71330  func _sqlite3PagerClearCache(tls *crt.TLS, _pPager *XPager) {
 71331  	func() {
 71332  		if int32(_pPager.XmemDb) != int32(0) && _pPager.XtempFile == 0 {
 71333  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54222), unsafe.Pointer(&_sqlite3PagerClearCacheØ00__func__Ø000), unsafe.Pointer(str(55874)))
 71334  			crt.X__builtin_abort(tls)
 71335  		}
 71336  	}()
 71337  	if int32(_pPager.XtempFile) == int32(0) {
 71338  		_pager_reset(tls, _pPager)
 71339  	}
 71340  }
 71341  
 71342  var _sqlite3PagerClearCacheØ00__func__Ø000 [23]int8
 71343  
 71344  func init() {
 71345  	crt.Xstrncpy(nil, &_sqlite3PagerClearCacheØ00__func__Ø000[0], str(91308), 23)
 71346  }
 71347  
 71348  // C comment
 71349  //  /*
 71350  //  ** A write-transaction must be opened before calling this function.
 71351  //  ** It performs a single unit of work towards an incremental vacuum.
 71352  //  **
 71353  //  ** If the incremental vacuum is finished after this function has run,
 71354  //  ** SQLITE_DONE is returned. If it is not finished, but no error occurred,
 71355  //  ** SQLITE_OK is returned. Otherwise an SQLite error code.
 71356  //  */
 71357  func _sqlite3BtreeIncrVacuum(tls *crt.TLS, _p *XBtree) (r0 int32) {
 71358  	var _rc int32
 71359  	var _2_nOrig, _2_nFree, _2_nFin uint32
 71360  	var _pBt *XBtShared
 71361  	_pBt = (*XBtShared)(_p.XpBt)
 71362  	_sqlite3BtreeEnter(tls, _p)
 71363  	func() {
 71364  		if int32(_pBt.XinTransaction) != int32(2) || int32(_p.XinTrans) != int32(2) {
 71365  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(62715), unsafe.Pointer(&_sqlite3BtreeIncrVacuumØ00__func__Ø000), unsafe.Pointer(str(91331)))
 71366  			crt.X__builtin_abort(tls)
 71367  		}
 71368  	}()
 71369  	if _pBt.XautoVacuum == 0 {
 71370  		_rc = int32(101)
 71371  		goto _4
 71372  	}
 71373  	_2_nOrig = _btreePagecount(tls, _pBt)
 71374  	_2_nFree = _sqlite3Get4byte(tls, elem15((*XMemPage)(_pBt.XpPage1).XaData, uintptr(36)))
 71375  	_2_nFin = _finalDbSize(tls, _pBt, _2_nOrig, _2_nFree)
 71376  	if _2_nOrig < _2_nFin {
 71377  		_rc = _sqlite3CorruptError(tls, int32(62724))
 71378  		goto _10
 71379  	}
 71380  	if _2_nFree <= (0) {
 71381  		goto _7
 71382  	}
 71383  	_rc = _saveAllCursors(tls, _pBt, 0, nil)
 71384  	if _rc == int32(0) {
 71385  		_invalidateAllOverflowCache(tls, _pBt)
 71386  		_rc = _incrVacuumStep(tls, _pBt, _2_nFin, _2_nOrig, int32(0))
 71387  	}
 71388  	if _rc == int32(0) {
 71389  		_rc = _sqlite3PagerWrite(tls, (*XPgHdr)((*XMemPage)(_pBt.XpPage1).XpDbPage))
 71390  		_sqlite3Put4byte(tls, elem15((*XMemPage)(_pBt.XpPage1).XaData, uintptr(28)), _pBt.XnPage)
 71391  	}
 71392  	goto _10
 71393  _7:
 71394  	_rc = int32(101)
 71395  _10:
 71396  _4:
 71397  	_sqlite3BtreeLeave(tls, _p)
 71398  	return _rc
 71399  }
 71400  
 71401  var _sqlite3BtreeIncrVacuumØ00__func__Ø000 [23]int8
 71402  
 71403  func init() {
 71404  	crt.Xstrncpy(nil, &_sqlite3BtreeIncrVacuumØ00__func__Ø000[0], str(91390), 23)
 71405  }
 71406  
 71407  // C comment
 71408  //  /*
 71409  //  ** Obtain a lock on the table whose root page is iTab.  The
 71410  //  ** lock is a write lock if isWritelock is true or a read lock
 71411  //  ** if it is false.
 71412  //  */
 71413  func _sqlite3BtreeLockTable(tls *crt.TLS, _p *XBtree, _iTab int32, _isWriteLock uint8) (r0 int32) {
 71414  	var _rc int32
 71415  	var _1_lockType uint8
 71416  	_rc = int32(0)
 71417  	func() {
 71418  		if int32(_p.XinTrans) == int32(0) {
 71419  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68740), unsafe.Pointer(&_sqlite3BtreeLockTableØ00__func__Ø000), unsafe.Pointer(str(91413)))
 71420  			crt.X__builtin_abort(tls)
 71421  		}
 71422  	}()
 71423  	if _p.Xsharable == 0 {
 71424  		goto _2
 71425  	}
 71426  	_1_lockType = uint8(int32(1) + int32(_isWriteLock))
 71427  
 71428  	func() {
 71429  		if int32(_isWriteLock) != int32(0) && int32(_isWriteLock) != int32(1) {
 71430  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68744), unsafe.Pointer(&_sqlite3BtreeLockTableØ00__func__Ø000), unsafe.Pointer(str(69953)))
 71431  			crt.X__builtin_abort(tls)
 71432  		}
 71433  	}()
 71434  	_sqlite3BtreeEnter(tls, _p)
 71435  	_rc = _querySharedCacheTableLock(tls, _p, uint32(_iTab), _1_lockType)
 71436  	if _rc == int32(0) {
 71437  		_rc = _setSharedCacheTableLock(tls, _p, uint32(_iTab), _1_lockType)
 71438  	}
 71439  	_sqlite3BtreeLeave(tls, _p)
 71440  _2:
 71441  	return _rc
 71442  }
 71443  
 71444  var _sqlite3BtreeLockTableØ00__func__Ø000 [22]int8
 71445  
 71446  func init() {
 71447  	crt.Xstrncpy(nil, &_sqlite3BtreeLockTableØ00__func__Ø000[0], str(91436), 22)
 71448  }
 71449  
 71450  // C comment
 71451  //  /*
 71452  //  ** Add a lock on the table with root-page iTable to the shared-btree used
 71453  //  ** by Btree handle p. Parameter eLock must be either READ_LOCK or
 71454  //  ** WRITE_LOCK.
 71455  //  **
 71456  //  ** This function assumes the following:
 71457  //  **
 71458  //  **   (a) The specified Btree object p is connected to a sharable
 71459  //  **       database (one with the BtShared.sharable flag set), and
 71460  //  **
 71461  //  **   (b) No other Btree objects hold a lock that conflicts
 71462  //  **       with the requested lock (i.e. querySharedCacheTableLock() has
 71463  //  **       already been called and returned SQLITE_OK).
 71464  //  **
 71465  //  ** SQLITE_OK is returned if the lock is added successfully. SQLITE_NOMEM
 71466  //  ** is returned if a malloc attempt fails.
 71467  //  */
 71468  func _setSharedCacheTableLock(tls *crt.TLS, _p *XBtree, _iTable uint32, _eLock uint8) (r0 int32) {
 71469  	var _pBt *XBtShared
 71470  	var _pLock, _pIter *XBtLock
 71471  	_pBt = (*XBtShared)(_p.XpBt)
 71472  	_pLock = nil
 71473  	func() {
 71474  		if _sqlite3BtreeHoldsMutex(tls, _p) == 0 {
 71475  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59358), unsafe.Pointer(&_setSharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(17442)))
 71476  			crt.X__builtin_abort(tls)
 71477  		}
 71478  	}()
 71479  	func() {
 71480  		if int32(_eLock) != int32(1) && int32(_eLock) != int32(2) {
 71481  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59359), unsafe.Pointer(&_setSharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(50726)))
 71482  			crt.X__builtin_abort(tls)
 71483  		}
 71484  	}()
 71485  	func() {
 71486  		if (*Xsqlite3)(_p.Xdb) == nil {
 71487  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59360), unsafe.Pointer(&_setSharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(23631)))
 71488  			crt.X__builtin_abort(tls)
 71489  		}
 71490  	}()
 71491  	func() {
 71492  		if int32(0) != (((*Xsqlite3)(_p.Xdb).Xflags)&int32(16384)) && int32(_eLock) != int32(2) {
 71493  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59366), unsafe.Pointer(&_setSharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(91458)))
 71494  			crt.X__builtin_abort(tls)
 71495  		}
 71496  	}()
 71497  	func() {
 71498  		if _p.Xsharable == 0 {
 71499  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59370), unsafe.Pointer(&_setSharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(91520)))
 71500  			crt.X__builtin_abort(tls)
 71501  		}
 71502  	}()
 71503  	func() {
 71504  		if int32(0) != _querySharedCacheTableLock(tls, _p, _iTable, _eLock) {
 71505  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(59371), unsafe.Pointer(&_setSharedCacheTableLockØ00__func__Ø000), unsafe.Pointer(str(91532)))
 71506  			crt.X__builtin_abort(tls)
 71507  		}
 71508  	}()
 71509  	_pIter = (*XBtLock)(_pBt.XpLock)
 71510  _14:
 71511  	if _pIter == nil {
 71512  		goto _17
 71513  	}
 71514  	if (_pIter.XiTable == _iTable) && ((*XBtree)(_pIter.XpBtree) == _p) {
 71515  		_pLock = _pIter
 71516  		goto _17
 71517  	}
 71518  	_pIter = (*XBtLock)(_pIter.XpNext)
 71519  	goto _14
 71520  _17:
 71521  	if _pLock != nil {
 71522  		goto _20
 71523  	}
 71524  	_pLock = (*XBtLock)(_sqlite3MallocZero(tls, uint64(16)))
 71525  	if _pLock == nil {
 71526  		return _sqlite3NomemError(tls, int32(59387))
 71527  	}
 71528  	_pLock.XiTable = _iTable
 71529  	*(**XBtree)(unsafe.Pointer(&_pLock.XpBtree)) = _p
 71530  	*(**XBtLock)(unsafe.Pointer(&_pLock.XpNext)) = (*XBtLock)(_pBt.XpLock)
 71531  	*(**XBtLock)(unsafe.Pointer(&_pBt.XpLock)) = _pLock
 71532  _20:
 71533  
 71534  	if int32(_eLock) > int32(_pLock.XeLock) {
 71535  		_pLock.XeLock = _eLock
 71536  	}
 71537  	return int32(0)
 71538  }
 71539  
 71540  var _setSharedCacheTableLockØ00__func__Ø000 [24]int8
 71541  
 71542  func init() {
 71543  	crt.Xstrncpy(nil, &_setSharedCacheTableLockØ00__func__Ø000[0], str(91587), 24)
 71544  }
 71545  
 71546  // C comment
 71547  //  /*
 71548  //  ** If the virtual table pVtab supports the transaction interface
 71549  //  ** (xBegin/xRollback/xCommit and optionally xSync) and a transaction is
 71550  //  ** not currently open, invoke the xBegin method now.
 71551  //  **
 71552  //  ** If the xBegin call is successful, place the sqlite3_vtab pointer
 71553  //  ** in the sqlite3.aVTrans array.
 71554  //  */
 71555  func _sqlite3VtabBegin(tls *crt.TLS, _db *Xsqlite3, _pVTab *XVTable) (r0 int32) {
 71556  	var _rc, _3_i, _7_iSvpt int32
 71557  	var _pModule *Xsqlite3_module
 71558  	_rc = int32(0)
 71559  	if (_db.XnVTrans > int32(0)) && ((**XVTable)(unsafe.Pointer(_db.XaVTrans)) == nil) {
 71560  		return int32(6)
 71561  	}
 71562  	if _pVTab == nil {
 71563  		return int32(0)
 71564  	}
 71565  	_pModule = (*Xsqlite3_module)((*Xsqlite3_vtab)(_pVTab.XpVtab).XpModule)
 71566  	if _pModule.XxBegin == nil {
 71567  		goto _3
 71568  	}
 71569  	_3_i = int32(0)
 71570  _4:
 71571  	if _3_i >= _db.XnVTrans {
 71572  		goto _7
 71573  	}
 71574  	if (*elem28((**XVTable)(unsafe.Pointer(_db.XaVTrans)), uintptr(_3_i))) == _pVTab {
 71575  		return int32(0)
 71576  	}
 71577  	_3_i += 1
 71578  	goto _4
 71579  _7:
 71580  	_rc = _growVTrans(tls, _db)
 71581  	if _rc != int32(0) {
 71582  		goto _9
 71583  	}
 71584  	_rc = func() func(*crt.TLS, *Xsqlite3_vtab) int32 {
 71585  		v := _pModule.XxBegin
 71586  		return *(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&v))
 71587  	}()(tls, (*Xsqlite3_vtab)(_pVTab.XpVtab))
 71588  	if _rc != int32(0) {
 71589  		goto _10
 71590  	}
 71591  	_7_iSvpt = _db.XnStatement + _db.XnSavepoint
 71592  	_addToVTrans(tls, _db, _pVTab)
 71593  	if _7_iSvpt != 0 && (_pModule.XxSavepoint != nil) {
 71594  		_pVTab.XiSavepoint = _7_iSvpt
 71595  		_rc = func() func(*crt.TLS, *Xsqlite3_vtab, int32) int32 {
 71596  			v := _pModule.XxSavepoint
 71597  			return *(*func(*crt.TLS, *Xsqlite3_vtab, int32) int32)(unsafe.Pointer(&v))
 71598  		}()(tls, (*Xsqlite3_vtab)(_pVTab.XpVtab), _7_iSvpt-int32(1))
 71599  	}
 71600  _10:
 71601  _9:
 71602  _3:
 71603  	return _rc
 71604  }
 71605  
 71606  // C comment
 71607  //  /*
 71608  //  ** Grow the db->aVTrans[] array so that there is room for at least one
 71609  //  ** more v-table. Return SQLITE_NOMEM if a malloc fails, or SQLITE_OK otherwise.
 71610  //  */
 71611  func _growVTrans(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 71612  	var _ARRAY_INCR, _1_nBytes int32
 71613  	var _1_aVTrans **XVTable
 71614  	_ARRAY_INCR = int32(5)
 71615  	if (_db.XnVTrans % _ARRAY_INCR) != int32(0) {
 71616  		goto _0
 71617  	}
 71618  	_1_nBytes = int32(uint32(4) * uint32(_db.XnVTrans+_ARRAY_INCR))
 71619  	_1_aVTrans = (**XVTable)(_sqlite3DbRealloc(tls, _db, unsafe.Pointer(_db.XaVTrans), uint64(_1_nBytes)))
 71620  	if _1_aVTrans == nil {
 71621  		return _sqlite3NomemError(tls, int32(125653))
 71622  	}
 71623  	crt.Xmemset(tls, unsafe.Pointer(elem28(_1_aVTrans, uintptr(_db.XnVTrans))), int32(0), uint32(4)*uint32(_ARRAY_INCR))
 71624  	*(***XVTable)(unsafe.Pointer(&_db.XaVTrans)) = _1_aVTrans
 71625  _0:
 71626  	return int32(0)
 71627  }
 71628  
 71629  // C comment
 71630  //  /*
 71631  //  ** Add the virtual table pVTab to the array sqlite3.aVTrans[]. Space should
 71632  //  ** have already been reserved using growVTrans().
 71633  //  */
 71634  func _addToVTrans(tls *crt.TLS, _db *Xsqlite3, _pVTab *XVTable) {
 71635  	*elem28((**XVTable)(unsafe.Pointer(_db.XaVTrans)), uintptr(postInc2(&_db.XnVTrans, 1))) = _pVTab
 71636  	_sqlite3VtabLock(tls, _pVTab)
 71637  }
 71638  
 71639  // C comment
 71640  //  /*
 71641  //  ** Make a full copy of pFrom into pTo.  Prior contents of pTo are
 71642  //  ** freed before the copy is made.
 71643  //  */
 71644  func _sqlite3VdbeMemCopy(tls *crt.TLS, _pTo *XMem, _pFrom *XMem) (r0 int32) {
 71645  	var _rc int32
 71646  	_rc = int32(0)
 71647  	func() {
 71648  		if (int32(_pFrom.Xflags) & int32(32)) != int32(0) {
 71649  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(70514), unsafe.Pointer(&_sqlite3VdbeMemCopyØ00__func__Ø000), unsafe.Pointer(str(71149)))
 71650  			crt.X__builtin_abort(tls)
 71651  		}
 71652  	}()
 71653  	if (int32(_pTo.Xflags) & int32(9312)) != int32(0) {
 71654  		_vdbeMemClearExternAndSetNull(tls, _pTo)
 71655  	}
 71656  	crt.Xmemcpy(tls, unsafe.Pointer(_pTo), unsafe.Pointer(_pFrom), uint32(20))
 71657  	{
 71658  		p := &_pTo.Xflags
 71659  		*p = uint16(int32(*p) & int32(-1025))
 71660  	}
 71661  	if (int32(_pTo.Xflags) & int32(18)) == 0 {
 71662  		goto _3
 71663  	}
 71664  	if int32(0) == (int32(_pFrom.Xflags) & int32(2048)) {
 71665  		{
 71666  			p := &_pTo.Xflags
 71667  			*p = uint16(int32(*p) | int32(4096))
 71668  		}
 71669  		_rc = _sqlite3VdbeMemMakeWriteable(tls, _pTo)
 71670  	}
 71671  _3:
 71672  	return _rc
 71673  }
 71674  
 71675  var _sqlite3VdbeMemCopyØ00__func__Ø000 [19]int8
 71676  
 71677  func init() {
 71678  	crt.Xstrncpy(nil, &_sqlite3VdbeMemCopyØ00__func__Ø000[0], str(91611), 19)
 71679  }
 71680  
 71681  // C comment
 71682  //  /*
 71683  //  ** This function is invoked by the vdbe to call the xCreate method
 71684  //  ** of the virtual table named zTab in database iDb.
 71685  //  **
 71686  //  ** If an error occurs, *pzErr is set to point to an English language
 71687  //  ** description of the error and an SQLITE_XXX error code is returned.
 71688  //  ** In this case the caller must call sqlite3DbFree(db, ) on *pzErr.
 71689  //  */
 71690  func _sqlite3VtabCallCreate(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _zTab *int8, _pzErr **int8) (r0 int32) {
 71691  	var _rc int32
 71692  	var _zMod *int8
 71693  	var _pTab *XTable
 71694  	var _pMod *XModule
 71695  	_rc = int32(0)
 71696  	_pTab = _sqlite3FindTable(tls, _db, _zTab, elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName)
 71697  	func() {
 71698  		if _pTab == nil || _pTab.XnModuleArg == 0 || _pTab.XpVTable != nil {
 71699  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125687), unsafe.Pointer(&_sqlite3VtabCallCreateØ00__func__Ø000), unsafe.Pointer(str(91630)))
 71700  			crt.X__builtin_abort(tls)
 71701  		}
 71702  	}()
 71703  	_zMod = *elem0(_pTab.XazModuleArg, 0)
 71704  	_pMod = (*XModule)(_sqlite3HashFind(tls, &_db.XaModule, _zMod))
 71705  	if ((_pMod == nil) || (func() func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 {
 71706  		v := (*Xsqlite3_module)(_pMod.XpModule).XxCreate
 71707  		return *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&v))
 71708  	}() == nil)) || (func() func(*crt.TLS, *Xsqlite3_vtab) int32 {
 71709  		v := (*Xsqlite3_module)(_pMod.XpModule).XxDestroy
 71710  		return *(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&v))
 71711  	}() == nil) {
 71712  		*_pzErr = _sqlite3MPrintf(tls, _db, str(91672), unsafe.Pointer(_zMod))
 71713  		_rc = int32(1)
 71714  		goto _7
 71715  	}
 71716  	_rc = _vtabCallConstructor(tls, _db, _pTab, _pMod, func() func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 {
 71717  		v := (*Xsqlite3_module)(_pMod.XpModule).XxCreate
 71718  		return *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&v))
 71719  	}(), _pzErr)
 71720  _7:
 71721  	if _rc != int32(0) || func() int32 {
 71722  		if _sqlite3GetVTable(tls, _db, _pTab) != nil {
 71723  			return int32(1)
 71724  		}
 71725  		return func() int32 {
 71726  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125706), unsafe.Pointer(&_sqlite3VtabCallCreateØ00__func__Ø000), unsafe.Pointer(str(4809)))
 71727  			crt.X__builtin_abort(tls)
 71728  			return int32(0)
 71729  		}()
 71730  	}() == 0 {
 71731  		goto _11
 71732  	}
 71733  	_rc = _growVTrans(tls, _db)
 71734  	if _rc == int32(0) {
 71735  		_addToVTrans(tls, _db, _sqlite3GetVTable(tls, _db, _pTab))
 71736  	}
 71737  _11:
 71738  	return _rc
 71739  }
 71740  
 71741  var _sqlite3VtabCallCreateØ00__func__Ø000 [22]int8
 71742  
 71743  func init() {
 71744  	crt.Xstrncpy(nil, &_sqlite3VtabCallCreateØ00__func__Ø000[0], str(91691), 22)
 71745  }
 71746  
 71747  // C comment
 71748  //  /*
 71749  //  ** Invoke a virtual table constructor (either xCreate or xConnect). The
 71750  //  ** pointer to the function to invoke is passed as the fourth parameter
 71751  //  ** to this procedure.
 71752  //  */
 71753  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) {
 71754  	var _rc, _nArg, _iDb, _10_iCol, _11_nType, _11_i, _14_j, _14_nDel int32
 71755  	var _zErr, _zModuleName, _9_zFormat, _11_zType *int8
 71756  	var _10_oooHidden uint8
 71757  	var _azArg **int8
 71758  	var _pVTable *XVTable
 71759  	var _sCtx XVtabCtx
 71760  	var _pCtx *XVtabCtx
 71761  	_azArg = _pTab.XazModuleArg
 71762  	_nArg = _pTab.XnModuleArg
 71763  	_zErr = nil
 71764  	_pCtx = (*XVtabCtx)(_db.XpVtabCtx)
 71765  _0:
 71766  	if _pCtx == nil {
 71767  		goto _3
 71768  	}
 71769  	if (*XTable)(_pCtx.XpTab) == _pTab {
 71770  		*_pzErr = _sqlite3MPrintf(tls, _db, str(91713), unsafe.Pointer(_pTab.XzName))
 71771  		return int32(6)
 71772  	}
 71773  	_pCtx = (*XVtabCtx)(_pCtx.XpPrior)
 71774  	goto _0
 71775  _3:
 71776  	_zModuleName = _sqlite3MPrintf(tls, _db, str(24531), unsafe.Pointer(_pTab.XzName))
 71777  	if _zModuleName == nil {
 71778  		return _sqlite3NomemError(tls, int32(125510))
 71779  	}
 71780  	_pVTable = (*XVTable)(_sqlite3DbMallocZero(tls, _db, uint64(28)))
 71781  	if _pVTable == nil {
 71782  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zModuleName))
 71783  		return _sqlite3NomemError(tls, int32(125516))
 71784  	}
 71785  	*(**Xsqlite3)(unsafe.Pointer(&_pVTable.Xdb)) = _db
 71786  	*(**XModule)(unsafe.Pointer(&_pVTable.XpMod)) = _pMod
 71787  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.XpSchema))
 71788  	*elem0(_pTab.XazModuleArg, uintptr(1)) = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
 71789  	func() {
 71790  		if &_db.XpVtabCtx == nil {
 71791  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125525), unsafe.Pointer(&_vtabCallConstructorØ00__func__Ø000), unsafe.Pointer(str(91755)))
 71792  			crt.X__builtin_abort(tls)
 71793  		}
 71794  	}()
 71795  	func() {
 71796  		if _xConstruct == nil {
 71797  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125526), unsafe.Pointer(&_vtabCallConstructorØ00__func__Ø000), unsafe.Pointer(str(91769)))
 71798  			crt.X__builtin_abort(tls)
 71799  		}
 71800  	}()
 71801  	*(**XTable)(unsafe.Pointer(&_sCtx.XpTab)) = _pTab
 71802  	*(**XVTable)(unsafe.Pointer(&_sCtx.XpVTable)) = _pVTable
 71803  	*(**XVtabCtx)(unsafe.Pointer(&_sCtx.XpPrior)) = (*XVtabCtx)(_db.XpVtabCtx)
 71804  	_sCtx.XbDeclared = int32(0)
 71805  	*(**XVtabCtx)(unsafe.Pointer(&_db.XpVtabCtx)) = &_sCtx
 71806  	_rc = _xConstruct(tls, _db, _pMod.XpAux, _nArg, _azArg, (**Xsqlite3_vtab)(unsafe.Pointer(&_pVTable.XpVtab)), &_zErr)
 71807  	*(**XVtabCtx)(unsafe.Pointer(&_db.XpVtabCtx)) = (*XVtabCtx)(_sCtx.XpPrior)
 71808  	if _rc == int32(7) {
 71809  		_sqlite3OomFault(tls, _db)
 71810  	}
 71811  	func() {
 71812  		if (*XTable)(_sCtx.XpTab) != _pTab {
 71813  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125535), unsafe.Pointer(&_vtabCallConstructorØ00__func__Ø000), unsafe.Pointer(str(91780)))
 71814  			crt.X__builtin_abort(tls)
 71815  		}
 71816  	}()
 71817  	if int32(0) == _rc {
 71818  		goto _14
 71819  	}
 71820  	if _zErr == nil {
 71821  		*_pzErr = _sqlite3MPrintf(tls, _db, str(91796), unsafe.Pointer(_zModuleName))
 71822  		goto _16
 71823  	}
 71824  	*_pzErr = _sqlite3MPrintf(tls, _db, str(24531), unsafe.Pointer(_zErr))
 71825  	Xsqlite3_free(tls, unsafe.Pointer(_zErr))
 71826  _16:
 71827  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pVTable))
 71828  	goto _20
 71829  _14:
 71830  	if func() int32 {
 71831  		if _pVTable.XpVtab != nil {
 71832  			return int32(1)
 71833  		}
 71834  		return func() int32 {
 71835  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125545), unsafe.Pointer(&_vtabCallConstructorØ00__func__Ø000), unsafe.Pointer(str(4809)))
 71836  			crt.X__builtin_abort(tls)
 71837  			return int32(0)
 71838  		}()
 71839  	}() == 0 {
 71840  		goto _20
 71841  	}
 71842  	crt.Xmemset(tls, _pVTable.XpVtab, int32(0), uint32(12))
 71843  	*(**Xsqlite3_module)(unsafe.Pointer(&((*Xsqlite3_vtab)(_pVTable.XpVtab).XpModule))) = (*Xsqlite3_module)(_pMod.XpModule)
 71844  	_pVTable.XnRef = int32(1)
 71845  	if _sCtx.XbDeclared == int32(0) {
 71846  		_9_zFormat = str(91826)
 71847  		*_pzErr = _sqlite3MPrintf(tls, _db, _9_zFormat, unsafe.Pointer(_pTab.XzName))
 71848  		_sqlite3VtabUnlock(tls, _pVTable)
 71849  		_rc = int32(1)
 71850  		goto _22
 71851  	}
 71852  	_10_oooHidden = uint8(0)
 71853  	*(**XVTable)(unsafe.Pointer(&_pVTable.XpNext)) = (*XVTable)(_pTab.XpVTable)
 71854  	*(**XVTable)(unsafe.Pointer(&_pTab.XpVTable)) = _pVTable
 71855  	_10_iCol = int32(0)
 71856  _23:
 71857  	if _10_iCol >= int32(_pTab.XnCol) {
 71858  		goto _26
 71859  	}
 71860  	_11_zType = _sqlite3ColumnType(tls, elem41((*XColumn)(_pTab.XaCol), uintptr(_10_iCol)), str(284))
 71861  	_11_i = int32(0)
 71862  	_11_nType = _sqlite3Strlen30(tls, _11_zType)
 71863  	_11_i = int32(0)
 71864  _27:
 71865  	if _11_i >= _11_nType {
 71866  		goto _30
 71867  	}
 71868  	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))) {
 71869  		goto _30
 71870  	}
 71871  	_11_i += 1
 71872  	goto _27
 71873  _30:
 71874  	if _11_i >= _11_nType {
 71875  		goto _36
 71876  	}
 71877  	_14_nDel = int32(6) + func() int32 {
 71878  		if (*elem1(_11_zType, uintptr(_11_i+int32(6)))) != 0 {
 71879  			return int32(1)
 71880  		}
 71881  		return int32(0)
 71882  	}()
 71883  	_14_j = _11_i
 71884  _39:
 71885  	if (_14_j + _14_nDel) > _11_nType {
 71886  		goto _42
 71887  	}
 71888  	*elem1(_11_zType, uintptr(_14_j)) = *elem1(_11_zType, uintptr(_14_j+_14_nDel))
 71889  	_14_j += 1
 71890  	goto _39
 71891  _42:
 71892  	if (int32(*elem1(_11_zType, uintptr(_11_i))) == int32(0)) && (_11_i > int32(0)) {
 71893  		func() {
 71894  			if int32(*elem1(_11_zType, uintptr(_11_i-int32(1)))) != int32(32) {
 71895  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125587), unsafe.Pointer(&_vtabCallConstructorØ00__func__Ø000), unsafe.Pointer(str(91879)))
 71896  				crt.X__builtin_abort(tls)
 71897  			}
 71898  		}()
 71899  		*elem1(_11_zType, uintptr(_11_i-int32(1))) = 0
 71900  	}
 71901  	{
 71902  		p := &(elem41((*XColumn)(_pTab.XaCol), uintptr(_10_iCol)).XcolFlags)
 71903  		*p = uint8(int32(*p) | int32(2))
 71904  	}
 71905  	_10_oooHidden = uint8(128)
 71906  	goto _47
 71907  _36:
 71908  	_pTab.XtabFlags |= uint32(_10_oooHidden)
 71909  _47:
 71910  	_10_iCol += 1
 71911  	goto _23
 71912  _26:
 71913  _22:
 71914  _20:
 71915  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zModuleName))
 71916  	return _rc
 71917  }
 71918  
 71919  var _vtabCallConstructorØ00__func__Ø000 [20]int8
 71920  
 71921  func init() {
 71922  	crt.Xstrncpy(nil, &_vtabCallConstructorØ00__func__Ø000[0], str(91895), 20)
 71923  }
 71924  
 71925  // C comment
 71926  //  /*
 71927  //  ** Return the declared type of a column.  Or return zDflt if the column
 71928  //  ** has no declared type.
 71929  //  **
 71930  //  ** The column type is an extra string stored after the zero-terminator on
 71931  //  ** the column name if and only if the COLFLAG_HASTYPE flag is set.
 71932  //  */
 71933  func _sqlite3ColumnType(tls *crt.TLS, _pCol *XColumn, _zDflt *int8) (r0 *int8) {
 71934  	if (int32(_pCol.XcolFlags) & int32(4)) == int32(0) {
 71935  		return _zDflt
 71936  	}
 71937  	return (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCol.XzName))+uintptr(crt.Xstrlen(tls, _pCol.XzName)))))) + uintptr(int32(1))))
 71938  }
 71939  
 71940  // C comment
 71941  //  /*
 71942  //  ** This function is invoked by the vdbe to call the xDestroy method
 71943  //  ** of the virtual table named zTab in database iDb. This occurs
 71944  //  ** when a DROP TABLE is mentioned.
 71945  //  **
 71946  //  ** This call is a no-op if zTab is not a virtual table.
 71947  //  */
 71948  func _sqlite3VtabCallDestroy(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _zTab *int8) (r0 int32) {
 71949  	var _rc int32
 71950  	var _pTab *XTable
 71951  	var _1_p *XVTable
 71952  	var _1_xDestroy func(*crt.TLS, *Xsqlite3_vtab) int32
 71953  	_rc = int32(0)
 71954  	_pTab = _sqlite3FindTable(tls, _db, _zTab, elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName)
 71955  	if _pTab == nil || func() int32 {
 71956  		if (*XVTable)(_pTab.XpVTable) != nil {
 71957  			return int32(1)
 71958  		}
 71959  		return func() int32 {
 71960  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125811), unsafe.Pointer(&_sqlite3VtabCallDestroyØ00__func__Ø000), unsafe.Pointer(str(4809)))
 71961  			crt.X__builtin_abort(tls)
 71962  			return int32(0)
 71963  		}()
 71964  	}() == 0 {
 71965  		goto _3
 71966  	}
 71967  	_1_p = (*XVTable)(_pTab.XpVTable)
 71968  _4:
 71969  	if _1_p == nil {
 71970  		goto _7
 71971  	}
 71972  	func() {
 71973  		if _1_p.XpVtab == nil {
 71974  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125815), unsafe.Pointer(&_sqlite3VtabCallDestroyØ00__func__Ø000), unsafe.Pointer(str(91915)))
 71975  			crt.X__builtin_abort(tls)
 71976  		}
 71977  	}()
 71978  	if ((*Xsqlite3_vtab)(_1_p.XpVtab).XnRef) > int32(0) {
 71979  		return int32(6)
 71980  	}
 71981  	_1_p = (*XVTable)(_1_p.XpNext)
 71982  	goto _4
 71983  _7:
 71984  	_1_p = _vtabDisconnectAll(tls, _db, _pTab)
 71985  	_1_xDestroy = func() func(*crt.TLS, *Xsqlite3_vtab) int32 {
 71986  		v := (*Xsqlite3_module)((*XModule)(_1_p.XpMod).XpModule).XxDestroy
 71987  		return *(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&v))
 71988  	}()
 71989  	func() {
 71990  		if _1_xDestroy == nil {
 71991  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125822), unsafe.Pointer(&_sqlite3VtabCallDestroyØ00__func__Ø000), unsafe.Pointer(str(91924)))
 71992  			crt.X__builtin_abort(tls)
 71993  		}
 71994  	}()
 71995  	_rc = _1_xDestroy(tls, (*Xsqlite3_vtab)(_1_p.XpVtab))
 71996  	if _rc == int32(0) {
 71997  		func() {
 71998  			if (*XVTable)(_pTab.XpVTable) != _1_p || (*XVTable)(_1_p.XpNext) != nil {
 71999  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125826), unsafe.Pointer(&_sqlite3VtabCallDestroyØ00__func__Ø000), unsafe.Pointer(str(91936)))
 72000  				crt.X__builtin_abort(tls)
 72001  			}
 72002  		}()
 72003  		*(**Xsqlite3_vtab)(unsafe.Pointer(&_1_p.XpVtab)) = nil
 72004  		*(**XVTable)(unsafe.Pointer(&_pTab.XpVTable)) = nil
 72005  		_sqlite3VtabUnlock(tls, _1_p)
 72006  	}
 72007  _3:
 72008  	return _rc
 72009  }
 72010  
 72011  var _sqlite3VtabCallDestroyØ00__func__Ø000 [23]int8
 72012  
 72013  func init() {
 72014  	crt.Xstrncpy(nil, &_sqlite3VtabCallDestroyØ00__func__Ø000[0], str(91968), 23)
 72015  }
 72016  
 72017  // C comment
 72018  //  /*
 72019  //  ** Set the maximum page count for a database if mxPage is positive.
 72020  //  ** No changes are made if mxPage is 0 or negative.
 72021  //  ** Regardless of the value of mxPage, return the maximum page count.
 72022  //  */
 72023  func _sqlite3BtreeMaxPageCount(tls *crt.TLS, _p *XBtree, _mxPage int32) (r0 int32) {
 72024  	var _n int32
 72025  	_sqlite3BtreeEnter(tls, _p)
 72026  	_n = _sqlite3PagerMaxPageCount(tls, (*XPager)((*XBtShared)(_p.XpBt).XpPager), _mxPage)
 72027  	_sqlite3BtreeLeave(tls, _p)
 72028  	return _n
 72029  }
 72030  
 72031  // C comment
 72032  //  /*
 72033  //  ** Attempt to set the maximum database page count if mxPage is positive.
 72034  //  ** Make no changes if mxPage is zero or negative.  And never reduce the
 72035  //  ** maximum page count below the current size of the database.
 72036  //  **
 72037  //  ** Regardless of mxPage, return the current maximum page count.
 72038  //  */
 72039  func _sqlite3PagerMaxPageCount(tls *crt.TLS, _pPager *XPager, _mxPage int32) (r0 int32) {
 72040  	if _mxPage > int32(0) {
 72041  		_pPager.XmxPgno = uint32(_mxPage)
 72042  	}
 72043  	func() {
 72044  		if int32(_pPager.XeState) == int32(0) {
 72045  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50719), unsafe.Pointer(&_sqlite3PagerMaxPageCountØ00__func__Ø000), unsafe.Pointer(str(91991)))
 72046  			crt.X__builtin_abort(tls)
 72047  		}
 72048  	}()
 72049  	func() {
 72050  		if _pPager.XmxPgno < _pPager.XdbSize {
 72051  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(50720), unsafe.Pointer(&_sqlite3PagerMaxPageCountØ00__func__Ø000), unsafe.Pointer(str(92018)))
 72052  			crt.X__builtin_abort(tls)
 72053  		}
 72054  	}()
 72055  	return int32(_pPager.XmxPgno)
 72056  }
 72057  
 72058  var _sqlite3PagerMaxPageCountØ00__func__Ø000 [25]int8
 72059  
 72060  func init() {
 72061  	crt.Xstrncpy(nil, &_sqlite3PagerMaxPageCountØ00__func__Ø000[0], str(92049), 25)
 72062  }
 72063  
 72064  // C comment
 72065  //  /*
 72066  //  ** This function returns a pointer to a nul-terminated string in memory
 72067  //  ** obtained from sqlite3DbMalloc(). If sqlite3.nVdbeExec is 1, then the
 72068  //  ** string contains a copy of zRawSql but with host parameters expanded to
 72069  //  ** their current bindings. Or, if sqlite3.nVdbeExec is greater than 1,
 72070  //  ** then the returned string holds a copy of zRawSql with "-- " prepended
 72071  //  ** to each line of text.
 72072  //  **
 72073  //  ** If the SQLITE_TRACE_SIZE_LIMIT macro is defined to an integer, then
 72074  //  ** then long strings and blobs are truncated to that many bytes.  This
 72075  //  ** can be used to prevent unreasonably large trace strings when dealing
 72076  //  ** with large (multi-megabyte) strings and blobs.
 72077  //  **
 72078  //  ** The calling function is responsible for making sure the memory returned
 72079  //  ** is eventually freed.
 72080  //  **
 72081  //  ** ALGORITHM:  Scan the input string looking for host parameters in any of
 72082  //  ** these forms:  ?, ?N, $A, @A, :A.  Take care to avoid text within
 72083  //  ** string literals, quoted identifier names, and comments.  For text forms,
 72084  //  ** the host parameter index is found by scanning the prepared
 72085  //  ** statement for the corresponding OP_Variable opcode.  Once the host
 72086  //  ** parameter index is known, locate the value in p->aVar[].  Then render
 72087  //  ** the value as a literal in place of the host parameter name.
 72088  //  */
 72089  func _sqlite3VdbeExpandSql(tls *crt.TLS, _p *TVdbe, _zRawSql *int8) (r0 *int8) {
 72090  	var _idx, _nextIndex, _n, _nToken, _i, _13_nOut, _17_nOut int32
 72091  	var _2_zStart *int8
 72092  	var _13_enc uint8
 72093  	var _db *Xsqlite3
 72094  	var _utf8 XMem
 72095  	var _pVar *XMem
 72096  	var _zBase [100]int8
 72097  	var _out XStrAccum
 72098  	_idx = int32(0)
 72099  	_nextIndex = int32(1)
 72100  	_db = (*Xsqlite3)(_p.Xdb)
 72101  	_sqlite3StrAccumInit(tls, &_out, nil, (*int8)(unsafe.Pointer(&_zBase)), int32(100), *elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), 0))
 72102  	if _db.XnVdbeExec <= int32(1) {
 72103  		goto _0
 72104  	}
 72105  _1:
 72106  	if (*_zRawSql) == 0 {
 72107  		goto _2
 72108  	}
 72109  	_2_zStart = _zRawSql
 72110  _3:
 72111  	if (int32(*postInc1(&_zRawSql, 1)) != int32(10)) && ((*_zRawSql) != 0) {
 72112  		goto _3
 72113  	}
 72114  	_sqlite3StrAccumAppend(tls, &_out, str(70516), int32(3))
 72115  	func() {
 72116  		if int32(uintptr(unsafe.Pointer(_zRawSql))-uintptr(unsafe.Pointer(_2_zStart))) <= int32(0) {
 72117  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78101), unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000), unsafe.Pointer(str(92074)))
 72118  			crt.X__builtin_abort(tls)
 72119  		}
 72120  	}()
 72121  	_sqlite3StrAccumAppend(tls, &_out, _2_zStart, int32(uintptr(unsafe.Pointer(_zRawSql))-uintptr(unsafe.Pointer(_2_zStart))))
 72122  	goto _1
 72123  _2:
 72124  	goto _10
 72125  _0:
 72126  	if int32(_p.XnVar) == int32(0) {
 72127  		_sqlite3StrAccumAppend(tls, &_out, _zRawSql, _sqlite3Strlen30(tls, _zRawSql))
 72128  		goto _10
 72129  	}
 72130  _11:
 72131  	if (*elem1(_zRawSql, 0)) == 0 {
 72132  		goto _12
 72133  	}
 72134  	_n = _findNextHostParameter(tls, _zRawSql, &_nToken)
 72135  	func() {
 72136  		if _n <= int32(0) {
 72137  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78109), unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000), unsafe.Pointer(str(1376)))
 72138  			crt.X__builtin_abort(tls)
 72139  		}
 72140  	}()
 72141  	_sqlite3StrAccumAppend(tls, &_out, _zRawSql, _n)
 72142  	*(*uintptr)(unsafe.Pointer(&_zRawSql)) += uintptr(_n)
 72143  	func() {
 72144  		if (*elem1(_zRawSql, 0)) == 0 && _nToken != int32(0) {
 72145  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78112), unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000), unsafe.Pointer(str(92097)))
 72146  			crt.X__builtin_abort(tls)
 72147  		}
 72148  	}()
 72149  	if _nToken == int32(0) {
 72150  		goto _12
 72151  	}
 72152  	if int32(*elem1(_zRawSql, 0)) != int32(63) {
 72153  		goto _19
 72154  	}
 72155  	if _nToken > int32(1) {
 72156  		func() {
 72157  			if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_zRawSql, uintptr(1)))))) & int32(4)) == 0 {
 72158  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78116), unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000), unsafe.Pointer(str(92121)))
 72159  				crt.X__builtin_abort(tls)
 72160  			}
 72161  		}()
 72162  		_sqlite3GetInt32(tls, elem1(_zRawSql, uintptr(1)), &_idx)
 72163  		goto _23
 72164  	}
 72165  	_idx = _nextIndex
 72166  _23:
 72167  	goto _24
 72168  _19:
 72169  	func() {
 72170  		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) {
 72171  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78122), unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000), unsafe.Pointer(str(92148)))
 72172  			crt.X__builtin_abort(tls)
 72173  		}
 72174  	}()
 72175  	_idx = _sqlite3VdbeParameterIndex(tls, _p, _zRawSql, _nToken)
 72176  	func() {
 72177  		if _idx <= int32(0) {
 72178  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78129), unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000), unsafe.Pointer(str(92221)))
 72179  			crt.X__builtin_abort(tls)
 72180  		}
 72181  	}()
 72182  _24:
 72183  	*(*uintptr)(unsafe.Pointer(&_zRawSql)) += uintptr(_nToken)
 72184  	_nextIndex = _idx + int32(1)
 72185  	func() {
 72186  		if _idx <= int32(0) || _idx > int32(_p.XnVar) {
 72187  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78133), unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000), unsafe.Pointer(str(92227)))
 72188  			crt.X__builtin_abort(tls)
 72189  		}
 72190  	}()
 72191  	_pVar = elem25((*XMem)(_p.XaVar), uintptr(_idx-int32(1)))
 72192  	if (int32(_pVar.Xflags) & int32(1)) != 0 {
 72193  		_sqlite3StrAccumAppend(tls, &_out, str(285), int32(4))
 72194  		goto _47
 72195  	}
 72196  	if (int32(_pVar.Xflags) & int32(4)) != 0 {
 72197  		_sqlite3XPrintf(tls, &_out, str(6249), *(*int64)(unsafe.Pointer(&_pVar.Xu)))
 72198  		goto _47
 72199  	}
 72200  	if (int32(_pVar.Xflags) & int32(8)) != 0 {
 72201  		_sqlite3XPrintf(tls, &_out, str(6268), *(*float64)(unsafe.Pointer(&_pVar.Xu)))
 72202  		goto _47
 72203  	}
 72204  	if (int32(_pVar.Xflags) & int32(2)) == 0 {
 72205  		goto _41
 72206  	}
 72207  	_13_enc = _db.Xenc
 72208  	if int32(_13_enc) == int32(1) {
 72209  		goto _42
 72210  	}
 72211  	crt.Xmemset(tls, unsafe.Pointer(&_utf8), int32(0), uint32(48))
 72212  	*(**Xsqlite3)(unsafe.Pointer(&_utf8.Xdb)) = _db
 72213  	_sqlite3VdbeMemSetStr(tls, &_utf8, _pVar.Xz, _pVar.Xn, _13_enc, nil)
 72214  	if int32(7) == _sqlite3VdbeChangeEncoding(tls, &_utf8, int32(1)) {
 72215  		_out.XaccError = uint8(1)
 72216  		_out.XnAlloc = 0
 72217  	}
 72218  	_pVar = &_utf8
 72219  _42:
 72220  	_13_nOut = _pVar.Xn
 72221  	_sqlite3XPrintf(tls, &_out, str(92249), _13_nOut, unsafe.Pointer(_pVar.Xz))
 72222  	if int32(_13_enc) != int32(1) {
 72223  		_sqlite3VdbeMemRelease(tls, &_utf8)
 72224  	}
 72225  	goto _47
 72226  _41:
 72227  	if (int32(_pVar.Xflags) & int32(16384)) != 0 {
 72228  		_sqlite3XPrintf(tls, &_out, str(92256), *(*int32)(unsafe.Pointer(&_pVar.Xu)))
 72229  		goto _47
 72230  	}
 72231  	func() {
 72232  		if (int32(_pVar.Xflags) & int32(16)) == 0 {
 72233  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78176), unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000), unsafe.Pointer(str(92269)))
 72234  			crt.X__builtin_abort(tls)
 72235  		}
 72236  	}()
 72237  	_sqlite3StrAccumAppend(tls, &_out, str(92292), int32(2))
 72238  	_17_nOut = _pVar.Xn
 72239  	_i = int32(0)
 72240  _50:
 72241  	if _i >= _17_nOut {
 72242  		goto _53
 72243  	}
 72244  	_sqlite3XPrintf(tls, &_out, str(92295), int32(*elem1(_pVar.Xz, uintptr(_i)))&int32(255))
 72245  	_i += 1
 72246  	goto _50
 72247  _53:
 72248  	_sqlite3StrAccumAppend(tls, &_out, str(92300), int32(1))
 72249  _47:
 72250  	goto _11
 72251  _12:
 72252  _10:
 72253  	if _out.XaccError != 0 {
 72254  		_sqlite3StrAccumReset(tls, &_out)
 72255  	}
 72256  	return _sqlite3StrAccumFinish(tls, &_out)
 72257  
 72258  	_ = _zBase
 72259  	panic(0)
 72260  }
 72261  
 72262  var _sqlite3VdbeExpandSqlØ00__func__Ø000 [21]int8
 72263  
 72264  func init() {
 72265  	crt.Xstrncpy(nil, &_sqlite3VdbeExpandSqlØ00__func__Ø000[0], str(92302), 21)
 72266  }
 72267  
 72268  // C comment
 72269  //  /*
 72270  //  ** zSql is a zero-terminated string of UTF-8 SQL text.  Return the number of
 72271  //  ** bytes in this text up to but excluding the first character in
 72272  //  ** a host parameter.  If the text contains no host parameters, return
 72273  //  ** the total number of bytes in the text.
 72274  //  */
 72275  func _findNextHostParameter(tls *crt.TLS, _zSql *int8, _pnToken *int32) (r0 int32) {
 72276  	var _tokenType, _nTotal, _n int32
 72277  	_nTotal = int32(0)
 72278  	*_pnToken = int32(0)
 72279  _0:
 72280  	if (*elem1(_zSql, 0)) == 0 {
 72281  		goto _1
 72282  	}
 72283  	_n = _sqlite3GetToken(tls, (*uint8)(unsafe.Pointer(_zSql)), &_tokenType)
 72284  	func() {
 72285  		if _n <= int32(0) || _tokenType == int32(164) {
 72286  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78041), unsafe.Pointer(&_findNextHostParameterØ00__func__Ø000), unsafe.Pointer(str(92323)))
 72287  			crt.X__builtin_abort(tls)
 72288  		}
 72289  	}()
 72290  	if _tokenType == int32(135) {
 72291  		*_pnToken = _n
 72292  		goto _1
 72293  	}
 72294  	_nTotal += _n
 72295  	*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(_n)
 72296  	goto _0
 72297  _1:
 72298  	return _nTotal
 72299  }
 72300  
 72301  var _findNextHostParameterØ00__func__Ø000 [22]int8
 72302  
 72303  func init() {
 72304  	crt.Xstrncpy(nil, &_findNextHostParameterØ00__func__Ø000[0], str(92352), 22)
 72305  }
 72306  
 72307  // C comment
 72308  //  /*
 72309  //  ** The sqlite3_strlike() interface.  Return 0 on a match and non-zero for
 72310  //  ** a miss - like strcmp().
 72311  //  */
 72312  func Xsqlite3_strlike(tls *crt.TLS, _zPattern *int8, _zStr *int8, _esc uint32) (r0 int32) {
 72313  	return _patternCompare(tls, (*uint8)(unsafe.Pointer(_zPattern)), (*uint8)(unsafe.Pointer(_zStr)), &_likeInfoNorm, _esc)
 72314  }
 72315  
 72316  // C comment
 72317  //  /* The correct SQL-92 behavior is for the LIKE operator to ignore
 72318  //  ** case.  Thus  'a' LIKE 'A' would be true. */
 72319  var _likeInfoNorm TcompareInfo
 72320  
 72321  func init() {
 72322  	_likeInfoNorm = TcompareInfo{XmatchAll: uint8(37), XmatchOne: uint8(95), XnoCase: uint8(1)}
 72323  }
 72324  
 72325  // C comment
 72326  //  /*
 72327  //  ** This function is called after a transaction has been committed. It
 72328  //  ** invokes callbacks registered with sqlite3_wal_hook() as required.
 72329  //  */
 72330  func _doWalCallbacks(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
 72331  	var _rc, _i, _2_nEntry int32
 72332  	var _1_pBt *XBtree
 72333  	_rc = int32(0)
 72334  	_i = int32(0)
 72335  _0:
 72336  	if _i >= _db.XnDb {
 72337  		goto _3
 72338  	}
 72339  	_1_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
 72340  	if _1_pBt == nil {
 72341  		goto _4
 72342  	}
 72343  	_sqlite3BtreeEnter(tls, _1_pBt)
 72344  	_2_nEntry = _sqlite3PagerWalCallback(tls, _sqlite3BtreePager(tls, _1_pBt))
 72345  	_sqlite3BtreeLeave(tls, _1_pBt)
 72346  	if ((_db.XxWalCallback != nil) && (_2_nEntry > int32(0))) && (_rc == int32(0)) {
 72347  		_rc = func() func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32 {
 72348  			v := _db.XxWalCallback
 72349  			return *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32)(unsafe.Pointer(&v))
 72350  		}()(tls, _db.XpWalArg, _db, elem27((*XDb)(_db.XaDb), uintptr(_i)).XzDbSName, _2_nEntry)
 72351  	}
 72352  _4:
 72353  	_i += 1
 72354  	goto _0
 72355  _3:
 72356  	return _rc
 72357  }
 72358  
 72359  func _sqlite3PagerWalCallback(tls *crt.TLS, _pPager *XPager) (r0 int32) {
 72360  	return _sqlite3WalCallback(tls, (*XWal)(_pPager.XpWal))
 72361  }
 72362  
 72363  // C comment
 72364  //  /* Return the value to pass to a sqlite3_wal_hook callback, the
 72365  //  ** number of frames in the WAL at the point of the last commit since
 72366  //  ** sqlite3WalCallback() was called.  If no commits have occurred since
 72367  //  ** the last call, then return 0.
 72368  //  */
 72369  func _sqlite3WalCallback(tls *crt.TLS, _pWal *XWal) (r0 int32) {
 72370  	var _ret uint32
 72371  	_ret = uint32(0)
 72372  	if _pWal != nil {
 72373  		_ret = _pWal.XiCallback
 72374  		_pWal.XiCallback = 0
 72375  	}
 72376  	return int32(_ret)
 72377  }
 72378  
 72379  // C comment
 72380  //  /*
 72381  //  ** Rerun the compilation of a statement after a schema change.
 72382  //  **
 72383  //  ** If the statement is successfully recompiled, return SQLITE_OK. Otherwise,
 72384  //  ** if the statement cannot be recompiled because another connection has
 72385  //  ** locked the sqlite3_master table, return SQLITE_LOCKED. If any other error
 72386  //  ** occurs, return SQLITE_SCHEMA.
 72387  //  */
 72388  func _sqlite3Reprepare(tls *crt.TLS, _p *TVdbe) (r0 int32) {
 72389  	var _rc int32
 72390  	var _zSql *int8
 72391  	var _pNew unsafe.Pointer
 72392  	var _db *Xsqlite3
 72393  	func() {
 72394  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_sqlite3VdbeDb(tls, _p).Xmutex)) == 0 {
 72395  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116374), unsafe.Pointer(&_sqlite3ReprepareØ00__func__Ø000), unsafe.Pointer(str(92374)))
 72396  			crt.X__builtin_abort(tls)
 72397  		}
 72398  	}()
 72399  	_zSql = Xsqlite3_sql(tls, unsafe.Pointer(_p))
 72400  	func() {
 72401  		if _zSql == nil {
 72402  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116376), unsafe.Pointer(&_sqlite3ReprepareØ00__func__Ø000), unsafe.Pointer(str(24569)))
 72403  			crt.X__builtin_abort(tls)
 72404  		}
 72405  	}()
 72406  	_db = _sqlite3VdbeDb(tls, _p)
 72407  	func() {
 72408  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.Xmutex)) == 0 {
 72409  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116378), unsafe.Pointer(&_sqlite3ReprepareØ00__func__Ø000), unsafe.Pointer(str(881)))
 72410  			crt.X__builtin_abort(tls)
 72411  		}
 72412  	}()
 72413  	_rc = _sqlite3LockAndPrepare(tls, _db, _zSql, int32(-1), int32(0), _p, &_pNew, nil)
 72414  	if _rc == 0 {
 72415  		goto _6
 72416  	}
 72417  	if _rc == int32(7) {
 72418  		_sqlite3OomFault(tls, _db)
 72419  	}
 72420  	func() {
 72421  		if _pNew != nil {
 72422  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116384), unsafe.Pointer(&_sqlite3ReprepareØ00__func__Ø000), unsafe.Pointer(str(92418)))
 72423  			crt.X__builtin_abort(tls)
 72424  		}
 72425  	}()
 72426  	return _rc
 72427  
 72428  _6:
 72429  	func() {
 72430  		if _pNew == nil {
 72431  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116387), unsafe.Pointer(&_sqlite3ReprepareØ00__func__Ø000), unsafe.Pointer(str(21101)))
 72432  			crt.X__builtin_abort(tls)
 72433  		}
 72434  	}()
 72435  	_sqlite3VdbeSwap(tls, (*TVdbe)(_pNew), _p)
 72436  	_sqlite3TransferBindings(tls, _pNew, unsafe.Pointer(_p))
 72437  	_sqlite3VdbeResetStepResult(tls, (*TVdbe)(_pNew))
 72438  	_sqlite3VdbeFinalize(tls, (*TVdbe)(_pNew))
 72439  	return int32(0)
 72440  }
 72441  
 72442  var _sqlite3ReprepareØ00__func__Ø000 [17]int8
 72443  
 72444  func init() {
 72445  	crt.Xstrncpy(nil, &_sqlite3ReprepareØ00__func__Ø000[0], str(92426), 17)
 72446  }
 72447  
 72448  // C comment
 72449  //  /*
 72450  //  ** Return the SQL associated with a prepared statement
 72451  //  */
 72452  func Xsqlite3_sql(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 *int8) {
 72453  	var _p *TVdbe
 72454  	_p = (*TVdbe)(_pStmt)
 72455  	return func() *int8 {
 72456  		if _p != nil {
 72457  			return _p.XzSql
 72458  		}
 72459  		return nil
 72460  	}()
 72461  }
 72462  
 72463  // C comment
 72464  //  /*
 72465  //  ** Swap all content between two VDBE structures.
 72466  //  */
 72467  func _sqlite3VdbeSwap(tls *crt.TLS, _pA *TVdbe, _pB *TVdbe) {
 72468  	var _zTmp *int8
 72469  	var _pTmp *TVdbe
 72470  	var _tmp TVdbe
 72471  	func() {
 72472  		if (*Xsqlite3)(_pA.Xdb) != (*Xsqlite3)(_pB.Xdb) {
 72473  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71495), unsafe.Pointer(&_sqlite3VdbeSwapØ00__func__Ø000), unsafe.Pointer(str(92443)))
 72474  			crt.X__builtin_abort(tls)
 72475  		}
 72476  	}()
 72477  	_tmp = *_pA
 72478  	*_pA = *_pB
 72479  	*_pB = _tmp
 72480  	_pTmp = (*TVdbe)(_pA.XpNext)
 72481  	*(**TVdbe)(unsafe.Pointer(&_pA.XpNext)) = (*TVdbe)(_pB.XpNext)
 72482  	*(**TVdbe)(unsafe.Pointer(&_pB.XpNext)) = _pTmp
 72483  	_pTmp = (*TVdbe)(_pA.XpPrev)
 72484  	*(**TVdbe)(unsafe.Pointer(&_pA.XpPrev)) = (*TVdbe)(_pB.XpPrev)
 72485  	*(**TVdbe)(unsafe.Pointer(&_pB.XpPrev)) = _pTmp
 72486  	_zTmp = _pA.XzSql
 72487  	_pA.XzSql = _pB.XzSql
 72488  	_pB.XzSql = _zTmp
 72489  	storebits26(&_pB.Xexpired, int16((uint32(_pA.Xexpired>>9)<<31)>>31), 512, 9)
 72490  	_pB.Xexpmask = _pA.Xexpmask
 72491  }
 72492  
 72493  var _sqlite3VdbeSwapØ00__func__Ø000 [16]int8
 72494  
 72495  func init() {
 72496  	crt.Xstrncpy(nil, &_sqlite3VdbeSwapØ00__func__Ø000[0], str(92458), 16)
 72497  }
 72498  
 72499  // C comment
 72500  //  /*
 72501  //  ** Transfer all bindings from the first statement over to the second.
 72502  //  */
 72503  func _sqlite3TransferBindings(tls *crt.TLS, _pFromStmt unsafe.Pointer, _pToStmt unsafe.Pointer) (r0 int32) {
 72504  	var _i int32
 72505  	var _pFrom, _pTo *TVdbe
 72506  	_pFrom = (*TVdbe)(_pFromStmt)
 72507  	_pTo = (*TVdbe)(_pToStmt)
 72508  	func() {
 72509  		if (*Xsqlite3)(_pTo.Xdb) != (*Xsqlite3)(_pFrom.Xdb) {
 72510  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(77607), unsafe.Pointer(&_sqlite3TransferBindingsØ00__func__Ø000), unsafe.Pointer(str(71180)))
 72511  			crt.X__builtin_abort(tls)
 72512  		}
 72513  	}()
 72514  	func() {
 72515  		if int32(_pTo.XnVar) != int32(_pFrom.XnVar) {
 72516  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(77608), unsafe.Pointer(&_sqlite3TransferBindingsØ00__func__Ø000), unsafe.Pointer(str(92474)))
 72517  			crt.X__builtin_abort(tls)
 72518  		}
 72519  	}()
 72520  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pTo.Xdb).Xmutex))
 72521  	_i = int32(0)
 72522  _4:
 72523  	if _i >= int32(_pFrom.XnVar) {
 72524  		goto _7
 72525  	}
 72526  	_sqlite3VdbeMemMove(tls, elem25((*XMem)(_pTo.XaVar), uintptr(_i)), elem25((*XMem)(_pFrom.XaVar), uintptr(_i)))
 72527  	_i += 1
 72528  	goto _4
 72529  _7:
 72530  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pTo.Xdb).Xmutex))
 72531  	return int32(0)
 72532  }
 72533  
 72534  var _sqlite3TransferBindingsØ00__func__Ø000 [24]int8
 72535  
 72536  func init() {
 72537  	crt.Xstrncpy(nil, &_sqlite3TransferBindingsØ00__func__Ø000[0], str(92497), 24)
 72538  }
 72539  
 72540  // C comment
 72541  //  /*
 72542  //  ** Each VDBE holds the result of the most recent sqlite3_step() call
 72543  //  ** in p->rc.  This routine sets that result back to SQLITE_OK.
 72544  //  */
 72545  func _sqlite3VdbeResetStepResult(tls *crt.TLS, _p *TVdbe) {
 72546  	_p.Xrc = int32(0)
 72547  }
 72548  
 72549  var _sqlite3_stepØ00__func__Ø000 [13]int8
 72550  
 72551  func init() {
 72552  	crt.Xstrncpy(nil, &_sqlite3_stepØ00__func__Ø000[0], str(92521), 13)
 72553  }
 72554  
 72555  // C comment
 72556  //  /*
 72557  //  ** Parameter zName points to a nul-terminated buffer containing the name
 72558  //  ** of a database ("main", "temp" or the name of an attached db). This
 72559  //  ** function returns the index of the named database in db->aDb[], or
 72560  //  ** -1 if the named db cannot be found.
 72561  //  */
 72562  func _sqlite3FindDbName(tls *crt.TLS, _db *Xsqlite3, _zName *int8) (r0 int32) {
 72563  	var _i int32
 72564  	var _1_pDb *XDb
 72565  	_i = int32(-1)
 72566  	if _zName == nil {
 72567  		goto _0
 72568  	}
 72569  	*func() **XDb { _i = _db.XnDb - int32(1); return &_1_pDb }() = elem27((*XDb)(_db.XaDb), uintptr(_i))
 72570  _1:
 72571  	if _i < int32(0) {
 72572  		goto _4
 72573  	}
 72574  	if int32(0) == Xsqlite3_stricmp(tls, _1_pDb.XzDbSName, _zName) {
 72575  		goto _4
 72576  	}
 72577  	if (_i == int32(0)) && (int32(0) == Xsqlite3_stricmp(tls, str(92534), _zName)) {
 72578  		goto _4
 72579  	}
 72580  	*(*uintptr)(unsafe.Pointer(func() **XDb { _i -= 1; return &_1_pDb }())) += uintptr(4294967280)
 72581  	goto _1
 72582  _4:
 72583  _0:
 72584  	return _i
 72585  }
 72586  
 72587  // C comment
 72588  //  /*
 72589  //  ** Check to see if zTabName is really the name of a pragma.  If it is,
 72590  //  ** then register an eponymous virtual table for that pragma and return
 72591  //  ** a pointer to the Module object for the new virtual table.
 72592  //  */
 72593  func _sqlite3PragmaVtabRegister(tls *crt.TLS, _db *Xsqlite3, _zName *int8) (r0 *XModule) {
 72594  	var _pName *XPragmaName
 72595  	func() {
 72596  		if Xsqlite3_strnicmp(tls, _zName, str(49769), int32(7)) != int32(0) {
 72597  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115653), unsafe.Pointer(&_sqlite3PragmaVtabRegisterØ00__func__Ø000), unsafe.Pointer(str(92539)))
 72598  			crt.X__builtin_abort(tls)
 72599  		}
 72600  	}()
 72601  	_pName = _pragmaLocate(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zName))+uintptr(int32(7)))))
 72602  	if _pName == nil {
 72603  		return nil
 72604  	}
 72605  	if (int32(_pName.XmPragFlg) & int32(48)) == int32(0) {
 72606  		return nil
 72607  	}
 72608  	func() {
 72609  		if _sqlite3HashFind(tls, &_db.XaModule, _zName) != nil {
 72610  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115657), unsafe.Pointer(&_sqlite3PragmaVtabRegisterØ00__func__Ø000), unsafe.Pointer(str(92580)))
 72611  			crt.X__builtin_abort(tls)
 72612  		}
 72613  	}()
 72614  	return _sqlite3VtabCreateModule(tls, _db, _zName, &_pragmaVtabModule, unsafe.Pointer(_pName), nil)
 72615  }
 72616  
 72617  var _sqlite3PragmaVtabRegisterØ00__func__Ø000 [26]int8
 72618  
 72619  func init() {
 72620  	crt.Xstrncpy(nil, &_sqlite3PragmaVtabRegisterØ00__func__Ø000[0], str(92620), 26)
 72621  }
 72622  
 72623  // C comment
 72624  //  /*
 72625  //  ** Locate a pragma in the aPragmaName[] array.
 72626  //  */
 72627  func _pragmaLocate(tls *crt.TLS, _zName *int8) (r0 *XPragmaName) {
 72628  	var _upr, _lwr, _mid, _rc int32
 72629  	_mid = int32(0)
 72630  	_lwr = int32(0)
 72631  	_upr = int32(66)
 72632  _0:
 72633  	if _lwr > _upr {
 72634  		goto _1
 72635  	}
 72636  	_mid = (_lwr + _upr) / int32(2)
 72637  	_rc = Xsqlite3_stricmp(tls, _zName, elem95((*XPragmaName)(unsafe.Pointer(&_aPragmaName)), uintptr(_mid)).XzName)
 72638  	if _rc == int32(0) {
 72639  		goto _1
 72640  	}
 72641  	if _rc < int32(0) {
 72642  		_upr = _mid - int32(1)
 72643  		goto _4
 72644  	}
 72645  	_lwr = _mid + int32(1)
 72646  _4:
 72647  	goto _0
 72648  _1:
 72649  	return func() *XPragmaName {
 72650  		if _lwr > _upr {
 72651  			return nil
 72652  		}
 72653  		return elem95((*XPragmaName)(unsafe.Pointer(&_aPragmaName)), uintptr(_mid))
 72654  	}()
 72655  }
 72656  
 72657  var _aPragmaName [67]XPragmaName
 72658  
 72659  func init() {
 72660  	_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)}}
 72661  }
 72662  
 72663  // C comment
 72664  //  /* The pragma virtual table object */
 72665  var _pragmaVtabModule Xsqlite3_module
 72666  
 72667  func init() {
 72668  	_pragmaVtabModule = Xsqlite3_module{XxConnect: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, **int8, *unsafe.Pointer, **int8) int32)(unsafe.Pointer(&struct {
 72669  		f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32
 72670  	}{_pragmaVtabConnect})), XxBestIndex: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 72671  		f func(*crt.TLS, *Xsqlite3_vtab, *Xsqlite3_index_info) int32
 72672  	}{_pragmaVtabBestIndex})), XxDisconnect: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 72673  		f func(*crt.TLS, *Xsqlite3_vtab) int32
 72674  	}{_pragmaVtabDisconnect})), XxOpen: *(*func(*crt.TLS, unsafe.Pointer, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 72675  		f func(*crt.TLS, *Xsqlite3_vtab, **Xsqlite3_vtab_cursor) int32
 72676  	}{_pragmaVtabOpen})), XxClose: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 72677  		f func(*crt.TLS, *Xsqlite3_vtab_cursor) int32
 72678  	}{_pragmaVtabClose})), XxFilter: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 72679  		f func(*crt.TLS, *Xsqlite3_vtab_cursor, int32, *int8, int32, **XMem) int32
 72680  	}{_pragmaVtabFilter})), XxNext: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 72681  		f func(*crt.TLS, *Xsqlite3_vtab_cursor) int32
 72682  	}{_pragmaVtabNext})), XxEof: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
 72683  		f func(*crt.TLS, *Xsqlite3_vtab_cursor) int32
 72684  	}{_pragmaVtabEof})), XxColumn: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
 72685  		f func(*crt.TLS, *Xsqlite3_vtab_cursor, *Xsqlite3_context, int32) int32
 72686  	}{_pragmaVtabColumn})), XxRowid: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
 72687  		f func(*crt.TLS, *Xsqlite3_vtab_cursor, *int64) int32
 72688  	}{_pragmaVtabRowid}))}
 72689  }
 72690  
 72691  // C comment
 72692  //  /*
 72693  //  ** Pragma virtual table module xConnect method.
 72694  //  */
 72695  func _pragmaVtabConnect(tls *crt.TLS, _db *Xsqlite3, _pAux unsafe.Pointer, _argc int32, _argv **int8, _ppVtab **Xsqlite3_vtab, _pzErr **int8) (r0 int32) {
 72696  	var _rc, _i, _j int32
 72697  	var _cSep int8
 72698  	var _acc XStrAccum
 72699  	var _zBuf [200]int8
 72700  	var _pPragma *XPragmaName
 72701  	var _pTab *XPragmaVtab
 72702  	_pPragma = (*XPragmaName)(_pAux)
 72703  	_pTab = nil
 72704  	_cSep = int8(40)
 72705  
 72706  	_sqlite3StrAccumInit(tls, &_acc, nil, (*int8)(unsafe.Pointer(&_zBuf)), int32(200), int32(0))
 72707  	_sqlite3StrAccumAppendAll(tls, &_acc, str(93618))
 72708  	*func() *int32 { _i = int32(0); return &_j }() = int32(_pPragma.XiPragCName)
 72709  _0:
 72710  	if _i >= int32(_pPragma.XnPragCName) {
 72711  		goto _3
 72712  	}
 72713  	_sqlite3XPrintf(tls, &_acc, str(93633), int32(_cSep), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_pragCName)), uintptr(_j))))
 72714  	_cSep = int8(44)
 72715  	*func() *int32 { _i += 1; return &_j }() += 1
 72716  	goto _0
 72717  _3:
 72718  	if _i == int32(0) {
 72719  		_sqlite3XPrintf(tls, &_acc, str(93640), unsafe.Pointer(_pPragma.XzName))
 72720  		_cSep = int8(44)
 72721  		_i += 1
 72722  	}
 72723  	_j = int32(0)
 72724  	if (int32(_pPragma.XmPragFlg) & int32(32)) != 0 {
 72725  		_sqlite3StrAccumAppendAll(tls, &_acc, str(93646))
 72726  		_j += 1
 72727  	}
 72728  	if (int32(_pPragma.XmPragFlg) & int32(192)) != 0 {
 72729  		_sqlite3StrAccumAppendAll(tls, &_acc, str(93658))
 72730  		_j += 1
 72731  	}
 72732  	_sqlite3StrAccumAppend(tls, &_acc, str(37853), int32(1))
 72733  	_sqlite3StrAccumFinish(tls, &_acc)
 72734  	func() {
 72735  		if crt.Xstrlen(tls, (*int8)(unsafe.Pointer(&_zBuf))) >= uint32(199) {
 72736  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115419), unsafe.Pointer(&_pragmaVtabConnectØ00__func__Ø000), unsafe.Pointer(str(93673)))
 72737  			crt.X__builtin_abort(tls)
 72738  		}
 72739  	}()
 72740  	_rc = Xsqlite3_declare_vtab(tls, _db, (*int8)(unsafe.Pointer(&_zBuf)))
 72741  	if _rc != int32(0) {
 72742  		goto _9
 72743  	}
 72744  	_pTab = (*XPragmaVtab)(Xsqlite3_malloc(tls, int32(24)))
 72745  	if _pTab == nil {
 72746  		_rc = int32(7)
 72747  		goto _11
 72748  	}
 72749  	crt.Xmemset(tls, unsafe.Pointer(_pTab), int32(0), uint32(24))
 72750  	*(**XPragmaName)(unsafe.Pointer(&_pTab.XpName)) = _pPragma
 72751  	*(**Xsqlite3)(unsafe.Pointer(&_pTab.Xdb)) = _db
 72752  	_pTab.XiHidden = uint8(_i)
 72753  	_pTab.XnHidden = uint8(_j)
 72754  _11:
 72755  	goto _12
 72756  _9:
 72757  	*_pzErr = Xsqlite3_mprintf(tls, str(24531), unsafe.Pointer(Xsqlite3_errmsg(tls, _db)))
 72758  _12:
 72759  	*_ppVtab = (*Xsqlite3_vtab)(unsafe.Pointer(_pTab))
 72760  	return _rc
 72761  
 72762  	_ = _zBuf
 72763  	panic(0)
 72764  }
 72765  
 72766  // C comment
 72767  //  /*
 72768  //  ** Append the complete text of zero-terminated string z[] to the p string.
 72769  //  */
 72770  func _sqlite3StrAccumAppendAll(tls *crt.TLS, _p *XStrAccum, _z *int8) {
 72771  	_sqlite3StrAccumAppend(tls, _p, _z, _sqlite3Strlen30(tls, _z))
 72772  }
 72773  
 72774  // C comment
 72775  //  /* Names of columns for pragmas that return multi-column result
 72776  //  ** or that return single-column results where the name of the
 72777  //  ** result column is different from the name of the pragma
 72778  //  */
 72779  var _pragCName [49]*int8
 72780  
 72781  func init() {
 72782  	_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)}
 72783  }
 72784  
 72785  var _pragmaVtabConnectØ00__func__Ø000 [18]int8
 72786  
 72787  func init() {
 72788  	crt.Xstrncpy(nil, &_pragmaVtabConnectØ00__func__Ø000[0], str(93909), 18)
 72789  }
 72790  
 72791  // C comment
 72792  //  /* Figure out the best index to use to search a pragma virtual table.
 72793  //  **
 72794  //  ** There are not really any index choices.  But we want to encourage the
 72795  //  ** query planner to give == constraints on as many hidden parameters as
 72796  //  ** possible, and especially on the first hidden parameter.  So return a
 72797  //  ** high cost if hidden parameters are unconstrained.
 72798  //  */
 72799  func _pragmaVtabBestIndex(tls *crt.TLS, _tab *Xsqlite3_vtab, _pIdxInfo *Xsqlite3_index_info) (r0 int32) {
 72800  	var _i, _j int32
 72801  	var _seen [2]int32
 72802  	var _pTab *XPragmaVtab
 72803  	var _pConstraint *Tsqlite3_index_constraint
 72804  	_pTab = (*XPragmaVtab)(unsafe.Pointer(_tab))
 72805  	_pIdxInfo.XestimatedCost = float64(1)
 72806  	if int32(_pTab.XnHidden) == int32(0) {
 72807  		return int32(0)
 72808  	}
 72809  	_pConstraint = (*Tsqlite3_index_constraint)(_pIdxInfo.XaConstraint)
 72810  	*elem8((*int32)(unsafe.Pointer(&_seen)), 0) = int32(0)
 72811  	*elem8((*int32)(unsafe.Pointer(&_seen)), uintptr(1)) = int32(0)
 72812  	_i = int32(0)
 72813  _1:
 72814  	if _i >= _pIdxInfo.XnConstraint {
 72815  		goto _4
 72816  	}
 72817  	if int32(_pConstraint.Xusable) == int32(0) {
 72818  		goto _2
 72819  	}
 72820  	if int32(_pConstraint.Xop) != int32(2) {
 72821  		goto _2
 72822  	}
 72823  	if _pConstraint.XiColumn < int32(_pTab.XiHidden) {
 72824  		goto _2
 72825  	}
 72826  	_j = _pConstraint.XiColumn - int32(_pTab.XiHidden)
 72827  	func() {
 72828  		if _j >= int32(2) {
 72829  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115472), unsafe.Pointer(&_pragmaVtabBestIndexØ00__func__Ø000), unsafe.Pointer(str(93927)))
 72830  			crt.X__builtin_abort(tls)
 72831  		}
 72832  	}()
 72833  	*elem8((*int32)(unsafe.Pointer(&_seen)), uintptr(_j)) = _i + int32(1)
 72834  _2:
 72835  	*(*uintptr)(unsafe.Pointer(func() **Tsqlite3_index_constraint { _i += 1; return &_pConstraint }())) += uintptr(12)
 72836  	goto _1
 72837  _4:
 72838  	if (*elem8((*int32)(unsafe.Pointer(&_seen)), 0)) == int32(0) {
 72839  		_pIdxInfo.XestimatedCost = 2.147483647e+09
 72840  		_pIdxInfo.XestimatedRows = int64(2147483647)
 72841  		return int32(0)
 72842  	}
 72843  	_j = (*elem8((*int32)(unsafe.Pointer(&_seen)), 0)) - int32(1)
 72844  	elem96((*Tsqlite3_index_constraint_usage)(_pIdxInfo.XaConstraintUsage), uintptr(_j)).XargvIndex = int32(1)
 72845  	elem96((*Tsqlite3_index_constraint_usage)(_pIdxInfo.XaConstraintUsage), uintptr(_j)).Xomit = uint8(1)
 72846  	if (*elem8((*int32)(unsafe.Pointer(&_seen)), uintptr(1))) == int32(0) {
 72847  		return int32(0)
 72848  	}
 72849  	_pIdxInfo.XestimatedCost = float64(20)
 72850  	_pIdxInfo.XestimatedRows = int64(20)
 72851  	_j = (*elem8((*int32)(unsafe.Pointer(&_seen)), uintptr(1))) - int32(1)
 72852  	elem96((*Tsqlite3_index_constraint_usage)(_pIdxInfo.XaConstraintUsage), uintptr(_j)).XargvIndex = int32(2)
 72853  	elem96((*Tsqlite3_index_constraint_usage)(_pIdxInfo.XaConstraintUsage), uintptr(_j)).Xomit = uint8(1)
 72854  	return int32(0)
 72855  
 72856  	_ = _seen
 72857  	panic(0)
 72858  }
 72859  
 72860  var _pragmaVtabBestIndexØ00__func__Ø000 [20]int8
 72861  
 72862  func init() {
 72863  	crt.Xstrncpy(nil, &_pragmaVtabBestIndexØ00__func__Ø000[0], str(93933), 20)
 72864  }
 72865  
 72866  // C comment
 72867  //  /*
 72868  //  ** Pragma virtual table module xDisconnect method.
 72869  //  */
 72870  func _pragmaVtabDisconnect(tls *crt.TLS, _pVtab *Xsqlite3_vtab) (r0 int32) {
 72871  	var _pTab *XPragmaVtab
 72872  	_pTab = (*XPragmaVtab)(unsafe.Pointer(_pVtab))
 72873  	Xsqlite3_free(tls, unsafe.Pointer(_pTab))
 72874  	return int32(0)
 72875  }
 72876  
 72877  // C comment
 72878  //  /* Create a new cursor for the pragma virtual table */
 72879  func _pragmaVtabOpen(tls *crt.TLS, _pVtab *Xsqlite3_vtab, _ppCursor **Xsqlite3_vtab_cursor) (r0 int32) {
 72880  	var _pCsr *XPragmaVtabCursor
 72881  	_pCsr = (*XPragmaVtabCursor)(Xsqlite3_malloc(tls, int32(24)))
 72882  	if _pCsr == nil {
 72883  		return int32(7)
 72884  	}
 72885  	crt.Xmemset(tls, unsafe.Pointer(_pCsr), int32(0), uint32(24))
 72886  	*(**Xsqlite3_vtab)(unsafe.Pointer(&(_pCsr.Xbase.XpVtab))) = _pVtab
 72887  	*_ppCursor = &_pCsr.Xbase
 72888  	return int32(0)
 72889  }
 72890  
 72891  // C comment
 72892  //  /* Close a pragma virtual table cursor */
 72893  func _pragmaVtabClose(tls *crt.TLS, _cur *Xsqlite3_vtab_cursor) (r0 int32) {
 72894  	var _pCsr *XPragmaVtabCursor
 72895  	_pCsr = (*XPragmaVtabCursor)(unsafe.Pointer(_cur))
 72896  	_pragmaVtabCursorClear(tls, _pCsr)
 72897  	Xsqlite3_free(tls, unsafe.Pointer(_pCsr))
 72898  	return int32(0)
 72899  }
 72900  
 72901  // C comment
 72902  //  /* Clear all content from pragma virtual table cursor. */
 72903  func _pragmaVtabCursorClear(tls *crt.TLS, _pCsr *XPragmaVtabCursor) {
 72904  	var _i int32
 72905  	Xsqlite3_finalize(tls, _pCsr.XpPragma)
 72906  	_pCsr.XpPragma = nil
 72907  	_i = int32(0)
 72908  _0:
 72909  	if _i >= int32(2) {
 72910  		goto _3
 72911  	}
 72912  	Xsqlite3_free(tls, unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_pCsr.XazArg)), uintptr(_i))))
 72913  	*elem0((**int8)(unsafe.Pointer(&_pCsr.XazArg)), uintptr(_i)) = nil
 72914  	_i += 1
 72915  	goto _0
 72916  _3:
 72917  }
 72918  
 72919  // C comment
 72920  //  /*
 72921  //  ** Pragma virtual table module xFilter method.
 72922  //  */
 72923  func _pragmaVtabFilter(tls *crt.TLS, _pVtabCursor *Xsqlite3_vtab_cursor, _idxNum int32, _idxStr *int8, _argc int32, _argv **XMem) (r0 int32) {
 72924  	var _rc, _i, _j int32
 72925  	var _zSql *int8
 72926  	var _acc XStrAccum
 72927  	var _pTab *XPragmaVtab
 72928  	var _pCsr *XPragmaVtabCursor
 72929  	_pCsr = (*XPragmaVtabCursor)(unsafe.Pointer(_pVtabCursor))
 72930  	_pTab = (*XPragmaVtab)(unsafe.Pointer((*Xsqlite3_vtab)(_pVtabCursor.XpVtab)))
 72931  
 72932  	_pragmaVtabCursorClear(tls, _pCsr)
 72933  	_j = func() int32 {
 72934  		if (int32((*XPragmaName)(_pTab.XpName).XmPragFlg) & int32(32)) != int32(0) {
 72935  			return int32(0)
 72936  		}
 72937  		return int32(1)
 72938  	}()
 72939  	_i = int32(0)
 72940  _2:
 72941  	if _i >= _argc {
 72942  		goto _5
 72943  	}
 72944  	func() {
 72945  		if _j >= int32(2) {
 72946  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115558), unsafe.Pointer(&_pragmaVtabFilterØ00__func__Ø000), unsafe.Pointer(str(93953)))
 72947  			crt.X__builtin_abort(tls)
 72948  		}
 72949  	}()
 72950  	*elem0((**int8)(unsafe.Pointer(&_pCsr.XazArg)), uintptr(_j)) = Xsqlite3_mprintf(tls, str(24531), unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, uintptr(_i)))))
 72951  	if (*elem0((**int8)(unsafe.Pointer(&_pCsr.XazArg)), uintptr(_j))) == nil {
 72952  		return int32(7)
 72953  	}
 72954  	*func() *int32 { _i += 1; return &_j }() += 1
 72955  	goto _2
 72956  _5:
 72957  	_sqlite3StrAccumInit(tls, &_acc, nil, nil, int32(0), *elem8((*int32)(unsafe.Pointer(&((*Xsqlite3)(_pTab.Xdb).XaLimit))), uintptr(1)))
 72958  	_sqlite3StrAccumAppendAll(tls, &_acc, str(93978))
 72959  	if (*elem0((**int8)(unsafe.Pointer(&_pCsr.XazArg)), uintptr(1))) != nil {
 72960  		_sqlite3XPrintf(tls, &_acc, str(93986), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_pCsr.XazArg)), uintptr(1))))
 72961  	}
 72962  	_sqlite3StrAccumAppendAll(tls, &_acc, (*XPragmaName)(_pTab.XpName).XzName)
 72963  	if (*elem0((**int8)(unsafe.Pointer(&_pCsr.XazArg)), 0)) != nil {
 72964  		_sqlite3XPrintf(tls, &_acc, str(93990), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_pCsr.XazArg)), 0)))
 72965  	}
 72966  	_zSql = _sqlite3StrAccumFinish(tls, &_acc)
 72967  	if _zSql == nil {
 72968  		return int32(7)
 72969  	}
 72970  	_rc = Xsqlite3_prepare_v2(tls, (*Xsqlite3)(_pTab.Xdb), _zSql, int32(-1), &_pCsr.XpPragma, nil)
 72971  	Xsqlite3_free(tls, unsafe.Pointer(_zSql))
 72972  	if _rc != int32(0) {
 72973  		_pTab.Xbase.XzErrMsg = Xsqlite3_mprintf(tls, str(24531), unsafe.Pointer(Xsqlite3_errmsg(tls, (*Xsqlite3)(_pTab.Xdb))))
 72974  		return _rc
 72975  	}
 72976  	return _pragmaVtabNext(tls, _pVtabCursor)
 72977  }
 72978  
 72979  var _pragmaVtabFilterØ00__func__Ø000 [17]int8
 72980  
 72981  func init() {
 72982  	crt.Xstrncpy(nil, &_pragmaVtabFilterØ00__func__Ø000[0], str(93994), 17)
 72983  }
 72984  
 72985  // C comment
 72986  //  /* Advance the pragma virtual table cursor to the next row */
 72987  func _pragmaVtabNext(tls *crt.TLS, _pVtabCursor *Xsqlite3_vtab_cursor) (r0 int32) {
 72988  	var _rc int32
 72989  	var _pCsr *XPragmaVtabCursor
 72990  	_pCsr = (*XPragmaVtabCursor)(unsafe.Pointer(_pVtabCursor))
 72991  	_rc = int32(0)
 72992  	_pCsr.XiRowid += 1
 72993  	func() {
 72994  		if _pCsr.XpPragma == nil {
 72995  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115529), unsafe.Pointer(&_pragmaVtabNextØ00__func__Ø000), unsafe.Pointer(str(94011)))
 72996  			crt.X__builtin_abort(tls)
 72997  		}
 72998  	}()
 72999  	if int32(100) != Xsqlite3_step(tls, _pCsr.XpPragma) {
 73000  		_rc = Xsqlite3_finalize(tls, _pCsr.XpPragma)
 73001  		_pCsr.XpPragma = nil
 73002  		_pragmaVtabCursorClear(tls, _pCsr)
 73003  	}
 73004  	return _rc
 73005  }
 73006  
 73007  var _pragmaVtabNextØ00__func__Ø000 [15]int8
 73008  
 73009  func init() {
 73010  	crt.Xstrncpy(nil, &_pragmaVtabNextØ00__func__Ø000[0], str(94025), 15)
 73011  }
 73012  
 73013  // C comment
 73014  //  /*
 73015  //  ** Pragma virtual table module xEof method.
 73016  //  */
 73017  func _pragmaVtabEof(tls *crt.TLS, _pVtabCursor *Xsqlite3_vtab_cursor) (r0 int32) {
 73018  	var _pCsr *XPragmaVtabCursor
 73019  	_pCsr = (*XPragmaVtabCursor)(unsafe.Pointer(_pVtabCursor))
 73020  	return bool2int(_pCsr.XpPragma == nil)
 73021  }
 73022  
 73023  // C comment
 73024  //  /* The xColumn method simply returns the corresponding column from
 73025  //  ** the PRAGMA.
 73026  //  */
 73027  func _pragmaVtabColumn(tls *crt.TLS, _pVtabCursor *Xsqlite3_vtab_cursor, _ctx *Xsqlite3_context, _i int32) (r0 int32) {
 73028  	var _pTab *XPragmaVtab
 73029  	var _pCsr *XPragmaVtabCursor
 73030  	_pCsr = (*XPragmaVtabCursor)(unsafe.Pointer(_pVtabCursor))
 73031  	_pTab = (*XPragmaVtab)(unsafe.Pointer((*Xsqlite3_vtab)(_pVtabCursor.XpVtab)))
 73032  	if _i < int32(_pTab.XiHidden) {
 73033  		Xsqlite3_result_value(tls, _ctx, Xsqlite3_column_value(tls, _pCsr.XpPragma, _i))
 73034  		goto _1
 73035  	}
 73036  	Xsqlite3_result_text(tls, _ctx, *elem0((**int8)(unsafe.Pointer(&_pCsr.XazArg)), uintptr(_i-int32(_pTab.XiHidden))), int32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
 73037  _1:
 73038  	return int32(0)
 73039  }
 73040  
 73041  // C comment
 73042  //  /* SQLITE_OMIT_UTF16 */
 73043  func Xsqlite3_result_value(tls *crt.TLS, _pCtx *Xsqlite3_context, _pValue *XMem) {
 73044  	func() {
 73045  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
 73046  			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)))
 73047  			crt.X__builtin_abort(tls)
 73048  		}
 73049  	}()
 73050  	_sqlite3VdbeMemCopy(tls, (*XMem)(_pCtx.XpOut), _pValue)
 73051  }
 73052  
 73053  var _sqlite3_result_valueØ00__func__Ø000 [21]int8
 73054  
 73055  func init() {
 73056  	crt.Xstrncpy(nil, &_sqlite3_result_valueØ00__func__Ø000[0], str(94040), 21)
 73057  }
 73058  
 73059  // C comment
 73060  //  /*
 73061  //  ** Pragma virtual table module xRowid method.
 73062  //  */
 73063  func _pragmaVtabRowid(tls *crt.TLS, _pVtabCursor *Xsqlite3_vtab_cursor, _p *int64) (r0 int32) {
 73064  	var _pCsr *XPragmaVtabCursor
 73065  	_pCsr = (*XPragmaVtabCursor)(unsafe.Pointer(_pVtabCursor))
 73066  	*_p = _pCsr.XiRowid
 73067  	return int32(0)
 73068  }
 73069  
 73070  // C comment
 73071  //  /*
 73072  //  ** Check to see if virtual table module pMod can be have an eponymous
 73073  //  ** virtual table instance.  If it can, create one if one does not already
 73074  //  ** exist. Return non-zero if the eponymous virtual table instance exists
 73075  //  ** when this routine returns, and return zero if it does not exist.
 73076  //  **
 73077  //  ** An eponymous virtual table instance is one that is named after its
 73078  //  ** module, and more importantly, does not require a CREATE VIRTUAL TABLE
 73079  //  ** statement in order to come into existance.  Eponymous virtual table
 73080  //  ** instances always exist.  They cannot be DROP-ed.
 73081  //  **
 73082  //  ** Any virtual table module for which xConnect and xCreate are the same
 73083  //  ** method can have an eponymous virtual table instance.
 73084  //  */
 73085  func _sqlite3VtabEponymousTableInit(tls *crt.TLS, _pParse *XParse, _pMod *XModule) (r0 int32) {
 73086  	var _rc int32
 73087  	var _zErr *int8
 73088  	var _db *Xsqlite3
 73089  	var _pTab *XTable
 73090  	var _pModule *Xsqlite3_module
 73091  	_pModule = (*Xsqlite3_module)(_pMod.XpModule)
 73092  	_zErr = nil
 73093  	_db = (*Xsqlite3)(_pParse.Xdb)
 73094  	if _pMod.XpEpoTab != nil {
 73095  		return int32(1)
 73096  	}
 73097  	if (func() func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 {
 73098  		v := _pModule.XxCreate
 73099  		return *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&v))
 73100  	}() != nil) && (*(*uintptr)(unsafe.Pointer(&struct {
 73101  		f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32
 73102  	}{func() func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 {
 73103  		v := _pModule.XxCreate
 73104  		return *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&v))
 73105  	}()})) != *(*uintptr)(unsafe.Pointer(&struct {
 73106  		f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32
 73107  	}{func() func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 {
 73108  		v := _pModule.XxConnect
 73109  		return *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&v))
 73110  	}()}))) {
 73111  		return int32(0)
 73112  	}
 73113  	_pTab = (*XTable)(_sqlite3DbMallocZero(tls, _db, uint64(80)))
 73114  	if _pTab == nil {
 73115  		return int32(0)
 73116  	}
 73117  	_pTab.XzName = _sqlite3DbStrDup(tls, _db, _pMod.XzName)
 73118  	if _pTab.XzName == nil {
 73119  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_pTab))
 73120  		return int32(0)
 73121  	}
 73122  	*(**XTable)(unsafe.Pointer(&_pMod.XpEpoTab)) = _pTab
 73123  	_pTab.XnTabRef = uint32(1)
 73124  	*(**XSchema)(unsafe.Pointer(&_pTab.XpSchema)) = (*XSchema)(elem27((*XDb)(_db.XaDb), 0).XpSchema)
 73125  	func() {
 73126  		if _pTab.XnModuleArg != int32(0) {
 73127  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(126139), unsafe.Pointer(&_sqlite3VtabEponymousTableInitØ00__func__Ø000), unsafe.Pointer(str(94061)))
 73128  			crt.X__builtin_abort(tls)
 73129  		}
 73130  	}()
 73131  	_pTab.XiPKey = int16(-1)
 73132  	_addModuleArgument(tls, _db, _pTab, _sqlite3DbStrDup(tls, _db, _pTab.XzName))
 73133  	_addModuleArgument(tls, _db, _pTab, nil)
 73134  	_addModuleArgument(tls, _db, _pTab, _sqlite3DbStrDup(tls, _db, _pTab.XzName))
 73135  	_rc = _vtabCallConstructor(tls, _db, _pTab, _pMod, func() func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 {
 73136  		v := _pModule.XxConnect
 73137  		return *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&v))
 73138  	}(), &_zErr)
 73139  	if _rc != 0 {
 73140  		_sqlite3ErrorMsg(tls, _pParse, str(24531), unsafe.Pointer(_zErr))
 73141  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErr))
 73142  		_sqlite3VtabEponymousTableClear(tls, _db, _pMod)
 73143  		return int32(0)
 73144  	}
 73145  	return int32(1)
 73146  }
 73147  
 73148  var _sqlite3VtabEponymousTableInitØ00__func__Ø000 [30]int8
 73149  
 73150  func init() {
 73151  	crt.Xstrncpy(nil, &_sqlite3VtabEponymousTableInitØ00__func__Ø000[0], str(94081), 30)
 73152  }
 73153  
 73154  // C comment
 73155  //  /*
 73156  //  ** Add a new module argument to pTable->azModuleArg[].
 73157  //  ** The string is not copied - the pointer is stored.  The
 73158  //  ** string will be freed automatically when the table is
 73159  //  ** deleted.
 73160  //  */
 73161  func _addModuleArgument(tls *crt.TLS, _db *Xsqlite3, _pTable *XTable, _zArg *int8) {
 73162  	var _nBytes, _2_i int32
 73163  	var _azModuleArg **int8
 73164  	_nBytes = int32(uint32(4) * uint32(int32(2)+_pTable.XnModuleArg))
 73165  	_azModuleArg = (**int8)(_sqlite3DbRealloc(tls, _db, unsafe.Pointer(_pTable.XazModuleArg), uint64(_nBytes)))
 73166  	if _azModuleArg == nil {
 73167  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zArg))
 73168  		goto _1
 73169  	}
 73170  	_2_i = postInc2(&_pTable.XnModuleArg, 1)
 73171  	*elem0(_azModuleArg, uintptr(_2_i)) = _zArg
 73172  	*elem0(_azModuleArg, uintptr(_2_i+int32(1))) = nil
 73173  	_pTable.XazModuleArg = _azModuleArg
 73174  _1:
 73175  }
 73176  
 73177  // C comment
 73178  //  /*
 73179  //  ** The Table structure pTable is really a VIEW.  Fill in the names of
 73180  //  ** the columns of the view in the pTable structure.  Return the number
 73181  //  ** of errors.  If an error is seen leave an error message in pParse->zErrMsg.
 73182  //  */
 73183  func _sqlite3ViewGetColumnNames(tls *crt.TLS, _pParse *XParse, _pTable *XTable) (r0 int32) {
 73184  	var _nErr, _n int32
 73185  	var _xAuth func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32
 73186  	var _db *Xsqlite3
 73187  	var _pSelTab *XTable
 73188  	var _pSel *XSelect
 73189  	_nErr = int32(0)
 73190  	_db = (*Xsqlite3)(_pParse.Xdb)
 73191  	func() {
 73192  		if _pTable == nil {
 73193  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101853), unsafe.Pointer(&_sqlite3ViewGetColumnNamesØ00__func__Ø000), unsafe.Pointer(str(94111)))
 73194  			crt.X__builtin_abort(tls)
 73195  		}
 73196  	}()
 73197  	if _sqlite3VtabCallConnect(tls, _pParse, _pTable) != 0 {
 73198  		return int32(1)
 73199  	}
 73200  	if _pTable.XnModuleArg != 0 {
 73201  		return int32(0)
 73202  	}
 73203  	if int32(_pTable.XnCol) > int32(0) {
 73204  		return int32(0)
 73205  	}
 73206  	if int32(_pTable.XnCol) < int32(0) {
 73207  		_sqlite3ErrorMsg(tls, _pParse, str(94118), unsafe.Pointer(_pTable.XzName))
 73208  		return int32(1)
 73209  	}
 73210  	func() {
 73211  		if int32(_pTable.XnCol) < int32(0) {
 73212  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101887), unsafe.Pointer(&_sqlite3ViewGetColumnNamesØ00__func__Ø000), unsafe.Pointer(str(94148)))
 73213  			crt.X__builtin_abort(tls)
 73214  		}
 73215  	}()
 73216  	func() {
 73217  		if _pTable.XpSelect == nil {
 73218  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101896), unsafe.Pointer(&_sqlite3ViewGetColumnNamesØ00__func__Ø000), unsafe.Pointer(str(94164)))
 73219  			crt.X__builtin_abort(tls)
 73220  		}
 73221  	}()
 73222  	_pSel = _sqlite3SelectDup(tls, _db, (*XSelect)(_pTable.XpSelect), int32(0))
 73223  	if _pSel == nil {
 73224  		goto _10
 73225  	}
 73226  	_n = _pParse.XnTab
 73227  	_sqlite3SrcListAssignCursors(tls, _pParse, (*XSrcList)(_pSel.XpSrc))
 73228  	_pTable.XnCol = int16(-1)
 73229  	_db.Xlookaside.XbDisable += 1
 73230  	_xAuth = _db.XxAuth
 73231  	_db.XxAuth = nil
 73232  	_pSelTab = _sqlite3ResultSetOfSelect(tls, _pParse, _pSel)
 73233  	_db.XxAuth = _xAuth
 73234  	_pParse.XnTab = _n
 73235  	if _pTable.XpCheck == nil {
 73236  		goto _11
 73237  	}
 73238  	_sqlite3ColumnsFromExprList(tls, _pParse, (*XExprList)(_pTable.XpCheck), &_pTable.XnCol, (**XColumn)(unsafe.Pointer(&_pTable.XaCol)))
 73239  	if ((int32(_db.XmallocFailed) == int32(0)) && (_pParse.XnErr == int32(0))) && (int32(_pTable.XnCol) == ((*XExprList)(_pSel.XpEList).XnExpr)) {
 73240  		_sqlite3SelectAddColumnTypeAndCollation(tls, _pParse, _pTable, _pSel)
 73241  	}
 73242  	goto _21
 73243  _11:
 73244  	if _pSelTab != nil {
 73245  		func() {
 73246  			if (*XColumn)(_pTable.XaCol) != nil {
 73247  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101931), unsafe.Pointer(&_sqlite3ViewGetColumnNamesØ00__func__Ø000), unsafe.Pointer(str(94180)))
 73248  				crt.X__builtin_abort(tls)
 73249  			}
 73250  		}()
 73251  		_pTable.XnCol = _pSelTab.XnCol
 73252  		*(**XColumn)(unsafe.Pointer(&_pTable.XaCol)) = (*XColumn)(_pSelTab.XaCol)
 73253  		_pSelTab.XnCol = 0
 73254  		*(**XColumn)(unsafe.Pointer(&_pSelTab.XaCol)) = nil
 73255  		func() {
 73256  			if _sqlite3SchemaMutexHeld(tls, _db, int32(0), (*XSchema)(_pTable.XpSchema)) == 0 {
 73257  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101936), unsafe.Pointer(&_sqlite3ViewGetColumnNamesØ00__func__Ø000), unsafe.Pointer(str(94196)))
 73258  				crt.X__builtin_abort(tls)
 73259  			}
 73260  		}()
 73261  		goto _21
 73262  	}
 73263  	_pTable.XnCol = 0
 73264  	_nErr += 1
 73265  _21:
 73266  	_sqlite3DeleteTable(tls, _db, _pSelTab)
 73267  	_sqlite3SelectDelete(tls, _db, _pSel)
 73268  	_db.Xlookaside.XbDisable -= 1
 73269  	goto _22
 73270  _10:
 73271  	_nErr += 1
 73272  _22:
 73273  	{
 73274  		p := &((*XSchema)(_pTable.XpSchema).XschemaFlags)
 73275  		*p = uint16(int32(*p) | int32(2))
 73276  	}
 73277  	return _nErr
 73278  }
 73279  
 73280  var _sqlite3ViewGetColumnNamesØ00__func__Ø000 [26]int8
 73281  
 73282  func init() {
 73283  	crt.Xstrncpy(nil, &_sqlite3ViewGetColumnNamesØ00__func__Ø000[0], str(94243), 26)
 73284  }
 73285  
 73286  // C comment
 73287  //  /*
 73288  //  ** This function is invoked by the parser to call the xConnect() method
 73289  //  ** of the virtual table pTab. If an error occurs, an error code is returned
 73290  //  ** and an error left in pParse.
 73291  //  **
 73292  //  ** This call is a no-op if table pTab is not a virtual table.
 73293  //  */
 73294  func _sqlite3VtabCallConnect(tls *crt.TLS, _pParse *XParse, _pTab *XTable) (r0 int32) {
 73295  	var _rc int32
 73296  	var _zMod, _2_zModule, _3_zErr *int8
 73297  	var _db *Xsqlite3
 73298  	var _pMod *XModule
 73299  	_db = (*Xsqlite3)(_pParse.Xdb)
 73300  	func() {
 73301  		if _pTab == nil {
 73302  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125616), unsafe.Pointer(&_sqlite3VtabCallConnectØ00__func__Ø000), unsafe.Pointer(str(94269)))
 73303  			crt.X__builtin_abort(tls)
 73304  		}
 73305  	}()
 73306  	if (_pTab.XnModuleArg == 0) || (_sqlite3GetVTable(tls, _db, _pTab) != nil) {
 73307  		return int32(0)
 73308  	}
 73309  	_zMod = *elem0(_pTab.XazModuleArg, 0)
 73310  	_pMod = (*XModule)(_sqlite3HashFind(tls, &_db.XaModule, _zMod))
 73311  	if _pMod == nil {
 73312  		_2_zModule = *elem0(_pTab.XazModuleArg, 0)
 73313  		_sqlite3ErrorMsg(tls, _pParse, str(91672), unsafe.Pointer(_2_zModule))
 73314  		_rc = int32(1)
 73315  		goto _5
 73316  	}
 73317  	_3_zErr = nil
 73318  	_rc = _vtabCallConstructor(tls, _db, _pTab, _pMod, func() func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 {
 73319  		v := (*Xsqlite3_module)(_pMod.XpModule).XxConnect
 73320  		return *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&v))
 73321  	}(), &_3_zErr)
 73322  	if _rc != int32(0) {
 73323  		_sqlite3ErrorMsg(tls, _pParse, str(24531), unsafe.Pointer(_3_zErr))
 73324  	}
 73325  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_3_zErr))
 73326  _5:
 73327  	return _rc
 73328  }
 73329  
 73330  var _sqlite3VtabCallConnectØ00__func__Ø000 [23]int8
 73331  
 73332  func init() {
 73333  	crt.Xstrncpy(nil, &_sqlite3VtabCallConnectØ00__func__Ø000[0], str(94274), 23)
 73334  }
 73335  
 73336  // C comment
 73337  //  /*
 73338  //  ** Given a SELECT statement, generate a Table structure that describes
 73339  //  ** the result set of that SELECT.
 73340  //  */
 73341  func _sqlite3ResultSetOfSelect(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect) (r0 *XTable) {
 73342  	var _savedFlags int32
 73343  	var _db *Xsqlite3
 73344  	var _pTab *XTable
 73345  	_db = (*Xsqlite3)(_pParse.Xdb)
 73346  	_savedFlags = _db.Xflags
 73347  	_db.Xflags &= int32(-5)
 73348  	_db.Xflags |= int32(64)
 73349  	_sqlite3SelectPrep(tls, _pParse, _pSelect, nil)
 73350  	if _pParse.XnErr != 0 {
 73351  		return nil
 73352  	}
 73353  _0:
 73354  	if _pSelect.XpPrior != nil {
 73355  		_pSelect = (*XSelect)(_pSelect.XpPrior)
 73356  		goto _0
 73357  	}
 73358  	_db.Xflags = _savedFlags
 73359  	_pTab = (*XTable)(_sqlite3DbMallocZero(tls, _db, uint64(80)))
 73360  	if _pTab == nil {
 73361  		return nil
 73362  	}
 73363  	func() {
 73364  		if (_db.Xlookaside.XbDisable) == 0 {
 73365  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118340), unsafe.Pointer(&_sqlite3ResultSetOfSelectØ00__func__Ø000), unsafe.Pointer(str(94297)))
 73366  			crt.X__builtin_abort(tls)
 73367  		}
 73368  	}()
 73369  	_pTab.XnTabRef = uint32(1)
 73370  	_pTab.XzName = nil
 73371  	_pTab.XnRowLogEst = int16(200)
 73372  	func() {
 73373  		if int32(200) != int32(_sqlite3LogEst(tls, uint64(1048576))) {
 73374  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118343), unsafe.Pointer(&_sqlite3ResultSetOfSelectØ00__func__Ø000), unsafe.Pointer(str(48082)))
 73375  			crt.X__builtin_abort(tls)
 73376  		}
 73377  	}()
 73378  	_sqlite3ColumnsFromExprList(tls, _pParse, (*XExprList)(_pSelect.XpEList), &_pTab.XnCol, (**XColumn)(unsafe.Pointer(&_pTab.XaCol)))
 73379  	_sqlite3SelectAddColumnTypeAndCollation(tls, _pParse, _pTab, _pSelect)
 73380  	_pTab.XiPKey = int16(-1)
 73381  	if _db.XmallocFailed != 0 {
 73382  		_sqlite3DeleteTable(tls, _db, _pTab)
 73383  		return nil
 73384  	}
 73385  	return _pTab
 73386  }
 73387  
 73388  var _sqlite3ResultSetOfSelectØ00__func__Ø000 [25]int8
 73389  
 73390  func init() {
 73391  	crt.Xstrncpy(nil, &_sqlite3ResultSetOfSelectØ00__func__Ø000[0], str(94320), 25)
 73392  }
 73393  
 73394  // C comment
 73395  //  /*
 73396  //  ** Add type and collation information to a column list based on
 73397  //  ** a SELECT statement.
 73398  //  **
 73399  //  ** The column list presumably came from selectColumnNamesFromExprList().
 73400  //  ** The column list has only names, not types or collations.  This
 73401  //  ** routine goes through and adds the types and collations.
 73402  //  **
 73403  //  ** This routine requires that all identifiers in the SELECT
 73404  //  ** statement be resolved.
 73405  //  */
 73406  func _sqlite3SelectAddColumnTypeAndCollation(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pSelect *XSelect) {
 73407  	var _i, _1_n, _1_m int32
 73408  	var _szAll uint64
 73409  	var _1_zType *int8
 73410  	var _db *Xsqlite3
 73411  	var _a *TExprList_item
 73412  	var _p *XExpr
 73413  	var _pCol *XColumn
 73414  	var _pColl *XCollSeq
 73415  	var _sNC XNameContext
 73416  	_db = (*Xsqlite3)(_pParse.Xdb)
 73417  	_szAll = uint64(0)
 73418  	func() {
 73419  		if _pSelect == nil {
 73420  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118287), unsafe.Pointer(&_sqlite3SelectAddColumnTypeAndCollationØ00__func__Ø000), unsafe.Pointer(str(94345)))
 73421  			crt.X__builtin_abort(tls)
 73422  		}
 73423  	}()
 73424  	func() {
 73425  		if (_pSelect.XselFlags & uint32(4)) == (0) {
 73426  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118288), unsafe.Pointer(&_sqlite3SelectAddColumnTypeAndCollationØ00__func__Ø000), unsafe.Pointer(str(94356)))
 73427  			crt.X__builtin_abort(tls)
 73428  		}
 73429  	}()
 73430  	func() {
 73431  		if int32(_pTab.XnCol) != ((*XExprList)(_pSelect.XpEList).XnExpr) && _db.XmallocFailed == 0 {
 73432  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118289), unsafe.Pointer(&_sqlite3SelectAddColumnTypeAndCollationØ00__func__Ø000), unsafe.Pointer(str(94393)))
 73433  			crt.X__builtin_abort(tls)
 73434  		}
 73435  	}()
 73436  	if _db.XmallocFailed != 0 {
 73437  		return
 73438  	}
 73439  	crt.Xmemset(tls, unsafe.Pointer(&_sNC), int32(0), uint32(32))
 73440  	*(**XSrcList)(unsafe.Pointer(&_sNC.XpSrcList)) = (*XSrcList)(_pSelect.XpSrc)
 73441  	_a = (*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSelect.XpEList).Xa)))
 73442  	*func() **XColumn { _i = int32(0); return &_pCol }() = (*XColumn)(_pTab.XaCol)
 73443  _8:
 73444  	if _i >= int32(_pTab.XnCol) {
 73445  		goto _11
 73446  	}
 73447  	_p = (*XExpr)(elem57(_a, uintptr(_i)).XpExpr)
 73448  	_1_zType = _columnTypeImpl(tls, &_sNC, _p, &_pCol.XszEst)
 73449  	_szAll += uint64(_pCol.XszEst)
 73450  	_pCol.Xaffinity = _sqlite3ExprAffinity(tls, _p)
 73451  	if _1_zType == nil || store2(&_1_m, _sqlite3Strlen30(tls, _1_zType)) <= int32(0) {
 73452  		goto _13
 73453  	}
 73454  	_1_n = _sqlite3Strlen30(tls, _pCol.XzName)
 73455  	_pCol.XzName = (*int8)(_sqlite3DbReallocOrFree(tls, _db, unsafe.Pointer(_pCol.XzName), uint64((_1_n+_1_m)+int32(2))))
 73456  	if _pCol.XzName != nil {
 73457  		crt.Xmemcpy(tls, unsafe.Pointer(elem1(_pCol.XzName, uintptr(_1_n+int32(1)))), unsafe.Pointer(_1_zType), uint32(_1_m+int32(1)))
 73458  		{
 73459  			p := &_pCol.XcolFlags
 73460  			*p = uint8(int32(*p) | int32(4))
 73461  		}
 73462  	}
 73463  _13:
 73464  	if int32(_pCol.Xaffinity) == int32(0) {
 73465  		_pCol.Xaffinity = int8(65)
 73466  	}
 73467  	_pColl = _sqlite3ExprCollSeq(tls, _pParse, _p)
 73468  	if (_pColl != nil) && (_pCol.XzColl == nil) {
 73469  		_pCol.XzColl = _sqlite3DbStrDup(tls, _db, _pColl.XzName)
 73470  	}
 73471  	*(*uintptr)(unsafe.Pointer(func() **XColumn { _i += 1; return &_pCol }())) += uintptr(16)
 73472  	goto _8
 73473  _11:
 73474  	_pTab.XszTabRow = _sqlite3LogEst(tls, _szAll*uint64(4))
 73475  }
 73476  
 73477  var _sqlite3SelectAddColumnTypeAndCollationØ00__func__Ø000 [39]int8
 73478  
 73479  func init() {
 73480  	crt.Xstrncpy(nil, &_sqlite3SelectAddColumnTypeAndCollationØ00__func__Ø000[0], str(94448), 39)
 73481  }
 73482  
 73483  func _columnTypeImpl(tls *crt.TLS, _pNC *XNameContext, _pExpr *XExpr, _pEstWidth *uint8) (r0 *int8) {
 73484  	var _j, _2_iCol int32
 73485  	var _zType *int8
 73486  	var _estWidth uint8
 73487  	var _2_pTab *XTable
 73488  	var _3_pTabList *XSrcList
 73489  	var _2_pS, _12_pS *XSelect
 73490  	var _8_p, _12_p *XExpr
 73491  	var _8_sNC, _12_sNC XNameContext
 73492  	_zType = nil
 73493  	_estWidth = uint8(1)
 73494  	func() {
 73495  		if _pExpr == nil {
 73496  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117910), unsafe.Pointer(&_columnTypeImplØ00__func__Ø000), unsafe.Pointer(str(43591)))
 73497  			crt.X__builtin_abort(tls)
 73498  		}
 73499  	}()
 73500  	func() {
 73501  		if (*XSrcList)(_pNC.XpSrcList) == nil {
 73502  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117911), unsafe.Pointer(&_columnTypeImplØ00__func__Ø000), unsafe.Pointer(str(94487)))
 73503  			crt.X__builtin_abort(tls)
 73504  		}
 73505  	}()
 73506  	switch int32(_pExpr.Xop) {
 73507  	case int32(119):
 73508  		goto _7
 73509  	case int32(152):
 73510  		goto _5
 73511  	case int32(154):
 73512  		goto _5
 73513  	default:
 73514  		goto _8
 73515  	}
 73516  
 73517  _5:
 73518  	_2_pTab = nil
 73519  	_2_pS = nil
 73520  	_2_iCol = int32(_pExpr.XiColumn)
 73521  _9:
 73522  	if _pNC == nil || _2_pTab != nil {
 73523  		goto _10
 73524  	}
 73525  	_3_pTabList = (*XSrcList)(_pNC.XpSrcList)
 73526  	_j = int32(0)
 73527  _12:
 73528  	if _j >= _3_pTabList.XnSrc || (elem6((*TSrcList_item)(unsafe.Pointer(&_3_pTabList.Xa)), uintptr(_j)).XiCursor) == _pExpr.XiTable {
 73529  		goto _16
 73530  	}
 73531  	_j += 1
 73532  	goto _12
 73533  _16:
 73534  	if _j < _3_pTabList.XnSrc {
 73535  		_2_pTab = (*XTable)(elem6((*TSrcList_item)(unsafe.Pointer(&_3_pTabList.Xa)), uintptr(_j)).XpTab)
 73536  		_2_pS = (*XSelect)(elem6((*TSrcList_item)(unsafe.Pointer(&_3_pTabList.Xa)), uintptr(_j)).XpSelect)
 73537  		goto _18
 73538  	}
 73539  	_pNC = (*XNameContext)(_pNC.XpNext)
 73540  _18:
 73541  	goto _9
 73542  _10:
 73543  	if _2_pTab == nil {
 73544  		goto _8
 73545  	}
 73546  	func() {
 73547  		if _2_pTab == nil || (*XTable)(_pExpr.XpTab) != _2_pTab {
 73548  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117956), unsafe.Pointer(&_columnTypeImplØ00__func__Ø000), unsafe.Pointer(str(94504)))
 73549  			crt.X__builtin_abort(tls)
 73550  		}
 73551  	}()
 73552  	if _2_pS == nil {
 73553  		goto _23
 73554  	}
 73555  	if (_2_iCol >= int32(0)) && func() int32 {
 73556  		if _2_iCol < ((*XExprList)(_2_pS.XpEList).XnExpr) {
 73557  			return int32(1)
 73558  		}
 73559  		return func() int32 {
 73560  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117962), unsafe.Pointer(&_columnTypeImplØ00__func__Ø000), unsafe.Pointer(str(4809)))
 73561  			crt.X__builtin_abort(tls)
 73562  			return int32(0)
 73563  		}()
 73564  	}() != 0 {
 73565  		_8_p = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_2_pS.XpEList).Xa))), uintptr(_2_iCol)).XpExpr)
 73566  		*(**XSrcList)(unsafe.Pointer(&_8_sNC.XpSrcList)) = (*XSrcList)(_2_pS.XpSrc)
 73567  		*(**XNameContext)(unsafe.Pointer(&_8_sNC.XpNext)) = _pNC
 73568  		*(**XParse)(unsafe.Pointer(&_8_sNC.XpParse)) = (*XParse)(_pNC.XpParse)
 73569  		_zType = _columnTypeImpl(tls, &_8_sNC, _8_p, &_estWidth)
 73570  	}
 73571  	goto _29
 73572  _23:
 73573  	if _2_pTab.XpSchema == nil {
 73574  		goto _29
 73575  	}
 73576  	func() {
 73577  		if _2_pS != nil {
 73578  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117979), unsafe.Pointer(&_columnTypeImplØ00__func__Ø000), unsafe.Pointer(str(94530)))
 73579  			crt.X__builtin_abort(tls)
 73580  		}
 73581  	}()
 73582  	if _2_iCol < int32(0) {
 73583  		_2_iCol = int32(_2_pTab.XiPKey)
 73584  	}
 73585  	func() {
 73586  		if _2_iCol != int32(-1) && (_2_iCol < int32(0) || _2_iCol >= int32(_2_pTab.XnCol)) {
 73587  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117981), unsafe.Pointer(&_columnTypeImplØ00__func__Ø000), unsafe.Pointer(str(94534)))
 73588  			crt.X__builtin_abort(tls)
 73589  		}
 73590  	}()
 73591  	if _2_iCol < int32(0) {
 73592  		_zType = str(25747)
 73593  		goto _38
 73594  	}
 73595  	_zType = _sqlite3ColumnType(tls, elem41((*XColumn)(_2_pTab.XaCol), uintptr(_2_iCol)), nil)
 73596  	_estWidth = elem41((*XColumn)(_2_pTab.XaCol), uintptr(_2_iCol)).XszEst
 73597  _38:
 73598  _29:
 73599  	goto _8
 73600  _7:
 73601  	_12_pS = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 73602  	_12_p = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_12_pS.XpEList).Xa))), 0).XpExpr)
 73603  	func() {
 73604  		if (_pExpr.Xflags & uint32(2048)) == (0) {
 73605  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118016), unsafe.Pointer(&_columnTypeImplØ00__func__Ø000), unsafe.Pointer(str(45114)))
 73606  			crt.X__builtin_abort(tls)
 73607  		}
 73608  	}()
 73609  	*(**XSrcList)(unsafe.Pointer(&_12_sNC.XpSrcList)) = (*XSrcList)(_12_pS.XpSrc)
 73610  	*(**XNameContext)(unsafe.Pointer(&_12_sNC.XpNext)) = _pNC
 73611  	*(**XParse)(unsafe.Pointer(&_12_sNC.XpParse)) = (*XParse)(_pNC.XpParse)
 73612  	_zType = _columnTypeImpl(tls, &_12_sNC, _12_p, &_estWidth)
 73613  	goto _8
 73614  _8:
 73615  	if _pEstWidth != nil {
 73616  		*_pEstWidth = _estWidth
 73617  	}
 73618  	return _zType
 73619  }
 73620  
 73621  var _columnTypeImplØ00__func__Ø000 [15]int8
 73622  
 73623  func init() {
 73624  	crt.Xstrncpy(nil, &_columnTypeImplØ00__func__Ø000[0], str(94575), 15)
 73625  }
 73626  
 73627  // C comment
 73628  //  /*
 73629  //  ** Return the collation sequence for the expression pExpr. If
 73630  //  ** there is no defined collating sequence, return NULL.
 73631  //  **
 73632  //  ** The collating sequence might be determined by a COLLATE operator
 73633  //  ** or by the presence of a column with a defined collating sequence.
 73634  //  ** COLLATE operators take first precedence.  Left operands take
 73635  //  ** precedence over right operands.
 73636  //  */
 73637  func _sqlite3ExprCollSeq(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) (r0 *XCollSeq) {
 73638  	var _1_op, _4_j, _9_i int32
 73639  	var _5_zColl *int8
 73640  	var _db *Xsqlite3
 73641  	var _p, _8_pNext *XExpr
 73642  	var _pColl *XCollSeq
 73643  	_db = (*Xsqlite3)(_pParse.Xdb)
 73644  	_pColl = nil
 73645  	_p = _pExpr
 73646  _0:
 73647  	if _p == nil {
 73648  		goto _1
 73649  	}
 73650  	_1_op = int32(_p.Xop)
 73651  	if (_p.Xflags & uint32(512)) != 0 {
 73652  		goto _1
 73653  	}
 73654  	if (_1_op == int32(37)) || (_1_op == int32(156)) {
 73655  		_p = (*XExpr)(_p.XpLeft)
 73656  		goto _0
 73657  	}
 73658  	if (_1_op == int32(94)) || ((_1_op == int32(157)) && (int32(_p.Xop2) == int32(94))) {
 73659  		_pColl = _sqlite3GetCollSeq(tls, _pParse, _db.Xenc, nil, *(**int8)(unsafe.Pointer(&_p.Xu)))
 73660  		goto _1
 73661  	}
 73662  	if _1_op != int32(154) && _1_op != int32(152) && _1_op != int32(157) && _1_op != int32(61) || (*XTable)(_p.XpTab) == nil {
 73663  		goto _12
 73664  	}
 73665  	_4_j = int32(_p.XiColumn)
 73666  	if _4_j >= int32(0) {
 73667  		_5_zColl = elem41((*XColumn)((*XTable)(_p.XpTab).XaCol), uintptr(_4_j)).XzColl
 73668  		_pColl = _sqlite3FindCollSeq(tls, _db, _db.Xenc, _5_zColl, int32(0))
 73669  	}
 73670  	goto _1
 73671  _12:
 73672  	if (_p.Xflags & uint32(256)) == 0 {
 73673  		goto _14
 73674  	}
 73675  	if (_p.XpLeft != nil) && ((((*XExpr)(_p.XpLeft).Xflags) & uint32(256)) != (0)) {
 73676  		_p = (*XExpr)(_p.XpLeft)
 73677  		goto _17
 73678  	}
 73679  	_8_pNext = (*XExpr)(_p.XpRight)
 73680  	func() {
 73681  		if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))) != nil && (*XExpr)(_p.XpRight) != nil {
 73682  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91064), unsafe.Pointer(&_sqlite3ExprCollSeqØ00__func__Ø000), unsafe.Pointer(str(21240)))
 73683  			crt.X__builtin_abort(tls)
 73684  		}
 73685  	}()
 73686  	if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))) == nil || func() int32 {
 73687  		if (_p.Xflags & uint32(2048)) == (0) {
 73688  			return int32(1)
 73689  		}
 73690  		return func() int32 {
 73691  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91068), unsafe.Pointer(&_sqlite3ExprCollSeqØ00__func__Ø000), unsafe.Pointer(str(4809)))
 73692  			crt.X__builtin_abort(tls)
 73693  			return int32(0)
 73694  		}()
 73695  	}() == 0 {
 73696  		goto _24
 73697  	}
 73698  	_9_i = int32(0)
 73699  _25:
 73700  	if func() int32 {
 73701  		if _9_i < ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))).XnExpr) {
 73702  			return int32(1)
 73703  		}
 73704  		return func() int32 {
 73705  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91070), unsafe.Pointer(&_sqlite3ExprCollSeqØ00__func__Ø000), unsafe.Pointer(str(4809)))
 73706  			crt.X__builtin_abort(tls)
 73707  			return int32(0)
 73708  		}()
 73709  	}() == 0 {
 73710  		goto _30
 73711  	}
 73712  	if (((*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))).Xa))), uintptr(_9_i)).XpExpr).Xflags) & uint32(256)) != (0) {
 73713  		_8_pNext = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))).Xa))), uintptr(_9_i)).XpExpr)
 73714  		goto _30
 73715  	}
 73716  	_9_i += 1
 73717  	goto _25
 73718  _30:
 73719  _24:
 73720  	_p = _8_pNext
 73721  _17:
 73722  	goto _32
 73723  _14:
 73724  	goto _1
 73725  _32:
 73726  	goto _0
 73727  _1:
 73728  	if _sqlite3CheckCollSeq(tls, _pParse, _pColl) != 0 {
 73729  		_pColl = nil
 73730  	}
 73731  	return _pColl
 73732  }
 73733  
 73734  var _sqlite3ExprCollSeqØ00__func__Ø000 [19]int8
 73735  
 73736  func init() {
 73737  	crt.Xstrncpy(nil, &_sqlite3ExprCollSeqØ00__func__Ø000[0], str(94590), 19)
 73738  }
 73739  
 73740  // C comment
 73741  //  /*
 73742  //  ** This routine is called on a collation sequence before it is used to
 73743  //  ** check that it is defined. An undefined collation sequence exists when
 73744  //  ** a database is loaded that contains references to collation sequences
 73745  //  ** that have not been defined by sqlite3_create_collation() etc.
 73746  //  **
 73747  //  ** If required, this routine calls the 'collation needed' callback to
 73748  //  ** request a definition of the collating sequence. If this doesn't work,
 73749  //  ** an equivalent collating sequence that uses a text encoding different
 73750  //  ** from the main database is substituted, if one is available.
 73751  //  */
 73752  func _sqlite3CheckCollSeq(tls *crt.TLS, _pParse *XParse, _pColl *XCollSeq) (r0 int32) {
 73753  	var _1_zName *int8
 73754  	var _1_db *Xsqlite3
 73755  	var _1_p *XCollSeq
 73756  	if _pColl == nil {
 73757  		goto _0
 73758  	}
 73759  	_1_zName = _pColl.XzName
 73760  	_1_db = (*Xsqlite3)(_pParse.Xdb)
 73761  	_1_p = _sqlite3GetCollSeq(tls, _pParse, _1_db.Xenc, _pColl, _1_zName)
 73762  	if _1_p == nil {
 73763  		return int32(1)
 73764  	}
 73765  	func() {
 73766  		if _1_p != _pColl {
 73767  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104276), unsafe.Pointer(&_sqlite3CheckCollSeqØ00__func__Ø000), unsafe.Pointer(str(94609)))
 73768  			crt.X__builtin_abort(tls)
 73769  		}
 73770  	}()
 73771  _0:
 73772  	return int32(0)
 73773  }
 73774  
 73775  var _sqlite3CheckCollSeqØ00__func__Ø000 [20]int8
 73776  
 73777  func init() {
 73778  	crt.Xstrncpy(nil, &_sqlite3CheckCollSeqØ00__func__Ø000[0], str(94618), 20)
 73779  }
 73780  
 73781  // C comment
 73782  //  /*
 73783  //  ** If the source-list item passed as an argument was augmented with an
 73784  //  ** INDEXED BY clause, then try to locate the specified index. If there
 73785  //  ** was such a clause and the named index cannot be found, return
 73786  //  ** SQLITE_ERROR and leave an error in pParse. Otherwise, populate
 73787  //  ** pFrom->pIndex and return SQLITE_OK.
 73788  //  */
 73789  func _sqlite3IndexedByLookup(tls *crt.TLS, _pParse *XParse, _pFrom *TSrcList_item) (r0 int32) {
 73790  	var _1_zIndexedBy *int8
 73791  	var _1_pTab *XTable
 73792  	var _1_pIdx *XIndex
 73793  	if _pFrom.XpTab == nil || ((uint32((_pFrom.Xfg.XnotIndexed)>>1)<<31)>>31) == 0 {
 73794  		goto _1
 73795  	}
 73796  	_1_pTab = (*XTable)(_pFrom.XpTab)
 73797  	_1_zIndexedBy = *(**int8)(unsafe.Pointer(&_pFrom.Xu1))
 73798  	_1_pIdx = (*XIndex)(_1_pTab.XpIndex)
 73799  _2:
 73800  	if _1_pIdx == nil || _sqlite3StrICmp(tls, _1_pIdx.XzName, _1_zIndexedBy) == 0 {
 73801  		goto _6
 73802  	}
 73803  	_1_pIdx = (*XIndex)(_1_pIdx.XpNext)
 73804  	goto _2
 73805  _6:
 73806  	if _1_pIdx == nil {
 73807  		_sqlite3ErrorMsg(tls, _pParse, str(94638), unsafe.Pointer(_1_zIndexedBy), int32(0))
 73808  		_pParse.XcheckSchema = uint8(1)
 73809  		return int32(1)
 73810  	}
 73811  	*(**XIndex)(unsafe.Pointer(&_pFrom.XpIBIndex)) = _1_pIdx
 73812  _1:
 73813  	return int32(0)
 73814  }
 73815  
 73816  // C comment
 73817  //  /*
 73818  //  ** This routine processes the join information for a SELECT statement.
 73819  //  ** ON and USING clauses are converted into extra terms of the WHERE clause.
 73820  //  ** NATURAL joins also create extra WHERE clause terms.
 73821  //  **
 73822  //  ** The terms of a FROM clause are contained in the Select.pSrc structure.
 73823  //  ** The left most table is the first entry in Select.pSrc.  The right-most
 73824  //  ** table is the last entry.  The join operator is held in the entry to
 73825  //  ** the left.  Thus entry 0 contains the join operator for the join between
 73826  //  ** entries 0 and 1.  Any ON or USING clauses associated with the join are
 73827  //  ** also attached to the left entry.
 73828  //  **
 73829  //  ** This routine returns the number of errors encountered.
 73830  //  */
 73831  func _sqliteProcessJoin(tls *crt.TLS, _pParse *XParse, _p *XSelect) (r0 int32) {
 73832  	var _i, _j, _1_isOuter, _4_iLeft, _4_iLeftCol, _9_iLeft, _9_iLeftCol, _9_iRightCol int32
 73833  	var _4_zName, _9_zName *int8
 73834  	var _1_pLeftTab, _1_pRightTab *XTable
 73835  	var _pSrc *XSrcList
 73836  	var _pLeft, _pRight *TSrcList_item
 73837  	var _8_pList *XIdList
 73838  	_pSrc = (*XSrcList)(_p.XpSrc)
 73839  	_pLeft = elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), 0)
 73840  	_pRight = elem6(_pLeft, uintptr(1))
 73841  	_i = int32(0)
 73842  _0:
 73843  	if _i >= (_pSrc.XnSrc - int32(1)) {
 73844  		goto _3
 73845  	}
 73846  	_1_pLeftTab = (*XTable)(_pLeft.XpTab)
 73847  	_1_pRightTab = (*XTable)(_pRight.XpTab)
 73848  	if func() int32 {
 73849  		if (_1_pLeftTab == nil) || (_1_pRightTab == nil) {
 73850  			return func() int32 {
 73851  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116938), unsafe.Pointer(&_sqliteProcessJoinØ00__func__Ø000), unsafe.Pointer(str(4809)))
 73852  				crt.X__builtin_abort(tls)
 73853  				return int32(1)
 73854  			}()
 73855  		}
 73856  		return int32(0)
 73857  	}() != 0 {
 73858  		goto _1
 73859  	}
 73860  	_1_isOuter = bool2int((int32(_pRight.Xfg.Xjointype) & int32(32)) != int32(0))
 73861  	if (int32(_pRight.Xfg.Xjointype) & int32(4)) == 0 {
 73862  		goto _8
 73863  	}
 73864  	if (_pRight.XpOn != nil) || (_pRight.XpUsing != nil) {
 73865  		_sqlite3ErrorMsg(tls, _pParse, str(94656), int32(0))
 73866  		return int32(1)
 73867  	}
 73868  	_j = int32(0)
 73869  _11:
 73870  	if _j >= int32(_1_pRightTab.XnCol) {
 73871  		goto _14
 73872  	}
 73873  	_4_zName = elem41((*XColumn)(_1_pRightTab.XaCol), uintptr(_j)).XzName
 73874  	if _tableAndColumnIndex(tls, _pSrc, _i+int32(1), _4_zName, &_4_iLeft, &_4_iLeftCol) != 0 {
 73875  		_addWhereTerm(tls, _pParse, _pSrc, _4_iLeft, _4_iLeftCol, _i+int32(1), _j, _1_isOuter, (**XExpr)(unsafe.Pointer(&_p.XpWhere)))
 73876  	}
 73877  	_j += 1
 73878  	goto _11
 73879  _14:
 73880  _8:
 73881  	if (_pRight.XpOn != nil) && (_pRight.XpUsing != nil) {
 73882  		_sqlite3ErrorMsg(tls, _pParse, str(94706))
 73883  		return int32(1)
 73884  	}
 73885  	if _pRight.XpOn == nil {
 73886  		goto _18
 73887  	}
 73888  	if _1_isOuter != 0 {
 73889  		_setJoinExpr(tls, (*XExpr)(_pRight.XpOn), _pRight.XiCursor)
 73890  	}
 73891  	*(**XExpr)(unsafe.Pointer(&_p.XpWhere)) = _sqlite3ExprAnd(tls, (*Xsqlite3)(_pParse.Xdb), (*XExpr)(_p.XpWhere), (*XExpr)(_pRight.XpOn))
 73892  	*(**XExpr)(unsafe.Pointer(&_pRight.XpOn)) = nil
 73893  _18:
 73894  	if _pRight.XpUsing == nil {
 73895  		goto _20
 73896  	}
 73897  	_8_pList = (*XIdList)(_pRight.XpUsing)
 73898  	_j = int32(0)
 73899  _21:
 73900  	if _j >= _8_pList.XnId {
 73901  		goto _24
 73902  	}
 73903  	_9_zName = elem42((*TIdList_item)(_8_pList.Xa), uintptr(_j)).XzName
 73904  	_9_iRightCol = _columnIndex(tls, _1_pRightTab, _9_zName)
 73905  	if (_9_iRightCol < int32(0)) || (_tableAndColumnIndex(tls, _pSrc, _i+int32(1), _9_zName, &_9_iLeft, &_9_iLeftCol) == 0) {
 73906  		_sqlite3ErrorMsg(tls, _pParse, str(94761), unsafe.Pointer(_9_zName))
 73907  		return int32(1)
 73908  	}
 73909  	_addWhereTerm(tls, _pParse, _pSrc, _9_iLeft, _9_iLeftCol, _i+int32(1), _9_iRightCol, _1_isOuter, (**XExpr)(unsafe.Pointer(&_p.XpWhere)))
 73910  	_j += 1
 73911  	goto _21
 73912  _24:
 73913  _20:
 73914  _1:
 73915  	*(*uintptr)(unsafe.Pointer(func() **TSrcList_item {
 73916  		*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pRight }())) += uintptr(68)
 73917  		return &_pLeft
 73918  	}())) += uintptr(68)
 73919  	goto _0
 73920  _3:
 73921  	return int32(0)
 73922  }
 73923  
 73924  var _sqliteProcessJoinØ00__func__Ø000 [18]int8
 73925  
 73926  func init() {
 73927  	crt.Xstrncpy(nil, &_sqliteProcessJoinØ00__func__Ø000[0], str(94825), 18)
 73928  }
 73929  
 73930  // C comment
 73931  //  /*
 73932  //  ** Search the first N tables in pSrc, from left to right, looking for a
 73933  //  ** table that has a column named zCol.
 73934  //  **
 73935  //  ** When found, set *piTab and *piCol to the table index and column index
 73936  //  ** of the matching column and return TRUE.
 73937  //  **
 73938  //  ** If not found, return FALSE.
 73939  //  */
 73940  func _tableAndColumnIndex(tls *crt.TLS, _pSrc *XSrcList, _N int32, _zCol *int8, _piTab *int32, _piCol *int32) (r0 int32) {
 73941  	var _i, _iCol int32
 73942  	func() {
 73943  		if (_piTab == nil) != (_piCol == nil) {
 73944  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116809), unsafe.Pointer(&_tableAndColumnIndexØ00__func__Ø000), unsafe.Pointer(str(94843)))
 73945  			crt.X__builtin_abort(tls)
 73946  		}
 73947  	}()
 73948  	_i = int32(0)
 73949  _2:
 73950  	if _i >= _N {
 73951  		goto _5
 73952  	}
 73953  	_iCol = _columnIndex(tls, (*XTable)(elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_i)).XpTab), _zCol)
 73954  	if _iCol < int32(0) {
 73955  		goto _6
 73956  	}
 73957  	if _piTab != nil {
 73958  		*_piTab = _i
 73959  		*_piCol = _iCol
 73960  	}
 73961  	return int32(1)
 73962  
 73963  _6:
 73964  	_i += 1
 73965  	goto _2
 73966  _5:
 73967  	return int32(0)
 73968  }
 73969  
 73970  var _tableAndColumnIndexØ00__func__Ø000 [20]int8
 73971  
 73972  func init() {
 73973  	crt.Xstrncpy(nil, &_tableAndColumnIndexØ00__func__Ø000[0], str(94866), 20)
 73974  }
 73975  
 73976  // C comment
 73977  //  /*
 73978  //  ** Return the index of a column in a table.  Return -1 if the column
 73979  //  ** is not contained in the table.
 73980  //  */
 73981  func _columnIndex(tls *crt.TLS, _pTab *XTable, _zCol *int8) (r0 int32) {
 73982  	var _i int32
 73983  	_i = int32(0)
 73984  _0:
 73985  	if _i >= int32(_pTab.XnCol) {
 73986  		goto _3
 73987  	}
 73988  	if _sqlite3StrICmp(tls, elem41((*XColumn)(_pTab.XaCol), uintptr(_i)).XzName, _zCol) == int32(0) {
 73989  		return _i
 73990  	}
 73991  	_i += 1
 73992  	goto _0
 73993  _3:
 73994  	return int32(-1)
 73995  }
 73996  
 73997  // C comment
 73998  //  /*
 73999  //  ** This function is used to add terms implied by JOIN syntax to the
 74000  //  ** WHERE clause expression of a SELECT statement. The new term, which
 74001  //  ** is ANDed with the existing WHERE clause, is of the form:
 74002  //  **
 74003  //  **    (tab1.col1 = tab2.col2)
 74004  //  **
 74005  //  ** where tab1 is the iSrc'th table in SrcList pSrc and tab2 is the
 74006  //  ** (iSrc+1)'th. Column col1 is column iColLeft of tab1, and col2 is
 74007  //  ** column iColRight of tab2.
 74008  //  */
 74009  func _addWhereTerm(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _iLeft int32, _iColLeft int32, _iRight int32, _iColRight int32, _isOuterJoin int32, _ppWhere **XExpr) {
 74010  	var _db *Xsqlite3
 74011  	var _pE1, _pE2, _pEq *XExpr
 74012  	_db = (*Xsqlite3)(_pParse.Xdb)
 74013  	func() {
 74014  		if _iLeft >= _iRight {
 74015  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116849), unsafe.Pointer(&_addWhereTermØ00__func__Ø000), unsafe.Pointer(str(94886)))
 74016  			crt.X__builtin_abort(tls)
 74017  		}
 74018  	}()
 74019  	func() {
 74020  		if _pSrc.XnSrc <= _iRight {
 74021  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116850), unsafe.Pointer(&_addWhereTermØ00__func__Ø000), unsafe.Pointer(str(94899)))
 74022  			crt.X__builtin_abort(tls)
 74023  		}
 74024  	}()
 74025  	func() {
 74026  		if (elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_iLeft)).XpTab) == nil {
 74027  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116851), unsafe.Pointer(&_addWhereTermØ00__func__Ø000), unsafe.Pointer(str(94917)))
 74028  			crt.X__builtin_abort(tls)
 74029  		}
 74030  	}()
 74031  	func() {
 74032  		if (elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_iRight)).XpTab) == nil {
 74033  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116852), unsafe.Pointer(&_addWhereTermØ00__func__Ø000), unsafe.Pointer(str(94937)))
 74034  			crt.X__builtin_abort(tls)
 74035  		}
 74036  	}()
 74037  	_pE1 = _sqlite3CreateColumnExpr(tls, _db, _pSrc, _iLeft, _iColLeft)
 74038  	_pE2 = _sqlite3CreateColumnExpr(tls, _db, _pSrc, _iRight, _iColRight)
 74039  	_pEq = _sqlite3PExpr(tls, _pParse, int32(78), _pE1, _pE2)
 74040  	if (_pEq != nil) && _isOuterJoin != 0 {
 74041  		_pEq.Xflags |= uint32(1)
 74042  		func() {
 74043  			if (_pEq.Xflags & uint32(24576)) != (0) {
 74044  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116860), unsafe.Pointer(&_addWhereTermØ00__func__Ø000), unsafe.Pointer(str(94958)))
 74045  				crt.X__builtin_abort(tls)
 74046  			}
 74047  		}()
 74048  		_pEq.Xflags |= uint32(131072)
 74049  		_pEq.XiRightJoinTable = int16(_pE2.XiTable)
 74050  	}
 74051  	*_ppWhere = _sqlite3ExprAnd(tls, _db, *_ppWhere, _pEq)
 74052  }
 74053  
 74054  var _addWhereTermØ00__func__Ø000 [13]int8
 74055  
 74056  func init() {
 74057  	crt.Xstrncpy(nil, &_addWhereTermØ00__func__Ø000[0], str(95005), 13)
 74058  }
 74059  
 74060  // C comment
 74061  //  /*
 74062  //  ** Allocate and return a pointer to an expression to load the column iCol
 74063  //  ** from datasource iSrc in SrcList pSrc.
 74064  //  */
 74065  func _sqlite3CreateColumnExpr(tls *crt.TLS, _db *Xsqlite3, _pSrc *XSrcList, _iSrc int32, _iCol int32) (r0 *XExpr) {
 74066  	var _1_pItem *TSrcList_item
 74067  	var _p *XExpr
 74068  	_p = _sqlite3ExprAlloc(tls, _db, int32(152), nil, int32(0))
 74069  	if _p == nil {
 74070  		goto _0
 74071  	}
 74072  	_1_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_iSrc))
 74073  	*(**XTable)(unsafe.Pointer(&_p.XpTab)) = (*XTable)(_1_pItem.XpTab)
 74074  	_p.XiTable = _1_pItem.XiCursor
 74075  	if int32((*XTable)(_p.XpTab).XiPKey) == _iCol {
 74076  		_p.XiColumn = int16(-1)
 74077  		goto _2
 74078  	}
 74079  	_p.XiColumn = int16(_iCol)
 74080  	_1_pItem.XcolUsed |= uint64(1) << uint(func() int32 {
 74081  		if _iCol >= int32(64) {
 74082  			return int32(63)
 74083  		}
 74084  		return _iCol
 74085  	}())
 74086  _2:
 74087  	_p.Xflags |= uint32(4)
 74088  _0:
 74089  	return _p
 74090  }
 74091  
 74092  // C comment
 74093  //  /*
 74094  //  ** Allocate an Expr node which joins as many as two subtrees.
 74095  //  **
 74096  //  ** One or both of the subtrees can be NULL.  Return a pointer to the new
 74097  //  ** Expr node.  Or, if an OOM error occurs, set pParse->db->mallocFailed,
 74098  //  ** free the subtrees and return NULL.
 74099  //  */
 74100  func _sqlite3PExpr(tls *crt.TLS, _pParse *XParse, _op int32, _pLeft *XExpr, _pRight *XExpr) (r0 *XExpr) {
 74101  	var _p *XExpr
 74102  	if (_op == int32(71)) && (_pParse.XnErr == int32(0)) {
 74103  		_p = _sqlite3ExprAnd(tls, (*Xsqlite3)(_pParse.Xdb), _pLeft, _pRight)
 74104  		goto _2
 74105  	}
 74106  	_p = (*XExpr)(_sqlite3DbMallocRawNN(tls, (*Xsqlite3)(_pParse.Xdb), uint64(48)))
 74107  	if _p != nil {
 74108  		crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint32(48))
 74109  		_p.Xop = uint8(_op & int32(255))
 74110  		_p.XiAgg = int16(-1)
 74111  	}
 74112  	_sqlite3ExprAttachSubtrees(tls, (*Xsqlite3)(_pParse.Xdb), _p, _pLeft, _pRight)
 74113  _2:
 74114  	if _p != nil {
 74115  		_sqlite3ExprCheckHeight(tls, _pParse, _p.XnHeight)
 74116  	}
 74117  	return _p
 74118  }
 74119  
 74120  // C comment
 74121  //  /*
 74122  //  ** Join two expressions using an AND operator.  If either expression is
 74123  //  ** NULL, then just return the other expression.
 74124  //  **
 74125  //  ** If one side or the other of the AND is known to be false, then instead
 74126  //  ** of returning an AND expression, just return a constant expression with
 74127  //  ** a value of false.
 74128  //  */
 74129  func _sqlite3ExprAnd(tls *crt.TLS, _db *Xsqlite3, _pLeft *XExpr, _pRight *XExpr) (r0 *XExpr) {
 74130  	var _4_pNew *XExpr
 74131  	if _pLeft == nil {
 74132  		return _pRight
 74133  	}
 74134  	if _pRight == nil {
 74135  		return _pLeft
 74136  	}
 74137  	if _exprAlwaysFalse(tls, _pLeft) != 0 || _exprAlwaysFalse(tls, _pRight) != 0 {
 74138  		_sqlite3ExprDelete(tls, _db, _pLeft)
 74139  		_sqlite3ExprDelete(tls, _db, _pRight)
 74140  		return _sqlite3ExprAlloc(tls, _db, int32(134), elem56((*XToken)(unsafe.Pointer(&_sqlite3IntTokens)), 0), int32(0))
 74141  	}
 74142  	_4_pNew = _sqlite3ExprAlloc(tls, _db, int32(71), nil, int32(0))
 74143  	_sqlite3ExprAttachSubtrees(tls, _db, _4_pNew, _pLeft, _pRight)
 74144  	return _4_pNew
 74145  }
 74146  
 74147  func _exprAlwaysFalse(tls *crt.TLS, _p *XExpr) (r0 int32) {
 74148  	var _v int32
 74149  	_v = int32(0)
 74150  	if (_p.Xflags & uint32(1)) != (0) {
 74151  		return int32(0)
 74152  	}
 74153  	if _sqlite3ExprIsInteger(tls, _p, &_v) == 0 {
 74154  		return int32(0)
 74155  	}
 74156  	return bool2int(_v == int32(0))
 74157  }
 74158  
 74159  // C comment
 74160  //  /*
 74161  //  ** If the expression p codes a constant integer that is small enough
 74162  //  ** to fit in a 32-bit integer, return 1 and put the value of the integer
 74163  //  ** in *pValue.  If the expression is not an integer or if it is too big
 74164  //  ** to fit in a signed 32-bit integer, return 0 and leave *pValue unchanged.
 74165  //  */
 74166  func _sqlite3ExprIsInteger(tls *crt.TLS, _p *XExpr, _pValue *int32) (r0 int32) {
 74167  	var _rc, _4_v int32
 74168  	_rc = int32(0)
 74169  	if _p == nil {
 74170  		return int32(0)
 74171  	}
 74172  	func() {
 74173  		if int32(_p.Xop) == int32(134) && (_p.Xflags&uint32(1024)) == (0) && _sqlite3GetInt32(tls, *(**int8)(unsafe.Pointer(&_p.Xu)), &_rc) != int32(0) {
 74174  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92815), unsafe.Pointer(&_sqlite3ExprIsIntegerØ00__func__Ø000), unsafe.Pointer(str(95018)))
 74175  			crt.X__builtin_abort(tls)
 74176  		}
 74177  	}()
 74178  	if (_p.Xflags & uint32(1024)) != 0 {
 74179  		*_pValue = *(*int32)(unsafe.Pointer(&_p.Xu))
 74180  		return int32(1)
 74181  	}
 74182  	switch int32(_p.Xop) {
 74183  	case int32(155):
 74184  		goto _8
 74185  	case int32(156):
 74186  		goto _7
 74187  	default:
 74188  		goto _9
 74189  	}
 74190  
 74191  _7:
 74192  	_rc = _sqlite3ExprIsInteger(tls, (*XExpr)(_p.XpLeft), _pValue)
 74193  	goto _10
 74194  _8:
 74195  	if _sqlite3ExprIsInteger(tls, (*XExpr)(_p.XpLeft), &_4_v) != 0 {
 74196  		func() {
 74197  			if _4_v == int32(-2147483648) {
 74198  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92830), unsafe.Pointer(&_sqlite3ExprIsIntegerØ00__func__Ø000), unsafe.Pointer(str(95107)))
 74199  				crt.X__builtin_abort(tls)
 74200  			}
 74201  		}()
 74202  		*_pValue = -_4_v
 74203  		_rc = int32(1)
 74204  	}
 74205  	goto _10
 74206  _9:
 74207  	goto _10
 74208  _10:
 74209  	return _rc
 74210  }
 74211  
 74212  var _sqlite3ExprIsIntegerØ00__func__Ø000 [21]int8
 74213  
 74214  func init() {
 74215  	crt.Xstrncpy(nil, &_sqlite3ExprIsIntegerØ00__func__Ø000[0], str(95126), 21)
 74216  }
 74217  
 74218  // C comment
 74219  //  /*
 74220  //  ** Constant tokens for values 0 and 1.
 74221  //  */
 74222  var _sqlite3IntTokens [2]XToken
 74223  
 74224  func init() {
 74225  	_sqlite3IntTokens = [2]XToken{XToken{Xz: str(4809), Xn: uint32(1)}, XToken{Xz: str(49995), Xn: uint32(1)}}
 74226  }
 74227  
 74228  // C comment
 74229  //  /*
 74230  //  ** Attach subtrees pLeft and pRight to the Expr node pRoot.
 74231  //  **
 74232  //  ** If pRoot==NULL that means that a memory allocation error has occurred.
 74233  //  ** In that case, delete the subtrees pLeft and pRight.
 74234  //  */
 74235  func _sqlite3ExprAttachSubtrees(tls *crt.TLS, _db *Xsqlite3, _pRoot *XExpr, _pLeft *XExpr, _pRight *XExpr) {
 74236  	if _pRoot == nil {
 74237  		func() {
 74238  			if _db.XmallocFailed == 0 {
 74239  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91693), unsafe.Pointer(&_sqlite3ExprAttachSubtreesØ00__func__Ø000), unsafe.Pointer(str(47803)))
 74240  				crt.X__builtin_abort(tls)
 74241  			}
 74242  		}()
 74243  		_sqlite3ExprDelete(tls, _db, _pLeft)
 74244  		_sqlite3ExprDelete(tls, _db, _pRight)
 74245  		goto _3
 74246  	}
 74247  	if _pRight != nil {
 74248  		*(**XExpr)(unsafe.Pointer(&_pRoot.XpRight)) = _pRight
 74249  		_pRoot.Xflags |= uint32(2097408) & _pRight.Xflags
 74250  	}
 74251  	if _pLeft != nil {
 74252  		*(**XExpr)(unsafe.Pointer(&_pRoot.XpLeft)) = _pLeft
 74253  		_pRoot.Xflags |= uint32(2097408) & _pLeft.Xflags
 74254  	}
 74255  	_exprSetHeight(tls, _pRoot)
 74256  _3:
 74257  }
 74258  
 74259  var _sqlite3ExprAttachSubtreesØ00__func__Ø000 [26]int8
 74260  
 74261  func init() {
 74262  	crt.Xstrncpy(nil, &_sqlite3ExprAttachSubtreesØ00__func__Ø000[0], str(95147), 26)
 74263  }
 74264  
 74265  // C comment
 74266  //  /*
 74267  //  ** Set the Expr.nHeight variable in the structure passed as an
 74268  //  ** argument. An expression with no children, Expr.pList or
 74269  //  ** Expr.pSelect member has a height of 1. Any other expression
 74270  //  ** has a height equal to the maximum height of any other
 74271  //  ** referenced Expr plus one.
 74272  //  **
 74273  //  ** Also propagate EP_Propagate flags up from Expr.x.pList to Expr.flags,
 74274  //  ** if appropriate.
 74275  //  */
 74276  func _exprSetHeight(tls *crt.TLS, _p *XExpr) {
 74277  	var _nHeight int32
 74278  	_nHeight = int32(0)
 74279  	_heightOfExpr(tls, (*XExpr)(_p.XpLeft), &_nHeight)
 74280  	_heightOfExpr(tls, (*XExpr)(_p.XpRight), &_nHeight)
 74281  	if (_p.Xflags & uint32(2048)) != (0) {
 74282  		_heightOfSelect(tls, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))), &_nHeight)
 74283  		goto _2
 74284  	}
 74285  	if (*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))) != nil {
 74286  		_heightOfExprList(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))), &_nHeight)
 74287  		_p.Xflags |= uint32(2097408) & _sqlite3ExprListFlags(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))))
 74288  	}
 74289  _2:
 74290  	_p.XnHeight = _nHeight + int32(1)
 74291  }
 74292  
 74293  // C comment
 74294  //  /* The following three functions, heightOfExpr(), heightOfExprList()
 74295  //  ** and heightOfSelect(), are used to determine the maximum height
 74296  //  ** of any expression tree referenced by the structure passed as the
 74297  //  ** first argument.
 74298  //  **
 74299  //  ** If this maximum height is greater than the current value pointed
 74300  //  ** to by pnHeight, the second parameter, then set *pnHeight to that
 74301  //  ** value.
 74302  //  */
 74303  func _heightOfExpr(tls *crt.TLS, _p *XExpr, _pnHeight *int32) {
 74304  	if _p == nil {
 74305  		goto _0
 74306  	}
 74307  	if _p.XnHeight > (*_pnHeight) {
 74308  		*_pnHeight = _p.XnHeight
 74309  	}
 74310  _0:
 74311  }
 74312  
 74313  func _heightOfSelect(tls *crt.TLS, _p *XSelect, _pnHeight *int32) {
 74314  	if _p != nil {
 74315  		_heightOfExpr(tls, (*XExpr)(_p.XpWhere), _pnHeight)
 74316  		_heightOfExpr(tls, (*XExpr)(_p.XpHaving), _pnHeight)
 74317  		_heightOfExpr(tls, (*XExpr)(_p.XpLimit), _pnHeight)
 74318  		_heightOfExpr(tls, (*XExpr)(_p.XpOffset), _pnHeight)
 74319  		_heightOfExprList(tls, (*XExprList)(_p.XpEList), _pnHeight)
 74320  		_heightOfExprList(tls, (*XExprList)(_p.XpGroupBy), _pnHeight)
 74321  		_heightOfExprList(tls, (*XExprList)(_p.XpOrderBy), _pnHeight)
 74322  		_heightOfSelect(tls, (*XSelect)(_p.XpPrior), _pnHeight)
 74323  	}
 74324  }
 74325  
 74326  func _heightOfExprList(tls *crt.TLS, _p *XExprList, _pnHeight *int32) {
 74327  	var _1_i int32
 74328  	if _p == nil {
 74329  		goto _0
 74330  	}
 74331  	_1_i = int32(0)
 74332  _1:
 74333  	if _1_i >= _p.XnExpr {
 74334  		goto _4
 74335  	}
 74336  	_heightOfExpr(tls, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_p.Xa)), uintptr(_1_i)).XpExpr), _pnHeight)
 74337  	_1_i += 1
 74338  	goto _1
 74339  _4:
 74340  _0:
 74341  }
 74342  
 74343  // C comment
 74344  //  /*
 74345  //  ** Return the bitwise-OR of all Expr.flags fields in the given
 74346  //  ** ExprList.
 74347  //  */
 74348  func _sqlite3ExprListFlags(tls *crt.TLS, _pList *XExprList) (r0 uint32) {
 74349  	var _i int32
 74350  	var _m uint32
 74351  	var _2_pExpr *XExpr
 74352  	_m = uint32(0)
 74353  	if _pList == nil {
 74354  		goto _0
 74355  	}
 74356  	_i = int32(0)
 74357  _1:
 74358  	if _i >= _pList.XnExpr {
 74359  		goto _4
 74360  	}
 74361  	_2_pExpr = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_i)).XpExpr)
 74362  	func() {
 74363  		if _2_pExpr == nil {
 74364  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92578), unsafe.Pointer(&_sqlite3ExprListFlagsØ00__func__Ø000), unsafe.Pointer(str(43591)))
 74365  			crt.X__builtin_abort(tls)
 74366  		}
 74367  	}()
 74368  	_m |= _2_pExpr.Xflags
 74369  	_i += 1
 74370  	goto _1
 74371  _4:
 74372  _0:
 74373  	return _m
 74374  }
 74375  
 74376  var _sqlite3ExprListFlagsØ00__func__Ø000 [21]int8
 74377  
 74378  func init() {
 74379  	crt.Xstrncpy(nil, &_sqlite3ExprListFlagsØ00__func__Ø000[0], str(95173), 21)
 74380  }
 74381  
 74382  // C comment
 74383  //  /*
 74384  //  ** Check that argument nHeight is less than or equal to the maximum
 74385  //  ** expression depth allowed. If it is not, leave an error message in
 74386  //  ** pParse.
 74387  //  */
 74388  func _sqlite3ExprCheckHeight(tls *crt.TLS, _pParse *XParse, _nHeight int32) (r0 int32) {
 74389  	var _rc, _mxHeight int32
 74390  	_rc = int32(0)
 74391  	_mxHeight = *elem8((*int32)(unsafe.Pointer(&((*Xsqlite3)(_pParse.Xdb).XaLimit))), uintptr(3))
 74392  	if _nHeight > _mxHeight {
 74393  		_sqlite3ErrorMsg(tls, _pParse, str(95194), _mxHeight)
 74394  		_rc = int32(1)
 74395  	}
 74396  	return _rc
 74397  }
 74398  
 74399  // C comment
 74400  //  /*
 74401  //  ** Set the EP_FromJoin property on all terms of the given expression.
 74402  //  ** And set the Expr.iRightJoinTable to iTable for every term in the
 74403  //  ** expression.
 74404  //  **
 74405  //  ** The EP_FromJoin property is used on terms of an expression to tell
 74406  //  ** the LEFT OUTER JOIN processing logic that this term is part of the
 74407  //  ** join restriction specified in the ON or USING clause and not a part
 74408  //  ** of the more general WHERE clause.  These terms are moved over to the
 74409  //  ** WHERE clause during join processing but we need to remember that they
 74410  //  ** originated in the ON or USING clause.
 74411  //  **
 74412  //  ** The Expr.iRightJoinTable tells the WHERE clause processing that the
 74413  //  ** expression depends on table iRightJoinTable even if that table is not
 74414  //  ** explicitly mentioned in the expression.  That information is needed
 74415  //  ** for cases like this:
 74416  //  **
 74417  //  **    SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.b AND t1.x=5
 74418  //  **
 74419  //  ** The where clause needs to defer the handling of the t1.x=5
 74420  //  ** term until after the t2 loop of the join.  In that way, a
 74421  //  ** NULL t2 row will be inserted whenever t1.x!=5.  If we do not
 74422  //  ** defer the handling of t1.x=5, it will be processed immediately
 74423  //  ** after the t1 loop and rows with t1.x!=5 will never appear in
 74424  //  ** the output, which is incorrect.
 74425  //  */
 74426  func _setJoinExpr(tls *crt.TLS, _p *XExpr, _iTable int32) {
 74427  	var _2_i int32
 74428  _0:
 74429  	if _p == nil {
 74430  		goto _1
 74431  	}
 74432  	_p.Xflags |= uint32(1)
 74433  	func() {
 74434  		if (_p.Xflags & uint32(24576)) != (0) {
 74435  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116896), unsafe.Pointer(&_setJoinExprØ00__func__Ø000), unsafe.Pointer(str(49384)))
 74436  			crt.X__builtin_abort(tls)
 74437  		}
 74438  	}()
 74439  	_p.Xflags |= uint32(131072)
 74440  	_p.XiRightJoinTable = int16(_iTable)
 74441  	if int32(_p.Xop) != int32(151) || (*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))) == nil {
 74442  		goto _5
 74443  	}
 74444  	_2_i = int32(0)
 74445  _6:
 74446  	if _2_i >= ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))).XnExpr) {
 74447  		goto _9
 74448  	}
 74449  	_setJoinExpr(tls, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))).Xa))), uintptr(_2_i)).XpExpr), _iTable)
 74450  	_2_i += 1
 74451  	goto _6
 74452  _9:
 74453  _5:
 74454  	_setJoinExpr(tls, (*XExpr)(_p.XpLeft), _iTable)
 74455  	_p = (*XExpr)(_p.XpRight)
 74456  	goto _0
 74457  _1:
 74458  }
 74459  
 74460  var _setJoinExprØ00__func__Ø000 [12]int8
 74461  
 74462  func init() {
 74463  	crt.Xstrncpy(nil, &_setJoinExprØ00__func__Ø000[0], str(95242), 12)
 74464  }
 74465  
 74466  // C comment
 74467  //  /*
 74468  //  ** Subqueries stores the original database, table and column names for their
 74469  //  ** result sets in ExprList.a[].zSpan, in the form "DATABASE.TABLE.COLUMN".
 74470  //  ** Check to see if the zSpan given to this routine matches the zDb, zTab,
 74471  //  ** and zCol.  If any of zDb, zTab, and zCol are NULL then those fields will
 74472  //  ** match anything.
 74473  //  */
 74474  func _sqlite3MatchSpanName(tls *crt.TLS, _zSpan *int8, _zCol *int8, _zTab *int8, _zDb *int8) (r0 int32) {
 74475  	var _n int32
 74476  	_n = int32(0)
 74477  _0:
 74478  	if func() int32 {
 74479  		if (*elem1(_zSpan, uintptr(_n))) != 0 {
 74480  			return int32(1)
 74481  		}
 74482  		return func() int32 {
 74483  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89484), unsafe.Pointer(&_sqlite3MatchSpanNameØ00__func__Ø000), unsafe.Pointer(str(4809)))
 74484  			crt.X__builtin_abort(tls)
 74485  			return int32(0)
 74486  		}()
 74487  	}() == 0 || int32(*elem1(_zSpan, uintptr(_n))) == int32(46) {
 74488  		goto _6
 74489  	}
 74490  	_n += 1
 74491  	goto _0
 74492  _6:
 74493  	if (_zDb != nil) && ((Xsqlite3_strnicmp(tls, _zSpan, _zDb, _n) != int32(0)) || (int32(*elem1(_zDb, uintptr(_n))) != int32(0))) {
 74494  		return int32(0)
 74495  	}
 74496  	*(*uintptr)(unsafe.Pointer(&_zSpan)) += uintptr(_n + int32(1))
 74497  	_n = int32(0)
 74498  _10:
 74499  	if func() int32 {
 74500  		if (*elem1(_zSpan, uintptr(_n))) != 0 {
 74501  			return int32(1)
 74502  		}
 74503  		return func() int32 {
 74504  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89489), unsafe.Pointer(&_sqlite3MatchSpanNameØ00__func__Ø000), unsafe.Pointer(str(4809)))
 74505  			crt.X__builtin_abort(tls)
 74506  			return int32(0)
 74507  		}()
 74508  	}() == 0 || int32(*elem1(_zSpan, uintptr(_n))) == int32(46) {
 74509  		goto _16
 74510  	}
 74511  	_n += 1
 74512  	goto _10
 74513  _16:
 74514  	if (_zTab != nil) && ((Xsqlite3_strnicmp(tls, _zSpan, _zTab, _n) != int32(0)) || (int32(*elem1(_zTab, uintptr(_n))) != int32(0))) {
 74515  		return int32(0)
 74516  	}
 74517  	*(*uintptr)(unsafe.Pointer(&_zSpan)) += uintptr(_n + int32(1))
 74518  	if (_zCol != nil) && (_sqlite3StrICmp(tls, _zSpan, _zCol) != int32(0)) {
 74519  		return int32(0)
 74520  	}
 74521  	return int32(1)
 74522  }
 74523  
 74524  var _sqlite3MatchSpanNameØ00__func__Ø000 [21]int8
 74525  
 74526  func init() {
 74527  	crt.Xstrncpy(nil, &_sqlite3MatchSpanNameØ00__func__Ø000[0], str(95254), 21)
 74528  }
 74529  
 74530  // C comment
 74531  //  /*
 74532  //  ** Return the index in pList of the identifier named zId.  Return -1
 74533  //  ** if not found.
 74534  //  */
 74535  func _sqlite3IdListIndex(tls *crt.TLS, _pList *XIdList, _zName *int8) (r0 int32) {
 74536  	var _i int32
 74537  	if _pList == nil {
 74538  		return int32(-1)
 74539  	}
 74540  	_i = int32(0)
 74541  _1:
 74542  	if _i >= _pList.XnId {
 74543  		goto _4
 74544  	}
 74545  	if _sqlite3StrICmp(tls, elem42((*TIdList_item)(_pList.Xa), uintptr(_i)).XzName, _zName) == int32(0) {
 74546  		return _i
 74547  	}
 74548  	_i += 1
 74549  	goto _1
 74550  _4:
 74551  	return int32(-1)
 74552  }
 74553  
 74554  // C comment
 74555  //  /*
 74556  //  ** Generate a Token object from a string
 74557  //  */
 74558  func _sqlite3TokenInit(tls *crt.TLS, _p *XToken, _z *int8) {
 74559  	_p.Xz = _z
 74560  	_p.Xn = uint32(_sqlite3Strlen30(tls, _z))
 74561  }
 74562  
 74563  // C comment
 74564  //  /*
 74565  //  ** Set the ExprList.a[].zName element of the most recently added item
 74566  //  ** on the expression list.
 74567  //  **
 74568  //  ** pList might be NULL following an OOM error.  But pName should never be
 74569  //  ** NULL.  If a memory allocation fails, the pParse->db->mallocFailed flag
 74570  //  ** is set.
 74571  //  */
 74572  func _sqlite3ExprListSetName(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _pName *XToken, _dequote int32) {
 74573  	var _1_pItem *TExprList_item
 74574  	func() {
 74575  		if _pList == nil && int32((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == int32(0) {
 74576  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92496), unsafe.Pointer(&_sqlite3ExprListSetNameØ00__func__Ø000), unsafe.Pointer(str(95275)))
 74577  			crt.X__builtin_abort(tls)
 74578  		}
 74579  	}()
 74580  	if _pList == nil {
 74581  		goto _3
 74582  	}
 74583  	func() {
 74584  		if _pList.XnExpr <= int32(0) {
 74585  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92499), unsafe.Pointer(&_sqlite3ExprListSetNameØ00__func__Ø000), unsafe.Pointer(str(21290)))
 74586  			crt.X__builtin_abort(tls)
 74587  		}
 74588  	}()
 74589  	_1_pItem = elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_pList.XnExpr-int32(1)))
 74590  	func() {
 74591  		if _1_pItem.XzName != nil {
 74592  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92501), unsafe.Pointer(&_sqlite3ExprListSetNameØ00__func__Ø000), unsafe.Pointer(str(95315)))
 74593  			crt.X__builtin_abort(tls)
 74594  		}
 74595  	}()
 74596  	_1_pItem.XzName = _sqlite3DbStrNDup(tls, (*Xsqlite3)(_pParse.Xdb), _pName.Xz, uint64(_pName.Xn))
 74597  	if _dequote != 0 {
 74598  		_sqlite3Dequote(tls, _1_pItem.XzName)
 74599  	}
 74600  _3:
 74601  }
 74602  
 74603  var _sqlite3ExprListSetNameØ00__func__Ø000 [23]int8
 74604  
 74605  func init() {
 74606  	crt.Xstrncpy(nil, &_sqlite3ExprListSetNameØ00__func__Ø000[0], str(95331), 23)
 74607  }
 74608  
 74609  // C comment
 74610  //  /*
 74611  //  ** If the SELECT passed as the second argument has an associated WITH
 74612  //  ** clause, pop it from the stack stored as part of the Parse object.
 74613  //  **
 74614  //  ** This function is used as the xSelectCallback2() callback by
 74615  //  ** sqlite3SelectExpand() when walking a SELECT tree to resolve table
 74616  //  ** names and other FROM clause elements.
 74617  //  */
 74618  func _selectPopWith(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) {
 74619  	var _1_pWith *XWith
 74620  	var _pParse *XParse
 74621  	_pParse = (*XParse)(_pWalker.XpParse)
 74622  	if _pParse.XpWith == nil || (*XSelect)(_p.XpPrior) != nil {
 74623  		goto _1
 74624  	}
 74625  	_1_pWith = (*XWith)(_findRightmost(tls, _p).XpWith)
 74626  	if _1_pWith != nil {
 74627  		func() {
 74628  			if (*XWith)(_pParse.XpWith) != _1_pWith {
 74629  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120817), unsafe.Pointer(&_selectPopWithØ00__func__Ø000), unsafe.Pointer(str(95354)))
 74630  				crt.X__builtin_abort(tls)
 74631  			}
 74632  		}()
 74633  		*(**XWith)(unsafe.Pointer(&_pParse.XpWith)) = (*XWith)(_1_pWith.XpOuter)
 74634  	}
 74635  _1:
 74636  }
 74637  
 74638  // C comment
 74639  //  /*
 74640  //  ** Return a pointer to the right-most SELECT statement in a compound.
 74641  //  */
 74642  func _findRightmost(tls *crt.TLS, _p *XSelect) (r0 *XSelect) {
 74643  _0:
 74644  	if _p.XpNext != nil {
 74645  		_p = (*XSelect)(_p.XpNext)
 74646  		goto _0
 74647  	}
 74648  	return _p
 74649  }
 74650  
 74651  var _selectPopWithØ00__func__Ø000 [14]int8
 74652  
 74653  func init() {
 74654  	crt.Xstrncpy(nil, &_selectPopWithØ00__func__Ø000[0], str(95375), 14)
 74655  }
 74656  
 74657  // C comment
 74658  //  /*
 74659  //  ** Resolve all names in all expressions of a SELECT and in all
 74660  //  ** decendents of the SELECT, including compounds off of p->pPrior,
 74661  //  ** subqueries in expressions, and subqueries used as FROM clause
 74662  //  ** terms.
 74663  //  **
 74664  //  ** See sqlite3ResolveExprNames() for a description of the kinds of
 74665  //  ** transformations that occur.
 74666  //  **
 74667  //  ** All SELECT statements should have been expanded using
 74668  //  ** sqlite3SelectExpand() prior to invoking this routine.
 74669  //  */
 74670  func _sqlite3ResolveSelectNames(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pOuterNC *XNameContext) {
 74671  	var _w XWalker
 74672  	func() {
 74673  		if _p == nil {
 74674  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90853), unsafe.Pointer(&_sqlite3ResolveSelectNamesØ00__func__Ø000), unsafe.Pointer(str(807)))
 74675  			crt.X__builtin_abort(tls)
 74676  		}
 74677  	}()
 74678  	crt.Xmemset(tls, unsafe.Pointer(&_w), int32(0), uint32(28))
 74679  	*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_w.XxExprCallback)) = _resolveExprStep
 74680  	*(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer(&_w.XxSelectCallback)) = _resolveSelectStep
 74681  	*(**XParse)(unsafe.Pointer(&_w.XpParse)) = _pParse
 74682  	*(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_w.Xu)))) = _pOuterNC
 74683  	_sqlite3WalkSelect(tls, &_w, _p)
 74684  }
 74685  
 74686  var _sqlite3ResolveSelectNamesØ00__func__Ø000 [26]int8
 74687  
 74688  func init() {
 74689  	crt.Xstrncpy(nil, &_sqlite3ResolveSelectNamesØ00__func__Ø000[0], str(95389), 26)
 74690  }
 74691  
 74692  // C comment
 74693  //  /*
 74694  //  ** This routine is callback for sqlite3WalkExpr().
 74695  //  **
 74696  //  ** Resolve symbolic names into TK_COLUMN operators for the current
 74697  //  ** node in the expression tree.  Return 0 to continue the search down
 74698  //  ** the tree or 2 to abort the tree walk.
 74699  //  **
 74700  //  ** This routine also does error checking and name resolution for
 74701  //  ** function names.  The operator for aggregate functions is changed
 74702  //  ** to TK_AGG_FUNCTION.
 74703  //  */
 74704  func _resolveExprStep(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
 74705  	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
 74706  	var _4_zColumn, _4_zTable, _4_zDb, _9_zId *int8
 74707  	var _9_enc uint8
 74708  	var _9_pDef *XFuncDef
 74709  	var _1_pSrcList *XSrcList
 74710  	var _9_pList *XExprList
 74711  	var _4_pRight *XExpr
 74712  	var _pParse *XParse
 74713  	var _pNC, _26_pNC2 *XNameContext
 74714  	_pNC = (*XNameContext)(*(*unsafe.Pointer)(unsafe.Pointer(&_pWalker.Xu)))
 74715  	func() {
 74716  		if _pNC == nil {
 74717  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89925), unsafe.Pointer(&_resolveExprStepØ00__func__Ø000), unsafe.Pointer(str(95415)))
 74718  			crt.X__builtin_abort(tls)
 74719  		}
 74720  	}()
 74721  	_pParse = (*XParse)(_pNC.XpParse)
 74722  	func() {
 74723  		if _pParse != (*XParse)(_pWalker.XpParse) {
 74724  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89927), unsafe.Pointer(&_resolveExprStepØ00__func__Ø000), unsafe.Pointer(str(95422)))
 74725  			crt.X__builtin_abort(tls)
 74726  		}
 74727  	}()
 74728  	if (_pExpr.Xflags & uint32(4)) != (0) {
 74729  		return int32(1)
 74730  	}
 74731  	_pExpr.Xflags |= uint32(4)
 74732  	if _pNC.XpSrcList == nil || ((*XSrcList)(_pNC.XpSrcList).XnAlloc) <= (0) {
 74733  		goto _6
 74734  	}
 74735  	_1_pSrcList = (*XSrcList)(_pNC.XpSrcList)
 74736  	_1_i = int32(0)
 74737  _7:
 74738  	if _1_i >= ((*XSrcList)(_pNC.XpSrcList).XnSrc) {
 74739  		goto _10
 74740  	}
 74741  	func() {
 74742  		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 {
 74743  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89936), unsafe.Pointer(&_resolveExprStepØ00__func__Ø000), unsafe.Pointer(str(95446)))
 74744  			crt.X__builtin_abort(tls)
 74745  		}
 74746  	}()
 74747  	_1_i += 1
 74748  	goto _7
 74749  _10:
 74750  _6:
 74751  	switch int32(_pExpr.Xop) {
 74752  	case int32(20):
 74753  		goto _18
 74754  	case int32(27):
 74755  		goto _15
 74756  	case int32(72):
 74757  		goto _22
 74758  	case int32(73):
 74759  		goto _22
 74760  	case int32(74):
 74761  		goto _18
 74762  	case int32(77):
 74763  		goto _22
 74764  	case int32(78):
 74765  		goto _22
 74766  	case int32(79):
 74767  		goto _22
 74768  	case int32(80):
 74769  		goto _22
 74770  	case int32(81):
 74771  		goto _22
 74772  	case int32(82):
 74773  		goto _22
 74774  	case int32(119):
 74775  		goto _18
 74776  	case int32(122):
 74777  		goto _15
 74778  	case int32(135):
 74779  		goto _21
 74780  	case int32(148):
 74781  		goto _22
 74782  	case int32(151):
 74783  		goto _17
 74784  	default:
 74785  		goto _31
 74786  	}
 74787  
 74788  _15:
 74789  	if int32(_pExpr.Xop) == int32(27) {
 74790  		_4_zDb = nil
 74791  		_4_zTable = nil
 74792  		_4_zColumn = *(**int8)(unsafe.Pointer(&_pExpr.Xu))
 74793  		goto _33
 74794  	}
 74795  	_notValid(tls, _pParse, _pNC, str(95511), int32(32))
 74796  	_4_pRight = (*XExpr)(_pExpr.XpRight)
 74797  	if int32(_4_pRight.Xop) == int32(27) {
 74798  		_4_zDb = nil
 74799  		_4_zTable = *(**int8)(unsafe.Pointer(&((*XExpr)(_pExpr.XpLeft).Xu)))
 74800  		_4_zColumn = *(**int8)(unsafe.Pointer(&_4_pRight.Xu))
 74801  		goto _35
 74802  	}
 74803  	func() {
 74804  		if int32(_4_pRight.Xop) != int32(122) {
 74805  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89989), unsafe.Pointer(&_resolveExprStepØ00__func__Ø000), unsafe.Pointer(str(95528)))
 74806  			crt.X__builtin_abort(tls)
 74807  		}
 74808  	}()
 74809  	_4_zDb = *(**int8)(unsafe.Pointer(&((*XExpr)(_pExpr.XpLeft).Xu)))
 74810  	_4_zTable = *(**int8)(unsafe.Pointer(&((*XExpr)(_4_pRight.XpLeft).Xu)))
 74811  	_4_zColumn = *(**int8)(unsafe.Pointer(&((*XExpr)(_4_pRight.XpRight).Xu)))
 74812  _35:
 74813  _33:
 74814  	return _lookupName(tls, _pParse, _4_zDb, _4_zTable, _4_zColumn, _pNC, _pExpr)
 74815  
 74816  _17:
 74817  	_9_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 74818  	_9_n = func() int32 {
 74819  		if _9_pList != nil {
 74820  			return _9_pList.XnExpr
 74821  		}
 74822  		return int32(0)
 74823  	}()
 74824  	_9_no_such_func = int32(0)
 74825  	_9_wrong_num_args = int32(0)
 74826  	_9_is_agg = int32(0)
 74827  	_9_enc = (*Xsqlite3)(_pParse.Xdb).Xenc
 74828  	func() {
 74829  		if (_pExpr.Xflags & uint32(2048)) != (0) {
 74830  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90011), unsafe.Pointer(&_resolveExprStepØ00__func__Ø000), unsafe.Pointer(str(42733)))
 74831  			crt.X__builtin_abort(tls)
 74832  		}
 74833  	}()
 74834  	_9_zId = *(**int8)(unsafe.Pointer(&_pExpr.Xu))
 74835  	_9_nId = _sqlite3Strlen30(tls, _9_zId)
 74836  	_9_pDef = _sqlite3FindFunction(tls, (*Xsqlite3)(_pParse.Xdb), _9_zId, _9_n, _9_enc, 0)
 74837  	if _9_pDef != nil {
 74838  		goto _42
 74839  	}
 74840  	_9_pDef = _sqlite3FindFunction(tls, (*Xsqlite3)(_pParse.Xdb), _9_zId, int32(-2), _9_enc, 0)
 74841  	if _9_pDef == nil {
 74842  		_9_no_such_func = int32(1)
 74843  		goto _44
 74844  	}
 74845  	_9_wrong_num_args = int32(1)
 74846  _44:
 74847  	goto _45
 74848  _42:
 74849  	_9_is_agg = bool2int(func() func(*crt.TLS, *Xsqlite3_context) {
 74850  		v := _9_pDef.XxFinalize
 74851  		return *(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer(&v))
 74852  	}() != nil)
 74853  	if (int32(_9_pDef.XfuncFlags) & int32(1024)) == 0 {
 74854  		goto _46
 74855  	}
 74856  	_pExpr.Xflags |= uint32(266240)
 74857  	if _9_n != int32(2) {
 74858  		goto _47
 74859  	}
 74860  	_pExpr.XiTable = _exprProbability(tls, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_9_pList.Xa)), uintptr(1)).XpExpr))
 74861  	if _pExpr.XiTable < int32(0) {
 74862  		_sqlite3ErrorMsg(tls, _pParse, str(95547))
 74863  		_pNC.XnErr += 1
 74864  	}
 74865  	goto _49
 74866  _47:
 74867  	_pExpr.XiTable = func() int32 {
 74868  		if int32(*elem1(_9_pDef.XzName, 0)) == int32(117) {
 74869  			return int32(8388608)
 74870  		}
 74871  		return int32(125829120)
 74872  	}()
 74873  _49:
 74874  _46:
 74875  	_18_auth = _sqlite3AuthCheck(tls, _pParse, int32(31), nil, _9_pDef.XzName, nil)
 74876  	if _18_auth == int32(0) {
 74877  		goto _52
 74878  	}
 74879  	if _18_auth == int32(1) {
 74880  		_sqlite3ErrorMsg(tls, _pParse, str(95618), unsafe.Pointer(_9_pDef.XzName))
 74881  		_pNC.XnErr += 1
 74882  	}
 74883  	_pExpr.Xop = uint8(101)
 74884  	return int32(1)
 74885  
 74886  _52:
 74887  	if (int32(_9_pDef.XfuncFlags) & int32(10240)) != 0 {
 74888  		_pExpr.Xflags |= uint32(524288)
 74889  	}
 74890  	if (int32(_9_pDef.XfuncFlags) & int32(2048)) == int32(0) {
 74891  		_notValid(tls, _pParse, _pNC, str(95653), int32(34))
 74892  	}
 74893  _45:
 74894  	if _9_is_agg != 0 && ((int32(_pNC.XncFlags) & int32(1)) == int32(0)) {
 74895  		_sqlite3ErrorMsg(tls, _pParse, str(95681), _9_nId, unsafe.Pointer(_9_zId))
 74896  		_pNC.XnErr += 1
 74897  		_9_is_agg = int32(0)
 74898  		goto _62
 74899  	}
 74900  	if _9_no_such_func != 0 && (int32(((*Xsqlite3)(_pParse.Xdb).Xinit).Xbusy) == int32(0)) {
 74901  		_sqlite3ErrorMsg(tls, _pParse, str(95717), _9_nId, unsafe.Pointer(_9_zId))
 74902  		_pNC.XnErr += 1
 74903  		goto _62
 74904  	}
 74905  	if _9_wrong_num_args != 0 {
 74906  		_sqlite3ErrorMsg(tls, _pParse, str(95740), _9_nId, unsafe.Pointer(_9_zId))
 74907  		_pNC.XnErr += 1
 74908  	}
 74909  _62:
 74910  	if _9_is_agg != 0 {
 74911  		{
 74912  			p := &_pNC.XncFlags
 74913  			*p = uint16(int32(*p) & int32(-2))
 74914  		}
 74915  	}
 74916  	_sqlite3WalkExprList(tls, _pWalker, _9_pList)
 74917  	if _9_is_agg == 0 {
 74918  		goto _64
 74919  	}
 74920  	_26_pNC2 = _pNC
 74921  	_pExpr.Xop = uint8(153)
 74922  	_pExpr.Xop2 = 0
 74923  _65:
 74924  	if (_26_pNC2 != nil) && (_sqlite3FunctionUsesThisSrc(tls, _pExpr, (*XSrcList)(_26_pNC2.XpSrcList)) == 0) {
 74925  		_pExpr.Xop2 += 1
 74926  		_26_pNC2 = (*XNameContext)(_26_pNC2.XpNext)
 74927  		goto _65
 74928  	}
 74929  	func() {
 74930  		if _9_pDef == nil {
 74931  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90101), unsafe.Pointer(&_resolveExprStepØ00__func__Ø000), unsafe.Pointer(str(95785)))
 74932  			crt.X__builtin_abort(tls)
 74933  		}
 74934  	}()
 74935  	if _26_pNC2 != nil {
 74936  		{
 74937  			p := &_26_pNC2.XncFlags
 74938  			*p = uint16(int32(*p) | (int32(16) | (int32(_9_pDef.XfuncFlags) & int32(4096))))
 74939  		}
 74940  	}
 74941  	{
 74942  		p := &_pNC.XncFlags
 74943  		*p = uint16(int32(*p) | int32(1))
 74944  	}
 74945  _64:
 74946  	return int32(1)
 74947  
 74948  _18:
 74949  	if (_pExpr.Xflags & uint32(2048)) == (0) {
 74950  		goto _71
 74951  	}
 74952  	_30_nRef = _pNC.XnRef
 74953  	_notValid(tls, _pParse, _pNC, str(95793), int32(38))
 74954  	_sqlite3WalkSelect(tls, _pWalker, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))))
 74955  	func() {
 74956  		if _pNC.XnRef < _30_nRef {
 74957  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90125), unsafe.Pointer(&_resolveExprStepØ00__func__Ø000), unsafe.Pointer(str(95804)))
 74958  			crt.X__builtin_abort(tls)
 74959  		}
 74960  	}()
 74961  	if _30_nRef != _pNC.XnRef {
 74962  		_pExpr.Xflags |= uint32(32)
 74963  		{
 74964  			p := &_pNC.XncFlags
 74965  			*p = uint16(int32(*p) | int32(64))
 74966  		}
 74967  	}
 74968  _71:
 74969  	goto _31
 74970  _21:
 74971  	_notValid(tls, _pParse, _pNC, str(95820), int32(38))
 74972  	goto _31
 74973  _22:
 74974  	if ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) != 0 {
 74975  		goto _31
 74976  	}
 74977  	func() {
 74978  		if (*XExpr)(_pExpr.XpLeft) == nil {
 74979  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90148), unsafe.Pointer(&_resolveExprStepØ00__func__Ø000), unsafe.Pointer(str(95831)))
 74980  			crt.X__builtin_abort(tls)
 74981  		}
 74982  	}()
 74983  	_33_nLeft = _sqlite3ExprVectorSize(tls, (*XExpr)(_pExpr.XpLeft))
 74984  	if int32(_pExpr.Xop) != int32(73) {
 74985  		goto _78
 74986  	}
 74987  	_33_nRight = _sqlite3ExprVectorSize(tls, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).Xa))), 0).XpExpr))
 74988  	if _33_nRight == _33_nLeft {
 74989  		_33_nRight = _sqlite3ExprVectorSize(tls, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).Xa))), uintptr(1)).XpExpr))
 74990  	}
 74991  	goto _80
 74992  _78:
 74993  	func() {
 74994  		if (*XExpr)(_pExpr.XpRight) == nil {
 74995  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90156), unsafe.Pointer(&_resolveExprStepØ00__func__Ø000), unsafe.Pointer(str(95847)))
 74996  			crt.X__builtin_abort(tls)
 74997  		}
 74998  	}()
 74999  	_33_nRight = _sqlite3ExprVectorSize(tls, (*XExpr)(_pExpr.XpRight))
 75000  _80:
 75001  	if _33_nLeft != _33_nRight {
 75002  		_sqlite3ErrorMsg(tls, _pParse, str(43136))
 75003  	}
 75004  	goto _31
 75005  _31:
 75006  	return func() int32 {
 75007  		if _pParse.XnErr != 0 || (((*Xsqlite3)(_pParse.Xdb).XmallocFailed) != 0) {
 75008  			return int32(2)
 75009  		}
 75010  		return int32(0)
 75011  	}()
 75012  }
 75013  
 75014  var _resolveExprStepØ00__func__Ø000 [16]int8
 75015  
 75016  func init() {
 75017  	crt.Xstrncpy(nil, &_resolveExprStepØ00__func__Ø000[0], str(95864), 16)
 75018  }
 75019  
 75020  // C comment
 75021  //  /*
 75022  //  ** Report an error that an expression is not valid for some set of
 75023  //  ** pNC->ncFlags values determined by validMask.
 75024  //  */
 75025  func _notValid(tls *crt.TLS, _pParse *XParse, _pNC *XNameContext, _zMsg *int8, _validMask int32) {
 75026  	var _1_zIn *int8
 75027  	func() {
 75028  		if (_validMask & int32(-39)) != int32(0) {
 75029  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89884), unsafe.Pointer(&_notValidØ00__func__Ø000), unsafe.Pointer(str(95880)))
 75030  			crt.X__builtin_abort(tls)
 75031  		}
 75032  	}()
 75033  	if (int32(_pNC.XncFlags) & _validMask) == int32(0) {
 75034  		goto _2
 75035  	}
 75036  	_1_zIn = str(95931)
 75037  	if (int32(_pNC.XncFlags) & int32(32)) != 0 {
 75038  		_1_zIn = str(95959)
 75039  		goto _5
 75040  	}
 75041  	if (int32(_pNC.XncFlags) & int32(4)) != 0 {
 75042  		_1_zIn = str(95977)
 75043  	}
 75044  _5:
 75045  	_sqlite3ErrorMsg(tls, _pParse, str(95995), unsafe.Pointer(_zMsg), unsafe.Pointer(_1_zIn))
 75046  _2:
 75047  }
 75048  
 75049  var _notValidØ00__func__Ø000 [9]int8
 75050  
 75051  func init() {
 75052  	crt.Xstrncpy(nil, &_notValidØ00__func__Ø000[0], str(96015), 9)
 75053  }
 75054  
 75055  // C comment
 75056  //  /*
 75057  //  ** Given the name of a column of the form X.Y.Z or Y.Z or just Z, look up
 75058  //  ** that name in the set of source tables in pSrcList and make the pExpr
 75059  //  ** expression node refer back to that source column.  The following changes
 75060  //  ** are made to pExpr:
 75061  //  **
 75062  //  **    pExpr->iDb           Set the index in db->aDb[] of the database X
 75063  //  **                         (even if X is implied).
 75064  //  **    pExpr->iTable        Set to the cursor number for the table obtained
 75065  //  **                         from pSrcList.
 75066  //  **    pExpr->pTab          Points to the Table structure of X.Y (even if
 75067  //  **                         X and/or Y are implied.)
 75068  //  **    pExpr->iColumn       Set to the column number within the table.
 75069  //  **    pExpr->op            Set to TK_COLUMN.
 75070  //  **    pExpr->pLeft         Any expression this points to is deleted
 75071  //  **    pExpr->pRight        Any expression this points to is deleted.
 75072  //  **
 75073  //  ** The zDb variable is the name of the database (the "X").  This value may be
 75074  //  ** NULL meaning that name is of the form Y.Z or Z.  Any available database
 75075  //  ** can be used.  The zTable variable is the name of the table (the "Y").  This
 75076  //  ** value can be NULL if zDb is also NULL.  If zTable is NULL it
 75077  //  ** means that the form of the name is Z and that columns from any table
 75078  //  ** can be used.
 75079  //  **
 75080  //  ** If the name cannot be resolved unambiguously, leave an error message
 75081  //  ** in pParse and return WRC_Abort.  Return WRC_Prune on success.
 75082  //  */
 75083  func _lookupName(tls *crt.TLS, _pParse *XParse, _zDb *int8, _zTab *int8, _zCol *int8, _pNC *XNameContext, _pExpr *XExpr) (r0 int32) {
 75084  	var _i, _j, _cnt, _cntTab, _nSubquery, _isTrigger, _9_hit, _21_op, _25_iCol, _45_n int32
 75085  	var _13_zTabName, _36_zAs, _41_zErr *int8
 75086  	var _db *Xsqlite3
 75087  	var _pSchema *XSchema
 75088  	var _pTab *XTable
 75089  	var _6_pSrcList *XSrcList
 75090  	var _pItem, _pMatch *TSrcList_item
 75091  	var _6_pEList *XExprList
 75092  	var _37_pOrig *XExpr
 75093  	var _pCol *XColumn
 75094  	var _pTopNC *XNameContext
 75095  	_cnt = int32(0)
 75096  	_cntTab = int32(0)
 75097  	_nSubquery = int32(0)
 75098  	_db = (*Xsqlite3)(_pParse.Xdb)
 75099  	_pMatch = nil
 75100  	_pTopNC = _pNC
 75101  	_pSchema = nil
 75102  	_isTrigger = int32(0)
 75103  	_pTab = nil
 75104  	func() {
 75105  		if _pNC == nil {
 75106  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89548), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96024)))
 75107  			crt.X__builtin_abort(tls)
 75108  		}
 75109  	}()
 75110  	func() {
 75111  		if _zCol == nil {
 75112  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89549), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96028)))
 75113  			crt.X__builtin_abort(tls)
 75114  		}
 75115  	}()
 75116  	func() {
 75117  		if (_pExpr.Xflags & uint32(24576)) != (0) {
 75118  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89550), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96033)))
 75119  			crt.X__builtin_abort(tls)
 75120  		}
 75121  	}()
 75122  	_pExpr.XiTable = int32(-1)
 75123  	*(**XTable)(unsafe.Pointer(&_pExpr.XpTab)) = nil
 75124  	_pExpr.Xflags |= uint32(131072)
 75125  	if _zDb == nil {
 75126  		goto _6
 75127  	}
 75128  	if (int32(_pNC.XncFlags) & int32(6)) != int32(0) {
 75129  		_zDb = nil
 75130  		goto _8
 75131  	}
 75132  	_i = int32(0)
 75133  _9:
 75134  	if _i >= _db.XnDb {
 75135  		goto _12
 75136  	}
 75137  	func() {
 75138  		if (elem27((*XDb)(_db.XaDb), uintptr(_i)).XzDbSName) == nil {
 75139  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89572), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96082)))
 75140  			crt.X__builtin_abort(tls)
 75141  		}
 75142  	}()
 75143  	if _sqlite3StrICmp(tls, elem27((*XDb)(_db.XaDb), uintptr(_i)).XzDbSName, _zDb) == int32(0) {
 75144  		_pSchema = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpSchema)
 75145  		goto _12
 75146  	}
 75147  	_i += 1
 75148  	goto _9
 75149  _12:
 75150  _8:
 75151  _6:
 75152  	func() {
 75153  		if _pNC == nil || _cnt != int32(0) {
 75154  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89582), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96102)))
 75155  			crt.X__builtin_abort(tls)
 75156  		}
 75157  	}()
 75158  _19:
 75159  	_6_pSrcList = (*XSrcList)(_pNC.XpSrcList)
 75160  	if _6_pSrcList == nil {
 75161  		goto _20
 75162  	}
 75163  	*func() **TSrcList_item { _i = int32(0); return &_pItem }() = (*TSrcList_item)(unsafe.Pointer(&_6_pSrcList.Xa))
 75164  _21:
 75165  	if _i >= _6_pSrcList.XnSrc {
 75166  		goto _24
 75167  	}
 75168  	_pTab = (*XTable)(_pItem.XpTab)
 75169  	func() {
 75170  		if _pTab == nil || _pTab.XzName == nil {
 75171  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89590), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96116)))
 75172  			crt.X__builtin_abort(tls)
 75173  		}
 75174  	}()
 75175  	func() {
 75176  		if int32(_pTab.XnCol) <= int32(0) {
 75177  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89591), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96142)))
 75178  			crt.X__builtin_abort(tls)
 75179  		}
 75180  	}()
 75181  	if _pItem.XpSelect == nil || (((*XSelect)(_pItem.XpSelect).XselFlags)&uint32(2048)) == (0) {
 75182  		goto _31
 75183  	}
 75184  	_9_hit = int32(0)
 75185  	_6_pEList = (*XExprList)((*XSelect)(_pItem.XpSelect).XpEList)
 75186  	_j = int32(0)
 75187  _32:
 75188  	if _j >= _6_pEList.XnExpr {
 75189  		goto _35
 75190  	}
 75191  	if _sqlite3MatchSpanName(tls, elem57((*TExprList_item)(unsafe.Pointer(&_6_pEList.Xa)), uintptr(_j)).XzSpan, _zCol, _zTab, _zDb) != 0 {
 75192  		_cnt += 1
 75193  		_cntTab = int32(2)
 75194  		_pMatch = _pItem
 75195  		_pExpr.XiColumn = int16(_j)
 75196  		_9_hit = int32(1)
 75197  	}
 75198  	_j += 1
 75199  	goto _32
 75200  _35:
 75201  	if _9_hit != 0 || (_zTab == nil) {
 75202  		goto _22
 75203  	}
 75204  _31:
 75205  	if (_zDb != nil) && ((*XSchema)(_pTab.XpSchema) != _pSchema) {
 75206  		goto _22
 75207  	}
 75208  	if _zTab == nil {
 75209  		goto _41
 75210  	}
 75211  	_13_zTabName = func() *int8 {
 75212  		if _pItem.XzAlias != nil {
 75213  			return _pItem.XzAlias
 75214  		}
 75215  		return _pTab.XzName
 75216  	}()
 75217  	func() {
 75218  		if _13_zTabName == nil {
 75219  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89611), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96155)))
 75220  			crt.X__builtin_abort(tls)
 75221  		}
 75222  	}()
 75223  	if _sqlite3StrICmp(tls, _13_zTabName, _zTab) != int32(0) {
 75224  		goto _22
 75225  	}
 75226  _41:
 75227  	if int32(0) == postInc2(&_cntTab, 1) {
 75228  		_pMatch = _pItem
 75229  	}
 75230  	*func() **XColumn { _j = int32(0); return &_pCol }() = (*XColumn)(_pTab.XaCol)
 75231  _48:
 75232  	if _j >= int32(_pTab.XnCol) {
 75233  		goto _51
 75234  	}
 75235  	if _sqlite3StrICmp(tls, _pCol.XzName, _zCol) != int32(0) {
 75236  		goto _52
 75237  	}
 75238  	if _cnt != int32(1) {
 75239  		goto _53
 75240  	}
 75241  	if (int32(_pItem.Xfg.Xjointype) & int32(4)) != 0 {
 75242  		goto _49
 75243  	}
 75244  	if _nameInUsingClause(tls, (*XIdList)(_pItem.XpUsing), _zCol) != 0 {
 75245  		goto _49
 75246  	}
 75247  _53:
 75248  	_cnt += 1
 75249  	_pMatch = _pItem
 75250  	_pExpr.XiColumn = int16(func() int32 {
 75251  		if _j == int32(_pTab.XiPKey) {
 75252  			return int32(-1)
 75253  		}
 75254  		return int32(int16(_j))
 75255  	}())
 75256  	goto _51
 75257  _52:
 75258  _49:
 75259  	*(*uintptr)(unsafe.Pointer(func() **XColumn { _j += 1; return &_pCol }())) += uintptr(16)
 75260  	goto _48
 75261  _51:
 75262  _22:
 75263  	*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pItem }())) += uintptr(68)
 75264  	goto _21
 75265  _24:
 75266  	if _pMatch == nil {
 75267  		goto _58
 75268  	}
 75269  	_pExpr.XiTable = _pMatch.XiCursor
 75270  	*(**XTable)(unsafe.Pointer(&_pExpr.XpTab)) = (*XTable)(_pMatch.XpTab)
 75271  	func() {
 75272  		if (int32(_pMatch.Xfg.Xjointype) & int32(16)) != int32(0) {
 75273  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89641), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96167)))
 75274  			crt.X__builtin_abort(tls)
 75275  		}
 75276  	}()
 75277  	if (int32(_pMatch.Xfg.Xjointype) & int32(8)) != int32(0) {
 75278  		_pExpr.Xflags |= uint32(1048576)
 75279  	}
 75280  	_pSchema = (*XSchema)((*XTable)(_pExpr.XpTab).XpSchema)
 75281  _58:
 75282  _20:
 75283  	if _zDb != nil || _zTab == nil || _cntTab != int32(0) || (*XTable)(_pParse.XpTriggerTab) == nil {
 75284  		goto _65
 75285  	}
 75286  	_21_op = int32(_pParse.XeTriggerOp)
 75287  	func() {
 75288  		if _21_op != int32(109) && _21_op != int32(110) && _21_op != int32(108) {
 75289  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89655), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96203)))
 75290  			crt.X__builtin_abort(tls)
 75291  		}
 75292  	}()
 75293  	if (_21_op != int32(109)) && (_sqlite3StrICmp(tls, str(43128), _zTab) == int32(0)) {
 75294  		_pExpr.XiTable = int32(1)
 75295  		_pTab = (*XTable)(_pParse.XpTriggerTab)
 75296  		goto _75
 75297  	}
 75298  	if (_21_op != int32(108)) && (_sqlite3StrICmp(tls, str(43132), _zTab) == int32(0)) {
 75299  		_pExpr.XiTable = int32(0)
 75300  		_pTab = (*XTable)(_pParse.XpTriggerTab)
 75301  		goto _75
 75302  	}
 75303  	_pTab = nil
 75304  _75:
 75305  	if _pTab == nil {
 75306  		goto _76
 75307  	}
 75308  	_pSchema = (*XSchema)(_pTab.XpSchema)
 75309  	_cntTab += 1
 75310  	*func() **XColumn { _25_iCol = int32(0); return &_pCol }() = (*XColumn)(_pTab.XaCol)
 75311  _77:
 75312  	if _25_iCol >= int32(_pTab.XnCol) {
 75313  		goto _80
 75314  	}
 75315  	if _sqlite3StrICmp(tls, _pCol.XzName, _zCol) != int32(0) {
 75316  		goto _81
 75317  	}
 75318  	if _25_iCol == int32(_pTab.XiPKey) {
 75319  		_25_iCol = int32(-1)
 75320  	}
 75321  	goto _80
 75322  _81:
 75323  	*(*uintptr)(unsafe.Pointer(func() **XColumn { _25_iCol += 1; return &_pCol }())) += uintptr(16)
 75324  	goto _77
 75325  _80:
 75326  	if ((_25_iCol >= int32(_pTab.XnCol)) && _sqlite3IsRowid(tls, _zCol) != 0) && ((_pTab.XtabFlags & uint32(64)) == (0)) {
 75327  		_25_iCol = int32(-1)
 75328  	}
 75329  	if _25_iCol >= int32(_pTab.XnCol) {
 75330  		goto _86
 75331  	}
 75332  	_cnt += 1
 75333  	if _25_iCol < int32(0) {
 75334  		_pExpr.Xaffinity = int8(68)
 75335  		goto _92
 75336  	}
 75337  	if _pExpr.XiTable == int32(0) {
 75338  		_pParse.Xoldmask |= func() uint32 {
 75339  			if _25_iCol >= int32(32) {
 75340  				return uint32(4294967295)
 75341  			}
 75342  			return (uint32(1) << uint(_25_iCol))
 75343  		}()
 75344  		goto _92
 75345  	}
 75346  	_pParse.Xnewmask |= func() uint32 {
 75347  		if _25_iCol >= int32(32) {
 75348  			return uint32(4294967295)
 75349  		}
 75350  		return (uint32(1) << uint(_25_iCol))
 75351  	}()
 75352  _92:
 75353  	_pExpr.XiColumn = int16(_25_iCol)
 75354  	*(**XTable)(unsafe.Pointer(&_pExpr.XpTab)) = _pTab
 75355  	_isTrigger = int32(1)
 75356  _86:
 75357  _76:
 75358  _65:
 75359  	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)) {
 75360  		_cnt = int32(1)
 75361  		_pExpr.XiColumn = int16(-1)
 75362  		_pExpr.Xaffinity = int8(68)
 75363  	}
 75364  	if store70(&_6_pEList, (*XExprList)(_pNC.XpEList)) == nil || _zTab != nil || _cnt != int32(0) {
 75365  		goto _103
 75366  	}
 75367  	_j = int32(0)
 75368  _104:
 75369  	if _j >= _6_pEList.XnExpr {
 75370  		goto _107
 75371  	}
 75372  	_36_zAs = elem57((*TExprList_item)(unsafe.Pointer(&_6_pEList.Xa)), uintptr(_j)).XzName
 75373  	if _36_zAs == nil || _sqlite3StrICmp(tls, _36_zAs, _zCol) != int32(0) {
 75374  		goto _109
 75375  	}
 75376  	func() {
 75377  		if (*XExpr)(_pExpr.XpLeft) != nil || (*XExpr)(_pExpr.XpRight) != nil {
 75378  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89744), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96251)))
 75379  			crt.X__builtin_abort(tls)
 75380  		}
 75381  	}()
 75382  	func() {
 75383  		if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))) != nil {
 75384  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89745), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96287)))
 75385  			crt.X__builtin_abort(tls)
 75386  		}
 75387  	}()
 75388  	func() {
 75389  		if (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))) != nil {
 75390  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89746), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96305)))
 75391  			crt.X__builtin_abort(tls)
 75392  		}
 75393  	}()
 75394  	_37_pOrig = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_6_pEList.Xa)), uintptr(_j)).XpExpr)
 75395  	if ((int32(_pNC.XncFlags) & int32(1)) == int32(0)) && ((_37_pOrig.Xflags & uint32(2)) != (0)) {
 75396  		_sqlite3ErrorMsg(tls, _pParse, str(96325), unsafe.Pointer(_36_zAs))
 75397  		return int32(2)
 75398  	}
 75399  	if _sqlite3ExprVectorSize(tls, _37_pOrig) != int32(1) {
 75400  		_sqlite3ErrorMsg(tls, _pParse, str(43136))
 75401  		return int32(2)
 75402  	}
 75403  	_resolveAlias(tls, _pParse, _6_pEList, _j, _pExpr, str(284), _nSubquery)
 75404  	_cnt = int32(1)
 75405  	_pMatch = nil
 75406  	func() {
 75407  		if _zTab != nil || _zDb != nil {
 75408  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89759), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96356)))
 75409  			crt.X__builtin_abort(tls)
 75410  		}
 75411  	}()
 75412  	goto _lookupname_end
 75413  _109:
 75414  	_j += 1
 75415  	goto _104
 75416  _107:
 75417  _103:
 75418  	if _cnt != 0 {
 75419  		goto _124
 75420  	}
 75421  	_pNC = (*XNameContext)(_pNC.XpNext)
 75422  	_nSubquery += 1
 75423  	if _pNC != nil {
 75424  		goto _19
 75425  	}
 75426  _124:
 75427  	if ((_cnt == int32(0)) && (_zTab == nil)) && ((_pExpr.Xflags & uint32(64)) != (0)) {
 75428  		_pExpr.Xop = uint8(97)
 75429  		*(**XTable)(unsafe.Pointer(&_pExpr.XpTab)) = nil
 75430  		return int32(1)
 75431  	}
 75432  	if _cnt == int32(1) {
 75433  		goto _128
 75434  	}
 75435  	_41_zErr = func() *int8 {
 75436  		if _cnt == int32(0) {
 75437  			return str(96374)
 75438  		}
 75439  		return str(96389)
 75440  	}()
 75441  	if _zDb != nil {
 75442  		_sqlite3ErrorMsg(tls, _pParse, str(96411), unsafe.Pointer(_41_zErr), unsafe.Pointer(_zDb), unsafe.Pointer(_zTab), unsafe.Pointer(_zCol))
 75443  		goto _134
 75444  	}
 75445  	if _zTab != nil {
 75446  		_sqlite3ErrorMsg(tls, _pParse, str(49777), unsafe.Pointer(_41_zErr), unsafe.Pointer(_zTab), unsafe.Pointer(_zCol))
 75447  		goto _134
 75448  	}
 75449  	_sqlite3ErrorMsg(tls, _pParse, str(49787), unsafe.Pointer(_41_zErr), unsafe.Pointer(_zCol))
 75450  _134:
 75451  	_pParse.XcheckSchema = uint8(1)
 75452  	_pTopNC.XnErr += 1
 75453  _128:
 75454  	if int32(_pExpr.XiColumn) < int32(0) || _pMatch == nil {
 75455  		goto _136
 75456  	}
 75457  	_45_n = int32(_pExpr.XiColumn)
 75458  	if _45_n >= int32(64) {
 75459  		_45_n = int32(63)
 75460  	}
 75461  	func() {
 75462  		if _pMatch.XiCursor != _pExpr.XiTable {
 75463  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89820), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96424)))
 75464  			crt.X__builtin_abort(tls)
 75465  		}
 75466  	}()
 75467  	_pMatch.XcolUsed |= uint64(1) << uint(_45_n)
 75468  _136:
 75469  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_pExpr.XpLeft))
 75470  	*(**XExpr)(unsafe.Pointer(&_pExpr.XpLeft)) = nil
 75471  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_pExpr.XpRight))
 75472  	*(**XExpr)(unsafe.Pointer(&_pExpr.XpRight)) = nil
 75473  	_pExpr.Xop = uint8(func() int32 {
 75474  		if _isTrigger != 0 {
 75475  			return int32(61)
 75476  		}
 75477  		return int32(152)
 75478  	}())
 75479  _lookupname_end:
 75480  	if _cnt != int32(1) {
 75481  		goto _142
 75482  	}
 75483  	func() {
 75484  		if _pNC == nil {
 75485  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89833), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(95415)))
 75486  			crt.X__builtin_abort(tls)
 75487  		}
 75488  	}()
 75489  	if (_pExpr.Xflags & uint32(4194304)) == (0) {
 75490  		_sqlite3AuthRead(tls, _pParse, _pExpr, _pSchema, (*XSrcList)(_pNC.XpSrcList))
 75491  	}
 75492  _145:
 75493  	func() {
 75494  		if _pTopNC == nil {
 75495  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89840), unsafe.Pointer(&_lookupNameØ00__func__Ø000), unsafe.Pointer(str(96455)))
 75496  			crt.X__builtin_abort(tls)
 75497  		}
 75498  	}()
 75499  	_pTopNC.XnRef += 1
 75500  	if _pTopNC == _pNC {
 75501  		goto _148
 75502  	}
 75503  	_pTopNC = (*XNameContext)(_pTopNC.XpNext)
 75504  	goto _145
 75505  _148:
 75506  	return int32(1)
 75507  
 75508  _142:
 75509  	return int32(2)
 75510  }
 75511  
 75512  var _lookupNameØ00__func__Ø000 [11]int8
 75513  
 75514  func init() {
 75515  	crt.Xstrncpy(nil, &_lookupNameØ00__func__Ø000[0], str(96465), 11)
 75516  }
 75517  
 75518  // C comment
 75519  //  /*
 75520  //  ** Return TRUE if the name zCol occurs anywhere in the USING clause.
 75521  //  **
 75522  //  ** Return FALSE if the USING clause is NULL or if it does not contain
 75523  //  ** zCol.
 75524  //  */
 75525  func _nameInUsingClause(tls *crt.TLS, _pUsing *XIdList, _zCol *int8) (r0 int32) {
 75526  	var _1_k int32
 75527  	if _pUsing == nil {
 75528  		goto _0
 75529  	}
 75530  	_1_k = int32(0)
 75531  _1:
 75532  	if _1_k >= _pUsing.XnId {
 75533  		goto _4
 75534  	}
 75535  	if _sqlite3StrICmp(tls, elem42((*TIdList_item)(_pUsing.Xa), uintptr(_1_k)).XzName, _zCol) == int32(0) {
 75536  		return int32(1)
 75537  	}
 75538  	_1_k += 1
 75539  	goto _1
 75540  _4:
 75541  _0:
 75542  	return int32(0)
 75543  }
 75544  
 75545  // C comment
 75546  //  /*
 75547  //  ** Return TRUE if the given string is a row-id column name.
 75548  //  */
 75549  func _sqlite3IsRowid(tls *crt.TLS, _z *int8) (r0 int32) {
 75550  	if _sqlite3StrICmp(tls, _z, str(96476)) == int32(0) {
 75551  		return int32(1)
 75552  	}
 75553  	if _sqlite3StrICmp(tls, _z, str(96484)) == int32(0) {
 75554  		return int32(1)
 75555  	}
 75556  	if _sqlite3StrICmp(tls, _z, str(96490)) == int32(0) {
 75557  		return int32(1)
 75558  	}
 75559  	return int32(0)
 75560  }
 75561  
 75562  // C comment
 75563  //  /*
 75564  //  ** Turn the pExpr expression into an alias for the iCol-th column of the
 75565  //  ** result set in pEList.
 75566  //  **
 75567  //  ** If the reference is followed by a COLLATE operator, then make sure
 75568  //  ** the COLLATE operator is preserved.  For example:
 75569  //  **
 75570  //  **     SELECT a+b, c+d FROM t1 ORDER BY 1 COLLATE nocase;
 75571  //  **
 75572  //  ** Should be transformed into:
 75573  //  **
 75574  //  **     SELECT a+b, c+d FROM t1 ORDER BY (a+b) COLLATE nocase;
 75575  //  **
 75576  //  ** The nSubquery parameter specifies how many levels of subquery the
 75577  //  ** alias is removed from the original expression.  The usual value is
 75578  //  ** zero but it might be more if the alias is contained within a subquery
 75579  //  ** of the original expression.  The Expr.op2 field of TK_AGG_FUNCTION
 75580  //  ** structures must be increased by the nSubquery amount.
 75581  //  */
 75582  func _resolveAlias(tls *crt.TLS, _pParse *XParse, _pEList *XExprList, _iCol int32, _pExpr *XExpr, _zType *int8, _nSubquery int32) {
 75583  	var _db *Xsqlite3
 75584  	var _pOrig, _pDup *XExpr
 75585  	func() {
 75586  		if _iCol < int32(0) || _iCol >= _pEList.XnExpr {
 75587  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89423), unsafe.Pointer(&_resolveAliasØ00__func__Ø000), unsafe.Pointer(str(96494)))
 75588  			crt.X__builtin_abort(tls)
 75589  		}
 75590  	}()
 75591  	_pOrig = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_iCol)).XpExpr)
 75592  	func() {
 75593  		if _pOrig == nil {
 75594  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89425), unsafe.Pointer(&_resolveAliasØ00__func__Ø000), unsafe.Pointer(str(96524)))
 75595  			crt.X__builtin_abort(tls)
 75596  		}
 75597  	}()
 75598  	_db = (*Xsqlite3)(_pParse.Xdb)
 75599  	_pDup = _sqlite3ExprDup(tls, _db, _pOrig, int32(0))
 75600  	if _pDup == nil {
 75601  		return
 75602  	}
 75603  	if int32(*elem1(_zType, 0)) != int32(71) {
 75604  		_incrAggFunctionDepth(tls, _pDup, _nSubquery)
 75605  	}
 75606  	if int32(_pExpr.Xop) == int32(94) {
 75607  		_pDup = _sqlite3ExprAddCollateString(tls, _pParse, _pDup, *(**int8)(unsafe.Pointer(&_pExpr.Xu)))
 75608  	}
 75609  	_pDup.Xflags |= uint32(4194304)
 75610  	_pExpr.Xflags |= uint32(32768)
 75611  	_sqlite3ExprDelete(tls, _db, _pExpr)
 75612  	crt.Xmemcpy(tls, unsafe.Pointer(_pExpr), unsafe.Pointer(_pDup), uint32(48))
 75613  	if ((_pExpr.Xflags & uint32(1024)) == (0)) && ((*(**int8)(unsafe.Pointer(&_pExpr.Xu))) != nil) {
 75614  		func() {
 75615  			if (_pExpr.Xflags & uint32(24576)) != (0) {
 75616  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89446), unsafe.Pointer(&_resolveAliasØ00__func__Ø000), unsafe.Pointer(str(96533)))
 75617  				crt.X__builtin_abort(tls)
 75618  			}
 75619  		}()
 75620  		*(**int8)(unsafe.Pointer(&_pExpr.Xu)) = _sqlite3DbStrDup(tls, _db, *(**int8)(unsafe.Pointer(&_pExpr.Xu)))
 75621  		_pExpr.Xflags |= uint32(65536)
 75622  	}
 75623  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pDup))
 75624  }
 75625  
 75626  var _resolveAliasØ00__func__Ø000 [13]int8
 75627  
 75628  func init() {
 75629  	crt.Xstrncpy(nil, &_resolveAliasØ00__func__Ø000[0], str(96579), 13)
 75630  }
 75631  
 75632  func _incrAggFunctionDepth(tls *crt.TLS, _pExpr *XExpr, _N int32) {
 75633  	var _1_w XWalker
 75634  	if _N > int32(0) {
 75635  		crt.Xmemset(tls, unsafe.Pointer(&_1_w), int32(0), uint32(28))
 75636  		*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_1_w.XxExprCallback)) = _incrAggDepth
 75637  		*(*int32)(unsafe.Pointer(&_1_w.Xu)) = _N
 75638  		_sqlite3WalkExpr(tls, &_1_w, _pExpr)
 75639  	}
 75640  }
 75641  
 75642  // C comment
 75643  //  /*
 75644  //  ** Walk the expression tree pExpr and increase the aggregate function
 75645  //  ** depth (the Expr.op2 field) by N on every TK_AGG_FUNCTION node.
 75646  //  ** This needs to occur when copying a TK_AGG_FUNCTION node from an
 75647  //  ** outer query into an inner subquery.
 75648  //  **
 75649  //  ** incrAggFunctionDepth(pExpr,n) is the main routine.  incrAggDepth(..)
 75650  //  ** is a helper function - a callback for the tree walker.
 75651  //  */
 75652  func _incrAggDepth(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
 75653  	if int32(_pExpr.Xop) == int32(153) {
 75654  		{
 75655  			p := &_pExpr.Xop2
 75656  			*p = uint8(int32(*p) + (*(*int32)(unsafe.Pointer(&_pWalker.Xu))))
 75657  		}
 75658  	}
 75659  	return int32(0)
 75660  }
 75661  
 75662  func _sqlite3ExprAddCollateString(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _zC *int8) (r0 *XExpr) {
 75663  	var _s XToken
 75664  	func() {
 75665  		if _zC == nil {
 75666  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90997), unsafe.Pointer(&_sqlite3ExprAddCollateStringØ00__func__Ø000), unsafe.Pointer(str(96592)))
 75667  			crt.X__builtin_abort(tls)
 75668  		}
 75669  	}()
 75670  	_sqlite3TokenInit(tls, &_s, _zC)
 75671  	return _sqlite3ExprAddCollateToken(tls, _pParse, _pExpr, &_s, int32(0))
 75672  }
 75673  
 75674  var _sqlite3ExprAddCollateStringØ00__func__Ø000 [28]int8
 75675  
 75676  func init() {
 75677  	crt.Xstrncpy(nil, &_sqlite3ExprAddCollateStringØ00__func__Ø000[0], str(96598), 28)
 75678  }
 75679  
 75680  // C comment
 75681  //  /*
 75682  //  ** Set the collating sequence for expression pExpr to be the collating
 75683  //  ** sequence named by pToken.   Return a pointer to a new Expr node that
 75684  //  ** implements the COLLATE operator.
 75685  //  **
 75686  //  ** If a memory allocation error occurs, that fact is recorded in pParse->db
 75687  //  ** and the pExpr parameter is returned unchanged.
 75688  //  */
 75689  func _sqlite3ExprAddCollateToken(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _pCollName *XToken, _dequote int32) (r0 *XExpr) {
 75690  	var _1_pNew *XExpr
 75691  	if _pCollName.Xn <= (0) {
 75692  		goto _0
 75693  	}
 75694  	_1_pNew = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(94), _pCollName, _dequote)
 75695  	if _1_pNew != nil {
 75696  		*(**XExpr)(unsafe.Pointer(&_1_pNew.XpLeft)) = _pExpr
 75697  		_1_pNew.Xflags |= uint32(4352)
 75698  		_pExpr = _1_pNew
 75699  	}
 75700  _0:
 75701  	return _pExpr
 75702  }
 75703  
 75704  // C comment
 75705  //  /*
 75706  //  ** The pExpr should be a TK_COLUMN expression.  The table referred to
 75707  //  ** is in pTabList or else it is the NEW or OLD table of a trigger.
 75708  //  ** Check to see if it is OK to read this particular column.
 75709  //  **
 75710  //  ** If the auth function returns SQLITE_IGNORE, change the TK_COLUMN
 75711  //  ** instruction into a TK_NULL.  If the auth function returns SQLITE_DENY,
 75712  //  ** then generate an error.
 75713  //  */
 75714  func _sqlite3AuthRead(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _pSchema *XSchema, _pTabList *XSrcList) {
 75715  	var _iSrc, _iDb, _iCol int32
 75716  	var _zCol *int8
 75717  	var _db *Xsqlite3
 75718  	var _pTab *XTable
 75719  	_db = (*Xsqlite3)(_pParse.Xdb)
 75720  	_pTab = nil
 75721  	if _db.XxAuth == nil {
 75722  		return
 75723  	}
 75724  	_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), _pSchema)
 75725  	if _iDb < int32(0) {
 75726  		return
 75727  	}
 75728  	func() {
 75729  		if int32(_pExpr.Xop) != int32(152) && int32(_pExpr.Xop) != int32(61) {
 75730  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99583), unsafe.Pointer(&_sqlite3AuthReadØ00__func__Ø000), unsafe.Pointer(str(96626)))
 75731  			crt.X__builtin_abort(tls)
 75732  		}
 75733  	}()
 75734  	if int32(_pExpr.Xop) == int32(61) {
 75735  		_pTab = (*XTable)(_pParse.XpTriggerTab)
 75736  		goto _6
 75737  	}
 75738  	func() {
 75739  		if _pTabList == nil {
 75740  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99587), unsafe.Pointer(&_sqlite3AuthReadØ00__func__Ø000), unsafe.Pointer(str(96672)))
 75741  			crt.X__builtin_abort(tls)
 75742  		}
 75743  	}()
 75744  	_iSrc = int32(0)
 75745  _9:
 75746  	if func() int32 {
 75747  		if _iSrc < _pTabList.XnSrc {
 75748  			return int32(1)
 75749  		}
 75750  		return func() int32 {
 75751  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99588), unsafe.Pointer(&_sqlite3AuthReadØ00__func__Ø000), unsafe.Pointer(str(4809)))
 75752  			crt.X__builtin_abort(tls)
 75753  			return int32(0)
 75754  		}()
 75755  	}() == 0 {
 75756  		goto _14
 75757  	}
 75758  	if _pExpr.XiTable == (elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_iSrc)).XiCursor) {
 75759  		_pTab = (*XTable)(elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_iSrc)).XpTab)
 75760  		goto _14
 75761  	}
 75762  	_iSrc += 1
 75763  	goto _9
 75764  _14:
 75765  _6:
 75766  	_iCol = int32(_pExpr.XiColumn)
 75767  	if func() int32 {
 75768  		if _pTab == nil {
 75769  			return func() int32 {
 75770  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99596), unsafe.Pointer(&_sqlite3AuthReadØ00__func__Ø000), unsafe.Pointer(str(4809)))
 75771  				crt.X__builtin_abort(tls)
 75772  				return int32(1)
 75773  			}()
 75774  		}
 75775  		return int32(0)
 75776  	}() != 0 {
 75777  		return
 75778  	}
 75779  	if _iCol >= int32(0) {
 75780  		func() {
 75781  			if _iCol >= int32(_pTab.XnCol) {
 75782  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99599), unsafe.Pointer(&_sqlite3AuthReadØ00__func__Ø000), unsafe.Pointer(str(45530)))
 75783  				crt.X__builtin_abort(tls)
 75784  			}
 75785  		}()
 75786  		_zCol = elem41((*XColumn)(_pTab.XaCol), uintptr(_iCol)).XzName
 75787  		goto _26
 75788  	}
 75789  	if int32(_pTab.XiPKey) >= int32(0) {
 75790  		func() {
 75791  			if int32(_pTab.XiPKey) >= int32(_pTab.XnCol) {
 75792  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99602), unsafe.Pointer(&_sqlite3AuthReadØ00__func__Ø000), unsafe.Pointer(str(96681)))
 75793  				crt.X__builtin_abort(tls)
 75794  			}
 75795  		}()
 75796  		_zCol = elem41((*XColumn)(_pTab.XaCol), uintptr(_pTab.XiPKey)).XzName
 75797  		goto _26
 75798  	}
 75799  	_zCol = str(96484)
 75800  _26:
 75801  	func() {
 75802  		if _iDb < int32(0) || _iDb >= _db.XnDb {
 75803  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99607), unsafe.Pointer(&_sqlite3AuthReadØ00__func__Ø000), unsafe.Pointer(str(21693)))
 75804  			crt.X__builtin_abort(tls)
 75805  		}
 75806  	}()
 75807  	if int32(2) == _sqlite3AuthReadCol(tls, _pParse, _pTab.XzName, _zCol, _iDb) {
 75808  		_pExpr.Xop = uint8(101)
 75809  	}
 75810  }
 75811  
 75812  var _sqlite3AuthReadØ00__func__Ø000 [16]int8
 75813  
 75814  func init() {
 75815  	crt.Xstrncpy(nil, &_sqlite3AuthReadØ00__func__Ø000[0], str(96704), 16)
 75816  }
 75817  
 75818  // C comment
 75819  //  /*
 75820  //  ** Invoke the authorization callback for permission to read column zCol from
 75821  //  ** table zTab in database zDb. This function assumes that an authorization
 75822  //  ** callback has been registered (i.e. that sqlite3.xAuth is not NULL).
 75823  //  **
 75824  //  ** If SQLITE_IGNORE is returned and pExpr is not NULL, then pExpr is changed
 75825  //  ** to an SQL NULL expression. Otherwise, if pExpr is NULL, then SQLITE_IGNORE
 75826  //  ** is treated as SQLITE_DENY. In this case an error is left in pParse.
 75827  //  */
 75828  func _sqlite3AuthReadCol(tls *crt.TLS, _pParse *XParse, _zTab *int8, _zCol *int8, _iDb int32) (r0 int32) {
 75829  	var _rc int32
 75830  	var _zDb *int8
 75831  	var _db *Xsqlite3
 75832  	_db = (*Xsqlite3)(_pParse.Xdb)
 75833  	_zDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
 75834  	if (_db.Xinit.Xbusy) != 0 {
 75835  		return int32(0)
 75836  	}
 75837  	_rc = _db.XxAuth(tls, _db.XpAuthArg, int32(20), _zTab, _zCol, _zDb, _pParse.XzAuthContext)
 75838  	if _rc != int32(1) {
 75839  		goto _1
 75840  	}
 75841  	if (_db.XnDb > int32(2)) || (_iDb != int32(0)) {
 75842  		_sqlite3ErrorMsg(tls, _pParse, str(96720), unsafe.Pointer(_zDb), unsafe.Pointer(_zTab), unsafe.Pointer(_zCol))
 75843  		goto _4
 75844  	}
 75845  	_sqlite3ErrorMsg(tls, _pParse, str(96753), unsafe.Pointer(_zTab), unsafe.Pointer(_zCol))
 75846  _4:
 75847  	_pParse.Xrc = int32(23)
 75848  	goto _7
 75849  _1:
 75850  	if (_rc != int32(2)) && (_rc != int32(0)) {
 75851  		_sqliteAuthBadReturnCode(tls, _pParse)
 75852  	}
 75853  _7:
 75854  	return _rc
 75855  }
 75856  
 75857  // C comment
 75858  //  /*
 75859  //  ** Expression p should encode a floating point value between 1.0 and 0.0.
 75860  //  ** Return 1024 times this value.  Or return -1 if p is not a floating point
 75861  //  ** value between 1.0 and 0.0.
 75862  //  */
 75863  func _exprProbability(tls *crt.TLS, _p *XExpr) (r0 int32) {
 75864  	var _r float64
 75865  	_r = -1
 75866  	if int32(_p.Xop) != int32(132) {
 75867  		return int32(-1)
 75868  	}
 75869  	_sqlite3AtoF(tls, *(**int8)(unsafe.Pointer(&_p.Xu)), &_r, _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer(&_p.Xu))), uint8(1))
 75870  	func() {
 75871  		if _r < float64(0) {
 75872  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(89904), unsafe.Pointer(&_exprProbabilityØ00__func__Ø000), unsafe.Pointer(str(96783)))
 75873  			crt.X__builtin_abort(tls)
 75874  		}
 75875  	}()
 75876  	if _r > float64(1) {
 75877  		return int32(-1)
 75878  	}
 75879  	return int32(_r * (1.34217728e+08))
 75880  }
 75881  
 75882  var _exprProbabilityØ00__func__Ø000 [16]int8
 75883  
 75884  func init() {
 75885  	crt.Xstrncpy(nil, &_exprProbabilityØ00__func__Ø000[0], str(96790), 16)
 75886  }
 75887  
 75888  // C comment
 75889  //  /*
 75890  //  ** Determine if any of the arguments to the pExpr Function reference
 75891  //  ** pSrcList.  Return true if they do.  Also return true if the function
 75892  //  ** has no arguments or has only constant arguments.  Return false if pExpr
 75893  //  ** references columns but not columns of tables found in pSrcList.
 75894  //  */
 75895  func _sqlite3FunctionUsesThisSrc(tls *crt.TLS, _pExpr *XExpr, _pSrcList *XSrcList) (r0 int32) {
 75896  	var _w XWalker
 75897  	var _cnt TSrcCount
 75898  	func() {
 75899  		if int32(_pExpr.Xop) != int32(153) {
 75900  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95801), unsafe.Pointer(&_sqlite3FunctionUsesThisSrcØ00__func__Ø000), unsafe.Pointer(str(96806)))
 75901  			crt.X__builtin_abort(tls)
 75902  		}
 75903  	}()
 75904  	crt.Xmemset(tls, unsafe.Pointer(&_w), int32(0), uint32(28))
 75905  	*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_w.XxExprCallback)) = _exprSrcCount
 75906  	*(**TSrcCount)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_w.Xu)))) = &_cnt
 75907  	*(**XSrcList)(unsafe.Pointer(&_cnt.XpSrc)) = _pSrcList
 75908  	_cnt.XnThis = int32(0)
 75909  	_cnt.XnOther = int32(0)
 75910  	_sqlite3WalkExprList(tls, &_w, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))))
 75911  	return bool2int((_cnt.XnThis > int32(0)) || (_cnt.XnOther == int32(0)))
 75912  }
 75913  
 75914  var _sqlite3FunctionUsesThisSrcØ00__func__Ø000 [27]int8
 75915  
 75916  func init() {
 75917  	crt.Xstrncpy(nil, &_sqlite3FunctionUsesThisSrcØ00__func__Ø000[0], str(96833), 27)
 75918  }
 75919  
 75920  // C comment
 75921  //  /*
 75922  //  ** Count the number of references to columns.
 75923  //  */
 75924  func _exprSrcCount(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
 75925  	var _1_i, _1_nSrc int32
 75926  	var _1_pSrc *XSrcList
 75927  	var _1_p *TSrcCount
 75928  	if int32(_pExpr.Xop) != int32(152) && func() int32 {
 75929  		if int32(_pExpr.Xop) == int32(154) {
 75930  			return func() int32 {
 75931  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95775), unsafe.Pointer(&_exprSrcCountØ00__func__Ø000), unsafe.Pointer(str(4809)))
 75932  				crt.X__builtin_abort(tls)
 75933  				return int32(1)
 75934  			}()
 75935  		}
 75936  		return int32(0)
 75937  	}() == 0 {
 75938  		goto _3
 75939  	}
 75940  	_1_p = (*TSrcCount)(*(*unsafe.Pointer)(unsafe.Pointer(&_pWalker.Xu)))
 75941  	_1_pSrc = (*XSrcList)(_1_p.XpSrc)
 75942  	_1_nSrc = func() int32 {
 75943  		if _1_pSrc != nil {
 75944  			return _1_pSrc.XnSrc
 75945  		}
 75946  		return int32(0)
 75947  	}()
 75948  	_1_i = int32(0)
 75949  _6:
 75950  	if _1_i >= _1_nSrc {
 75951  		goto _9
 75952  	}
 75953  	if _pExpr.XiTable == (elem6((*TSrcList_item)(unsafe.Pointer(&_1_pSrc.Xa)), uintptr(_1_i)).XiCursor) {
 75954  		goto _9
 75955  	}
 75956  	_1_i += 1
 75957  	goto _6
 75958  _9:
 75959  	if _1_i < _1_nSrc {
 75960  		_1_p.XnThis += 1
 75961  		goto _12
 75962  	}
 75963  	_1_p.XnOther += 1
 75964  _12:
 75965  _3:
 75966  	return int32(0)
 75967  }
 75968  
 75969  var _exprSrcCountØ00__func__Ø000 [13]int8
 75970  
 75971  func init() {
 75972  	crt.Xstrncpy(nil, &_exprSrcCountØ00__func__Ø000[0], str(96860), 13)
 75973  }
 75974  
 75975  // C comment
 75976  //  /*
 75977  //  ** Resolve names in the SELECT statement p and all of its descendants.
 75978  //  */
 75979  func _resolveSelectStep(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) {
 75980  	var _isCompound, _nCompound, _i, _7_nRef int32
 75981  	var _7_zSavedContext *int8
 75982  	var _db *Xsqlite3
 75983  	var _6_pItem, _11_pItem *TSrcList_item
 75984  	var _pGroupBy *XExprList
 75985  	var _16_pItem *TExprList_item
 75986  	var _pLeftmost, _5_pSub, _13_pSub *XSelect
 75987  	var _pParse *XParse
 75988  	var _sNC XNameContext
 75989  	var _pOuterNC, _7_pNC *XNameContext
 75990  	func() {
 75991  		if _p == nil {
 75992  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90520), unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000), unsafe.Pointer(str(807)))
 75993  			crt.X__builtin_abort(tls)
 75994  		}
 75995  	}()
 75996  	if (_p.XselFlags & uint32(4)) != 0 {
 75997  		return int32(1)
 75998  	}
 75999  	_pOuterNC = (*XNameContext)(*(*unsafe.Pointer)(unsafe.Pointer(&_pWalker.Xu)))
 76000  	_pParse = (*XParse)(_pWalker.XpParse)
 76001  	_db = (*Xsqlite3)(_pParse.Xdb)
 76002  	if (_p.XselFlags & uint32(64)) == (0) {
 76003  		_sqlite3SelectPrep(tls, _pParse, _p, _pOuterNC)
 76004  		return func() int32 {
 76005  			if _pParse.XnErr != 0 || (_db.XmallocFailed != 0) {
 76006  				return int32(2)
 76007  			}
 76008  			return int32(1)
 76009  		}()
 76010  	}
 76011  	_isCompound = bool2int((*XSelect)(_p.XpPrior) != nil)
 76012  	_nCompound = int32(0)
 76013  	_pLeftmost = _p
 76014  _7:
 76015  	if _p == nil {
 76016  		goto _8
 76017  	}
 76018  	func() {
 76019  		if (_p.XselFlags & uint32(64)) == (0) {
 76020  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90545), unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000), unsafe.Pointer(str(96873)))
 76021  			crt.X__builtin_abort(tls)
 76022  		}
 76023  	}()
 76024  	func() {
 76025  		if (_p.XselFlags & uint32(4)) != (0) {
 76026  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90546), unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000), unsafe.Pointer(str(96904)))
 76027  			crt.X__builtin_abort(tls)
 76028  		}
 76029  	}()
 76030  	_p.XselFlags |= uint32(4)
 76031  	crt.Xmemset(tls, unsafe.Pointer(&_sNC), int32(0), uint32(32))
 76032  	*(**XParse)(unsafe.Pointer(&_sNC.XpParse)) = _pParse
 76033  	if _sqlite3ResolveExprNames(tls, &_sNC, (*XExpr)(_p.XpLimit)) != 0 || _sqlite3ResolveExprNames(tls, &_sNC, (*XExpr)(_p.XpOffset)) != 0 {
 76034  		return int32(2)
 76035  	}
 76036  	if (_p.XselFlags & uint32(65536)) != 0 {
 76037  		_5_pSub = (*XSelect)(elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.XpSrc).Xa))), 0).XpSelect)
 76038  		func() {
 76039  			if ((*XSrcList)(_p.XpSrc).XnSrc) != int32(1) || _p.XpOrderBy == nil {
 76040  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90567), unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000), unsafe.Pointer(str(96935)))
 76041  				crt.X__builtin_abort(tls)
 76042  			}
 76043  		}()
 76044  		func() {
 76045  			if _5_pSub.XpPrior == nil || (*XExprList)(_5_pSub.XpOrderBy) != nil {
 76046  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90568), unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000), unsafe.Pointer(str(96967)))
 76047  				crt.X__builtin_abort(tls)
 76048  			}
 76049  		}()
 76050  		*(**XExprList)(unsafe.Pointer(&_5_pSub.XpOrderBy)) = (*XExprList)(_p.XpOrderBy)
 76051  		*(**XExprList)(unsafe.Pointer(&_p.XpOrderBy)) = nil
 76052  	}
 76053  	_i = int32(0)
 76054  _22:
 76055  	if _i >= ((*XSrcList)(_p.XpSrc).XnSrc) {
 76056  		goto _25
 76057  	}
 76058  	_6_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.XpSrc).Xa))), uintptr(_i))
 76059  	if _6_pItem.XpSelect == nil {
 76060  		goto _26
 76061  	}
 76062  	_7_nRef = int32(0)
 76063  	_7_zSavedContext = _pParse.XzAuthContext
 76064  	_7_pNC = _pOuterNC
 76065  _27:
 76066  	if _7_pNC == nil {
 76067  		goto _30
 76068  	}
 76069  	_7_nRef += _7_pNC.XnRef
 76070  	_7_pNC = (*XNameContext)(_7_pNC.XpNext)
 76071  	goto _27
 76072  _30:
 76073  	if _6_pItem.XzName != nil {
 76074  		_pParse.XzAuthContext = _6_pItem.XzName
 76075  	}
 76076  	_sqlite3ResolveSelectNames(tls, _pParse, (*XSelect)(_6_pItem.XpSelect), _pOuterNC)
 76077  	_pParse.XzAuthContext = _7_zSavedContext
 76078  	if _pParse.XnErr != 0 || (_db.XmallocFailed != 0) {
 76079  		return int32(2)
 76080  	}
 76081  	_7_pNC = _pOuterNC
 76082  _34:
 76083  	if _7_pNC == nil {
 76084  		goto _37
 76085  	}
 76086  	_7_nRef -= _7_pNC.XnRef
 76087  	_7_pNC = (*XNameContext)(_7_pNC.XpNext)
 76088  	goto _34
 76089  _37:
 76090  	func() {
 76091  		if int32((uint32((_6_pItem.Xfg.XnotIndexed)>>3)<<31)>>31) != int32(0) || _7_nRef > int32(0) {
 76092  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90595), unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000), unsafe.Pointer(str(97001)))
 76093  			crt.X__builtin_abort(tls)
 76094  		}
 76095  	}()
 76096  	storebits5(&(_6_pItem.Xfg.XnotIndexed), int8(bool2int(_7_nRef != int32(0))), 8, 3)
 76097  _26:
 76098  	_i += 1
 76099  	goto _22
 76100  _25:
 76101  	_sNC.XncFlags = uint16(1)
 76102  	*(**XSrcList)(unsafe.Pointer(&_sNC.XpSrcList)) = (*XSrcList)(_p.XpSrc)
 76103  	*(**XNameContext)(unsafe.Pointer(&_sNC.XpNext)) = _pOuterNC
 76104  	if _sqlite3ResolveExprListNames(tls, &_sNC, (*XExprList)(_p.XpEList)) != 0 {
 76105  		return int32(2)
 76106  	}
 76107  	func() {
 76108  		if (_p.XselFlags & uint32(8)) != (0) {
 76109  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90613), unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000), unsafe.Pointer(str(97038)))
 76110  			crt.X__builtin_abort(tls)
 76111  		}
 76112  	}()
 76113  	_pGroupBy = (*XExprList)(_p.XpGroupBy)
 76114  	if (_pGroupBy != nil) || ((int32(_sNC.XncFlags) & int32(16)) != int32(0)) {
 76115  		_p.XselFlags |= uint32(int32(8) | (int32(_sNC.XncFlags) & int32(4096)))
 76116  		goto _46
 76117  	}
 76118  	{
 76119  		p := &_sNC.XncFlags
 76120  		*p = uint16(int32(*p) & int32(-2))
 76121  	}
 76122  _46:
 76123  	if (_p.XpHaving != nil) && (_pGroupBy == nil) {
 76124  		_sqlite3ErrorMsg(tls, _pParse, str(97070))
 76125  		return int32(2)
 76126  	}
 76127  	*(**XExprList)(unsafe.Pointer(&_sNC.XpEList)) = (*XExprList)(_p.XpEList)
 76128  	if _sqlite3ResolveExprNames(tls, &_sNC, (*XExpr)(_p.XpHaving)) != 0 {
 76129  		return int32(2)
 76130  	}
 76131  	if _sqlite3ResolveExprNames(tls, &_sNC, (*XExpr)(_p.XpWhere)) != 0 {
 76132  		return int32(2)
 76133  	}
 76134  	_i = int32(0)
 76135  _51:
 76136  	if _i >= ((*XSrcList)(_p.XpSrc).XnSrc) {
 76137  		goto _54
 76138  	}
 76139  	_11_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.XpSrc).Xa))), uintptr(_i))
 76140  	if (((uint32((_11_pItem.Xfg.XnotIndexed)>>2) << 31) >> 31) != 0) && _sqlite3ResolveExprListNames(tls, &_sNC, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_11_pItem.Xu1)))) != 0 {
 76141  		return int32(2)
 76142  	}
 76143  	_i += 1
 76144  	goto _51
 76145  _54:
 76146  	*(**XNameContext)(unsafe.Pointer(&_sNC.XpNext)) = nil
 76147  	{
 76148  		p := &_sNC.XncFlags
 76149  		*p = uint16(int32(*p) | int32(1))
 76150  	}
 76151  	if (_p.XselFlags & uint32(65536)) != 0 {
 76152  		_13_pSub = (*XSelect)(elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.XpSrc).Xa))), 0).XpSelect)
 76153  		*(**XExprList)(unsafe.Pointer(&_p.XpOrderBy)) = (*XExprList)(_13_pSub.XpOrderBy)
 76154  		*(**XExprList)(unsafe.Pointer(&_13_pSub.XpOrderBy)) = nil
 76155  	}
 76156  	if (_isCompound <= _nCompound) && _resolveOrderGroupBy(tls, &_sNC, _p, (*XExprList)(_p.XpOrderBy), str(25700)) != 0 {
 76157  		return int32(2)
 76158  	}
 76159  	if _db.XmallocFailed != 0 {
 76160  		return int32(2)
 76161  	}
 76162  	if _pGroupBy == nil {
 76163  		goto _61
 76164  	}
 76165  	if _resolveOrderGroupBy(tls, &_sNC, _p, _pGroupBy, str(25706)) != 0 || (_db.XmallocFailed != 0) {
 76166  		return int32(2)
 76167  	}
 76168  	*func() **TExprList_item { _i = int32(0); return &_16_pItem }() = (*TExprList_item)(unsafe.Pointer(&_pGroupBy.Xa))
 76169  _64:
 76170  	if _i >= _pGroupBy.XnExpr {
 76171  		goto _67
 76172  	}
 76173  	if (((*XExpr)(_16_pItem.XpExpr).Xflags) & uint32(2)) != (0) {
 76174  		_sqlite3ErrorMsg(tls, _pParse, str(97114))
 76175  		return int32(2)
 76176  	}
 76177  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_16_pItem }())) += uintptr(20)
 76178  	goto _64
 76179  _67:
 76180  _61:
 76181  	if (_p.XpNext != nil) && (((*XExprList)(_p.XpEList).XnExpr) != ((*XExprList)((*XSelect)(_p.XpNext).XpEList).XnExpr)) {
 76182  		_sqlite3SelectWrongNumTermsError(tls, _pParse, (*XSelect)(_p.XpNext))
 76183  		return int32(2)
 76184  	}
 76185  	_p = (*XSelect)(_p.XpPrior)
 76186  	_nCompound += 1
 76187  	goto _7
 76188  _8:
 76189  	if _isCompound != 0 && _resolveCompoundOrderBy(tls, _pParse, _pLeftmost) != 0 {
 76190  		return int32(2)
 76191  	}
 76192  	return int32(1)
 76193  }
 76194  
 76195  var _resolveSelectStepØ00__func__Ø000 [18]int8
 76196  
 76197  func init() {
 76198  	crt.Xstrncpy(nil, &_resolveSelectStepØ00__func__Ø000[0], str(97173), 18)
 76199  }
 76200  
 76201  // C comment
 76202  //  /*
 76203  //  ** This routine walks an expression tree and resolves references to
 76204  //  ** table columns and result-set columns.  At the same time, do error
 76205  //  ** checking on function usage and set a flag if any aggregate functions
 76206  //  ** are seen.
 76207  //  **
 76208  //  ** To resolve table columns references we look for nodes (or subtrees) of the
 76209  //  ** form X.Y.Z or Y.Z or just Z where
 76210  //  **
 76211  //  **      X:   The name of a database.  Ex:  "main" or "temp" or
 76212  //  **           the symbolic name assigned to an ATTACH-ed database.
 76213  //  **
 76214  //  **      Y:   The name of a table in a FROM clause.  Or in a trigger
 76215  //  **           one of the special names "old" or "new".
 76216  //  **
 76217  //  **      Z:   The name of a column in table Y.
 76218  //  **
 76219  //  ** The node at the root of the subtree is modified as follows:
 76220  //  **
 76221  //  **    Expr.op        Changed to TK_COLUMN
 76222  //  **    Expr.pTab      Points to the Table object for X.Y
 76223  //  **    Expr.iColumn   The column index in X.Y.  -1 for the rowid.
 76224  //  **    Expr.iTable    The VDBE cursor number for X.Y
 76225  //  **
 76226  //  **
 76227  //  ** To resolve result-set references, look for expression nodes of the
 76228  //  ** form Z (with no X and Y prefix) where the Z matches the right-hand
 76229  //  ** size of an AS clause in the result-set of a SELECT.  The Z expression
 76230  //  ** is replaced by a copy of the left-hand side of the result-set expression.
 76231  //  ** Table-name and function resolution occurs on the substituted expression
 76232  //  ** tree.  For example, in:
 76233  //  **
 76234  //  **      SELECT a+b AS x, c+d AS y FROM t1 ORDER BY x;
 76235  //  **
 76236  //  ** The "x" term of the order by is replaced by "a+b" to render:
 76237  //  **
 76238  //  **      SELECT a+b AS x, c+d AS y FROM t1 ORDER BY a+b;
 76239  //  **
 76240  //  ** Function calls are checked to make sure that the function is
 76241  //  ** defined and that the correct number of arguments are specified.
 76242  //  ** If the function is an aggregate function, then the NC_HasAgg flag is
 76243  //  ** set and the opcode is changed from TK_FUNCTION to TK_AGG_FUNCTION.
 76244  //  ** If an expression contains aggregate functions then the EP_Agg
 76245  //  ** property on the expression is set.
 76246  //  **
 76247  //  ** An error message is left in pParse if anything is amiss.  The number
 76248  //  ** if errors is returned.
 76249  //  */
 76250  func _sqlite3ResolveExprNames(tls *crt.TLS, _pNC *XNameContext, _pExpr *XExpr) (r0 int32) {
 76251  	var _savedHasAgg uint16
 76252  	var _1_pParse *XParse
 76253  	var _w XWalker
 76254  	if _pExpr == nil {
 76255  		return int32(0)
 76256  	}
 76257  	_1_pParse = (*XParse)(_pNC.XpParse)
 76258  	if _sqlite3ExprCheckHeight(tls, _1_pParse, _pExpr.XnHeight+((*XParse)(_pNC.XpParse).XnHeight)) != 0 {
 76259  		return int32(1)
 76260  	}
 76261  	_1_pParse.XnHeight += _pExpr.XnHeight
 76262  	_savedHasAgg = uint16(int32(_pNC.XncFlags) & int32(4112))
 76263  	{
 76264  		p := &_pNC.XncFlags
 76265  		*p = uint16(int32(*p) & int32(-4113))
 76266  	}
 76267  	*(**XParse)(unsafe.Pointer(&_w.XpParse)) = (*XParse)(_pNC.XpParse)
 76268  	*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_w.XxExprCallback)) = _resolveExprStep
 76269  	*(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer(&_w.XxSelectCallback)) = _resolveSelectStep
 76270  	*(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer(&_w.XxSelectCallback2)) = nil
 76271  	_w.XwalkerDepth = int32(0)
 76272  	_w.XeCode = 0
 76273  	*(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_w.Xu)))) = _pNC
 76274  	_sqlite3WalkExpr(tls, &_w, _pExpr)
 76275  	(*XParse)(_pNC.XpParse).XnHeight -= _pExpr.XnHeight
 76276  	if (_pNC.XnErr > int32(0)) || (((*XParse)(_w.XpParse).XnErr) > int32(0)) {
 76277  		_pExpr.Xflags |= uint32(8)
 76278  	}
 76279  	if (int32(_pNC.XncFlags) & int32(16)) != 0 {
 76280  		_pExpr.Xflags |= uint32(2)
 76281  	}
 76282  	{
 76283  		p := &_pNC.XncFlags
 76284  		*p = uint16(int32(*p) | int32(_savedHasAgg))
 76285  	}
 76286  	return bool2int((_pExpr.Xflags & uint32(8)) != (0))
 76287  }
 76288  
 76289  // C comment
 76290  //  /*
 76291  //  ** Resolve all names for all expression in an expression list.  This is
 76292  //  ** just like sqlite3ResolveExprNames() except that it works for an expression
 76293  //  ** list rather than a single expression.
 76294  //  */
 76295  func _sqlite3ResolveExprListNames(tls *crt.TLS, _pNC *XNameContext, _pList *XExprList) (r0 int32) {
 76296  	var _i int32
 76297  	if _pList == nil {
 76298  		goto _0
 76299  	}
 76300  	_i = int32(0)
 76301  _1:
 76302  	if _i >= _pList.XnExpr {
 76303  		goto _4
 76304  	}
 76305  	if _sqlite3ResolveExprNames(tls, _pNC, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_i)).XpExpr)) != 0 {
 76306  		return int32(2)
 76307  	}
 76308  	_i += 1
 76309  	goto _1
 76310  _4:
 76311  _0:
 76312  	return int32(0)
 76313  }
 76314  
 76315  // C comment
 76316  //  /*
 76317  //  ** pOrderBy is an ORDER BY or GROUP BY clause in SELECT statement pSelect.
 76318  //  ** The Name context of the SELECT statement is pNC.  zType is either
 76319  //  ** "ORDER" or "GROUP" depending on which type of clause pOrderBy is.
 76320  //  **
 76321  //  ** This routine resolves each term of the clause into an expression.
 76322  //  ** If the order-by term is an integer I between 1 and N (where N is the
 76323  //  ** number of columns in the result set of the SELECT) then the expression
 76324  //  ** in the resolution is a copy of the I-th result-set expression.  If
 76325  //  ** the order-by term is an identifier that corresponds to the AS-name of
 76326  //  ** a result-set expression, then the term resolves to a copy of the
 76327  //  ** result-set expression.  Otherwise, the expression is resolved in
 76328  //  ** the usual way - using sqlite3ResolveExprNames().
 76329  //  **
 76330  //  ** This routine returns the number of errors.  If errors occur, then
 76331  //  ** an appropriate error message might be left in pParse.  (OOM errors
 76332  //  ** excepted.)
 76333  //  */
 76334  func _resolveOrderGroupBy(tls *crt.TLS, _pNC *XNameContext, _pSelect *XSelect, _pOrderBy *XExprList, _zType *int8) (r0 int32) {
 76335  	var _i, _j, _iCol, _nResult int32
 76336  	var _pItem *TExprList_item
 76337  	var _1_pE, _1_pE2 *XExpr
 76338  	var _pParse *XParse
 76339  	if _pOrderBy == nil {
 76340  		return int32(0)
 76341  	}
 76342  	_nResult = (*XExprList)(_pSelect.XpEList).XnExpr
 76343  	_pParse = (*XParse)(_pNC.XpParse)
 76344  	*func() **TExprList_item { _i = int32(0); return &_pItem }() = (*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa))
 76345  _1:
 76346  	if _i >= _pOrderBy.XnExpr {
 76347  		goto _4
 76348  	}
 76349  	_1_pE = (*XExpr)(_pItem.XpExpr)
 76350  	_1_pE2 = _sqlite3ExprSkipCollate(tls, _1_pE)
 76351  	if int32(*elem1(_zType, 0)) == int32(71) {
 76352  		goto _5
 76353  	}
 76354  	_iCol = _resolveAsName(tls, _pParse, (*XExprList)(_pSelect.XpEList), _1_pE2)
 76355  	if _iCol > int32(0) {
 76356  		(*t71)(unsafe.Pointer(&_pItem.Xu)).XiOrderByCol = uint16(_iCol)
 76357  		goto _2
 76358  	}
 76359  _5:
 76360  	if _sqlite3ExprIsInteger(tls, _1_pE2, &_iCol) == 0 {
 76361  		goto _7
 76362  	}
 76363  	if (_iCol < int32(1)) || (_iCol > int32(65535)) {
 76364  		_resolveOutOfRangeError(tls, _pParse, _zType, _i+int32(1), _nResult)
 76365  		return int32(1)
 76366  	}
 76367  	(*t71)(unsafe.Pointer(&_pItem.Xu)).XiOrderByCol = uint16(_iCol)
 76368  	goto _2
 76369  _7:
 76370  	(*t71)(unsafe.Pointer(&_pItem.Xu)).XiOrderByCol = 0
 76371  	if _sqlite3ResolveExprNames(tls, _pNC, _1_pE) != 0 {
 76372  		return int32(1)
 76373  	}
 76374  	_j = int32(0)
 76375  _11:
 76376  	if _j >= ((*XExprList)(_pSelect.XpEList).XnExpr) {
 76377  		goto _14
 76378  	}
 76379  	if _sqlite3ExprCompare(tls, _1_pE, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSelect.XpEList).Xa))), uintptr(_j)).XpExpr), int32(-1)) == int32(0) {
 76380  		(*t71)(unsafe.Pointer(&_pItem.Xu)).XiOrderByCol = uint16(_j + int32(1))
 76381  	}
 76382  	_j += 1
 76383  	goto _11
 76384  _14:
 76385  _2:
 76386  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pItem }())) += uintptr(20)
 76387  	goto _1
 76388  _4:
 76389  	return _sqlite3ResolveOrderGroupBy(tls, _pParse, _pSelect, _pOrderBy, _zType)
 76390  }
 76391  
 76392  // C comment
 76393  //  /*
 76394  //  ** pEList is a list of expressions which are really the result set of the
 76395  //  ** a SELECT statement.  pE is a term in an ORDER BY or GROUP BY clause.
 76396  //  ** This routine checks to see if pE is a simple identifier which corresponds
 76397  //  ** to the AS-name of one of the terms of the expression list.  If it is,
 76398  //  ** this routine return an integer between 1 and N where N is the number of
 76399  //  ** elements in pEList, corresponding to the matching entry.  If there is
 76400  //  ** no match, or if pE is not a simple identifier, then this routine
 76401  //  ** return 0.
 76402  //  **
 76403  //  ** pEList has been resolved.  pE has not.
 76404  //  */
 76405  func _resolveAsName(tls *crt.TLS, _pParse *XParse, _pEList *XExprList, _pE *XExpr) (r0 int32) {
 76406  	var _i int32
 76407  	var _1_zCol, _2_zAs *int8
 76408  
 76409  	if int32(_pE.Xop) != int32(27) {
 76410  		goto _0
 76411  	}
 76412  	_1_zCol = *(**int8)(unsafe.Pointer(&_pE.Xu))
 76413  	_i = int32(0)
 76414  _1:
 76415  	if _i >= _pEList.XnExpr {
 76416  		goto _4
 76417  	}
 76418  	_2_zAs = elem57((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XzName
 76419  	if (_2_zAs != nil) && (_sqlite3StrICmp(tls, _2_zAs, _1_zCol) == int32(0)) {
 76420  		return _i + int32(1)
 76421  	}
 76422  	_i += 1
 76423  	goto _1
 76424  _4:
 76425  _0:
 76426  	return int32(0)
 76427  }
 76428  
 76429  // C comment
 76430  //  /*
 76431  //  ** Generate an ORDER BY or GROUP BY term out-of-range error.
 76432  //  */
 76433  func _resolveOutOfRangeError(tls *crt.TLS, _pParse *XParse, _zType *int8, _i int32, _mx int32) {
 76434  	_sqlite3ErrorMsg(tls, _pParse, str(97191), _i, unsafe.Pointer(_zType), _mx)
 76435  }
 76436  
 76437  // C comment
 76438  //  /*
 76439  //  ** Do a deep comparison of two expression trees.  Return 0 if the two
 76440  //  ** expressions are completely identical.  Return 1 if they differ only
 76441  //  ** by a COLLATE operator at the top level.  Return 2 if there are differences
 76442  //  ** other than the top-level COLLATE operator.
 76443  //  **
 76444  //  ** If any subelement of pB has Expr.iTable==(-1) then it is allowed
 76445  //  ** to compare equal to an equivalent element in pA with Expr.iTable==iTab.
 76446  //  **
 76447  //  ** The pA side might be using TK_REGISTER.  If that is the case and pB is
 76448  //  ** not using TK_REGISTER but is otherwise equivalent, then still return 0.
 76449  //  **
 76450  //  ** Sometimes this routine will return 2 even if the two expressions
 76451  //  ** really are equivalent.  If we cannot prove that the expressions are
 76452  //  ** identical, we return 2 just to be safe.  So if this routine
 76453  //  ** returns 2, then you do not really know for certain if the two
 76454  //  ** expressions are the same.  But if you get a 0 or 1 return, then you
 76455  //  ** can be sure the expressions are the same.  In the places where
 76456  //  ** this routine is used, it does not hurt to get an extra 2 - that
 76457  //  ** just might result in some slightly slower code.  But returning
 76458  //  ** an incorrect 0 or 1 could lead to a malfunction.
 76459  //  */
 76460  func _sqlite3ExprCompare(tls *crt.TLS, _pA *XExpr, _pB *XExpr, _iTab int32) (r0 int32) {
 76461  	var _combinedFlags uint32
 76462  	if (_pA == nil) || (_pB == nil) {
 76463  		return func() int32 {
 76464  			if _pB == _pA {
 76465  				return int32(0)
 76466  			}
 76467  			return int32(2)
 76468  		}()
 76469  	}
 76470  	_combinedFlags = _pA.Xflags | _pB.Xflags
 76471  	if (_combinedFlags & uint32(1024)) == 0 {
 76472  		goto _4
 76473  	}
 76474  	if (((_pA.Xflags & _pB.Xflags) & uint32(1024)) != (0)) && ((*(*int32)(unsafe.Pointer(&_pA.Xu))) == (*(*int32)(unsafe.Pointer(&_pB.Xu)))) {
 76475  		return int32(0)
 76476  	}
 76477  	return int32(2)
 76478  
 76479  _4:
 76480  	if int32(_pA.Xop) == int32(_pB.Xop) {
 76481  		goto _7
 76482  	}
 76483  	if (int32(_pA.Xop) == int32(94)) && (_sqlite3ExprCompare(tls, (*XExpr)(_pA.XpLeft), _pB, _iTab) < int32(2)) {
 76484  		return int32(1)
 76485  	}
 76486  	if (int32(_pB.Xop) == int32(94)) && (_sqlite3ExprCompare(tls, _pA, (*XExpr)(_pB.XpLeft), _iTab) < int32(2)) {
 76487  		return int32(1)
 76488  	}
 76489  	return int32(2)
 76490  
 76491  _7:
 76492  	if int32(_pA.Xop) == int32(152) || int32(_pA.Xop) == int32(154) || (*(**int8)(unsafe.Pointer(&_pA.Xu))) == nil {
 76493  		goto _14
 76494  	}
 76495  	if int32(_pA.Xop) != int32(151) {
 76496  		goto _15
 76497  	}
 76498  	if _sqlite3StrICmp(tls, *(**int8)(unsafe.Pointer(&_pA.Xu)), *(**int8)(unsafe.Pointer(&_pB.Xu))) != int32(0) {
 76499  		return int32(2)
 76500  	}
 76501  	goto _18
 76502  _15:
 76503  	if crt.Xstrcmp(tls, *(**int8)(unsafe.Pointer(&_pA.Xu)), *(**int8)(unsafe.Pointer(&_pB.Xu))) != int32(0) {
 76504  		return func() int32 {
 76505  			if int32(_pA.Xop) == int32(94) {
 76506  				return int32(1)
 76507  			}
 76508  			return int32(2)
 76509  		}()
 76510  	}
 76511  _18:
 76512  _14:
 76513  	if (_pA.Xflags & uint32(16)) != (_pB.Xflags & uint32(16)) {
 76514  		return int32(2)
 76515  	}
 76516  	if func() int32 {
 76517  		if (_combinedFlags & uint32(16384)) == (0) {
 76518  			return int32(1)
 76519  		}
 76520  		return func() int32 {
 76521  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95607), unsafe.Pointer(&_sqlite3ExprCompareØ00__func__Ø000), unsafe.Pointer(str(4809)))
 76522  			crt.X__builtin_abort(tls)
 76523  			return int32(0)
 76524  		}()
 76525  	}() == 0 {
 76526  		goto _24
 76527  	}
 76528  	if (_combinedFlags & uint32(2048)) != 0 {
 76529  		return int32(2)
 76530  	}
 76531  	if _sqlite3ExprCompare(tls, (*XExpr)(_pA.XpLeft), (*XExpr)(_pB.XpLeft), _iTab) != 0 {
 76532  		return int32(2)
 76533  	}
 76534  	if _sqlite3ExprCompare(tls, (*XExpr)(_pA.XpRight), (*XExpr)(_pB.XpRight), _iTab) != 0 {
 76535  		return int32(2)
 76536  	}
 76537  	if _sqlite3ExprListCompare(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pA.Xx))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pB.Xx))), _iTab) != 0 {
 76538  		return int32(2)
 76539  	}
 76540  	if func() int32 {
 76541  		if (_combinedFlags & uint32(8192)) == (0) {
 76542  			return int32(1)
 76543  		}
 76544  		return func() int32 {
 76545  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95612), unsafe.Pointer(&_sqlite3ExprCompareØ00__func__Ø000), unsafe.Pointer(str(4809)))
 76546  			crt.X__builtin_abort(tls)
 76547  			return int32(0)
 76548  		}()
 76549  	}() == 0 || int32(_pA.Xop) == int32(97) {
 76550  		goto _32
 76551  	}
 76552  	if int32(_pA.XiColumn) != int32(_pB.XiColumn) {
 76553  		return int32(2)
 76554  	}
 76555  	if (_pA.XiTable != _pB.XiTable) && ((_pA.XiTable != _iTab) || func() int32 {
 76556  		if _pB.XiTable >= int32(0) {
 76557  			return func() int32 {
 76558  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95615), unsafe.Pointer(&_sqlite3ExprCompareØ00__func__Ø000), unsafe.Pointer(str(4809)))
 76559  				crt.X__builtin_abort(tls)
 76560  				return int32(1)
 76561  			}()
 76562  		}
 76563  		return int32(0)
 76564  	}() != 0) {
 76565  		return int32(2)
 76566  	}
 76567  _32:
 76568  _24:
 76569  	return int32(0)
 76570  }
 76571  
 76572  var _sqlite3ExprCompareØ00__func__Ø000 [19]int8
 76573  
 76574  func init() {
 76575  	crt.Xstrncpy(nil, &_sqlite3ExprCompareØ00__func__Ø000[0], str(97247), 19)
 76576  }
 76577  
 76578  // C comment
 76579  //  /*
 76580  //  ** Compare two ExprList objects.  Return 0 if they are identical and
 76581  //  ** non-zero if they differ in any way.
 76582  //  **
 76583  //  ** If any subelement of pB has Expr.iTable==(-1) then it is allowed
 76584  //  ** to compare equal to an equivalent element in pA with Expr.iTable==iTab.
 76585  //  **
 76586  //  ** This routine might return non-zero for equivalent ExprLists.  The
 76587  //  ** only consequence will be disabled optimizations.  But this routine
 76588  //  ** must never return 0 if the two ExprList objects are different, or
 76589  //  ** a malfunction will result.
 76590  //  **
 76591  //  ** Two NULL pointers are considered to be the same.  But a NULL pointer
 76592  //  ** always differs from a non-NULL pointer.
 76593  //  */
 76594  func _sqlite3ExprListCompare(tls *crt.TLS, _pA *XExprList, _pB *XExprList, _iTab int32) (r0 int32) {
 76595  	var _i int32
 76596  	var _1_pExprA, _1_pExprB *XExpr
 76597  	if (_pA == nil) && (_pB == nil) {
 76598  		return int32(0)
 76599  	}
 76600  	if (_pA == nil) || (_pB == nil) {
 76601  		return int32(1)
 76602  	}
 76603  	if _pA.XnExpr != _pB.XnExpr {
 76604  		return int32(1)
 76605  	}
 76606  	_i = int32(0)
 76607  _5:
 76608  	if _i >= _pA.XnExpr {
 76609  		goto _8
 76610  	}
 76611  	_1_pExprA = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pA.Xa)), uintptr(_i)).XpExpr)
 76612  	_1_pExprB = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pB.Xa)), uintptr(_i)).XpExpr)
 76613  	if int32(elem57((*TExprList_item)(unsafe.Pointer(&_pA.Xa)), uintptr(_i)).XsortOrder) != int32(elem57((*TExprList_item)(unsafe.Pointer(&_pB.Xa)), uintptr(_i)).XsortOrder) {
 76614  		return int32(1)
 76615  	}
 76616  	if _sqlite3ExprCompare(tls, _1_pExprA, _1_pExprB, _iTab) != 0 {
 76617  		return int32(1)
 76618  	}
 76619  	_i += 1
 76620  	goto _5
 76621  _8:
 76622  	return int32(0)
 76623  }
 76624  
 76625  // C comment
 76626  //  /*
 76627  //  ** Check every term in the ORDER BY or GROUP BY clause pOrderBy of
 76628  //  ** the SELECT statement pSelect.  If any term is reference to a
 76629  //  ** result set expression (as determined by the ExprList.a.u.x.iOrderByCol
 76630  //  ** field) then convert that term into a copy of the corresponding result set
 76631  //  ** column.
 76632  //  **
 76633  //  ** If any errors are detected, add an error message to pParse and
 76634  //  ** return non-zero.  Return zero if no errors are seen.
 76635  //  */
 76636  func _sqlite3ResolveOrderGroupBy(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect, _pOrderBy *XExprList, _zType *int8) (r0 int32) {
 76637  	var _i int32
 76638  	var _db *Xsqlite3
 76639  	var _pEList *XExprList
 76640  	var _pItem *TExprList_item
 76641  	_db = (*Xsqlite3)(_pParse.Xdb)
 76642  	if (_pOrderBy == nil) || (((*Xsqlite3)(_pParse.Xdb).XmallocFailed) != 0) {
 76643  		return int32(0)
 76644  	}
 76645  	if _pOrderBy.XnExpr > (*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(2))) {
 76646  		_sqlite3ErrorMsg(tls, _pParse, str(97266), unsafe.Pointer(_zType))
 76647  		return int32(1)
 76648  	}
 76649  	_pEList = (*XExprList)(_pSelect.XpEList)
 76650  	func() {
 76651  		if _pEList == nil {
 76652  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90418), unsafe.Pointer(&_sqlite3ResolveOrderGroupByØ00__func__Ø000), unsafe.Pointer(str(45007)))
 76653  			crt.X__builtin_abort(tls)
 76654  		}
 76655  	}()
 76656  	*func() **TExprList_item { _i = int32(0); return &_pItem }() = (*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa))
 76657  _5:
 76658  	if _i >= _pOrderBy.XnExpr {
 76659  		goto _8
 76660  	}
 76661  	if ((*t71)(unsafe.Pointer(&_pItem.Xu)).XiOrderByCol) == 0 {
 76662  		goto _9
 76663  	}
 76664  	if int32((*t71)(unsafe.Pointer(&_pItem.Xu)).XiOrderByCol) > _pEList.XnExpr {
 76665  		_resolveOutOfRangeError(tls, _pParse, _zType, _i+int32(1), _pEList.XnExpr)
 76666  		return int32(1)
 76667  	}
 76668  	_resolveAlias(tls, _pParse, _pEList, int32((*t71)(unsafe.Pointer(&_pItem.Xu)).XiOrderByCol)-int32(1), (*XExpr)(_pItem.XpExpr), _zType, int32(0))
 76669  _9:
 76670  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pItem }())) += uintptr(20)
 76671  	goto _5
 76672  _8:
 76673  	return int32(0)
 76674  }
 76675  
 76676  var _sqlite3ResolveOrderGroupByØ00__func__Ø000 [27]int8
 76677  
 76678  func init() {
 76679  	crt.Xstrncpy(nil, &_sqlite3ResolveOrderGroupByØ00__func__Ø000[0], str(97297), 27)
 76680  }
 76681  
 76682  // C comment
 76683  //  /*
 76684  //  ** Error message for when two or more terms of a compound select have different
 76685  //  ** size result sets.
 76686  //  */
 76687  func _sqlite3SelectWrongNumTermsError(tls *crt.TLS, _pParse *XParse, _p *XSelect) {
 76688  	if (_p.XselFlags & uint32(512)) != 0 {
 76689  		_sqlite3ErrorMsg(tls, _pParse, str(97324))
 76690  		goto _1
 76691  	}
 76692  	_sqlite3ErrorMsg(tls, _pParse, str(97370), unsafe.Pointer(_selectOpName(tls, int32(_p.Xop))))
 76693  _1:
 76694  }
 76695  
 76696  // C comment
 76697  //  /*
 76698  //  ** Name of the connection operator, used for error messages.
 76699  //  */
 76700  func _selectOpName(tls *crt.TLS, _id int32) (r0 *int8) {
 76701  	var _z *int8
 76702  	switch _id {
 76703  	case int32(116):
 76704  		goto _1
 76705  	case int32(117):
 76706  		goto _3
 76707  	case int32(118):
 76708  		goto _2
 76709  	default:
 76710  		goto _4
 76711  	}
 76712  
 76713  _1:
 76714  	_z = str(47055)
 76715  	goto _5
 76716  _2:
 76717  	_z = str(25647)
 76718  	goto _5
 76719  _3:
 76720  	_z = str(25640)
 76721  	goto _5
 76722  _4:
 76723  	_z = str(25630)
 76724  	goto _5
 76725  _5:
 76726  	return _z
 76727  }
 76728  
 76729  // C comment
 76730  //  /*
 76731  //  ** Analyze the ORDER BY clause in a compound SELECT statement.   Modify
 76732  //  ** each term of the ORDER BY clause is a constant integer between 1
 76733  //  ** and N where N is the number of columns in the compound SELECT.
 76734  //  **
 76735  //  ** ORDER BY terms that are already an integer between 1 and N are
 76736  //  ** unmodified.  ORDER BY terms that are integers outside the range of
 76737  //  ** 1 through N generate an error.  ORDER BY terms that are expressions
 76738  //  ** are matched against result set expressions of compound SELECT
 76739  //  ** beginning with the left-most SELECT and working toward the right.
 76740  //  ** At the first match, the ORDER BY expression is transformed into
 76741  //  ** the integer column number.
 76742  //  **
 76743  //  ** Return the number of errors seen.
 76744  //  */
 76745  func _resolveCompoundOrderBy(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect) (r0 int32) {
 76746  	var _i, _moreToDo, _5_iCol int32
 76747  	var _db *Xsqlite3
 76748  	var _pOrderBy, _pEList *XExprList
 76749  	var _4_pItem *TExprList_item
 76750  	var _5_pE, _5_pDup, _11_pNew, _13_pParent *XExpr
 76751  	_moreToDo = int32(1)
 76752  	_pOrderBy = (*XExprList)(_pSelect.XpOrderBy)
 76753  	if _pOrderBy == nil {
 76754  		return int32(0)
 76755  	}
 76756  	_db = (*Xsqlite3)(_pParse.Xdb)
 76757  	if _pOrderBy.XnExpr > (*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(2))) {
 76758  		_sqlite3ErrorMsg(tls, _pParse, str(97452))
 76759  		return int32(1)
 76760  	}
 76761  	_i = int32(0)
 76762  _2:
 76763  	if _i >= _pOrderBy.XnExpr {
 76764  		goto _5
 76765  	}
 76766  	storebits5(&(elem57((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_i)).Xdone), 0, 1, 0)
 76767  	_i += 1
 76768  	goto _2
 76769  _5:
 76770  	*(**XSelect)(unsafe.Pointer(&_pSelect.XpNext)) = nil
 76771  _6:
 76772  	if _pSelect.XpPrior != nil {
 76773  		*(**XSelect)(unsafe.Pointer(&((*XSelect)(_pSelect.XpPrior).XpNext))) = _pSelect
 76774  		_pSelect = (*XSelect)(_pSelect.XpPrior)
 76775  		goto _6
 76776  	}
 76777  _7:
 76778  	if _pSelect == nil || _moreToDo == 0 {
 76779  		goto _9
 76780  	}
 76781  	_moreToDo = int32(0)
 76782  	_pEList = (*XExprList)(_pSelect.XpEList)
 76783  	func() {
 76784  		if _pEList == nil {
 76785  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90332), unsafe.Pointer(&_resolveCompoundOrderByØ00__func__Ø000), unsafe.Pointer(str(45007)))
 76786  			crt.X__builtin_abort(tls)
 76787  		}
 76788  	}()
 76789  	*func() **TExprList_item { _i = int32(0); return &_4_pItem }() = (*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa))
 76790  _13:
 76791  	if _i >= _pOrderBy.XnExpr {
 76792  		goto _16
 76793  	}
 76794  	_5_iCol = int32(-1)
 76795  	if ((uint32(_4_pItem.Xdone) << 31) >> 31) != 0 {
 76796  		goto _14
 76797  	}
 76798  	_5_pE = _sqlite3ExprSkipCollate(tls, (*XExpr)(_4_pItem.XpExpr))
 76799  	if _sqlite3ExprIsInteger(tls, _5_pE, &_5_iCol) == 0 {
 76800  		goto _18
 76801  	}
 76802  	if (_5_iCol <= int32(0)) || (_5_iCol > _pEList.XnExpr) {
 76803  		_resolveOutOfRangeError(tls, _pParse, str(25700), _i+int32(1), _pEList.XnExpr)
 76804  		return int32(1)
 76805  	}
 76806  	goto _21
 76807  _18:
 76808  	_5_iCol = _resolveAsName(tls, _pParse, _pEList, _5_pE)
 76809  	if _5_iCol != int32(0) {
 76810  		goto _22
 76811  	}
 76812  	_5_pDup = _sqlite3ExprDup(tls, _db, _5_pE, int32(0))
 76813  	if _db.XmallocFailed == 0 {
 76814  		func() {
 76815  			if _5_pDup == nil {
 76816  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90348), unsafe.Pointer(&_resolveCompoundOrderByØ00__func__Ø000), unsafe.Pointer(str(97486)))
 76817  				crt.X__builtin_abort(tls)
 76818  			}
 76819  		}()
 76820  		_5_iCol = _resolveOrderByTermToExprList(tls, _pParse, _pSelect, _5_pDup)
 76821  	}
 76822  	_sqlite3ExprDelete(tls, _db, _5_pDup)
 76823  _22:
 76824  _21:
 76825  	if _5_iCol <= int32(0) {
 76826  		goto _26
 76827  	}
 76828  	_11_pNew = _sqlite3Expr(tls, _db, int32(134), nil)
 76829  	if _11_pNew == nil {
 76830  		return int32(1)
 76831  	}
 76832  	_11_pNew.Xflags |= uint32(1024)
 76833  	*(*int32)(unsafe.Pointer(&_11_pNew.Xu)) = _5_iCol
 76834  	if (*XExpr)(_4_pItem.XpExpr) == _5_pE {
 76835  		*(**XExpr)(unsafe.Pointer(&_4_pItem.XpExpr)) = _11_pNew
 76836  		goto _29
 76837  	}
 76838  	_13_pParent = (*XExpr)(_4_pItem.XpExpr)
 76839  	func() {
 76840  		if int32(_13_pParent.Xop) != int32(94) {
 76841  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90365), unsafe.Pointer(&_resolveCompoundOrderByØ00__func__Ø000), unsafe.Pointer(str(97491)))
 76842  			crt.X__builtin_abort(tls)
 76843  		}
 76844  	}()
 76845  _32:
 76846  	if int32((*XExpr)(_13_pParent.XpLeft).Xop) == int32(94) {
 76847  		_13_pParent = (*XExpr)(_13_pParent.XpLeft)
 76848  		goto _32
 76849  	}
 76850  	func() {
 76851  		if (*XExpr)(_13_pParent.XpLeft) != _5_pE {
 76852  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90367), unsafe.Pointer(&_resolveCompoundOrderByØ00__func__Ø000), unsafe.Pointer(str(97515)))
 76853  			crt.X__builtin_abort(tls)
 76854  		}
 76855  	}()
 76856  	*(**XExpr)(unsafe.Pointer(&_13_pParent.XpLeft)) = _11_pNew
 76857  _29:
 76858  	_sqlite3ExprDelete(tls, _db, _5_pE)
 76859  	(*t71)(unsafe.Pointer(&_4_pItem.Xu)).XiOrderByCol = uint16(_5_iCol)
 76860  	storebits5(&_4_pItem.Xdone, int8(1), 1, 0)
 76861  	goto _36
 76862  _26:
 76863  	_moreToDo = int32(1)
 76864  _36:
 76865  _14:
 76866  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_4_pItem }())) += uintptr(20)
 76867  	goto _13
 76868  _16:
 76869  	_pSelect = (*XSelect)(_pSelect.XpNext)
 76870  	goto _7
 76871  _9:
 76872  	_i = int32(0)
 76873  _37:
 76874  	if _i >= _pOrderBy.XnExpr {
 76875  		goto _40
 76876  	}
 76877  	if int32((uint32(elem57((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_i)).Xdone)<<31)>>31) == int32(0) {
 76878  		_sqlite3ErrorMsg(tls, _pParse, str(97534), _i+int32(1))
 76879  		return int32(1)
 76880  	}
 76881  	_i += 1
 76882  	goto _37
 76883  _40:
 76884  	return int32(0)
 76885  }
 76886  
 76887  var _resolveCompoundOrderByØ00__func__Ø000 [23]int8
 76888  
 76889  func init() {
 76890  	crt.Xstrncpy(nil, &_resolveCompoundOrderByØ00__func__Ø000[0], str(97595), 23)
 76891  }
 76892  
 76893  // C comment
 76894  //  /*
 76895  //  ** pE is a pointer to an expression which is a single term in the
 76896  //  ** ORDER BY of a compound SELECT.  The expression has not been
 76897  //  ** name resolved.
 76898  //  **
 76899  //  ** At the point this routine is called, we already know that the
 76900  //  ** ORDER BY term is not an integer index into the result set.  That
 76901  //  ** case is handled by the calling routine.
 76902  //  **
 76903  //  ** Attempt to match pE against result set columns in the left-most
 76904  //  ** SELECT statement.  Return the index i of the matching column,
 76905  //  ** as an indication to the caller that it should sort by the i-th column.
 76906  //  ** The left-most column is 1.  In other words, the value returned is the
 76907  //  ** same integer value that would be used in the SQL statement to indicate
 76908  //  ** the column.
 76909  //  **
 76910  //  ** If there is no match, return 0.  Return -1 if an error occurs.
 76911  //  */
 76912  func _resolveOrderByTermToExprList(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect, _pE *XExpr) (r0 int32) {
 76913  	var _i, _rc int32
 76914  	var _savedSuppErr uint8
 76915  	var _db *Xsqlite3
 76916  	var _pEList *XExprList
 76917  	var _nc XNameContext
 76918  	func() {
 76919  		if _sqlite3ExprIsInteger(tls, _pE, &_i) != int32(0) {
 76920  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90240), unsafe.Pointer(&_resolveOrderByTermToExprListØ00__func__Ø000), unsafe.Pointer(str(97618)))
 76921  			crt.X__builtin_abort(tls)
 76922  		}
 76923  	}()
 76924  	_pEList = (*XExprList)(_pSelect.XpEList)
 76925  	crt.Xmemset(tls, unsafe.Pointer(&_nc), int32(0), uint32(32))
 76926  	*(**XParse)(unsafe.Pointer(&_nc.XpParse)) = _pParse
 76927  	*(**XSrcList)(unsafe.Pointer(&_nc.XpSrcList)) = (*XSrcList)(_pSelect.XpSrc)
 76928  	*(**XExprList)(unsafe.Pointer(&_nc.XpEList)) = _pEList
 76929  	_nc.XncFlags = uint16(1)
 76930  	_nc.XnErr = int32(0)
 76931  	_db = (*Xsqlite3)(_pParse.Xdb)
 76932  	_savedSuppErr = _db.XsuppressErr
 76933  	_db.XsuppressErr = uint8(1)
 76934  	_rc = _sqlite3ResolveExprNames(tls, &_nc, _pE)
 76935  	_db.XsuppressErr = _savedSuppErr
 76936  	if _rc != 0 {
 76937  		return int32(0)
 76938  	}
 76939  	_i = int32(0)
 76940  _3:
 76941  	if _i >= _pEList.XnExpr {
 76942  		goto _6
 76943  	}
 76944  	if _sqlite3ExprCompare(tls, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XpExpr), _pE, int32(-1)) < int32(2) {
 76945  		return _i + int32(1)
 76946  	}
 76947  	_i += 1
 76948  	goto _3
 76949  _6:
 76950  	return int32(0)
 76951  }
 76952  
 76953  var _resolveOrderByTermToExprListØ00__func__Ø000 [29]int8
 76954  
 76955  func init() {
 76956  	crt.Xstrncpy(nil, &_resolveOrderByTermToExprListØ00__func__Ø000[0], str(97650), 29)
 76957  }
 76958  
 76959  // C comment
 76960  //  /*
 76961  //  ** This routine adds datatype and collating sequence information to
 76962  //  ** the Table structures of all FROM-clause subqueries in a
 76963  //  ** SELECT statement.
 76964  //  **
 76965  //  ** Use this routine after name resolution.
 76966  //  */
 76967  func _sqlite3SelectAddTypeInfo(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect) {
 76968  	var _w XWalker
 76969  	crt.Xmemset(tls, unsafe.Pointer(&_w), int32(0), uint32(28))
 76970  	*(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer(&_w.XxSelectCallback2)) = _selectAddSubqueryTypeInfo
 76971  	*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_w.XxExprCallback)) = _sqlite3ExprWalkNoop
 76972  	*(**XParse)(unsafe.Pointer(&_w.XpParse)) = _pParse
 76973  	_sqlite3WalkSelect(tls, &_w, _pSelect)
 76974  }
 76975  
 76976  // C comment
 76977  //  /*
 76978  //  ** This is a Walker.xSelectCallback callback for the sqlite3SelectTypeInfo()
 76979  //  ** interface.
 76980  //  **
 76981  //  ** For each FROM-clause subquery, add Column.zType and Column.zColl
 76982  //  ** information to the Table structure that represents the result set
 76983  //  ** of that subquery.
 76984  //  **
 76985  //  ** The Table structure that represents the result set was constructed
 76986  //  ** by selectExpander() but the type and collation information was omitted
 76987  //  ** at that point because identifiers had not yet been resolved.  This
 76988  //  ** routine is called after identifier resolution.
 76989  //  */
 76990  func _selectAddSubqueryTypeInfo(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) {
 76991  	var _i int32
 76992  	var _1_pTab *XTable
 76993  	var _pTabList *XSrcList
 76994  	var _pFrom *TSrcList_item
 76995  	var _2_pSel *XSelect
 76996  	var _pParse *XParse
 76997  	func() {
 76998  		if (_p.XselFlags & uint32(4)) == 0 {
 76999  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121182), unsafe.Pointer(&_selectAddSubqueryTypeInfoØ00__func__Ø000), unsafe.Pointer(str(97679)))
 77000  			crt.X__builtin_abort(tls)
 77001  		}
 77002  	}()
 77003  	func() {
 77004  		if (_p.XselFlags & uint32(128)) != (0) {
 77005  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121183), unsafe.Pointer(&_selectAddSubqueryTypeInfoØ00__func__Ø000), unsafe.Pointer(str(97705)))
 77006  			crt.X__builtin_abort(tls)
 77007  		}
 77008  	}()
 77009  	_p.XselFlags |= uint32(128)
 77010  	_pParse = (*XParse)(_pWalker.XpParse)
 77011  	_pTabList = (*XSrcList)(_p.XpSrc)
 77012  	*func() **TSrcList_item { _i = int32(0); return &_pFrom }() = (*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa))
 77013  _4:
 77014  	if _i >= _pTabList.XnSrc {
 77015  		goto _7
 77016  	}
 77017  	_1_pTab = (*XTable)(_pFrom.XpTab)
 77018  	func() {
 77019  		if _1_pTab == nil {
 77020  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121189), unsafe.Pointer(&_selectAddSubqueryTypeInfoØ00__func__Ø000), unsafe.Pointer(str(43549)))
 77021  			crt.X__builtin_abort(tls)
 77022  		}
 77023  	}()
 77024  	if (_1_pTab.XtabFlags & uint32(2)) == (0) {
 77025  		goto _10
 77026  	}
 77027  	_2_pSel = (*XSelect)(_pFrom.XpSelect)
 77028  	if _2_pSel == nil {
 77029  		goto _11
 77030  	}
 77031  _12:
 77032  	if _2_pSel.XpPrior != nil {
 77033  		_2_pSel = (*XSelect)(_2_pSel.XpPrior)
 77034  		goto _12
 77035  	}
 77036  	_sqlite3SelectAddColumnTypeAndCollation(tls, _pParse, _1_pTab, _2_pSel)
 77037  _11:
 77038  _10:
 77039  	*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pFrom }())) += uintptr(68)
 77040  	goto _4
 77041  _7:
 77042  }
 77043  
 77044  var _selectAddSubqueryTypeInfoØ00__func__Ø000 [26]int8
 77045  
 77046  func init() {
 77047  	crt.Xstrncpy(nil, &_selectAddSubqueryTypeInfoØ00__func__Ø000[0], str(97739), 26)
 77048  }
 77049  
 77050  // C comment
 77051  //  /*
 77052  //  ** This routine attempts to flatten subqueries as a performance optimization.
 77053  //  ** This routine returns 1 if it makes changes and 0 if no flattening occurs.
 77054  //  **
 77055  //  ** To understand the concept of flattening, consider the following
 77056  //  ** query:
 77057  //  **
 77058  //  **     SELECT a FROM (SELECT x+y AS a FROM t1 WHERE z<100) WHERE a>5
 77059  //  **
 77060  //  ** The default way of implementing this query is to execute the
 77061  //  ** subquery first and store the results in a temporary table, then
 77062  //  ** run the outer query on that temporary table.  This requires two
 77063  //  ** passes over the data.  Furthermore, because the temporary table
 77064  //  ** has no indices, the WHERE clause on the outer query cannot be
 77065  //  ** optimized.
 77066  //  **
 77067  //  ** This routine attempts to rewrite queries such as the above into
 77068  //  ** a single flat select, like this:
 77069  //  **
 77070  //  **     SELECT x+y AS a FROM t1 WHERE z<100 AND a>5
 77071  //  **
 77072  //  ** The code generated for this simplification gives the same result
 77073  //  ** but only has to scan the data once.  And because indices might
 77074  //  ** exist on the table t1, a complete scan of the data might be
 77075  //  ** avoided.
 77076  //  **
 77077  //  ** Flattening is only attempted if all of the following are true:
 77078  //  **
 77079  //  **   (1)  The subquery and the outer query do not both use aggregates.
 77080  //  **
 77081  //  **   (2)  The subquery is not an aggregate or (2a) the outer query is not a join
 77082  //  **        and (2b) the outer query does not use subqueries other than the one
 77083  //  **        FROM-clause subquery that is a candidate for flattening.  (2b is
 77084  //  **        due to ticket [2f7170d73bf9abf80] from 2015-02-09.)
 77085  //  **
 77086  //  **   (3)  The subquery is not the right operand of a LEFT JOIN
 77087  //  **        or the subquery is not itself a join and the outer query is not
 77088  //  **        an aggregate.
 77089  //  **
 77090  //  **   (4)  The subquery is not DISTINCT.
 77091  //  **
 77092  //  **  (**)  At one point restrictions (4) and (5) defined a subset of DISTINCT
 77093  //  **        sub-queries that were excluded from this optimization. Restriction
 77094  //  **        (4) has since been expanded to exclude all DISTINCT subqueries.
 77095  //  **
 77096  //  **   (6)  The subquery does not use aggregates or the outer query is not
 77097  //  **        DISTINCT.
 77098  //  **
 77099  //  **   (7)  The subquery has a FROM clause.  TODO:  For subqueries without
 77100  //  **        A FROM clause, consider adding a FROM clause with the special
 77101  //  **        table sqlite_once that consists of a single row containing a
 77102  //  **        single NULL.
 77103  //  **
 77104  //  **   (8)  The subquery does not use LIMIT or the outer query is not a join.
 77105  //  **
 77106  //  **   (9)  The subquery does not use LIMIT or the outer query does not use
 77107  //  **        aggregates.
 77108  //  **
 77109  //  **  (**)  Restriction (10) was removed from the code on 2005-02-05 but we
 77110  //  **        accidently carried the comment forward until 2014-09-15.  Original
 77111  //  **        text: "The subquery does not use aggregates or the outer query
 77112  //  **        does not use LIMIT."
 77113  //  **
 77114  //  **  (11)  The subquery and the outer query do not both have ORDER BY clauses.
 77115  //  **
 77116  //  **  (**)  Not implemented.  Subsumed into restriction (3).  Was previously
 77117  //  **        a separate restriction deriving from ticket #350.
 77118  //  **
 77119  //  **  (13)  The subquery and outer query do not both use LIMIT.
 77120  //  **
 77121  //  **  (14)  The subquery does not use OFFSET.
 77122  //  **
 77123  //  **  (15)  The outer query is not part of a compound select or the
 77124  //  **        subquery does not have a LIMIT clause.
 77125  //  **        (See ticket #2339 and ticket [02a8e81d44]).
 77126  //  **
 77127  //  **  (16)  The outer query is not an aggregate or the subquery does
 77128  //  **        not contain ORDER BY.  (Ticket #2942)  This used to not matter
 77129  //  **        until we introduced the group_concat() function.
 77130  //  **
 77131  //  **  (17)  The sub-query is not a compound select, or it is a UNION ALL
 77132  //  **        compound clause made up entirely of non-aggregate queries, and
 77133  //  **        the parent query:
 77134  //  **
 77135  //  **          * is not itself part of a compound select,
 77136  //  **          * is not an aggregate or DISTINCT query, and
 77137  //  **          * is not a join
 77138  //  **
 77139  //  **        The parent and sub-query may contain WHERE clauses. Subject to
 77140  //  **        rules (11), (13) and (14), they may also contain ORDER BY,
 77141  //  **        LIMIT and OFFSET clauses.  The subquery cannot use any compound
 77142  //  **        operator other than UNION ALL because all the other compound
 77143  //  **        operators have an implied DISTINCT which is disallowed by
 77144  //  **        restriction (4).
 77145  //  **
 77146  //  **        Also, each component of the sub-query must return the same number
 77147  //  **        of result columns. This is actually a requirement for any compound
 77148  //  **        SELECT statement, but all the code here does is make sure that no
 77149  //  **        such (illegal) sub-query is flattened. The caller will detect the
 77150  //  **        syntax error and return a detailed message.
 77151  //  **
 77152  //  **  (18)  If the sub-query is a compound select, then all terms of the
 77153  //  **        ORDER by clause of the parent must be simple references to
 77154  //  **        columns of the sub-query.
 77155  //  **
 77156  //  **  (19)  The subquery does not use LIMIT or the outer query does not
 77157  //  **        have a WHERE clause.
 77158  //  **
 77159  //  **  (20)  If the sub-query is a compound select, then it must not use
 77160  //  **        an ORDER BY clause.  Ticket #3773.  We could relax this constraint
 77161  //  **        somewhat by saying that the terms of the ORDER BY clause must
 77162  //  **        appear as unmodified result columns in the outer query.  But we
 77163  //  **        have other optimizations in mind to deal with that case.
 77164  //  **
 77165  //  **  (21)  The subquery does not use LIMIT or the outer query is not
 77166  //  **        DISTINCT.  (See ticket [752e1646fc]).
 77167  //  **
 77168  //  **  (22)  The subquery is not a recursive CTE.
 77169  //  **
 77170  //  **  (23)  The parent is not a recursive CTE, or the sub-query is not a
 77171  //  **        compound query. This restriction is because transforming the
 77172  //  **        parent to a compound query confuses the code that handles
 77173  //  **        recursive queries in multiSelect().
 77174  //  **
 77175  //  **  (24)  The subquery is not an aggregate that uses the built-in min() or
 77176  //  **        or max() functions.  (Without this restriction, a query like:
 77177  //  **        "SELECT x FROM (SELECT max(y), x FROM t1)" would not necessarily
 77178  //  **        return the value X for which Y was maximal.)
 77179  //  **
 77180  //  **
 77181  //  ** In this routine, the "p" parameter is a pointer to the outer query.
 77182  //  ** The subquery is p->pSrc->a[iFrom].  isAgg is true if the outer query
 77183  //  ** uses aggregates and subqueryIsAgg is true if the subquery uses aggregates.
 77184  //  **
 77185  //  ** If flattening is not attempted, this routine is a no-op and returns 0.
 77186  //  ** If flattening is attempted this routine returns 1.
 77187  //  **
 77188  //  ** All of the expression analysis must occur on both the outer query and
 77189  //  ** the subquery before this routine runs.
 77190  //  */
 77191  func _flattenSubquery(tls *crt.TLS, _pParse *XParse, _p *XSelect, _iFrom int32, _isAgg int32, _subqueryIsAgg int32) (r0 int32) {
 77192  	var _iParent, _iNewParent, _isLeftJoin, _i, _17_ii, _25_nSubSrc int32
 77193  	var _zSavedAuthContext, _33_zName *int8
 77194  	var _25_jointype uint8
 77195  	var _db *Xsqlite3
 77196  	var _22_pTabToDel *XTable
 77197  	var _pSrc, _pSubSrc *XSrcList
 77198  	var _pSubitem *TSrcList_item
 77199  	var _pList, _19_pOrderBy, _34_pOrderBy *XExprList
 77200  	var _pParent, _pSub, _pSub1, _19_pNew, _19_pPrior *XSelect
 77201  	var _pWhere, _19_pLimit, _19_pOffset *XExpr
 77202  	var _23_pToplevel *XParse
 77203  	var _39_x XSubstContext
 77204  	_zSavedAuthContext = _pParse.XzAuthContext
 77205  	_iNewParent = int32(-1)
 77206  	_isLeftJoin = int32(0)
 77207  	_db = (*Xsqlite3)(_pParse.Xdb)
 77208  	func() {
 77209  		if _p == nil {
 77210  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119953), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(807)))
 77211  			crt.X__builtin_abort(tls)
 77212  		}
 77213  	}()
 77214  	func() {
 77215  		if (*XSelect)(_p.XpPrior) != nil {
 77216  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119954), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(97765)))
 77217  			crt.X__builtin_abort(tls)
 77218  		}
 77219  	}()
 77220  	if (int32(_db.XdbOptFlags) & int32(1)) != int32(0) {
 77221  		return int32(0)
 77222  	}
 77223  	_pSrc = (*XSrcList)(_p.XpSrc)
 77224  	func() {
 77225  		if _pSrc == nil || _iFrom < int32(0) || _iFrom >= _pSrc.XnSrc {
 77226  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119957), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(97778)))
 77227  			crt.X__builtin_abort(tls)
 77228  		}
 77229  	}()
 77230  	_pSubitem = elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_iFrom))
 77231  	_iParent = _pSubitem.XiCursor
 77232  	_pSub = (*XSelect)(_pSubitem.XpSelect)
 77233  	func() {
 77234  		if _pSub == nil {
 77235  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119961), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(97815)))
 77236  			crt.X__builtin_abort(tls)
 77237  		}
 77238  	}()
 77239  	if _subqueryIsAgg == 0 {
 77240  		goto _11
 77241  	}
 77242  	if _isAgg != 0 {
 77243  		return int32(0)
 77244  	}
 77245  	if _pSrc.XnSrc > int32(1) {
 77246  		return int32(0)
 77247  	}
 77248  	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)) {
 77249  		return int32(0)
 77250  	}
 77251  _11:
 77252  	_pSubSrc = (*XSrcList)(_pSub.XpSrc)
 77253  	func() {
 77254  		if _pSubSrc == nil {
 77255  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119974), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(97823)))
 77256  			crt.X__builtin_abort(tls)
 77257  		}
 77258  	}()
 77259  	if (_pSub.XpLimit != nil) && (_p.XpLimit != nil) {
 77260  		return int32(0)
 77261  	}
 77262  	if _pSub.XpOffset != nil {
 77263  		return int32(0)
 77264  	}
 77265  	if ((_p.XselFlags & uint32(256)) != (0)) && (_pSub.XpLimit != nil) {
 77266  		return int32(0)
 77267  	}
 77268  	if _pSubSrc.XnSrc == int32(0) {
 77269  		return int32(0)
 77270  	}
 77271  	if (_pSub.XselFlags & uint32(1)) != 0 {
 77272  		return int32(0)
 77273  	}
 77274  	if (_pSub.XpLimit != nil) && ((_pSrc.XnSrc > int32(1)) || _isAgg != 0) {
 77275  		return int32(0)
 77276  	}
 77277  	if ((_p.XselFlags & uint32(1)) != (0)) && _subqueryIsAgg != 0 {
 77278  		return int32(0)
 77279  	}
 77280  	if (_p.XpOrderBy != nil) && (_pSub.XpOrderBy != nil) {
 77281  		return int32(0)
 77282  	}
 77283  	if _isAgg != 0 && (_pSub.XpOrderBy != nil) {
 77284  		return int32(0)
 77285  	}
 77286  	if (_pSub.XpLimit != nil) && (_p.XpWhere != nil) {
 77287  		return int32(0)
 77288  	}
 77289  	if (_pSub.XpLimit != nil) && ((_p.XselFlags & uint32(1)) != (0)) {
 77290  		return int32(0)
 77291  	}
 77292  	if (_pSub.XselFlags & uint32(12288)) != 0 {
 77293  		return int32(0)
 77294  	}
 77295  	if ((_p.XselFlags & uint32(8192)) != 0) && (_pSub.XpPrior != nil) {
 77296  		return int32(0)
 77297  	}
 77298  	if (int32(_pSubitem.Xfg.Xjointype) & int32(32)) == int32(0) {
 77299  		goto _43
 77300  	}
 77301  	_isLeftJoin = int32(1)
 77302  	if (_pSubSrc.XnSrc > int32(1)) || _isAgg != 0 {
 77303  		return int32(0)
 77304  	}
 77305  _43:
 77306  	if _pSub.XpPrior == nil {
 77307  		goto _46
 77308  	}
 77309  	if _pSub.XpOrderBy != nil {
 77310  		return int32(0)
 77311  	}
 77312  	if (_isAgg != 0 || ((_p.XselFlags & uint32(1)) != (0))) || (_pSrc.XnSrc != int32(1)) {
 77313  		return int32(0)
 77314  	}
 77315  	_pSub1 = _pSub
 77316  _51:
 77317  	if _pSub1 == nil {
 77318  		goto _54
 77319  	}
 77320  	func() {
 77321  		if (*XSrcList)(_pSub.XpSrc) == nil {
 77322  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120059), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(97831)))
 77323  			crt.X__builtin_abort(tls)
 77324  		}
 77325  	}()
 77326  	func() {
 77327  		if ((*XExprList)(_pSub.XpEList).XnExpr) != ((*XExprList)(_pSub1.XpEList).XnExpr) {
 77328  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120060), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(97845)))
 77329  			crt.X__builtin_abort(tls)
 77330  		}
 77331  	}()
 77332  	if (((_pSub1.XselFlags & uint32(9)) != (0)) || ((_pSub1.XpPrior != nil) && (int32(_pSub1.Xop) != int32(116)))) || (((*XSrcList)(_pSub1.XpSrc).XnSrc) < int32(1)) {
 77333  		return int32(0)
 77334  	}
 77335  	_pSub1 = (*XSelect)(_pSub1.XpPrior)
 77336  	goto _51
 77337  _54:
 77338  	if _p.XpOrderBy == nil {
 77339  		goto _63
 77340  	}
 77341  	_17_ii = int32(0)
 77342  _64:
 77343  	if _17_ii >= ((*XExprList)(_p.XpOrderBy).XnExpr) {
 77344  		goto _67
 77345  	}
 77346  	if int32((*t71)(unsafe.Pointer(&(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.XpOrderBy).Xa))), uintptr(_17_ii)).Xu))).XiOrderByCol) == int32(0) {
 77347  		return int32(0)
 77348  	}
 77349  	_17_ii += 1
 77350  	goto _64
 77351  _67:
 77352  _63:
 77353  _46:
 77354  	if (Xsqlite3SelectTrace & int32(1)) != 0 {
 77355  		_sqlite3DebugPrintf(tls, func() *int8 {
 77356  			_sqlite3DebugPrintf(tls, str(45615), (_pParse.XnSelectIndent*int32(2))-int32(2), unsafe.Pointer(str(284)), unsafe.Pointer(&_p.XzSelName), unsafe.Pointer(_p))
 77357  			return str(97887)
 77358  		}(), unsafe.Pointer(&_pSub.XzSelName), unsafe.Pointer(_pSub), _iFrom)
 77359  	}
 77360  	_pParse.XzAuthContext = _pSubitem.XzName
 77361  	_i = _sqlite3AuthCheck(tls, _pParse, int32(21), nil, nil, nil)
 77362  	_pParse.XzAuthContext = _zSavedAuthContext
 77363  	_pSub = (*XSelect)(_pSub.XpPrior)
 77364  _70:
 77365  	if _pSub == nil {
 77366  		goto _73
 77367  	}
 77368  	_19_pOrderBy = (*XExprList)(_p.XpOrderBy)
 77369  	_19_pLimit = (*XExpr)(_p.XpLimit)
 77370  	_19_pOffset = (*XExpr)(_p.XpOffset)
 77371  	_19_pPrior = (*XSelect)(_p.XpPrior)
 77372  	*(**XExprList)(unsafe.Pointer(&_p.XpOrderBy)) = nil
 77373  	*(**XSrcList)(unsafe.Pointer(&_p.XpSrc)) = nil
 77374  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = nil
 77375  	*(**XExpr)(unsafe.Pointer(&_p.XpLimit)) = nil
 77376  	*(**XExpr)(unsafe.Pointer(&_p.XpOffset)) = nil
 77377  	_19_pNew = _sqlite3SelectDup(tls, _db, _p, int32(0))
 77378  	_sqlite3SelectSetName(tls, _19_pNew, (*int8)(unsafe.Pointer(&_pSub.XzSelName)))
 77379  	*(**XExpr)(unsafe.Pointer(&_p.XpOffset)) = _19_pOffset
 77380  	*(**XExpr)(unsafe.Pointer(&_p.XpLimit)) = _19_pLimit
 77381  	*(**XExprList)(unsafe.Pointer(&_p.XpOrderBy)) = _19_pOrderBy
 77382  	*(**XSrcList)(unsafe.Pointer(&_p.XpSrc)) = _pSrc
 77383  	_p.Xop = uint8(116)
 77384  	if _19_pNew == nil {
 77385  		*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = _19_pPrior
 77386  		goto _75
 77387  	}
 77388  	*(**XSelect)(unsafe.Pointer(&_19_pNew.XpPrior)) = _19_pPrior
 77389  	if _19_pPrior != nil {
 77390  		*(**XSelect)(unsafe.Pointer(&_19_pPrior.XpNext)) = _19_pNew
 77391  	}
 77392  	*(**XSelect)(unsafe.Pointer(&_19_pNew.XpNext)) = _p
 77393  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = _19_pNew
 77394  	if (Xsqlite3SelectTrace & int32(2)) != 0 {
 77395  		_sqlite3DebugPrintf(tls, func() *int8 {
 77396  			_sqlite3DebugPrintf(tls, str(45615), (_pParse.XnSelectIndent*int32(2))-int32(2), unsafe.Pointer(str(284)), unsafe.Pointer(&_p.XzSelName), unsafe.Pointer(_p))
 77397  			return str(97915)
 77398  		}(), unsafe.Pointer(&_19_pNew.XzSelName), unsafe.Pointer(_19_pNew))
 77399  	}
 77400  _75:
 77401  	if _db.XmallocFailed != 0 {
 77402  		return int32(1)
 77403  	}
 77404  	_pSub = (*XSelect)(_pSub.XpPrior)
 77405  	goto _70
 77406  _73:
 77407  	_pSub = store97(&_pSub1, (*XSelect)(_pSubitem.XpSelect))
 77408  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pSubitem.XzDatabase))
 77409  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pSubitem.XzName))
 77410  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pSubitem.XzAlias))
 77411  	_pSubitem.XzDatabase = nil
 77412  	_pSubitem.XzName = nil
 77413  	_pSubitem.XzAlias = nil
 77414  	*(**XSelect)(unsafe.Pointer(&_pSubitem.XpSelect)) = nil
 77415  	if func() int32 {
 77416  		if (*XTable)(_pSubitem.XpTab) != nil {
 77417  			return int32(1)
 77418  		}
 77419  		return func() int32 {
 77420  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120177), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(4809)))
 77421  			crt.X__builtin_abort(tls)
 77422  			return int32(0)
 77423  		}()
 77424  	}() == 0 {
 77425  		goto _81
 77426  	}
 77427  	_22_pTabToDel = (*XTable)(_pSubitem.XpTab)
 77428  	if _22_pTabToDel.XnTabRef == uint32(1) {
 77429  		_23_pToplevel = func() *XParse {
 77430  			if _pParse.XpToplevel != nil {
 77431  				return (*XParse)(_pParse.XpToplevel)
 77432  			}
 77433  			return _pParse
 77434  		}()
 77435  		*(**XTable)(unsafe.Pointer(&_22_pTabToDel.XpNextZombie)) = (*XTable)(_23_pToplevel.XpZombieTab)
 77436  		*(**XTable)(unsafe.Pointer(&_23_pToplevel.XpZombieTab)) = _22_pTabToDel
 77437  		goto _85
 77438  	}
 77439  	_22_pTabToDel.XnTabRef -= 1
 77440  _85:
 77441  	*(**XTable)(unsafe.Pointer(&_pSubitem.XpTab)) = nil
 77442  _81:
 77443  	_pParent = _p
 77444  _86:
 77445  	if _pParent == nil {
 77446  		goto _89
 77447  	}
 77448  	_25_jointype = 0
 77449  	_pSubSrc = (*XSrcList)(_pSub.XpSrc)
 77450  	_25_nSubSrc = _pSubSrc.XnSrc
 77451  	_pSrc = (*XSrcList)(_pParent.XpSrc)
 77452  	if _pSrc != nil {
 77453  		func() {
 77454  			if _pParent != _p {
 77455  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120210), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(97966)))
 77456  				crt.X__builtin_abort(tls)
 77457  			}
 77458  		}()
 77459  		_25_jointype = _pSubitem.Xfg.Xjointype
 77460  		goto _93
 77461  	}
 77462  	func() {
 77463  		if _pParent == _p {
 77464  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120213), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(97977)))
 77465  			crt.X__builtin_abort(tls)
 77466  		}
 77467  	}()
 77468  	_pSrc = store98((**XSrcList)(unsafe.Pointer(&_pParent.XpSrc)), _sqlite3SrcListAppend(tls, _db, nil, nil, nil))
 77469  	if _pSrc == nil {
 77470  		func() {
 77471  			if _db.XmallocFailed == 0 {
 77472  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120216), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(47803)))
 77473  				crt.X__builtin_abort(tls)
 77474  			}
 77475  		}()
 77476  		goto _89
 77477  	}
 77478  _93:
 77479  	if _25_nSubSrc <= int32(1) {
 77480  		goto _99
 77481  	}
 77482  	*(**XSrcList)(unsafe.Pointer(&_pParent.XpSrc)) = store98(&_pSrc, _sqlite3SrcListEnlarge(tls, _db, _pSrc, _25_nSubSrc-int32(1), _iFrom+int32(1)))
 77483  	if _db.XmallocFailed != 0 {
 77484  		goto _89
 77485  	}
 77486  _99:
 77487  	_i = int32(0)
 77488  _101:
 77489  	if _i >= _25_nSubSrc {
 77490  		goto _104
 77491  	}
 77492  	_sqlite3IdListDelete(tls, _db, (*XIdList)(elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_i+_iFrom)).XpUsing))
 77493  	func() {
 77494  		if int32((uint32(((elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_i+_iFrom)).Xfg).XnotIndexed)>>2)<<31)>>31) != int32(0) {
 77495  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120248), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(97988)))
 77496  			crt.X__builtin_abort(tls)
 77497  		}
 77498  	}()
 77499  	*elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_i+_iFrom)) = *elem6((*TSrcList_item)(unsafe.Pointer(&_pSubSrc.Xa)), uintptr(_i))
 77500  	_iNewParent = elem6((*TSrcList_item)(unsafe.Pointer(&_pSubSrc.Xa)), uintptr(_i)).XiCursor
 77501  	crt.Xmemset(tls, unsafe.Pointer(elem6((*TSrcList_item)(unsafe.Pointer(&_pSubSrc.Xa)), uintptr(_i))), int32(0), uint32(68))
 77502  	_i += 1
 77503  	goto _101
 77504  _104:
 77505  	(elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_iFrom)).Xfg).Xjointype = _25_jointype
 77506  	_pList = (*XExprList)(_pParent.XpEList)
 77507  	_i = int32(0)
 77508  _107:
 77509  	if _i >= _pList.XnExpr {
 77510  		goto _110
 77511  	}
 77512  	if (elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_i)).XzName) == nil {
 77513  		_33_zName = _sqlite3DbStrDup(tls, _db, elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_i)).XzSpan)
 77514  		_sqlite3Dequote(tls, _33_zName)
 77515  		elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_i)).XzName = _33_zName
 77516  	}
 77517  	_i += 1
 77518  	goto _107
 77519  _110:
 77520  	if _pSub.XpOrderBy == nil {
 77521  		goto _112
 77522  	}
 77523  	_34_pOrderBy = (*XExprList)(_pSub.XpOrderBy)
 77524  	_i = int32(0)
 77525  _113:
 77526  	if _i >= _34_pOrderBy.XnExpr {
 77527  		goto _116
 77528  	}
 77529  	(*t71)(unsafe.Pointer(&(elem57((*TExprList_item)(unsafe.Pointer(&_34_pOrderBy.Xa)), uintptr(_i)).Xu))).XiOrderByCol = 0
 77530  	_i += 1
 77531  	goto _113
 77532  _116:
 77533  	func() {
 77534  		if (*XExprList)(_pParent.XpOrderBy) != nil {
 77535  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120290), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(98021)))
 77536  			crt.X__builtin_abort(tls)
 77537  		}
 77538  	}()
 77539  	func() {
 77540  		if (*XSelect)(_pSub.XpPrior) != nil {
 77541  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120291), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(98042)))
 77542  			crt.X__builtin_abort(tls)
 77543  		}
 77544  	}()
 77545  	*(**XExprList)(unsafe.Pointer(&_pParent.XpOrderBy)) = _34_pOrderBy
 77546  	*(**XExprList)(unsafe.Pointer(&_pSub.XpOrderBy)) = nil
 77547  _112:
 77548  	_pWhere = _sqlite3ExprDup(tls, _db, (*XExpr)(_pSub.XpWhere), int32(0))
 77549  	if _isLeftJoin > int32(0) {
 77550  		_setJoinExpr(tls, _pWhere, _iNewParent)
 77551  	}
 77552  	if _subqueryIsAgg != 0 {
 77553  		func() {
 77554  			if (*XExpr)(_pParent.XpHaving) != nil {
 77555  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120300), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(98058)))
 77556  				crt.X__builtin_abort(tls)
 77557  			}
 77558  		}()
 77559  		*(**XExpr)(unsafe.Pointer(&_pParent.XpHaving)) = (*XExpr)(_pParent.XpWhere)
 77560  		*(**XExpr)(unsafe.Pointer(&_pParent.XpWhere)) = _pWhere
 77561  		*(**XExpr)(unsafe.Pointer(&_pParent.XpHaving)) = _sqlite3ExprAnd(tls, _db, _sqlite3ExprDup(tls, _db, (*XExpr)(_pSub.XpHaving), int32(0)), (*XExpr)(_pParent.XpHaving))
 77562  		func() {
 77563  			if (*XExprList)(_pParent.XpGroupBy) != nil {
 77564  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120306), unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000), unsafe.Pointer(str(98078)))
 77565  				crt.X__builtin_abort(tls)
 77566  			}
 77567  		}()
 77568  		*(**XExprList)(unsafe.Pointer(&_pParent.XpGroupBy)) = _sqlite3ExprListDup(tls, _db, (*XExprList)(_pSub.XpGroupBy), int32(0))
 77569  		goto _127
 77570  	}
 77571  	*(**XExpr)(unsafe.Pointer(&_pParent.XpWhere)) = _sqlite3ExprAnd(tls, _db, _pWhere, (*XExpr)(_pParent.XpWhere))
 77572  _127:
 77573  	if int32(_db.XmallocFailed) == int32(0) {
 77574  		*(**XParse)(unsafe.Pointer(&_39_x.XpParse)) = _pParse
 77575  		_39_x.XiTable = _iParent
 77576  		_39_x.XiNewTable = _iNewParent
 77577  		_39_x.XisLeftJoin = _isLeftJoin
 77578  		*(**XExprList)(unsafe.Pointer(&_39_x.XpEList)) = (*XExprList)(_pSub.XpEList)
 77579  		_substSelect(tls, &_39_x, _pParent, int32(0))
 77580  	}
 77581  	_pParent.XselFlags |= _pSub.XselFlags & uint32(1)
 77582  	if _pSub.XpLimit != nil {
 77583  		*(**XExpr)(unsafe.Pointer(&_pParent.XpLimit)) = (*XExpr)(_pSub.XpLimit)
 77584  		*(**XExpr)(unsafe.Pointer(&_pSub.XpLimit)) = nil
 77585  	}
 77586  	*func() **XSelect { _pParent = (*XSelect)(_pParent.XpPrior); return &_pSub }() = (*XSelect)(_pSub.XpPrior)
 77587  	goto _86
 77588  _89:
 77589  	_sqlite3SelectDelete(tls, _db, _pSub1)
 77590  	if (Xsqlite3SelectTrace & int32(256)) == 0 {
 77591  		goto _130
 77592  	}
 77593  	if (Xsqlite3SelectTrace & int32(256)) != 0 {
 77594  		_sqlite3DebugPrintf(tls, func() *int8 {
 77595  			_sqlite3DebugPrintf(tls, str(45615), (_pParse.XnSelectIndent*int32(2))-int32(2), unsafe.Pointer(str(284)), unsafe.Pointer(&_p.XzSelName), unsafe.Pointer(_p))
 77596  			return str(98099)
 77597  		}())
 77598  	}
 77599  	_sqlite3TreeViewSelect(tls, nil, _p, 0)
 77600  _130:
 77601  	return int32(1)
 77602  }
 77603  
 77604  var _flattenSubqueryØ00__func__Ø000 [16]int8
 77605  
 77606  func init() {
 77607  	crt.Xstrncpy(nil, &_flattenSubqueryØ00__func__Ø000[0], str(98118), 16)
 77608  }
 77609  
 77610  func _substSelect(tls *crt.TLS, _pSubst *XSubstContext, _p *XSelect, _doPrior int32) {
 77611  	var _i int32
 77612  	var _pSrc *XSrcList
 77613  	var _pItem *TSrcList_item
 77614  	if _p == nil {
 77615  		return
 77616  	}
 77617  _0:
 77618  	_substExprList(tls, _pSubst, (*XExprList)(_p.XpEList))
 77619  	_substExprList(tls, _pSubst, (*XExprList)(_p.XpGroupBy))
 77620  	_substExprList(tls, _pSubst, (*XExprList)(_p.XpOrderBy))
 77621  	*(**XExpr)(unsafe.Pointer(&_p.XpHaving)) = _substExpr(tls, _pSubst, (*XExpr)(_p.XpHaving))
 77622  	*(**XExpr)(unsafe.Pointer(&_p.XpWhere)) = _substExpr(tls, _pSubst, (*XExpr)(_p.XpWhere))
 77623  	_pSrc = (*XSrcList)(_p.XpSrc)
 77624  	func() {
 77625  		if _pSrc == nil {
 77626  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119777), unsafe.Pointer(&_substSelectØ00__func__Ø000), unsafe.Pointer(str(47776)))
 77627  			crt.X__builtin_abort(tls)
 77628  		}
 77629  	}()
 77630  	*func() **TSrcList_item { _i = _pSrc.XnSrc; return &_pItem }() = (*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa))
 77631  _4:
 77632  	if _i <= int32(0) {
 77633  		goto _7
 77634  	}
 77635  	_substSelect(tls, _pSubst, (*XSelect)(_pItem.XpSelect), int32(1))
 77636  	if ((uint32((_pItem.Xfg.XnotIndexed)>>2) << 31) >> 31) != 0 {
 77637  		_substExprList(tls, _pSubst, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pItem.Xu1))))
 77638  	}
 77639  	*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i -= 1; return &_pItem }())) += uintptr(68)
 77640  	goto _4
 77641  _7:
 77642  	if _doPrior != 0 && (store97(&_p, (*XSelect)(_p.XpPrior)) != nil) {
 77643  		goto _0
 77644  	}
 77645  }
 77646  
 77647  // C comment
 77648  //  /* Forward Declarations */
 77649  func _substExprList(tls *crt.TLS, _pSubst *XSubstContext, _pList *XExprList) {
 77650  	var _i int32
 77651  	if _pList == nil {
 77652  		return
 77653  	}
 77654  	_i = int32(0)
 77655  _1:
 77656  	if _i >= _pList.XnExpr {
 77657  		goto _4
 77658  	}
 77659  	*(**XExpr)(unsafe.Pointer(&(elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_i)).XpExpr))) = _substExpr(tls, _pSubst, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_i)).XpExpr))
 77660  	_i += 1
 77661  	goto _1
 77662  _4:
 77663  }
 77664  
 77665  // C comment
 77666  //  /*
 77667  //  ** Scan through the expression pExpr.  Replace every reference to
 77668  //  ** a column in table number iTable with a copy of the iColumn-th
 77669  //  ** entry in pEList.  (But leave references to the ROWID column
 77670  //  ** unchanged.)
 77671  //  **
 77672  //  ** This routine is part of the flattening procedure.  A subquery
 77673  //  ** whose result set is defined by pEList appears as entry in the
 77674  //  ** FROM clause of a SELECT such that the VDBE cursor assigned to that
 77675  //  ** FORM clause entry is iTable.  This routine makes the necessary
 77676  //  ** changes to pExpr so that it refers directly to the source table
 77677  //  ** of the subquery rather the result set of the subquery.
 77678  //  */
 77679  func _substExpr(tls *crt.TLS, _pSubst *XSubstContext, _pExpr *XExpr) (r0 *XExpr) {
 77680  	var _6_db *Xsqlite3
 77681  	var _4_pNew, _4_pCopy *XExpr
 77682  	var _4_ifNullRow XExpr
 77683  	if _pExpr == nil {
 77684  		return nil
 77685  	}
 77686  	if ((_pExpr.Xflags & uint32(1)) != (0)) && (int32(_pExpr.XiRightJoinTable) == _pSubst.XiTable) {
 77687  		_pExpr.XiRightJoinTable = int16(_pSubst.XiNewTable)
 77688  	}
 77689  	if int32(_pExpr.Xop) != int32(152) || _pExpr.XiTable != _pSubst.XiTable {
 77690  		goto _4
 77691  	}
 77692  	if int32(_pExpr.XiColumn) < int32(0) {
 77693  		_pExpr.Xop = uint8(101)
 77694  		goto _6
 77695  	}
 77696  	_4_pCopy = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSubst.XpEList).Xa))), uintptr(_pExpr.XiColumn)).XpExpr)
 77697  	func() {
 77698  		if (*XExprList)(_pSubst.XpEList) == nil || int32(_pExpr.XiColumn) >= ((*XExprList)(_pSubst.XpEList).XnExpr) {
 77699  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119715), unsafe.Pointer(&_substExprØ00__func__Ø000), unsafe.Pointer(str(98134)))
 77700  			crt.X__builtin_abort(tls)
 77701  		}
 77702  	}()
 77703  	func() {
 77704  		if (*XExpr)(_pExpr.XpLeft) != nil || (*XExpr)(_pExpr.XpRight) != nil {
 77705  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119716), unsafe.Pointer(&_substExprØ00__func__Ø000), unsafe.Pointer(str(96251)))
 77706  			crt.X__builtin_abort(tls)
 77707  		}
 77708  	}()
 77709  	if _sqlite3ExprIsVector(tls, _4_pCopy) != 0 {
 77710  		_sqlite3VectorErrorMsg(tls, (*XParse)(_pSubst.XpParse), _4_pCopy)
 77711  		goto _14
 77712  	}
 77713  	_6_db = (*Xsqlite3)((*XParse)(_pSubst.XpParse).Xdb)
 77714  	if _pSubst.XisLeftJoin != 0 && (int32(_4_pCopy.Xop) != int32(152)) {
 77715  		crt.Xmemset(tls, unsafe.Pointer(&_4_ifNullRow), int32(0), uint32(48))
 77716  		_4_ifNullRow.Xop = uint8(160)
 77717  		*(**XExpr)(unsafe.Pointer(&_4_ifNullRow.XpLeft)) = _4_pCopy
 77718  		_4_ifNullRow.XiTable = _pSubst.XiNewTable
 77719  		_4_pCopy = &_4_ifNullRow
 77720  	}
 77721  	_4_pNew = _sqlite3ExprDup(tls, _6_db, _4_pCopy, int32(0))
 77722  	if (_4_pNew != nil) && ((_pExpr.Xflags & uint32(1)) != 0) {
 77723  		_4_pNew.XiRightJoinTable = _pExpr.XiRightJoinTable
 77724  		_4_pNew.Xflags |= uint32(1)
 77725  	}
 77726  	_sqlite3ExprDelete(tls, _6_db, _pExpr)
 77727  	_pExpr = _4_pNew
 77728  _14:
 77729  _6:
 77730  	goto _19
 77731  _4:
 77732  	if (int32(_pExpr.Xop) == int32(160)) && (_pExpr.XiTable == _pSubst.XiTable) {
 77733  		_pExpr.XiTable = _pSubst.XiNewTable
 77734  	}
 77735  	*(**XExpr)(unsafe.Pointer(&_pExpr.XpLeft)) = _substExpr(tls, _pSubst, (*XExpr)(_pExpr.XpLeft))
 77736  	*(**XExpr)(unsafe.Pointer(&_pExpr.XpRight)) = _substExpr(tls, _pSubst, (*XExpr)(_pExpr.XpRight))
 77737  	if (_pExpr.Xflags & uint32(2048)) != (0) {
 77738  		_substSelect(tls, _pSubst, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))), int32(1))
 77739  		goto _23
 77740  	}
 77741  	_substExprList(tls, _pSubst, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))))
 77742  _23:
 77743  _19:
 77744  	return _pExpr
 77745  }
 77746  
 77747  var _substExprØ00__func__Ø000 [10]int8
 77748  
 77749  func init() {
 77750  	crt.Xstrncpy(nil, &_substExprØ00__func__Ø000[0], str(98192), 10)
 77751  }
 77752  
 77753  func _sqlite3VectorErrorMsg(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) {
 77754  	if (_pExpr.Xflags & uint32(2048)) != 0 {
 77755  		_sqlite3SubselectError(tls, _pParse, (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).XpEList).XnExpr, int32(1))
 77756  		goto _1
 77757  	}
 77758  	_sqlite3ErrorMsg(tls, _pParse, str(43136))
 77759  _1:
 77760  }
 77761  
 77762  func _sqlite3SubselectError(tls *crt.TLS, _pParse *XParse, _nActual int32, _nExpect int32) {
 77763  	var _zFmt *int8
 77764  	_zFmt = str(98202)
 77765  	_sqlite3ErrorMsg(tls, _pParse, _zFmt, _nActual, _nExpect)
 77766  }
 77767  
 77768  var _substSelectØ00__func__Ø000 [12]int8
 77769  
 77770  func init() {
 77771  	crt.Xstrncpy(nil, &_substSelectØ00__func__Ø000[0], str(98246), 12)
 77772  }
 77773  
 77774  // C comment
 77775  //  /*
 77776  //  ** This routine is called to process a compound query form from
 77777  //  ** two or more separate queries using UNION, UNION ALL, EXCEPT, or
 77778  //  ** INTERSECT
 77779  //  **
 77780  //  ** "p" points to the right-most of the two queries.  the query on the
 77781  //  ** left is p->pPrior.  The left query could also be a compound query
 77782  //  ** in which case this routine will be called recursively.
 77783  //  **
 77784  //  ** The results of the total query are to be written into a destination
 77785  //  ** of type eDest with parameter iParm.
 77786  //  **
 77787  //  ** Example 1:  Consider a three-way compound SQL statement.
 77788  //  **
 77789  //  **     SELECT a FROM t1 UNION SELECT b FROM t2 UNION SELECT c FROM t3
 77790  //  **
 77791  //  ** This statement is parsed up as follows:
 77792  //  **
 77793  //  **     SELECT c FROM t3
 77794  //  **      |
 77795  //  **      `----->  SELECT b FROM t2
 77796  //  **                |
 77797  //  **                `------>  SELECT a FROM t1
 77798  //  **
 77799  //  ** The arrows in the diagram above represent the Select.pPrior pointer.
 77800  //  ** So if this routine is called with p equal to the t3 query, then
 77801  //  ** pPrior will be the t2 query.  p->op will be TK_UNION in this case.
 77802  //  **
 77803  //  ** Notice that because of the way SQLite parses compound SELECTs, the
 77804  //  ** individual selects always group from left to right.
 77805  //  */
 77806  func _multiSelect(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectDest) (r0 int32) {
 77807  	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
 77808  	var _14_op uint8
 77809  	var _db *Xsqlite3
 77810  	var _v *TVdbe
 77811  	var _pPrior, _pDelete, _22_pFirst, _25_pFirst, _26_pLoop *XSelect
 77812  	var _14_pLimit, _14_pOffset, _23_pLimit, _23_pOffset *XExpr
 77813  	var _26_pKeyInfo *XKeyInfo
 77814  	var _26_apColl **XCollSeq
 77815  	var _dest, _14_uniondest, _23_intersectdest XSelectDest
 77816  	_rc = int32(0)
 77817  	_pDelete = nil
 77818  	_iSub1 = int32(0)
 77819  	_iSub2 = int32(0)
 77820  	func() {
 77821  		if _p == nil || _p.XpPrior == nil {
 77822  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118776), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98258)))
 77823  			crt.X__builtin_abort(tls)
 77824  		}
 77825  	}()
 77826  	func() {
 77827  		if (_p.XselFlags&uint32(8192)) != (0) && int32(_p.Xop) != int32(116) && int32(_p.Xop) != int32(115) {
 77828  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118777), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98273)))
 77829  			crt.X__builtin_abort(tls)
 77830  		}
 77831  	}()
 77832  	_db = (*Xsqlite3)(_pParse.Xdb)
 77833  	_pPrior = (*XSelect)(_p.XpPrior)
 77834  	_dest = *_pDest
 77835  	if _pPrior.XpOrderBy != nil {
 77836  		_sqlite3ErrorMsg(tls, _pParse, str(98341), unsafe.Pointer(_selectOpName(tls, int32(_p.Xop))))
 77837  		_rc = int32(1)
 77838  		goto _multi_select_end
 77839  	}
 77840  	if _pPrior.XpLimit != nil {
 77841  		_sqlite3ErrorMsg(tls, _pParse, str(98389), unsafe.Pointer(_selectOpName(tls, int32(_p.Xop))))
 77842  		_rc = int32(1)
 77843  		goto _multi_select_end
 77844  	}
 77845  	_v = _sqlite3GetVdbe(tls, _pParse)
 77846  	func() {
 77847  		if _v == nil {
 77848  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118795), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(42019)))
 77849  			crt.X__builtin_abort(tls)
 77850  		}
 77851  	}()
 77852  	if int32(_dest.XeDest) == int32(12) {
 77853  		func() {
 77854  			if _p.XpEList == nil {
 77855  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118800), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98434)))
 77856  				crt.X__builtin_abort(tls)
 77857  			}
 77858  		}()
 77859  		_sqlite3VdbeAddOp2(tls, _v, int32(110), _dest.XiSDParm, (*XExprList)(_p.XpEList).XnExpr)
 77860  		_dest.XeDest = uint8(14)
 77861  	}
 77862  	if (_p.XselFlags & uint32(1024)) != 0 {
 77863  		_rc = _multiSelectValues(tls, _pParse, _p, &_dest)
 77864  		goto _multi_select_end
 77865  	}
 77866  	func() {
 77867  		if _p.XpEList == nil || _pPrior.XpEList == nil {
 77868  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118815), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98444)))
 77869  			crt.X__builtin_abort(tls)
 77870  		}
 77871  	}()
 77872  	func() {
 77873  		if ((*XExprList)(_p.XpEList).XnExpr) != ((*XExprList)(_pPrior.XpEList).XnExpr) {
 77874  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118816), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98472)))
 77875  			crt.X__builtin_abort(tls)
 77876  		}
 77877  	}()
 77878  	if (_p.XselFlags & uint32(8192)) != 0 {
 77879  		_generateWithRecursiveQuery(tls, _pParse, _p, &_dest)
 77880  		goto _39
 77881  	}
 77882  	if _p.XpOrderBy != nil {
 77883  		return _multiSelectOrderBy(tls, _pParse, _p, _pDest)
 77884  	}
 77885  	switch int32(_p.Xop) {
 77886  	case int32(115):
 77887  		goto _26
 77888  	case int32(116):
 77889  		goto _25
 77890  	case int32(117):
 77891  		goto _26
 77892  	default:
 77893  		goto _28
 77894  	}
 77895  
 77896  _25:
 77897  	_8_addr = int32(0)
 77898  	func() {
 77899  		if _pPrior.XpLimit != nil {
 77900  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118836), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98512)))
 77901  			crt.X__builtin_abort(tls)
 77902  		}
 77903  	}()
 77904  	_pPrior.XiLimit = _p.XiLimit
 77905  	_pPrior.XiOffset = _p.XiOffset
 77906  	*(**XExpr)(unsafe.Pointer(&_pPrior.XpLimit)) = (*XExpr)(_p.XpLimit)
 77907  	*(**XExpr)(unsafe.Pointer(&_pPrior.XpOffset)) = (*XExpr)(_p.XpOffset)
 77908  	_iSub1 = _pParse.XiNextSelectId
 77909  	_rc = _sqlite3Select(tls, _pParse, _pPrior, &_dest)
 77910  	*(**XExpr)(unsafe.Pointer(&_p.XpLimit)) = nil
 77911  	*(**XExpr)(unsafe.Pointer(&_p.XpOffset)) = nil
 77912  	if _rc != 0 {
 77913  		goto _multi_select_end
 77914  	}
 77915  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = nil
 77916  	_p.XiLimit = _pPrior.XiLimit
 77917  	_p.XiOffset = _pPrior.XiOffset
 77918  	if _p.XiLimit == 0 {
 77919  		goto _32
 77920  	}
 77921  	_8_addr = _sqlite3VdbeAddOp1(tls, _v, int32(22), _p.XiLimit)
 77922  	_sqlite3VdbeComment(tls, _v, str(98528))
 77923  	if _p.XiOffset != 0 {
 77924  		_sqlite3VdbeAddOp3(tls, _v, int32(149), _p.XiLimit, _p.XiOffset+int32(1), _p.XiOffset)
 77925  	}
 77926  _32:
 77927  	_iSub2 = _pParse.XiNextSelectId
 77928  	_rc = _sqlite3Select(tls, _pParse, _p, &_dest)
 77929  	_pDelete = (*XSelect)(_p.XpPrior)
 77930  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = _pPrior
 77931  	_p.XnSelectRow = _sqlite3LogEstAdd(tls, _p.XnSelectRow, _pPrior.XnSelectRow)
 77932  	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)))) {
 77933  		_p.XnSelectRow = _sqlite3LogEst(tls, uint64(_8_nLimit))
 77934  	}
 77935  	if _8_addr != 0 {
 77936  		_sqlite3VdbeJumpHere(tls, _v, _8_addr)
 77937  	}
 77938  	goto _39
 77939  _26:
 77940  	_14_op = uint8(0)
 77941  	_14_priorOp = int32(1)
 77942  	if int32(_dest.XeDest) == _14_priorOp {
 77943  		func() {
 77944  			if (*XExpr)(_p.XpLimit) != nil {
 77945  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118892), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98556)))
 77946  				crt.X__builtin_abort(tls)
 77947  			}
 77948  		}()
 77949  		func() {
 77950  			if (*XExpr)(_p.XpOffset) != nil {
 77951  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118893), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98569)))
 77952  				crt.X__builtin_abort(tls)
 77953  			}
 77954  		}()
 77955  		_14_unionTab = _dest.XiSDParm
 77956  		goto _45
 77957  	}
 77958  	_14_unionTab = postInc2(&_pParse.XnTab, 1)
 77959  	func() {
 77960  		if (*XExprList)(_p.XpOrderBy) != nil {
 77961  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118900), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98583)))
 77962  			crt.X__builtin_abort(tls)
 77963  		}
 77964  	}()
 77965  	_14_addr = _sqlite3VdbeAddOp2(tls, _v, int32(110), _14_unionTab, int32(0))
 77966  	func() {
 77967  		if (*elem8((*int32)(unsafe.Pointer(&_p.XaddrOpenEphm)), 0)) != int32(-1) {
 77968  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118902), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98598)))
 77969  			crt.X__builtin_abort(tls)
 77970  		}
 77971  	}()
 77972  	*elem8((*int32)(unsafe.Pointer(&_p.XaddrOpenEphm)), 0) = _14_addr
 77973  	_findRightmost(tls, _p).XselFlags |= uint32(32)
 77974  	func() {
 77975  		if _p.XpEList == nil {
 77976  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118905), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98434)))
 77977  			crt.X__builtin_abort(tls)
 77978  		}
 77979  	}()
 77980  _45:
 77981  	func() {
 77982  		if _pPrior.XpOrderBy != nil {
 77983  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118910), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98623)))
 77984  			crt.X__builtin_abort(tls)
 77985  		}
 77986  	}()
 77987  	_sqlite3SelectDestInit(tls, &_14_uniondest, _14_priorOp, _14_unionTab)
 77988  	_iSub1 = _pParse.XiNextSelectId
 77989  	_rc = _sqlite3Select(tls, _pParse, _pPrior, &_14_uniondest)
 77990  	if _rc != 0 {
 77991  		goto _multi_select_end
 77992  	}
 77993  	if int32(_p.Xop) == int32(117) {
 77994  		_14_op = uint8(2)
 77995  		goto _56
 77996  	}
 77997  	func() {
 77998  		if int32(_p.Xop) != int32(115) {
 77999  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118923), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98641)))
 78000  			crt.X__builtin_abort(tls)
 78001  		}
 78002  	}()
 78003  	_14_op = uint8(1)
 78004  _56:
 78005  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = nil
 78006  	_14_pLimit = (*XExpr)(_p.XpLimit)
 78007  	*(**XExpr)(unsafe.Pointer(&_p.XpLimit)) = nil
 78008  	_14_pOffset = (*XExpr)(_p.XpOffset)
 78009  	*(**XExpr)(unsafe.Pointer(&_p.XpOffset)) = nil
 78010  	_14_uniondest.XeDest = _14_op
 78011  	_iSub2 = _pParse.XiNextSelectId
 78012  	_rc = _sqlite3Select(tls, _pParse, _p, &_14_uniondest)
 78013  	_sqlite3ExprListDelete(tls, _db, (*XExprList)(_p.XpOrderBy))
 78014  	_pDelete = (*XSelect)(_p.XpPrior)
 78015  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = _pPrior
 78016  	*(**XExprList)(unsafe.Pointer(&_p.XpOrderBy)) = nil
 78017  	if int32(_p.Xop) == int32(115) {
 78018  		_p.XnSelectRow = _sqlite3LogEstAdd(tls, _p.XnSelectRow, _pPrior.XnSelectRow)
 78019  	}
 78020  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.XpLimit))
 78021  	*(**XExpr)(unsafe.Pointer(&_p.XpLimit)) = _14_pLimit
 78022  	*(**XExpr)(unsafe.Pointer(&_p.XpOffset)) = _14_pOffset
 78023  	_p.XiLimit = int32(0)
 78024  	_p.XiOffset = int32(0)
 78025  	func() {
 78026  		if _14_unionTab != _dest.XiSDParm && int32(_dest.XeDest) == _14_priorOp {
 78027  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118953), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98657)))
 78028  			crt.X__builtin_abort(tls)
 78029  		}
 78030  	}()
 78031  	if int32(_dest.XeDest) == _14_priorOp {
 78032  		goto _63
 78033  	}
 78034  	func() {
 78035  		if _p.XpEList == nil {
 78036  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118956), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98434)))
 78037  			crt.X__builtin_abort(tls)
 78038  		}
 78039  	}()
 78040  	if int32(_dest.XeDest) != int32(9) {
 78041  		goto _66
 78042  	}
 78043  	_22_pFirst = _p
 78044  _67:
 78045  	if _22_pFirst.XpPrior != nil {
 78046  		_22_pFirst = (*XSelect)(_22_pFirst.XpPrior)
 78047  		goto _67
 78048  	}
 78049  	_generateColumnNames(tls, _pParse, (*XSrcList)(_22_pFirst.XpSrc), (*XExprList)(_22_pFirst.XpEList))
 78050  _66:
 78051  	_21_iBreak = _sqlite3VdbeMakeLabel(tls, _v)
 78052  	_21_iCont = _sqlite3VdbeMakeLabel(tls, _v)
 78053  	_computeLimitRegisters(tls, _pParse, _p, _21_iBreak)
 78054  	_sqlite3VdbeAddOp2(tls, _v, int32(37), _14_unionTab, _21_iBreak)
 78055  	_21_iStart = _sqlite3VdbeCurrentAddr(tls, _v)
 78056  	_selectInnerLoop(tls, _pParse, _p, (*XExprList)(_p.XpEList), _14_unionTab, nil, nil, &_dest, _21_iCont, _21_iBreak)
 78057  	_sqlite3VdbeResolveLabel(tls, _v, _21_iCont)
 78058  	_sqlite3VdbeAddOp2(tls, _v, int32(7), _14_unionTab, _21_iStart)
 78059  	_sqlite3VdbeResolveLabel(tls, _v, _21_iBreak)
 78060  	_sqlite3VdbeAddOp2(tls, _v, int32(114), _14_unionTab, int32(0))
 78061  _63:
 78062  	goto _39
 78063  _28:
 78064  	func() {
 78065  		if int32(_p.Xop) != int32(118) {
 78066  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118976), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98703)))
 78067  			crt.X__builtin_abort(tls)
 78068  		}
 78069  	}()
 78070  	_23_tab1 = postInc2(&_pParse.XnTab, 1)
 78071  	_23_tab2 = postInc2(&_pParse.XnTab, 1)
 78072  	func() {
 78073  		if (*XExprList)(_p.XpOrderBy) != nil {
 78074  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118990), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98583)))
 78075  			crt.X__builtin_abort(tls)
 78076  		}
 78077  	}()
 78078  	_23_addr = _sqlite3VdbeAddOp2(tls, _v, int32(110), _23_tab1, int32(0))
 78079  	func() {
 78080  		if (*elem8((*int32)(unsafe.Pointer(&_p.XaddrOpenEphm)), 0)) != int32(-1) {
 78081  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118993), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98598)))
 78082  			crt.X__builtin_abort(tls)
 78083  		}
 78084  	}()
 78085  	*elem8((*int32)(unsafe.Pointer(&_p.XaddrOpenEphm)), 0) = _23_addr
 78086  	_findRightmost(tls, _p).XselFlags |= uint32(32)
 78087  	func() {
 78088  		if _p.XpEList == nil {
 78089  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118996), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98434)))
 78090  			crt.X__builtin_abort(tls)
 78091  		}
 78092  	}()
 78093  	_sqlite3SelectDestInit(tls, &_23_intersectdest, int32(1), _23_tab1)
 78094  	_iSub1 = _pParse.XiNextSelectId
 78095  	_rc = _sqlite3Select(tls, _pParse, _pPrior, &_23_intersectdest)
 78096  	if _rc != 0 {
 78097  		goto _multi_select_end
 78098  	}
 78099  	_23_addr = _sqlite3VdbeAddOp2(tls, _v, int32(110), _23_tab2, int32(0))
 78100  	func() {
 78101  		if (*elem8((*int32)(unsafe.Pointer(&_p.XaddrOpenEphm)), uintptr(1))) != int32(-1) {
 78102  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119010), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98723)))
 78103  			crt.X__builtin_abort(tls)
 78104  		}
 78105  	}()
 78106  	*elem8((*int32)(unsafe.Pointer(&_p.XaddrOpenEphm)), uintptr(1)) = _23_addr
 78107  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = nil
 78108  	_23_pLimit = (*XExpr)(_p.XpLimit)
 78109  	*(**XExpr)(unsafe.Pointer(&_p.XpLimit)) = nil
 78110  	_23_pOffset = (*XExpr)(_p.XpOffset)
 78111  	*(**XExpr)(unsafe.Pointer(&_p.XpOffset)) = nil
 78112  	_23_intersectdest.XiSDParm = _23_tab2
 78113  	_iSub2 = _pParse.XiNextSelectId
 78114  	_rc = _sqlite3Select(tls, _pParse, _p, &_23_intersectdest)
 78115  	_pDelete = (*XSelect)(_p.XpPrior)
 78116  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = _pPrior
 78117  	if int32(_p.XnSelectRow) > int32(_pPrior.XnSelectRow) {
 78118  		_p.XnSelectRow = _pPrior.XnSelectRow
 78119  	}
 78120  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.XpLimit))
 78121  	*(**XExpr)(unsafe.Pointer(&_p.XpLimit)) = _23_pLimit
 78122  	*(**XExpr)(unsafe.Pointer(&_p.XpOffset)) = _23_pOffset
 78123  	func() {
 78124  		if _p.XpEList == nil {
 78125  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119031), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98434)))
 78126  			crt.X__builtin_abort(tls)
 78127  		}
 78128  	}()
 78129  	if int32(_dest.XeDest) != int32(9) {
 78130  		goto _83
 78131  	}
 78132  	_25_pFirst = _p
 78133  _84:
 78134  	if _25_pFirst.XpPrior != nil {
 78135  		_25_pFirst = (*XSelect)(_25_pFirst.XpPrior)
 78136  		goto _84
 78137  	}
 78138  	_generateColumnNames(tls, _pParse, (*XSrcList)(_25_pFirst.XpSrc), (*XExprList)(_25_pFirst.XpEList))
 78139  _83:
 78140  	_23_iBreak = _sqlite3VdbeMakeLabel(tls, _v)
 78141  	_23_iCont = _sqlite3VdbeMakeLabel(tls, _v)
 78142  	_computeLimitRegisters(tls, _pParse, _p, _23_iBreak)
 78143  	_sqlite3VdbeAddOp2(tls, _v, int32(37), _23_tab1, _23_iBreak)
 78144  	_23_r1 = _sqlite3GetTempReg(tls, _pParse)
 78145  	_23_iStart = _sqlite3VdbeAddOp2(tls, _v, int32(124), _23_tab1, _23_r1)
 78146  	_sqlite3VdbeAddOp4Int(tls, _v, int32(29), _23_tab2, _23_iCont, _23_r1, int32(0))
 78147  	_sqlite3ReleaseTempReg(tls, _pParse, _23_r1)
 78148  	_selectInnerLoop(tls, _pParse, _p, (*XExprList)(_p.XpEList), _23_tab1, nil, nil, &_dest, _23_iCont, _23_iBreak)
 78149  	_sqlite3VdbeResolveLabel(tls, _v, _23_iCont)
 78150  	_sqlite3VdbeAddOp2(tls, _v, int32(7), _23_tab1, _23_iStart)
 78151  	_sqlite3VdbeResolveLabel(tls, _v, _23_iBreak)
 78152  	_sqlite3VdbeAddOp2(tls, _v, int32(114), _23_tab2, int32(0))
 78153  	_sqlite3VdbeAddOp2(tls, _v, int32(114), _23_tab1, int32(0))
 78154  	goto _39
 78155  _39:
 78156  	_explainComposite(tls, _pParse, int32(_p.Xop), _iSub1, _iSub2, bool2int(int32(_p.Xop) != int32(116)))
 78157  	if (_p.XselFlags & uint32(32)) == 0 {
 78158  		goto _multi_select_end
 78159  	}
 78160  	func() {
 78161  		if (*XSelect)(_p.XpNext) != nil {
 78162  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119074), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98748)))
 78163  			crt.X__builtin_abort(tls)
 78164  		}
 78165  	}()
 78166  	_26_nCol = (*XExprList)(_p.XpEList).XnExpr
 78167  	_26_pKeyInfo = _sqlite3KeyInfoAlloc(tls, _db, _26_nCol, int32(1))
 78168  	if _26_pKeyInfo == nil {
 78169  		_rc = _sqlite3NomemError(tls, int32(119078))
 78170  		goto _multi_select_end
 78171  	}
 78172  	*func() ***XCollSeq { _26_i = int32(0); return &_26_apColl }() = (**XCollSeq)(unsafe.Pointer(&_26_pKeyInfo.XaColl))
 78173  _90:
 78174  	if _26_i >= _26_nCol {
 78175  		goto _93
 78176  	}
 78177  	*_26_apColl = _multiSelectCollSeq(tls, _pParse, _p, _26_i)
 78178  	if nil == (*_26_apColl) {
 78179  		*_26_apColl = (*XCollSeq)(_db.XpDfltColl)
 78180  	}
 78181  	*(*uintptr)(unsafe.Pointer(func() ***XCollSeq { _26_i += 1; return &_26_apColl }())) += uintptr(4)
 78182  	goto _90
 78183  _93:
 78184  	_26_pLoop = _p
 78185  _95:
 78186  	if _26_pLoop == nil {
 78187  		goto _98
 78188  	}
 78189  	_26_i = int32(0)
 78190  _99:
 78191  	if _26_i >= int32(2) {
 78192  		goto _102
 78193  	}
 78194  	_31_addr = *elem8((*int32)(unsafe.Pointer(&_26_pLoop.XaddrOpenEphm)), uintptr(_26_i))
 78195  	if _31_addr < int32(0) {
 78196  		func() {
 78197  			if (*elem8((*int32)(unsafe.Pointer(&_26_pLoop.XaddrOpenEphm)), uintptr(1))) >= int32(0) {
 78198  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119094), unsafe.Pointer(&_multiSelectØ00__func__Ø000), unsafe.Pointer(str(98760)))
 78199  				crt.X__builtin_abort(tls)
 78200  			}
 78201  		}()
 78202  		goto _102
 78203  	}
 78204  	_sqlite3VdbeChangeP2(tls, _v, uint32(_31_addr), _26_nCol)
 78205  	_sqlite3VdbeChangeP4(tls, _v, _31_addr, (*int8)(unsafe.Pointer(_sqlite3KeyInfoRef(tls, _26_pKeyInfo))), int32(-5))
 78206  	*elem8((*int32)(unsafe.Pointer(&_26_pLoop.XaddrOpenEphm)), uintptr(_26_i)) = int32(-1)
 78207  	_26_i += 1
 78208  	goto _99
 78209  _102:
 78210  	_26_pLoop = (*XSelect)(_26_pLoop.XpPrior)
 78211  	goto _95
 78212  _98:
 78213  	_sqlite3KeyInfoUnref(tls, _26_pKeyInfo)
 78214  _multi_select_end:
 78215  	_pDest.XiSdst = _dest.XiSdst
 78216  	_pDest.XnSdst = _dest.XnSdst
 78217  	_sqlite3SelectDelete(tls, _db, _pDelete)
 78218  	return _rc
 78219  }
 78220  
 78221  var _multiSelectØ00__func__Ø000 [12]int8
 78222  
 78223  func init() {
 78224  	crt.Xstrncpy(nil, &_multiSelectØ00__func__Ø000[0], str(98785), 12)
 78225  }
 78226  
 78227  // C comment
 78228  //  /*
 78229  //  ** Handle the special case of a compound-select that originates from a
 78230  //  ** VALUES clause.  By handling this as a special case, we avoid deep
 78231  //  ** recursion, and thus do not need to enforce the SQLITE_LIMIT_COMPOUND_SELECT
 78232  //  ** on a VALUES clause.
 78233  //  **
 78234  //  ** Because the Select object originates from a VALUES clause:
 78235  //  **   (1) It has no LIMIT or OFFSET
 78236  //  **   (2) All terms are UNION ALL
 78237  //  **   (3) There is no ORDER BY clause
 78238  //  */
 78239  func _multiSelectValues(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectDest) (r0 int32) {
 78240  	var _nRow, _rc int32
 78241  	var _pPrior *XSelect
 78242  	_nRow = int32(1)
 78243  	_rc = int32(0)
 78244  	func() {
 78245  		if (_p.XselFlags & uint32(1024)) == 0 {
 78246  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118702), unsafe.Pointer(&_multiSelectValuesØ00__func__Ø000), unsafe.Pointer(str(98797)))
 78247  			crt.X__builtin_abort(tls)
 78248  		}
 78249  	}()
 78250  _2:
 78251  	func() {
 78252  		if (_p.XselFlags & uint32(512)) == 0 {
 78253  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118704), unsafe.Pointer(&_multiSelectValuesØ00__func__Ø000), unsafe.Pointer(str(98825)))
 78254  			crt.X__builtin_abort(tls)
 78255  		}
 78256  	}()
 78257  	func() {
 78258  		if int32(_p.Xop) != int32(116) && (int32(_p.Xop) != int32(119) || (*XSelect)(_p.XpPrior) != nil) {
 78259  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118705), unsafe.Pointer(&_multiSelectValuesØ00__func__Ø000), unsafe.Pointer(str(98849)))
 78260  			crt.X__builtin_abort(tls)
 78261  		}
 78262  	}()
 78263  	func() {
 78264  		if (*XExpr)(_p.XpLimit) != nil {
 78265  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118706), unsafe.Pointer(&_multiSelectValuesØ00__func__Ø000), unsafe.Pointer(str(98556)))
 78266  			crt.X__builtin_abort(tls)
 78267  		}
 78268  	}()
 78269  	func() {
 78270  		if (*XExpr)(_p.XpOffset) != nil {
 78271  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118707), unsafe.Pointer(&_multiSelectValuesØ00__func__Ø000), unsafe.Pointer(str(98569)))
 78272  			crt.X__builtin_abort(tls)
 78273  		}
 78274  	}()
 78275  	func() {
 78276  		if (*XSelect)(_p.XpNext) != nil && ((*XExprList)(_p.XpEList).XnExpr) != ((*XExprList)((*XSelect)(_p.XpNext).XpEList).XnExpr) {
 78277  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118708), unsafe.Pointer(&_multiSelectValuesØ00__func__Ø000), unsafe.Pointer(str(98901)))
 78278  			crt.X__builtin_abort(tls)
 78279  		}
 78280  	}()
 78281  	if (*XSelect)(_p.XpPrior) == nil {
 78282  		goto _17
 78283  	}
 78284  	func() {
 78285  		if (*XSelect)((*XSelect)(_p.XpPrior).XpNext) != _p {
 78286  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118710), unsafe.Pointer(&_multiSelectValuesØ00__func__Ø000), unsafe.Pointer(str(98958)))
 78287  			crt.X__builtin_abort(tls)
 78288  		}
 78289  	}()
 78290  	_p = (*XSelect)(_p.XpPrior)
 78291  	_nRow += 1
 78292  	goto _2
 78293  _17:
 78294  	if _p == nil {
 78295  		goto _21
 78296  	}
 78297  	_pPrior = (*XSelect)(_p.XpPrior)
 78298  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = nil
 78299  	_rc = _sqlite3Select(tls, _pParse, _p, _pDest)
 78300  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = _pPrior
 78301  	if _rc != 0 {
 78302  		goto _21
 78303  	}
 78304  	_p.XnSelectRow = int16(_nRow)
 78305  	_p = (*XSelect)(_p.XpNext)
 78306  	goto _17
 78307  _21:
 78308  	return _rc
 78309  }
 78310  
 78311  var _multiSelectValuesØ00__func__Ø000 [18]int8
 78312  
 78313  func init() {
 78314  	crt.Xstrncpy(nil, &_multiSelectValuesØ00__func__Ø000[0], str(98978), 18)
 78315  }
 78316  
 78317  // C comment
 78318  //  /*
 78319  //  ** This routine generates VDBE code to compute the content of a WITH RECURSIVE
 78320  //  ** query of the form:
 78321  //  **
 78322  //  **   <recursive-table> AS (<setup-query> UNION [ALL] <recursive-query>)
 78323  //  **                         \___________/             \_______________/
 78324  //  **                           p->pPrior                      p
 78325  //  **
 78326  //  **
 78327  //  ** There is exactly one reference to the recursive-table in the FROM clause
 78328  //  ** of recursive-query, marked with the SrcList->a[].fg.isRecursive flag.
 78329  //  **
 78330  //  ** The setup-query runs once to generate an initial set of rows that go
 78331  //  ** into a Queue table.  Rows are extracted from the Queue table one by
 78332  //  ** one.  Each row extracted from Queue is output to pDest.  Then the single
 78333  //  ** extracted row (now in the iCurrent table) becomes the content of the
 78334  //  ** recursive-table for a recursive-query run.  The output of the recursive-query
 78335  //  ** is added back into the Queue table.  Then another row is extracted from Queue
 78336  //  ** and the iteration continues until the Queue table is empty.
 78337  //  **
 78338  //  ** If the compound query operator is UNION then no duplicate rows are ever
 78339  //  ** inserted into the Queue table.  The iDistinct table keeps a copy of all rows
 78340  //  ** that have ever been inserted into Queue and causes duplicates to be
 78341  //  ** discarded.  If the operator is UNION ALL, then duplicates are allowed.
 78342  //  **
 78343  //  ** If the query has an ORDER BY, then entries in the Queue table are kept in
 78344  //  ** ORDER BY order and the first entry is extracted for each cycle.  Without
 78345  //  ** an ORDER BY, the Queue table is just a FIFO.
 78346  //  **
 78347  //  ** If a LIMIT clause is provided, then the iteration stops after LIMIT rows
 78348  //  ** have been output to pDest.  A LIMIT of zero means to output no rows and a
 78349  //  ** negative LIMIT means to output all rows.  If there is also an OFFSET clause
 78350  //  ** with a positive value, then the first OFFSET outputs are discarded rather
 78351  //  ** than being sent to pDest.  The LIMIT count does not begin until after OFFSET
 78352  //  ** rows have been skipped.
 78353  //  */
 78354  func _generateWithRecursiveQuery(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectDest) {
 78355  	var _nCol, _addrTop, _addrCont, _addrBreak, _iCurrent, _regCurrent, _iQueue, _iDistinct, _eDest, _i, _rc, _regLimit, _regOffset int32
 78356  	var _v *TVdbe
 78357  	var _pSrc *XSrcList
 78358  	var _pOrderBy *XExprList
 78359  	var _pSetup *XSelect
 78360  	var _pLimit, _pOffset *XExpr
 78361  	var _5_pKeyInfo *XKeyInfo
 78362  	var _destQueue XSelectDest
 78363  	_pSrc = (*XSrcList)(_p.XpSrc)
 78364  	_nCol = (*XExprList)(_p.XpEList).XnExpr
 78365  	_v = (*TVdbe)(_pParse.XpVdbe)
 78366  	_pSetup = (*XSelect)(_p.XpPrior)
 78367  	_iCurrent = int32(0)
 78368  	_iDistinct = int32(0)
 78369  	_eDest = int32(5)
 78370  	if _sqlite3AuthCheck(tls, _pParse, int32(33), nil, nil, nil) != 0 {
 78371  		return
 78372  	}
 78373  	_addrBreak = _sqlite3VdbeMakeLabel(tls, _v)
 78374  	_p.XnSelectRow = int16(320)
 78375  	_computeLimitRegisters(tls, _pParse, _p, _addrBreak)
 78376  	_pLimit = (*XExpr)(_p.XpLimit)
 78377  	_pOffset = (*XExpr)(_p.XpOffset)
 78378  	_regLimit = _p.XiLimit
 78379  	_regOffset = _p.XiOffset
 78380  	*(**XExpr)(unsafe.Pointer(&_p.XpLimit)) = store58((**XExpr)(unsafe.Pointer(&_p.XpOffset)), nil)
 78381  	_p.XiLimit = store2(&_p.XiOffset, int32(0))
 78382  	_pOrderBy = (*XExprList)(_p.XpOrderBy)
 78383  	_i = int32(0)
 78384  _1:
 78385  	if func() int32 {
 78386  		if _i < _pSrc.XnSrc {
 78387  			return int32(1)
 78388  		}
 78389  		return func() int32 {
 78390  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118583), unsafe.Pointer(&_generateWithRecursiveQueryØ00__func__Ø000), unsafe.Pointer(str(4809)))
 78391  			crt.X__builtin_abort(tls)
 78392  			return int32(0)
 78393  		}()
 78394  	}() == 0 {
 78395  		goto _6
 78396  	}
 78397  	if ((uint32(((elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_i)).Xfg).XnotIndexed)>>5) << 31) >> 31) != 0 {
 78398  		_iCurrent = elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_i)).XiCursor
 78399  		goto _6
 78400  	}
 78401  	_i += 1
 78402  	goto _1
 78403  _6:
 78404  	_iQueue = postInc2(&_pParse.XnTab, 1)
 78405  	if int32(_p.Xop) == int32(115) {
 78406  		_eDest = func() int32 {
 78407  			if _pOrderBy != nil {
 78408  				return int32(8)
 78409  			}
 78410  			return int32(6)
 78411  		}()
 78412  		_iDistinct = postInc2(&_pParse.XnTab, 1)
 78413  		goto _11
 78414  	}
 78415  	_eDest = func() int32 {
 78416  		if _pOrderBy != nil {
 78417  			return int32(7)
 78418  		}
 78419  		return int32(5)
 78420  	}()
 78421  _11:
 78422  	_sqlite3SelectDestInit(tls, &_destQueue, _eDest, _iQueue)
 78423  	_regCurrent = preInc2(&_pParse.XnMem, 1)
 78424  	_sqlite3VdbeAddOp3(tls, _v, int32(113), _iCurrent, _regCurrent, _nCol)
 78425  	if _pOrderBy != nil {
 78426  		_5_pKeyInfo = _multiSelectOrderByKeyInfo(tls, _pParse, _p, int32(1))
 78427  		_sqlite3VdbeAddOp4(tls, _v, int32(110), _iQueue, _pOrderBy.XnExpr+int32(2), int32(0), (*int8)(unsafe.Pointer(_5_pKeyInfo)), int32(-5))
 78428  		*(**XExprList)(unsafe.Pointer(&_destQueue.XpOrderBy)) = _pOrderBy
 78429  		goto _15
 78430  	}
 78431  	_sqlite3VdbeAddOp2(tls, _v, int32(110), _iQueue, _nCol)
 78432  _15:
 78433  	_sqlite3VdbeComment(tls, _v, str(98996))
 78434  	if _iDistinct != 0 {
 78435  		*elem8((*int32)(unsafe.Pointer(&_p.XaddrOpenEphm)), 0) = _sqlite3VdbeAddOp2(tls, _v, int32(110), _iDistinct, int32(0))
 78436  		_p.XselFlags |= uint32(32)
 78437  	}
 78438  	*(**XExprList)(unsafe.Pointer(&_p.XpOrderBy)) = nil
 78439  	*(**XSelect)(unsafe.Pointer(&_pSetup.XpNext)) = nil
 78440  	_rc = _sqlite3Select(tls, _pParse, _pSetup, &_destQueue)
 78441  	*(**XSelect)(unsafe.Pointer(&_pSetup.XpNext)) = _p
 78442  	if _rc != 0 {
 78443  		goto _end_of_recursive_query
 78444  	}
 78445  	_addrTop = _sqlite3VdbeAddOp2(tls, _v, int32(37), _iQueue, _addrBreak)
 78446  	_sqlite3VdbeAddOp1(tls, _v, int32(126), _iCurrent)
 78447  	if _pOrderBy != nil {
 78448  		_sqlite3VdbeAddOp3(tls, _v, int32(99), _iQueue, _pOrderBy.XnExpr+int32(1), _regCurrent)
 78449  		goto _19
 78450  	}
 78451  	_sqlite3VdbeAddOp2(tls, _v, int32(124), _iQueue, _regCurrent)
 78452  _19:
 78453  	_sqlite3VdbeAddOp1(tls, _v, int32(120), _iQueue)
 78454  	_addrCont = _sqlite3VdbeMakeLabel(tls, _v)
 78455  	_codeOffset(tls, _v, _regOffset, _addrCont)
 78456  	_selectInnerLoop(tls, _pParse, _p, (*XExprList)(_p.XpEList), _iCurrent, nil, nil, _pDest, _addrCont, _addrBreak)
 78457  	if _regLimit != 0 {
 78458  		_sqlite3VdbeAddOp2(tls, _v, int32(48), _regLimit, _addrBreak)
 78459  	}
 78460  	_sqlite3VdbeResolveLabel(tls, _v, _addrCont)
 78461  	if (_p.XselFlags & uint32(8)) != 0 {
 78462  		_sqlite3ErrorMsg(tls, _pParse, str(99008))
 78463  		goto _22
 78464  	}
 78465  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = nil
 78466  	_sqlite3Select(tls, _pParse, _p, &_destQueue)
 78467  	func() {
 78468  		if (*XSelect)(_p.XpPrior) != nil {
 78469  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118659), unsafe.Pointer(&_generateWithRecursiveQueryØ00__func__Ø000), unsafe.Pointer(str(97765)))
 78470  			crt.X__builtin_abort(tls)
 78471  		}
 78472  	}()
 78473  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = _pSetup
 78474  _22:
 78475  	_sqlite3VdbeGoto(tls, _v, _addrTop)
 78476  	_sqlite3VdbeResolveLabel(tls, _v, _addrBreak)
 78477  _end_of_recursive_query:
 78478  	_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.Xdb), (*XExprList)(_p.XpOrderBy))
 78479  	*(**XExprList)(unsafe.Pointer(&_p.XpOrderBy)) = _pOrderBy
 78480  	*(**XExpr)(unsafe.Pointer(&_p.XpLimit)) = _pLimit
 78481  	*(**XExpr)(unsafe.Pointer(&_p.XpOffset)) = _pOffset
 78482  }
 78483  
 78484  // C comment
 78485  //  /*
 78486  //  ** Compute the iLimit and iOffset fields of the SELECT based on the
 78487  //  ** pLimit and pOffset expressions.  pLimit and pOffset hold the expressions
 78488  //  ** that appear in the original SQL statement after the LIMIT and OFFSET
 78489  //  ** keywords.  Or NULL if those keywords are omitted. iLimit and iOffset
 78490  //  ** are the integer memory register numbers for counters used to compute
 78491  //  ** the limit and offset.  If there is no limit and/or offset, then
 78492  //  ** iLimit and iOffset are negative.
 78493  //  **
 78494  //  ** This routine changes the values of iLimit and iOffset only if
 78495  //  ** a limit or offset is defined by pLimit and pOffset.  iLimit and
 78496  //  ** iOffset should have been preset to appropriate default values (zero)
 78497  //  ** prior to calling this routine.
 78498  //  **
 78499  //  ** The iOffset register (if it exists) is initialized to the value
 78500  //  ** of the OFFSET.  The iLimit register is initialized to LIMIT.  Register
 78501  //  ** iOffset+1 is initialized to LIMIT+OFFSET.
 78502  //  **
 78503  //  ** Only if pLimit!=0 or pOffset!=0 do the limit registers get
 78504  //  ** redefined.  The UNION ALL operator uses this property to force
 78505  //  ** the reuse of the same limit and offset registers across multiple
 78506  //  ** SELECT statements.
 78507  //  */
 78508  func _computeLimitRegisters(tls *crt.TLS, _pParse *XParse, _p *XSelect, _iBreak int32) {
 78509  	var _iLimit, _iOffset, _n int32
 78510  	var _v *TVdbe
 78511  	_v = nil
 78512  	_iLimit = int32(0)
 78513  	if _p.XiLimit != 0 {
 78514  		return
 78515  	}
 78516  	_sqlite3ExprCacheClear(tls, _pParse)
 78517  	func() {
 78518  		if (*XExpr)(_p.XpOffset) != nil && (*XExpr)(_p.XpLimit) == nil {
 78519  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118411), unsafe.Pointer(&_computeLimitRegistersØ00__func__Ø000), unsafe.Pointer(str(99050)))
 78520  			crt.X__builtin_abort(tls)
 78521  		}
 78522  	}()
 78523  	if _p.XpLimit == nil {
 78524  		goto _4
 78525  	}
 78526  	_p.XiLimit = store2(&_iLimit, preInc2(&_pParse.XnMem, 1))
 78527  	_v = _sqlite3GetVdbe(tls, _pParse)
 78528  	func() {
 78529  		if _v == nil {
 78530  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118415), unsafe.Pointer(&_computeLimitRegistersØ00__func__Ø000), unsafe.Pointer(str(42019)))
 78531  			crt.X__builtin_abort(tls)
 78532  		}
 78533  	}()
 78534  	if _sqlite3ExprIsInteger(tls, (*XExpr)(_p.XpLimit), &_n) == 0 {
 78535  		goto _7
 78536  	}
 78537  	_sqlite3VdbeAddOp2(tls, _v, int32(56), _n, _iLimit)
 78538  	_sqlite3VdbeComment(tls, _v, str(99080))
 78539  	if _n == int32(0) {
 78540  		_sqlite3VdbeGoto(tls, _v, _iBreak)
 78541  		goto _11
 78542  	}
 78543  	if (_n >= int32(0)) && (int32(_p.XnSelectRow) > int32(_sqlite3LogEst(tls, uint64(_n)))) {
 78544  		_p.XnSelectRow = _sqlite3LogEst(tls, uint64(_n))
 78545  		_p.XselFlags |= uint32(16384)
 78546  	}
 78547  _11:
 78548  	goto _12
 78549  _7:
 78550  	_sqlite3ExprCode(tls, _pParse, (*XExpr)(_p.XpLimit), _iLimit)
 78551  	_sqlite3VdbeAddOp1(tls, _v, int32(17), _iLimit)
 78552  	_sqlite3VdbeComment(tls, _v, str(99080))
 78553  	_sqlite3VdbeAddOp2(tls, _v, int32(22), _iLimit, _iBreak)
 78554  _12:
 78555  	if _p.XpOffset != nil {
 78556  		_p.XiOffset = store2(&_iOffset, preInc2(&_pParse.XnMem, 1))
 78557  		_pParse.XnMem += 1
 78558  		_sqlite3ExprCode(tls, _pParse, (*XExpr)(_p.XpOffset), _iOffset)
 78559  		_sqlite3VdbeAddOp1(tls, _v, int32(17), _iOffset)
 78560  		_sqlite3VdbeComment(tls, _v, str(99094))
 78561  		_sqlite3VdbeAddOp3(tls, _v, int32(149), _iLimit, _iOffset+int32(1), _iOffset)
 78562  		_sqlite3VdbeComment(tls, _v, str(99109))
 78563  	}
 78564  _4:
 78565  }
 78566  
 78567  // C comment
 78568  //  /*
 78569  //  ** Clear all column cache entries.
 78570  //  */
 78571  func _sqlite3ExprCacheClear(tls *crt.TLS, _pParse *XParse) {
 78572  	var _i int32
 78573  	if (((*Xsqlite3)(_pParse.Xdb).Xflags) & int32(4096)) != 0 {
 78574  		crt.Xprintf(tls, str(99122))
 78575  	}
 78576  	_i = int32(0)
 78577  _1:
 78578  	if _i >= int32(_pParse.XnColCache) {
 78579  		goto _4
 78580  	}
 78581  	if ((elem69((*TyColCache)(unsafe.Pointer(&_pParse.XaColCache)), uintptr(_i)).XtempReg) != 0) && (int32(_pParse.XnTempReg) < int32(8)) {
 78582  		*elem8((*int32)(unsafe.Pointer(&_pParse.XaTempReg)), uintptr(postInc3(&_pParse.XnTempReg, byte(1)))) = elem69((*TyColCache)(unsafe.Pointer(&_pParse.XaColCache)), uintptr(_i)).XiReg
 78583  	}
 78584  	_i += 1
 78585  	goto _1
 78586  _4:
 78587  	_pParse.XnColCache = 0
 78588  }
 78589  
 78590  var _computeLimitRegistersØ00__func__Ø000 [22]int8
 78591  
 78592  func init() {
 78593  	crt.Xstrncpy(nil, &_computeLimitRegistersØ00__func__Ø000[0], str(99129), 22)
 78594  }
 78595  
 78596  // C comment
 78597  //  /* Generate code for an unconditional jump to instruction iDest
 78598  //  */
 78599  func _sqlite3VdbeGoto(tls *crt.TLS, _p *TVdbe, _iDest int32) (r0 int32) {
 78600  	return _sqlite3VdbeAddOp3(tls, _p, int32(13), int32(0), _iDest, int32(0))
 78601  }
 78602  
 78603  var _generateWithRecursiveQueryØ00__func__Ø000 [27]int8
 78604  
 78605  func init() {
 78606  	crt.Xstrncpy(nil, &_generateWithRecursiveQueryØ00__func__Ø000[0], str(99151), 27)
 78607  }
 78608  
 78609  // C comment
 78610  //  /*
 78611  //  ** The select statement passed as the second parameter is a compound SELECT
 78612  //  ** with an ORDER BY clause. This function allocates and returns a KeyInfo
 78613  //  ** structure suitable for implementing the ORDER BY.
 78614  //  **
 78615  //  ** Space to hold the KeyInfo structure is obtained from malloc. The calling
 78616  //  ** function is responsible for ensuring that this structure is eventually
 78617  //  ** freed.
 78618  //  */
 78619  func _multiSelectOrderByKeyInfo(tls *crt.TLS, _pParse *XParse, _p *XSelect, _nExtra int32) (r0 *XKeyInfo) {
 78620  	var _nOrderBy, _1_i int32
 78621  	var _db *Xsqlite3
 78622  	var _pOrderBy *XExprList
 78623  	var _2_pItem *TExprList_item
 78624  	var _2_pTerm *XExpr
 78625  	var _pRet *XKeyInfo
 78626  	var _2_pColl *XCollSeq
 78627  	_pOrderBy = (*XExprList)(_p.XpOrderBy)
 78628  	_nOrderBy = (*XExprList)(_p.XpOrderBy).XnExpr
 78629  	_db = (*Xsqlite3)(_pParse.Xdb)
 78630  	_pRet = _sqlite3KeyInfoAlloc(tls, _db, _nOrderBy+_nExtra, int32(1))
 78631  	if _pRet == nil {
 78632  		goto _0
 78633  	}
 78634  	_1_i = int32(0)
 78635  _1:
 78636  	if _1_i >= _nOrderBy {
 78637  		goto _4
 78638  	}
 78639  	_2_pItem = elem57((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_1_i))
 78640  	_2_pTerm = (*XExpr)(_2_pItem.XpExpr)
 78641  	if (_2_pTerm.Xflags & uint32(256)) != 0 {
 78642  		_2_pColl = _sqlite3ExprCollSeq(tls, _pParse, _2_pTerm)
 78643  		goto _6
 78644  	}
 78645  	_2_pColl = _multiSelectCollSeq(tls, _pParse, _p, int32((*t71)(unsafe.Pointer(&_2_pItem.Xu)).XiOrderByCol)-int32(1))
 78646  	if _2_pColl == nil {
 78647  		_2_pColl = (*XCollSeq)(_db.XpDfltColl)
 78648  	}
 78649  	*(**XExpr)(unsafe.Pointer(&(elem57((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_1_i)).XpExpr))) = _sqlite3ExprAddCollateString(tls, _pParse, _2_pTerm, _2_pColl.XzName)
 78650  _6:
 78651  	func() {
 78652  		if _sqlite3KeyInfoIsWriteable(tls, _pRet) == 0 {
 78653  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118498), unsafe.Pointer(&_multiSelectOrderByKeyInfoØ00__func__Ø000), unsafe.Pointer(str(99178)))
 78654  			crt.X__builtin_abort(tls)
 78655  		}
 78656  	}()
 78657  	*elem62((**XCollSeq)(unsafe.Pointer(&_pRet.XaColl)), uintptr(_1_i)) = _2_pColl
 78658  	*elem15(_pRet.XaSortOrder, uintptr(_1_i)) = elem57((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_1_i)).XsortOrder
 78659  	_1_i += 1
 78660  	goto _1
 78661  _4:
 78662  _0:
 78663  	return _pRet
 78664  }
 78665  
 78666  // C comment
 78667  //  /*
 78668  //  ** Return the appropriate collating sequence for the iCol-th column of
 78669  //  ** the result set for the compound-select statement "p".  Return NULL if
 78670  //  ** the column has no default collating sequence.
 78671  //  **
 78672  //  ** The collating sequence for the compound select is taken from the
 78673  //  ** left-most term of the select that has a collating sequence.
 78674  //  */
 78675  func _multiSelectCollSeq(tls *crt.TLS, _pParse *XParse, _p *XSelect, _iCol int32) (r0 *XCollSeq) {
 78676  	var _pRet *XCollSeq
 78677  	if _p.XpPrior != nil {
 78678  		_pRet = _multiSelectCollSeq(tls, _pParse, (*XSelect)(_p.XpPrior), _iCol)
 78679  		goto _1
 78680  	}
 78681  	_pRet = nil
 78682  _1:
 78683  	func() {
 78684  		if _iCol < int32(0) {
 78685  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118459), unsafe.Pointer(&_multiSelectCollSeqØ00__func__Ø000), unsafe.Pointer(str(99210)))
 78686  			crt.X__builtin_abort(tls)
 78687  		}
 78688  	}()
 78689  	if (_pRet == nil) && func() int32 {
 78690  		if _iCol < ((*XExprList)(_p.XpEList).XnExpr) {
 78691  			return int32(1)
 78692  		}
 78693  		return func() int32 {
 78694  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118463), unsafe.Pointer(&_multiSelectCollSeqØ00__func__Ø000), unsafe.Pointer(str(4809)))
 78695  			crt.X__builtin_abort(tls)
 78696  			return int32(0)
 78697  		}()
 78698  	}() != 0 {
 78699  		_pRet = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.XpEList).Xa))), uintptr(_iCol)).XpExpr))
 78700  	}
 78701  	return _pRet
 78702  }
 78703  
 78704  var _multiSelectCollSeqØ00__func__Ø000 [19]int8
 78705  
 78706  func init() {
 78707  	crt.Xstrncpy(nil, &_multiSelectCollSeqØ00__func__Ø000[0], str(99218), 19)
 78708  }
 78709  
 78710  var _multiSelectOrderByKeyInfoØ00__func__Ø000 [26]int8
 78711  
 78712  func init() {
 78713  	crt.Xstrncpy(nil, &_multiSelectOrderByKeyInfoØ00__func__Ø000[0], str(99237), 26)
 78714  }
 78715  
 78716  // C comment
 78717  //  /*
 78718  //  ** Add code to implement the OFFSET
 78719  //  */
 78720  func _codeOffset(tls *crt.TLS, _v *TVdbe, _iOffset int32, _iContinue int32) {
 78721  	if _iOffset > int32(0) {
 78722  		_sqlite3VdbeAddOp3(tls, _v, int32(46), _iOffset, _iContinue, int32(1))
 78723  		_sqlite3VdbeComment(tls, _v, str(25247))
 78724  	}
 78725  }
 78726  
 78727  // C comment
 78728  //  /*
 78729  //  ** This routine generates the code for the inside of the inner loop
 78730  //  ** of a SELECT.
 78731  //  **
 78732  //  ** If srcTab is negative, then the pEList expressions
 78733  //  ** are evaluated in order to get the data for this row.  If srcTab is
 78734  //  ** zero or more, then data is pulled from srcTab and pEList is used only
 78735  //  ** to get the number of columns and the collation sequence for each column.
 78736  //  */
 78737  func _selectInnerLoop(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pEList *XExprList, _srcTab int32, _pSort *XSortCtx, _pDistinct *XDistinctCtx, _pDest *XSelectDest, _iContinue int32, _iBreak int32) {
 78738  	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
 78739  	var _7_ecelFlags uint8
 78740  	var _v *TVdbe
 78741  	var _40_pSO *XExprList
 78742  	var _15_pOp *XVdbeOp
 78743  	var _16_pColl *XCollSeq
 78744  	_v = (*TVdbe)(_pParse.XpVdbe)
 78745  	_eDest = int32(_pDest.XeDest)
 78746  	_iParm = _pDest.XiSDParm
 78747  	_nPrefixReg = int32(0)
 78748  	func() {
 78749  		if _v == nil {
 78750  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117220), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(41816)))
 78751  			crt.X__builtin_abort(tls)
 78752  		}
 78753  	}()
 78754  	func() {
 78755  		if _pEList == nil {
 78756  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117221), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(45007)))
 78757  			crt.X__builtin_abort(tls)
 78758  		}
 78759  	}()
 78760  	_hasDistinct = func() int32 {
 78761  		if _pDistinct != nil {
 78762  			return int32(_pDistinct.XeTnctType)
 78763  		}
 78764  		return int32(0)
 78765  	}()
 78766  	if (_pSort != nil) && ((*XExprList)(_pSort.XpOrderBy) == nil) {
 78767  		_pSort = nil
 78768  	}
 78769  	if (_pSort == nil) && (_hasDistinct == 0) {
 78770  		func() {
 78771  			if _iContinue == int32(0) {
 78772  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117225), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(99263)))
 78773  				crt.X__builtin_abort(tls)
 78774  			}
 78775  		}()
 78776  		_codeOffset(tls, _v, _p.XiOffset, _iContinue)
 78777  	}
 78778  	_nResultCol = _pEList.XnExpr
 78779  	if _pDest.XiSdst != int32(0) {
 78780  		goto _12
 78781  	}
 78782  	if _pSort == nil {
 78783  		goto _13
 78784  	}
 78785  	_nPrefixReg = (*XExprList)(_pSort.XpOrderBy).XnExpr
 78786  	if (int32(_pSort.XsortFlags) & int32(1)) == 0 {
 78787  		_nPrefixReg += 1
 78788  	}
 78789  	_pParse.XnMem += _nPrefixReg
 78790  _13:
 78791  	_pDest.XiSdst = _pParse.XnMem + int32(1)
 78792  	_pParse.XnMem += _nResultCol
 78793  	goto _16
 78794  _12:
 78795  	if (_pDest.XiSdst + _nResultCol) > _pParse.XnMem {
 78796  		_pParse.XnMem += _nResultCol
 78797  	}
 78798  _16:
 78799  	_pDest.XnSdst = _nResultCol
 78800  	_regOrig = store2(&_regResult, _pDest.XiSdst)
 78801  	if _srcTab < int32(0) {
 78802  		goto _17
 78803  	}
 78804  	_i = int32(0)
 78805  _18:
 78806  	if _i >= _nResultCol {
 78807  		goto _21
 78808  	}
 78809  	_sqlite3VdbeAddOp3(tls, _v, int32(99), _srcTab, _i, _regResult+_i)
 78810  	_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(elem57((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XzName))
 78811  	_i += 1
 78812  	goto _18
 78813  _21:
 78814  	goto _23
 78815  _17:
 78816  	if _eDest == int32(3) {
 78817  		goto _23
 78818  	}
 78819  	if ((_eDest == int32(10)) || (_eDest == int32(9))) || (_eDest == int32(13)) {
 78820  		_7_ecelFlags = uint8(1)
 78821  		goto _27
 78822  	}
 78823  	_7_ecelFlags = 0
 78824  _27:
 78825  	if _pSort == nil || _hasDistinct != int32(0) || _eDest == int32(12) || _eDest == int32(14) {
 78826  		goto _31
 78827  	}
 78828  	{
 78829  		p := &_7_ecelFlags
 78830  		*p = uint8(int32(*p) | int32(12))
 78831  	}
 78832  	_i = _pSort.XnOBSat
 78833  _32:
 78834  	if _i >= ((*XExprList)(_pSort.XpOrderBy).XnExpr) {
 78835  		goto _35
 78836  	}
 78837  	if store2(&_11_j, int32((*t71)(unsafe.Pointer(&(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSort.XpOrderBy).Xa))), uintptr(_i)).Xu))).XiOrderByCol)) > int32(0) {
 78838  		(*t71)(unsafe.Pointer(&(elem57((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_11_j-int32(1))).Xu))).XiOrderByCol = uint16((_i + int32(1)) - _pSort.XnOBSat)
 78839  	}
 78840  	_i += 1
 78841  	goto _32
 78842  _35:
 78843  	_regOrig = int32(0)
 78844  	func() {
 78845  		if _eDest != int32(11) && _eDest != int32(10) && _eDest != int32(13) && _eDest != int32(9) {
 78846  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117281), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(99276)))
 78847  			crt.X__builtin_abort(tls)
 78848  		}
 78849  	}()
 78850  _31:
 78851  	_nResultCol = _sqlite3ExprCodeExprList(tls, _pParse, _pEList, _regResult, int32(0), _7_ecelFlags)
 78852  _23:
 78853  	if _hasDistinct == 0 {
 78854  		goto _42
 78855  	}
 78856  	switch int32(_pDistinct.XeTnctType) {
 78857  	case int32(1):
 78858  		goto _45
 78859  	case int32(2):
 78860  		goto _44
 78861  	default:
 78862  		goto _46
 78863  	}
 78864  
 78865  _44:
 78866  	_15_regPrev = _pParse.XnMem + int32(1)
 78867  	_pParse.XnMem += _nResultCol
 78868  	_sqlite3VdbeChangeToNoop(tls, _v, _pDistinct.XaddrTnct)
 78869  	_15_pOp = _sqlite3VdbeGetOp(tls, _v, _pDistinct.XaddrTnct)
 78870  	_15_pOp.Xopcode = uint8(59)
 78871  	_15_pOp.Xp1 = int32(1)
 78872  	_15_pOp.Xp2 = _15_regPrev
 78873  	_15_iJump = _sqlite3VdbeCurrentAddr(tls, _v) + _nResultCol
 78874  	_i = int32(0)
 78875  _47:
 78876  	if _i >= _nResultCol {
 78877  		goto _50
 78878  	}
 78879  	_16_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XpExpr))
 78880  	if _i < (_nResultCol - int32(1)) {
 78881  		_sqlite3VdbeAddOp3(tls, _v, int32(77), _regResult+_i, _15_iJump, _15_regPrev+_i)
 78882  		goto _52
 78883  	}
 78884  	_sqlite3VdbeAddOp3(tls, _v, int32(78), _regResult+_i, _iContinue, _15_regPrev+_i)
 78885  _52:
 78886  	_sqlite3VdbeChangeP4(tls, _v, int32(-1), (*int8)(unsafe.Pointer(_16_pColl)), int32(-3))
 78887  	_sqlite3VdbeChangeP5(tls, _v, uint16(128))
 78888  	_i += 1
 78889  	goto _47
 78890  _50:
 78891  	func() {
 78892  		if _sqlite3VdbeCurrentAddr(tls, _v) != _15_iJump && ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == 0 {
 78893  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117327), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(99354)))
 78894  			crt.X__builtin_abort(tls)
 78895  		}
 78896  	}()
 78897  	_sqlite3VdbeAddOp3(tls, _v, int32(64), _regResult, _15_regPrev, _nResultCol-int32(1))
 78898  	goto _56
 78899  _45:
 78900  	_sqlite3VdbeChangeToNoop(tls, _v, _pDistinct.XaddrTnct)
 78901  	goto _56
 78902  _46:
 78903  	func() {
 78904  		if int32(_pDistinct.XeTnctType) != int32(3) {
 78905  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117338), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(99415)))
 78906  			crt.X__builtin_abort(tls)
 78907  		}
 78908  	}()
 78909  	_codeDistinct(tls, _pParse, _pDistinct.XtabTnct, _iContinue, _nResultCol, _regResult)
 78910  	goto _56
 78911  _56:
 78912  	if _pSort == nil {
 78913  		_codeOffset(tls, _v, _p.XiOffset, _iContinue)
 78914  	}
 78915  _42:
 78916  	switch _eDest {
 78917  	case int32(1):
 78918  		goto _61
 78919  	case int32(2):
 78920  		goto _62
 78921  	case int32(3):
 78922  		goto _68
 78923  	case int32(5):
 78924  		goto _63
 78925  	case int32(6):
 78926  		goto _63
 78927  	case int32(7):
 78928  		goto _72
 78929  	case int32(8):
 78930  		goto _72
 78931  	case int32(9):
 78932  		goto _70
 78933  	case int32(10):
 78934  		goto _69
 78935  	case int32(11):
 78936  		goto _67
 78937  	case int32(12):
 78938  		goto _63
 78939  	case int32(13):
 78940  		goto _70
 78941  	case int32(14):
 78942  		goto _63
 78943  	default:
 78944  		goto _74
 78945  	}
 78946  
 78947  _61:
 78948  	_23_r1 = _sqlite3GetTempReg(tls, _pParse)
 78949  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _regResult, _nResultCol, _23_r1)
 78950  	_sqlite3VdbeAddOp4Int(tls, _v, int32(128), _iParm, _23_r1, _regResult, _nResultCol)
 78951  	_sqlite3ReleaseTempReg(tls, _pParse, _23_r1)
 78952  	goto _75
 78953  _62:
 78954  	_sqlite3VdbeAddOp3(tls, _v, int32(129), _iParm, _regResult, _nResultCol)
 78955  	goto _75
 78956  _63:
 78957  	_25_r1 = _sqlite3GetTempRange(tls, _pParse, _nPrefixReg+int32(1))
 78958  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _regResult, _nResultCol, _25_r1+_nPrefixReg)
 78959  	if _eDest == int32(6) {
 78960  		_26_addr = _sqlite3VdbeCurrentAddr(tls, _v) + int32(4)
 78961  		_sqlite3VdbeAddOp4Int(tls, _v, int32(30), _iParm+int32(1), _26_addr, _25_r1, int32(0))
 78962  		_sqlite3VdbeAddOp4Int(tls, _v, int32(128), _iParm+int32(1), _25_r1, _regResult, _nResultCol)
 78963  		func() {
 78964  			if _pSort != nil {
 78965  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117396), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(99462)))
 78966  				crt.X__builtin_abort(tls)
 78967  			}
 78968  		}()
 78969  	}
 78970  	if _pSort != nil {
 78971  		_pushOntoSorter(tls, _pParse, _pSort, _p, _25_r1+_nPrefixReg, _regResult, int32(1), _nPrefixReg)
 78972  		goto _80
 78973  	}
 78974  	_28_r2 = _sqlite3GetTempReg(tls, _pParse)
 78975  	_sqlite3VdbeAddOp2(tls, _v, int32(117), _iParm, _28_r2)
 78976  	_sqlite3VdbeAddOp3(tls, _v, int32(118), _iParm, _25_r1, _28_r2)
 78977  	_sqlite3VdbeChangeP5(tls, _v, uint16(8))
 78978  	_sqlite3ReleaseTempReg(tls, _pParse, _28_r2)
 78979  _80:
 78980  	_sqlite3ReleaseTempRange(tls, _pParse, _25_r1, _nPrefixReg+int32(1))
 78981  	goto _75
 78982  _67:
 78983  	if _pSort != nil {
 78984  		_pushOntoSorter(tls, _pParse, _pSort, _p, _regResult, _regOrig, _nResultCol, _nPrefixReg)
 78985  		goto _82
 78986  	}
 78987  	_31_r1 = _sqlite3GetTempReg(tls, _pParse)
 78988  	func() {
 78989  		if _sqlite3Strlen30(tls, _pDest.XzAffSdst) != _nResultCol {
 78990  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117427), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(99471)))
 78991  			crt.X__builtin_abort(tls)
 78992  		}
 78993  	}()
 78994  	_sqlite3VdbeAddOp4(tls, _v, int32(101), _regResult, _nResultCol, _31_r1, _pDest.XzAffSdst, _nResultCol)
 78995  	_sqlite3ExprCacheAffinityChange(tls, _pParse, _regResult, _nResultCol)
 78996  	_sqlite3VdbeAddOp4Int(tls, _v, int32(128), _iParm, _31_r1, _regResult, _nResultCol)
 78997  	_sqlite3ReleaseTempReg(tls, _pParse, _31_r1)
 78998  _82:
 78999  	goto _75
 79000  _68:
 79001  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(1), _iParm)
 79002  	goto _75
 79003  _69:
 79004  	if _pSort != nil {
 79005  		func() {
 79006  			if _nResultCol > _pDest.XnSdst {
 79007  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117451), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(99516)))
 79008  				crt.X__builtin_abort(tls)
 79009  			}
 79010  		}()
 79011  		_pushOntoSorter(tls, _pParse, _pSort, _p, _regResult, _regOrig, _nResultCol, _nPrefixReg)
 79012  		goto _88
 79013  	}
 79014  	func() {
 79015  		if _nResultCol != _pDest.XnSdst {
 79016  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117455), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(99541)))
 79017  			crt.X__builtin_abort(tls)
 79018  		}
 79019  	}()
 79020  	func() {
 79021  		if _regResult != _iParm {
 79022  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117456), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(99566)))
 79023  			crt.X__builtin_abort(tls)
 79024  		}
 79025  	}()
 79026  _88:
 79027  	goto _75
 79028  _70:
 79029  	if _pSort != nil {
 79030  		_pushOntoSorter(tls, _pParse, _pSort, _p, _regResult, _regOrig, _nResultCol, _nPrefixReg)
 79031  		goto _96
 79032  	}
 79033  	if _eDest == int32(13) {
 79034  		_sqlite3VdbeAddOp1(tls, _v, int32(16), _pDest.XiSDParm)
 79035  		goto _96
 79036  	}
 79037  	_sqlite3VdbeAddOp2(tls, _v, int32(67), _regResult, _nResultCol)
 79038  	_sqlite3ExprCacheAffinityChange(tls, _pParse, _regResult, _nResultCol)
 79039  _96:
 79040  	goto _75
 79041  _72:
 79042  	_40_addrTest = int32(0)
 79043  	_40_pSO = (*XExprList)(_pDest.XpOrderBy)
 79044  	func() {
 79045  		if _40_pSO == nil {
 79046  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117493), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(99583)))
 79047  			crt.X__builtin_abort(tls)
 79048  		}
 79049  	}()
 79050  	_40_nKey = _40_pSO.XnExpr
 79051  	_40_r1 = _sqlite3GetTempReg(tls, _pParse)
 79052  	_40_r2 = _sqlite3GetTempRange(tls, _pParse, _40_nKey+int32(2))
 79053  	_40_r3 = (_40_r2 + _40_nKey) + int32(1)
 79054  	if _eDest == int32(8) {
 79055  		_40_addrTest = _sqlite3VdbeAddOp4Int(tls, _v, int32(30), _iParm+int32(1), int32(0), _regResult, _nResultCol)
 79056  	}
 79057  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _regResult, _nResultCol, _40_r3)
 79058  	if _eDest == int32(8) {
 79059  		_sqlite3VdbeAddOp2(tls, _v, int32(128), _iParm+int32(1), _40_r3)
 79060  		_sqlite3VdbeChangeP5(tls, _v, uint16(16))
 79061  	}
 79062  	_i = int32(0)
 79063  _101:
 79064  	if _i >= _40_nKey {
 79065  		goto _104
 79066  	}
 79067  	_sqlite3VdbeAddOp2(tls, _v, int32(65), (_regResult+int32((*t71)(unsafe.Pointer(&(elem57((*TExprList_item)(unsafe.Pointer(&_40_pSO.Xa)), uintptr(_i)).Xu))).XiOrderByCol))-int32(1), _40_r2+_i)
 79068  	_i += 1
 79069  	goto _101
 79070  _104:
 79071  	_sqlite3VdbeAddOp2(tls, _v, int32(116), _iParm, _40_r2+_40_nKey)
 79072  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _40_r2, _40_nKey+int32(2), _40_r1)
 79073  	_sqlite3VdbeAddOp4Int(tls, _v, int32(128), _iParm, _40_r1, _40_r2, _40_nKey+int32(2))
 79074  	if _40_addrTest != 0 {
 79075  		_sqlite3VdbeJumpHere(tls, _v, _40_addrTest)
 79076  	}
 79077  	_sqlite3ReleaseTempReg(tls, _pParse, _40_r1)
 79078  	_sqlite3ReleaseTempRange(tls, _pParse, _40_r2, _40_nKey+int32(2))
 79079  	goto _75
 79080  _74:
 79081  	func() {
 79082  		if _eDest != int32(4) {
 79083  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117535), unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000), unsafe.Pointer(str(99587)))
 79084  			crt.X__builtin_abort(tls)
 79085  		}
 79086  	}()
 79087  	goto _75
 79088  _75:
 79089  	if (_pSort == nil) && _p.XiLimit != 0 {
 79090  		_sqlite3VdbeAddOp2(tls, _v, int32(48), _p.XiLimit, _iBreak)
 79091  	}
 79092  }
 79093  
 79094  var _selectInnerLoopØ00__func__Ø000 [16]int8
 79095  
 79096  func init() {
 79097  	crt.Xstrncpy(nil, &_selectInnerLoopØ00__func__Ø000[0], str(99606), 16)
 79098  }
 79099  
 79100  // C comment
 79101  //  /*
 79102  //  ** Generate code that pushes the value of every element of the given
 79103  //  ** expression list into a sequence of registers beginning at target.
 79104  //  **
 79105  //  ** Return the number of elements evaluated.
 79106  //  **
 79107  //  ** The SQLITE_ECEL_DUP flag prevents the arguments from being
 79108  //  ** filled using OP_SCopy.  OP_Copy must be used instead.
 79109  //  **
 79110  //  ** The SQLITE_ECEL_FACTOR argument allows constant arguments to be
 79111  //  ** factored out into initialization code.
 79112  //  **
 79113  //  ** The SQLITE_ECEL_REF flag means that expressions in the list with
 79114  //  ** ExprList.a[].u.x.iOrderByCol>0 have already been evaluated and stored
 79115  //  ** in registers at srcReg, and so the value can be copied from there.
 79116  //  */
 79117  func _sqlite3ExprCodeExprList(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _target int32, _srcReg int32, _flags uint8) (r0 int32) {
 79118  	var _i, _j, _n, _6_inReg int32
 79119  	var _copyOp uint8
 79120  	var _v *TVdbe
 79121  	var _pItem *TExprList_item
 79122  	var _1_pExpr *XExpr
 79123  	var _7_pOp *XVdbeOp
 79124  	_copyOp = uint8(func() int32 {
 79125  		if (int32(_flags) & int32(1)) != 0 {
 79126  			return int32(64)
 79127  		}
 79128  		return int32(65)
 79129  	}())
 79130  	_v = (*TVdbe)(_pParse.XpVdbe)
 79131  	func() {
 79132  		if _pList == nil {
 79133  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95149), unsafe.Pointer(&_sqlite3ExprCodeExprListØ00__func__Ø000), unsafe.Pointer(str(88609)))
 79134  			crt.X__builtin_abort(tls)
 79135  		}
 79136  	}()
 79137  	func() {
 79138  		if _target <= int32(0) {
 79139  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95150), unsafe.Pointer(&_sqlite3ExprCodeExprListØ00__func__Ø000), unsafe.Pointer(str(99622)))
 79140  			crt.X__builtin_abort(tls)
 79141  		}
 79142  	}()
 79143  	func() {
 79144  		if (*TVdbe)(_pParse.XpVdbe) == nil {
 79145  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95151), unsafe.Pointer(&_sqlite3ExprCodeExprListØ00__func__Ø000), unsafe.Pointer(str(99631)))
 79146  			crt.X__builtin_abort(tls)
 79147  		}
 79148  	}()
 79149  	_n = _pList.XnExpr
 79150  	if _pParse.XokConstFactor == 0 {
 79151  		{
 79152  			p := &_flags
 79153  			*p = uint8(int32(*p) & int32(-3))
 79154  		}
 79155  	}
 79156  	*func() *int32 { _pItem = (*TExprList_item)(unsafe.Pointer(&_pList.Xa)); return &_i }() = int32(0)
 79157  _9:
 79158  	if _i >= _n {
 79159  		goto _12
 79160  	}
 79161  	_1_pExpr = (*XExpr)(_pItem.XpExpr)
 79162  	if (int32(_flags)&int32(4)) == int32(0) || store2(&_j, int32((*t71)(unsafe.Pointer(&_pItem.Xu)).XiOrderByCol)) <= int32(0) {
 79163  		goto _14
 79164  	}
 79165  	if (int32(_flags) & int32(8)) != 0 {
 79166  		_i -= 1
 79167  		_n -= 1
 79168  		goto _16
 79169  	}
 79170  	_sqlite3VdbeAddOp2(tls, _v, int32(_copyOp), (_j+_srcReg)-int32(1), _target+_i)
 79171  _16:
 79172  	goto _20
 79173  _14:
 79174  	if ((int32(_flags) & int32(2)) != int32(0)) && _sqlite3ExprIsConstant(tls, _1_pExpr) != 0 {
 79175  		_sqlite3ExprCodeAtInit(tls, _pParse, _1_pExpr, _target+_i)
 79176  		goto _20
 79177  	}
 79178  	_6_inReg = _sqlite3ExprCodeTarget(tls, _pParse, _1_pExpr, _target+_i)
 79179  	if _6_inReg == (_target + _i) {
 79180  		goto _21
 79181  	}
 79182  	if (((int32(_copyOp) == int32(64)) && (int32(store61(&_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)) {
 79183  		_7_pOp.Xp3 += 1
 79184  		goto _26
 79185  	}
 79186  	_sqlite3VdbeAddOp2(tls, _v, int32(_copyOp), _6_inReg, _target+_i)
 79187  _26:
 79188  _21:
 79189  _20:
 79190  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pItem }())) += uintptr(20)
 79191  	goto _9
 79192  _12:
 79193  	return _n
 79194  }
 79195  
 79196  var _sqlite3ExprCodeExprListØ00__func__Ø000 [24]int8
 79197  
 79198  func init() {
 79199  	crt.Xstrncpy(nil, &_sqlite3ExprCodeExprListØ00__func__Ø000[0], str(99648), 24)
 79200  }
 79201  
 79202  // C comment
 79203  //  /*
 79204  //  ** Walk an expression tree.  Return non-zero if the expression is constant
 79205  //  ** and 0 if it involves variables or function calls.
 79206  //  **
 79207  //  ** For the purposes of this function, a double-quoted string (ex: "abc")
 79208  //  ** is considered a variable but a single-quoted string (ex: 'abc') is
 79209  //  ** a constant.
 79210  //  */
 79211  func _sqlite3ExprIsConstant(tls *crt.TLS, _p *XExpr) (r0 int32) {
 79212  	return _exprIsConst(tls, _p, int32(1), int32(0))
 79213  }
 79214  
 79215  func _exprIsConst(tls *crt.TLS, _p *XExpr, _initFlag int32, _iCur int32) (r0 int32) {
 79216  	var _w XWalker
 79217  	crt.Xmemset(tls, unsafe.Pointer(&_w), int32(0), uint32(28))
 79218  	_w.XeCode = uint8(_initFlag)
 79219  	*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_w.XxExprCallback)) = _exprNodeIsConstant
 79220  	*(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer(&_w.XxSelectCallback)) = _selectNodeIsConstant
 79221  	*(*int32)(unsafe.Pointer(&_w.Xu)) = _iCur
 79222  	_sqlite3WalkExpr(tls, &_w, _p)
 79223  	return int32(_w.XeCode)
 79224  }
 79225  
 79226  // C comment
 79227  //  /*
 79228  //  ** These routines are Walker callbacks used to check expressions to
 79229  //  ** see if they are "constant" for some definition of constant.  The
 79230  //  ** Walker.eCode value determines the type of "constant" we are looking
 79231  //  ** for.
 79232  //  **
 79233  //  ** These callback routines are used to implement the following:
 79234  //  **
 79235  //  **     sqlite3ExprIsConstant()                  pWalker->eCode==1
 79236  //  **     sqlite3ExprIsConstantNotJoin()           pWalker->eCode==2
 79237  //  **     sqlite3ExprIsTableConstant()             pWalker->eCode==3
 79238  //  **     sqlite3ExprIsConstantOrFunction()        pWalker->eCode==4 or 5
 79239  //  **
 79240  //  ** In all cases, the callbacks set Walker.eCode=0 and abort if the expression
 79241  //  ** is found to not be a constant.
 79242  //  **
 79243  //  ** The sqlite3ExprIsConstantOrFunction() is used for evaluating expressions
 79244  //  ** in a CREATE TABLE statement.  The Walker.eCode value is 5 when parsing
 79245  //  ** an existing schema and 4 when processing a new statement.  A bound
 79246  //  ** parameter raises an error for new statements, but is silently converted
 79247  //  ** to NULL for existing schemas.  This allows sqlite_master tables that
 79248  //  ** contain a bound parameter because they were generated by older versions
 79249  //  ** of SQLite to be parsed by newer versions of SQLite without raising a
 79250  //  ** malformed schema error.
 79251  //  */
 79252  func _exprNodeIsConstant(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
 79253  	if (int32(_pWalker.XeCode) == int32(2)) && ((_pExpr.Xflags & uint32(1)) != (0)) {
 79254  		_pWalker.XeCode = 0
 79255  		return int32(2)
 79256  	}
 79257  	switch int32(_pExpr.Xop) {
 79258  	case int32(27):
 79259  		goto _4
 79260  	case int32(135):
 79261  		goto _9
 79262  	case int32(151):
 79263  		goto _3
 79264  	case int32(152):
 79265  		goto _4
 79266  	case int32(153):
 79267  		goto _4
 79268  	case int32(154):
 79269  		goto _4
 79270  	case int32(160):
 79271  		goto _15
 79272  	default:
 79273  		goto _18
 79274  	}
 79275  
 79276  _3:
 79277  	if (int32(_pWalker.XeCode) >= int32(4)) || ((_pExpr.Xflags & uint32(524288)) != (0)) {
 79278  		return int32(0)
 79279  	}
 79280  	_pWalker.XeCode = 0
 79281  	return int32(2)
 79282  
 79283  _4:
 79284  	if (int32(_pWalker.XeCode) == int32(3)) && (_pExpr.XiTable == (*(*int32)(unsafe.Pointer(&_pWalker.Xu)))) {
 79285  		return int32(0)
 79286  	}
 79287  _15:
 79288  	_pWalker.XeCode = 0
 79289  	return int32(2)
 79290  
 79291  _9:
 79292  	if int32(_pWalker.XeCode) == int32(5) {
 79293  		_pExpr.Xop = uint8(101)
 79294  		goto _18
 79295  	}
 79296  	if int32(_pWalker.XeCode) == int32(4) {
 79297  		_pWalker.XeCode = 0
 79298  		return int32(2)
 79299  	}
 79300  _18:
 79301  	return int32(0)
 79302  }
 79303  
 79304  func _selectNodeIsConstant(tls *crt.TLS, _pWalker *XWalker, _NotUsed *XSelect) (r0 int32) {
 79305  	_pWalker.XeCode = 0
 79306  	return int32(2)
 79307  }
 79308  
 79309  // C comment
 79310  //  /*
 79311  //  ** Factor out the code of the given expression to initialization time.
 79312  //  **
 79313  //  ** If regDest>=0 then the result is always stored in that register and the
 79314  //  ** result is not reusable.  If regDest<0 then this routine is free to
 79315  //  ** store the value whereever it wants.  The register where the expression
 79316  //  ** is stored is returned.  When regDest<0, two identical expressions will
 79317  //  ** code to the same register.
 79318  //  */
 79319  func _sqlite3ExprCodeAtInit(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _regDest int32) (r0 int32) {
 79320  	var _1_i int32
 79321  	var _p *XExprList
 79322  	var _1_pItem, _4_pItem *TExprList_item
 79323  	func() {
 79324  		if _pParse.XokConstFactor == 0 {
 79325  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94994), unsafe.Pointer(&_sqlite3ExprCodeAtInitØ00__func__Ø000), unsafe.Pointer(str(99672)))
 79326  			crt.X__builtin_abort(tls)
 79327  		}
 79328  	}()
 79329  	_p = (*XExprList)(_pParse.XpConstExpr)
 79330  	if _regDest >= int32(0) || _p == nil {
 79331  		goto _3
 79332  	}
 79333  	*func() *int32 { _1_pItem = (*TExprList_item)(unsafe.Pointer(&_p.Xa)); return &_1_i }() = _p.XnExpr
 79334  _4:
 79335  	if _1_i <= int32(0) {
 79336  		goto _7
 79337  	}
 79338  	if (((uint32(_1_pItem.Xdone>>2) << 31) >> 31) != 0) && (_sqlite3ExprCompare(tls, (*XExpr)(_1_pItem.XpExpr), _pExpr, int32(-1)) == int32(0)) {
 79339  		return *(*int32)(unsafe.Pointer(&_1_pItem.Xu))
 79340  	}
 79341  	*func() *int32 { *(*uintptr)(unsafe.Pointer(&_1_pItem)) += uintptr(20); return &_1_i }() -= 1
 79342  	goto _4
 79343  _7:
 79344  _3:
 79345  	_pExpr = _sqlite3ExprDup(tls, (*Xsqlite3)(_pParse.Xdb), _pExpr, int32(0))
 79346  	_p = _sqlite3ExprListAppend(tls, _pParse, _p, _pExpr)
 79347  	if _p == nil {
 79348  		goto _10
 79349  	}
 79350  	_4_pItem = elem57((*TExprList_item)(unsafe.Pointer(&_p.Xa)), uintptr(_p.XnExpr-int32(1)))
 79351  	storebits5(&_4_pItem.Xdone, int8(bool2int(_regDest < int32(0))), 4, 2)
 79352  	if _regDest < int32(0) {
 79353  		_regDest = preInc2(&_pParse.XnMem, 1)
 79354  	}
 79355  	*(*int32)(unsafe.Pointer(&_4_pItem.Xu)) = _regDest
 79356  _10:
 79357  	*(**XExprList)(unsafe.Pointer(&_pParse.XpConstExpr)) = _p
 79358  	return _regDest
 79359  }
 79360  
 79361  var _sqlite3ExprCodeAtInitØ00__func__Ø000 [22]int8
 79362  
 79363  func init() {
 79364  	crt.Xstrncpy(nil, &_sqlite3ExprCodeAtInitØ00__func__Ø000[0], str(99694), 22)
 79365  }
 79366  
 79367  // C comment
 79368  //  /*
 79369  //  ** Change the opcode at addr into OP_Noop
 79370  //  */
 79371  func _sqlite3VdbeChangeToNoop(tls *crt.TLS, _p *TVdbe, _addr int32) (r0 int32) {
 79372  	var _pOp *XVdbeOp
 79373  	if ((*Xsqlite3)(_p.Xdb).XmallocFailed) != 0 {
 79374  		return int32(0)
 79375  	}
 79376  	func() {
 79377  		if _addr < int32(0) || _addr >= _p.XnOp {
 79378  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72328), unsafe.Pointer(&_sqlite3VdbeChangeToNoopØ00__func__Ø000), unsafe.Pointer(str(99716)))
 79379  			crt.X__builtin_abort(tls)
 79380  		}
 79381  	}()
 79382  	_pOp = elem61((*XVdbeOp)(_p.XaOp), uintptr(_addr))
 79383  	_freeP4(tls, (*Xsqlite3)(_p.Xdb), int32(_pOp.Xp4type), *(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
 79384  	_pOp.Xp4type = 0
 79385  	*(**int8)(unsafe.Pointer(&_pOp.Xp4)) = nil
 79386  	_pOp.Xopcode = uint8(164)
 79387  	return int32(1)
 79388  }
 79389  
 79390  var _sqlite3VdbeChangeToNoopØ00__func__Ø000 [24]int8
 79391  
 79392  func init() {
 79393  	crt.Xstrncpy(nil, &_sqlite3VdbeChangeToNoopØ00__func__Ø000[0], str(99739), 24)
 79394  }
 79395  
 79396  // C comment
 79397  //  /*
 79398  //  ** Return the address of the next instruction to be inserted.
 79399  //  */
 79400  func _sqlite3VdbeCurrentAddr(tls *crt.TLS, _p *TVdbe) (r0 int32) {
 79401  	func() {
 79402  		if _p.Xmagic != uint32(381479589) {
 79403  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72061), unsafe.Pointer(&_sqlite3VdbeCurrentAddrØ00__func__Ø000), unsafe.Pointer(str(37597)))
 79404  			crt.X__builtin_abort(tls)
 79405  		}
 79406  	}()
 79407  	return _p.XnOp
 79408  }
 79409  
 79410  var _sqlite3VdbeCurrentAddrØ00__func__Ø000 [23]int8
 79411  
 79412  func init() {
 79413  	crt.Xstrncpy(nil, &_sqlite3VdbeCurrentAddrØ00__func__Ø000[0], str(99763), 23)
 79414  }
 79415  
 79416  // C comment
 79417  //  /*
 79418  //  ** Add code that will check to make sure the N registers starting at iMem
 79419  //  ** form a distinct entry.  iTab is a sorting index that holds previously
 79420  //  ** seen combinations of the N values.  A new entry is made in iTab
 79421  //  ** if the current N values are new.
 79422  //  **
 79423  //  ** A jump to addrRepeat is made and the N+1 values are popped from the
 79424  //  ** stack if the top N elements are not distinct.
 79425  //  */
 79426  func _codeDistinct(tls *crt.TLS, _pParse *XParse, _iTab int32, _addrRepeat int32, _N int32, _iMem int32) {
 79427  	var _r1 int32
 79428  	var _v *TVdbe
 79429  	_v = (*TVdbe)(_pParse.XpVdbe)
 79430  	_r1 = _sqlite3GetTempReg(tls, _pParse)
 79431  	_sqlite3VdbeAddOp4Int(tls, _v, int32(30), _iTab, _addrRepeat, _iMem, _N)
 79432  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _iMem, _N, _r1)
 79433  	_sqlite3VdbeAddOp4Int(tls, _v, int32(128), _iTab, _r1, _iMem, _N)
 79434  	_sqlite3VdbeChangeP5(tls, _v, uint16(16))
 79435  	_sqlite3ReleaseTempReg(tls, _pParse, _r1)
 79436  }
 79437  
 79438  // C comment
 79439  //  /*
 79440  //  ** Allocate a single new register for use to hold some intermediate result.
 79441  //  */
 79442  func _sqlite3GetTempReg(tls *crt.TLS, _pParse *XParse) (r0 int32) {
 79443  	if int32(_pParse.XnTempReg) == int32(0) {
 79444  		return preInc2(&_pParse.XnMem, 1)
 79445  	}
 79446  	return *elem8((*int32)(unsafe.Pointer(&_pParse.XaTempReg)), uintptr(preInc3(&_pParse.XnTempReg, byte(255))))
 79447  }
 79448  
 79449  // C comment
 79450  //  /*
 79451  //  ** Deallocate a register, making available for reuse for some other
 79452  //  ** purpose.
 79453  //  **
 79454  //  ** If a register is currently being used by the column cache, then
 79455  //  ** the deallocation is deferred until the column cache line that uses
 79456  //  ** the register becomes stale.
 79457  //  */
 79458  func _sqlite3ReleaseTempReg(tls *crt.TLS, _pParse *XParse, _iReg int32) {
 79459  	var _1_i int32
 79460  	var _1_p *TyColCache
 79461  	if _iReg == 0 || int32(_pParse.XnTempReg) >= int32(8) {
 79462  		goto _1
 79463  	}
 79464  	*func() **TyColCache { _1_i = int32(0); return &_1_p }() = (*TyColCache)(unsafe.Pointer(&_pParse.XaColCache))
 79465  _2:
 79466  	if _1_i >= int32(_pParse.XnColCache) {
 79467  		goto _5
 79468  	}
 79469  	if _1_p.XiReg == _iReg {
 79470  		_1_p.XtempReg = uint8(1)
 79471  		return
 79472  	}
 79473  	*(*uintptr)(unsafe.Pointer(func() **TyColCache { _1_i += 1; return &_1_p }())) += uintptr(20)
 79474  	goto _2
 79475  _5:
 79476  	*elem8((*int32)(unsafe.Pointer(&_pParse.XaTempReg)), uintptr(postInc3(&_pParse.XnTempReg, byte(1)))) = _iReg
 79477  _1:
 79478  }
 79479  
 79480  // C comment
 79481  //  /*
 79482  //  ** Allocate or deallocate a block of nReg consecutive registers.
 79483  //  */
 79484  func _sqlite3GetTempRange(tls *crt.TLS, _pParse *XParse, _nReg int32) (r0 int32) {
 79485  	var _i, _n int32
 79486  	if _nReg == int32(1) {
 79487  		return _sqlite3GetTempReg(tls, _pParse)
 79488  	}
 79489  	_i = _pParse.XiRangeReg
 79490  	_n = _pParse.XnRangeReg
 79491  	if _nReg <= _n {
 79492  		func() {
 79493  			if _usedAsColumnCache(tls, _pParse, _i, (_i+_n)-int32(1)) != 0 {
 79494  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96056), unsafe.Pointer(&_sqlite3GetTempRangeØ00__func__Ø000), unsafe.Pointer(str(99786)))
 79495  				crt.X__builtin_abort(tls)
 79496  			}
 79497  		}()
 79498  		_pParse.XiRangeReg += _nReg
 79499  		_pParse.XnRangeReg -= _nReg
 79500  		goto _4
 79501  	}
 79502  	_i = _pParse.XnMem + int32(1)
 79503  	_pParse.XnMem += _nReg
 79504  _4:
 79505  	return _i
 79506  }
 79507  
 79508  // C comment
 79509  //  /*
 79510  //  ** Return true if any register in the range iFrom..iTo (inclusive)
 79511  //  ** is used as part of the column cache.
 79512  //  **
 79513  //  ** This routine is used within assert() and testcase() macros only
 79514  //  ** and does not appear in a normal build.
 79515  //  */
 79516  func _usedAsColumnCache(tls *crt.TLS, _pParse *XParse, _iFrom int32, _iTo int32) (r0 int32) {
 79517  	var _i, _1_r int32
 79518  	var _p *TyColCache
 79519  	*func() **TyColCache { _i = int32(0); return &_p }() = (*TyColCache)(unsafe.Pointer(&_pParse.XaColCache))
 79520  _0:
 79521  	if _i >= int32(_pParse.XnColCache) {
 79522  		goto _3
 79523  	}
 79524  	_1_r = _p.XiReg
 79525  	if (_1_r >= _iFrom) && (_1_r <= _iTo) {
 79526  		return int32(1)
 79527  	}
 79528  	*(*uintptr)(unsafe.Pointer(func() **TyColCache { _i += 1; return &_p }())) += uintptr(20)
 79529  	goto _0
 79530  _3:
 79531  	return int32(0)
 79532  }
 79533  
 79534  var _sqlite3GetTempRangeØ00__func__Ø000 [20]int8
 79535  
 79536  func init() {
 79537  	crt.Xstrncpy(nil, &_sqlite3GetTempRangeØ00__func__Ø000[0], str(99823), 20)
 79538  }
 79539  
 79540  // C comment
 79541  //  /*
 79542  //  ** Generate code that will push the record in registers regData
 79543  //  ** through regData+nData-1 onto the sorter.
 79544  //  */
 79545  func _pushOntoSorter(tls *crt.TLS, _pParse *XParse, _pSort *XSortCtx, _pSelect *XSelect, _regData int32, _regOrigData int32, _nData int32, _nPrefixReg int32) {
 79546  	var _bSeq, _nExpr, _nBase, _regBase, _regRecord, _nOBSat, _op, _iLimit, _5_regPrevKey, _5_addrFirst, _5_addrJmp, _5_nKey, _11_addr, _11_r1, _13_iBrk int32
 79547  	var _v *TVdbe
 79548  	var _5_pKI *XKeyInfo
 79549  	var _5_pOp *XVdbeOp
 79550  	_v = (*TVdbe)(_pParse.XpVdbe)
 79551  	_bSeq = bool2int((int32(_pSort.XsortFlags) & int32(1)) == int32(0))
 79552  	_nExpr = (*XExprList)(_pSort.XpOrderBy).XnExpr
 79553  	_nBase = (_nExpr + _bSeq) + _nData
 79554  	_regRecord = preInc2(&_pParse.XnMem, 1)
 79555  	_nOBSat = _pSort.XnOBSat
 79556  	func() {
 79557  		if _bSeq != int32(0) && _bSeq != int32(1) {
 79558  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117043), unsafe.Pointer(&_pushOntoSorterØ00__func__Ø000), unsafe.Pointer(str(99843)))
 79559  			crt.X__builtin_abort(tls)
 79560  		}
 79561  	}()
 79562  	func() {
 79563  		if _nData != int32(1) && _regData != _regOrigData && _regOrigData != int32(0) {
 79564  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117044), unsafe.Pointer(&_pushOntoSorterØ00__func__Ø000), unsafe.Pointer(str(99862)))
 79565  			crt.X__builtin_abort(tls)
 79566  		}
 79567  	}()
 79568  	if _nPrefixReg != 0 {
 79569  		func() {
 79570  			if _nPrefixReg != (_nExpr + _bSeq) {
 79571  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117046), unsafe.Pointer(&_pushOntoSorterØ00__func__Ø000), unsafe.Pointer(str(99913)))
 79572  				crt.X__builtin_abort(tls)
 79573  			}
 79574  		}()
 79575  		_regBase = (_regData - _nExpr) - _bSeq
 79576  		goto _10
 79577  	}
 79578  	_regBase = _pParse.XnMem + int32(1)
 79579  	_pParse.XnMem += _nBase
 79580  _10:
 79581  	func() {
 79582  		if _pSelect.XiOffset != int32(0) && _pSelect.XiLimit == int32(0) {
 79583  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117052), unsafe.Pointer(&_pushOntoSorterØ00__func__Ø000), unsafe.Pointer(str(99936)))
 79584  			crt.X__builtin_abort(tls)
 79585  		}
 79586  	}()
 79587  	_iLimit = func() int32 {
 79588  		if _pSelect.XiOffset != 0 {
 79589  			return (_pSelect.XiOffset + int32(1))
 79590  		}
 79591  		return _pSelect.XiLimit
 79592  	}()
 79593  	_pSort.XlabelDone = _sqlite3VdbeMakeLabel(tls, _v)
 79594  	_sqlite3ExprCodeExprList(tls, _pParse, (*XExprList)(_pSort.XpOrderBy), _regBase, _regOrigData, uint8(int32(1)|func() int32 {
 79595  		if _regOrigData != 0 {
 79596  			return int32(4)
 79597  		}
 79598  		return int32(0)
 79599  	}()))
 79600  	if _bSeq != 0 {
 79601  		_sqlite3VdbeAddOp2(tls, _v, int32(116), _pSort.XiECursor, _regBase+_nExpr)
 79602  	}
 79603  	if (_nPrefixReg == int32(0)) && (_nData > int32(0)) {
 79604  		_sqlite3ExprCodeMove(tls, _pParse, _regData, (_regBase+_nExpr)+_bSeq, _nData)
 79605  	}
 79606  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _regBase+_nOBSat, _nBase-_nOBSat, _regRecord)
 79607  	if _nOBSat <= int32(0) {
 79608  		goto _21
 79609  	}
 79610  	_5_regPrevKey = _pParse.XnMem + int32(1)
 79611  	_pParse.XnMem += _pSort.XnOBSat
 79612  	_5_nKey = (_nExpr - _pSort.XnOBSat) + _bSeq
 79613  	if _bSeq != 0 {
 79614  		_5_addrFirst = _sqlite3VdbeAddOp1(tls, _v, int32(22), _regBase+_nExpr)
 79615  		goto _23
 79616  	}
 79617  	_5_addrFirst = _sqlite3VdbeAddOp1(tls, _v, int32(112), _pSort.XiECursor)
 79618  _23:
 79619  	_sqlite3VdbeAddOp3(tls, _v, int32(98), _5_regPrevKey, _regBase, _pSort.XnOBSat)
 79620  	_5_pOp = _sqlite3VdbeGetOp(tls, _v, _pSort.XaddrSortIndex)
 79621  	if ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) != 0 {
 79622  		return
 79623  	}
 79624  	_5_pOp.Xp2 = _5_nKey + _nData
 79625  	_5_pKI = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_5_pOp.Xp4)))
 79626  	crt.Xmemset(tls, unsafe.Pointer(_5_pKI.XaSortOrder), int32(0), uint32(_5_pKI.XnField))
 79627  	_sqlite3VdbeChangeP4(tls, _v, int32(-1), (*int8)(unsafe.Pointer(_5_pKI)), int32(-5))
 79628  	*(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_5_pOp.Xp4)))) = _keyInfoFromExprList(tls, _pParse, (*XExprList)(_pSort.XpOrderBy), _nOBSat, int32(_5_pKI.XnXField)-int32(1))
 79629  	_5_addrJmp = _sqlite3VdbeCurrentAddr(tls, _v)
 79630  	_sqlite3VdbeAddOp3(tls, _v, int32(18), _5_addrJmp+int32(1), int32(0), _5_addrJmp+int32(1))
 79631  	_pSort.XlabelBkOut = _sqlite3VdbeMakeLabel(tls, _v)
 79632  	_pSort.XregReturn = preInc2(&_pParse.XnMem, 1)
 79633  	_sqlite3VdbeAddOp2(tls, _v, int32(14), _pSort.XregReturn, _pSort.XlabelBkOut)
 79634  	_sqlite3VdbeAddOp1(tls, _v, int32(135), _pSort.XiECursor)
 79635  	if _iLimit != 0 {
 79636  		_sqlite3VdbeAddOp2(tls, _v, int32(22), _iLimit, _pSort.XlabelDone)
 79637  	}
 79638  	_sqlite3VdbeJumpHere(tls, _v, _5_addrFirst)
 79639  	_sqlite3ExprCodeMove(tls, _pParse, _regBase, _5_regPrevKey, _pSort.XnOBSat)
 79640  	_sqlite3VdbeJumpHere(tls, _v, _5_addrJmp)
 79641  _21:
 79642  	if (int32(_pSort.XsortFlags) & int32(1)) != 0 {
 79643  		_op = int32(127)
 79644  		goto _27
 79645  	}
 79646  	_op = int32(128)
 79647  _27:
 79648  	_sqlite3VdbeAddOp4Int(tls, _v, _op, _pSort.XiECursor, _regRecord, _regBase+_nOBSat, _nBase-_nOBSat)
 79649  	if _iLimit == 0 {
 79650  		goto _28
 79651  	}
 79652  	_11_r1 = int32(0)
 79653  	_11_addr = _sqlite3VdbeAddOp1(tls, _v, int32(47), _iLimit)
 79654  	_sqlite3VdbeAddOp1(tls, _v, int32(33), _pSort.XiECursor)
 79655  	if _pSort.XbOrderedInnerLoop != 0 {
 79656  		_11_r1 = preInc2(&_pParse.XnMem, 1)
 79657  		_sqlite3VdbeAddOp3(tls, _v, int32(99), _pSort.XiECursor, _nExpr, _11_r1)
 79658  		_sqlite3VdbeComment(tls, _v, str(93782))
 79659  	}
 79660  	_sqlite3VdbeAddOp1(tls, _v, int32(120), _pSort.XiECursor)
 79661  	if _pSort.XbOrderedInnerLoop != 0 {
 79662  		_13_iBrk = _sqlite3VdbeCurrentAddr(tls, _v) + int32(2)
 79663  		_sqlite3VdbeAddOp3(tls, _v, int32(78), _regBase+_nExpr, _13_iBrk, _11_r1)
 79664  		_sqlite3VdbeChangeP5(tls, _v, uint16(128))
 79665  	}
 79666  	_sqlite3VdbeJumpHere(tls, _v, _11_addr)
 79667  _28:
 79668  }
 79669  
 79670  var _pushOntoSorterØ00__func__Ø000 [15]int8
 79671  
 79672  func init() {
 79673  	crt.Xstrncpy(nil, &_pushOntoSorterØ00__func__Ø000[0], str(99978), 15)
 79674  }
 79675  
 79676  // C comment
 79677  //  /*
 79678  //  ** Generate code to move content from registers iFrom...iFrom+nReg-1
 79679  //  ** over to iTo..iTo+nReg-1. Keep the column cache up-to-date.
 79680  //  */
 79681  func _sqlite3ExprCodeMove(tls *crt.TLS, _pParse *XParse, _iFrom int32, _iTo int32, _nReg int32) {
 79682  	func() {
 79683  		if _iFrom < (_iTo+_nReg) && (_iFrom+_nReg) > _iTo {
 79684  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94255), unsafe.Pointer(&_sqlite3ExprCodeMoveØ00__func__Ø000), unsafe.Pointer(str(99993)))
 79685  			crt.X__builtin_abort(tls)
 79686  		}
 79687  	}()
 79688  	_sqlite3VdbeAddOp3(tls, (*TVdbe)(_pParse.XpVdbe), int32(63), _iFrom, _iTo, _nReg)
 79689  	_sqlite3ExprCacheRemove(tls, _pParse, _iFrom, _nReg)
 79690  }
 79691  
 79692  var _sqlite3ExprCodeMoveØ00__func__Ø000 [20]int8
 79693  
 79694  func init() {
 79695  	crt.Xstrncpy(nil, &_sqlite3ExprCodeMoveØ00__func__Ø000[0], str(100028), 20)
 79696  }
 79697  
 79698  // C comment
 79699  //  /*
 79700  //  ** Given an expression list, generate a KeyInfo structure that records
 79701  //  ** the collating sequence for each expression in that expression list.
 79702  //  **
 79703  //  ** If the ExprList is an ORDER BY or GROUP BY clause then the resulting
 79704  //  ** KeyInfo structure is appropriate for initializing a virtual index to
 79705  //  ** implement that clause.  If the ExprList is the result set of a SELECT
 79706  //  ** then the KeyInfo structure is appropriate for initializing a virtual
 79707  //  ** index to implement a DISTINCT test.
 79708  //  **
 79709  //  ** Space to hold the KeyInfo structure is obtained from malloc.  The calling
 79710  //  ** function is responsible for seeing that this structure is eventually
 79711  //  ** freed.
 79712  //  */
 79713  func _keyInfoFromExprList(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _iStart int32, _nExtra int32) (r0 *XKeyInfo) {
 79714  	var _nExpr, _i int32
 79715  	var _db *Xsqlite3
 79716  	var _pItem *TExprList_item
 79717  	var _pInfo *XKeyInfo
 79718  	var _2_pColl *XCollSeq
 79719  	_db = (*Xsqlite3)(_pParse.Xdb)
 79720  	_nExpr = _pList.XnExpr
 79721  	_pInfo = _sqlite3KeyInfoAlloc(tls, _db, _nExpr-_iStart, _nExtra+int32(1))
 79722  	if _pInfo == nil {
 79723  		goto _0
 79724  	}
 79725  	func() {
 79726  		if _sqlite3KeyInfoIsWriteable(tls, _pInfo) == 0 {
 79727  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117632), unsafe.Pointer(&_keyInfoFromExprListØ00__func__Ø000), unsafe.Pointer(str(100048)))
 79728  			crt.X__builtin_abort(tls)
 79729  		}
 79730  	}()
 79731  	*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(20)))))))))))
 79732  _3:
 79733  	if _i >= _nExpr {
 79734  		goto _6
 79735  	}
 79736  	_2_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_pItem.XpExpr))
 79737  	if _2_pColl == nil {
 79738  		_2_pColl = (*XCollSeq)(_db.XpDfltColl)
 79739  	}
 79740  	*elem62((**XCollSeq)(unsafe.Pointer(&_pInfo.XaColl)), uintptr(_i-_iStart)) = _2_pColl
 79741  	*elem15(_pInfo.XaSortOrder, uintptr(_i-_iStart)) = _pItem.XsortOrder
 79742  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pItem }())) += uintptr(20)
 79743  	goto _3
 79744  _6:
 79745  _0:
 79746  	return _pInfo
 79747  }
 79748  
 79749  var _keyInfoFromExprListØ00__func__Ø000 [20]int8
 79750  
 79751  func init() {
 79752  	crt.Xstrncpy(nil, &_keyInfoFromExprListØ00__func__Ø000[0], str(100081), 20)
 79753  }
 79754  
 79755  func _sqlite3ReleaseTempRange(tls *crt.TLS, _pParse *XParse, _iReg int32, _nReg int32) {
 79756  	if _nReg == int32(1) {
 79757  		_sqlite3ReleaseTempReg(tls, _pParse, _iReg)
 79758  		return
 79759  	}
 79760  	_sqlite3ExprCacheRemove(tls, _pParse, _iReg, _nReg)
 79761  	if _nReg > _pParse.XnRangeReg {
 79762  		_pParse.XnRangeReg = _nReg
 79763  		_pParse.XiRangeReg = _iReg
 79764  	}
 79765  }
 79766  
 79767  // C comment
 79768  //  /*
 79769  //  ** Resolve label "x" to be the address of the next instruction to
 79770  //  ** be inserted.  The parameter "x" must have been obtained from
 79771  //  ** a prior call to sqlite3VdbeMakeLabel().
 79772  //  */
 79773  func _sqlite3VdbeResolveLabel(tls *crt.TLS, _v *TVdbe, _x int32) {
 79774  	var _j int32
 79775  	var _p *XParse
 79776  	_p = (*XParse)(_v.XpParse)
 79777  	_j = int32(-1) - _x
 79778  	func() {
 79779  		if _v.Xmagic != uint32(381479589) {
 79780  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71803), unsafe.Pointer(&_sqlite3VdbeResolveLabelØ00__func__Ø000), unsafe.Pointer(str(44852)))
 79781  			crt.X__builtin_abort(tls)
 79782  		}
 79783  	}()
 79784  	func() {
 79785  		if _j >= _p.XnLabel {
 79786  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71804), unsafe.Pointer(&_sqlite3VdbeResolveLabelØ00__func__Ø000), unsafe.Pointer(str(100101)))
 79787  			crt.X__builtin_abort(tls)
 79788  		}
 79789  	}()
 79790  	func() {
 79791  		if _j < int32(0) {
 79792  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71805), unsafe.Pointer(&_sqlite3VdbeResolveLabelØ00__func__Ø000), unsafe.Pointer(str(100113)))
 79793  			crt.X__builtin_abort(tls)
 79794  		}
 79795  	}()
 79796  	if _p.XaLabel != nil {
 79797  		*elem8(_p.XaLabel, uintptr(_j)) = _v.XnOp
 79798  	}
 79799  }
 79800  
 79801  var _sqlite3VdbeResolveLabelØ00__func__Ø000 [24]int8
 79802  
 79803  func init() {
 79804  	crt.Xstrncpy(nil, &_sqlite3VdbeResolveLabelØ00__func__Ø000[0], str(100118), 24)
 79805  }
 79806  
 79807  // C comment
 79808  //  /* Forward references */
 79809  func _multiSelectOrderBy(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectDest) (r0 int32) {
 79810  	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
 79811  	var _aPermute *int32
 79812  	var _db *Xsqlite3
 79813  	var _v *TVdbe
 79814  	var _pOrderBy *XExprList
 79815  	var _2_pItem, _5_pItem *TExprList_item
 79816  	var _pPrior, _24_pFirst *XSelect
 79817  	var _4_pNew *XExpr
 79818  	var _pKeyDup, _pKeyMerge *XKeyInfo
 79819  	var _destA, _destB XSelectDest
 79820  	_addrOutB = int32(0)
 79821  	_pKeyDup = nil
 79822  	func() {
 79823  		if (*XExprList)(_p.XpOrderBy) == nil {
 79824  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119400), unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000), unsafe.Pointer(str(100142)))
 79825  			crt.X__builtin_abort(tls)
 79826  		}
 79827  	}()
 79828  	func() {
 79829  		if _pKeyDup != nil {
 79830  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119401), unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000), unsafe.Pointer(str(100157)))
 79831  			crt.X__builtin_abort(tls)
 79832  		}
 79833  	}()
 79834  	_db = (*Xsqlite3)(_pParse.Xdb)
 79835  	_v = (*TVdbe)(_pParse.XpVdbe)
 79836  	func() {
 79837  		if _v == nil {
 79838  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119404), unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000), unsafe.Pointer(str(42019)))
 79839  			crt.X__builtin_abort(tls)
 79840  		}
 79841  	}()
 79842  	_labelEnd = _sqlite3VdbeMakeLabel(tls, _v)
 79843  	_labelCmpr = _sqlite3VdbeMakeLabel(tls, _v)
 79844  	_op = int32(_p.Xop)
 79845  	_pPrior = (*XSelect)(_p.XpPrior)
 79846  	func() {
 79847  		if (*XExprList)(_pPrior.XpOrderBy) != nil {
 79848  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119413), unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000), unsafe.Pointer(str(100168)))
 79849  			crt.X__builtin_abort(tls)
 79850  		}
 79851  	}()
 79852  	_pOrderBy = (*XExprList)(_p.XpOrderBy)
 79853  	func() {
 79854  		if _pOrderBy == nil {
 79855  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119415), unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000), unsafe.Pointer(str(100188)))
 79856  			crt.X__builtin_abort(tls)
 79857  		}
 79858  	}()
 79859  	_nOrderBy = _pOrderBy.XnExpr
 79860  	if _op == int32(116) {
 79861  		goto _10
 79862  	}
 79863  	_i = int32(1)
 79864  _11:
 79865  	if int32(_db.XmallocFailed) != int32(0) || _i > ((*XExprList)(_p.XpEList).XnExpr) {
 79866  		goto _15
 79867  	}
 79868  	*func() **TExprList_item { _j = int32(0); return &_2_pItem }() = (*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa))
 79869  _16:
 79870  	if _j >= _nOrderBy {
 79871  		goto _19
 79872  	}
 79873  	func() {
 79874  		if int32((*t71)(unsafe.Pointer(&_2_pItem.Xu)).XiOrderByCol) <= int32(0) {
 79875  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119426), unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000), unsafe.Pointer(str(100197)))
 79876  			crt.X__builtin_abort(tls)
 79877  		}
 79878  	}()
 79879  	if int32((*t71)(unsafe.Pointer(&_2_pItem.Xu)).XiOrderByCol) == _i {
 79880  		goto _19
 79881  	}
 79882  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _j += 1; return &_2_pItem }())) += uintptr(20)
 79883  	goto _16
 79884  _19:
 79885  	if _j != _nOrderBy {
 79886  		goto _23
 79887  	}
 79888  	_4_pNew = _sqlite3Expr(tls, _db, int32(134), nil)
 79889  	if _4_pNew == nil {
 79890  		return _sqlite3NomemError(tls, int32(119431))
 79891  	}
 79892  	_4_pNew.Xflags |= uint32(1024)
 79893  	*(*int32)(unsafe.Pointer(&_4_pNew.Xu)) = _i
 79894  	*(**XExprList)(unsafe.Pointer(&_p.XpOrderBy)) = store70(&_pOrderBy, _sqlite3ExprListAppend(tls, _pParse, _pOrderBy, _4_pNew))
 79895  	if _pOrderBy != nil {
 79896  		(*t71)(unsafe.Pointer(&(elem57((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(postInc2(&_nOrderBy, 1))).Xu))).XiOrderByCol = uint16(_i)
 79897  	}
 79898  _23:
 79899  	_i += 1
 79900  	goto _11
 79901  _15:
 79902  _10:
 79903  	_aPermute = (*int32)(_sqlite3DbMallocRawNN(tls, _db, uint64(uint32(4)*uint32(_nOrderBy+int32(1)))))
 79904  	if _aPermute == nil {
 79905  		goto _26
 79906  	}
 79907  	*elem8(_aPermute, 0) = _nOrderBy
 79908  	*func() **TExprList_item { _i = int32(1); return &_5_pItem }() = (*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa))
 79909  _27:
 79910  	if _i > _nOrderBy {
 79911  		goto _30
 79912  	}
 79913  	func() {
 79914  		if int32((*t71)(unsafe.Pointer(&_5_pItem.Xu)).XiOrderByCol) <= int32(0) {
 79915  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119452), unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000), unsafe.Pointer(str(100197)))
 79916  			crt.X__builtin_abort(tls)
 79917  		}
 79918  	}()
 79919  	func() {
 79920  		if int32((*t71)(unsafe.Pointer(&_5_pItem.Xu)).XiOrderByCol) > ((*XExprList)(_p.XpEList).XnExpr) {
 79921  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119453), unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000), unsafe.Pointer(str(100222)))
 79922  			crt.X__builtin_abort(tls)
 79923  		}
 79924  	}()
 79925  	*elem8(_aPermute, uintptr(_i)) = int32((*t71)(unsafe.Pointer(&_5_pItem.Xu)).XiOrderByCol) - int32(1)
 79926  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_5_pItem }())) += uintptr(20)
 79927  	goto _27
 79928  _30:
 79929  	_pKeyMerge = _multiSelectOrderByKeyInfo(tls, _pParse, _p, int32(1))
 79930  	goto _35
 79931  _26:
 79932  	_pKeyMerge = nil
 79933  _35:
 79934  	*(**XExprList)(unsafe.Pointer(&_p.XpOrderBy)) = _pOrderBy
 79935  	*(**XExprList)(unsafe.Pointer(&_pPrior.XpOrderBy)) = _sqlite3ExprListDup(tls, (*Xsqlite3)(_pParse.Xdb), _pOrderBy, int32(0))
 79936  	if _op == int32(116) {
 79937  		_regPrev = int32(0)
 79938  		goto _37
 79939  	}
 79940  	_9_nExpr = (*XExprList)(_p.XpEList).XnExpr
 79941  	func() {
 79942  		if _nOrderBy < _9_nExpr && _db.XmallocFailed == 0 {
 79943  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119474), unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000), unsafe.Pointer(str(100263)))
 79944  			crt.X__builtin_abort(tls)
 79945  		}
 79946  	}()
 79947  	_regPrev = _pParse.XnMem + int32(1)
 79948  	_pParse.XnMem += _9_nExpr + int32(1)
 79949  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _regPrev)
 79950  	_pKeyDup = _sqlite3KeyInfoAlloc(tls, _db, _9_nExpr, int32(1))
 79951  	if _pKeyDup == nil {
 79952  		goto _41
 79953  	}
 79954  	func() {
 79955  		if _sqlite3KeyInfoIsWriteable(tls, _pKeyDup) == 0 {
 79956  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119480), unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000), unsafe.Pointer(str(100299)))
 79957  			crt.X__builtin_abort(tls)
 79958  		}
 79959  	}()
 79960  	_i = int32(0)
 79961  _44:
 79962  	if _i >= _9_nExpr {
 79963  		goto _47
 79964  	}
 79965  	*elem62((**XCollSeq)(unsafe.Pointer(&_pKeyDup.XaColl)), uintptr(_i)) = _multiSelectCollSeq(tls, _pParse, _p, _i)
 79966  	*elem15(_pKeyDup.XaSortOrder, uintptr(_i)) = 0
 79967  	_i += 1
 79968  	goto _44
 79969  _47:
 79970  _41:
 79971  _37:
 79972  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = nil
 79973  	*(**XSelect)(unsafe.Pointer(&_pPrior.XpNext)) = nil
 79974  	_sqlite3ResolveOrderGroupBy(tls, _pParse, _p, (*XExprList)(_p.XpOrderBy), str(25700))
 79975  	if (*XSelect)(_pPrior.XpPrior) == nil {
 79976  		_sqlite3ResolveOrderGroupBy(tls, _pParse, _pPrior, (*XExprList)(_pPrior.XpOrderBy), str(25700))
 79977  	}
 79978  	_computeLimitRegisters(tls, _pParse, _p, _labelEnd)
 79979  	if _p.XiLimit != 0 && (_op == int32(116)) {
 79980  		_regLimitA = preInc2(&_pParse.XnMem, 1)
 79981  		_regLimitB = preInc2(&_pParse.XnMem, 1)
 79982  		_sqlite3VdbeAddOp2(tls, _v, int32(64), func() int32 {
 79983  			if _p.XiOffset != 0 {
 79984  				return (_p.XiOffset + int32(1))
 79985  			}
 79986  			return _p.XiLimit
 79987  		}(), _regLimitA)
 79988  		_sqlite3VdbeAddOp2(tls, _v, int32(64), _regLimitA, _regLimitB)
 79989  		goto _53
 79990  	}
 79991  	_regLimitA = store2(&_regLimitB, int32(0))
 79992  _53:
 79993  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.XpLimit))
 79994  	*(**XExpr)(unsafe.Pointer(&_p.XpLimit)) = nil
 79995  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.XpOffset))
 79996  	*(**XExpr)(unsafe.Pointer(&_p.XpOffset)) = nil
 79997  	_regAddrA = preInc2(&_pParse.XnMem, 1)
 79998  	_regAddrB = preInc2(&_pParse.XnMem, 1)
 79999  	_regOutA = preInc2(&_pParse.XnMem, 1)
 80000  	_regOutB = preInc2(&_pParse.XnMem, 1)
 80001  	_sqlite3SelectDestInit(tls, &_destA, int32(13), _regAddrA)
 80002  	_sqlite3SelectDestInit(tls, &_destB, int32(13), _regAddrB)
 80003  	_addrSelectA = _sqlite3VdbeCurrentAddr(tls, _v) + int32(1)
 80004  	_addr1 = _sqlite3VdbeAddOp3(tls, _v, int32(15), _regAddrA, int32(0), _addrSelectA)
 80005  	_sqlite3VdbeComment(tls, _v, str(100334))
 80006  	_pPrior.XiLimit = _regLimitA
 80007  	_iSub1 = _pParse.XiNextSelectId
 80008  	_sqlite3Select(tls, _pParse, _pPrior, &_destA)
 80009  	_sqlite3VdbeEndCoroutine(tls, _v, _regAddrA)
 80010  	_sqlite3VdbeJumpHere(tls, _v, _addr1)
 80011  	_addrSelectB = _sqlite3VdbeCurrentAddr(tls, _v) + int32(1)
 80012  	_addr1 = _sqlite3VdbeAddOp3(tls, _v, int32(15), _regAddrB, int32(0), _addrSelectB)
 80013  	_sqlite3VdbeComment(tls, _v, str(100346))
 80014  	_savedLimit = _p.XiLimit
 80015  	_savedOffset = _p.XiOffset
 80016  	_p.XiLimit = _regLimitB
 80017  	_p.XiOffset = int32(0)
 80018  	_iSub2 = _pParse.XiNextSelectId
 80019  	_sqlite3Select(tls, _pParse, _p, &_destB)
 80020  	_p.XiLimit = _savedLimit
 80021  	_p.XiOffset = _savedOffset
 80022  	_sqlite3VdbeEndCoroutine(tls, _v, _regAddrB)
 80023  	_sqlite3VdbeNoopComment(tls, _v, str(100359))
 80024  	_addrOutA = _generateOutputSubroutine(tls, _pParse, _p, &_destA, _pDest, _regOutA, _regPrev, _pKeyDup, _labelEnd)
 80025  	if (_op == int32(116)) || (_op == int32(115)) {
 80026  		_sqlite3VdbeNoopComment(tls, _v, str(100380))
 80027  		_addrOutB = _generateOutputSubroutine(tls, _pParse, _p, &_destB, _pDest, _regOutB, _regPrev, _pKeyDup, _labelEnd)
 80028  	}
 80029  	_sqlite3KeyInfoUnref(tls, _pKeyDup)
 80030  	if (_op == int32(117)) || (_op == int32(118)) {
 80031  		_addrEofA_noB = store2(&_addrEofA, _labelEnd)
 80032  		goto _58
 80033  	}
 80034  	_sqlite3VdbeNoopComment(tls, _v, str(100401))
 80035  	_addrEofA = _sqlite3VdbeAddOp2(tls, _v, int32(14), _regOutB, _addrOutB)
 80036  	_addrEofA_noB = _sqlite3VdbeAddOp2(tls, _v, int32(16), _regAddrB, _labelEnd)
 80037  	_sqlite3VdbeGoto(tls, _v, _addrEofA)
 80038  	_p.XnSelectRow = _sqlite3LogEstAdd(tls, _p.XnSelectRow, _pPrior.XnSelectRow)
 80039  _58:
 80040  	if _op != int32(118) {
 80041  		goto _59
 80042  	}
 80043  	_addrEofB = _addrEofA
 80044  	if int32(_p.XnSelectRow) > int32(_pPrior.XnSelectRow) {
 80045  		_p.XnSelectRow = _pPrior.XnSelectRow
 80046  	}
 80047  	goto _61
 80048  _59:
 80049  	_sqlite3VdbeNoopComment(tls, _v, str(100418))
 80050  	_addrEofB = _sqlite3VdbeAddOp2(tls, _v, int32(14), _regOutA, _addrOutA)
 80051  	_sqlite3VdbeAddOp2(tls, _v, int32(16), _regAddrA, _labelEnd)
 80052  	_sqlite3VdbeGoto(tls, _v, _addrEofB)
 80053  _61:
 80054  	_sqlite3VdbeNoopComment(tls, _v, str(100435))
 80055  	_addrAltB = _sqlite3VdbeAddOp2(tls, _v, int32(14), _regOutA, _addrOutA)
 80056  	_sqlite3VdbeAddOp2(tls, _v, int32(16), _regAddrA, _addrEofA)
 80057  	_sqlite3VdbeGoto(tls, _v, _labelCmpr)
 80058  	if _op == int32(116) {
 80059  		_addrAeqB = _addrAltB
 80060  		goto _65
 80061  	}
 80062  	if _op == int32(118) {
 80063  		_addrAeqB = _addrAltB
 80064  		_addrAltB += 1
 80065  		goto _65
 80066  	}
 80067  	_sqlite3VdbeNoopComment(tls, _v, str(100453))
 80068  	_addrAeqB = _sqlite3VdbeAddOp2(tls, _v, int32(16), _regAddrA, _addrEofA)
 80069  	_sqlite3VdbeGoto(tls, _v, _labelCmpr)
 80070  _65:
 80071  	_sqlite3VdbeNoopComment(tls, _v, str(100471))
 80072  	_addrAgtB = _sqlite3VdbeCurrentAddr(tls, _v)
 80073  	if (_op == int32(116)) || (_op == int32(115)) {
 80074  		_sqlite3VdbeAddOp2(tls, _v, int32(14), _regOutB, _addrOutB)
 80075  	}
 80076  	_sqlite3VdbeAddOp2(tls, _v, int32(16), _regAddrB, _addrEofB)
 80077  	_sqlite3VdbeGoto(tls, _v, _labelCmpr)
 80078  	_sqlite3VdbeJumpHere(tls, _v, _addr1)
 80079  	_sqlite3VdbeAddOp2(tls, _v, int32(16), _regAddrA, _addrEofA_noB)
 80080  	_sqlite3VdbeAddOp2(tls, _v, int32(16), _regAddrB, _addrEofB)
 80081  	_sqlite3VdbeResolveLabel(tls, _v, _labelCmpr)
 80082  	_sqlite3VdbeAddOp4(tls, _v, int32(96), int32(0), int32(0), int32(0), (*int8)(unsafe.Pointer(_aPermute)), int32(-12))
 80083  	_sqlite3VdbeAddOp4(tls, _v, int32(98), _destA.XiSdst, _destB.XiSdst, _nOrderBy, (*int8)(unsafe.Pointer(_pKeyMerge)), int32(-5))
 80084  	_sqlite3VdbeChangeP5(tls, _v, uint16(1))
 80085  	_sqlite3VdbeAddOp3(tls, _v, int32(18), _addrAltB, _addrAeqB, _addrAgtB)
 80086  	_sqlite3VdbeResolveLabel(tls, _v, _labelEnd)
 80087  	if int32(_pDest.XeDest) != int32(9) {
 80088  		goto _68
 80089  	}
 80090  	_24_pFirst = _pPrior
 80091  _69:
 80092  	if _24_pFirst.XpPrior != nil {
 80093  		_24_pFirst = (*XSelect)(_24_pFirst.XpPrior)
 80094  		goto _69
 80095  	}
 80096  	_generateColumnNames(tls, _pParse, (*XSrcList)(_24_pFirst.XpSrc), (*XExprList)(_24_pFirst.XpEList))
 80097  _68:
 80098  	if _p.XpPrior != nil {
 80099  		_sqlite3SelectDelete(tls, _db, (*XSelect)(_p.XpPrior))
 80100  	}
 80101  	*(**XSelect)(unsafe.Pointer(&_p.XpPrior)) = _pPrior
 80102  	*(**XSelect)(unsafe.Pointer(&_pPrior.XpNext)) = _p
 80103  	_explainComposite(tls, _pParse, int32(_p.Xop), _iSub1, _iSub2, int32(0))
 80104  	return bool2int(_pParse.XnErr != int32(0))
 80105  }
 80106  
 80107  var _multiSelectOrderByØ00__func__Ø000 [19]int8
 80108  
 80109  func init() {
 80110  	crt.Xstrncpy(nil, &_multiSelectOrderByØ00__func__Ø000[0], str(100489), 19)
 80111  }
 80112  
 80113  // C comment
 80114  //  /* Insert the end of a co-routine
 80115  //  */
 80116  func _sqlite3VdbeEndCoroutine(tls *crt.TLS, _v *TVdbe, _regYield int32) {
 80117  	_sqlite3VdbeAddOp1(tls, _v, int32(53), _regYield)
 80118  	(*XParse)(_v.XpParse).XnTempReg = 0
 80119  	(*XParse)(_v.XpParse).XnRangeReg = int32(0)
 80120  }
 80121  
 80122  func _sqlite3VdbeNoopComment(tls *crt.TLS, _p *TVdbe, _zFormat *int8, args ...interface{}) {
 80123  	var _ap []interface{}
 80124  	if _p != nil {
 80125  		_sqlite3VdbeAddOp0(tls, _p, int32(164))
 80126  		_ap = args
 80127  		_vdbeVComment(tls, _p, _zFormat, _ap)
 80128  		_ap = nil
 80129  	}
 80130  }
 80131  
 80132  // C comment
 80133  //  /*
 80134  //  ** Code an output subroutine for a coroutine implementation of a
 80135  //  ** SELECT statment.
 80136  //  **
 80137  //  ** The data to be output is contained in pIn->iSdst.  There are
 80138  //  ** pIn->nSdst columns to be output.  pDest is where the output should
 80139  //  ** be sent.
 80140  //  **
 80141  //  ** regReturn is the number of the register holding the subroutine
 80142  //  ** return address.
 80143  //  **
 80144  //  ** If regPrev>0 then it is the first register in a vector that
 80145  //  ** records the previous output.  mem[regPrev] is a flag that is false
 80146  //  ** if there has been no previous output.  If regPrev>0 then code is
 80147  //  ** generated to suppress duplicates.  pKeyInfo is used for comparing
 80148  //  ** keys.
 80149  //  **
 80150  //  ** If the LIMIT found in p->iLimit is reached, jump immediately to
 80151  //  ** iBreak.
 80152  //  */
 80153  func _generateOutputSubroutine(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pIn *XSelectDest, _pDest *XSelectDest, _regReturn int32, _regPrev int32, _pKeyInfo *XKeyInfo, _iBreak int32) (r0 int32) {
 80154  	var _iContinue, _addr, _1_addr1, _1_addr2, _3_r1, _3_r2, _4_r1 int32
 80155  	var _v *TVdbe
 80156  	_v = (*TVdbe)(_pParse.XpVdbe)
 80157  	_addr = _sqlite3VdbeCurrentAddr(tls, _v)
 80158  	_iContinue = _sqlite3VdbeMakeLabel(tls, _v)
 80159  	if _regPrev != 0 {
 80160  		_1_addr1 = _sqlite3VdbeAddOp1(tls, _v, int32(22), _regPrev)
 80161  		_1_addr2 = _sqlite3VdbeAddOp4(tls, _v, int32(98), _pIn.XiSdst, _regPrev+int32(1), _pIn.XnSdst, (*int8)(unsafe.Pointer(_sqlite3KeyInfoRef(tls, _pKeyInfo))), int32(-5))
 80162  		_sqlite3VdbeAddOp3(tls, _v, int32(18), _1_addr2+int32(2), _iContinue, _1_addr2+int32(2))
 80163  		_sqlite3VdbeJumpHere(tls, _v, _1_addr1)
 80164  		_sqlite3VdbeAddOp3(tls, _v, int32(64), _pIn.XiSdst, _regPrev+int32(1), _pIn.XnSdst-int32(1))
 80165  		_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(1), _regPrev)
 80166  	}
 80167  	if ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) != 0 {
 80168  		return int32(0)
 80169  	}
 80170  	_codeOffset(tls, _v, _p.XiOffset, _iContinue)
 80171  	func() {
 80172  		if int32(_pDest.XeDest) == int32(3) {
 80173  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119182), unsafe.Pointer(&_generateOutputSubroutineØ00__func__Ø000), unsafe.Pointer(str(100508)))
 80174  			crt.X__builtin_abort(tls)
 80175  		}
 80176  	}()
 80177  	func() {
 80178  		if int32(_pDest.XeDest) == int32(14) {
 80179  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119183), unsafe.Pointer(&_generateOutputSubroutineØ00__func__Ø000), unsafe.Pointer(str(100533)))
 80180  			crt.X__builtin_abort(tls)
 80181  		}
 80182  	}()
 80183  	switch int32(_pDest.XeDest) {
 80184  	case int32(10):
 80185  		goto _9
 80186  	case int32(11):
 80187  		goto _8
 80188  	case int32(12):
 80189  		goto _7
 80190  	case int32(13):
 80191  		goto _10
 80192  	default:
 80193  		goto _11
 80194  	}
 80195  
 80196  _7:
 80197  	_3_r1 = _sqlite3GetTempReg(tls, _pParse)
 80198  	_3_r2 = _sqlite3GetTempReg(tls, _pParse)
 80199  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _pIn.XiSdst, _pIn.XnSdst, _3_r1)
 80200  	_sqlite3VdbeAddOp2(tls, _v, int32(117), _pDest.XiSDParm, _3_r2)
 80201  	_sqlite3VdbeAddOp3(tls, _v, int32(118), _pDest.XiSDParm, _3_r1, _3_r2)
 80202  	_sqlite3VdbeChangeP5(tls, _v, uint16(8))
 80203  	_sqlite3ReleaseTempReg(tls, _pParse, _3_r2)
 80204  	_sqlite3ReleaseTempReg(tls, _pParse, _3_r1)
 80205  	goto _12
 80206  _8:
 80207  	_4_r1 = _sqlite3GetTempReg(tls, _pParse)
 80208  	_sqlite3VdbeAddOp4(tls, _v, int32(101), _pIn.XiSdst, _pIn.XnSdst, _4_r1, _pDest.XzAffSdst, _pIn.XnSdst)
 80209  	_sqlite3ExprCacheAffinityChange(tls, _pParse, _pIn.XiSdst, _pIn.XnSdst)
 80210  	_sqlite3VdbeAddOp4Int(tls, _v, int32(128), _pDest.XiSDParm, _4_r1, _pIn.XiSdst, _pIn.XnSdst)
 80211  	_sqlite3ReleaseTempReg(tls, _pParse, _4_r1)
 80212  	goto _12
 80213  _9:
 80214  	func() {
 80215  		if _pIn.XnSdst != int32(1) && _pParse.XnErr <= int32(0) {
 80216  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119220), unsafe.Pointer(&_generateOutputSubroutineØ00__func__Ø000), unsafe.Pointer(str(100557)))
 80217  			crt.X__builtin_abort(tls)
 80218  		}
 80219  	}()
 80220  	_sqlite3ExprCodeMove(tls, _pParse, _pIn.XiSdst, _pDest.XiSDParm, int32(1))
 80221  	goto _12
 80222  _10:
 80223  	if _pDest.XiSdst == int32(0) {
 80224  		_pDest.XiSdst = _sqlite3GetTempRange(tls, _pParse, _pIn.XnSdst)
 80225  		_pDest.XnSdst = _pIn.XnSdst
 80226  	}
 80227  	_sqlite3ExprCodeMove(tls, _pParse, _pIn.XiSdst, _pDest.XiSdst, _pIn.XnSdst)
 80228  	_sqlite3VdbeAddOp1(tls, _v, int32(16), _pDest.XiSDParm)
 80229  	goto _12
 80230  _11:
 80231  	func() {
 80232  		if int32(_pDest.XeDest) != int32(9) {
 80233  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(119249), unsafe.Pointer(&_generateOutputSubroutineØ00__func__Ø000), unsafe.Pointer(str(100589)))
 80234  			crt.X__builtin_abort(tls)
 80235  		}
 80236  	}()
 80237  	_sqlite3VdbeAddOp2(tls, _v, int32(67), _pIn.XiSdst, _pIn.XnSdst)
 80238  	_sqlite3ExprCacheAffinityChange(tls, _pParse, _pIn.XiSdst, _pIn.XnSdst)
 80239  	goto _12
 80240  _12:
 80241  	if _p.XiLimit != 0 {
 80242  		_sqlite3VdbeAddOp2(tls, _v, int32(48), _p.XiLimit, _iBreak)
 80243  	}
 80244  	_sqlite3VdbeResolveLabel(tls, _v, _iContinue)
 80245  	_sqlite3VdbeAddOp1(tls, _v, int32(52), _regReturn)
 80246  	return _addr
 80247  }
 80248  
 80249  // C comment
 80250  //  /*
 80251  //  ** Make a new pointer to a KeyInfo object
 80252  //  */
 80253  func _sqlite3KeyInfoRef(tls *crt.TLS, _p *XKeyInfo) (r0 *XKeyInfo) {
 80254  	if _p != nil {
 80255  		func() {
 80256  			if _p.XnRef <= (0) {
 80257  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117587), unsafe.Pointer(&_sqlite3KeyInfoRefØ00__func__Ø000), unsafe.Pointer(str(13812)))
 80258  				crt.X__builtin_abort(tls)
 80259  			}
 80260  		}()
 80261  		_p.XnRef += 1
 80262  	}
 80263  	return _p
 80264  }
 80265  
 80266  var _sqlite3KeyInfoRefØ00__func__Ø000 [18]int8
 80267  
 80268  func init() {
 80269  	crt.Xstrncpy(nil, &_sqlite3KeyInfoRefØ00__func__Ø000[0], str(100614), 18)
 80270  }
 80271  
 80272  var _generateOutputSubroutineØ00__func__Ø000 [25]int8
 80273  
 80274  func init() {
 80275  	crt.Xstrncpy(nil, &_generateOutputSubroutineØ00__func__Ø000[0], str(100632), 25)
 80276  }
 80277  
 80278  // C comment
 80279  //  /*
 80280  //  ** Find (an approximate) sum of two LogEst values.  This computation is
 80281  //  ** not a simple "+" operator because LogEst is stored as a logarithmic
 80282  //  ** value.
 80283  //  **
 80284  //  */
 80285  func _sqlite3LogEstAdd(tls *crt.TLS, _a int16, _b int16) (r0 int16) {
 80286  	if int32(_a) < int32(_b) {
 80287  		goto _0
 80288  	}
 80289  	if int32(_a) > (int32(_b) + int32(49)) {
 80290  		return _a
 80291  	}
 80292  	if int32(_a) > (int32(_b) + int32(31)) {
 80293  		return int16(int32(_a) + int32(1))
 80294  	}
 80295  	return int16(int32(_a) + int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3LogEstAddØ00xØ001)), uintptr(int32(_a)-int32(_b)))))
 80296  
 80297  _0:
 80298  	if int32(_b) > (int32(_a) + int32(49)) {
 80299  		return _b
 80300  	}
 80301  	if int32(_b) > (int32(_a) + int32(31)) {
 80302  		return int16(int32(_b) + int32(1))
 80303  	}
 80304  	return int16(int32(_b) + int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3LogEstAddØ00xØ001)), uintptr(int32(_b)-int32(_a)))))
 80305  }
 80306  
 80307  var _sqlite3LogEstAddØ00xØ001 [32]uint8
 80308  
 80309  func init() {
 80310  	_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}
 80311  }
 80312  
 80313  // C comment
 80314  //  /*
 80315  //  ** Generate code that will tell the VDBE the names of columns
 80316  //  ** in the result set.  This information is used to provide the
 80317  //  ** azCol[] values in the callback.
 80318  //  */
 80319  func _generateColumnNames(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pEList *XExprList) {
 80320  	var _i, _fullNames, _shortNames, _4_iCol int32
 80321  	var _3_zName, _4_zCol, _8_zName, _10_z *int8
 80322  	var _db *Xsqlite3
 80323  	var _pTab *XTable
 80324  	var _v *TVdbe
 80325  	var _2_p *XExpr
 80326  	_v = (*TVdbe)(_pParse.XpVdbe)
 80327  	_db = (*Xsqlite3)(_pParse.Xdb)
 80328  	if _pParse.Xexplain != 0 {
 80329  		return
 80330  	}
 80331  	if (_pParse.XcolNamesSet != 0) || (_db.XmallocFailed != 0) {
 80332  		return
 80333  	}
 80334  	func() {
 80335  		if _v == nil {
 80336  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118115), unsafe.Pointer(&_generateColumnNamesØ00__func__Ø000), unsafe.Pointer(str(42019)))
 80337  			crt.X__builtin_abort(tls)
 80338  		}
 80339  	}()
 80340  	func() {
 80341  		if _pTabList == nil {
 80342  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118116), unsafe.Pointer(&_generateColumnNamesØ00__func__Ø000), unsafe.Pointer(str(100657)))
 80343  			crt.X__builtin_abort(tls)
 80344  		}
 80345  	}()
 80346  	_pParse.XcolNamesSet = uint8(1)
 80347  	_fullNames = bool2int((_db.Xflags & int32(4)) != int32(0))
 80348  	_shortNames = bool2int((_db.Xflags & int32(64)) != int32(0))
 80349  	_sqlite3VdbeSetNumCols(tls, _v, _pEList.XnExpr)
 80350  	_i = int32(0)
 80351  _7:
 80352  	if _i >= _pEList.XnExpr {
 80353  		goto _10
 80354  	}
 80355  	_2_p = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XpExpr)
 80356  	if func() int32 {
 80357  		if _2_p == nil {
 80358  			return func() int32 {
 80359  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118124), unsafe.Pointer(&_generateColumnNamesØ00__func__Ø000), unsafe.Pointer(str(4809)))
 80360  				crt.X__builtin_abort(tls)
 80361  				return int32(1)
 80362  			}()
 80363  		}
 80364  		return int32(0)
 80365  	}() != 0 {
 80366  		goto _8
 80367  	}
 80368  	if (elem57((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XzName) != nil {
 80369  		_3_zName = elem57((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XzName
 80370  		_sqlite3VdbeSetColName(tls, _v, _i, int32(0), _3_zName, *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
 80371  		goto _31
 80372  	}
 80373  	if int32(_2_p.Xop) != int32(152) && int32(_2_p.Xop) != int32(154) || store72(&_pTab, _tableWithCursor(tls, _pTabList, _2_p.XiTable)) == nil {
 80374  		goto _18
 80375  	}
 80376  	_4_iCol = int32(_2_p.XiColumn)
 80377  	if _4_iCol < int32(0) {
 80378  		_4_iCol = int32(_pTab.XiPKey)
 80379  	}
 80380  	func() {
 80381  		if _4_iCol != int32(-1) && (_4_iCol < int32(0) || _4_iCol >= int32(_pTab.XnCol)) {
 80382  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(118134), unsafe.Pointer(&_generateColumnNamesØ00__func__Ø000), unsafe.Pointer(str(94534)))
 80383  			crt.X__builtin_abort(tls)
 80384  		}
 80385  	}()
 80386  	if _4_iCol < int32(0) {
 80387  		_4_zCol = str(27182)
 80388  		goto _25
 80389  	}
 80390  	_4_zCol = elem41((*XColumn)(_pTab.XaCol), uintptr(_4_iCol)).XzName
 80391  _25:
 80392  	if (_shortNames == 0) && (_fullNames == 0) {
 80393  		_sqlite3VdbeSetColName(tls, _v, _i, int32(0), _sqlite3DbStrDup(tls, _db, elem57((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XzSpan), func() func(*crt.TLS, unsafe.Pointer) {
 80394  			v := _sqlite3MallocSize
 80395  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
 80396  		}())
 80397  		goto _30
 80398  	}
 80399  	if _fullNames != 0 {
 80400  		_8_zName = nil
 80401  		_8_zName = _sqlite3MPrintf(tls, _db, str(7919), unsafe.Pointer(_pTab.XzName), unsafe.Pointer(_4_zCol))
 80402  		_sqlite3VdbeSetColName(tls, _v, _i, int32(0), _8_zName, func() func(*crt.TLS, unsafe.Pointer) {
 80403  			v := _sqlite3MallocSize
 80404  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
 80405  		}())
 80406  		goto _30
 80407  	}
 80408  	_sqlite3VdbeSetColName(tls, _v, _i, int32(0), _4_zCol, *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
 80409  _30:
 80410  	goto _31
 80411  _18:
 80412  	_10_z = elem57((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XzSpan
 80413  	_10_z = func() *int8 {
 80414  		if _10_z == nil {
 80415  			return _sqlite3MPrintf(tls, _db, str(100669), _i+int32(1))
 80416  		}
 80417  		return _sqlite3DbStrDup(tls, _db, _10_z)
 80418  	}()
 80419  	_sqlite3VdbeSetColName(tls, _v, _i, int32(0), _10_z, func() func(*crt.TLS, unsafe.Pointer) {
 80420  		v := _sqlite3MallocSize
 80421  		return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
 80422  	}())
 80423  _31:
 80424  _8:
 80425  	_i += 1
 80426  	goto _7
 80427  _10:
 80428  	_generateColumnTypes(tls, _pParse, _pTabList, _pEList)
 80429  }
 80430  
 80431  var _generateColumnNamesØ00__func__Ø000 [20]int8
 80432  
 80433  func init() {
 80434  	crt.Xstrncpy(nil, &_generateColumnNamesØ00__func__Ø000[0], str(100678), 20)
 80435  }
 80436  
 80437  // C comment
 80438  //  /*
 80439  //  ** Return the Table objecct in the SrcList that has cursor iCursor.
 80440  //  ** Or return NULL if no such Table object exists in the SrcList.
 80441  //  */
 80442  func _tableWithCursor(tls *crt.TLS, _pList *XSrcList, _iCursor int32) (r0 *XTable) {
 80443  	var _j int32
 80444  	_j = int32(0)
 80445  _0:
 80446  	if _j >= _pList.XnSrc {
 80447  		goto _3
 80448  	}
 80449  	if (elem6((*TSrcList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_j)).XiCursor) == _iCursor {
 80450  		return (*XTable)(elem6((*TSrcList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_j)).XpTab)
 80451  	}
 80452  	_j += 1
 80453  	goto _0
 80454  _3:
 80455  	return nil
 80456  }
 80457  
 80458  // C comment
 80459  //  /*
 80460  //  ** Generate code that will tell the VDBE the declaration types of columns
 80461  //  ** in the result set.
 80462  //  */
 80463  func _generateColumnTypes(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pEList *XExprList) {
 80464  	var _i int32
 80465  	var _1_zType *int8
 80466  	var _v *TVdbe
 80467  	var _1_p *XExpr
 80468  	var _sNC XNameContext
 80469  	_v = (*TVdbe)(_pParse.XpVdbe)
 80470  	*(**XSrcList)(unsafe.Pointer(&_sNC.XpSrcList)) = _pTabList
 80471  	*(**XParse)(unsafe.Pointer(&_sNC.XpParse)) = _pParse
 80472  	*(**XNameContext)(unsafe.Pointer(&_sNC.XpNext)) = nil
 80473  	_i = int32(0)
 80474  _0:
 80475  	if _i >= _pEList.XnExpr {
 80476  		goto _3
 80477  	}
 80478  	_1_p = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XpExpr)
 80479  	_1_zType = _columnTypeImpl(tls, &_sNC, _1_p, nil)
 80480  	_sqlite3VdbeSetColName(tls, _v, _i, int32(1), _1_zType, *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
 80481  	_i += 1
 80482  	goto _0
 80483  _3:
 80484  }
 80485  
 80486  // C comment
 80487  //  /*
 80488  //  ** Unless an "EXPLAIN QUERY PLAN" command is being processed, this function
 80489  //  ** is a no-op. Otherwise, it adds a single row of output to the EQP result,
 80490  //  ** where the caption is of one of the two forms:
 80491  //  **
 80492  //  **   "COMPOSITE SUBQUERIES iSub1 and iSub2 (op)"
 80493  //  **   "COMPOSITE SUBQUERIES iSub1 and iSub2 USING TEMP B-TREE (op)"
 80494  //  **
 80495  //  ** where iSub1 and iSub2 are the integers passed as the corresponding
 80496  //  ** function parameters, and op is the text representation of the parameter
 80497  //  ** of the same name. The parameter "op" must be one of TK_UNION, TK_EXCEPT,
 80498  //  ** TK_INTERSECT or TK_ALL. The first form is used if argument bUseTmp is
 80499  //  ** false, or the second form if it is true.
 80500  //  */
 80501  func _explainComposite(tls *crt.TLS, _pParse *XParse, _op int32, _iSub1 int32, _iSub2 int32, _bUseTmp int32) {
 80502  	var _1_zMsg *int8
 80503  	var _1_v *TVdbe
 80504  	func() {
 80505  		if _op != int32(115) && _op != int32(117) && _op != int32(118) && _op != int32(116) {
 80506  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117714), unsafe.Pointer(&_explainCompositeØ00__func__Ø000), unsafe.Pointer(str(100698)))
 80507  			crt.X__builtin_abort(tls)
 80508  		}
 80509  	}()
 80510  	if int32(_pParse.Xexplain) == int32(2) {
 80511  		_1_v = (*TVdbe)(_pParse.XpVdbe)
 80512  		_1_zMsg = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.Xdb), str(100762), _iSub1, _iSub2, unsafe.Pointer(func() *int8 {
 80513  			if _bUseTmp != 0 {
 80514  				return str(100799)
 80515  			}
 80516  			return str(284)
 80517  		}()), unsafe.Pointer(_selectOpName(tls, _op)))
 80518  		_sqlite3VdbeAddOp4(tls, _1_v, int32(165), _pParse.XiSelectId, int32(0), int32(0), _1_zMsg, int32(-1))
 80519  	}
 80520  }
 80521  
 80522  var _explainCompositeØ00__func__Ø000 [17]int8
 80523  
 80524  func init() {
 80525  	crt.Xstrncpy(nil, &_explainCompositeØ00__func__Ø000[0], str(100818), 17)
 80526  }
 80527  
 80528  // C comment
 80529  //  /*
 80530  //  ** Return the maximum height of any expression tree referenced
 80531  //  ** by the select statement passed as an argument.
 80532  //  */
 80533  func _sqlite3SelectExprHeight(tls *crt.TLS, _p *XSelect) (r0 int32) {
 80534  	var _nHeight int32
 80535  	_nHeight = int32(0)
 80536  	_heightOfSelect(tls, _p, &_nHeight)
 80537  	return _nHeight
 80538  }
 80539  
 80540  // C comment
 80541  //  /*
 80542  //  ** Make copies of relevant WHERE clause terms of the outer query into
 80543  //  ** the WHERE clause of subquery.  Example:
 80544  //  **
 80545  //  **    SELECT * FROM (SELECT a AS x, c-d AS y FROM t1) WHERE x=5 AND y=10;
 80546  //  **
 80547  //  ** Transformed into:
 80548  //  **
 80549  //  **    SELECT * FROM (SELECT a AS x, c-d AS y FROM t1 WHERE a=5 AND c-d=10)
 80550  //  **     WHERE x=5 AND y=10;
 80551  //  **
 80552  //  ** The hope is that the terms added to the inner query will make it more
 80553  //  ** efficient.
 80554  //  **
 80555  //  ** Do not attempt this optimization if:
 80556  //  **
 80557  //  **   (1) The inner query is an aggregate.  (In that case, we'd really want
 80558  //  **       to copy the outer WHERE-clause terms onto the HAVING clause of the
 80559  //  **       inner query.  But they probably won't help there so do not bother.)
 80560  //  **
 80561  //  **   (2) The inner query is the recursive part of a common table expression.
 80562  //  **
 80563  //  **   (3) The inner query has a LIMIT clause (since the changes to the WHERE
 80564  //  **       close would change the meaning of the LIMIT).
 80565  //  **
 80566  //  **   (4) The inner query is the right operand of a LEFT JOIN.  (The caller
 80567  //  **       enforces this restriction since this routine does not have enough
 80568  //  **       information to know.)
 80569  //  **
 80570  //  **   (5) The WHERE clause expression originates in the ON or USING clause
 80571  //  **       of a LEFT JOIN.
 80572  //  **
 80573  //  ** Return 0 if no changes are made and non-zero if one or more WHERE clause
 80574  //  ** terms are duplicated into the subquery.
 80575  //  */
 80576  func _pushDownWhereTerms(tls *crt.TLS, _pParse *XParse, _pSubq *XSelect, _pWhere *XExpr, _iCursor int32) (r0 int32) {
 80577  	var _nChng int32
 80578  	var _pX *XSelect
 80579  	var _pNew *XExpr
 80580  	var _6_x XSubstContext
 80581  	_nChng = int32(0)
 80582  	if _pWhere == nil {
 80583  		return int32(0)
 80584  	}
 80585  	_pX = _pSubq
 80586  _1:
 80587  	if _pX == nil {
 80588  		goto _4
 80589  	}
 80590  	if (_pX.XselFlags & uint32(8200)) != (0) {
 80591  		return int32(0)
 80592  	}
 80593  	_pX = (*XSelect)(_pX.XpPrior)
 80594  	goto _1
 80595  _4:
 80596  	if (*XExpr)(_pSubq.XpLimit) != nil {
 80597  		return int32(0)
 80598  	}
 80599  _6:
 80600  	if int32(_pWhere.Xop) == int32(71) {
 80601  		_nChng += _pushDownWhereTerms(tls, _pParse, _pSubq, (*XExpr)(_pWhere.XpRight), _iCursor)
 80602  		_pWhere = (*XExpr)(_pWhere.XpLeft)
 80603  		goto _6
 80604  	}
 80605  	if (_pWhere.Xflags & uint32(1)) != (0) {
 80606  		return int32(0)
 80607  	}
 80608  	if _sqlite3ExprIsTableConstant(tls, _pWhere, _iCursor) == 0 {
 80609  		goto _10
 80610  	}
 80611  	_nChng += 1
 80612  _11:
 80613  	if _pSubq != nil {
 80614  		_pNew = _sqlite3ExprDup(tls, (*Xsqlite3)(_pParse.Xdb), _pWhere, int32(0))
 80615  		*(**XParse)(unsafe.Pointer(&_6_x.XpParse)) = _pParse
 80616  		_6_x.XiTable = _iCursor
 80617  		_6_x.XiNewTable = _iCursor
 80618  		_6_x.XisLeftJoin = int32(0)
 80619  		*(**XExprList)(unsafe.Pointer(&_6_x.XpEList)) = (*XExprList)(_pSubq.XpEList)
 80620  		_pNew = _substExpr(tls, &_6_x, _pNew)
 80621  		*(**XExpr)(unsafe.Pointer(&_pSubq.XpWhere)) = _sqlite3ExprAnd(tls, (*Xsqlite3)(_pParse.Xdb), (*XExpr)(_pSubq.XpWhere), _pNew)
 80622  		_pSubq = (*XSelect)(_pSubq.XpPrior)
 80623  		goto _11
 80624  	}
 80625  _10:
 80626  	return _nChng
 80627  }
 80628  
 80629  // C comment
 80630  //  /*
 80631  //  ** Walk an expression tree.  Return non-zero if the expression is constant
 80632  //  ** for any single row of the table with cursor iCur.  In other words, the
 80633  //  ** expression must not refer to any non-deterministic function nor any
 80634  //  ** table other than iCur.
 80635  //  */
 80636  func _sqlite3ExprIsTableConstant(tls *crt.TLS, _p *XExpr, _iCur int32) (r0 int32) {
 80637  	return _exprIsConst(tls, _p, int32(3), _iCur)
 80638  }
 80639  
 80640  // C comment
 80641  //  /*
 80642  //  ** Mark all temporary registers as being unavailable for reuse.
 80643  //  */
 80644  func _sqlite3ClearTempRegCache(tls *crt.TLS, _pParse *XParse) {
 80645  	_pParse.XnTempReg = 0
 80646  	_pParse.XnRangeReg = int32(0)
 80647  }
 80648  
 80649  // C comment
 80650  //  /*
 80651  //  ** Check to see if the pThis entry of pTabList is a self-join of a prior view.
 80652  //  ** If it is, then return the SrcList_item for the prior view.  If it is not,
 80653  //  ** then return 0.
 80654  //  */
 80655  func _isSelfJoinView(tls *crt.TLS, _pTabList *XSrcList, _pThis *TSrcList_item) (r0 *TSrcList_item) {
 80656  	var _pItem *TSrcList_item
 80657  	_pItem = (*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa))
 80658  _0:
 80659  	if crt.P2U(unsafe.Pointer(_pItem)) >= crt.P2U(unsafe.Pointer(_pThis)) {
 80660  		goto _3
 80661  	}
 80662  	if (*XSelect)(_pItem.XpSelect) == nil {
 80663  		goto _1
 80664  	}
 80665  	if ((uint32((_pItem.Xfg.XnotIndexed)>>4) << 31) >> 31) != 0 {
 80666  		goto _1
 80667  	}
 80668  	if _pItem.XzName == nil {
 80669  		goto _1
 80670  	}
 80671  	if Xsqlite3_stricmp(tls, _pItem.XzDatabase, _pThis.XzDatabase) != int32(0) {
 80672  		goto _1
 80673  	}
 80674  	if Xsqlite3_stricmp(tls, _pItem.XzName, _pThis.XzName) != int32(0) {
 80675  		goto _1
 80676  	}
 80677  	if _sqlite3ExprCompare(tls, (*XExpr)((*XSelect)(_pThis.XpSelect).XpWhere), (*XExpr)((*XSelect)(_pItem.XpSelect).XpWhere), int32(-1)) != 0 {
 80678  		goto _1
 80679  	}
 80680  	return _pItem
 80681  
 80682  _1:
 80683  	*(*uintptr)(unsafe.Pointer(&_pItem)) += uintptr(68)
 80684  	goto _0
 80685  _3:
 80686  	return nil
 80687  }
 80688  
 80689  func _sqlite3VdbeChangeP1(tls *crt.TLS, _p *TVdbe, _addr uint32, _val int32) {
 80690  	_sqlite3VdbeGetOp(tls, _p, int32(_addr)).Xp1 = _val
 80691  }
 80692  
 80693  // C comment
 80694  //  /*
 80695  //  ** Change the value of the opcode, or P1, P2, P3, or P5 operands
 80696  //  ** for a specific instruction.
 80697  //  */
 80698  func _sqlite3VdbeChangeOpcode(tls *crt.TLS, _p *TVdbe, _addr uint32, _iNewOpcode uint8) {
 80699  	_sqlite3VdbeGetOp(tls, _p, int32(_addr)).Xopcode = _iNewOpcode
 80700  }
 80701  
 80702  // C comment
 80703  //  /*
 80704  //  ** Generate the beginning of the loop used for WHERE clause processing.
 80705  //  ** The return value is a pointer to an opaque structure that contains
 80706  //  ** information needed to terminate the loop.  Later, the calling routine
 80707  //  ** should invoke sqlite3WhereEnd() with the return value of this function
 80708  //  ** in order to complete the WHERE clause processing.
 80709  //  **
 80710  //  ** If an error occurs, this routine returns NULL.
 80711  //  **
 80712  //  ** The basic idea is to do a nested loop, one loop for each table in
 80713  //  ** the FROM clause of a select.  (INSERT and UPDATE statements are the
 80714  //  ** same as a SELECT with only a single table in the FROM clause.)  For
 80715  //  ** example, if the SQL is this:
 80716  //  **
 80717  //  **       SELECT * FROM t1, t2, t3 WHERE ...;
 80718  //  **
 80719  //  ** Then the code generated is conceptually like the following:
 80720  //  **
 80721  //  **      foreach row1 in t1 do       \    Code generated
 80722  //  **        foreach row2 in t2 do      |-- by sqlite3WhereBegin()
 80723  //  **          foreach row3 in t3 do   /
 80724  //  **            ...
 80725  //  **          end                     \    Code generated
 80726  //  **        end                        |-- by sqlite3WhereEnd()
 80727  //  **      end                         /
 80728  //  **
 80729  //  ** Note that the loops might not be nested in the order in which they
 80730  //  ** appear in the FROM clause if a different order is better able to make
 80731  //  ** use of indices.  Note also that when the IN operator appears in
 80732  //  ** the WHERE clause, it might result in additional nested loops for
 80733  //  ** scanning through all values on the right-hand side of the IN.
 80734  //  **
 80735  //  ** There are Btree cursors associated with each table.  t1 uses cursor
 80736  //  ** number pTabList->a[0].iCursor.  t2 uses the cursor pTabList->a[1].iCursor.
 80737  //  ** And so forth.  This routine generates code to open those VDBE cursors
 80738  //  ** and sqlite3WhereEnd() generates the code to close them.
 80739  //  **
 80740  //  ** The code that sqlite3WhereBegin() generates leaves the cursors named
 80741  //  ** in pTabList pointing at their appropriate entries.  The [...] code
 80742  //  ** can use OP_Column and OP_Rowid opcodes on these cursors to extract
 80743  //  ** data from the various tables of the loop.
 80744  //  **
 80745  //  ** If the WHERE clause is empty, the foreach loops must each scan their
 80746  //  ** entire tables.  Thus a three-way join is an O(N^3) operation.  But if
 80747  //  ** the tables have indices and there are terms in the WHERE clause that
 80748  //  ** refer to those indices, a complete table scan can be avoided and the
 80749  //  ** code will run much faster.  Most of the work of this routine is checking
 80750  //  ** to see if there are indices that can be used to speed up the loop.
 80751  //  **
 80752  //  ** Terms of the WHERE clause are also used to limit which rows actually
 80753  //  ** make it to the "..." in the middle of the loop.  After each "foreach",
 80754  //  ** terms of the WHERE clause that use only terms in that loop and outer
 80755  //  ** loops are evaluated and if false a jump is made around all subsequent
 80756  //  ** inner loops (or around the "..." if the test occurs within the inner-
 80757  //  ** most loop)
 80758  //  **
 80759  //  ** OUTER JOINS
 80760  //  **
 80761  //  ** An outer join of tables t1 and t2 is conceptally coded as follows:
 80762  //  **
 80763  //  **    foreach row1 in t1 do
 80764  //  **      flag = 0
 80765  //  **      foreach row2 in t2 do
 80766  //  **        start:
 80767  //  **          ...
 80768  //  **          flag = 1
 80769  //  **      end
 80770  //  **      if flag==0 then
 80771  //  **        move the row2 cursor to a null row
 80772  //  **        goto start
 80773  //  **      fi
 80774  //  **    end
 80775  //  **
 80776  //  ** ORDER BY CLAUSE PROCESSING
 80777  //  **
 80778  //  ** pOrderBy is a pointer to the ORDER BY clause (or the GROUP BY clause
 80779  //  ** if the WHERE_GROUPBY flag is set in wctrlFlags) of a SELECT statement
 80780  //  ** if there is one.  If there is no ORDER BY clause or if this routine
 80781  //  ** is called from an UPDATE or DELETE statement, then pOrderBy is NULL.
 80782  //  **
 80783  //  ** The iIdxCur parameter is the cursor number of an index.  If
 80784  //  ** WHERE_OR_SUBCLAUSE is set, iIdxCur is the cursor number of an index
 80785  //  ** to use for OR clause processing.  The WHERE clause should use this
 80786  //  ** specific cursor.  If WHERE_ONEPASS_DESIRED is set, then iIdxCur is
 80787  //  ** the first cursor in an array of cursors for all indices.  iIdxCur should
 80788  //  ** be used to compute the appropriate cursor depending on which index is
 80789  //  ** used.
 80790  //  */
 80791  func _sqlite3WhereBegin(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pWhere *XExpr, _pOrderBy *XExprList, _pResultSet *XExprList, _wctrlFlags uint16, _iAuxArg int32) (r0 *XWhereInfo) {
 80792  	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
 80793  	var _notReady, _9_m, _17_tabUsed, _33_b uint64
 80794  	var _29_pVTab *int8
 80795  	var _bFordelete uint8
 80796  	var _db *Xsqlite3
 80797  	var _27_pTab *XTable
 80798  	var _v *TVdbe
 80799  	var _27_pTabItem *TSrcList_item
 80800  	var _37_pIx, _39_pJ *XIndex
 80801  	var _pWInfo *XWhereInfo
 80802  	var _pLoop *XWhereLoop
 80803  	var _pLevel *XWhereLevel
 80804  	var _19_pTerm, _19_pEnd *XWhereTerm
 80805  	var _pMaskSet *XWhereMaskSet
 80806  	var _sWLB XWhereLoopBuilder
 80807  	_v = (*TVdbe)(_pParse.XpVdbe)
 80808  	_bFordelete = uint8(0)
 80809  	func() {
 80810  		if (int32(_wctrlFlags)&int32(8)) != int32(0) && ((int32(_wctrlFlags)&int32(4)) == int32(0) || (int32(_wctrlFlags)&int32(32)) != int32(0)) {
 80811  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134785), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(100835)))
 80812  			crt.X__builtin_abort(tls)
 80813  		}
 80814  	}()
 80815  	func() {
 80816  		if (int32(_wctrlFlags)&int32(32)) != int32(0) && (int32(_wctrlFlags)&int32(16384)) != int32(0) {
 80817  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134791), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(100963)))
 80818  			crt.X__builtin_abort(tls)
 80819  		}
 80820  	}()
 80821  	_db = (*Xsqlite3)(_pParse.Xdb)
 80822  	crt.Xmemset(tls, unsafe.Pointer(&_sWLB), int32(0), uint32(24))
 80823  	if (_pOrderBy != nil) && (_pOrderBy.XnExpr >= int32(64)) {
 80824  		_pOrderBy = nil
 80825  	}
 80826  	*(**XExprList)(unsafe.Pointer(&_sWLB.XpOrderBy)) = _pOrderBy
 80827  	if (int32(_db.XdbOptFlags) & int32(32)) != int32(0) {
 80828  		{
 80829  			p := &_wctrlFlags
 80830  			*p = uint16(int32(*p) & int32(-257))
 80831  		}
 80832  	}
 80833  	if _pTabList.XnSrc > int32(64) {
 80834  		_sqlite3ErrorMsg(tls, _pParse, str(101037), int32(64))
 80835  		return nil
 80836  	}
 80837  	_nTabList = func() int32 {
 80838  		if (int32(_wctrlFlags) & int32(32)) != 0 {
 80839  			return int32(1)
 80840  		}
 80841  		return _pTabList.XnSrc
 80842  	}()
 80843  	_nByteWInfo = int32(((uint32(820) + (uint32(_nTabList-int32(1)) * uint32(76))) + uint32(7)) & uint32(4294967288))
 80844  	_pWInfo = (*XWhereInfo)(_sqlite3DbMallocRawNN(tls, _db, uint64(uint32(_nByteWInfo)+uint32(72))))
 80845  	if _db.XmallocFailed != 0 {
 80846  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_pWInfo))
 80847  		_pWInfo = nil
 80848  		goto _whereBeginError
 80849  	}
 80850  	*(**XParse)(unsafe.Pointer(&_pWInfo.XpParse)) = _pParse
 80851  	*(**XSrcList)(unsafe.Pointer(&_pWInfo.XpTabList)) = _pTabList
 80852  	*(**XExprList)(unsafe.Pointer(&_pWInfo.XpOrderBy)) = _pOrderBy
 80853  	*(**XExpr)(unsafe.Pointer(&_pWInfo.XpWhere)) = _pWhere
 80854  	*(**XExprList)(unsafe.Pointer(&_pWInfo.XpResultSet)) = _pResultSet
 80855  	*elem8((*int32)(unsafe.Pointer(&_pWInfo.XaiCurOnePass)), 0) = store2(elem8((*int32)(unsafe.Pointer(&_pWInfo.XaiCurOnePass)), uintptr(1)), int32(-1))
 80856  	_pWInfo.XnLevel = uint8(_nTabList)
 80857  	_pWInfo.XiBreak = store2(&_pWInfo.XiContinue, _sqlite3VdbeMakeLabel(tls, _v))
 80858  	_pWInfo.XwctrlFlags = _wctrlFlags
 80859  	_pWInfo.XiLimit = int16(_iAuxArg)
 80860  	_pWInfo.XsavedNQueryLoop = int32(_pParse.XnQueryLoop)
 80861  	crt.Xmemset(tls, unsafe.Pointer(&_pWInfo.XnOBSat), int32(0), uint32(29))
 80862  	crt.Xmemset(tls, unsafe.Pointer(elem99((*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa)), 0)), int32(0), uint32(72)+(uint32(_nTabList)*uint32(76)))
 80863  	func() {
 80864  		if int32(_pWInfo.XeOnePass) != int32(0) {
 80865  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134853), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(101065)))
 80866  			crt.X__builtin_abort(tls)
 80867  		}
 80868  	}()
 80869  	_pMaskSet = &_pWInfo.XsMaskSet
 80870  	*(**XWhereInfo)(unsafe.Pointer(&_sWLB.XpWInfo)) = _pWInfo
 80871  	*(**XWhereClause)(unsafe.Pointer(&_sWLB.XpWC)) = &_pWInfo.XsWC
 80872  	*(**XWhereLoop)(unsafe.Pointer(&_sWLB.XpNew)) = (*XWhereLoop)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pWInfo)) + uintptr(_nByteWInfo)))))
 80873  	func() {
 80874  		if (int32(uintptr(_sWLB.XpNew)) & int32(7)) != int32(0) {
 80875  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134858), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(101095)))
 80876  			crt.X__builtin_abort(tls)
 80877  		}
 80878  	}()
 80879  	_whereLoopInit(tls, (*XWhereLoop)(_sWLB.XpNew))
 80880  	(*XWhereLoop)(_sWLB.XpNew).XcId = int8(42)
 80881  	_pMaskSet.Xn = int32(0)
 80882  	_sqlite3WhereClauseInit(tls, &_pWInfo.XsWC, _pWInfo)
 80883  	_sqlite3WhereSplit(tls, &_pWInfo.XsWC, _pWhere, uint8(71))
 80884  	_ii = int32(0)
 80885  _18:
 80886  	if _ii >= ((*XWhereClause)(_sWLB.XpWC).XnTerm) {
 80887  		goto _21
 80888  	}
 80889  	if (_nTabList == int32(0)) || _sqlite3ExprIsConstantNotJoin(tls, (*XExpr)(elem100((*XWhereTerm)((*XWhereClause)(_sWLB.XpWC).Xa), uintptr(_ii)).XpExpr)) != 0 {
 80890  		_sqlite3ExprIfFalse(tls, _pParse, (*XExpr)(elem100((*XWhereTerm)((*XWhereClause)(_sWLB.XpWC).Xa), uintptr(_ii)).XpExpr), _pWInfo.XiBreak, int32(16))
 80891  		{
 80892  			p := &(elem100((*XWhereTerm)((*XWhereClause)(_sWLB.XpWC).Xa), uintptr(_ii)).XwtFlags)
 80893  			*p = uint16(int32(*p) | int32(4))
 80894  		}
 80895  	}
 80896  	_ii += 1
 80897  	goto _18
 80898  _21:
 80899  	if _nTabList != int32(0) {
 80900  		goto _24
 80901  	}
 80902  	if _pOrderBy != nil {
 80903  		_pWInfo.XnOBSat = int8(_pOrderBy.XnExpr)
 80904  	}
 80905  	if (int32(_wctrlFlags) & int32(256)) != 0 {
 80906  		_pWInfo.XeDistinct = uint8(1)
 80907  	}
 80908  _24:
 80909  	_ii = int32(0)
 80910  _27:
 80911  	if _ii >= _pTabList.XnSrc {
 80912  		goto _30
 80913  	}
 80914  	_createMask(tls, _pMaskSet, elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_ii)).XiCursor)
 80915  	_sqlite3WhereTabFuncArgs(tls, _pParse, elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_ii)), &_pWInfo.XsWC)
 80916  	_ii += 1
 80917  	goto _27
 80918  _30:
 80919  	_ii = int32(0)
 80920  _31:
 80921  	if _ii >= _pTabList.XnSrc {
 80922  		goto _34
 80923  	}
 80924  	_9_m = _sqlite3WhereGetMask(tls, _pMaskSet, elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_ii)).XiCursor)
 80925  	func() {
 80926  		if _9_m != (uint64(1) << uint(_ii)) {
 80927  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134912), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(101127)))
 80928  			crt.X__builtin_abort(tls)
 80929  		}
 80930  	}()
 80931  	_ii += 1
 80932  	goto _31
 80933  _34:
 80934  	_sqlite3WhereExprAnalyze(tls, _pTabList, &_pWInfo.XsWC)
 80935  	if _db.XmallocFailed != 0 {
 80936  		goto _whereBeginError
 80937  	}
 80938  	if (int32(_wctrlFlags) & int32(256)) == 0 {
 80939  		goto _38
 80940  	}
 80941  	if _isDistinctRedundant(tls, _pParse, _pTabList, &_pWInfo.XsWC, _pResultSet) != 0 {
 80942  		_pWInfo.XeDistinct = uint8(1)
 80943  		goto _41
 80944  	}
 80945  	if _pOrderBy == nil {
 80946  		{
 80947  			p := &_pWInfo.XwctrlFlags
 80948  			*p = uint16(int32(*p) | int32(128))
 80949  		}
 80950  		*(**XExprList)(unsafe.Pointer(&_pWInfo.XpOrderBy)) = _pResultSet
 80951  	}
 80952  _41:
 80953  _38:
 80954  	if _nTabList == int32(1) && _whereShortCut(tls, &_sWLB) != int32(0) {
 80955  		goto _43
 80956  	}
 80957  	_rc = _whereLoopAddAll(tls, &_sWLB)
 80958  	if _rc != 0 {
 80959  		goto _whereBeginError
 80960  	}
 80961  	_wherePathSolver(tls, _pWInfo, 0)
 80962  	if _db.XmallocFailed != 0 {
 80963  		goto _whereBeginError
 80964  	}
 80965  	if _pWInfo.XpOrderBy == nil {
 80966  		goto _46
 80967  	}
 80968  	_wherePathSolver(tls, _pWInfo, int16(int32(_pWInfo.XnRowOut)+int32(1)))
 80969  	if _db.XmallocFailed != 0 {
 80970  		goto _whereBeginError
 80971  	}
 80972  _46:
 80973  _43:
 80974  	if ((*XExprList)(_pWInfo.XpOrderBy) == nil) && ((_db.Xflags & int32(131072)) != int32(0)) {
 80975  		_pWInfo.XrevMask = uint64(18446744073709551615)
 80976  	}
 80977  	if _pParse.XnErr != 0 || func() int32 {
 80978  		if _db.XmallocFailed != 0 {
 80979  			return func() int32 {
 80980  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134972), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(4809)))
 80981  				crt.X__builtin_abort(tls)
 80982  				return int32(1)
 80983  			}()
 80984  		}
 80985  		return int32(0)
 80986  	}() != 0 {
 80987  		goto _whereBeginError
 80988  	}
 80989  	if int32(_pWInfo.XnLevel) < int32(2) || _pResultSet == nil || (int32(_db.XdbOptFlags)&int32(1024)) != int32(0) {
 80990  		goto _56
 80991  	}
 80992  	_17_tabUsed = _sqlite3WhereExprListUsage(tls, _pMaskSet, _pResultSet)
 80993  	if _sWLB.XpOrderBy != nil {
 80994  		_17_tabUsed |= _sqlite3WhereExprListUsage(tls, _pMaskSet, (*XExprList)(_sWLB.XpOrderBy))
 80995  	}
 80996  _57:
 80997  	if int32(_pWInfo.XnLevel) < int32(2) {
 80998  		goto _59
 80999  	}
 81000  	_pLoop = (*XWhereLoop)(elem99((*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa)), uintptr(int32(_pWInfo.XnLevel)-int32(1))).XpWLoop)
 81001  	if (int32((elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.XpTabList).Xa))), uintptr(_pLoop.XiTab)).Xfg).Xjointype) & int32(8)) == int32(0) {
 81002  		goto _59
 81003  	}
 81004  	if ((int32(_wctrlFlags) & int32(256)) == int32(0)) && ((_pLoop.XwsFlags & uint32(4096)) == (0)) {
 81005  		goto _59
 81006  	}
 81007  	if (_17_tabUsed & _pLoop.XmaskSelf) != (0) {
 81008  		goto _59
 81009  	}
 81010  	_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(48)))))))))))
 81011  	_19_pTerm = (*XWhereTerm)((*XWhereClause)(_sWLB.XpWC).Xa)
 81012  _64:
 81013  	if crt.P2U(unsafe.Pointer(_19_pTerm)) >= crt.P2U(unsafe.Pointer(_19_pEnd)) {
 81014  		goto _67
 81015  	}
 81016  	if ((_19_pTerm.XprereqAll & _pLoop.XmaskSelf) != (0)) && ((((*XExpr)(_19_pTerm.XpExpr).Xflags) & uint32(1)) == (0)) {
 81017  		goto _67
 81018  	}
 81019  	*(*uintptr)(unsafe.Pointer(&_19_pTerm)) += uintptr(48)
 81020  	goto _64
 81021  _67:
 81022  	if crt.P2U(unsafe.Pointer(_19_pTerm)) < crt.P2U(unsafe.Pointer(_19_pEnd)) {
 81023  		goto _59
 81024  	}
 81025  	_pWInfo.XnLevel -= 1
 81026  	_nTabList -= 1
 81027  	goto _57
 81028  _59:
 81029  _56:
 81030  	(*XParse)(_pWInfo.XpParse).XnQueryLoop += uint32(_pWInfo.XnRowOut)
 81031  	func() {
 81032  		if (int32(_wctrlFlags)&int32(4)) != int32(0) && int32(_pWInfo.XnLevel) != int32(1) {
 81033  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135040), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(101142)))
 81034  			crt.X__builtin_abort(tls)
 81035  		}
 81036  	}()
 81037  	if (int32(_wctrlFlags) & int32(4)) == int32(0) {
 81038  		goto _74
 81039  	}
 81040  	_23_wsFlags = int32((*XWhereLoop)(elem99((*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa)), 0).XpWLoop).XwsFlags)
 81041  	_23_bOnerow = bool2int((_23_wsFlags & int32(4096)) != int32(0))
 81042  	if _23_bOnerow == 0 && ((int32(_wctrlFlags)&int32(8)) == int32(0) || int32(0) != (_23_wsFlags&int32(1024))) {
 81043  		goto _77
 81044  	}
 81045  	_pWInfo.XeOnePass = uint8(func() int32 {
 81046  		if _23_bOnerow != 0 {
 81047  			return int32(1)
 81048  		}
 81049  		return int32(2)
 81050  	}())
 81051  	if (((*XTable)(elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), 0).XpTab).XtabFlags)&uint32(32)) != (0) || (_23_wsFlags&int32(64)) == 0 {
 81052  		goto _81
 81053  	}
 81054  	if (int32(_wctrlFlags) & int32(8)) != 0 {
 81055  		_bFordelete = uint8(8)
 81056  	}
 81057  	(*XWhereLoop)(elem99((*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa)), 0).XpWLoop).XwsFlags = uint32(_23_wsFlags & int32(-65))
 81058  _81:
 81059  _77:
 81060  _74:
 81061  	*func() **XWhereLevel { _ii = int32(0); return &_pLevel }() = (*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa))
 81062  _83:
 81063  	if _ii >= _nTabList {
 81064  		goto _86
 81065  	}
 81066  	_27_pTabItem = elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_pLevel.XiFrom))
 81067  	_27_pTab = (*XTable)(_27_pTabItem.XpTab)
 81068  	_27_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_27_pTab.XpSchema))
 81069  	_pLoop = (*XWhereLoop)(_pLevel.XpWLoop)
 81070  	if ((_27_pTab.XtabFlags & uint32(2)) != (0)) || (_27_pTab.XpSelect != nil) {
 81071  		goto _108
 81072  	}
 81073  	if (_pLoop.XwsFlags & uint32(1024)) != (0) {
 81074  		_29_pVTab = (*int8)(unsafe.Pointer(_sqlite3GetVTable(tls, _db, _27_pTab)))
 81075  		_29_iCur = _27_pTabItem.XiCursor
 81076  		_sqlite3VdbeAddOp4(tls, _v, int32(158), _29_iCur, int32(0), int32(0), _29_pVTab, int32(-8))
 81077  		goto _108
 81078  	}
 81079  	if _27_pTab.XnModuleArg != 0 {
 81080  		goto _108
 81081  	}
 81082  	if (_pLoop.XwsFlags&uint32(64)) != (0) || (int32(_wctrlFlags)&int32(32)) != int32(0) {
 81083  		goto _95
 81084  	}
 81085  	_31_op = int32(106)
 81086  	if int32(_pWInfo.XeOnePass) != int32(0) {
 81087  		_31_op = int32(107)
 81088  		*elem8((*int32)(unsafe.Pointer(&_pWInfo.XaiCurOnePass)), 0) = _27_pTabItem.XiCursor
 81089  	}
 81090  	_sqlite3OpenTable(tls, _pParse, _27_pTabItem.XiCursor, _27_iDb, _27_pTab, _31_op)
 81091  	func() {
 81092  		if _27_pTabItem.XiCursor != _pLevel.XiTabCur {
 81093  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135090), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(101203)))
 81094  			crt.X__builtin_abort(tls)
 81095  		}
 81096  	}()
 81097  	if int32(_pWInfo.XeOnePass) != int32(0) || int32(_27_pTab.XnCol) >= int32(64) || (_27_pTab.XtabFlags&uint32(32)) != (0) {
 81098  		goto _101
 81099  	}
 81100  	_33_b = _27_pTabItem.XcolUsed
 81101  	_33_n = int32(0)
 81102  _102:
 81103  	if _33_b == 0 {
 81104  		goto _105
 81105  	}
 81106  	*func() *int32 { _33_b = _33_b >> 1; return &_33_n }() += 1
 81107  	goto _102
 81108  _105:
 81109  	_sqlite3VdbeChangeP4(tls, _v, int32(-1), (*int8)(crt.U2P(uintptr(_33_n))), int32(-11))
 81110  	func() {
 81111  		if _33_n > int32(_27_pTab.XnCol) {
 81112  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135098), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(101238)))
 81113  			crt.X__builtin_abort(tls)
 81114  		}
 81115  	}()
 81116  _101:
 81117  	_sqlite3VdbeChangeP5(tls, _v, uint16(_bFordelete))
 81118  	goto _108
 81119  _95:
 81120  	_sqlite3TableLock(tls, _pParse, _27_iDb, _27_pTab.Xtnum, 0, _27_pTab.XzName)
 81121  _108:
 81122  	if (_pLoop.XwsFlags & uint32(512)) == 0 {
 81123  		goto _109
 81124  	}
 81125  	_37_pIx = (*XIndex)((*t101)(unsafe.Pointer(&_pLoop.Xu)).XpIndex)
 81126  	_37_op = int32(106)
 81127  	func() {
 81128  		if _iAuxArg == int32(0) && (int32(_pWInfo.XwctrlFlags)&int32(4)) != int32(0) {
 81129  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135120), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(101252)))
 81130  			crt.X__builtin_abort(tls)
 81131  		}
 81132  	}()
 81133  	if (((_27_pTab.XtabFlags & uint32(32)) != (0)) && (int32((uint32(_37_pIx.XidxType)<<30)>>30) == int32(2))) && ((int32(_wctrlFlags) & int32(32)) != int32(0)) {
 81134  		_37_iIndexCur = _pLevel.XiTabCur
 81135  		_37_op = int32(0)
 81136  		goto _128
 81137  	}
 81138  	if int32(_pWInfo.XeOnePass) == int32(0) {
 81139  		goto _117
 81140  	}
 81141  	_39_pJ = (*XIndex)((*XTable)(_27_pTabItem.XpTab).XpIndex)
 81142  	_37_iIndexCur = _iAuxArg
 81143  	func() {
 81144  		if (int32(_wctrlFlags) & int32(4)) == 0 {
 81145  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135131), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(101314)))
 81146  			crt.X__builtin_abort(tls)
 81147  		}
 81148  	}()
 81149  _120:
 81150  	if func() int32 {
 81151  		if _39_pJ != nil {
 81152  			return int32(1)
 81153  		}
 81154  		return func() int32 {
 81155  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135132), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(4809)))
 81156  			crt.X__builtin_abort(tls)
 81157  			return int32(0)
 81158  		}()
 81159  	}() != 0 && (_39_pJ != _37_pIx) {
 81160  		_37_iIndexCur += 1
 81161  		_39_pJ = (*XIndex)(_39_pJ.XpNext)
 81162  		goto _120
 81163  	}
 81164  	_37_op = int32(107)
 81165  	*elem8((*int32)(unsafe.Pointer(&_pWInfo.XaiCurOnePass)), uintptr(1)) = _37_iIndexCur
 81166  	goto _128
 81167  _117:
 81168  	if _iAuxArg != 0 && ((int32(_wctrlFlags) & int32(32)) != int32(0)) {
 81169  		_37_iIndexCur = _iAuxArg
 81170  		_37_op = int32(105)
 81171  		goto _128
 81172  	}
 81173  	_37_iIndexCur = postInc2(&_pParse.XnTab, 1)
 81174  _128:
 81175  	_pLevel.XiIdxCur = _37_iIndexCur
 81176  	func() {
 81177  		if (*XSchema)(_37_pIx.XpSchema) != (*XSchema)(_27_pTab.XpSchema) {
 81178  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135145), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(101349)))
 81179  			crt.X__builtin_abort(tls)
 81180  		}
 81181  	}()
 81182  	func() {
 81183  		if _37_iIndexCur < int32(0) {
 81184  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135146), unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000), unsafe.Pointer(str(101377)))
 81185  			crt.X__builtin_abort(tls)
 81186  		}
 81187  	}()
 81188  	if _37_op == 0 {
 81189  		goto _133
 81190  	}
 81191  	_sqlite3VdbeAddOp3(tls, _v, _37_op, _37_iIndexCur, _37_pIx.Xtnum, _27_iDb)
 81192  	_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _37_pIx)
 81193  	if ((((_pLoop.XwsFlags & uint32(15)) != (0)) && ((_pLoop.XwsFlags & uint32(32770)) == (0))) && ((int32(_pWInfo.XwctrlFlags) & int32(1)) == int32(0))) && (int32(_pWInfo.XeDistinct) != int32(2)) {
 81194  		_sqlite3VdbeChangeP5(tls, _v, uint16(2))
 81195  	}
 81196  	_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(_37_pIx.XzName))
 81197  _133:
 81198  _109:
 81199  	if _27_iDb >= int32(0) {
 81200  		_sqlite3CodeVerifySchema(tls, _pParse, _27_iDb)
 81201  	}
 81202  	*(*uintptr)(unsafe.Pointer(func() **XWhereLevel { _ii += 1; return &_pLevel }())) += uintptr(76)
 81203  	goto _83
 81204  _86:
 81205  	_pWInfo.XiTop = _sqlite3VdbeCurrentAddr(tls, _v)
 81206  	if _db.XmallocFailed != 0 {
 81207  		goto _whereBeginError
 81208  	}
 81209  	_notReady = uint64(18446744073709551615)
 81210  	_ii = int32(0)
 81211  _140:
 81212  	if _ii >= _nTabList {
 81213  		goto _143
 81214  	}
 81215  	_pLevel = elem99((*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa)), uintptr(_ii))
 81216  	_45_wsFlags = int32((*XWhereLoop)(_pLevel.XpWLoop).XwsFlags)
 81217  	if (((*XWhereLoop)(_pLevel.XpWLoop).XwsFlags) & uint32(16384)) == (0) {
 81218  		goto _144
 81219  	}
 81220  	_constructAutomaticIndex(tls, _pParse, &_pWInfo.XsWC, elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_pLevel.XiFrom)), _notReady, _pLevel)
 81221  	if _db.XmallocFailed != 0 {
 81222  		goto _whereBeginError
 81223  	}
 81224  _144:
 81225  	_45_addrExplain = _sqlite3WhereExplainOneScan(tls, _pParse, _pTabList, _pLevel, _ii, int32(_pLevel.XiFrom), _wctrlFlags)
 81226  	_pLevel.XaddrBody = _sqlite3VdbeCurrentAddr(tls, _v)
 81227  	_notReady = _sqlite3WhereCodeOneLoopStart(tls, _pWInfo, _ii, _notReady)
 81228  	_pWInfo.XiContinue = _pLevel.XaddrCont
 81229  	if ((_45_wsFlags & int32(8192)) == int32(0)) && ((int32(_wctrlFlags) & int32(32)) == int32(0)) {
 81230  	}
 81231  	_ii += 1
 81232  	goto _140
 81233  _143:
 81234  	return _pWInfo
 81235  
 81236  _whereBeginError:
 81237  	if _pWInfo != nil {
 81238  		_pParse.XnQueryLoop = uint32(_pWInfo.XsavedNQueryLoop)
 81239  		_whereInfoFree(tls, _db, _pWInfo)
 81240  	}
 81241  	return nil
 81242  
 81243  	_ = _45_addrExplain
 81244  	panic(0)
 81245  }
 81246  
 81247  var _sqlite3WhereBeginØ00__func__Ø000 [18]int8
 81248  
 81249  func init() {
 81250  	crt.Xstrncpy(nil, &_sqlite3WhereBeginØ00__func__Ø000[0], str(101390), 18)
 81251  }
 81252  
 81253  // C comment
 81254  //  /*
 81255  //  ** Convert bulk memory into a valid WhereLoop that can be passed
 81256  //  ** to whereLoopClear harmlessly.
 81257  //  */
 81258  func _whereLoopInit(tls *crt.TLS, _p *XWhereLoop) {
 81259  	*(***XWhereTerm)(unsafe.Pointer(&_p.XaLTerm)) = (**XWhereTerm)(unsafe.Pointer(&_p.XaLTermSpace))
 81260  	_p.XnLTerm = 0
 81261  	_p.XnLSlot = uint16(3)
 81262  	_p.XwsFlags = 0
 81263  }
 81264  
 81265  // C comment
 81266  //  /*
 81267  //  ** Initialize a preallocated WhereClause structure.
 81268  //  */
 81269  func _sqlite3WhereClauseInit(tls *crt.TLS, _pWC *XWhereClause, _pWInfo *XWhereInfo) {
 81270  	*(**XWhereInfo)(unsafe.Pointer(&_pWC.XpWInfo)) = _pWInfo
 81271  	*(**XWhereClause)(unsafe.Pointer(&_pWC.XpOuter)) = nil
 81272  	_pWC.XnTerm = int32(0)
 81273  	_pWC.XnSlot = int32(8)
 81274  	*(**XWhereTerm)(unsafe.Pointer(&_pWC.Xa)) = (*XWhereTerm)(unsafe.Pointer(&_pWC.XaStatic))
 81275  }
 81276  
 81277  // C comment
 81278  //  /*
 81279  //  ** This routine identifies subexpressions in the WHERE clause where
 81280  //  ** each subexpression is separated by the AND operator or some other
 81281  //  ** operator specified in the op parameter.  The WhereClause structure
 81282  //  ** is filled with pointers to subexpressions.  For example:
 81283  //  **
 81284  //  **    WHERE  a=='hello' AND coalesce(b,11)<10 AND (c+12!=d OR c==22)
 81285  //  **           \________/     \_______________/     \________________/
 81286  //  **            slot[0]            slot[1]               slot[2]
 81287  //  **
 81288  //  ** The original WHERE clause in pExpr is unaltered.  All this routine
 81289  //  ** does is make slot[] entries point to substructure within pExpr.
 81290  //  **
 81291  //  ** In the previous sentence and in the diagram, "slot[]" refers to
 81292  //  ** the WhereClause.a[] array.  The slot[] array grows as needed to contain
 81293  //  ** all terms of the WHERE clause.
 81294  //  */
 81295  func _sqlite3WhereSplit(tls *crt.TLS, _pWC *XWhereClause, _pExpr *XExpr, _op uint8) {
 81296  	var _pE2 *XExpr
 81297  	_pE2 = _sqlite3ExprSkipCollate(tls, _pExpr)
 81298  	_pWC.Xop = _op
 81299  	if _pE2 == nil {
 81300  		return
 81301  	}
 81302  	if int32(_pE2.Xop) != int32(_op) {
 81303  		_whereClauseInsert(tls, _pWC, _pExpr, 0)
 81304  		goto _2
 81305  	}
 81306  	_sqlite3WhereSplit(tls, _pWC, (*XExpr)(_pE2.XpLeft), _op)
 81307  	_sqlite3WhereSplit(tls, _pWC, (*XExpr)(_pE2.XpRight), _op)
 81308  _2:
 81309  }
 81310  
 81311  // C comment
 81312  //  /*
 81313  //  ** Add a single new WhereTerm entry to the WhereClause object pWC.
 81314  //  ** The new WhereTerm object is constructed from Expr p and with wtFlags.
 81315  //  ** The index in pWC->a[] of the new WhereTerm is returned on success.
 81316  //  ** 0 is returned if the new WhereTerm could not be added due to a memory
 81317  //  ** allocation error.  The memory allocation failure will be recorded in
 81318  //  ** the db->mallocFailed flag so that higher-level functions can detect it.
 81319  //  **
 81320  //  ** This routine will increase the size of the pWC->a[] array as necessary.
 81321  //  **
 81322  //  ** If the wtFlags argument includes TERM_DYNAMIC, then responsibility
 81323  //  ** for freeing the expression p is assumed by the WhereClause object pWC.
 81324  //  ** This is true even if this routine fails to allocate a new WhereTerm.
 81325  //  **
 81326  //  ** WARNING:  This routine might reallocate the space used to store
 81327  //  ** WhereTerms.  All pointers to WhereTerms should be invalidated after
 81328  //  ** calling this routine.  Such pointers may be reinitialized by referencing
 81329  //  ** the pWC->a[] array.
 81330  //  */
 81331  func _whereClauseInsert(tls *crt.TLS, _pWC *XWhereClause, _p *XExpr, _wtFlags uint16) (r0 int32) {
 81332  	var _idx int32
 81333  	var _1_db *Xsqlite3
 81334  	var _pTerm, _1_pOld *XWhereTerm
 81335  	if _pWC.XnTerm < _pWC.XnSlot {
 81336  		goto _0
 81337  	}
 81338  	_1_pOld = (*XWhereTerm)(_pWC.Xa)
 81339  	_1_db = (*Xsqlite3)((*XParse)((*XWhereInfo)(_pWC.XpWInfo).XpParse).Xdb)
 81340  	*(**XWhereTerm)(unsafe.Pointer(&_pWC.Xa)) = (*XWhereTerm)(_sqlite3DbMallocRawNN(tls, _1_db, uint64((uint32(48)*uint32(_pWC.XnSlot))*uint32(2))))
 81341  	if (*XWhereTerm)(_pWC.Xa) != nil {
 81342  		goto _1
 81343  	}
 81344  	if (int32(_wtFlags) & int32(1)) != 0 {
 81345  		_sqlite3ExprDelete(tls, _1_db, _p)
 81346  	}
 81347  	*(**XWhereTerm)(unsafe.Pointer(&_pWC.Xa)) = _1_pOld
 81348  	return int32(0)
 81349  
 81350  _1:
 81351  	crt.Xmemcpy(tls, _pWC.Xa, unsafe.Pointer(_1_pOld), uint32(48)*uint32(_pWC.XnTerm))
 81352  	if _1_pOld != (*XWhereTerm)(unsafe.Pointer(&_pWC.XaStatic)) {
 81353  		_sqlite3DbFree(tls, _1_db, unsafe.Pointer(_1_pOld))
 81354  	}
 81355  	_pWC.XnSlot = int32(uint32(_sqlite3DbMallocSize(tls, _1_db, _pWC.Xa)) / uint32(48))
 81356  _0:
 81357  	_pTerm = elem100((*XWhereTerm)(_pWC.Xa), uintptr(store2(&_idx, postInc2(&_pWC.XnTerm, 1))))
 81358  	if (_p != nil) && ((_p.Xflags & uint32(262144)) != (0)) {
 81359  		_pTerm.XtruthProb = int16(int32(_sqlite3LogEst(tls, uint64(_p.XiTable))) - int32(270))
 81360  		goto _6
 81361  	}
 81362  	_pTerm.XtruthProb = int16(1)
 81363  _6:
 81364  	*(**XExpr)(unsafe.Pointer(&_pTerm.XpExpr)) = _sqlite3ExprSkipCollate(tls, _p)
 81365  	_pTerm.XwtFlags = _wtFlags
 81366  	*(**XWhereClause)(unsafe.Pointer(&_pTerm.XpWC)) = _pWC
 81367  	_pTerm.XiParent = int32(-1)
 81368  	crt.Xmemset(tls, unsafe.Pointer(&_pTerm.XeOperator), int32(0), uint32(36))
 81369  	return _idx
 81370  }
 81371  
 81372  // C comment
 81373  //  /*
 81374  //  ** Walk an expression tree.  Return non-zero if the expression is constant
 81375  //  ** that does no originate from the ON or USING clauses of a join.
 81376  //  ** Return 0 if it involves variables or function calls or terms from
 81377  //  ** an ON or USING clause.
 81378  //  */
 81379  func _sqlite3ExprIsConstantNotJoin(tls *crt.TLS, _p *XExpr) (r0 int32) {
 81380  	return _exprIsConst(tls, _p, int32(2), int32(0))
 81381  }
 81382  
 81383  // C comment
 81384  //  /*
 81385  //  ** Generate code for a boolean expression such that a jump is made
 81386  //  ** to the label "dest" if the expression is false but execution
 81387  //  ** continues straight thru if the expression is true.
 81388  //  **
 81389  //  ** If the expression evaluates to NULL (neither true nor false) then
 81390  //  ** jump if jumpIfNull is SQLITE_JUMPIFNULL or fall through if jumpIfNull
 81391  //  ** is 0.
 81392  //  */
 81393  func _sqlite3ExprIfFalse(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _dest int32, _jumpIfNull int32) {
 81394  	var _op, _regFree1, _regFree2, _r1, _r2, _3_d2, _10_destIfNull int32
 81395  	var _v *TVdbe
 81396  	_v = (*TVdbe)(_pParse.XpVdbe)
 81397  	_op = int32(0)
 81398  	_regFree1 = int32(0)
 81399  	_regFree2 = int32(0)
 81400  	func() {
 81401  		if _jumpIfNull != int32(16) && _jumpIfNull != int32(0) {
 81402  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95403), unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000), unsafe.Pointer(str(101408)))
 81403  			crt.X__builtin_abort(tls)
 81404  		}
 81405  	}()
 81406  	if func() int32 {
 81407  		if _v == nil {
 81408  			return func() int32 {
 81409  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95404), unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000), unsafe.Pointer(str(4809)))
 81410  				crt.X__builtin_abort(tls)
 81411  				return int32(1)
 81412  			}()
 81413  		}
 81414  		return int32(0)
 81415  	}() != 0 {
 81416  		return
 81417  	}
 81418  	if _pExpr == nil {
 81419  		return
 81420  	}
 81421  	_op = ((int32(_pExpr.Xop) + int32(1)) ^ int32(1)) - int32(1)
 81422  	func() {
 81423  		if int32(_pExpr.Xop) == int32(75) && _op != int32(76) {
 81424  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95429), unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000), unsafe.Pointer(str(101455)))
 81425  			crt.X__builtin_abort(tls)
 81426  		}
 81427  	}()
 81428  	func() {
 81429  		if int32(_pExpr.Xop) == int32(76) && _op != int32(75) {
 81430  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95430), unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000), unsafe.Pointer(str(101494)))
 81431  			crt.X__builtin_abort(tls)
 81432  		}
 81433  	}()
 81434  	func() {
 81435  		if int32(_pExpr.Xop) == int32(77) && _op != int32(78) {
 81436  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95431), unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000), unsafe.Pointer(str(101533)))
 81437  			crt.X__builtin_abort(tls)
 81438  		}
 81439  	}()
 81440  	func() {
 81441  		if int32(_pExpr.Xop) == int32(78) && _op != int32(77) {
 81442  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95432), unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000), unsafe.Pointer(str(101563)))
 81443  			crt.X__builtin_abort(tls)
 81444  		}
 81445  	}()
 81446  	func() {
 81447  		if int32(_pExpr.Xop) == int32(81) && _op != int32(82) {
 81448  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95433), unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000), unsafe.Pointer(str(101593)))
 81449  			crt.X__builtin_abort(tls)
 81450  		}
 81451  	}()
 81452  	func() {
 81453  		if int32(_pExpr.Xop) == int32(80) && _op != int32(79) {
 81454  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95434), unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000), unsafe.Pointer(str(101623)))
 81455  			crt.X__builtin_abort(tls)
 81456  		}
 81457  	}()
 81458  	func() {
 81459  		if int32(_pExpr.Xop) == int32(79) && _op != int32(80) {
 81460  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95435), unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000), unsafe.Pointer(str(101653)))
 81461  			crt.X__builtin_abort(tls)
 81462  		}
 81463  	}()
 81464  	func() {
 81465  		if int32(_pExpr.Xop) == int32(82) && _op != int32(81) {
 81466  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95436), unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000), unsafe.Pointer(str(101683)))
 81467  			crt.X__builtin_abort(tls)
 81468  		}
 81469  	}()
 81470  	switch int32(_pExpr.Xop) {
 81471  	case int32(19):
 81472  		goto _34
 81473  	case int32(70):
 81474  		goto _33
 81475  	case int32(71):
 81476  		goto _32
 81477  	case int32(72):
 81478  		goto _35
 81479  	case int32(73):
 81480  		goto _45
 81481  	case int32(74):
 81482  		goto _46
 81483  	case int32(75):
 81484  		goto _43
 81485  	case int32(76):
 81486  		goto _43
 81487  	case int32(77):
 81488  		goto _37
 81489  	case int32(78):
 81490  		goto _37
 81491  	case int32(79):
 81492  		goto _37
 81493  	case int32(80):
 81494  		goto _37
 81495  	case int32(81):
 81496  		goto _37
 81497  	case int32(82):
 81498  		goto _37
 81499  	case int32(148):
 81500  		goto _35
 81501  	default:
 81502  		goto _47
 81503  	}
 81504  
 81505  _32:
 81506  	_sqlite3ExprIfFalse(tls, _pParse, (*XExpr)(_pExpr.XpLeft), _dest, _jumpIfNull)
 81507  	_sqlite3ExprCachePush(tls, _pParse)
 81508  	_sqlite3ExprIfFalse(tls, _pParse, (*XExpr)(_pExpr.XpRight), _dest, _jumpIfNull)
 81509  	_sqlite3ExprCachePop(tls, _pParse)
 81510  	goto _48
 81511  _33:
 81512  	_3_d2 = _sqlite3VdbeMakeLabel(tls, _v)
 81513  	_sqlite3ExprIfTrue(tls, _pParse, (*XExpr)(_pExpr.XpLeft), _3_d2, _jumpIfNull^int32(16))
 81514  	_sqlite3ExprCachePush(tls, _pParse)
 81515  	_sqlite3ExprIfFalse(tls, _pParse, (*XExpr)(_pExpr.XpRight), _dest, _jumpIfNull)
 81516  	_sqlite3VdbeResolveLabel(tls, _v, _3_d2)
 81517  	_sqlite3ExprCachePop(tls, _pParse)
 81518  	goto _48
 81519  _34:
 81520  	_sqlite3ExprIfTrue(tls, _pParse, (*XExpr)(_pExpr.XpLeft), _dest, _jumpIfNull)
 81521  	goto _48
 81522  _35:
 81523  	_op = func() int32 {
 81524  		if int32(_pExpr.Xop) == int32(72) {
 81525  			return int32(77)
 81526  		}
 81527  		return int32(78)
 81528  	}()
 81529  	_jumpIfNull = int32(128)
 81530  _37:
 81531  	if _sqlite3ExprIsVector(tls, (*XExpr)(_pExpr.XpLeft)) != 0 {
 81532  		goto _default_expr
 81533  	}
 81534  	_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.XpLeft), &_regFree1)
 81535  	_r2 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.XpRight), &_regFree2)
 81536  	_codeCompare(tls, _pParse, (*XExpr)(_pExpr.XpLeft), (*XExpr)(_pExpr.XpRight), _op, _r1, _r2, _dest, _jumpIfNull)
 81537  
 81538  	goto _48
 81539  _43:
 81540  	_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.XpLeft), &_regFree1)
 81541  	_sqlite3VdbeAddOp2(tls, _v, _op, _r1, _dest)
 81542  	goto _48
 81543  _45:
 81544  	_exprCodeBetween(tls, _pParse, _pExpr, _dest, _sqlite3ExprIfFalse, _jumpIfNull)
 81545  	goto _48
 81546  _46:
 81547  	if _jumpIfNull != 0 {
 81548  		_sqlite3ExprCodeIN(tls, _pParse, _pExpr, _dest, _dest)
 81549  		goto _53
 81550  	}
 81551  	_10_destIfNull = _sqlite3VdbeMakeLabel(tls, _v)
 81552  	_sqlite3ExprCodeIN(tls, _pParse, _pExpr, _dest, _10_destIfNull)
 81553  	_sqlite3VdbeResolveLabel(tls, _v, _10_destIfNull)
 81554  _53:
 81555  	goto _48
 81556  _47:
 81557  _default_expr:
 81558  	if _exprAlwaysFalse(tls, _pExpr) != 0 {
 81559  		_sqlite3VdbeGoto(tls, _v, _dest)
 81560  		goto _57
 81561  	}
 81562  	if _exprAlwaysTrue(tls, _pExpr) != 0 {
 81563  		goto _57
 81564  	}
 81565  	_r1 = _sqlite3ExprCodeTemp(tls, _pParse, _pExpr, &_regFree1)
 81566  	_sqlite3VdbeAddOp3(tls, _v, int32(22), _r1, _dest, bool2int(_jumpIfNull != int32(0)))
 81567  _57:
 81568  	goto _48
 81569  _48:
 81570  	_sqlite3ReleaseTempReg(tls, _pParse, _regFree1)
 81571  	_sqlite3ReleaseTempReg(tls, _pParse, _regFree2)
 81572  }
 81573  
 81574  var _sqlite3ExprIfFalseØ00__func__Ø000 [19]int8
 81575  
 81576  func init() {
 81577  	crt.Xstrncpy(nil, &_sqlite3ExprIfFalseØ00__func__Ø000[0], str(101713), 19)
 81578  }
 81579  
 81580  // C comment
 81581  //  /*
 81582  //  ** Remove from the column cache any entries that were added since the
 81583  //  ** the previous sqlite3ExprCachePush operation.  In other words, restore
 81584  //  ** the cache to the state it was in prior the most recent Push.
 81585  //  */
 81586  func _sqlite3ExprCachePop(tls *crt.TLS, _pParse *XParse) {
 81587  	var _i int32
 81588  	_i = int32(0)
 81589  	func() {
 81590  		if _pParse.XiCacheLevel < int32(1) {
 81591  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94086), unsafe.Pointer(&_sqlite3ExprCachePopØ00__func__Ø000), unsafe.Pointer(str(101732)))
 81592  			crt.X__builtin_abort(tls)
 81593  		}
 81594  	}()
 81595  	_pParse.XiCacheLevel -= 1
 81596  	if (((*Xsqlite3)(_pParse.Xdb).Xflags) & int32(4096)) != 0 {
 81597  		crt.Xprintf(tls, str(101755), _pParse.XiCacheLevel)
 81598  	}
 81599  _2:
 81600  	if _i >= int32(_pParse.XnColCache) {
 81601  		goto _4
 81602  	}
 81603  	if (elem69((*TyColCache)(unsafe.Pointer(&_pParse.XaColCache)), uintptr(_i)).XiLevel) > _pParse.XiCacheLevel {
 81604  		_cacheEntryClear(tls, _pParse, _i)
 81605  		goto _6
 81606  	}
 81607  	_i += 1
 81608  _6:
 81609  	goto _2
 81610  _4:
 81611  }
 81612  
 81613  var _sqlite3ExprCachePopØ00__func__Ø000 [20]int8
 81614  
 81615  func init() {
 81616  	crt.Xstrncpy(nil, &_sqlite3ExprCachePopØ00__func__Ø000[0], str(101767), 20)
 81617  }
 81618  
 81619  // C comment
 81620  //  /*
 81621  //  ** Generate code for a boolean expression such that a jump is made
 81622  //  ** to the label "dest" if the expression is true but execution
 81623  //  ** continues straight thru if the expression is false.
 81624  //  **
 81625  //  ** If the expression evaluates to NULL (neither true nor false), then
 81626  //  ** take the jump if the jumpIfNull flag is SQLITE_JUMPIFNULL.
 81627  //  **
 81628  //  ** This code depends on the fact that certain token values (ex: TK_EQ)
 81629  //  ** are the same as opcode values (ex: OP_Eq) that implement the corresponding
 81630  //  ** operation.  Special comments in vdbe.c and the mkopcodeh.awk script in
 81631  //  ** the make process cause these values to align.  Assert()s in the code
 81632  //  ** below verify that the numbers are aligned correctly.
 81633  //  */
 81634  func _sqlite3ExprIfTrue(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _dest int32, _jumpIfNull int32) {
 81635  	var _op, _regFree1, _regFree2, _r1, _r2, _2_d2, _8_destIfFalse, _8_destIfNull int32
 81636  	var _v *TVdbe
 81637  	_v = (*TVdbe)(_pParse.XpVdbe)
 81638  	_op = int32(0)
 81639  	_regFree1 = int32(0)
 81640  	_regFree2 = int32(0)
 81641  	func() {
 81642  		if _jumpIfNull != int32(16) && _jumpIfNull != int32(0) {
 81643  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95280), unsafe.Pointer(&_sqlite3ExprIfTrueØ00__func__Ø000), unsafe.Pointer(str(101408)))
 81644  			crt.X__builtin_abort(tls)
 81645  		}
 81646  	}()
 81647  	if func() int32 {
 81648  		if _v == nil {
 81649  			return func() int32 {
 81650  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95281), unsafe.Pointer(&_sqlite3ExprIfTrueØ00__func__Ø000), unsafe.Pointer(str(4809)))
 81651  				crt.X__builtin_abort(tls)
 81652  				return int32(1)
 81653  			}()
 81654  		}
 81655  		return int32(0)
 81656  	}() != 0 {
 81657  		return
 81658  	}
 81659  	if func() int32 {
 81660  		if _pExpr == nil {
 81661  			return func() int32 {
 81662  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95282), unsafe.Pointer(&_sqlite3ExprIfTrueØ00__func__Ø000), unsafe.Pointer(str(4809)))
 81663  				crt.X__builtin_abort(tls)
 81664  				return int32(1)
 81665  			}()
 81666  		}
 81667  		return int32(0)
 81668  	}() != 0 {
 81669  		return
 81670  	}
 81671  	_op = int32(_pExpr.Xop)
 81672  	switch _op {
 81673  	case int32(19):
 81674  		goto _12
 81675  	case int32(70):
 81676  		goto _11
 81677  	case int32(71):
 81678  		goto _10
 81679  	case int32(72):
 81680  		goto _13
 81681  	case int32(73):
 81682  		goto _23
 81683  	case int32(74):
 81684  		goto _24
 81685  	case int32(75):
 81686  		goto _21
 81687  	case int32(76):
 81688  		goto _21
 81689  	case int32(77):
 81690  		goto _15
 81691  	case int32(78):
 81692  		goto _15
 81693  	case int32(79):
 81694  		goto _15
 81695  	case int32(80):
 81696  		goto _15
 81697  	case int32(81):
 81698  		goto _15
 81699  	case int32(82):
 81700  		goto _15
 81701  	case int32(148):
 81702  		goto _13
 81703  	default:
 81704  		goto _25
 81705  	}
 81706  
 81707  _10:
 81708  	_2_d2 = _sqlite3VdbeMakeLabel(tls, _v)
 81709  	_sqlite3ExprIfFalse(tls, _pParse, (*XExpr)(_pExpr.XpLeft), _2_d2, _jumpIfNull^int32(16))
 81710  	_sqlite3ExprCachePush(tls, _pParse)
 81711  	_sqlite3ExprIfTrue(tls, _pParse, (*XExpr)(_pExpr.XpRight), _dest, _jumpIfNull)
 81712  	_sqlite3VdbeResolveLabel(tls, _v, _2_d2)
 81713  	_sqlite3ExprCachePop(tls, _pParse)
 81714  	goto _26
 81715  _11:
 81716  	_sqlite3ExprIfTrue(tls, _pParse, (*XExpr)(_pExpr.XpLeft), _dest, _jumpIfNull)
 81717  	_sqlite3ExprCachePush(tls, _pParse)
 81718  	_sqlite3ExprIfTrue(tls, _pParse, (*XExpr)(_pExpr.XpRight), _dest, _jumpIfNull)
 81719  	_sqlite3ExprCachePop(tls, _pParse)
 81720  	goto _26
 81721  _12:
 81722  	_sqlite3ExprIfFalse(tls, _pParse, (*XExpr)(_pExpr.XpLeft), _dest, _jumpIfNull)
 81723  	goto _26
 81724  _13:
 81725  	_op = func() int32 {
 81726  		if _op == int32(72) {
 81727  			return int32(78)
 81728  		}
 81729  		return int32(77)
 81730  	}()
 81731  	_jumpIfNull = int32(128)
 81732  _15:
 81733  	if _sqlite3ExprIsVector(tls, (*XExpr)(_pExpr.XpLeft)) != 0 {
 81734  		goto _default_expr
 81735  	}
 81736  	_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.XpLeft), &_regFree1)
 81737  	_r2 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.XpRight), &_regFree2)
 81738  	_codeCompare(tls, _pParse, (*XExpr)(_pExpr.XpLeft), (*XExpr)(_pExpr.XpRight), _op, _r1, _r2, _dest, _jumpIfNull)
 81739  
 81740  	goto _26
 81741  _21:
 81742  
 81743  	_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.XpLeft), &_regFree1)
 81744  	_sqlite3VdbeAddOp2(tls, _v, _op, _r1, _dest)
 81745  	goto _26
 81746  _23:
 81747  	_exprCodeBetween(tls, _pParse, _pExpr, _dest, _sqlite3ExprIfTrue, _jumpIfNull)
 81748  	goto _26
 81749  _24:
 81750  	_8_destIfFalse = _sqlite3VdbeMakeLabel(tls, _v)
 81751  	_8_destIfNull = func() int32 {
 81752  		if _jumpIfNull != 0 {
 81753  			return _dest
 81754  		}
 81755  		return _8_destIfFalse
 81756  	}()
 81757  	_sqlite3ExprCodeIN(tls, _pParse, _pExpr, _8_destIfFalse, _8_destIfNull)
 81758  	_sqlite3VdbeGoto(tls, _v, _dest)
 81759  	_sqlite3VdbeResolveLabel(tls, _v, _8_destIfFalse)
 81760  	goto _26
 81761  _25:
 81762  _default_expr:
 81763  	if _exprAlwaysTrue(tls, _pExpr) != 0 {
 81764  		_sqlite3VdbeGoto(tls, _v, _dest)
 81765  		goto _35
 81766  	}
 81767  	if _exprAlwaysFalse(tls, _pExpr) != 0 {
 81768  		goto _35
 81769  	}
 81770  	_r1 = _sqlite3ExprCodeTemp(tls, _pParse, _pExpr, &_regFree1)
 81771  	_sqlite3VdbeAddOp3(tls, _v, int32(21), _r1, _dest, bool2int(_jumpIfNull != int32(0)))
 81772  _35:
 81773  	goto _26
 81774  _26:
 81775  	_sqlite3ReleaseTempReg(tls, _pParse, _regFree1)
 81776  	_sqlite3ReleaseTempReg(tls, _pParse, _regFree2)
 81777  }
 81778  
 81779  var _sqlite3ExprIfTrueØ00__func__Ø000 [18]int8
 81780  
 81781  func init() {
 81782  	crt.Xstrncpy(nil, &_sqlite3ExprIfTrueØ00__func__Ø000[0], str(101787), 18)
 81783  }
 81784  
 81785  // C comment
 81786  //  /*
 81787  //  ** Generate code to evaluate an expression and store the results
 81788  //  ** into a register.  Return the register number where the results
 81789  //  ** are stored.
 81790  //  **
 81791  //  ** If the register is a temporary register that can be deallocated,
 81792  //  ** then write its number into *pReg.  If the result register is not
 81793  //  ** a temporary, then set *pReg to zero.
 81794  //  **
 81795  //  ** If pExpr is a constant, then this routine might generate this
 81796  //  ** code to fill the register in the initialization section of the
 81797  //  ** VDBE program, in order to factor it out of the evaluation loop.
 81798  //  */
 81799  func _sqlite3ExprCodeTemp(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _pReg *int32) (r0 int32) {
 81800  	var _r2, _2_r1 int32
 81801  	_pExpr = _sqlite3ExprSkipCollate(tls, _pExpr)
 81802  	if ((_pParse.XokConstFactor != 0) && (int32(_pExpr.Xop) != int32(157))) && _sqlite3ExprIsConstantNotJoin(tls, _pExpr) != 0 {
 81803  		*_pReg = int32(0)
 81804  		_r2 = _sqlite3ExprCodeAtInit(tls, _pParse, _pExpr, int32(-1))
 81805  		goto _3
 81806  	}
 81807  	_2_r1 = _sqlite3GetTempReg(tls, _pParse)
 81808  	_r2 = _sqlite3ExprCodeTarget(tls, _pParse, _pExpr, _2_r1)
 81809  	if _r2 == _2_r1 {
 81810  		*_pReg = _2_r1
 81811  		goto _5
 81812  	}
 81813  	_sqlite3ReleaseTempReg(tls, _pParse, _2_r1)
 81814  	*_pReg = int32(0)
 81815  _5:
 81816  _3:
 81817  	return _r2
 81818  }
 81819  
 81820  // C comment
 81821  //  /*
 81822  //  ** Generate code for a comparison operator.
 81823  //  */
 81824  func _codeCompare(tls *crt.TLS, _pParse *XParse, _pLeft *XExpr, _pRight *XExpr, _opcode int32, _in1 int32, _in2 int32, _dest int32, _jumpIfNull int32) (r0 int32) {
 81825  	var _p5, _addr int32
 81826  	var _p4 *XCollSeq
 81827  	_p4 = _sqlite3BinaryCompareCollSeq(tls, _pParse, _pLeft, _pRight)
 81828  	_p5 = int32(_binaryCompareP5(tls, _pLeft, _pRight, _jumpIfNull))
 81829  	_addr = _sqlite3VdbeAddOp4(tls, (*TVdbe)(_pParse.XpVdbe), _opcode, _in2, _dest, _in1, (*int8)(unsafe.Pointer(_p4)), int32(-3))
 81830  	_sqlite3VdbeChangeP5(tls, (*TVdbe)(_pParse.XpVdbe), uint16(uint8(_p5)))
 81831  	return _addr
 81832  }
 81833  
 81834  // C comment
 81835  //  /*
 81836  //  ** Return a pointer to the collation sequence that should be used by
 81837  //  ** a binary comparison operator comparing pLeft and pRight.
 81838  //  **
 81839  //  ** If the left hand expression has a collating sequence type, then it is
 81840  //  ** used. Otherwise the collation sequence for the right hand expression
 81841  //  ** is used, or the default (BINARY) if neither expression has a collating
 81842  //  ** type.
 81843  //  **
 81844  //  ** Argument pRight (but not pLeft) may be a null pointer. In this case,
 81845  //  ** it is not considered.
 81846  //  */
 81847  func _sqlite3BinaryCompareCollSeq(tls *crt.TLS, _pParse *XParse, _pLeft *XExpr, _pRight *XExpr) (r0 *XCollSeq) {
 81848  	var _pColl *XCollSeq
 81849  	func() {
 81850  		if _pLeft == nil {
 81851  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91184), unsafe.Pointer(&_sqlite3BinaryCompareCollSeqØ00__func__Ø000), unsafe.Pointer(str(42701)))
 81852  			crt.X__builtin_abort(tls)
 81853  		}
 81854  	}()
 81855  	if (_pLeft.Xflags & uint32(256)) != 0 {
 81856  		_pColl = _sqlite3ExprCollSeq(tls, _pParse, _pLeft)
 81857  		goto _6
 81858  	}
 81859  	if (_pRight != nil) && ((_pRight.Xflags & uint32(256)) != (0)) {
 81860  		_pColl = _sqlite3ExprCollSeq(tls, _pParse, _pRight)
 81861  		goto _6
 81862  	}
 81863  	_pColl = _sqlite3ExprCollSeq(tls, _pParse, _pLeft)
 81864  	if _pColl == nil {
 81865  		_pColl = _sqlite3ExprCollSeq(tls, _pParse, _pRight)
 81866  	}
 81867  _6:
 81868  	return _pColl
 81869  }
 81870  
 81871  var _sqlite3BinaryCompareCollSeqØ00__func__Ø000 [28]int8
 81872  
 81873  func init() {
 81874  	crt.Xstrncpy(nil, &_sqlite3BinaryCompareCollSeqØ00__func__Ø000[0], str(101805), 28)
 81875  }
 81876  
 81877  // C comment
 81878  //  /*
 81879  //  ** Return the P5 value that should be used for a binary comparison
 81880  //  ** opcode (OP_Eq, OP_Ge etc.) used to compare pExpr1 and pExpr2.
 81881  //  */
 81882  func _binaryCompareP5(tls *crt.TLS, _pExpr1 *XExpr, _pExpr2 *XExpr, _jumpIfNull int32) (r0 uint8) {
 81883  	var _aff uint8
 81884  	_aff = uint8(_sqlite3ExprAffinity(tls, _pExpr2))
 81885  	_aff = uint8(int32(uint8(_sqlite3CompareAffinity(tls, _pExpr1, int8(_aff)))) | int32(uint8(_jumpIfNull)))
 81886  	return _aff
 81887  }
 81888  
 81889  // C comment
 81890  //  /*
 81891  //  ** Generate code for a BETWEEN operator.
 81892  //  **
 81893  //  **    x BETWEEN y AND z
 81894  //  **
 81895  //  ** The above is equivalent to
 81896  //  **
 81897  //  **    x>=y AND x<=z
 81898  //  **
 81899  //  ** Code it as such, taking care to do the common subexpression
 81900  //  ** elimination of x.
 81901  //  **
 81902  //  ** The xJumpIf parameter determines details:
 81903  //  **
 81904  //  **    NULL:                   Store the boolean result in reg[dest]
 81905  //  **    sqlite3ExprIfTrue:      Jump to dest if true
 81906  //  **    sqlite3ExprIfFalse:     Jump to dest if false
 81907  //  **
 81908  //  ** The jumpIfNull parameter is ignored if xJumpIf is NULL.
 81909  //  */
 81910  func _exprCodeBetween(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _dest int32, _xJump func(*crt.TLS, *XParse, *XExpr, int32, int32), _jumpIfNull int32) {
 81911  	var _regFree1 int32
 81912  	var _exprAnd, _compLeft, _compRight, _exprX XExpr
 81913  	_regFree1 = int32(0)
 81914  	crt.Xmemset(tls, unsafe.Pointer(&_compLeft), int32(0), uint32(48))
 81915  	crt.Xmemset(tls, unsafe.Pointer(&_compRight), int32(0), uint32(48))
 81916  	crt.Xmemset(tls, unsafe.Pointer(&_exprAnd), int32(0), uint32(48))
 81917  	func() {
 81918  		if (_pExpr.Xflags & uint32(2048)) != (0) {
 81919  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95222), unsafe.Pointer(&_exprCodeBetweenØ00__func__Ø000), unsafe.Pointer(str(42733)))
 81920  			crt.X__builtin_abort(tls)
 81921  		}
 81922  	}()
 81923  	_exprX = *(*XExpr)(_pExpr.XpLeft)
 81924  	_exprAnd.Xop = uint8(71)
 81925  	*(**XExpr)(unsafe.Pointer(&_exprAnd.XpLeft)) = &_compLeft
 81926  	*(**XExpr)(unsafe.Pointer(&_exprAnd.XpRight)) = &_compRight
 81927  	_compLeft.Xop = uint8(82)
 81928  	*(**XExpr)(unsafe.Pointer(&_compLeft.XpLeft)) = &_exprX
 81929  	*(**XExpr)(unsafe.Pointer(&_compLeft.XpRight)) = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).Xa))), 0).XpExpr)
 81930  	_compRight.Xop = uint8(80)
 81931  	*(**XExpr)(unsafe.Pointer(&_compRight.XpLeft)) = &_exprX
 81932  	*(**XExpr)(unsafe.Pointer(&_compRight.XpRight)) = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).Xa))), uintptr(1)).XpExpr)
 81933  	_exprToRegister(tls, &_exprX, _exprCodeVector(tls, _pParse, &_exprX, &_regFree1))
 81934  	if _xJump != nil {
 81935  		_xJump(tls, _pParse, &_exprAnd, _dest, _jumpIfNull)
 81936  		goto _3
 81937  	}
 81938  	_exprX.Xflags |= uint32(1)
 81939  	_sqlite3ExprCodeTarget(tls, _pParse, &_exprAnd, _dest)
 81940  _3:
 81941  	_sqlite3ReleaseTempReg(tls, _pParse, _regFree1)
 81942  }
 81943  
 81944  var _exprCodeBetweenØ00__func__Ø000 [16]int8
 81945  
 81946  func init() {
 81947  	crt.Xstrncpy(nil, &_exprCodeBetweenØ00__func__Ø000[0], str(101833), 16)
 81948  }
 81949  
 81950  // C comment
 81951  //  /*
 81952  //  ** Convert a scalar expression node to a TK_REGISTER referencing
 81953  //  ** register iReg.  The caller must ensure that iReg already contains
 81954  //  ** the correct value for the expression.
 81955  //  */
 81956  func _exprToRegister(tls *crt.TLS, _p *XExpr, _iReg int32) {
 81957  	_p.Xop2 = _p.Xop
 81958  	_p.Xop = uint8(157)
 81959  	_p.XiTable = _iReg
 81960  	_p.Xflags &= uint32(4294963199)
 81961  }
 81962  
 81963  // C comment
 81964  //  /*
 81965  //  ** Evaluate an expression (either a vector or a scalar expression) and store
 81966  //  ** the result in continguous temporary registers.  Return the index of
 81967  //  ** the first register used to store the result.
 81968  //  **
 81969  //  ** If the returned result register is a temporary scalar, then also write
 81970  //  ** that register number into *piFreeable.  If the returned result register
 81971  //  ** is not a temporary or if the expression is a vector set *piFreeable
 81972  //  ** to 0.
 81973  //  */
 81974  func _exprCodeVector(tls *crt.TLS, _pParse *XParse, _p *XExpr, _piFreeable *int32) (r0 int32) {
 81975  	var _iResult, _nResult, _4_i int32
 81976  	_nResult = _sqlite3ExprVectorSize(tls, _p)
 81977  	if _nResult == int32(1) {
 81978  		_iResult = _sqlite3ExprCodeTemp(tls, _pParse, _p, _piFreeable)
 81979  		goto _1
 81980  	}
 81981  	*_piFreeable = int32(0)
 81982  	if int32(_p.Xop) == int32(119) {
 81983  		_iResult = _sqlite3CodeSubselect(tls, _pParse, _p, int32(0), int32(0))
 81984  		goto _3
 81985  	}
 81986  	_iResult = _pParse.XnMem + int32(1)
 81987  	_pParse.XnMem += _nResult
 81988  	_4_i = int32(0)
 81989  _4:
 81990  	if _4_i >= _nResult {
 81991  		goto _7
 81992  	}
 81993  	_sqlite3ExprCodeFactorable(tls, _pParse, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))).Xa))), uintptr(_4_i)).XpExpr), _4_i+_iResult)
 81994  	_4_i += 1
 81995  	goto _4
 81996  _7:
 81997  _3:
 81998  _1:
 81999  	return _iResult
 82000  }
 82001  
 82002  // C comment
 82003  //  /*
 82004  //  ** Generate code that will evaluate expression pExpr and store the
 82005  //  ** results in register target.  The results are guaranteed to appear
 82006  //  ** in register target.  If the expression is constant, then this routine
 82007  //  ** might choose to code the expression at initialization time.
 82008  //  */
 82009  func _sqlite3ExprCodeFactorable(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _target int32) {
 82010  	if (_pParse.XokConstFactor != 0) && _sqlite3ExprIsConstant(tls, _pExpr) != 0 {
 82011  		_sqlite3ExprCodeAtInit(tls, _pParse, _pExpr, _target)
 82012  		goto _2
 82013  	}
 82014  	_sqlite3ExprCode(tls, _pParse, _pExpr, _target)
 82015  _2:
 82016  }
 82017  
 82018  // C comment
 82019  //  /*
 82020  //  ** Generate code for an IN expression.
 82021  //  **
 82022  //  **      x IN (SELECT ...)
 82023  //  **      x IN (value, value, ...)
 82024  //  **
 82025  //  ** The left-hand side (LHS) is a scalar or vector expression.  The
 82026  //  ** right-hand side (RHS) is an array of zero or more scalar values, or a
 82027  //  ** subquery.  If the RHS is a subquery, the number of result columns must
 82028  //  ** match the number of columns in the vector on the LHS.  If the RHS is
 82029  //  ** a list of values, the LHS must be a scalar.
 82030  //  **
 82031  //  ** The IN operator is true if the LHS value is contained within the RHS.
 82032  //  ** The result is false if the LHS is definitely not in the RHS.  The
 82033  //  ** result is NULL if the presence of the LHS in the RHS cannot be
 82034  //  ** determined due to NULLs.
 82035  //  **
 82036  //  ** This routine generates code that jumps to destIfFalse if the LHS is not
 82037  //  ** contained within the RHS.  If due to NULLs we cannot determine if the LHS
 82038  //  ** is contained in the RHS then jump to destIfNull.  If the LHS is contained
 82039  //  ** within the RHS then fall through.
 82040  //  **
 82041  //  ** See the separate in-operator.md documentation file in the canonical
 82042  //  ** SQLite source tree for additional information.
 82043  //  */
 82044  func _sqlite3ExprCodeIN(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _destIfFalse int32, _destIfNull int32) {
 82045  	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
 82046  	var _aiMap *int32
 82047  	var _zAff *int8
 82048  	var _v *TVdbe
 82049  	var _6_pList *XExprList
 82050  	var _pLeft, _15_p, _23_p *XExpr
 82051  	var _6_pColl, _23_pColl *XCollSeq
 82052  	_rRhsHasNull = int32(0)
 82053  	_aiMap = nil
 82054  	_zAff = nil
 82055  	_destStep6 = int32(0)
 82056  	_pLeft = (*XExpr)(_pExpr.XpLeft)
 82057  	if _sqlite3ExprCheckIN(tls, _pParse, _pExpr) != 0 {
 82058  		return
 82059  	}
 82060  	_zAff = _exprINAffinity(tls, _pParse, _pExpr)
 82061  	_nVector = _sqlite3ExprVectorSize(tls, (*XExpr)(_pExpr.XpLeft))
 82062  	_aiMap = (*int32)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pParse.Xdb), uint64((uint32(_nVector)*uint32(5))+uint32(1))))
 82063  	if ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) != 0 {
 82064  		goto _sqlite3ExprCodeIN_oom_error
 82065  	}
 82066  	_v = (*TVdbe)(_pParse.XpVdbe)
 82067  	func() {
 82068  		if _v == nil {
 82069  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93723), unsafe.Pointer(&_sqlite3ExprCodeINØ00__func__Ø000), unsafe.Pointer(str(42019)))
 82070  			crt.X__builtin_abort(tls)
 82071  		}
 82072  	}()
 82073  	_sqlite3VdbeNoopComment(tls, _v, str(101849))
 82074  	_eType = _sqlite3FindInIndex(tls, _pParse, _pExpr, uint32(3), func() *int32 {
 82075  		if _destIfFalse == _destIfNull {
 82076  			return nil
 82077  		}
 82078  		return &_rRhsHasNull
 82079  	}(), _aiMap)
 82080  	func() {
 82081  		if _pParse.XnErr == 0 && _nVector != int32(1) && _eType != int32(2) && _eType != int32(3) && _eType != int32(4) {
 82082  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93729), unsafe.Pointer(&_sqlite3ExprCodeINØ00__func__Ø000), unsafe.Pointer(str(101863)))
 82083  			crt.X__builtin_abort(tls)
 82084  		}
 82085  	}()
 82086  	_i = int32(0)
 82087  _12:
 82088  	if _i >= _nVector {
 82089  		goto _15
 82090  	}
 82091  	_1_cnt = store2(&_1_j, int32(0))
 82092  _16:
 82093  	if _1_j >= _nVector {
 82094  		goto _19
 82095  	}
 82096  	if (*elem8(_aiMap, uintptr(_1_j))) == _i {
 82097  		_1_cnt += 1
 82098  	}
 82099  	_1_j += 1
 82100  	goto _16
 82101  _19:
 82102  	func() {
 82103  		if _1_cnt != int32(1) {
 82104  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93738), unsafe.Pointer(&_sqlite3ExprCodeINØ00__func__Ø000), unsafe.Pointer(str(101972)))
 82105  			crt.X__builtin_abort(tls)
 82106  		}
 82107  	}()
 82108  	_i += 1
 82109  	goto _12
 82110  _15:
 82111  	_sqlite3ExprCachePush(tls, _pParse)
 82112  	_rLhsOrig = _exprCodeVector(tls, _pParse, _pLeft, &_iDummy)
 82113  	_i = int32(0)
 82114  _23:
 82115  	if _i >= _nVector || (*elem8(_aiMap, uintptr(_i))) != _i {
 82116  		goto _27
 82117  	}
 82118  	_i += 1
 82119  	goto _23
 82120  _27:
 82121  	if _i == _nVector {
 82122  		_rLhs = _rLhsOrig
 82123  		goto _29
 82124  	}
 82125  	_rLhs = _sqlite3GetTempRange(tls, _pParse, _nVector)
 82126  	_i = int32(0)
 82127  _30:
 82128  	if _i >= _nVector {
 82129  		goto _33
 82130  	}
 82131  	_sqlite3VdbeAddOp3(tls, _v, int32(64), _rLhsOrig+_i, _rLhs+(*elem8(_aiMap, uintptr(_i))), int32(0))
 82132  	_i += 1
 82133  	goto _30
 82134  _33:
 82135  _29:
 82136  	if _eType != int32(5) {
 82137  		goto _34
 82138  	}
 82139  	_6_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 82140  	_6_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_pExpr.XpLeft))
 82141  	_6_labelOk = _sqlite3VdbeMakeLabel(tls, _v)
 82142  	_6_regCkNull = int32(0)
 82143  	func() {
 82144  		if (_pExpr.Xflags & uint32(2048)) != (0) {
 82145  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93778), unsafe.Pointer(&_sqlite3ExprCodeINØ00__func__Ø000), unsafe.Pointer(str(42733)))
 82146  			crt.X__builtin_abort(tls)
 82147  		}
 82148  	}()
 82149  	if _destIfNull != _destIfFalse {
 82150  		_6_regCkNull = _sqlite3GetTempReg(tls, _pParse)
 82151  		_sqlite3VdbeAddOp3(tls, _v, int32(84), _rLhs, _rLhs, _6_regCkNull)
 82152  	}
 82153  	_6_ii = int32(0)
 82154  _38:
 82155  	if _6_ii >= _6_pList.XnExpr {
 82156  		goto _41
 82157  	}
 82158  	_6_r2 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_6_pList.Xa)), uintptr(_6_ii)).XpExpr), &_6_regToFree)
 82159  	if _6_regCkNull != 0 && _sqlite3ExprCanBeNull(tls, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_6_pList.Xa)), uintptr(_6_ii)).XpExpr)) != 0 {
 82160  		_sqlite3VdbeAddOp3(tls, _v, int32(84), _6_regCkNull, _6_r2, _6_regCkNull)
 82161  	}
 82162  	if (_6_ii < (_6_pList.XnExpr - int32(1))) || (_destIfNull != _destIfFalse) {
 82163  		_sqlite3VdbeAddOp4(tls, _v, int32(78), _rLhs, _6_labelOk, _6_r2, (*int8)(unsafe.Pointer(_6_pColl)), int32(-3))
 82164  		_sqlite3VdbeChangeP5(tls, _v, uint16(*elem1(_zAff, 0)))
 82165  		goto _46
 82166  	}
 82167  	func() {
 82168  		if _destIfNull != _destIfFalse {
 82169  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93795), unsafe.Pointer(&_sqlite3ExprCodeINØ00__func__Ø000), unsafe.Pointer(str(101979)))
 82170  			crt.X__builtin_abort(tls)
 82171  		}
 82172  	}()
 82173  	_sqlite3VdbeAddOp4(tls, _v, int32(77), _rLhs, _destIfFalse, _6_r2, (*int8)(unsafe.Pointer(_6_pColl)), int32(-3))
 82174  	_sqlite3VdbeChangeP5(tls, _v, uint16(int32(*elem1(_zAff, 0))|int32(16)))
 82175  _46:
 82176  	_sqlite3ReleaseTempReg(tls, _pParse, _6_regToFree)
 82177  	_6_ii += 1
 82178  	goto _38
 82179  _41:
 82180  	if _6_regCkNull != 0 {
 82181  		_sqlite3VdbeAddOp2(tls, _v, int32(75), _6_regCkNull, _destIfNull)
 82182  		_sqlite3VdbeGoto(tls, _v, _destIfFalse)
 82183  	}
 82184  	_sqlite3VdbeResolveLabel(tls, _v, _6_labelOk)
 82185  	_sqlite3ReleaseTempReg(tls, _pParse, _6_regCkNull)
 82186  	goto _sqlite3ExprCodeIN_finished
 82187  _34:
 82188  	if _destIfNull == _destIfFalse {
 82189  		_destStep2 = _destIfFalse
 82190  		goto _51
 82191  	}
 82192  	_destStep2 = store2(&_destStep6, _sqlite3VdbeMakeLabel(tls, _v))
 82193  _51:
 82194  	_i = int32(0)
 82195  _52:
 82196  	if _i >= _nVector {
 82197  		goto _55
 82198  	}
 82199  	_15_p = _sqlite3VectorFieldSubexpr(tls, (*XExpr)(_pExpr.XpLeft), _i)
 82200  	if _sqlite3ExprCanBeNull(tls, _15_p) != 0 {
 82201  		_sqlite3VdbeAddOp2(tls, _v, int32(75), _rLhs+_i, _destStep2)
 82202  	}
 82203  	_i += 1
 82204  	goto _52
 82205  _55:
 82206  	if _eType == int32(1) {
 82207  		_sqlite3VdbeAddOp3(tls, _v, int32(31), _pExpr.XiTable, _destIfFalse, _rLhs)
 82208  		_addrTruthOp = _sqlite3VdbeAddOp0(tls, _v, int32(13))
 82209  		goto _58
 82210  	}
 82211  	_sqlite3VdbeAddOp4(tls, _v, int32(100), _rLhs, _nVector, int32(0), _zAff, _nVector)
 82212  	if _destIfFalse == _destIfNull {
 82213  		_sqlite3VdbeAddOp4Int(tls, _v, int32(29), _pExpr.XiTable, _destIfFalse, _rLhs, _nVector)
 82214  		goto _sqlite3ExprCodeIN_finished
 82215  	}
 82216  	_addrTruthOp = _sqlite3VdbeAddOp4Int(tls, _v, int32(30), _pExpr.XiTable, int32(0), _rLhs, _nVector)
 82217  _58:
 82218  	if _rRhsHasNull != 0 && (_nVector == int32(1)) {
 82219  		_sqlite3VdbeAddOp2(tls, _v, int32(76), _rRhsHasNull, _destIfFalse)
 82220  	}
 82221  	if _destIfFalse == _destIfNull {
 82222  		_sqlite3VdbeGoto(tls, _v, _destIfFalse)
 82223  	}
 82224  	if _destStep6 != 0 {
 82225  		_sqlite3VdbeResolveLabel(tls, _v, _destStep6)
 82226  	}
 82227  	_addrTop = _sqlite3VdbeAddOp2(tls, _v, int32(37), _pExpr.XiTable, _destIfFalse)
 82228  	if _nVector > int32(1) {
 82229  		_destNotNull = _sqlite3VdbeMakeLabel(tls, _v)
 82230  		goto _65
 82231  	}
 82232  	_destNotNull = _destIfFalse
 82233  _65:
 82234  	_i = int32(0)
 82235  _66:
 82236  	if _i >= _nVector {
 82237  		goto _69
 82238  	}
 82239  	_23_r3 = _sqlite3GetTempReg(tls, _pParse)
 82240  	_23_p = _sqlite3VectorFieldSubexpr(tls, _pLeft, _i)
 82241  	_23_pColl = _sqlite3ExprCollSeq(tls, _pParse, _23_p)
 82242  	_sqlite3VdbeAddOp3(tls, _v, int32(99), _pExpr.XiTable, _i, _23_r3)
 82243  	_sqlite3VdbeAddOp4(tls, _v, int32(77), _rLhs+_i, _destNotNull, _23_r3, (*int8)(unsafe.Pointer(_23_pColl)), int32(-3))
 82244  	_sqlite3ReleaseTempReg(tls, _pParse, _23_r3)
 82245  	_i += 1
 82246  	goto _66
 82247  _69:
 82248  	_sqlite3VdbeAddOp2(tls, _v, int32(13), int32(0), _destIfNull)
 82249  	if _nVector > int32(1) {
 82250  		_sqlite3VdbeResolveLabel(tls, _v, _destNotNull)
 82251  		_sqlite3VdbeAddOp2(tls, _v, int32(7), _pExpr.XiTable, _addrTop+int32(1))
 82252  		_sqlite3VdbeAddOp2(tls, _v, int32(13), int32(0), _destIfFalse)
 82253  	}
 82254  	_sqlite3VdbeJumpHere(tls, _v, _addrTruthOp)
 82255  _sqlite3ExprCodeIN_finished:
 82256  	if _rLhs != _rLhsOrig {
 82257  		_sqlite3ReleaseTempReg(tls, _pParse, _rLhs)
 82258  	}
 82259  	_sqlite3ExprCachePop(tls, _pParse)
 82260  	_sqlite3VdbeComment(tls, _v, str(102003))
 82261  _sqlite3ExprCodeIN_oom_error:
 82262  	_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.Xdb), unsafe.Pointer(_aiMap))
 82263  	_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.Xdb), unsafe.Pointer(_zAff))
 82264  }
 82265  
 82266  // C comment
 82267  //  /*
 82268  //  ** Expr pIn is an IN(...) expression. This function checks that the
 82269  //  ** sub-select on the RHS of the IN() operator has the same number of
 82270  //  ** columns as the vector on the LHS. Or, if the RHS of the IN() is not
 82271  //  ** a sub-query, that the LHS is a vector of size 1.
 82272  //  */
 82273  func _sqlite3ExprCheckIN(tls *crt.TLS, _pParse *XParse, _pIn *XExpr) (r0 int32) {
 82274  	var _nVector int32
 82275  	_nVector = _sqlite3ExprVectorSize(tls, (*XExpr)(_pIn.XpLeft))
 82276  	if (_pIn.Xflags & uint32(2048)) == 0 {
 82277  		goto _0
 82278  	}
 82279  	if _nVector != ((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pIn.Xx))).XpEList).XnExpr) {
 82280  		_sqlite3SubselectError(tls, _pParse, (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pIn.Xx))).XpEList).XnExpr, _nVector)
 82281  		return int32(1)
 82282  	}
 82283  	goto _3
 82284  _0:
 82285  	if _nVector != int32(1) {
 82286  		_sqlite3VectorErrorMsg(tls, _pParse, (*XExpr)(_pIn.XpLeft))
 82287  		return int32(1)
 82288  	}
 82289  _3:
 82290  	return int32(0)
 82291  }
 82292  
 82293  var _sqlite3ExprCodeINØ00__func__Ø000 [18]int8
 82294  
 82295  func init() {
 82296  	crt.Xstrncpy(nil, &_sqlite3ExprCodeINØ00__func__Ø000[0], str(102015), 18)
 82297  }
 82298  
 82299  // C comment
 82300  //  /* IN operator used as a loop */
 82301  func _sqlite3FindInIndex(tls *crt.TLS, _pParse *XParse, _pX *XExpr, _inFlags uint32, _prRhsHasNull *int32, _aiMap *int32) (r0 int32) {
 82302  	var _4_iDb int16
 82303  	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
 82304  	var _7_idxaff, _7_cmpaff int8
 82305  	var _20_savedNQueryLoop uint32
 82306  	var _10_colUsed, _10_mCol uint64
 82307  	var _4_db *Xsqlite3
 82308  	var _4_pTab *XTable
 82309  	var _v *TVdbe
 82310  	var _1_pEList, _4_pEList *XExprList
 82311  	var _p *XSelect
 82312  	var _7_pLhs, _13_pLhs, _13_pRhs *XExpr
 82313  	var _6_pIdx *XIndex
 82314  	var _13_pReq *XCollSeq
 82315  	_eType = int32(0)
 82316  	_iTab = postInc2(&_pParse.XnTab, 1)
 82317  	_v = _sqlite3GetVdbe(tls, _pParse)
 82318  	func() {
 82319  		if int32(_pX.Xop) != int32(74) {
 82320  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93103), unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000), unsafe.Pointer(str(102033)))
 82321  			crt.X__builtin_abort(tls)
 82322  		}
 82323  	}()
 82324  	_mustBeUnique = bool2int((_inFlags & uint32(4)) != (0))
 82325  	if _prRhsHasNull == nil || (_pX.Xflags&uint32(2048)) == 0 {
 82326  		goto _3
 82327  	}
 82328  	_1_pEList = (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pX.Xx))).XpEList)
 82329  	_1_i = int32(0)
 82330  _4:
 82331  	if _1_i >= _1_pEList.XnExpr {
 82332  		goto _7
 82333  	}
 82334  	if _sqlite3ExprCanBeNull(tls, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_1_pEList.Xa)), uintptr(_1_i)).XpExpr)) != 0 {
 82335  		goto _7
 82336  	}
 82337  	_1_i += 1
 82338  	goto _4
 82339  _7:
 82340  	if _1_i == _1_pEList.XnExpr {
 82341  		_prRhsHasNull = nil
 82342  	}
 82343  _3:
 82344  	if _pParse.XnErr != int32(0) || store97(&_p, _isCandidateForInOpt(tls, _pX)) == nil {
 82345  		goto _11
 82346  	}
 82347  	_4_db = (*Xsqlite3)(_pParse.Xdb)
 82348  	_4_pEList = (*XExprList)(_p.XpEList)
 82349  	_4_nExpr = _4_pEList.XnExpr
 82350  	func() {
 82351  		if (*XExprList)(_p.XpEList) == nil {
 82352  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93132), unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000), unsafe.Pointer(str(46042)))
 82353  			crt.X__builtin_abort(tls)
 82354  		}
 82355  	}()
 82356  	func() {
 82357  		if (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.XpEList).Xa))), 0).XpExpr) == nil {
 82358  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93133), unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000), unsafe.Pointer(str(102047)))
 82359  			crt.X__builtin_abort(tls)
 82360  		}
 82361  	}()
 82362  	func() {
 82363  		if (*XSrcList)(_p.XpSrc) == nil {
 82364  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93134), unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000), unsafe.Pointer(str(102072)))
 82365  			crt.X__builtin_abort(tls)
 82366  		}
 82367  	}()
 82368  	_4_pTab = (*XTable)(elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.XpSrc).Xa))), 0).XpTab)
 82369  	_4_iDb = int16(_sqlite3SchemaToIndex(tls, _4_db, (*XSchema)(_4_pTab.XpSchema)))
 82370  	_sqlite3CodeVerifySchema(tls, _pParse, int32(_4_iDb))
 82371  	_sqlite3TableLock(tls, _pParse, int32(_4_iDb), _4_pTab.Xtnum, 0, _4_pTab.XzName)
 82372  	func() {
 82373  		if _v == nil {
 82374  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93142), unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000), unsafe.Pointer(str(41816)))
 82375  			crt.X__builtin_abort(tls)
 82376  		}
 82377  	}()
 82378  	if (_4_nExpr == int32(1)) && (int32((*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_4_pEList.Xa)), 0).XpExpr).XiColumn) < int32(0)) {
 82379  		_5_iAddr = _sqlite3VdbeAddOp0(tls, _v, int32(20))
 82380  		_sqlite3OpenTable(tls, _pParse, _iTab, int32(_4_iDb), _4_pTab, int32(106))
 82381  		_eType = int32(1)
 82382  		_sqlite3VdbeJumpHere(tls, _v, _5_iAddr)
 82383  		goto _22
 82384  	}
 82385  	_6_affinity_ok = int32(1)
 82386  	_6_i = int32(0)
 82387  _23:
 82388  	if _6_i >= _4_nExpr || _6_affinity_ok == 0 {
 82389  		goto _27
 82390  	}
 82391  	_7_pLhs = _sqlite3VectorFieldSubexpr(tls, (*XExpr)(_pX.XpLeft), _6_i)
 82392  	_7_iCol = int32((*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_4_pEList.Xa)), uintptr(_6_i)).XpExpr).XiColumn)
 82393  	_7_idxaff = _sqlite3TableColumnAffinity(tls, _4_pTab, _7_iCol)
 82394  	_7_cmpaff = _sqlite3CompareAffinity(tls, _7_pLhs, _7_idxaff)
 82395  	switch int32(_7_cmpaff) {
 82396  	case int32(65):
 82397  		goto _29
 82398  	case int32(66):
 82399  		goto _30
 82400  	default:
 82401  		goto _31
 82402  	}
 82403  
 82404  _29:
 82405  	goto _32
 82406  _30:
 82407  	func() {
 82408  		if int32(_7_idxaff) != int32(66) {
 82409  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93176), unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000), unsafe.Pointer(str(102083)))
 82410  			crt.X__builtin_abort(tls)
 82411  		}
 82412  	}()
 82413  	goto _32
 82414  _31:
 82415  	_6_affinity_ok = bool2int(int32(_7_idxaff) >= int32(67))
 82416  _32:
 82417  	_6_i += 1
 82418  	goto _23
 82419  _27:
 82420  	if _6_affinity_ok == 0 {
 82421  		goto _35
 82422  	}
 82423  	_6_pIdx = (*XIndex)(_4_pTab.XpIndex)
 82424  _36:
 82425  	if _6_pIdx == nil || _eType != int32(0) {
 82426  		goto _40
 82427  	}
 82428  	if int32(_6_pIdx.XnColumn) < _4_nExpr {
 82429  		goto _37
 82430  	}
 82431  	if int32(_6_pIdx.XnColumn) >= int32(63) {
 82432  		goto _37
 82433  	}
 82434  	if _mustBeUnique == 0 {
 82435  		goto _43
 82436  	}
 82437  	if (int32(_6_pIdx.XnKeyCol) > _4_nExpr) || ((int32(_6_pIdx.XnColumn) > _4_nExpr) && (int32(_6_pIdx.XonError) == int32(0))) {
 82438  		goto _37
 82439  	}
 82440  _43:
 82441  	_10_colUsed = 0
 82442  	_6_i = int32(0)
 82443  _47:
 82444  	if _6_i >= _4_nExpr {
 82445  		goto _50
 82446  	}
 82447  	_13_pLhs = _sqlite3VectorFieldSubexpr(tls, (*XExpr)(_pX.XpLeft), _6_i)
 82448  	_13_pRhs = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_4_pEList.Xa)), uintptr(_6_i)).XpExpr)
 82449  	_13_pReq = _sqlite3BinaryCompareCollSeq(tls, _pParse, _13_pLhs, _13_pRhs)
 82450  	func() {
 82451  		if _13_pReq == nil && int32(_13_pRhs.XiColumn) != int32(-1) && _pParse.XnErr == 0 {
 82452  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93209), unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000), unsafe.Pointer(str(102107)))
 82453  			crt.X__builtin_abort(tls)
 82454  		}
 82455  	}()
 82456  	_13_j = int32(0)
 82457  _55:
 82458  	if _13_j >= _4_nExpr {
 82459  		goto _58
 82460  	}
 82461  	if int32(*elem50(_6_pIdx.XaiColumn, uintptr(_13_j))) != int32(_13_pRhs.XiColumn) {
 82462  		goto _56
 82463  	}
 82464  	func() {
 82465  		if (*elem0(_6_pIdx.XazColl, uintptr(_13_j))) == nil {
 82466  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93212), unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000), unsafe.Pointer(str(102158)))
 82467  			crt.X__builtin_abort(tls)
 82468  		}
 82469  	}()
 82470  	if (_13_pReq != nil) && (_sqlite3StrICmp(tls, _13_pReq.XzName, *elem0(_6_pIdx.XazColl, uintptr(_13_j))) != int32(0)) {
 82471  		goto _56
 82472  	}
 82473  	goto _58
 82474  _56:
 82475  	_13_j += 1
 82476  	goto _55
 82477  _58:
 82478  	if _13_j == _4_nExpr {
 82479  		goto _50
 82480  	}
 82481  	_10_mCol = uint64(1) << uint(_13_j)
 82482  	if (_10_mCol & _10_colUsed) != 0 {
 82483  		goto _50
 82484  	}
 82485  	_10_colUsed |= _10_mCol
 82486  	if _aiMap != nil {
 82487  		*elem8(_aiMap, uintptr(_6_i)) = _13_j
 82488  	}
 82489  	_6_i += 1
 82490  	goto _47
 82491  _50:
 82492  	func() {
 82493  		if _6_i != _4_nExpr && _10_colUsed == ((uint64(1)<<uint(_4_nExpr))-uint64(1)) {
 82494  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(93225), unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000), unsafe.Pointer(str(102174)))
 82495  			crt.X__builtin_abort(tls)
 82496  		}
 82497  	}()
 82498  	if _10_colUsed != ((uint64(1) << uint(_4_nExpr)) - uint64(1)) {
 82499  		goto _70
 82500  	}
 82501  	_16_iAddr = _sqlite3VdbeAddOp0(tls, _v, int32(20))
 82502  	_sqlite3VdbeAddOp4(tls, _v, int32(165), int32(0), int32(0), int32(0), _sqlite3MPrintf(tls, _4_db, str(102214), unsafe.Pointer(_6_pIdx.XzName)), int32(-1))
 82503  	_sqlite3VdbeAddOp3(tls, _v, int32(106), _iTab, _6_pIdx.Xtnum, int32(_4_iDb))
 82504  	_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _6_pIdx)
 82505  	_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(_6_pIdx.XzName))
 82506  
 82507  	_eType = int32(3) + int32(*elem15(_6_pIdx.XaSortOrder, 0))
 82508  	if _prRhsHasNull == nil {
 82509  		goto _71
 82510  	}
 82511  	*_prRhsHasNull = preInc2(&_pParse.XnMem, 1)
 82512  	if _4_nExpr == int32(1) {
 82513  		_sqlite3SetHasNullFlag(tls, _v, _iTab, *_prRhsHasNull)
 82514  	}
 82515  _71:
 82516  	_sqlite3VdbeJumpHere(tls, _v, _16_iAddr)
 82517  _70:
 82518  _37:
 82519  	_6_pIdx = (*XIndex)(_6_pIdx.XpNext)
 82520  	goto _36
 82521  _40:
 82522  _35:
 82523  _22:
 82524  _11:
 82525  	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))) {
 82526  		_eType = int32(5)
 82527  	}
 82528  	if _eType != int32(0) {
 82529  		goto _78
 82530  	}
 82531  	_20_savedNQueryLoop = _pParse.XnQueryLoop
 82532  	_20_rMayHaveNull = int32(0)
 82533  	_eType = int32(2)
 82534  	if (_inFlags & uint32(4)) == 0 {
 82535  		goto _79
 82536  	}
 82537  	_pParse.XnQueryLoop = 0
 82538  	if (int32((*XExpr)(_pX.XpLeft).XiColumn) < int32(0)) && ((_pX.Xflags & uint32(2048)) == (0)) {
 82539  		_eType = int32(1)
 82540  	}
 82541  	goto _83
 82542  _79:
 82543  	if _prRhsHasNull != nil {
 82544  		*_prRhsHasNull = store2(&_20_rMayHaveNull, preInc2(&_pParse.XnMem, 1))
 82545  	}
 82546  _83:
 82547  	_sqlite3CodeSubselect(tls, _pParse, _pX, _20_rMayHaveNull, bool2int(_eType == int32(1)))
 82548  	_pParse.XnQueryLoop = _20_savedNQueryLoop
 82549  	goto _84
 82550  _78:
 82551  	_pX.XiTable = _iTab
 82552  _84:
 82553  	if _aiMap == nil || _eType == int32(3) || _eType == int32(4) {
 82554  		goto _87
 82555  	}
 82556  	_25_n = _sqlite3ExprVectorSize(tls, (*XExpr)(_pX.XpLeft))
 82557  	_25_i = int32(0)
 82558  _88:
 82559  	if _25_i >= _25_n {
 82560  		goto _91
 82561  	}
 82562  	*elem8(_aiMap, uintptr(_25_i)) = _25_i
 82563  	_25_i += 1
 82564  	goto _88
 82565  _91:
 82566  _87:
 82567  	return _eType
 82568  }
 82569  
 82570  var _sqlite3FindInIndexØ00__func__Ø000 [19]int8
 82571  
 82572  func init() {
 82573  	crt.Xstrncpy(nil, &_sqlite3FindInIndexØ00__func__Ø000[0], str(102245), 19)
 82574  }
 82575  
 82576  // C comment
 82577  //  /*
 82578  //  ** Return FALSE if there is no chance that the expression can be NULL.
 82579  //  **
 82580  //  ** If the expression might be NULL or if the expression is too complex
 82581  //  ** to tell return TRUE.
 82582  //  **
 82583  //  ** This routine is used as an optimization, to skip OP_IsNull opcodes
 82584  //  ** when we know that a value cannot be NULL.  Hence, a false positive
 82585  //  ** (returning TRUE when in fact the expression can never be NULL) might
 82586  //  ** be a small performance hit but is otherwise harmless.  On the other
 82587  //  ** hand, a false negative (returning FALSE when the result could be NULL)
 82588  //  ** will likely result in an incorrect answer.  So when in doubt, return
 82589  //  ** TRUE.
 82590  //  */
 82591  func _sqlite3ExprCanBeNull(tls *crt.TLS, _p *XExpr) (r0 int32) {
 82592  	var _op uint8
 82593  _0:
 82594  	if (int32(_p.Xop) == int32(156)) || (int32(_p.Xop) == int32(155)) {
 82595  		_p = (*XExpr)(_p.XpLeft)
 82596  		goto _0
 82597  	}
 82598  	_op = _p.Xop
 82599  	if int32(_op) == int32(157) {
 82600  		_op = _p.Xop2
 82601  	}
 82602  	switch int32(_op) {
 82603  	case int32(97):
 82604  		goto _5
 82605  	case int32(132):
 82606  		goto _5
 82607  	case int32(133):
 82608  		goto _5
 82609  	case int32(134):
 82610  		goto _5
 82611  	case int32(152):
 82612  		goto _9
 82613  	default:
 82614  		goto _10
 82615  	}
 82616  
 82617  _5:
 82618  	return int32(0)
 82619  
 82620  _9:
 82621  	func() {
 82622  		if (*XTable)(_p.XpTab) == nil {
 82623  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92867), unsafe.Pointer(&_sqlite3ExprCanBeNullØ00__func__Ø000), unsafe.Pointer(str(102264)))
 82624  			crt.X__builtin_abort(tls)
 82625  		}
 82626  	}()
 82627  	return bool2int(((_p.Xflags & uint32(1048576)) != (0)) || ((int32(_p.XiColumn) >= int32(0)) && (int32(elem41((*XColumn)((*XTable)(_p.XpTab).XaCol), uintptr(_p.XiColumn)).XnotNull) == int32(0))))
 82628  
 82629  _10:
 82630  	return int32(1)
 82631  }
 82632  
 82633  var _sqlite3ExprCanBeNullØ00__func__Ø000 [21]int8
 82634  
 82635  func init() {
 82636  	crt.Xstrncpy(nil, &_sqlite3ExprCanBeNullØ00__func__Ø000[0], str(102275), 21)
 82637  }
 82638  
 82639  func _isCandidateForInOpt(tls *crt.TLS, _pX *XExpr) (r0 *XSelect) {
 82640  	var _i int32
 82641  	var _pTab *XTable
 82642  	var _pSrc *XSrcList
 82643  	var _pEList *XExprList
 82644  	var _p *XSelect
 82645  	var _2_pRes *XExpr
 82646  	if (_pX.Xflags & uint32(2048)) == (0) {
 82647  		return nil
 82648  	}
 82649  	if (_pX.Xflags & uint32(32)) != (0) {
 82650  		return nil
 82651  	}
 82652  	_p = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pX.Xx)))
 82653  	if _p.XpPrior != nil {
 82654  		return nil
 82655  	}
 82656  	if (_p.XselFlags & uint32(9)) != 0 {
 82657  		return nil
 82658  	}
 82659  	func() {
 82660  		if (*XExprList)(_p.XpGroupBy) != nil {
 82661  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92948), unsafe.Pointer(&_isCandidateForInOptØ00__func__Ø000), unsafe.Pointer(str(46674)))
 82662  			crt.X__builtin_abort(tls)
 82663  		}
 82664  	}()
 82665  	if _p.XpLimit != nil {
 82666  		return nil
 82667  	}
 82668  	func() {
 82669  		if (*XExpr)(_p.XpOffset) != nil {
 82670  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92950), unsafe.Pointer(&_isCandidateForInOptØ00__func__Ø000), unsafe.Pointer(str(98569)))
 82671  			crt.X__builtin_abort(tls)
 82672  		}
 82673  	}()
 82674  	if _p.XpWhere != nil {
 82675  		return nil
 82676  	}
 82677  	_pSrc = (*XSrcList)(_p.XpSrc)
 82678  	func() {
 82679  		if _pSrc == nil {
 82680  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92953), unsafe.Pointer(&_isCandidateForInOptØ00__func__Ø000), unsafe.Pointer(str(47776)))
 82681  			crt.X__builtin_abort(tls)
 82682  		}
 82683  	}()
 82684  	if _pSrc.XnSrc != int32(1) {
 82685  		return nil
 82686  	}
 82687  	if (elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), 0).XpSelect) != nil {
 82688  		return nil
 82689  	}
 82690  	_pTab = (*XTable)(elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), 0).XpTab)
 82691  	func() {
 82692  		if _pTab == nil {
 82693  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92957), unsafe.Pointer(&_isCandidateForInOptØ00__func__Ø000), unsafe.Pointer(str(43549)))
 82694  			crt.X__builtin_abort(tls)
 82695  		}
 82696  	}()
 82697  	func() {
 82698  		if (*XSelect)(_pTab.XpSelect) != nil {
 82699  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92958), unsafe.Pointer(&_isCandidateForInOptØ00__func__Ø000), unsafe.Pointer(str(102296)))
 82700  			crt.X__builtin_abort(tls)
 82701  		}
 82702  	}()
 82703  	if _pTab.XnModuleArg != 0 {
 82704  		return nil
 82705  	}
 82706  	_pEList = (*XExprList)(_p.XpEList)
 82707  	func() {
 82708  		if _pEList == nil {
 82709  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92961), unsafe.Pointer(&_isCandidateForInOptØ00__func__Ø000), unsafe.Pointer(str(45007)))
 82710  			crt.X__builtin_abort(tls)
 82711  		}
 82712  	}()
 82713  	_i = int32(0)
 82714  _21:
 82715  	if _i >= _pEList.XnExpr {
 82716  		goto _24
 82717  	}
 82718  	_2_pRes = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_i)).XpExpr)
 82719  	if int32(_2_pRes.Xop) != int32(152) {
 82720  		return nil
 82721  	}
 82722  	func() {
 82723  		if _2_pRes.XiTable != (elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), 0).XiCursor) {
 82724  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92966), unsafe.Pointer(&_isCandidateForInOptØ00__func__Ø000), unsafe.Pointer(str(102313)))
 82725  			crt.X__builtin_abort(tls)
 82726  		}
 82727  	}()
 82728  	_i += 1
 82729  	goto _21
 82730  _24:
 82731  	return _p
 82732  }
 82733  
 82734  var _isCandidateForInOptØ00__func__Ø000 [20]int8
 82735  
 82736  func init() {
 82737  	crt.Xstrncpy(nil, &_isCandidateForInOptØ00__func__Ø000[0], str(102346), 20)
 82738  }
 82739  
 82740  // C comment
 82741  //  /*
 82742  //  ** Record the fact that the schema cookie will need to be verified
 82743  //  ** for database iDb.  The code to actually verify the schema cookie
 82744  //  ** will occur at the end of the top-level VDBE and will be generated
 82745  //  ** later, by sqlite3FinishCoding().
 82746  //  */
 82747  func _sqlite3CodeVerifySchema(tls *crt.TLS, _pParse *XParse, _iDb int32) {
 82748  	var _pToplevel *XParse
 82749  	_pToplevel = func() *XParse {
 82750  		if _pParse.XpToplevel != nil {
 82751  			return (*XParse)(_pParse.XpToplevel)
 82752  		}
 82753  		return _pParse
 82754  	}()
 82755  	func() {
 82756  		if _iDb < int32(0) || _iDb >= ((*Xsqlite3)(_pParse.Xdb).XnDb) {
 82757  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103756), unsafe.Pointer(&_sqlite3CodeVerifySchemaØ00__func__Ø000), unsafe.Pointer(str(102366)))
 82758  			crt.X__builtin_abort(tls)
 82759  		}
 82760  	}()
 82761  	func() {
 82762  		if (*XBtree)(elem27((*XDb)((*Xsqlite3)(_pParse.Xdb).XaDb), uintptr(_iDb)).XpBt) == nil && _iDb != int32(1) {
 82763  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103757), unsafe.Pointer(&_sqlite3CodeVerifySchemaØ00__func__Ø000), unsafe.Pointer(str(102396)))
 82764  			crt.X__builtin_abort(tls)
 82765  		}
 82766  	}()
 82767  	func() {
 82768  		if _iDb >= int32(12) {
 82769  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103758), unsafe.Pointer(&_sqlite3CodeVerifySchemaØ00__func__Ø000), unsafe.Pointer(str(102434)))
 82770  			crt.X__builtin_abort(tls)
 82771  		}
 82772  	}()
 82773  	func() {
 82774  		if _sqlite3SchemaMutexHeld(tls, (*Xsqlite3)(_pParse.Xdb), _iDb, nil) == 0 {
 82775  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103759), unsafe.Pointer(&_sqlite3CodeVerifySchemaØ00__func__Ø000), unsafe.Pointer(str(102460)))
 82776  			crt.X__builtin_abort(tls)
 82777  		}
 82778  	}()
 82779  	if bool2int((_pToplevel.XcookieMask&(uint32(1)<<uint(_iDb))) != (0)) != int32(0) {
 82780  		goto _12
 82781  	}
 82782  	_pToplevel.XcookieMask |= uint32(1) << uint(_iDb)
 82783  	if int32(1) != 0 && (_iDb == int32(1)) {
 82784  		_sqlite3OpenTempDatabase(tls, _pToplevel)
 82785  	}
 82786  _12:
 82787  }
 82788  
 82789  var _sqlite3CodeVerifySchemaØ00__func__Ø000 [24]int8
 82790  
 82791  func init() {
 82792  	crt.Xstrncpy(nil, &_sqlite3CodeVerifySchemaØ00__func__Ø000[0], str(102503), 24)
 82793  }
 82794  
 82795  // C comment
 82796  //  /*
 82797  //  ** Make sure the TEMP database is open and available for use.  Return
 82798  //  ** the number of errors.  Leave any error messages in the pParse structure.
 82799  //  */
 82800  func _sqlite3OpenTempDatabase(tls *crt.TLS, _pParse *XParse) (r0 int32) {
 82801  	var _1_rc int32
 82802  	var _db *Xsqlite3
 82803  	var _1_pBt *XBtree
 82804  	_db = (*Xsqlite3)(_pParse.Xdb)
 82805  	if (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(1)).XpBt) != nil || _pParse.Xexplain != 0 {
 82806  		goto _1
 82807  	}
 82808  	_1_rc = _sqlite3BtreeOpen(tls, (*Xsqlite3_vfs)(_db.XpVfs), nil, _db, &_1_pBt, int32(0), _sqlite3OpenTempDatabaseØ00flagsØ001)
 82809  	if _1_rc != int32(0) {
 82810  		_sqlite3ErrorMsg(tls, _pParse, str(102527))
 82811  		_pParse.Xrc = _1_rc
 82812  		return int32(1)
 82813  	}
 82814  	*(**XBtree)(unsafe.Pointer(&(elem27((*XDb)(_db.XaDb), uintptr(1)).XpBt))) = _1_pBt
 82815  	func() {
 82816  		if (elem27((*XDb)(_db.XaDb), uintptr(1)).XpSchema) == nil {
 82817  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103738), unsafe.Pointer(&_sqlite3OpenTempDatabaseØ00__func__Ø000), unsafe.Pointer(str(102597)))
 82818  			crt.X__builtin_abort(tls)
 82819  		}
 82820  	}()
 82821  	if int32(7) == _sqlite3BtreeSetPageSize(tls, _1_pBt, _db.XnextPagesize, int32(-1), int32(0)) {
 82822  		_sqlite3OomFault(tls, _db)
 82823  		return int32(1)
 82824  	}
 82825  _1:
 82826  	return int32(0)
 82827  }
 82828  
 82829  var _sqlite3OpenTempDatabaseØ00flagsØ001 int32
 82830  
 82831  func init() {
 82832  	_sqlite3OpenTempDatabaseØ00flagsØ001 = int32(542)
 82833  }
 82834  
 82835  var _sqlite3OpenTempDatabaseØ00__func__Ø000 [24]int8
 82836  
 82837  func init() {
 82838  	crt.Xstrncpy(nil, &_sqlite3OpenTempDatabaseØ00__func__Ø000[0], str(102616), 24)
 82839  }
 82840  
 82841  // C comment
 82842  //  /*
 82843  //  ** Generate code that checks the left-most column of index table iCur to see if
 82844  //  ** it contains any NULL entries.  Cause the register at regHasNull to be set
 82845  //  ** to a non-NULL value if iCur contains no NULLs.  Cause register regHasNull
 82846  //  ** to be set to NULL if iCur contains one or more NULL values.
 82847  //  */
 82848  func _sqlite3SetHasNullFlag(tls *crt.TLS, _v *TVdbe, _iCur int32, _regHasNull int32) {
 82849  	var _addr1 int32
 82850  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _regHasNull)
 82851  	_addr1 = _sqlite3VdbeAddOp1(tls, _v, int32(37), _iCur)
 82852  	_sqlite3VdbeAddOp3(tls, _v, int32(99), _iCur, int32(0), _regHasNull)
 82853  	_sqlite3VdbeChangeP5(tls, _v, uint16(128))
 82854  	_sqlite3VdbeComment(tls, _v, str(102640), _iCur)
 82855  	_sqlite3VdbeJumpHere(tls, _v, _addr1)
 82856  }
 82857  
 82858  // C comment
 82859  //  /*
 82860  //  ** The argument is an IN operator with a list (not a subquery) on the
 82861  //  ** right-hand side.  Return TRUE if that list is constant.
 82862  //  */
 82863  func _sqlite3InRhsIsConstant(tls *crt.TLS, _pIn *XExpr) (r0 int32) {
 82864  	var _res int32
 82865  	var _pLHS *XExpr
 82866  	func() {
 82867  		if (_pIn.Xflags & uint32(2048)) != (0) {
 82868  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92999), unsafe.Pointer(&_sqlite3InRhsIsConstantØ00__func__Ø000), unsafe.Pointer(str(102659)))
 82869  			crt.X__builtin_abort(tls)
 82870  		}
 82871  	}()
 82872  	_pLHS = (*XExpr)(_pIn.XpLeft)
 82873  	*(**XExpr)(unsafe.Pointer(&_pIn.XpLeft)) = nil
 82874  	_res = _sqlite3ExprIsConstant(tls, _pIn)
 82875  	*(**XExpr)(unsafe.Pointer(&_pIn.XpLeft)) = _pLHS
 82876  	return _res
 82877  }
 82878  
 82879  var _sqlite3InRhsIsConstantØ00__func__Ø000 [23]int8
 82880  
 82881  func init() {
 82882  	crt.Xstrncpy(nil, &_sqlite3InRhsIsConstantØ00__func__Ø000[0], str(102695), 23)
 82883  }
 82884  
 82885  // C comment
 82886  //  /*
 82887  //  ** If the expression is always either TRUE or FALSE (respectively),
 82888  //  ** then return 1.  If one cannot determine the truth value of the
 82889  //  ** expression at compile-time return 0.
 82890  //  **
 82891  //  ** This is an optimization.  If is OK to return 0 here even if
 82892  //  ** the expression really is always false or false (a false negative).
 82893  //  ** But it is a bug to return 1 if the expression might have different
 82894  //  ** boolean values in different circumstances (a false positive.)
 82895  //  **
 82896  //  ** Note that if the expression is part of conditional for a
 82897  //  ** LEFT JOIN, then we cannot determine at compile-time whether or not
 82898  //  ** is it true or false, so always return 0.
 82899  //  */
 82900  func _exprAlwaysTrue(tls *crt.TLS, _p *XExpr) (r0 int32) {
 82901  	var _v int32
 82902  	_v = int32(0)
 82903  	if (_p.Xflags & uint32(1)) != (0) {
 82904  		return int32(0)
 82905  	}
 82906  	if _sqlite3ExprIsInteger(tls, _p, &_v) == 0 {
 82907  		return int32(0)
 82908  	}
 82909  	return bool2int(_v != int32(0))
 82910  }
 82911  
 82912  // C comment
 82913  //  /*
 82914  //  ** Create a new mask for cursor iCursor.
 82915  //  **
 82916  //  ** There is one cursor per table in the FROM clause.  The number of
 82917  //  ** tables in the FROM clause is limited by a test early in the
 82918  //  ** sqlite3WhereBegin() routine.  So we know that the pMaskSet->ix[]
 82919  //  ** array will never overflow.
 82920  //  */
 82921  func _createMask(tls *crt.TLS, _pMaskSet *XWhereMaskSet, _iCursor int32) {
 82922  	func() {
 82923  		if _pMaskSet.Xn >= int32(64) {
 82924  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(130573), unsafe.Pointer(&_createMaskØ00__func__Ø000), unsafe.Pointer(str(102718)))
 82925  			crt.X__builtin_abort(tls)
 82926  		}
 82927  	}()
 82928  	*elem8((*int32)(unsafe.Pointer(&_pMaskSet.Xix)), uintptr(postInc2(&_pMaskSet.Xn, 1))) = _iCursor
 82929  }
 82930  
 82931  var _createMaskØ00__func__Ø000 [11]int8
 82932  
 82933  func init() {
 82934  	crt.Xstrncpy(nil, &_createMaskØ00__func__Ø000[0], str(102756), 11)
 82935  }
 82936  
 82937  // C comment
 82938  //  /*
 82939  //  ** For table-valued-functions, transform the function arguments into
 82940  //  ** new WHERE clause terms.
 82941  //  **
 82942  //  ** Each function argument translates into an equality constraint against
 82943  //  ** a HIDDEN column in the table.
 82944  //  */
 82945  func _sqlite3WhereTabFuncArgs(tls *crt.TLS, _pParse *XParse, _pItem *TSrcList_item, _pWC *XWhereClause) {
 82946  	var _j, _k int32
 82947  	var _pTab *XTable
 82948  	var _pArgs *XExprList
 82949  	var _pColRef, _pTerm *XExpr
 82950  	if int32((uint32((_pItem.Xfg.XnotIndexed)>>2)<<31)>>31) == int32(0) {
 82951  		return
 82952  	}
 82953  	_pTab = (*XTable)(_pItem.XpTab)
 82954  	func() {
 82955  		if _pTab == nil {
 82956  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(130367), unsafe.Pointer(&_sqlite3WhereTabFuncArgsØ00__func__Ø000), unsafe.Pointer(str(43549)))
 82957  			crt.X__builtin_abort(tls)
 82958  		}
 82959  	}()
 82960  	_pArgs = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pItem.Xu1)))
 82961  	if _pArgs == nil {
 82962  		return
 82963  	}
 82964  	_j = store2(&_k, int32(0))
 82965  _4:
 82966  	if _j >= _pArgs.XnExpr {
 82967  		goto _7
 82968  	}
 82969  _8:
 82970  	if (_k < int32(_pTab.XnCol)) && ((int32(elem41((*XColumn)(_pTab.XaCol), uintptr(_k)).XcolFlags) & int32(2)) == int32(0)) {
 82971  		_k += 1
 82972  		goto _8
 82973  	}
 82974  	if _k >= int32(_pTab.XnCol) {
 82975  		_sqlite3ErrorMsg(tls, _pParse, str(102767), unsafe.Pointer(_pTab.XzName), _j)
 82976  		return
 82977  	}
 82978  	_pColRef = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.Xdb), int32(152), nil, int32(0))
 82979  	if _pColRef == nil {
 82980  		return
 82981  	}
 82982  	_pColRef.XiTable = _pItem.XiCursor
 82983  	_pColRef.XiColumn = int16(postInc2(&_k, 1))
 82984  	*(**XTable)(unsafe.Pointer(&_pColRef.XpTab)) = _pTab
 82985  	_pTerm = _sqlite3PExpr(tls, _pParse, int32(78), _pColRef, _sqlite3ExprDup(tls, (*Xsqlite3)(_pParse.Xdb), (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pArgs.Xa)), uintptr(_j)).XpExpr), int32(0)))
 82986  	_whereClauseInsert(tls, _pWC, _pTerm, uint16(1))
 82987  	_j += 1
 82988  	goto _4
 82989  _7:
 82990  }
 82991  
 82992  var _sqlite3WhereTabFuncArgsØ00__func__Ø000 [24]int8
 82993  
 82994  func init() {
 82995  	crt.Xstrncpy(nil, &_sqlite3WhereTabFuncArgsØ00__func__Ø000[0], str(102803), 24)
 82996  }
 82997  
 82998  // C comment
 82999  //  /*
 83000  //  ** Return the bitmask for the given cursor number.  Return 0 if
 83001  //  ** iCursor is not in the set.
 83002  //  */
 83003  func _sqlite3WhereGetMask(tls *crt.TLS, _pMaskSet *XWhereMaskSet, _iCursor int32) (r0 uint64) {
 83004  	var _i int32
 83005  	func() {
 83006  		if _pMaskSet.Xn > int32(64) {
 83007  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(130555), unsafe.Pointer(&_sqlite3WhereGetMaskØ00__func__Ø000), unsafe.Pointer(str(102827)))
 83008  			crt.X__builtin_abort(tls)
 83009  		}
 83010  	}()
 83011  	_i = int32(0)
 83012  _2:
 83013  	if _i >= _pMaskSet.Xn {
 83014  		goto _5
 83015  	}
 83016  	if (*elem8((*int32)(unsafe.Pointer(&_pMaskSet.Xix)), uintptr(_i))) == _iCursor {
 83017  		return uint64(1) << uint(_i)
 83018  	}
 83019  	_i += 1
 83020  	goto _2
 83021  _5:
 83022  	return 0
 83023  }
 83024  
 83025  var _sqlite3WhereGetMaskØ00__func__Ø000 [20]int8
 83026  
 83027  func init() {
 83028  	crt.Xstrncpy(nil, &_sqlite3WhereGetMaskØ00__func__Ø000[0], str(102863), 20)
 83029  }
 83030  
 83031  // C comment
 83032  //  /*
 83033  //  ** Call exprAnalyze on all terms in a WHERE clause.
 83034  //  **
 83035  //  ** Note that exprAnalyze() might add new virtual terms onto the
 83036  //  ** end of the WHERE clause.  We do not want to analyze these new
 83037  //  ** virtual terms, so start analyzing at the end and work forward
 83038  //  ** so that the added virtual terms are never processed.
 83039  //  */
 83040  func _sqlite3WhereExprAnalyze(tls *crt.TLS, _pTabList *XSrcList, _pWC *XWhereClause) {
 83041  	var _i int32
 83042  	_i = _pWC.XnTerm - int32(1)
 83043  _0:
 83044  	if _i < int32(0) {
 83045  		goto _3
 83046  	}
 83047  	_exprAnalyze(tls, _pTabList, _pWC, _i)
 83048  	_i -= 1
 83049  	goto _0
 83050  _3:
 83051  }
 83052  
 83053  // C comment
 83054  //  /*
 83055  //  ** The input to this routine is an WhereTerm structure with only the
 83056  //  ** "pExpr" field filled in.  The job of this routine is to analyze the
 83057  //  ** subexpression and populate all the other fields of the WhereTerm
 83058  //  ** structure.
 83059  //  **
 83060  //  ** If the expression is of the form "<expr> <op> X" it gets commuted
 83061  //  ** to the standard form of "X <op> <expr>".
 83062  //  **
 83063  //  ** If the expression is of the form "X <op> Y" where both X and Y are
 83064  //  ** columns, then the original expression is unchanged and a new virtual
 83065  //  ** term of the form "Y <op> X" is added to the WHERE clause and
 83066  //  ** analyzed separately.  The original term is marked with TERM_COPIED
 83067  //  ** and the new term is marked with TERM_DYNAMIC (because it's pExpr
 83068  //  ** needs to be freed with the WhereClause) and TERM_VIRTUAL (because it
 83069  //  ** is a commuted copy of a prior term.)  The original term has nChild=1
 83070  //  ** and the copy has idxParent set to the index of the original term.
 83071  //  */
 83072  func _exprAnalyze(tls *crt.TLS, _pSrc *XSrcList, _pWC *XWhereClause, _idxTerm int32) {
 83073  	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
 83074  	var _21_c int8
 83075  	var _prereqLeft, _prereqAll, _extraRight, _7_x, _26_prereqColumn, _26_prereqExpr uint64
 83076  	var _20_zCollSeqName *int8
 83077  	var _9_opMask, _12_eExtraOp, _20_wtFlags uint16
 83078  	var _eOp2, _23_c uint8
 83079  	var _23_pC *uint8
 83080  	var _db *Xsqlite3
 83081  	var _17_pList *XExprList
 83082  	var _9_aiCurCol [2]int32
 83083  	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
 83084  	var _pParse *XParse
 83085  	var _pWInfo *XWhereInfo
 83086  	var _pTerm, _12_pNew, _26_pNewTerm *XWhereTerm
 83087  	var _pMaskSet *XWhereMaskSet
 83088  	_pWInfo = (*XWhereInfo)(_pWC.XpWInfo)
 83089  	_extraRight = uint64(0)
 83090  	_pStr1 = nil
 83091  	_isComplete = int32(0)
 83092  	_noCase = int32(0)
 83093  	_pParse = (*XParse)(_pWInfo.XpParse)
 83094  	_db = (*Xsqlite3)(_pParse.Xdb)
 83095  	if _db.XmallocFailed != 0 {
 83096  		return
 83097  	}
 83098  	_pTerm = elem100((*XWhereTerm)(_pWC.Xa), uintptr(_idxTerm))
 83099  	_pMaskSet = &_pWInfo.XsMaskSet
 83100  	_pExpr = (*XExpr)(_pTerm.XpExpr)
 83101  	func() {
 83102  		if int32(_pExpr.Xop) == int32(24) || int32(_pExpr.Xop) == int32(94) {
 83103  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129865), unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000), unsafe.Pointer(str(102883)))
 83104  			crt.X__builtin_abort(tls)
 83105  		}
 83106  	}()
 83107  	_prereqLeft = _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(_pExpr.XpLeft))
 83108  	_op = int32(_pExpr.Xop)
 83109  	if _op != int32(74) {
 83110  		goto _4
 83111  	}
 83112  	func() {
 83113  		if (*XExpr)(_pExpr.XpRight) != nil {
 83114  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129869), unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000), unsafe.Pointer(str(102925)))
 83115  			crt.X__builtin_abort(tls)
 83116  		}
 83117  	}()
 83118  	if _sqlite3ExprCheckIN(tls, _pParse, _pExpr) != 0 {
 83119  		return
 83120  	}
 83121  	if (_pExpr.Xflags & uint32(2048)) != (0) {
 83122  		_pTerm.XprereqRight = _exprSelectUsage(tls, _pMaskSet, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))))
 83123  		goto _9
 83124  	}
 83125  	_pTerm.XprereqRight = _sqlite3WhereExprListUsage(tls, _pMaskSet, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))))
 83126  _9:
 83127  	goto _12
 83128  _4:
 83129  	if _op == int32(75) {
 83130  		_pTerm.XprereqRight = 0
 83131  		goto _12
 83132  	}
 83133  	_pTerm.XprereqRight = _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(_pExpr.XpRight))
 83134  _12:
 83135  	_prereqAll = _sqlite3WhereExprUsage(tls, _pMaskSet, _pExpr)
 83136  	if (_pExpr.Xflags & uint32(1)) == (0) {
 83137  		goto _13
 83138  	}
 83139  	_7_x = _sqlite3WhereGetMask(tls, _pMaskSet, int32(_pExpr.XiRightJoinTable))
 83140  	_prereqAll |= _7_x
 83141  	_extraRight = _7_x - uint64(1)
 83142  	if (_prereqAll >> 1) >= _7_x {
 83143  		_sqlite3ErrorMsg(tls, _pParse, str(102942))
 83144  		return
 83145  	}
 83146  _13:
 83147  	_pTerm.XprereqAll = _prereqAll
 83148  	_pTerm.XleftCursor = int32(-1)
 83149  	_pTerm.XiParent = int32(-1)
 83150  	_pTerm.XeOperator = 0
 83151  	if _allowedOp(tls, _op) == 0 {
 83152  		goto _15
 83153  	}
 83154  	_9_pLeft = _sqlite3ExprSkipCollate(tls, (*XExpr)(_pExpr.XpLeft))
 83155  	_9_pRight = _sqlite3ExprSkipCollate(tls, (*XExpr)(_pExpr.XpRight))
 83156  	_9_opMask = uint16(func() int32 {
 83157  		if (_pTerm.XprereqRight & _prereqLeft) == (0) {
 83158  			return int32(8191)
 83159  		}
 83160  		return int32(2048)
 83161  	}())
 83162  	if _pTerm.XiField > int32(0) {
 83163  		func() {
 83164  			if _op != int32(74) {
 83165  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129903), unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000), unsafe.Pointer(str(102983)))
 83166  				crt.X__builtin_abort(tls)
 83167  			}
 83168  		}()
 83169  		func() {
 83170  			if int32(_9_pLeft.Xop) != int32(158) {
 83171  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129904), unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000), unsafe.Pointer(str(102993)))
 83172  				crt.X__builtin_abort(tls)
 83173  			}
 83174  		}()
 83175  		_9_pLeft = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_9_pLeft.Xx))).Xa))), uintptr(_pTerm.XiField-int32(1))).XpExpr)
 83176  	}
 83177  	if _exprMightBeIndexed(tls, _pSrc, _prereqLeft, (*int32)(unsafe.Pointer(&_9_aiCurCol)), _9_pLeft, _op) != 0 {
 83178  		_pTerm.XleftCursor = *elem8((*int32)(unsafe.Pointer(&_9_aiCurCol)), 0)
 83179  		*(*int32)(unsafe.Pointer(&_pTerm.Xu)) = *elem8((*int32)(unsafe.Pointer(&_9_aiCurCol)), uintptr(1))
 83180  		_pTerm.XeOperator = uint16(int32(_operatorMask(tls, _op)) & int32(_9_opMask))
 83181  	}
 83182  	if _op == int32(72) {
 83183  		{
 83184  			p := &_pTerm.XwtFlags
 83185  			*p = uint16(int32(*p) | int32(2048))
 83186  		}
 83187  	}
 83188  	if _9_pRight == nil || _exprMightBeIndexed(tls, _pSrc, _pTerm.XprereqRight, (*int32)(unsafe.Pointer(&_9_aiCurCol)), _9_pRight, _op) == 0 {
 83189  		goto _26
 83190  	}
 83191  	_12_eExtraOp = uint16(0)
 83192  	func() {
 83193  		if _pTerm.XiField != int32(0) {
 83194  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129920), unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000), unsafe.Pointer(str(103014)))
 83195  			crt.X__builtin_abort(tls)
 83196  		}
 83197  	}()
 83198  	if _pTerm.XleftCursor < int32(0) {
 83199  		goto _29
 83200  	}
 83201  	_12_pDup = _sqlite3ExprDup(tls, _db, _pExpr, int32(0))
 83202  	if _db.XmallocFailed != 0 {
 83203  		_sqlite3ExprDelete(tls, _db, _12_pDup)
 83204  		return
 83205  	}
 83206  	_13_idxNew = _whereClauseInsert(tls, _pWC, _12_pDup, uint16(3))
 83207  	if _13_idxNew == int32(0) {
 83208  		return
 83209  	}
 83210  	_12_pNew = elem100((*XWhereTerm)(_pWC.Xa), uintptr(_13_idxNew))
 83211  	_markTermAsChild(tls, _pWC, _13_idxNew, _idxTerm)
 83212  	if _op == int32(72) {
 83213  		{
 83214  			p := &_12_pNew.XwtFlags
 83215  			*p = uint16(int32(*p) | int32(2048))
 83216  		}
 83217  	}
 83218  	_pTerm = elem100((*XWhereTerm)(_pWC.Xa), uintptr(_idxTerm))
 83219  	{
 83220  		p := &_pTerm.XwtFlags
 83221  		*p = uint16(int32(*p) | int32(8))
 83222  	}
 83223  	if _termIsEquivalence(tls, _pParse, _12_pDup) != 0 {
 83224  		{
 83225  			p := &_pTerm.XeOperator
 83226  			*p = uint16(int32(*p) | int32(2048))
 83227  		}
 83228  		_12_eExtraOp = uint16(2048)
 83229  	}
 83230  	goto _34
 83231  _29:
 83232  	_12_pDup = _pExpr
 83233  	_12_pNew = _pTerm
 83234  _34:
 83235  	_exprCommute(tls, _pParse, _12_pDup)
 83236  	_12_pNew.XleftCursor = *elem8((*int32)(unsafe.Pointer(&_9_aiCurCol)), 0)
 83237  	*(*int32)(unsafe.Pointer(&_12_pNew.Xu)) = *elem8((*int32)(unsafe.Pointer(&_9_aiCurCol)), uintptr(1))
 83238  	_12_pNew.XprereqRight = _prereqLeft | _extraRight
 83239  	_12_pNew.XprereqAll = _prereqAll
 83240  	_12_pNew.XeOperator = uint16((int32(_operatorMask(tls, int32(_12_pDup.Xop))) + int32(_12_eExtraOp)) & int32(_9_opMask))
 83241  _26:
 83242  	goto _47
 83243  _15:
 83244  	if int32(_pExpr.Xop) != int32(73) || int32(_pWC.Xop) != int32(71) {
 83245  		goto _37
 83246  	}
 83247  	_17_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 83248  	func() {
 83249  		if _17_pList == nil {
 83250  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129974), unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000), unsafe.Pointer(str(88609)))
 83251  			crt.X__builtin_abort(tls)
 83252  		}
 83253  	}()
 83254  	func() {
 83255  		if _17_pList.XnExpr != int32(2) {
 83256  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129975), unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000), unsafe.Pointer(str(103031)))
 83257  			crt.X__builtin_abort(tls)
 83258  		}
 83259  	}()
 83260  	_17_i = int32(0)
 83261  _42:
 83262  	if _17_i >= int32(2) {
 83263  		goto _45
 83264  	}
 83265  	_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)(elem57((*TExprList_item)(unsafe.Pointer(&_17_pList.Xa)), uintptr(_17_i)).XpExpr), int32(0)))
 83266  	_transferJoinMarkings(tls, _18_pNewExpr, _pExpr)
 83267  	_18_idxNew = _whereClauseInsert(tls, _pWC, _18_pNewExpr, uint16(3))
 83268  	_exprAnalyze(tls, _pSrc, _pWC, _18_idxNew)
 83269  	_pTerm = elem100((*XWhereTerm)(_pWC.Xa), uintptr(_idxTerm))
 83270  	_markTermAsChild(tls, _pWC, _18_idxNew, _idxTerm)
 83271  	_17_i += 1
 83272  	goto _42
 83273  _45:
 83274  	goto _47
 83275  _37:
 83276  	if int32(_pExpr.Xop) == int32(70) {
 83277  		func() {
 83278  			if int32(_pWC.Xop) != int32(71) {
 83279  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129997), unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000), unsafe.Pointer(str(103047)))
 83280  				crt.X__builtin_abort(tls)
 83281  			}
 83282  		}()
 83283  		_exprAnalyzeOrTerm(tls, _pSrc, _pWC, _idxTerm)
 83284  		_pTerm = elem100((*XWhereTerm)(_pWC.Xa), uintptr(_idxTerm))
 83285  	}
 83286  _47:
 83287  	if int32(_pWC.Xop) != int32(71) || _isLikeOrGlob(tls, _pParse, _pExpr, &_pStr1, &_isComplete, &_noCase) == 0 {
 83288  		goto _51
 83289  	}
 83290  	_20_wtFlags = uint16(259)
 83291  	_20_pLeft = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).Xa))), uintptr(1)).XpExpr)
 83292  	_20_pStr2 = _sqlite3ExprDup(tls, _db, _pStr1, int32(0))
 83293  	if _noCase == 0 || ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) != 0 {
 83294  		goto _53
 83295  	}
 83296  	{
 83297  		p := &_pTerm.XwtFlags
 83298  		*p = uint16(int32(*p) | int32(1024))
 83299  	}
 83300  	_21_i = int32(0)
 83301  _54:
 83302  	if int32(store5(&_21_c, *elem1(*(**int8)(unsafe.Pointer(&_pStr1.Xu)), uintptr(_21_i)))) == int32(0) {
 83303  		goto _57
 83304  	}
 83305  	*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))))
 83306  	*elem1(*(**int8)(unsafe.Pointer(&_20_pStr2.Xu)), uintptr(_21_i)) = int8(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(uint8(_21_c))))
 83307  	_21_i += 1
 83308  	goto _54
 83309  _57:
 83310  _53:
 83311  	if _db.XmallocFailed != 0 {
 83312  		goto _58
 83313  	}
 83314  	_23_pC = (*uint8)(unsafe.Pointer(elem1(*(**int8)(unsafe.Pointer(&_20_pStr2.Xu)), uintptr(_sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer(&_20_pStr2.Xu)))-int32(1)))))
 83315  	_23_c = *_23_pC
 83316  	if _noCase == 0 {
 83317  		goto _59
 83318  	}
 83319  	if int32(_23_c) == int32(64) {
 83320  		_isComplete = int32(0)
 83321  	}
 83322  	_23_c = *elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(_23_c))
 83323  _59:
 83324  	*_23_pC = uint8(int32(_23_c) + int32(1))
 83325  _58:
 83326  	_20_zCollSeqName = func() *int8 {
 83327  		if _noCase != 0 {
 83328  			return str(103063)
 83329  		}
 83330  		return str(37836)
 83331  	}()
 83332  	_20_pNewExpr1 = _sqlite3ExprDup(tls, _db, _20_pLeft, int32(0))
 83333  	_20_pNewExpr1 = _sqlite3PExpr(tls, _pParse, int32(82), _sqlite3ExprAddCollateString(tls, _pParse, _20_pNewExpr1, _20_zCollSeqName), _pStr1)
 83334  	_transferJoinMarkings(tls, _20_pNewExpr1, _pExpr)
 83335  	_20_idxNew1 = _whereClauseInsert(tls, _pWC, _20_pNewExpr1, _20_wtFlags)
 83336  	_exprAnalyze(tls, _pSrc, _pWC, _20_idxNew1)
 83337  	_20_pNewExpr2 = _sqlite3ExprDup(tls, _db, _20_pLeft, int32(0))
 83338  	_20_pNewExpr2 = _sqlite3PExpr(tls, _pParse, int32(81), _sqlite3ExprAddCollateString(tls, _pParse, _20_pNewExpr2, _20_zCollSeqName), _20_pStr2)
 83339  	_transferJoinMarkings(tls, _20_pNewExpr2, _pExpr)
 83340  	_20_idxNew2 = _whereClauseInsert(tls, _pWC, _20_pNewExpr2, _20_wtFlags)
 83341  	_exprAnalyze(tls, _pSrc, _pWC, _20_idxNew2)
 83342  	_pTerm = elem100((*XWhereTerm)(_pWC.Xa), uintptr(_idxTerm))
 83343  	if _isComplete != 0 {
 83344  		_markTermAsChild(tls, _pWC, _20_idxNew1, _idxTerm)
 83345  		_markTermAsChild(tls, _pWC, _20_idxNew2, _idxTerm)
 83346  	}
 83347  _51:
 83348  	if int32(_pWC.Xop) != int32(71) || _isMatchOfColumn(tls, _pExpr, &_eOp2) == 0 {
 83349  		goto _65
 83350  	}
 83351  	_26_pRight = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).Xa))), 0).XpExpr)
 83352  	_26_pLeft = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).Xa))), uintptr(1)).XpExpr)
 83353  	_26_prereqExpr = _sqlite3WhereExprUsage(tls, _pMaskSet, _26_pRight)
 83354  	_26_prereqColumn = _sqlite3WhereExprUsage(tls, _pMaskSet, _26_pLeft)
 83355  	if (_26_prereqExpr & _26_prereqColumn) == (0) {
 83356  		_27_pNewExpr = _sqlite3PExpr(tls, _pParse, int32(50), nil, _sqlite3ExprDup(tls, _db, _26_pRight, int32(0)))
 83357  		_26_idxNew = _whereClauseInsert(tls, _pWC, _27_pNewExpr, uint16(3))
 83358  		_26_pNewTerm = elem100((*XWhereTerm)(_pWC.Xa), uintptr(_26_idxNew))
 83359  		_26_pNewTerm.XprereqRight = _26_prereqExpr
 83360  		_26_pNewTerm.XleftCursor = _26_pLeft.XiTable
 83361  		*(*int32)(unsafe.Pointer(&_26_pNewTerm.Xu)) = int32(_26_pLeft.XiColumn)
 83362  		_26_pNewTerm.XeOperator = uint16(64)
 83363  		_26_pNewTerm.XeMatchOp = _eOp2
 83364  		_markTermAsChild(tls, _pWC, _26_idxNew, _idxTerm)
 83365  		_pTerm = elem100((*XWhereTerm)(_pWC.Xa), uintptr(_idxTerm))
 83366  		{
 83367  			p := &_pTerm.XwtFlags
 83368  			*p = uint16(int32(*p) | int32(8))
 83369  		}
 83370  		_26_pNewTerm.XprereqAll = _pTerm.XprereqAll
 83371  	}
 83372  _65:
 83373  	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) {
 83374  		goto _73
 83375  	}
 83376  	_28_i = int32(0)
 83377  _74:
 83378  	if _28_i >= _nLeft {
 83379  		goto _77
 83380  	}
 83381  	_29_pLeft = _sqlite3ExprForVectorField(tls, _pParse, (*XExpr)(_pExpr.XpLeft), _28_i)
 83382  	_29_pRight = _sqlite3ExprForVectorField(tls, _pParse, (*XExpr)(_pExpr.XpRight), _28_i)
 83383  	_29_pNew = _sqlite3PExpr(tls, _pParse, int32(_pExpr.Xop), _29_pLeft, _29_pRight)
 83384  	_transferJoinMarkings(tls, _29_pNew, _pExpr)
 83385  	_29_idxNew = _whereClauseInsert(tls, _pWC, _29_pNew, uint16(1))
 83386  	_exprAnalyze(tls, _pSrc, _pWC, _29_idxNew)
 83387  	_28_i += 1
 83388  	goto _74
 83389  _77:
 83390  	_pTerm = elem100((*XWhereTerm)(_pWC.Xa), uintptr(_idxTerm))
 83391  	_pTerm.XwtFlags = uint16(6)
 83392  	_pTerm.XeOperator = 0
 83393  _73:
 83394  	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 {
 83395  		goto _82
 83396  	}
 83397  	_30_i = int32(0)
 83398  _83:
 83399  	if _30_i >= _sqlite3ExprVectorSize(tls, (*XExpr)(_pExpr.XpLeft)) {
 83400  		goto _86
 83401  	}
 83402  	_31_idxNew = _whereClauseInsert(tls, _pWC, _pExpr, uint16(2))
 83403  	elem100((*XWhereTerm)(_pWC.Xa), uintptr(_31_idxNew)).XiField = _30_i + int32(1)
 83404  	_exprAnalyze(tls, _pSrc, _pWC, _31_idxNew)
 83405  	_markTermAsChild(tls, _pWC, _31_idxNew, _idxTerm)
 83406  	_30_i += 1
 83407  	goto _83
 83408  _86:
 83409  _82:
 83410  	_pTerm = elem100((*XWhereTerm)(_pWC.Xa), uintptr(_idxTerm))
 83411  	_pTerm.XprereqRight |= _extraRight
 83412  	_ = _9_aiCurCol
 83413  }
 83414  
 83415  var _exprAnalyzeØ00__func__Ø000 [12]int8
 83416  
 83417  func init() {
 83418  	crt.Xstrncpy(nil, &_exprAnalyzeØ00__func__Ø000[0], str(103070), 12)
 83419  }
 83420  
 83421  // C comment
 83422  //  /*
 83423  //  ** These routines walk (recursively) an expression tree and generate
 83424  //  ** a bitmask indicating which tables are used in that expression
 83425  //  ** tree.
 83426  //  */
 83427  func _sqlite3WhereExprUsage(tls *crt.TLS, _pMaskSet *XWhereMaskSet, _p *XExpr) (r0 uint64) {
 83428  	var _mask uint64
 83429  	if _p == nil {
 83430  		return 0
 83431  	}
 83432  	if int32(_p.Xop) == int32(152) {
 83433  		return _sqlite3WhereGetMask(tls, _pMaskSet, _p.XiTable)
 83434  	}
 83435  	_mask = func() uint64 {
 83436  		if int32(_p.Xop) == int32(160) {
 83437  			return _sqlite3WhereGetMask(tls, _pMaskSet, _p.XiTable)
 83438  		}
 83439  		return (0)
 83440  	}()
 83441  	func() {
 83442  		if (_p.Xflags & uint32(16384)) != (0) {
 83443  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(130308), unsafe.Pointer(&_sqlite3WhereExprUsageØ00__func__Ø000), unsafe.Pointer(str(103082)))
 83444  			crt.X__builtin_abort(tls)
 83445  		}
 83446  	}()
 83447  	if _p.XpRight != nil {
 83448  		_mask |= _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(_p.XpRight))
 83449  	}
 83450  	if _p.XpLeft != nil {
 83451  		_mask |= _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(_p.XpLeft))
 83452  	}
 83453  	if (_p.Xflags & uint32(2048)) != (0) {
 83454  		_mask |= _exprSelectUsage(tls, _pMaskSet, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))))
 83455  		goto _10
 83456  	}
 83457  	if (*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))) != nil {
 83458  		_mask |= _sqlite3WhereExprListUsage(tls, _pMaskSet, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx))))
 83459  	}
 83460  _10:
 83461  	return _mask
 83462  }
 83463  
 83464  var _sqlite3WhereExprUsageØ00__func__Ø000 [22]int8
 83465  
 83466  func init() {
 83467  	crt.Xstrncpy(nil, &_sqlite3WhereExprUsageØ00__func__Ø000[0], str(103116), 22)
 83468  }
 83469  
 83470  // C comment
 83471  //  /*
 83472  //  ** Recursively walk the expressions of a SELECT statement and generate
 83473  //  ** a bitmask indicating which tables are used in that expression
 83474  //  ** tree.
 83475  //  */
 83476  func _exprSelectUsage(tls *crt.TLS, _pMaskSet *XWhereMaskSet, _pS *XSelect) (r0 uint64) {
 83477  	var _2_i int32
 83478  	var _mask uint64
 83479  	var _1_pSrc *XSrcList
 83480  	_mask = uint64(0)
 83481  _0:
 83482  	if _pS == nil {
 83483  		goto _1
 83484  	}
 83485  	_1_pSrc = (*XSrcList)(_pS.XpSrc)
 83486  	_mask |= _sqlite3WhereExprListUsage(tls, _pMaskSet, (*XExprList)(_pS.XpEList))
 83487  	_mask |= _sqlite3WhereExprListUsage(tls, _pMaskSet, (*XExprList)(_pS.XpGroupBy))
 83488  	_mask |= _sqlite3WhereExprListUsage(tls, _pMaskSet, (*XExprList)(_pS.XpOrderBy))
 83489  	_mask |= _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(_pS.XpWhere))
 83490  	_mask |= _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(_pS.XpHaving))
 83491  	if func() int32 {
 83492  		if _1_pSrc != nil {
 83493  			return int32(1)
 83494  		}
 83495  		return func() int32 {
 83496  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129744), unsafe.Pointer(&_exprSelectUsageØ00__func__Ø000), unsafe.Pointer(str(4809)))
 83497  			crt.X__builtin_abort(tls)
 83498  			return int32(0)
 83499  		}()
 83500  	}() == 0 {
 83501  		goto _4
 83502  	}
 83503  	_2_i = int32(0)
 83504  _5:
 83505  	if _2_i >= _1_pSrc.XnSrc {
 83506  		goto _8
 83507  	}
 83508  	_mask |= _exprSelectUsage(tls, _pMaskSet, (*XSelect)(elem6((*TSrcList_item)(unsafe.Pointer(&_1_pSrc.Xa)), uintptr(_2_i)).XpSelect))
 83509  	_mask |= _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(elem6((*TSrcList_item)(unsafe.Pointer(&_1_pSrc.Xa)), uintptr(_2_i)).XpOn))
 83510  	_2_i += 1
 83511  	goto _5
 83512  _8:
 83513  _4:
 83514  	_pS = (*XSelect)(_pS.XpPrior)
 83515  	goto _0
 83516  _1:
 83517  	return _mask
 83518  }
 83519  
 83520  func _sqlite3WhereExprListUsage(tls *crt.TLS, _pMaskSet *XWhereMaskSet, _pList *XExprList) (r0 uint64) {
 83521  	var _i int32
 83522  	var _mask uint64
 83523  	_mask = uint64(0)
 83524  	if _pList == nil {
 83525  		goto _0
 83526  	}
 83527  	_i = int32(0)
 83528  _1:
 83529  	if _i >= _pList.XnExpr {
 83530  		goto _4
 83531  	}
 83532  	_mask |= _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_i)).XpExpr))
 83533  	_i += 1
 83534  	goto _1
 83535  _4:
 83536  _0:
 83537  	return _mask
 83538  }
 83539  
 83540  var _exprSelectUsageØ00__func__Ø000 [16]int8
 83541  
 83542  func init() {
 83543  	crt.Xstrncpy(nil, &_exprSelectUsageØ00__func__Ø000[0], str(103138), 16)
 83544  }
 83545  
 83546  // C comment
 83547  //  /*
 83548  //  ** Return TRUE if the given operator is one of the operators that is
 83549  //  ** allowed for an indexable WHERE clause term.  The allowed operators are
 83550  //  ** "=", "<", ">", "<=", ">=", "IN", "IS", and "IS NULL"
 83551  //  */
 83552  func _allowedOp(tls *crt.TLS, _op int32) (r0 int32) {
 83553  	return bool2int((((_op == int32(74)) || ((_op >= int32(78)) && (_op <= int32(82)))) || (_op == int32(75))) || (_op == int32(72)))
 83554  }
 83555  
 83556  func _exprMightBeIndexed(tls *crt.TLS, _pFrom *XSrcList, _mPrereq uint64, _aiCurCol *int32, _pExpr *XExpr, _op int32) (r0 int32) {
 83557  	func() {
 83558  		if _op > int32(82) {
 83559  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129805), unsafe.Pointer(&_exprMightBeIndexedØ00__func__Ø000), unsafe.Pointer(str(103154)))
 83560  			crt.X__builtin_abort(tls)
 83561  		}
 83562  	}()
 83563  	if (int32(_pExpr.Xop) == int32(158)) && ((_op >= int32(79)) && func() int32 {
 83564  		if _op <= int32(82) {
 83565  			return int32(1)
 83566  		}
 83567  		return func() int32 {
 83568  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129806), unsafe.Pointer(&_exprMightBeIndexedØ00__func__Ø000), unsafe.Pointer(str(4809)))
 83569  			crt.X__builtin_abort(tls)
 83570  			return int32(0)
 83571  		}()
 83572  	}() != 0) {
 83573  		_pExpr = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).Xa))), 0).XpExpr)
 83574  	}
 83575  	if int32(_pExpr.Xop) == int32(152) {
 83576  		*elem8(_aiCurCol, 0) = _pExpr.XiTable
 83577  		*elem8(_aiCurCol, uintptr(1)) = int32(_pExpr.XiColumn)
 83578  		return int32(1)
 83579  	}
 83580  	if _mPrereq == (0) {
 83581  		return int32(0)
 83582  	}
 83583  	if (_mPrereq & (_mPrereq - uint64(1))) != (0) {
 83584  		return int32(0)
 83585  	}
 83586  	return _exprMightBeIndexed2(tls, _pFrom, _mPrereq, _aiCurCol, _pExpr)
 83587  }
 83588  
 83589  var _exprMightBeIndexedØ00__func__Ø000 [19]int8
 83590  
 83591  func init() {
 83592  	crt.Xstrncpy(nil, &_exprMightBeIndexedØ00__func__Ø000[0], str(103164), 19)
 83593  }
 83594  
 83595  // C comment
 83596  //  /*
 83597  //  ** Expression pExpr is one operand of a comparison operator that might
 83598  //  ** be useful for indexing.  This routine checks to see if pExpr appears
 83599  //  ** in any index.  Return TRUE (1) if pExpr is an indexed term and return
 83600  //  ** FALSE (0) if not.  If TRUE is returned, also set aiCurCol[0] to the cursor
 83601  //  ** number of the table that is indexed and aiCurCol[1] to the column number
 83602  //  ** of the column that is indexed, or XN_EXPR (-2) if an expression is being
 83603  //  ** indexed.
 83604  //  **
 83605  //  ** If pExpr is a TK_COLUMN column reference, then this routine always returns
 83606  //  ** true even if that particular column is not indexed, because the column
 83607  //  ** might be added to an automatic index later.
 83608  //  */
 83609  func _exprMightBeIndexed2(tls *crt.TLS, _pFrom *XSrcList, _mPrereq uint64, _aiCurCol *int32, _pExpr *XExpr) (r0 int32) {
 83610  	var _i, _iCur int32
 83611  	var _pIdx *XIndex
 83612  	_i = int32(0)
 83613  _0:
 83614  	if _mPrereq <= uint64(1) {
 83615  		goto _3
 83616  	}
 83617  	*func() *uint64 { _i += 1; return &_mPrereq }() >>= 1
 83618  	goto _0
 83619  _3:
 83620  	_iCur = elem6((*TSrcList_item)(unsafe.Pointer(&_pFrom.Xa)), uintptr(_i)).XiCursor
 83621  	_pIdx = (*XIndex)((*XTable)(elem6((*TSrcList_item)(unsafe.Pointer(&_pFrom.Xa)), uintptr(_i)).XpTab).XpIndex)
 83622  _4:
 83623  	if _pIdx == nil {
 83624  		goto _7
 83625  	}
 83626  	if (*XExprList)(_pIdx.XaColExpr) == nil {
 83627  		goto _5
 83628  	}
 83629  	_i = int32(0)
 83630  _9:
 83631  	if _i >= int32(_pIdx.XnKeyCol) {
 83632  		goto _12
 83633  	}
 83634  	if int32(*elem50(_pIdx.XaiColumn, uintptr(_i))) != int32(-2) {
 83635  		goto _10
 83636  	}
 83637  	if _sqlite3ExprCompareSkip(tls, _pExpr, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.XaColExpr).Xa))), uintptr(_i)).XpExpr), _iCur) == int32(0) {
 83638  		*elem8(_aiCurCol, 0) = _iCur
 83639  		*elem8(_aiCurCol, uintptr(1)) = int32(-2)
 83640  		return int32(1)
 83641  	}
 83642  _10:
 83643  	_i += 1
 83644  	goto _9
 83645  _12:
 83646  _5:
 83647  	_pIdx = (*XIndex)(_pIdx.XpNext)
 83648  	goto _4
 83649  _7:
 83650  	return int32(0)
 83651  }
 83652  
 83653  // C comment
 83654  //  /*
 83655  //  ** Like sqlite3ExprCompare() except COLLATE operators at the top-level
 83656  //  ** are ignored.
 83657  //  */
 83658  func _sqlite3ExprCompareSkip(tls *crt.TLS, _pA *XExpr, _pB *XExpr, _iTab int32) (r0 int32) {
 83659  	return _sqlite3ExprCompare(tls, _sqlite3ExprSkipCollate(tls, _pA), _sqlite3ExprSkipCollate(tls, _pB), _iTab)
 83660  }
 83661  
 83662  // C comment
 83663  //  /*
 83664  //  ** Translate from TK_xx operator to WO_xx bitmask.
 83665  //  */
 83666  func _operatorMask(tls *crt.TLS, _op int32) (r0 uint16) {
 83667  	var _c uint16
 83668  	func() {
 83669  		if _allowedOp(tls, _op) == 0 {
 83670  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129081), unsafe.Pointer(&_operatorMaskØ00__func__Ø000), unsafe.Pointer(str(103183)))
 83671  			crt.X__builtin_abort(tls)
 83672  		}
 83673  	}()
 83674  	if _op == int32(74) {
 83675  		_c = uint16(1)
 83676  		goto _7
 83677  	}
 83678  	if _op == int32(75) {
 83679  		_c = uint16(256)
 83680  		goto _7
 83681  	}
 83682  	if _op == int32(72) {
 83683  		_c = uint16(128)
 83684  		goto _7
 83685  	}
 83686  	func() {
 83687  		if (int32(2) << uint(_op-int32(78))) >= int32(32767) {
 83688  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129089), unsafe.Pointer(&_operatorMaskØ00__func__Ø000), unsafe.Pointer(str(103197)))
 83689  			crt.X__builtin_abort(tls)
 83690  		}
 83691  	}()
 83692  	_c = uint16(int32(2) << uint(_op-int32(78)))
 83693  _7:
 83694  	func() {
 83695  		if _op == int32(75) && int32(_c) != int32(256) {
 83696  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129092), unsafe.Pointer(&_operatorMaskØ00__func__Ø000), unsafe.Pointer(str(103226)))
 83697  			crt.X__builtin_abort(tls)
 83698  		}
 83699  	}()
 83700  	func() {
 83701  		if _op == int32(74) && int32(_c) != int32(1) {
 83702  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129093), unsafe.Pointer(&_operatorMaskØ00__func__Ø000), unsafe.Pointer(str(103256)))
 83703  			crt.X__builtin_abort(tls)
 83704  		}
 83705  	}()
 83706  	func() {
 83707  		if _op == int32(78) && int32(_c) != int32(2) {
 83708  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129094), unsafe.Pointer(&_operatorMaskØ00__func__Ø000), unsafe.Pointer(str(103278)))
 83709  			crt.X__builtin_abort(tls)
 83710  		}
 83711  	}()
 83712  	func() {
 83713  		if _op == int32(81) && int32(_c) != int32(16) {
 83714  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129095), unsafe.Pointer(&_operatorMaskØ00__func__Ø000), unsafe.Pointer(str(103300)))
 83715  			crt.X__builtin_abort(tls)
 83716  		}
 83717  	}()
 83718  	func() {
 83719  		if _op == int32(80) && int32(_c) != int32(8) {
 83720  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129096), unsafe.Pointer(&_operatorMaskØ00__func__Ø000), unsafe.Pointer(str(103322)))
 83721  			crt.X__builtin_abort(tls)
 83722  		}
 83723  	}()
 83724  	func() {
 83725  		if _op == int32(79) && int32(_c) != int32(4) {
 83726  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129097), unsafe.Pointer(&_operatorMaskØ00__func__Ø000), unsafe.Pointer(str(103344)))
 83727  			crt.X__builtin_abort(tls)
 83728  		}
 83729  	}()
 83730  	func() {
 83731  		if _op == int32(82) && int32(_c) != int32(32) {
 83732  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129098), unsafe.Pointer(&_operatorMaskØ00__func__Ø000), unsafe.Pointer(str(103366)))
 83733  			crt.X__builtin_abort(tls)
 83734  		}
 83735  	}()
 83736  	func() {
 83737  		if _op == int32(72) && int32(_c) != int32(128) {
 83738  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129099), unsafe.Pointer(&_operatorMaskØ00__func__Ø000), unsafe.Pointer(str(103388)))
 83739  			crt.X__builtin_abort(tls)
 83740  		}
 83741  	}()
 83742  	return _c
 83743  }
 83744  
 83745  var _operatorMaskØ00__func__Ø000 [13]int8
 83746  
 83747  func init() {
 83748  	crt.Xstrncpy(nil, &_operatorMaskØ00__func__Ø000[0], str(103410), 13)
 83749  }
 83750  
 83751  // C comment
 83752  //  /*
 83753  //  ** Mark term iChild as being a child of term iParent
 83754  //  */
 83755  func _markTermAsChild(tls *crt.TLS, _pWC *XWhereClause, _iChild int32, _iParent int32) {
 83756  	elem100((*XWhereTerm)(_pWC.Xa), uintptr(_iChild)).XiParent = _iParent
 83757  	elem100((*XWhereTerm)(_pWC.Xa), uintptr(_iChild)).XtruthProb = elem100((*XWhereTerm)(_pWC.Xa), uintptr(_iParent)).XtruthProb
 83758  	elem100((*XWhereTerm)(_pWC.Xa), uintptr(_iParent)).XnChild += 1
 83759  }
 83760  
 83761  // C comment
 83762  //  /*
 83763  //  ** We already know that pExpr is a binary operator where both operands are
 83764  //  ** column references.  This routine checks to see if pExpr is an equivalence
 83765  //  ** relation:
 83766  //  **   1.  The SQLITE_Transitive optimization must be enabled
 83767  //  **   2.  Must be either an == or an IS operator
 83768  //  **   3.  Not originating in the ON clause of an OUTER JOIN
 83769  //  **   4.  The affinities of A and B must be compatible
 83770  //  **   5a. Both operands use the same collating sequence OR
 83771  //  **   5b. The overall collating sequence is BINARY
 83772  //  ** If this routine returns TRUE, that means that the RHS can be substituted
 83773  //  ** for the LHS anyplace else in the WHERE clause where the LHS column occurs.
 83774  //  ** This is an optimization.  No harm comes from returning 0.  But if 1 is
 83775  //  ** returned when it should not be, then incorrect answers might result.
 83776  //  */
 83777  func _termIsEquivalence(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) (r0 int32) {
 83778  	var _aff1, _aff2 int8
 83779  	var _zColl1, _zColl2 *int8
 83780  	var _pColl *XCollSeq
 83781  	if (int32((*Xsqlite3)(_pParse.Xdb).XdbOptFlags) & int32(512)) != int32(0) {
 83782  		return int32(0)
 83783  	}
 83784  	if (int32(_pExpr.Xop) != int32(78)) && (int32(_pExpr.Xop) != int32(72)) {
 83785  		return int32(0)
 83786  	}
 83787  	if (_pExpr.Xflags & uint32(1)) != (0) {
 83788  		return int32(0)
 83789  	}
 83790  	_aff1 = _sqlite3ExprAffinity(tls, (*XExpr)(_pExpr.XpLeft))
 83791  	_aff2 = _sqlite3ExprAffinity(tls, (*XExpr)(_pExpr.XpRight))
 83792  	if (int32(_aff1) != int32(_aff2)) && ((int32(_aff1) < int32(67)) || (int32(_aff2) < int32(67))) {
 83793  		return int32(0)
 83794  	}
 83795  	_pColl = _sqlite3BinaryCompareCollSeq(tls, _pParse, (*XExpr)(_pExpr.XpLeft), (*XExpr)(_pExpr.XpRight))
 83796  	if (_pColl == nil) || (_sqlite3StrICmp(tls, _pColl.XzName, str(37836)) == int32(0)) {
 83797  		return int32(1)
 83798  	}
 83799  	_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_pExpr.XpLeft))
 83800  	_zColl1 = func() *int8 {
 83801  		if _pColl != nil {
 83802  			return _pColl.XzName
 83803  		}
 83804  		return nil
 83805  	}()
 83806  	_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_pExpr.XpRight))
 83807  	_zColl2 = func() *int8 {
 83808  		if _pColl != nil {
 83809  			return _pColl.XzName
 83810  		}
 83811  		return nil
 83812  	}()
 83813  	return bool2int(Xsqlite3_stricmp(tls, _zColl1, _zColl2) == int32(0))
 83814  }
 83815  
 83816  // C comment
 83817  //  /*
 83818  //  ** Commute a comparison operator.  Expressions of the form "X op Y"
 83819  //  ** are converted into "Y op X".
 83820  //  **
 83821  //  ** If left/right precedence rules come into play when determining the
 83822  //  ** collating sequence, then COLLATE operators are adjusted to ensure
 83823  //  ** that the collating sequence does not change.  For example:
 83824  //  ** "Y collate NOCASE op X" becomes "X op Y" because any collation sequence on
 83825  //  ** the left hand side of a comparison overrides any collation sequence
 83826  //  ** attached to the right. For the same reason the EP_Collate flag
 83827  //  ** is not commuted.
 83828  //  */
 83829  func _exprCommute(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) {
 83830  	var _expRight, _expLeft uint16
 83831  	var _4_t *XExpr
 83832  	_expRight = uint16(((*XExpr)(_pExpr.XpRight).Xflags) & uint32(256))
 83833  	_expLeft = uint16(((*XExpr)(_pExpr.XpLeft).Xflags) & uint32(256))
 83834  	func() {
 83835  		if _allowedOp(tls, int32(_pExpr.Xop)) == 0 || int32(_pExpr.Xop) == int32(74) {
 83836  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129051), unsafe.Pointer(&_exprCommuteØ00__func__Ø000), unsafe.Pointer(str(103423)))
 83837  			crt.X__builtin_abort(tls)
 83838  		}
 83839  	}()
 83840  	if int32(_expRight) != int32(_expLeft) {
 83841  		goto _3
 83842  	}
 83843  	if _expRight != 0 {
 83844  		(*XExpr)(_pExpr.XpRight).Xflags &= uint32(4294967039)
 83845  		goto _6
 83846  	}
 83847  	if _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_pExpr.XpLeft)) != nil {
 83848  		(*XExpr)(_pExpr.XpLeft).Xflags |= uint32(256)
 83849  	}
 83850  _6:
 83851  _3:
 83852  	_4_t = (*XExpr)(_pExpr.XpRight)
 83853  	*(**XExpr)(unsafe.Pointer(&_pExpr.XpRight)) = (*XExpr)(_pExpr.XpLeft)
 83854  	*(**XExpr)(unsafe.Pointer(&_pExpr.XpLeft)) = _4_t
 83855  	if int32(_pExpr.Xop) >= int32(79) {
 83856  		func() {
 83857  			if int32(_pExpr.Xop) < int32(79) || int32(_pExpr.Xop) > int32(82) {
 83858  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129071), unsafe.Pointer(&_exprCommuteØ00__func__Ø000), unsafe.Pointer(str(103464)))
 83859  				crt.X__builtin_abort(tls)
 83860  			}
 83861  		}()
 83862  		_pExpr.Xop = uint8(((int32(_pExpr.Xop) - int32(79)) ^ int32(2)) + int32(79))
 83863  	}
 83864  }
 83865  
 83866  var _exprCommuteØ00__func__Ø000 [12]int8
 83867  
 83868  func init() {
 83869  	crt.Xstrncpy(nil, &_exprCommuteØ00__func__Ø000[0], str(103501), 12)
 83870  }
 83871  
 83872  var _exprAnalyzeØ00opsØ001 [2]uint8
 83873  
 83874  func init() {
 83875  	_exprAnalyzeØ00opsØ001 = [2]uint8{82, 80}
 83876  }
 83877  
 83878  // C comment
 83879  //  /*
 83880  //  ** If the pBase expression originated in the ON or USING clause of
 83881  //  ** a join, then transfer the appropriate markings over to derived.
 83882  //  */
 83883  func _transferJoinMarkings(tls *crt.TLS, _pDerived *XExpr, _pBase *XExpr) {
 83884  	if _pDerived != nil {
 83885  		_pDerived.Xflags |= _pBase.Xflags & uint32(1)
 83886  		_pDerived.XiRightJoinTable = _pBase.XiRightJoinTable
 83887  	}
 83888  }
 83889  
 83890  // C comment
 83891  //  /*
 83892  //  ** Analyze a term that consists of two or more OR-connected
 83893  //  ** subterms.  So in:
 83894  //  **
 83895  //  **     ... WHERE  (a=5) AND (b=7 OR c=9 OR d=13) AND (d=13)
 83896  //  **                          ^^^^^^^^^^^^^^^^^^^^
 83897  //  **
 83898  //  ** This routine analyzes terms such as the middle term in the above example.
 83899  //  ** A WhereOrTerm object is computed and attached to the term under
 83900  //  ** analysis, regardless of the outcome of the analysis.  Hence:
 83901  //  **
 83902  //  **     WhereTerm.wtFlags   |=  TERM_ORINFO
 83903  //  **     WhereTerm.u.pOrInfo  =  a dynamically allocated WhereOrTerm object
 83904  //  **
 83905  //  ** The term being analyzed must have two or more of OR-connected subterms.
 83906  //  ** A single subterm might be a set of AND-connected sub-subterms.
 83907  //  ** Examples of terms under analysis:
 83908  //  **
 83909  //  **     (A)     t1.x=t2.y OR t1.x=t2.z OR t1.y=15 OR t1.z=t3.a+5
 83910  //  **     (B)     x=expr1 OR expr2=x OR x=expr3
 83911  //  **     (C)     t1.x=t2.y OR (t1.x=t2.z AND t1.y=15)
 83912  //  **     (D)     x=expr1 OR (y>11 AND y<22 AND z LIKE '*hello*')
 83913  //  **     (E)     (p.a=1 AND q.b=2 AND r.c=3) OR (p.x=4 AND q.y=5 AND r.z=6)
 83914  //  **     (F)     x>A OR (x=A AND y>=B)
 83915  //  **
 83916  //  ** CASE 1:
 83917  //  **
 83918  //  ** If all subterms are of the form T.C=expr for some single column of C and
 83919  //  ** a single table T (as shown in example B above) then create a new virtual
 83920  //  ** term that is an equivalent IN expression.  In other words, if the term
 83921  //  ** being analyzed is:
 83922  //  **
 83923  //  **      x = expr1  OR  expr2 = x  OR  x = expr3
 83924  //  **
 83925  //  ** then create a new virtual term like this:
 83926  //  **
 83927  //  **      x IN (expr1,expr2,expr3)
 83928  //  **
 83929  //  ** CASE 2:
 83930  //  **
 83931  //  ** If there are exactly two disjuncts and one side has x>A and the other side
 83932  //  ** has x=A (for the same x and A) then add a new virtual conjunct term to the
 83933  //  ** WHERE clause of the form "x>=A".  Example:
 83934  //  **
 83935  //  **      x>A OR (x=A AND y>B)    adds:    x>=A
 83936  //  **
 83937  //  ** The added conjunct can sometimes be helpful in query planning.
 83938  //  **
 83939  //  ** CASE 3:
 83940  //  **
 83941  //  ** If all subterms are indexable by a single table T, then set
 83942  //  **
 83943  //  **     WhereTerm.eOperator              =  WO_OR
 83944  //  **     WhereTerm.u.pOrInfo->indexable  |=  the cursor number for table T
 83945  //  **
 83946  //  ** A subterm is "indexable" if it is of the form
 83947  //  ** "T.C <op> <expr>" where C is any column of table T and
 83948  //  ** <op> is one of "=", "<", "<=", ">", ">=", "IS NULL", or "IN".
 83949  //  ** A subterm is also indexable if it is an AND of two or more
 83950  //  ** subsubterms at least one of which is indexable.  Indexable AND
 83951  //  ** subterms have their eOperator set to WO_AND and they have
 83952  //  ** u.pAndInfo set to a dynamically allocated WhereAndTerm object.
 83953  //  **
 83954  //  ** From another point of view, "indexable" means that the subterm could
 83955  //  ** potentially be used with an index if an appropriate index exists.
 83956  //  ** This analysis does not consider whether or not the index exists; that
 83957  //  ** is decided elsewhere.  This analysis only looks at whether subterms
 83958  //  ** appropriate for indexing exist.
 83959  //  **
 83960  //  ** All examples A through E above satisfy case 3.  But if a term
 83961  //  ** also satisfies case 1 (such as B) we know that the optimizer will
 83962  //  ** always prefer case 1, so in that case we pretend that case 3 is not
 83963  //  ** satisfied.
 83964  //  **
 83965  //  ** It might be the case that multiple tables are indexable.  For example,
 83966  //  ** (E) above is indexable on tables P, Q, and R.
 83967  //  **
 83968  //  ** Terms that satisfy case 3 are candidates for lookup by using
 83969  //  ** separate indices to find rowids for each subterm and composing
 83970  //  ** the union of all rowids using a RowSet object.  This is similar
 83971  //  ** to "bitmap indices" in other database engines.
 83972  //  **
 83973  //  ** OTHERWISE:
 83974  //  **
 83975  //  ** If none of cases 1, 2, or 3 apply, then leave the eOperator set to
 83976  //  ** zero.  This term is not useful for search.
 83977  //  */
 83978  func _exprAnalyzeOrTerm(tls *crt.TLS, _pSrc *XSrcList, _pWC *XWhereClause, _idxTerm int32) {
 83979  	var _i, _3_j, _12_iOne, _13_iTwo, _15_okToChngToIN, _15_iColumn, _15_iCursor, _15_j, _24_affLeft, _24_affRight, _29_idxNew int32
 83980  	var _chngToIN, _indexable, _3_b, _8_b uint64
 83981  	var _db *Xsqlite3
 83982  	var _27_pList *XExprList
 83983  	var _pExpr, _27_pDup, _27_pLeft, _27_pNew *XExpr
 83984  	var _pParse *XParse
 83985  	var _pWInfo *XWhereInfo
 83986  	var _pTerm, _pOrTerm, _3_pAndTerm, _9_pOther, _12_pOne, _13_pTwo *XWhereTerm
 83987  	var _pOrWc, _3_pAndWC *XWhereClause
 83988  	var _pOrInfo *XWhereOrInfo
 83989  	var _2_pAndInfo *XWhereAndInfo
 83990  	_pWInfo = (*XWhereInfo)(_pWC.XpWInfo)
 83991  	_pParse = (*XParse)(_pWInfo.XpParse)
 83992  	_db = (*Xsqlite3)(_pParse.Xdb)
 83993  	_pTerm = elem100((*XWhereTerm)(_pWC.Xa), uintptr(_idxTerm))
 83994  	_pExpr = (*XExpr)(_pTerm.XpExpr)
 83995  	func() {
 83996  		if (int32(_pTerm.XwtFlags) & int32(49)) != int32(0) {
 83997  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129466), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103513)))
 83998  			crt.X__builtin_abort(tls)
 83999  		}
 84000  	}()
 84001  	func() {
 84002  		if int32(_pExpr.Xop) != int32(70) {
 84003  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129467), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103575)))
 84004  			crt.X__builtin_abort(tls)
 84005  		}
 84006  	}()
 84007  	*(**XWhereOrInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTerm.Xu)))) = store102(&_pOrInfo, (*XWhereOrInfo)(_sqlite3DbMallocZero(tls, _db, uint64(416))))
 84008  	if _pOrInfo == nil {
 84009  		return
 84010  	}
 84011  	{
 84012  		p := &_pTerm.XwtFlags
 84013  		*p = uint16(int32(*p) | int32(16))
 84014  	}
 84015  	_pOrWc = &_pOrInfo.Xwc
 84016  	crt.Xmemset(tls, unsafe.Pointer(&_pOrWc.XaStatic), int32(0), uint32(384))
 84017  	_sqlite3WhereClauseInit(tls, _pOrWc, _pWInfo)
 84018  	_sqlite3WhereSplit(tls, _pOrWc, _pExpr, uint8(70))
 84019  	_sqlite3WhereExprAnalyze(tls, _pSrc, _pOrWc)
 84020  	if _db.XmallocFailed != 0 {
 84021  		return
 84022  	}
 84023  	func() {
 84024  		if _pOrWc.XnTerm < int32(2) {
 84025  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129477), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103592)))
 84026  			crt.X__builtin_abort(tls)
 84027  		}
 84028  	}()
 84029  	_indexable = uint64(18446744073709551615)
 84030  	_chngToIN = uint64(18446744073709551615)
 84031  	*func() **XWhereTerm { _i = _pOrWc.XnTerm - int32(1); return &_pOrTerm }() = (*XWhereTerm)(_pOrWc.Xa)
 84032  _8:
 84033  	if _i < int32(0) || _indexable == 0 {
 84034  		goto _12
 84035  	}
 84036  	if (int32(_pOrTerm.XeOperator) & int32(511)) != int32(0) {
 84037  		goto _13
 84038  	}
 84039  	func() {
 84040  		if (int32(_pOrTerm.XwtFlags) & int32(48)) != int32(0) {
 84041  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129487), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103608)))
 84042  			crt.X__builtin_abort(tls)
 84043  		}
 84044  	}()
 84045  	_chngToIN = 0
 84046  	_2_pAndInfo = (*XWhereAndInfo)(_sqlite3DbMallocRawNN(tls, _db, uint64(408)))
 84047  	if _2_pAndInfo == nil {
 84048  		goto _16
 84049  	}
 84050  	_3_b = 0
 84051  	*(**XWhereAndInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pOrTerm.Xu)))) = _2_pAndInfo
 84052  	{
 84053  		p := &_pOrTerm.XwtFlags
 84054  		*p = uint16(int32(*p) | int32(32))
 84055  	}
 84056  	_pOrTerm.XeOperator = uint16(1024)
 84057  	_3_pAndWC = &_2_pAndInfo.Xwc
 84058  	crt.Xmemset(tls, unsafe.Pointer(&_3_pAndWC.XaStatic), int32(0), uint32(384))
 84059  	_sqlite3WhereClauseInit(tls, _3_pAndWC, (*XWhereInfo)(_pWC.XpWInfo))
 84060  	_sqlite3WhereSplit(tls, _3_pAndWC, (*XExpr)(_pOrTerm.XpExpr), uint8(71))
 84061  	_sqlite3WhereExprAnalyze(tls, _pSrc, _3_pAndWC)
 84062  	*(**XWhereClause)(unsafe.Pointer(&_3_pAndWC.XpOuter)) = _pWC
 84063  	if _db.XmallocFailed != 0 {
 84064  		goto _17
 84065  	}
 84066  	*func() **XWhereTerm { _3_j = int32(0); return &_3_pAndTerm }() = (*XWhereTerm)(_3_pAndWC.Xa)
 84067  _18:
 84068  	if _3_j >= _3_pAndWC.XnTerm {
 84069  		goto _21
 84070  	}
 84071  	func() {
 84072  		if _3_pAndTerm.XpExpr == nil {
 84073  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129506), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103659)))
 84074  			crt.X__builtin_abort(tls)
 84075  		}
 84076  	}()
 84077  	if _allowedOp(tls, int32((*XExpr)(_3_pAndTerm.XpExpr).Xop)) != 0 || (int32(_3_pAndTerm.XeOperator) == int32(64)) {
 84078  		_3_b |= _sqlite3WhereGetMask(tls, &_pWInfo.XsMaskSet, _3_pAndTerm.XleftCursor)
 84079  	}
 84080  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _3_j += 1; return &_3_pAndTerm }())) += uintptr(48)
 84081  	goto _18
 84082  _21:
 84083  _17:
 84084  	_indexable &= _3_b
 84085  _16:
 84086  	goto _28
 84087  _13:
 84088  	if (int32(_pOrTerm.XwtFlags) & int32(8)) != 0 {
 84089  		goto _28
 84090  	}
 84091  	_8_b = _sqlite3WhereGetMask(tls, &_pWInfo.XsMaskSet, _pOrTerm.XleftCursor)
 84092  	if (int32(_pOrTerm.XwtFlags) & int32(2)) != 0 {
 84093  		_9_pOther = elem100((*XWhereTerm)(_pOrWc.Xa), uintptr(_pOrTerm.XiParent))
 84094  		_8_b |= _sqlite3WhereGetMask(tls, &_pWInfo.XsMaskSet, _9_pOther.XleftCursor)
 84095  	}
 84096  	_indexable &= _8_b
 84097  	if (int32(_pOrTerm.XeOperator) & int32(2)) == int32(0) {
 84098  		_chngToIN = 0
 84099  		goto _31
 84100  	}
 84101  	_chngToIN &= _8_b
 84102  _31:
 84103  _28:
 84104  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i -= 1; return &_pOrTerm }())) += uintptr(48)
 84105  	goto _8
 84106  _12:
 84107  	_pOrInfo.Xindexable = _indexable
 84108  	_pTerm.XeOperator = uint16(func() int32 {
 84109  		if _indexable == (0) {
 84110  			return int32(0)
 84111  		}
 84112  		return int32(512)
 84113  	}())
 84114  	if _indexable == 0 || _pOrWc.XnTerm != int32(2) {
 84115  		goto _35
 84116  	}
 84117  	_12_iOne = int32(0)
 84118  _36:
 84119  	if store100(&_12_pOne, _whereNthSubterm(tls, elem100((*XWhereTerm)(_pOrWc.Xa), 0), postInc2(&_12_iOne, 1))) == nil {
 84120  		goto _37
 84121  	}
 84122  	_13_iTwo = int32(0)
 84123  _38:
 84124  	if store100(&_13_pTwo, _whereNthSubterm(tls, elem100((*XWhereTerm)(_pOrWc.Xa), uintptr(1)), postInc2(&_13_iTwo, 1))) != nil {
 84125  		_whereCombineDisjuncts(tls, _pSrc, _pWC, _12_pOne, _13_pTwo)
 84126  		goto _38
 84127  	}
 84128  	goto _36
 84129  _37:
 84130  _35:
 84131  	if _chngToIN == 0 {
 84132  		goto _40
 84133  	}
 84134  	_15_okToChngToIN = int32(0)
 84135  	_15_iColumn = int32(-1)
 84136  	_15_iCursor = int32(-1)
 84137  	_15_j = int32(0)
 84138  	_15_j = int32(0)
 84139  _41:
 84140  	if _15_j >= int32(2) || _15_okToChngToIN != 0 {
 84141  		goto _45
 84142  	}
 84143  	_pOrTerm = (*XWhereTerm)(_pOrWc.Xa)
 84144  	_i = _pOrWc.XnTerm - int32(1)
 84145  _46:
 84146  	if _i < int32(0) {
 84147  		goto _49
 84148  	}
 84149  	func() {
 84150  		if (int32(_pOrTerm.XeOperator) & int32(2)) == 0 {
 84151  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129592), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103675)))
 84152  			crt.X__builtin_abort(tls)
 84153  		}
 84154  	}()
 84155  	{
 84156  		p := &_pOrTerm.XwtFlags
 84157  		*p = uint16(int32(*p) & int32(-65))
 84158  	}
 84159  	if _pOrTerm.XleftCursor == _15_iCursor {
 84160  		func() {
 84161  			if _15_j != int32(1) {
 84162  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129597), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103702)))
 84163  				crt.X__builtin_abort(tls)
 84164  			}
 84165  		}()
 84166  		goto _47
 84167  	}
 84168  	if (_chngToIN & _sqlite3WhereGetMask(tls, &_pWInfo.XsMaskSet, _pOrTerm.XleftCursor)) == (0) {
 84169  		func() {
 84170  			if (int32(_pOrTerm.XwtFlags) & int32(10)) == 0 {
 84171  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129608), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103707)))
 84172  				crt.X__builtin_abort(tls)
 84173  			}
 84174  		}()
 84175  		goto _47
 84176  	}
 84177  	_15_iColumn = *(*int32)(unsafe.Pointer(&_pOrTerm.Xu))
 84178  	_15_iCursor = _pOrTerm.XleftCursor
 84179  	goto _49
 84180  _47:
 84181  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i -= 1; return &_pOrTerm }())) += uintptr(48)
 84182  	goto _46
 84183  _49:
 84184  	if _i < int32(0) {
 84185  		func() {
 84186  			if _15_j != int32(1) {
 84187  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129618), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103702)))
 84188  				crt.X__builtin_abort(tls)
 84189  			}
 84190  		}()
 84191  		func() {
 84192  			if (_chngToIN & (_chngToIN - uint64(1))) != (0) {
 84193  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129619), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103753)))
 84194  				crt.X__builtin_abort(tls)
 84195  			}
 84196  		}()
 84197  		func() {
 84198  			if _chngToIN != _sqlite3WhereGetMask(tls, &_pWInfo.XsMaskSet, _15_iCursor) {
 84199  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129620), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103776)))
 84200  				crt.X__builtin_abort(tls)
 84201  			}
 84202  		}()
 84203  		goto _45
 84204  	}
 84205  	_15_okToChngToIN = int32(1)
 84206  _65:
 84207  	if _i < int32(0) || _15_okToChngToIN == 0 {
 84208  		goto _69
 84209  	}
 84210  	func() {
 84211  		if (int32(_pOrTerm.XeOperator) & int32(2)) == 0 {
 84212  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129629), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103675)))
 84213  			crt.X__builtin_abort(tls)
 84214  		}
 84215  	}()
 84216  	if _pOrTerm.XleftCursor != _15_iCursor {
 84217  		{
 84218  			p := &_pOrTerm.XwtFlags
 84219  			*p = uint16(int32(*p) & int32(-65))
 84220  		}
 84221  		goto _75
 84222  	}
 84223  	if (*(*int32)(unsafe.Pointer(&_pOrTerm.Xu))) != _15_iColumn {
 84224  		_15_okToChngToIN = int32(0)
 84225  		goto _75
 84226  	}
 84227  	_24_affRight = int32(_sqlite3ExprAffinity(tls, (*XExpr)((*XExpr)(_pOrTerm.XpExpr).XpRight)))
 84228  	_24_affLeft = int32(_sqlite3ExprAffinity(tls, (*XExpr)((*XExpr)(_pOrTerm.XpExpr).XpLeft)))
 84229  	if (_24_affRight != int32(0)) && (_24_affRight != _24_affLeft) {
 84230  		_15_okToChngToIN = int32(0)
 84231  		goto _78
 84232  	}
 84233  	{
 84234  		p := &_pOrTerm.XwtFlags
 84235  		*p = uint16(int32(*p) | int32(64))
 84236  	}
 84237  _78:
 84238  _75:
 84239  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i -= 1; return &_pOrTerm }())) += uintptr(48)
 84240  	goto _65
 84241  _69:
 84242  	_15_j += 1
 84243  	goto _41
 84244  _45:
 84245  	if _15_okToChngToIN == 0 {
 84246  		goto _79
 84247  	}
 84248  	_27_pList = nil
 84249  	_27_pLeft = nil
 84250  	*func() **XWhereTerm { _i = _pOrWc.XnTerm - int32(1); return &_pOrTerm }() = (*XWhereTerm)(_pOrWc.Xa)
 84251  _80:
 84252  	if _i < int32(0) {
 84253  		goto _83
 84254  	}
 84255  	if (int32(_pOrTerm.XwtFlags) & int32(64)) == int32(0) {
 84256  		goto _81
 84257  	}
 84258  	func() {
 84259  		if (int32(_pOrTerm.XeOperator) & int32(2)) == 0 {
 84260  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129663), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103675)))
 84261  			crt.X__builtin_abort(tls)
 84262  		}
 84263  	}()
 84264  	func() {
 84265  		if _pOrTerm.XleftCursor != _15_iCursor {
 84266  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129664), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103834)))
 84267  			crt.X__builtin_abort(tls)
 84268  		}
 84269  	}()
 84270  	func() {
 84271  		if (*(*int32)(unsafe.Pointer(&_pOrTerm.Xu))) != _15_iColumn {
 84272  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129665), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103863)))
 84273  			crt.X__builtin_abort(tls)
 84274  		}
 84275  	}()
 84276  	_27_pDup = _sqlite3ExprDup(tls, _db, (*XExpr)((*XExpr)(_pOrTerm.XpExpr).XpRight), int32(0))
 84277  	_27_pList = _sqlite3ExprListAppend(tls, (*XParse)(_pWInfo.XpParse), _27_pList, _27_pDup)
 84278  	_27_pLeft = (*XExpr)((*XExpr)(_pOrTerm.XpExpr).XpLeft)
 84279  _81:
 84280  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i -= 1; return &_pOrTerm }())) += uintptr(48)
 84281  	goto _80
 84282  _83:
 84283  	func() {
 84284  		if _27_pLeft == nil {
 84285  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129670), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103894)))
 84286  			crt.X__builtin_abort(tls)
 84287  		}
 84288  	}()
 84289  	_27_pDup = _sqlite3ExprDup(tls, _db, _27_pLeft, int32(0))
 84290  	_27_pNew = _sqlite3PExpr(tls, _pParse, int32(74), _27_pDup, nil)
 84291  	if _27_pNew != nil {
 84292  		_transferJoinMarkings(tls, _27_pNew, _pExpr)
 84293  		func() {
 84294  			if (_27_pNew.Xflags & uint32(2048)) != (0) {
 84295  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129676), unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000), unsafe.Pointer(str(103903)))
 84296  				crt.X__builtin_abort(tls)
 84297  			}
 84298  		}()
 84299  		*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_27_pNew.Xx)))) = _27_pList
 84300  		_29_idxNew = _whereClauseInsert(tls, _pWC, _27_pNew, uint16(3))
 84301  		_exprAnalyze(tls, _pSrc, _pWC, _29_idxNew)
 84302  		_pTerm = elem100((*XWhereTerm)(_pWC.Xa), uintptr(_idxTerm))
 84303  		_markTermAsChild(tls, _pWC, _29_idxNew, _idxTerm)
 84304  		goto _96
 84305  	}
 84306  	_sqlite3ExprListDelete(tls, _db, _27_pList)
 84307  _96:
 84308  	_pTerm.XeOperator = uint16(4096)
 84309  _79:
 84310  _40:
 84311  	_ = _12_iOne
 84312  	_ = _13_iTwo
 84313  }
 84314  
 84315  var _exprAnalyzeOrTermØ00__func__Ø000 [18]int8
 84316  
 84317  func init() {
 84318  	crt.Xstrncpy(nil, &_exprAnalyzeOrTermØ00__func__Ø000[0], str(103940), 18)
 84319  }
 84320  
 84321  // C comment
 84322  //  /*
 84323  //  ** Return the N-th AND-connected subterm of pTerm.  Or if pTerm is not
 84324  //  ** a conjunction, then return just pTerm when N==0.  If N is exceeds
 84325  //  ** the number of available subterms, return NULL.
 84326  //  */
 84327  func _whereNthSubterm(tls *crt.TLS, _pTerm *XWhereTerm, _N int32) (r0 *XWhereTerm) {
 84328  	if int32(_pTerm.XeOperator) != int32(1024) {
 84329  		return func() *XWhereTerm {
 84330  			if _N == int32(0) {
 84331  				return _pTerm
 84332  			}
 84333  			return nil
 84334  		}()
 84335  	}
 84336  	if _N < (((*XWhereAndInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_pTerm.Xu))).Xwc).XnTerm) {
 84337  		return elem100((*XWhereTerm)(((*XWhereAndInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_pTerm.Xu))).Xwc).Xa), uintptr(_N))
 84338  	}
 84339  	return nil
 84340  }
 84341  
 84342  // C comment
 84343  //  /*
 84344  //  ** Subterms pOne and pTwo are contained within WHERE clause pWC.  The
 84345  //  ** two subterms are in disjunction - they are OR-ed together.
 84346  //  **
 84347  //  ** If these two terms are both of the form:  "A op B" with the same
 84348  //  ** A and B values but different operators and if the operators are
 84349  //  ** compatible (if one is = and the other is <, for example) then
 84350  //  ** add a new virtual AND term to pWC that is the combination of the
 84351  //  ** two.
 84352  //  **
 84353  //  ** Some examples:
 84354  //  **
 84355  //  **    x<y OR x=y    -->     x<=y
 84356  //  **    x=y OR x=y    -->     x=y
 84357  //  **    x<=y OR x<y   -->     x<=y
 84358  //  **
 84359  //  ** The following is NOT generated:
 84360  //  **
 84361  //  **    x<y OR x>y    -->     x!=y
 84362  //  */
 84363  func _whereCombineDisjuncts(tls *crt.TLS, _pSrc *XSrcList, _pWC *XWhereClause, _pOne *XWhereTerm, _pTwo *XWhereTerm) {
 84364  	var _op, _idxNew int32
 84365  	var _eOp uint16
 84366  	var _db *Xsqlite3
 84367  	var _pNew *XExpr
 84368  	_eOp = uint16(int32(_pOne.XeOperator) | int32(_pTwo.XeOperator))
 84369  	if (int32(_pOne.XeOperator) & int32(62)) == int32(0) {
 84370  		return
 84371  	}
 84372  	if (int32(_pTwo.XeOperator) & int32(62)) == int32(0) {
 84373  		return
 84374  	}
 84375  	if ((int32(_eOp) & int32(26)) != int32(_eOp)) && ((int32(_eOp) & int32(38)) != int32(_eOp)) {
 84376  		return
 84377  	}
 84378  	func() {
 84379  		if (*XExpr)((*XExpr)(_pOne.XpExpr).XpLeft) == nil || (*XExpr)((*XExpr)(_pOne.XpExpr).XpRight) == nil {
 84380  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129334), unsafe.Pointer(&_whereCombineDisjunctsØ00__func__Ø000), unsafe.Pointer(str(103958)))
 84381  			crt.X__builtin_abort(tls)
 84382  		}
 84383  	}()
 84384  	func() {
 84385  		if (*XExpr)((*XExpr)(_pTwo.XpExpr).XpLeft) == nil || (*XExpr)((*XExpr)(_pTwo.XpExpr).XpRight) == nil {
 84386  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129335), unsafe.Pointer(&_whereCombineDisjunctsØ00__func__Ø000), unsafe.Pointer(str(104006)))
 84387  			crt.X__builtin_abort(tls)
 84388  		}
 84389  	}()
 84390  	if _sqlite3ExprCompare(tls, (*XExpr)((*XExpr)(_pOne.XpExpr).XpLeft), (*XExpr)((*XExpr)(_pTwo.XpExpr).XpLeft), int32(-1)) != 0 {
 84391  		return
 84392  	}
 84393  	if _sqlite3ExprCompare(tls, (*XExpr)((*XExpr)(_pOne.XpExpr).XpRight), (*XExpr)((*XExpr)(_pTwo.XpExpr).XpRight), int32(-1)) != 0 {
 84394  		return
 84395  	}
 84396  	if (int32(_eOp) & (int32(_eOp) - int32(1))) == int32(0) {
 84397  		goto _12
 84398  	}
 84399  	if (int32(_eOp) & int32(24)) != 0 {
 84400  		_eOp = uint16(8)
 84401  		goto _14
 84402  	}
 84403  	func() {
 84404  		if (int32(_eOp) & int32(36)) == 0 {
 84405  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129343), unsafe.Pointer(&_whereCombineDisjunctsØ00__func__Ø000), unsafe.Pointer(str(104054)))
 84406  			crt.X__builtin_abort(tls)
 84407  		}
 84408  	}()
 84409  	_eOp = uint16(32)
 84410  _14:
 84411  _12:
 84412  	_db = (*Xsqlite3)((*XParse)((*XWhereInfo)(_pWC.XpWInfo).XpParse).Xdb)
 84413  	_pNew = _sqlite3ExprDup(tls, _db, (*XExpr)(_pOne.XpExpr), int32(0))
 84414  	if _pNew == nil {
 84415  		return
 84416  	}
 84417  	_op = int32(78)
 84418  _18:
 84419  	if int32(_eOp) == (int32(2) << uint(_op-int32(78))) {
 84420  		goto _21
 84421  	}
 84422  	func() {
 84423  		if _op >= int32(82) {
 84424  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129350), unsafe.Pointer(&_whereCombineDisjunctsØ00__func__Ø000), unsafe.Pointer(str(104074)))
 84425  			crt.X__builtin_abort(tls)
 84426  		}
 84427  	}()
 84428  	_op += 1
 84429  	goto _18
 84430  _21:
 84431  	_pNew.Xop = uint8(_op)
 84432  	_idxNew = _whereClauseInsert(tls, _pWC, _pNew, uint16(3))
 84433  	_exprAnalyze(tls, _pSrc, _pWC, _idxNew)
 84434  }
 84435  
 84436  var _whereCombineDisjunctsØ00__func__Ø000 [22]int8
 84437  
 84438  func init() {
 84439  	crt.Xstrncpy(nil, &_whereCombineDisjunctsØ00__func__Ø000[0], str(104083), 22)
 84440  }
 84441  
 84442  // C comment
 84443  //  /*
 84444  //  ** Check to see if the given expression is a LIKE or GLOB operator that
 84445  //  ** can be optimized using inequality constraints.  Return TRUE if it is
 84446  //  ** so and false if not.
 84447  //  **
 84448  //  ** In order for the operator to be optimizible, the RHS must be a string
 84449  //  ** literal that does not begin with a wildcard.  The LHS must be a column
 84450  //  ** that may only be NULL, a string, or a BLOB, never a number. (This means
 84451  //  ** that virtual tables cannot participate in the LIKE optimization.)  The
 84452  //  ** collating sequence for the column on the LHS must be appropriate for
 84453  //  ** the operator.
 84454  //  */
 84455  func _isLikeOrGlob(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _ppPrefix **XExpr, _pisComplete *int32, _pnoCase *int32) (r0 int32) {
 84456  	var _c, _cnt, _op, _rc, _2_iCol, _11_r1 int32
 84457  	var _z *int8
 84458  	var _db *Xsqlite3
 84459  	var _2_pReprepare, _10_v *TVdbe
 84460  	var _pVal *XMem
 84461  	var _pList *XExprList
 84462  	var _pRight, _pLeft, _9_pPrefix *XExpr
 84463  	var _wc [3]int8
 84464  	_z = nil
 84465  	_db = (*Xsqlite3)(_pParse.Xdb)
 84466  	_pVal = nil
 84467  	if _sqlite3IsLikeFunction(tls, _db, _pExpr, _pnoCase, (*int8)(unsafe.Pointer(&_wc))) == 0 {
 84468  		return int32(0)
 84469  	}
 84470  	_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 84471  	_pLeft = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(1)).XpExpr)
 84472  	_pRight = _sqlite3ExprSkipCollate(tls, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), 0).XpExpr))
 84473  	_op = int32(_pRight.Xop)
 84474  	if _op != int32(135) {
 84475  		goto _1
 84476  	}
 84477  	_2_pReprepare = (*TVdbe)(_pParse.XpReprepare)
 84478  	_2_iCol = int32(_pRight.XiColumn)
 84479  	_pVal = _sqlite3VdbeGetBoundValue(tls, _2_pReprepare, _2_iCol, uint8(65))
 84480  	if (_pVal != nil) && (Xsqlite3_value_type(tls, _pVal) == int32(3)) {
 84481  		_z = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, _pVal)))
 84482  	}
 84483  	_sqlite3VdbeSetVarmask(tls, (*TVdbe)(_pParse.XpVdbe), _2_iCol)
 84484  	func() {
 84485  		if int32(_pRight.Xop) != int32(135) && int32(_pRight.Xop) != int32(157) {
 84486  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(129154), unsafe.Pointer(&_isLikeOrGlobØ00__func__Ø000), unsafe.Pointer(str(104105)))
 84487  			crt.X__builtin_abort(tls)
 84488  		}
 84489  	}()
 84490  	goto _8
 84491  _1:
 84492  	if _op == int32(97) {
 84493  		_z = *(**int8)(unsafe.Pointer(&_pRight.Xu))
 84494  	}
 84495  _8:
 84496  	if _z == nil {
 84497  		goto _9
 84498  	}
 84499  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_z, 0)))))&int32(4)) == 0 && int32(*elem1(_z, 0)) != int32(45) {
 84500  		goto _11
 84501  	}
 84502  	if ((int32(_pLeft.Xop) != int32(152)) || (int32(_sqlite3ExprAffinity(tls, _pLeft)) != int32(66))) || ((*XTable)(_pLeft.XpTab).XnModuleArg) != 0 {
 84503  		_sqlite3ValueFree(tls, _pVal)
 84504  		return int32(0)
 84505  	}
 84506  _11:
 84507  	_cnt = int32(0)
 84508  _15:
 84509  	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)))) {
 84510  		_cnt += 1
 84511  		goto _15
 84512  	}
 84513  	if _cnt == int32(0) || int32(255) == int32(uint8(*elem1(_z, uintptr(_cnt-int32(1))))) {
 84514  		goto _21
 84515  	}
 84516  	*_pisComplete = bool2int((_c == int32(*elem1((*int8)(unsafe.Pointer(&_wc)), 0))) && (int32(*elem1(_z, uintptr(_cnt+int32(1)))) == int32(0)))
 84517  	_9_pPrefix = _sqlite3Expr(tls, _db, int32(97), _z)
 84518  	if _9_pPrefix != nil {
 84519  		*elem1(*(**int8)(unsafe.Pointer(&_9_pPrefix.Xu)), uintptr(_cnt)) = 0
 84520  	}
 84521  	*_ppPrefix = _9_pPrefix
 84522  	if _op != int32(135) {
 84523  		goto _24
 84524  	}
 84525  	_10_v = (*TVdbe)(_pParse.XpVdbe)
 84526  	_sqlite3VdbeSetVarmask(tls, _10_v, int32(_pRight.XiColumn))
 84527  	if (*_pisComplete) != 0 && ((*elem1(*(**int8)(unsafe.Pointer(&_pRight.Xu)), uintptr(1))) != 0) {
 84528  		_11_r1 = _sqlite3GetTempReg(tls, _pParse)
 84529  		_sqlite3ExprCodeTarget(tls, _pParse, _pRight, _11_r1)
 84530  		_sqlite3VdbeChangeP3(tls, _10_v, uint32(_sqlite3VdbeCurrentAddr(tls, _10_v)-int32(1)), int32(0))
 84531  		_sqlite3ReleaseTempReg(tls, _pParse, _11_r1)
 84532  	}
 84533  _24:
 84534  	goto _27
 84535  _21:
 84536  	_z = nil
 84537  _27:
 84538  _9:
 84539  	_rc = bool2int(_z != nil)
 84540  	_sqlite3ValueFree(tls, _pVal)
 84541  	return _rc
 84542  
 84543  	_ = _wc
 84544  	panic(0)
 84545  }
 84546  
 84547  // C comment
 84548  //  /*
 84549  //  ** pExpr points to an expression which implements a function.  If
 84550  //  ** it is appropriate to apply the LIKE optimization to that function
 84551  //  ** then set aWc[0] through aWc[2] to the wildcard characters and
 84552  //  ** return TRUE.  If the function is not a LIKE-style function then
 84553  //  ** return FALSE.
 84554  //  **
 84555  //  ** *pIsNocase is set to true if uppercase and lowercase are equivalent for
 84556  //  ** the function (default for LIKE).  If the function makes the distinction
 84557  //  ** between uppercase and lowercase (as does GLOB) then *pIsNocase is set to
 84558  //  ** false.
 84559  //  */
 84560  func _sqlite3IsLikeFunction(tls *crt.TLS, _db *Xsqlite3, _pExpr *XExpr, _pIsNocase *int32, _aWc *int8) (r0 int32) {
 84561  	var _pDef *XFuncDef
 84562  	if ((int32(_pExpr.Xop) != int32(151)) || ((*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))) == nil)) || (((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).XnExpr) != int32(2)) {
 84563  		return int32(0)
 84564  	}
 84565  	func() {
 84566  		if (_pExpr.Xflags & uint32(2048)) != (0) {
 84567  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107262), unsafe.Pointer(&_sqlite3IsLikeFunctionØ00__func__Ø000), unsafe.Pointer(str(42733)))
 84568  			crt.X__builtin_abort(tls)
 84569  		}
 84570  	}()
 84571  	_pDef = _sqlite3FindFunction(tls, _db, *(**int8)(unsafe.Pointer(&_pExpr.Xu)), int32(2), uint8(1), 0)
 84572  	if func() int32 {
 84573  		if _pDef == nil {
 84574  			return func() int32 {
 84575  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107264), unsafe.Pointer(&_sqlite3IsLikeFunctionØ00__func__Ø000), unsafe.Pointer(str(4809)))
 84576  				crt.X__builtin_abort(tls)
 84577  				return int32(1)
 84578  			}()
 84579  		}
 84580  		return int32(0)
 84581  	}() != 0 || ((int32(_pDef.XfuncFlags) & int32(4)) == int32(0)) {
 84582  		return int32(0)
 84583  	}
 84584  	crt.Xmemcpy(tls, unsafe.Pointer(_aWc), _pDef.XpUserData, uint32(3))
 84585  	func() {
 84586  		if (*int8)(unsafe.Pointer(&_likeInfoAlt)) != (*int8)(unsafe.Pointer(&_likeInfoAlt.XmatchAll)) {
 84587  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107273), unsafe.Pointer(&_sqlite3IsLikeFunctionØ00__func__Ø000), unsafe.Pointer(str(104156)))
 84588  			crt.X__builtin_abort(tls)
 84589  		}
 84590  	}()
 84591  	func() {
 84592  		if elem1((*int8)(unsafe.Pointer(&_likeInfoAlt)), uintptr(1)) != (*int8)(unsafe.Pointer(&_likeInfoAlt.XmatchOne)) {
 84593  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107274), unsafe.Pointer(&_sqlite3IsLikeFunctionØ00__func__Ø000), unsafe.Pointer(str(104208)))
 84594  			crt.X__builtin_abort(tls)
 84595  		}
 84596  	}()
 84597  	func() {
 84598  		if elem1((*int8)(unsafe.Pointer(&_likeInfoAlt)), uintptr(2)) != (*int8)(unsafe.Pointer(&_likeInfoAlt.XmatchSet)) {
 84599  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107275), unsafe.Pointer(&_sqlite3IsLikeFunctionØ00__func__Ø000), unsafe.Pointer(str(104266)))
 84600  			crt.X__builtin_abort(tls)
 84601  		}
 84602  	}()
 84603  	*_pIsNocase = bool2int((int32(_pDef.XfuncFlags) & int32(8)) == int32(0))
 84604  	return int32(1)
 84605  }
 84606  
 84607  var _sqlite3IsLikeFunctionØ00__func__Ø000 [22]int8
 84608  
 84609  func init() {
 84610  	crt.Xstrncpy(nil, &_sqlite3IsLikeFunctionØ00__func__Ø000[0], str(104324), 22)
 84611  }
 84612  
 84613  // C comment
 84614  //  /* If SQLITE_CASE_SENSITIVE_LIKE is defined, then the LIKE operator
 84615  //  ** is case sensitive causing 'a' LIKE 'A' to be false */
 84616  var _likeInfoAlt TcompareInfo
 84617  
 84618  func init() {
 84619  	_likeInfoAlt = TcompareInfo{XmatchAll: uint8(37), XmatchOne: uint8(95)}
 84620  }
 84621  
 84622  // C comment
 84623  //  /*
 84624  //  ** Return a pointer to an sqlite3_value structure containing the value bound
 84625  //  ** parameter iVar of VM v. Except, if the value is an SQL NULL, return
 84626  //  ** 0 instead. Unless it is NULL, apply affinity aff (one of the SQLITE_AFF_*
 84627  //  ** constants) to the value before returning it.
 84628  //  **
 84629  //  ** The returned value must be freed by the caller using sqlite3ValueFree().
 84630  //  */
 84631  func _sqlite3VdbeGetBoundValue(tls *crt.TLS, _v *TVdbe, _iVar int32, _aff uint8) (r0 *XMem) {
 84632  	var _1_pMem, _2_pRet *XMem
 84633  	func() {
 84634  		if _iVar <= int32(0) {
 84635  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75960), unsafe.Pointer(&_sqlite3VdbeGetBoundValueØ00__func__Ø000), unsafe.Pointer(str(104346)))
 84636  			crt.X__builtin_abort(tls)
 84637  		}
 84638  	}()
 84639  	if _v == nil {
 84640  		goto _2
 84641  	}
 84642  	_1_pMem = elem25((*XMem)(_v.XaVar), uintptr(_iVar-int32(1)))
 84643  	if int32(0) != (int32(_1_pMem.Xflags) & int32(1)) {
 84644  		goto _3
 84645  	}
 84646  	_2_pRet = _sqlite3ValueNew(tls, (*Xsqlite3)(_v.Xdb))
 84647  	if _2_pRet != nil {
 84648  		_sqlite3VdbeMemCopy(tls, _2_pRet, _1_pMem)
 84649  		_sqlite3ValueApplyAffinity(tls, _2_pRet, _aff, uint8(1))
 84650  	}
 84651  	return _2_pRet
 84652  
 84653  _3:
 84654  _2:
 84655  	return nil
 84656  }
 84657  
 84658  var _sqlite3VdbeGetBoundValueØ00__func__Ø000 [25]int8
 84659  
 84660  func init() {
 84661  	crt.Xstrncpy(nil, &_sqlite3VdbeGetBoundValueØ00__func__Ø000[0], str(104353), 25)
 84662  }
 84663  
 84664  // C comment
 84665  //  /*
 84666  //  ** Configure SQL variable iVar so that binding a new value to it signals
 84667  //  ** to sqlite3_reoptimize() that re-preparing the statement may result
 84668  //  ** in a better query plan.
 84669  //  */
 84670  func _sqlite3VdbeSetVarmask(tls *crt.TLS, _v *TVdbe, _iVar int32) {
 84671  	func() {
 84672  		if _iVar <= int32(0) {
 84673  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(75981), unsafe.Pointer(&_sqlite3VdbeSetVarmaskØ00__func__Ø000), unsafe.Pointer(str(104346)))
 84674  			crt.X__builtin_abort(tls)
 84675  		}
 84676  	}()
 84677  	if _iVar >= int32(32) {
 84678  		_v.Xexpmask |= uint32(2147483648)
 84679  		goto _3
 84680  	}
 84681  	_v.Xexpmask |= uint32(1) << uint(_iVar-int32(1))
 84682  _3:
 84683  }
 84684  
 84685  var _sqlite3VdbeSetVarmaskØ00__func__Ø000 [22]int8
 84686  
 84687  func init() {
 84688  	crt.Xstrncpy(nil, &_sqlite3VdbeSetVarmaskØ00__func__Ø000[0], str(104378), 22)
 84689  }
 84690  
 84691  var _isLikeOrGlobØ00__func__Ø000 [13]int8
 84692  
 84693  func init() {
 84694  	crt.Xstrncpy(nil, &_isLikeOrGlobØ00__func__Ø000[0], str(104400), 13)
 84695  }
 84696  
 84697  func _sqlite3VdbeChangeP3(tls *crt.TLS, _p *TVdbe, _addr uint32, _val int32) {
 84698  	_sqlite3VdbeGetOp(tls, _p, int32(_addr)).Xp3 = _val
 84699  }
 84700  
 84701  // C comment
 84702  //  /*
 84703  //  ** Check to see if the given expression is of the form
 84704  //  **
 84705  //  **         column OP expr
 84706  //  **
 84707  //  ** where OP is one of MATCH, GLOB, LIKE or REGEXP and "column" is a
 84708  //  ** column of a virtual table.
 84709  //  **
 84710  //  ** If it is then return TRUE.  If not, return FALSE.
 84711  //  */
 84712  func _isMatchOfColumn(tls *crt.TLS, _pExpr *XExpr, _peOp2 *uint8) (r0 int32) {
 84713  	var _i int32
 84714  	var _pList *XExprList
 84715  	var _pCol *XExpr
 84716  	if int32(_pExpr.Xop) != int32(151) {
 84717  		return int32(0)
 84718  	}
 84719  	_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))
 84720  	if (_pList == nil) || (_pList.XnExpr != int32(2)) {
 84721  		return int32(0)
 84722  	}
 84723  	_pCol = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(1)).XpExpr)
 84724  	if (int32(_pCol.Xop) != int32(152)) || (((*XTable)(_pCol.XpTab).XnModuleArg) == 0) {
 84725  		return int32(0)
 84726  	}
 84727  	_i = int32(0)
 84728  _5:
 84729  	if _i >= int32(4) {
 84730  		goto _8
 84731  	}
 84732  	if _sqlite3StrICmp(tls, *(**int8)(unsafe.Pointer(&_pExpr.Xu)), elem103((*TOp2)(unsafe.Pointer(&_isMatchOfColumnØ00aOpØ001)), uintptr(_i)).XzOp) == int32(0) {
 84733  		*_peOp2 = elem103((*TOp2)(unsafe.Pointer(&_isMatchOfColumnØ00aOpØ001)), uintptr(_i)).XeOp2
 84734  		return int32(1)
 84735  	}
 84736  	_i += 1
 84737  	goto _5
 84738  _8:
 84739  	return int32(0)
 84740  }
 84741  
 84742  var _isMatchOfColumnØ00aOpØ001 [4]TOp2
 84743  
 84744  func init() {
 84745  	_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)}}
 84746  }
 84747  
 84748  // C comment
 84749  //  /*
 84750  //  ** Compute and return a new Expr object which when passed to
 84751  //  ** sqlite3ExprCode() will generate all necessary code to compute
 84752  //  ** the iField-th column of the vector expression pVector.
 84753  //  **
 84754  //  ** It is ok for pVector to be a scalar (as long as iField==0).
 84755  //  ** In that case, this routine works like sqlite3ExprDup().
 84756  //  **
 84757  //  ** The caller owns the returned Expr object and is responsible for
 84758  //  ** ensuring that the returned value eventually gets freed.
 84759  //  **
 84760  //  ** The caller retains ownership of pVector.  If pVector is a TK_SELECT,
 84761  //  ** then the returned object will reference pVector and so pVector must remain
 84762  //  ** valid for the life of the returned object.  If pVector is a TK_VECTOR
 84763  //  ** or a scalar expression, then it can be deleted as soon as this routine
 84764  //  ** returns.
 84765  //  **
 84766  //  ** A trick to cause a TK_SELECT pVector to be deleted together with
 84767  //  ** the returned Expr object is to attach the pVector to the pRight field
 84768  //  ** of the returned TK_SELECT_COLUMN Expr object.
 84769  //  */
 84770  func _sqlite3ExprForVectorField(tls *crt.TLS, _pParse *XParse, _pVector *XExpr, _iField int32) (r0 *XExpr) {
 84771  	var _pRet *XExpr
 84772  	if int32(_pVector.Xop) != int32(119) {
 84773  		goto _0
 84774  	}
 84775  	func() {
 84776  		if (_pVector.Xflags & uint32(2048)) == 0 {
 84777  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91309), unsafe.Pointer(&_sqlite3ExprForVectorFieldØ00__func__Ø000), unsafe.Pointer(str(104420)))
 84778  			crt.X__builtin_abort(tls)
 84779  		}
 84780  	}()
 84781  	_pRet = _sqlite3PExpr(tls, _pParse, int32(159), nil, nil)
 84782  	if _pRet != nil {
 84783  		_pRet.XiColumn = int16(_iField)
 84784  		*(**XExpr)(unsafe.Pointer(&_pRet.XpLeft)) = _pVector
 84785  	}
 84786  	func() {
 84787  		if _pRet != nil && _pRet.XiTable != int32(0) {
 84788  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91331), unsafe.Pointer(&_sqlite3ExprForVectorFieldØ00__func__Ø000), unsafe.Pointer(str(104450)))
 84789  			crt.X__builtin_abort(tls)
 84790  		}
 84791  	}()
 84792  	goto _7
 84793  _0:
 84794  	if int32(_pVector.Xop) == int32(158) {
 84795  		_pVector = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pVector.Xx))).Xa))), uintptr(_iField)).XpExpr)
 84796  	}
 84797  	_pRet = _sqlite3ExprDup(tls, (*Xsqlite3)(_pParse.Xdb), _pVector, int32(0))
 84798  _7:
 84799  	return _pRet
 84800  }
 84801  
 84802  var _sqlite3ExprForVectorFieldØ00__func__Ø000 [26]int8
 84803  
 84804  func init() {
 84805  	crt.Xstrncpy(nil, &_sqlite3ExprForVectorFieldØ00__func__Ø000[0], str(104477), 26)
 84806  }
 84807  
 84808  // C comment
 84809  //  /*
 84810  //  ** Return true if the DISTINCT expression-list passed as the third argument
 84811  //  ** is redundant.
 84812  //  **
 84813  //  ** A DISTINCT list is redundant if any subset of the columns in the
 84814  //  ** DISTINCT list are collectively unique and individually non-null.
 84815  //  */
 84816  func _isDistinctRedundant(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pWC *XWhereClause, _pDistinct *XExprList) (r0 int32) {
 84817  	var _i, _iBase int32
 84818  	var _pTab *XTable
 84819  	var _1_p *XExpr
 84820  	var _pIdx *XIndex
 84821  	if _pTabList.XnSrc != int32(1) {
 84822  		return int32(0)
 84823  	}
 84824  	_iBase = elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), 0).XiCursor
 84825  	_pTab = (*XTable)(elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), 0).XpTab)
 84826  	_i = int32(0)
 84827  _1:
 84828  	if _i >= _pDistinct.XnExpr {
 84829  		goto _4
 84830  	}
 84831  	_1_p = _sqlite3ExprSkipCollate(tls, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pDistinct.Xa)), uintptr(_i)).XpExpr))
 84832  	if ((int32(_1_p.Xop) == int32(152)) && (_1_p.XiTable == _iBase)) && (int32(_1_p.XiColumn) < int32(0)) {
 84833  		return int32(1)
 84834  	}
 84835  	_i += 1
 84836  	goto _1
 84837  _4:
 84838  	_pIdx = (*XIndex)(_pTab.XpIndex)
 84839  _8:
 84840  	if _pIdx == nil {
 84841  		goto _11
 84842  	}
 84843  	if int32(_pIdx.XonError) == int32(0) {
 84844  		goto _9
 84845  	}
 84846  	_i = int32(0)
 84847  _13:
 84848  	if _i >= int32(_pIdx.XnKeyCol) {
 84849  		goto _16
 84850  	}
 84851  	if nil != _sqlite3WhereFindTerm(tls, _pWC, _iBase, _i, uint64(18446744073709551615), uint32(2), _pIdx) {
 84852  		goto _17
 84853  	}
 84854  	if _findIndexCol(tls, _pParse, _pDistinct, _iBase, _pIdx, _i) < int32(0) {
 84855  		goto _16
 84856  	}
 84857  	if _indexColumnNotNull(tls, _pIdx, _i) == int32(0) {
 84858  		goto _16
 84859  	}
 84860  _17:
 84861  	_i += 1
 84862  	goto _13
 84863  _16:
 84864  	if _i == int32(_pIdx.XnKeyCol) {
 84865  		return int32(1)
 84866  	}
 84867  _9:
 84868  	_pIdx = (*XIndex)(_pIdx.XpNext)
 84869  	goto _8
 84870  _11:
 84871  	return int32(0)
 84872  }
 84873  
 84874  // C comment
 84875  //  /*
 84876  //  ** Search for a term in the WHERE clause that is of the form "X <op> <expr>"
 84877  //  ** where X is a reference to the iColumn of table iCur or of index pIdx
 84878  //  ** if pIdx!=0 and <op> is one of the WO_xx operator codes specified by
 84879  //  ** the op parameter.  Return a pointer to the term.  Return 0 if not found.
 84880  //  **
 84881  //  ** If pIdx!=0 then it must be one of the indexes of table iCur.
 84882  //  ** Search for terms matching the iColumn-th column of pIdx
 84883  //  ** rather than the iColumn-th column of table iCur.
 84884  //  **
 84885  //  ** The term returned might by Y=<expr> if there is another constraint in
 84886  //  ** the WHERE clause that specifies that X=Y.  Any such constraints will be
 84887  //  ** identified by the WO_EQUIV bit in the pTerm->eOperator field.  The
 84888  //  ** aiCur[]/iaColumn[] arrays hold X and all its equivalents. There are 11
 84889  //  ** slots in aiCur[]/aiColumn[] so that means we can look for X plus up to 10
 84890  //  ** other equivalent values.  Hence a search for X will return <expr> if X=A1
 84891  //  ** and A1=A2 and A2=A3 and ... and A9=A10 and A10=<expr>.
 84892  //  **
 84893  //  ** If there are multiple terms in the WHERE clause of the form "X <op> <expr>"
 84894  //  ** then try for the one with no dependencies on <expr> - in other words where
 84895  //  ** <expr> is a constant expression of some kind.  Only return entries of
 84896  //  ** the form "X <op> Y" where Y is a column in another table if no terms of
 84897  //  ** the form "X <op> <const-expr>" exist.   If no terms with a constant RHS
 84898  //  ** exist, try to return a term that does not use WO_EQUIV.
 84899  //  */
 84900  func _sqlite3WhereFindTerm(tls *crt.TLS, _pWC *XWhereClause, _iCur int32, _iColumn int32, _notReady uint64, _op uint32, _pIdx *XIndex) (r0 *XWhereTerm) {
 84901  	var _pResult, _p *XWhereTerm
 84902  	var _scan XWhereScan
 84903  	_pResult = nil
 84904  	_p = _whereScanInit(tls, &_scan, _pWC, _iCur, _iColumn, _op, _pIdx)
 84905  	_op &= uint32(130)
 84906  _0:
 84907  	if _p == nil {
 84908  		goto _1
 84909  	}
 84910  	if (_p.XprereqRight & _notReady) != (0) {
 84911  		goto _2
 84912  	}
 84913  	if (_p.XprereqRight == (0)) && ((uint32(_p.XeOperator) & _op) != (0)) {
 84914  		return _p
 84915  	}
 84916  	if _pResult == nil {
 84917  		_pResult = _p
 84918  	}
 84919  _2:
 84920  	_p = _whereScanNext(tls, &_scan)
 84921  	goto _0
 84922  _1:
 84923  	return _pResult
 84924  }
 84925  
 84926  // C comment
 84927  //  /*
 84928  //  ** Initialize a WHERE clause scanner object.  Return a pointer to the
 84929  //  ** first match.  Return NULL if there are no matches.
 84930  //  **
 84931  //  ** The scanner will be searching the WHERE clause pWC.  It will look
 84932  //  ** for terms of the form "X <op> <expr>" where X is column iColumn of table
 84933  //  ** iCur.   Or if pIdx!=0 then X is column iColumn of index pIdx.  pIdx
 84934  //  ** must be one of the indexes of table iCur.
 84935  //  **
 84936  //  ** The <op> must be one of the operators described by opMask.
 84937  //  **
 84938  //  ** If the search is for X and the WHERE clause contains terms of the
 84939  //  ** form X=Y then this routine might also return terms of the form
 84940  //  ** "Y <op> <expr>".  The number of levels of transitivity is limited,
 84941  //  ** but is enough to handle most commonly occurring SQL statements.
 84942  //  **
 84943  //  ** If X is not the INTEGER PRIMARY KEY then X must be compatible with
 84944  //  ** index pIdx.
 84945  //  */
 84946  func _whereScanInit(tls *crt.TLS, _pScan *XWhereScan, _pWC *XWhereClause, _iCur int32, _iColumn int32, _opMask uint32, _pIdx *XIndex) (r0 *XWhereTerm) {
 84947  	var _1_j int32
 84948  	*(**XWhereClause)(unsafe.Pointer(&_pScan.XpOrigWC)) = _pWC
 84949  	*(**XWhereClause)(unsafe.Pointer(&_pScan.XpWC)) = _pWC
 84950  	*(**XExpr)(unsafe.Pointer(&_pScan.XpIdxExpr)) = nil
 84951  	_pScan.Xidxaff = 0
 84952  	_pScan.XzCollName = nil
 84953  	if _pIdx == nil {
 84954  		goto _0
 84955  	}
 84956  	_1_j = _iColumn
 84957  	_iColumn = int32(*elem50(_pIdx.XaiColumn, uintptr(_1_j)))
 84958  	if _iColumn == int32(-2) {
 84959  		*(**XExpr)(unsafe.Pointer(&_pScan.XpIdxExpr)) = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.XaColExpr).Xa))), uintptr(_1_j)).XpExpr)
 84960  		_pScan.XzCollName = *elem0(_pIdx.XazColl, uintptr(_1_j))
 84961  		goto _5
 84962  	}
 84963  	if _iColumn == int32((*XTable)(_pIdx.XpTable).XiPKey) {
 84964  		_iColumn = int32(-1)
 84965  		goto _5
 84966  	}
 84967  	if _iColumn >= int32(0) {
 84968  		_pScan.Xidxaff = elem41((*XColumn)((*XTable)(_pIdx.XpTable).XaCol), uintptr(_iColumn)).Xaffinity
 84969  		_pScan.XzCollName = *elem0(_pIdx.XazColl, uintptr(_1_j))
 84970  	}
 84971  _5:
 84972  	goto _7
 84973  _0:
 84974  	if _iColumn == int32(-2) {
 84975  		return nil
 84976  	}
 84977  _7:
 84978  	_pScan.XopMask = _opMask
 84979  	_pScan.Xk = int32(0)
 84980  	*elem8((*int32)(unsafe.Pointer(&_pScan.XaiCur)), 0) = _iCur
 84981  	*elem50((*int16)(unsafe.Pointer(&_pScan.XaiColumn)), 0) = int16(_iColumn)
 84982  	_pScan.XnEquiv = uint8(1)
 84983  	_pScan.XiEquiv = uint8(1)
 84984  	return _whereScanNext(tls, _pScan)
 84985  }
 84986  
 84987  // C comment
 84988  //  /*
 84989  //  ** Advance to the next WhereTerm that matches according to the criteria
 84990  //  ** established when the pScan object was initialized by whereScanInit().
 84991  //  ** Return NULL if there are no more matching WhereTerms.
 84992  //  */
 84993  func _whereScanNext(tls *crt.TLS, _pScan *XWhereScan) (r0 *XWhereTerm) {
 84994  	var _iColumn int16
 84995  	var _iCur, _k, _5_j int32
 84996  	var _pX *XExpr
 84997  	var _10_pParse *XParse
 84998  	var _10_pColl *XCollSeq
 84999  	var _pTerm *XWhereTerm
 85000  	var _pWC *XWhereClause
 85001  	_k = _pScan.Xk
 85002  	func() {
 85003  		if int32(_pScan.XiEquiv) > int32(_pScan.XnEquiv) {
 85004  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(130590), unsafe.Pointer(&_whereScanNextØ00__func__Ø000), unsafe.Pointer(str(104503)))
 85005  			crt.X__builtin_abort(tls)
 85006  		}
 85007  	}()
 85008  	_pWC = (*XWhereClause)(_pScan.XpWC)
 85009  _2:
 85010  	_iColumn = *elem50((*int16)(unsafe.Pointer(&_pScan.XaiColumn)), uintptr(int32(_pScan.XiEquiv)-int32(1)))
 85011  	_iCur = *elem8((*int32)(unsafe.Pointer(&_pScan.XaiCur)), uintptr(int32(_pScan.XiEquiv)-int32(1)))
 85012  	func() {
 85013  		if _pWC == nil {
 85014  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(130595), unsafe.Pointer(&_whereScanNextØ00__func__Ø000), unsafe.Pointer(str(104532)))
 85015  			crt.X__builtin_abort(tls)
 85016  		}
 85017  	}()
 85018  _6:
 85019  	_pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.Xa) + uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(_k)*uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(48)))))))))))
 85020  _7:
 85021  	if _k >= _pWC.XnTerm {
 85022  		goto _10
 85023  	}
 85024  	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) {
 85025  		goto _16
 85026  	}
 85027  	if (int32(_pTerm.XeOperator)&int32(2048)) == int32(0) || int32(_pScan.XnEquiv) >= int32(11) || int32(store58(&_pX, _sqlite3ExprSkipCollate(tls, (*XExpr)((*XExpr)(_pTerm.XpExpr).XpRight))).Xop) != int32(152) {
 85028  		goto _19
 85029  	}
 85030  	_5_j = int32(0)
 85031  _20:
 85032  	if _5_j >= int32(_pScan.XnEquiv) {
 85033  		goto _23
 85034  	}
 85035  	if ((*elem8((*int32)(unsafe.Pointer(&_pScan.XaiCur)), uintptr(_5_j))) == _pX.XiTable) && (int32(*elem50((*int16)(unsafe.Pointer(&_pScan.XaiColumn)), uintptr(_5_j))) == int32(_pX.XiColumn)) {
 85036  		goto _23
 85037  	}
 85038  	_5_j += 1
 85039  	goto _20
 85040  _23:
 85041  	if _5_j == int32(_pScan.XnEquiv) {
 85042  		*elem8((*int32)(unsafe.Pointer(&_pScan.XaiCur)), uintptr(_5_j)) = _pX.XiTable
 85043  		*elem50((*int16)(unsafe.Pointer(&_pScan.XaiColumn)), uintptr(_5_j)) = _pX.XiColumn
 85044  		_pScan.XnEquiv += 1
 85045  	}
 85046  _19:
 85047  	if (uint32(_pTerm.XeOperator) & _pScan.XopMask) == (0) {
 85048  		goto _27
 85049  	}
 85050  	if _pScan.XzCollName == nil || (int32(_pTerm.XeOperator)&int32(256)) != int32(0) {
 85051  		goto _29
 85052  	}
 85053  	_10_pParse = (*XParse)((*XWhereInfo)(_pWC.XpWInfo).XpParse)
 85054  	_pX = (*XExpr)(_pTerm.XpExpr)
 85055  	if _sqlite3IndexAffinityOk(tls, _pX, _pScan.Xidxaff) == 0 {
 85056  		goto _8
 85057  	}
 85058  	func() {
 85059  		if _pX.XpLeft == nil {
 85060  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(130631), unsafe.Pointer(&_whereScanNextØ00__func__Ø000), unsafe.Pointer(str(104539)))
 85061  			crt.X__builtin_abort(tls)
 85062  		}
 85063  	}()
 85064  	_10_pColl = _sqlite3BinaryCompareCollSeq(tls, _10_pParse, (*XExpr)(_pX.XpLeft), (*XExpr)(_pX.XpRight))
 85065  	if _10_pColl == nil {
 85066  		_10_pColl = (*XCollSeq)((*Xsqlite3)(_10_pParse.Xdb).XpDfltColl)
 85067  	}
 85068  	if _sqlite3StrICmp(tls, _10_pColl.XzName, _pScan.XzCollName) != 0 {
 85069  		goto _8
 85070  	}
 85071  _29:
 85072  	if ((((int32(_pTerm.XeOperator) & int32(130)) != int32(0)) && (int32(store58(&_pX, (*XExpr)((*XExpr)(_pTerm.XpExpr).XpRight)).Xop) == int32(152))) && (_pX.XiTable == (*elem8((*int32)(unsafe.Pointer(&_pScan.XaiCur)), 0)))) && (int32(_pX.XiColumn) == int32(*elem50((*int16)(unsafe.Pointer(&_pScan.XaiColumn)), 0))) {
 85073  		goto _8
 85074  	}
 85075  	*(**XWhereClause)(unsafe.Pointer(&_pScan.XpWC)) = _pWC
 85076  	_pScan.Xk = _k + int32(1)
 85077  	return _pTerm
 85078  
 85079  _27:
 85080  _16:
 85081  _8:
 85082  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _k += 1; return &_pTerm }())) += uintptr(48)
 85083  	goto _7
 85084  _10:
 85085  	_pWC = (*XWhereClause)(_pWC.XpOuter)
 85086  	_k = int32(0)
 85087  	if _pWC != nil {
 85088  		goto _6
 85089  	}
 85090  	if int32(_pScan.XiEquiv) >= int32(_pScan.XnEquiv) {
 85091  		goto _3
 85092  	}
 85093  	_pWC = (*XWhereClause)(_pScan.XpOrigWC)
 85094  	_k = int32(0)
 85095  	_pScan.XiEquiv += 1
 85096  	goto _2
 85097  _3:
 85098  	return nil
 85099  }
 85100  
 85101  var _whereScanNextØ00__func__Ø000 [14]int8
 85102  
 85103  func init() {
 85104  	crt.Xstrncpy(nil, &_whereScanNextØ00__func__Ø000[0], str(104549), 14)
 85105  }
 85106  
 85107  // C comment
 85108  //  /*
 85109  //  ** pExpr is a comparison expression, eg. '=', '<', IN(...) etc.
 85110  //  ** idx_affinity is the affinity of an indexed column. Return true
 85111  //  ** if the index with affinity idx_affinity may be used to implement
 85112  //  ** the comparison in pExpr.
 85113  //  */
 85114  func _sqlite3IndexAffinityOk(tls *crt.TLS, _pExpr *XExpr, _idx_affinity int8) (r0 int32) {
 85115  	var _aff int8
 85116  	_aff = _comparisonAffinity(tls, _pExpr)
 85117  	switch int32(_aff) {
 85118  	case int32(65):
 85119  		goto _1
 85120  	case int32(66):
 85121  		goto _2
 85122  	default:
 85123  		goto _3
 85124  	}
 85125  
 85126  _1:
 85127  	return int32(1)
 85128  
 85129  _2:
 85130  	return bool2int(int32(_idx_affinity) == int32(66))
 85131  
 85132  _3:
 85133  	return bool2int(int32(_idx_affinity) >= int32(67))
 85134  }
 85135  
 85136  // C comment
 85137  //  /*
 85138  //  ** pExpr is a comparison operator.  Return the type affinity that should
 85139  //  ** be applied to both operands prior to doing the comparison.
 85140  //  */
 85141  func _comparisonAffinity(tls *crt.TLS, _pExpr *XExpr) (r0 int8) {
 85142  	var _aff int8
 85143  	func() {
 85144  		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) {
 85145  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91123), unsafe.Pointer(&_comparisonAffinityØ00__func__Ø000), unsafe.Pointer(str(104563)))
 85146  			crt.X__builtin_abort(tls)
 85147  		}
 85148  	}()
 85149  	func() {
 85150  		if _pExpr.XpLeft == nil {
 85151  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91126), unsafe.Pointer(&_comparisonAffinityØ00__func__Ø000), unsafe.Pointer(str(104743)))
 85152  			crt.X__builtin_abort(tls)
 85153  		}
 85154  	}()
 85155  	_aff = _sqlite3ExprAffinity(tls, (*XExpr)(_pExpr.XpLeft))
 85156  	if _pExpr.XpRight != nil {
 85157  		_aff = _sqlite3CompareAffinity(tls, (*XExpr)(_pExpr.XpRight), _aff)
 85158  		goto _16
 85159  	}
 85160  	if (_pExpr.Xflags & uint32(2048)) != (0) {
 85161  		_aff = _sqlite3CompareAffinity(tls, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).XpEList).Xa))), 0).XpExpr), _aff)
 85162  		goto _16
 85163  	}
 85164  	if int32(_aff) == int32(0) {
 85165  		_aff = int8(65)
 85166  	}
 85167  _16:
 85168  	return _aff
 85169  }
 85170  
 85171  var _comparisonAffinityØ00__func__Ø000 [19]int8
 85172  
 85173  func init() {
 85174  	crt.Xstrncpy(nil, &_comparisonAffinityØ00__func__Ø000[0], str(104756), 19)
 85175  }
 85176  
 85177  // C comment
 85178  //  /*
 85179  //  ** This function searches pList for an entry that matches the iCol-th column
 85180  //  ** of index pIdx.
 85181  //  **
 85182  //  ** If such an expression is found, its index in pList->a[] is returned. If
 85183  //  ** no expression is found, -1 is returned.
 85184  //  */
 85185  func _findIndexCol(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _iBase int32, _pIdx *XIndex, _iCol int32) (r0 int32) {
 85186  	var _i int32
 85187  	var _zColl *int8
 85188  	var _1_p *XExpr
 85189  	var _2_pColl *XCollSeq
 85190  	_zColl = *elem0(_pIdx.XazColl, uintptr(_iCol))
 85191  	_i = int32(0)
 85192  _0:
 85193  	if _i >= _pList.XnExpr {
 85194  		goto _3
 85195  	}
 85196  	_1_p = _sqlite3ExprSkipCollate(tls, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_i)).XpExpr))
 85197  	if int32(_1_p.Xop) != int32(152) || int32(_1_p.XiColumn) != int32(*elem50(_pIdx.XaiColumn, uintptr(_iCol))) || _1_p.XiTable != _iBase {
 85198  		goto _6
 85199  	}
 85200  	_2_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_i)).XpExpr))
 85201  	if (_2_pColl != nil) && (int32(0) == _sqlite3StrICmp(tls, _2_pColl.XzName, _zColl)) {
 85202  		return _i
 85203  	}
 85204  _6:
 85205  	_i += 1
 85206  	goto _0
 85207  _3:
 85208  	return int32(-1)
 85209  }
 85210  
 85211  // C comment
 85212  //  /*
 85213  //  ** Return TRUE if the iCol-th column of index pIdx is NOT NULL
 85214  //  */
 85215  func _indexColumnNotNull(tls *crt.TLS, _pIdx *XIndex, _iCol int32) (r0 int32) {
 85216  	var _j int32
 85217  	func() {
 85218  		if _pIdx == nil {
 85219  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(130810), unsafe.Pointer(&_indexColumnNotNullØ00__func__Ø000), unsafe.Pointer(str(42024)))
 85220  			crt.X__builtin_abort(tls)
 85221  		}
 85222  	}()
 85223  	func() {
 85224  		if _iCol < int32(0) || _iCol >= int32(_pIdx.XnColumn) {
 85225  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(130811), unsafe.Pointer(&_indexColumnNotNullØ00__func__Ø000), unsafe.Pointer(str(104775)))
 85226  			crt.X__builtin_abort(tls)
 85227  		}
 85228  	}()
 85229  	_j = int32(*elem50(_pIdx.XaiColumn, uintptr(_iCol)))
 85230  	if _j >= int32(0) {
 85231  		return int32(elem41((*XColumn)((*XTable)(_pIdx.XpTable).XaCol), uintptr(_j)).XnotNull)
 85232  	}
 85233  	if _j == int32(-1) {
 85234  		return int32(1)
 85235  	}
 85236  	func() {
 85237  		if _j != int32(-2) {
 85238  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(130818), unsafe.Pointer(&_indexColumnNotNullØ00__func__Ø000), unsafe.Pointer(str(104805)))
 85239  			crt.X__builtin_abort(tls)
 85240  		}
 85241  	}()
 85242  	return int32(0)
 85243  }
 85244  
 85245  var _indexColumnNotNullØ00__func__Ø000 [19]int8
 85246  
 85247  func init() {
 85248  	crt.Xstrncpy(nil, &_indexColumnNotNullØ00__func__Ø000[0], str(104813), 19)
 85249  }
 85250  
 85251  // C comment
 85252  //  /*
 85253  //  ** Most queries use only a single table (they are not joins) and have
 85254  //  ** simple == constraints against indexed fields.  This routine attempts
 85255  //  ** to plan those simple cases using much less ceremony than the
 85256  //  ** general-purpose query planner, and thereby yield faster sqlite3_prepare()
 85257  //  ** times for the common case.
 85258  //  **
 85259  //  ** Return non-zero on success, if this query can be handled by this
 85260  //  ** no-frills query planner.  Return zero if this query needs the
 85261  //  ** general-purpose query planner.
 85262  //  */
 85263  func _whereShortCut(tls *crt.TLS, _pBuilder *XWhereLoopBuilder) (r0 int32) {
 85264  	var _iCur, _j, _3_opMask int32
 85265  	var _pTab *XTable
 85266  	var _pItem *TSrcList_item
 85267  	var _pIdx *XIndex
 85268  	var _pWInfo *XWhereInfo
 85269  	var _pLoop *XWhereLoop
 85270  	var _pTerm *XWhereTerm
 85271  	var _pWC *XWhereClause
 85272  	_pWInfo = (*XWhereInfo)(_pBuilder.XpWInfo)
 85273  	if (int32(_pWInfo.XwctrlFlags) & int32(32)) != 0 {
 85274  		return int32(0)
 85275  	}
 85276  	func() {
 85277  		if ((*XSrcList)(_pWInfo.XpTabList).XnSrc) < int32(1) {
 85278  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134607), unsafe.Pointer(&_whereShortCutØ00__func__Ø000), unsafe.Pointer(str(104832)))
 85279  			crt.X__builtin_abort(tls)
 85280  		}
 85281  	}()
 85282  	_pItem = (*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.XpTabList).Xa)))
 85283  	_pTab = (*XTable)(_pItem.XpTab)
 85284  	if _pTab.XnModuleArg != 0 {
 85285  		return int32(0)
 85286  	}
 85287  	if ((uint32((_pItem.Xfg.XnotIndexed)>>1) << 31) >> 31) != 0 {
 85288  		return int32(0)
 85289  	}
 85290  	_iCur = _pItem.XiCursor
 85291  	_pWC = &_pWInfo.XsWC
 85292  	_pLoop = (*XWhereLoop)(_pBuilder.XpNew)
 85293  	_pLoop.XwsFlags = 0
 85294  	_pLoop.XnSkip = 0
 85295  	_pTerm = _sqlite3WhereFindTerm(tls, _pWC, _iCur, int32(-1), 0, uint32(130), nil)
 85296  	if _pTerm != nil {
 85297  		_pLoop.XwsFlags = uint32(4353)
 85298  		*elem104((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), 0) = _pTerm
 85299  		_pLoop.XnLTerm = uint16(1)
 85300  		(*t101)(unsafe.Pointer(&_pLoop.Xu)).XnEq = uint16(1)
 85301  		_pLoop.XrRun = int16(33)
 85302  		goto _6
 85303  	}
 85304  	_pIdx = (*XIndex)(_pTab.XpIndex)
 85305  _7:
 85306  	if _pIdx == nil {
 85307  		goto _10
 85308  	}
 85309  	func() {
 85310  		if (**XWhereTerm)(unsafe.Pointer(&_pLoop.XaLTermSpace)) != (**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)) {
 85311  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134629), unsafe.Pointer(&_whereShortCutØ00__func__Ø000), unsafe.Pointer(str(104858)))
 85312  			crt.X__builtin_abort(tls)
 85313  		}
 85314  	}()
 85315  	if ((int32(_pIdx.XonError) == int32(0)) || ((*XExpr)(_pIdx.XpPartIdxWhere) != nil)) || (int32(_pIdx.XnKeyCol) > int32(3)) {
 85316  		goto _8
 85317  	}
 85318  	_3_opMask = func() int32 {
 85319  		if ((uint32(_pIdx.XidxType>>3) << 31) >> 31) != 0 {
 85320  			return int32(130)
 85321  		}
 85322  		return int32(2)
 85323  	}()
 85324  	_j = int32(0)
 85325  _18:
 85326  	if _j >= int32(_pIdx.XnKeyCol) {
 85327  		goto _21
 85328  	}
 85329  	_pTerm = _sqlite3WhereFindTerm(tls, _pWC, _iCur, _j, 0, uint32(_3_opMask), _pIdx)
 85330  	if _pTerm == nil {
 85331  		goto _21
 85332  	}
 85333  	*elem104((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(_j)) = _pTerm
 85334  	_j += 1
 85335  	goto _18
 85336  _21:
 85337  	if _j != int32(_pIdx.XnKeyCol) {
 85338  		goto _8
 85339  	}
 85340  	_pLoop.XwsFlags = uint32(4609)
 85341  	if (((uint32(_pIdx.XidxType>>5) << 31) >> 31) != 0) || ((_pItem.XcolUsed & (^_columnsInIndex(tls, _pIdx))) == (0)) {
 85342  		_pLoop.XwsFlags |= uint32(64)
 85343  	}
 85344  	_pLoop.XnLTerm = uint16(_j)
 85345  	(*t101)(unsafe.Pointer(&_pLoop.Xu)).XnEq = uint16(_j)
 85346  	*(**XIndex)(unsafe.Pointer(&((*t101)(unsafe.Pointer(&_pLoop.Xu)).XpIndex))) = _pIdx
 85347  	_pLoop.XrRun = int16(39)
 85348  	goto _10
 85349  _8:
 85350  	_pIdx = (*XIndex)(_pIdx.XpNext)
 85351  	goto _7
 85352  _10:
 85353  _6:
 85354  	if _pLoop.XwsFlags == 0 {
 85355  		goto _26
 85356  	}
 85357  	_pLoop.XnOut = int16(1)
 85358  	*(**XWhereLoop)(unsafe.Pointer(&(elem99((*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa)), 0).XpWLoop))) = _pLoop
 85359  	func() {
 85360  		if (_pWInfo.XsMaskSet.Xn) != int32(1) || _iCur != (*elem8((*int32)(unsafe.Pointer(&(_pWInfo.XsMaskSet.Xix))), 0)) {
 85361  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134657), unsafe.Pointer(&_whereShortCutØ00__func__Ø000), unsafe.Pointer(str(104892)))
 85362  			crt.X__builtin_abort(tls)
 85363  		}
 85364  	}()
 85365  	_pLoop.XmaskSelf = uint64(1)
 85366  	elem99((*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa)), 0).XiTabCur = _iCur
 85367  	_pWInfo.XnRowOut = int16(1)
 85368  	if _pWInfo.XpOrderBy != nil {
 85369  		_pWInfo.XnOBSat = int8((*XExprList)(_pWInfo.XpOrderBy).XnExpr)
 85370  	}
 85371  	if (int32(_pWInfo.XwctrlFlags) & int32(256)) != 0 {
 85372  		_pWInfo.XeDistinct = uint8(1)
 85373  	}
 85374  	_pLoop.XcId = int8(48)
 85375  	return int32(1)
 85376  
 85377  _26:
 85378  	return int32(0)
 85379  }
 85380  
 85381  var _whereShortCutØ00__func__Ø000 [14]int8
 85382  
 85383  func init() {
 85384  	crt.Xstrncpy(nil, &_whereShortCutØ00__func__Ø000[0], str(104946), 14)
 85385  }
 85386  
 85387  // C comment
 85388  //  /*
 85389  //  ** Return a bitmask where 1s indicate that the corresponding column of
 85390  //  ** the table is used by an index.  Only the first 63 columns are considered.
 85391  //  */
 85392  func _columnsInIndex(tls *crt.TLS, _pIdx *XIndex) (r0 uint64) {
 85393  	var _j, _1_x int32
 85394  	var _m uint64
 85395  	_m = uint64(0)
 85396  	_j = int32(_pIdx.XnColumn) - int32(1)
 85397  _0:
 85398  	if _j < int32(0) {
 85399  		goto _3
 85400  	}
 85401  	_1_x = int32(*elem50(_pIdx.XaiColumn, uintptr(_j)))
 85402  	if _1_x < int32(0) {
 85403  		goto _4
 85404  	}
 85405  	if _1_x < int32(63) {
 85406  		_m |= uint64(1) << uint(_1_x)
 85407  	}
 85408  _4:
 85409  	_j -= 1
 85410  	goto _0
 85411  _3:
 85412  	return _m
 85413  }
 85414  
 85415  // C comment
 85416  //  /*
 85417  //  ** Add all WhereLoop objects for all tables
 85418  //  */
 85419  func _whereLoopAddAll(tls *crt.TLS, _pBuilder *XWhereLoopBuilder) (r0 int32) {
 85420  	var _iTab, _rc int32
 85421  	var _mPrereq, _mPrior, _1_mUnusable uint64
 85422  	var _priorJointype uint8
 85423  	var _db *Xsqlite3
 85424  	var _pTabList *XSrcList
 85425  	var _pItem, _pEnd, _3_p *TSrcList_item
 85426  	var _pWInfo *XWhereInfo
 85427  	var _pNew *XWhereLoop
 85428  	_pWInfo = (*XWhereInfo)(_pBuilder.XpWInfo)
 85429  	_mPrereq = uint64(0)
 85430  	_mPrior = uint64(0)
 85431  	_pTabList = (*XSrcList)(_pWInfo.XpTabList)
 85432  	_pEnd = elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_pWInfo.XnLevel))
 85433  	_db = (*Xsqlite3)((*XParse)(_pWInfo.XpParse).Xdb)
 85434  	_rc = int32(0)
 85435  	_priorJointype = uint8(0)
 85436  	_pNew = (*XWhereLoop)(_pBuilder.XpNew)
 85437  	_whereLoopInit(tls, _pNew)
 85438  	*func() **TSrcList_item { _iTab = int32(0); return &_pItem }() = (*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa))
 85439  _0:
 85440  	if crt.P2U(unsafe.Pointer(_pItem)) >= crt.P2U(unsafe.Pointer(_pEnd)) {
 85441  		goto _3
 85442  	}
 85443  	_1_mUnusable = 0
 85444  	_pNew.XiTab = uint8(_iTab)
 85445  	_pNew.XmaskSelf = _sqlite3WhereGetMask(tls, &_pWInfo.XsMaskSet, _pItem.XiCursor)
 85446  	if ((int32(_pItem.Xfg.Xjointype) | int32(_priorJointype)) & int32(10)) != int32(0) {
 85447  		_mPrereq = _mPrior
 85448  	}
 85449  	_priorJointype = _pItem.Xfg.Xjointype
 85450  	if ((*XTable)(_pItem.XpTab).XnModuleArg) == 0 {
 85451  		goto _5
 85452  	}
 85453  	_3_p = elem6(_pItem, uintptr(1))
 85454  _6:
 85455  	if crt.P2U(unsafe.Pointer(_3_p)) >= crt.P2U(unsafe.Pointer(_pEnd)) {
 85456  		goto _9
 85457  	}
 85458  	if (_1_mUnusable != 0) || (int32(_3_p.Xfg.Xjointype)&int32(10)) != 0 {
 85459  		_1_mUnusable |= _sqlite3WhereGetMask(tls, &_pWInfo.XsMaskSet, _3_p.XiCursor)
 85460  	}
 85461  	*(*uintptr)(unsafe.Pointer(&_3_p)) += uintptr(68)
 85462  	goto _6
 85463  _9:
 85464  	_rc = _whereLoopAddVirtual(tls, _pBuilder, _mPrereq, _1_mUnusable)
 85465  	goto _12
 85466  _5:
 85467  	_rc = _whereLoopAddBtree(tls, _pBuilder, _mPrereq)
 85468  _12:
 85469  	if _rc == int32(0) {
 85470  		_rc = _whereLoopAddOr(tls, _pBuilder, _mPrereq, _1_mUnusable)
 85471  	}
 85472  	_mPrior |= _pNew.XmaskSelf
 85473  	if _rc != 0 || (_db.XmallocFailed != 0) {
 85474  		goto _3
 85475  	}
 85476  	*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _iTab += 1; return &_pItem }())) += uintptr(68)
 85477  	goto _0
 85478  _3:
 85479  	_whereLoopClear(tls, _db, _pNew)
 85480  	return _rc
 85481  }
 85482  
 85483  // C comment
 85484  //  /*
 85485  //  ** Add all WhereLoop objects for a table of the join identified by
 85486  //  ** pBuilder->pNew->iTab.  That table is guaranteed to be a virtual table.
 85487  //  **
 85488  //  ** If there are no LEFT or CROSS JOIN joins in the query, both mPrereq and
 85489  //  ** mUnusable are set to 0. Otherwise, mPrereq is a mask of all FROM clause
 85490  //  ** entries that occur before the virtual table in the FROM clause and are
 85491  //  ** separated from it by at least one LEFT or CROSS JOIN. Similarly, the
 85492  //  ** mUnusable mask contains all FROM clause entries that occur after the
 85493  //  ** virtual table and are separated from it by at least one LEFT or
 85494  //  ** CROSS JOIN.
 85495  //  **
 85496  //  ** For example, if the query were:
 85497  //  **
 85498  //  **   ... FROM t1, t2 LEFT JOIN t3, t4, vt CROSS JOIN t5, t6;
 85499  //  **
 85500  //  ** then mPrereq corresponds to (t1, t2) and mUnusable to (t5, t6).
 85501  //  **
 85502  //  ** All the tables in mPrereq must be scanned before the current virtual
 85503  //  ** table. So any terms for which all prerequisites are satisfied by
 85504  //  ** mPrereq may be specified as "usable" in all calls to xBestIndex.
 85505  //  ** Conversely, all tables in mUnusable must be scanned after the current
 85506  //  ** virtual table, so any terms for which the prerequisites overlap with
 85507  //  ** mUnusable should always be configured as "not-usable" for xBestIndex.
 85508  //  */
 85509  func _whereLoopAddVirtual(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _mPrereq uint64, _mUnusable uint64) (r0 int32) {
 85510  	var _rc, _nConstraint, _bIn, _2_seenZero, _2_seenZeroNoIN, _5_i int32
 85511  	var _mBest, _2_mPrev, _2_mBestNoIn, _5_mNext, _6_mThis uint64
 85512  	var _mNoOmit uint16
 85513  	var _pSrc *TSrcList_item
 85514  	var _pParse *XParse
 85515  	var _pWInfo *XWhereInfo
 85516  	var _p *Xsqlite3_index_info
 85517  	var _pNew *XWhereLoop
 85518  	var _pWC *XWhereClause
 85519  	_rc = int32(0)
 85520  	func() {
 85521  		if (_mPrereq & _mUnusable) != (0) {
 85522  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133550), unsafe.Pointer(&_whereLoopAddVirtualØ00__func__Ø000), unsafe.Pointer(str(104960)))
 85523  			crt.X__builtin_abort(tls)
 85524  		}
 85525  	}()
 85526  	_pWInfo = (*XWhereInfo)(_pBuilder.XpWInfo)
 85527  	_pParse = (*XParse)(_pWInfo.XpParse)
 85528  	_pWC = (*XWhereClause)(_pBuilder.XpWC)
 85529  	_pNew = (*XWhereLoop)(_pBuilder.XpNew)
 85530  	_pSrc = elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.XpTabList).Xa))), uintptr(_pNew.XiTab))
 85531  	func() {
 85532  		if ((*XTable)(_pSrc.XpTab).XnModuleArg) == 0 {
 85533  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133556), unsafe.Pointer(&_whereLoopAddVirtualØ00__func__Ø000), unsafe.Pointer(str(104985)))
 85534  			crt.X__builtin_abort(tls)
 85535  		}
 85536  	}()
 85537  	_p = _allocateIndexInfo(tls, _pParse, _pWC, _mUnusable, _pSrc, (*XExprList)(_pBuilder.XpOrderBy), &_mNoOmit)
 85538  	if _p == nil {
 85539  		return _sqlite3NomemError(tls, int32(133559))
 85540  	}
 85541  	_pNew.XrSetup = 0
 85542  	_pNew.XwsFlags = uint32(1024)
 85543  	_pNew.XnLTerm = 0
 85544  	(*t105)(unsafe.Pointer(&_pNew.Xu)).XneedFree = 0
 85545  	_nConstraint = _p.XnConstraint
 85546  	if _whereLoopResize(tls, (*Xsqlite3)(_pParse.Xdb), _pNew, _nConstraint) != 0 {
 85547  		_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.Xdb), unsafe.Pointer(_p))
 85548  		return _sqlite3NomemError(tls, int32(133567))
 85549  	}
 85550  	_rc = _whereLoopAddVirtualOne(tls, _pBuilder, _mPrereq, uint64(18446744073709551615), 0, _p, _mNoOmit, &_bIn)
 85551  	if _rc != int32(0) || store85(&_mBest, _pNew.Xprereq&(^_mPrereq)) == (0) {
 85552  		goto _7
 85553  	}
 85554  	_2_seenZero = int32(0)
 85555  	_2_seenZeroNoIN = int32(0)
 85556  	_2_mPrev = uint64(0)
 85557  	_2_mBestNoIn = uint64(0)
 85558  	if _bIn == 0 {
 85559  		goto _8
 85560  	}
 85561  	_rc = _whereLoopAddVirtualOne(tls, _pBuilder, _mPrereq, uint64(18446744073709551615), uint16(1), _p, _mNoOmit, &_bIn)
 85562  	func() {
 85563  		if _bIn != int32(0) {
 85564  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133591), unsafe.Pointer(&_whereLoopAddVirtualØ00__func__Ø000), unsafe.Pointer(str(105007)))
 85565  			crt.X__builtin_abort(tls)
 85566  		}
 85567  	}()
 85568  	_2_mBestNoIn = _pNew.Xprereq & (^_mPrereq)
 85569  	if _2_mBestNoIn == (0) {
 85570  		_2_seenZero = int32(1)
 85571  		_2_seenZeroNoIN = int32(1)
 85572  	}
 85573  _8:
 85574  	if _rc != int32(0) {
 85575  		goto _13
 85576  	}
 85577  	_5_mNext = uint64(18446744073709551615)
 85578  	func() {
 85579  		if _5_mNext <= (0) {
 85580  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133604), unsafe.Pointer(&_whereLoopAddVirtualØ00__func__Ø000), unsafe.Pointer(str(105014)))
 85581  			crt.X__builtin_abort(tls)
 85582  		}
 85583  	}()
 85584  	_5_i = int32(0)
 85585  _16:
 85586  	if _5_i >= _nConstraint {
 85587  		goto _19
 85588  	}
 85589  	_6_mThis = (elem100((*XWhereTerm)(_pWC.Xa), uintptr(elem106((*Tsqlite3_index_constraint)(_p.XaConstraint), uintptr(_5_i)).XiTermOffset)).XprereqRight) & (^_mPrereq)
 85590  	if (_6_mThis > _2_mPrev) && (_6_mThis < _5_mNext) {
 85591  		_5_mNext = _6_mThis
 85592  	}
 85593  	_5_i += 1
 85594  	goto _16
 85595  _19:
 85596  	_2_mPrev = _5_mNext
 85597  	if _5_mNext == uint64(18446744073709551615) {
 85598  		goto _13
 85599  	}
 85600  	if (_5_mNext == _mBest) || (_5_mNext == _2_mBestNoIn) {
 85601  		goto _8
 85602  	}
 85603  	_rc = _whereLoopAddVirtualOne(tls, _pBuilder, _mPrereq, _5_mNext|_mPrereq, 0, _p, _mNoOmit, &_bIn)
 85604  	if _pNew.Xprereq != _mPrereq {
 85605  		goto _25
 85606  	}
 85607  	_2_seenZero = int32(1)
 85608  	if _bIn == int32(0) {
 85609  		_2_seenZeroNoIN = int32(1)
 85610  	}
 85611  _25:
 85612  	goto _8
 85613  _13:
 85614  	if _rc != int32(0) || _2_seenZero != int32(0) {
 85615  		goto _28
 85616  	}
 85617  	_rc = _whereLoopAddVirtualOne(tls, _pBuilder, _mPrereq, _mPrereq, 0, _p, _mNoOmit, &_bIn)
 85618  	if _bIn == int32(0) {
 85619  		_2_seenZeroNoIN = int32(1)
 85620  	}
 85621  _28:
 85622  	if (_rc == int32(0)) && (_2_seenZeroNoIN == int32(0)) {
 85623  		_rc = _whereLoopAddVirtualOne(tls, _pBuilder, _mPrereq, _mPrereq, uint16(1), _p, _mNoOmit, &_bIn)
 85624  	}
 85625  _7:
 85626  	if _p.XneedToFreeIdxStr != 0 {
 85627  		Xsqlite3_free(tls, unsafe.Pointer(_p.XidxStr))
 85628  	}
 85629  	_sqlite3DbFreeNN(tls, (*Xsqlite3)(_pParse.Xdb), unsafe.Pointer(_p))
 85630  	return _rc
 85631  }
 85632  
 85633  var _whereLoopAddVirtualØ00__func__Ø000 [20]int8
 85634  
 85635  func init() {
 85636  	crt.Xstrncpy(nil, &_whereLoopAddVirtualØ00__func__Ø000[0], str(105022), 20)
 85637  }
 85638  
 85639  // C comment
 85640  //  /*
 85641  //  ** Allocate and populate an sqlite3_index_info structure. It is the
 85642  //  ** responsibility of the caller to eventually release the structure
 85643  //  ** by passing the pointer returned by this function to sqlite3_free().
 85644  //  */
 85645  func _allocateIndexInfo(tls *crt.TLS, _pParse *XParse, _pWC *XWhereClause, _mUnusable uint64, _pSrc *TSrcList_item, _pOrderBy *XExprList, _pmNoOmit *uint16) (r0 *Xsqlite3_index_info) {
 85646  	var _i, _j, _nTerm, _nOrderBy, _2_n int32
 85647  	var _mNoOmit uint16
 85648  	var _6_op uint8
 85649  	var _3_pExpr, _9_pExpr *XExpr
 85650  	var _pIdxInfo *Xsqlite3_index_info
 85651  	var _pIdxCons *Tsqlite3_index_constraint
 85652  	var _pUsage *Tsqlite3_index_constraint_usage
 85653  	var _pTerm *XWhereTerm
 85654  	var _pIdxOrderBy *Tsqlite3_index_orderby
 85655  	_mNoOmit = uint16(0)
 85656  	*func() **XWhereTerm { _i = store2(&_nTerm, int32(0)); return &_pTerm }() = (*XWhereTerm)(_pWC.Xa)
 85657  _0:
 85658  	if _i >= _pWC.XnTerm {
 85659  		goto _3
 85660  	}
 85661  	if _pTerm.XleftCursor != _pSrc.XiCursor {
 85662  		goto _1
 85663  	}
 85664  	if (_pTerm.XprereqRight & _mUnusable) != 0 {
 85665  		goto _1
 85666  	}
 85667  	func() {
 85668  		if ((int32(_pTerm.XeOperator) & int32(-2049)) & ((int32(_pTerm.XeOperator) & int32(-2049)) - int32(1))) != int32(0) {
 85669  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131246), unsafe.Pointer(&_allocateIndexInfoØ00__func__Ø000), unsafe.Pointer(str(105042)))
 85670  			crt.X__builtin_abort(tls)
 85671  		}
 85672  	}()
 85673  	if (int32(_pTerm.XeOperator) & int32(-2433)) == int32(0) {
 85674  		goto _1
 85675  	}
 85676  	if (int32(_pTerm.XwtFlags) & int32(0)) != 0 {
 85677  		goto _1
 85678  	}
 85679  	func() {
 85680  		if (*(*int32)(unsafe.Pointer(&_pTerm.Xu))) < int32(-1) {
 85681  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131253), unsafe.Pointer(&_allocateIndexInfoØ00__func__Ø000), unsafe.Pointer(str(105085)))
 85682  			crt.X__builtin_abort(tls)
 85683  		}
 85684  	}()
 85685  	_nTerm += 1
 85686  _1:
 85687  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i += 1; return &_pTerm }())) += uintptr(48)
 85688  	goto _0
 85689  _3:
 85690  	_nOrderBy = int32(0)
 85691  	if _pOrderBy == nil {
 85692  		goto _12
 85693  	}
 85694  	_2_n = _pOrderBy.XnExpr
 85695  	_i = int32(0)
 85696  _13:
 85697  	if _i >= _2_n {
 85698  		goto _16
 85699  	}
 85700  	_3_pExpr = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_i)).XpExpr)
 85701  	if (int32(_3_pExpr.Xop) != int32(152)) || (_3_pExpr.XiTable != _pSrc.XiCursor) {
 85702  		goto _16
 85703  	}
 85704  	_i += 1
 85705  	goto _13
 85706  _16:
 85707  	if _i == _2_n {
 85708  		_nOrderBy = _2_n
 85709  	}
 85710  _12:
 85711  	_pIdxInfo = (*Xsqlite3_index_info)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pParse.Xdb), uint64((uint32(64)+(uint32(20)*uint32(_nTerm)))+(uint32(8)*uint32(_nOrderBy)))))
 85712  	if _pIdxInfo == nil {
 85713  		_sqlite3ErrorMsg(tls, _pParse, str(59395))
 85714  		return nil
 85715  	}
 85716  	_pIdxCons = (*Tsqlite3_index_constraint)(unsafe.Pointer(elem107(_pIdxInfo, uintptr(1))))
 85717  	_pIdxOrderBy = (*Tsqlite3_index_orderby)(unsafe.Pointer(elem106(_pIdxCons, uintptr(_nTerm))))
 85718  	_pUsage = (*Tsqlite3_index_constraint_usage)(unsafe.Pointer(elem108(_pIdxOrderBy, uintptr(_nOrderBy))))
 85719  	_pIdxInfo.XnConstraint = _nTerm
 85720  	_pIdxInfo.XnOrderBy = _nOrderBy
 85721  	*(**Tsqlite3_index_constraint)(unsafe.Pointer(&_pIdxInfo.XaConstraint)) = _pIdxCons
 85722  	*(**Tsqlite3_index_orderby)(unsafe.Pointer(&_pIdxInfo.XaOrderBy)) = _pIdxOrderBy
 85723  	*(**Tsqlite3_index_constraint_usage)(unsafe.Pointer(&_pIdxInfo.XaConstraintUsage)) = _pUsage
 85724  	*func() **XWhereTerm { _i = store2(&_j, int32(0)); return &_pTerm }() = (*XWhereTerm)(_pWC.Xa)
 85725  _21:
 85726  	if _i >= _pWC.XnTerm {
 85727  		goto _24
 85728  	}
 85729  	if _pTerm.XleftCursor != _pSrc.XiCursor {
 85730  		goto _22
 85731  	}
 85732  	if (_pTerm.XprereqRight & _mUnusable) != 0 {
 85733  		goto _22
 85734  	}
 85735  	func() {
 85736  		if ((int32(_pTerm.XeOperator) & int32(-2049)) & ((int32(_pTerm.XeOperator) & int32(-2049)) - int32(1))) != int32(0) {
 85737  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131302), unsafe.Pointer(&_allocateIndexInfoØ00__func__Ø000), unsafe.Pointer(str(105042)))
 85738  			crt.X__builtin_abort(tls)
 85739  		}
 85740  	}()
 85741  	if (int32(_pTerm.XeOperator) & int32(-2433)) == int32(0) {
 85742  		goto _22
 85743  	}
 85744  	if (int32(_pTerm.XwtFlags) & int32(0)) != 0 {
 85745  		goto _22
 85746  	}
 85747  	func() {
 85748  		if (*(*int32)(unsafe.Pointer(&_pTerm.Xu))) < int32(-1) {
 85749  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131309), unsafe.Pointer(&_allocateIndexInfoØ00__func__Ø000), unsafe.Pointer(str(105085)))
 85750  			crt.X__builtin_abort(tls)
 85751  		}
 85752  	}()
 85753  	elem106(_pIdxCons, uintptr(_j)).XiColumn = *(*int32)(unsafe.Pointer(&_pTerm.Xu))
 85754  	elem106(_pIdxCons, uintptr(_j)).XiTermOffset = _i
 85755  	_6_op = uint8(int32(uint8(_pTerm.XeOperator)) & int32(8191))
 85756  	if int32(_6_op) == int32(1) {
 85757  		_6_op = uint8(2)
 85758  	}
 85759  	if int32(_6_op) == int32(64) {
 85760  		_6_op = _pTerm.XeMatchOp
 85761  	}
 85762  	elem106(_pIdxCons, uintptr(_j)).Xop = _6_op
 85763  
 85764  	func() {
 85765  		if (int32(_pTerm.XeOperator) & int32(127)) == 0 {
 85766  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131327), unsafe.Pointer(&_allocateIndexInfoØ00__func__Ø000), unsafe.Pointer(str(105111)))
 85767  			crt.X__builtin_abort(tls)
 85768  		}
 85769  	}()
 85770  	if (int32(_6_op)&int32(60)) == 0 || _sqlite3ExprIsVector(tls, (*XExpr)((*XExpr)(_pTerm.XpExpr).XpRight)) == 0 {
 85771  		goto _38
 85772  	}
 85773  	if _i < int32(16) {
 85774  		{
 85775  			p := &_mNoOmit
 85776  			*p = uint16(int32(*p) | (int32(1) << uint(_i)))
 85777  		}
 85778  	}
 85779  	if int32(_6_op) == int32(16) {
 85780  		elem106(_pIdxCons, uintptr(_j)).Xop = uint8(8)
 85781  	}
 85782  	if int32(_6_op) == int32(4) {
 85783  		elem106(_pIdxCons, uintptr(_j)).Xop = uint8(32)
 85784  	}
 85785  _38:
 85786  	_j += 1
 85787  _22:
 85788  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i += 1; return &_pTerm }())) += uintptr(48)
 85789  	goto _21
 85790  _24:
 85791  	_i = int32(0)
 85792  _42:
 85793  	if _i >= _nOrderBy {
 85794  		goto _45
 85795  	}
 85796  	_9_pExpr = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_i)).XpExpr)
 85797  	elem108(_pIdxOrderBy, uintptr(_i)).XiColumn = int32(_9_pExpr.XiColumn)
 85798  	elem108(_pIdxOrderBy, uintptr(_i)).Xdesc = elem57((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_i)).XsortOrder
 85799  	_i += 1
 85800  	goto _42
 85801  _45:
 85802  	*_pmNoOmit = _mNoOmit
 85803  	return _pIdxInfo
 85804  }
 85805  
 85806  var _allocateIndexInfoØ00__func__Ø000 [18]int8
 85807  
 85808  func init() {
 85809  	crt.Xstrncpy(nil, &_allocateIndexInfoØ00__func__Ø000[0], str(105177), 18)
 85810  }
 85811  
 85812  // C comment
 85813  //  /*
 85814  //  ** Increase the memory allocation for pLoop->aLTerm[] to be at least n.
 85815  //  */
 85816  func _whereLoopResize(tls *crt.TLS, _db *Xsqlite3, _p *XWhereLoop, _n int32) (r0 int32) {
 85817  	var _paNew **XWhereTerm
 85818  	if int32(_p.XnLSlot) >= _n {
 85819  		return int32(0)
 85820  	}
 85821  	_n = (_n + int32(7)) & int32(-8)
 85822  	_paNew = (**XWhereTerm)(_sqlite3DbMallocRawNN(tls, _db, uint64(uint32(4)*uint32(_n))))
 85823  	if _paNew == nil {
 85824  		return _sqlite3NomemError(tls, int32(132201))
 85825  	}
 85826  	crt.Xmemcpy(tls, unsafe.Pointer(_paNew), unsafe.Pointer(_p.XaLTerm), uint32(4)*uint32(_p.XnLSlot))
 85827  	if (**XWhereTerm)(unsafe.Pointer(_p.XaLTerm)) != (**XWhereTerm)(unsafe.Pointer(&_p.XaLTermSpace)) {
 85828  		_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_p.XaLTerm))
 85829  	}
 85830  	*(***XWhereTerm)(unsafe.Pointer(&_p.XaLTerm)) = _paNew
 85831  	_p.XnLSlot = uint16(_n)
 85832  	return int32(0)
 85833  }
 85834  
 85835  // C comment
 85836  //  /*
 85837  //  ** Argument pIdxInfo is already populated with all constraints that may
 85838  //  ** be used by the virtual table identified by pBuilder->pNew->iTab. This
 85839  //  ** function marks a subset of those constraints usable, invokes the
 85840  //  ** xBestIndex method and adds the returned plan to pBuilder.
 85841  //  **
 85842  //  ** A constraint is marked usable if:
 85843  //  **
 85844  //  **   * Argument mUsable indicates that its prerequisites are available, and
 85845  //  **
 85846  //  **   * It is not one of the operators specified in the mExclude mask passed
 85847  //  **     as the fourth argument (which in practice is either WO_IN or 0).
 85848  //  **
 85849  //  ** Argument mPrereq is a mask of tables that must be scanned before the
 85850  //  ** virtual table in question. These are added to the plans prerequisites
 85851  //  ** before it is added to pBuilder.
 85852  //  **
 85853  //  ** Output parameter *pbIn is set to true if the plan added to pBuilder
 85854  //  ** uses one or more WO_IN terms, or false otherwise.
 85855  //  */
 85856  func _whereLoopAddVirtualOne(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _mPrereq uint64, _mUsable uint64, _mExclude uint16, _pIdxInfo *Xsqlite3_index_info, _mNoOmit uint16, _pbIn *int32) (r0 int32) {
 85857  	var _i, _mxTerm, _rc, _nConstraint, _3_iTerm, _4_j int32
 85858  	var _pSrc *TSrcList_item
 85859  	var _pParse *XParse
 85860  	var _pIdxCons *Tsqlite3_index_constraint
 85861  	var _pUsage *Tsqlite3_index_constraint_usage
 85862  	var _pNew *XWhereLoop
 85863  	var _1_pTerm, _4_pTerm *XWhereTerm
 85864  	var _pWC *XWhereClause
 85865  	_pWC = (*XWhereClause)(_pBuilder.XpWC)
 85866  	_pUsage = (*Tsqlite3_index_constraint_usage)(_pIdxInfo.XaConstraintUsage)
 85867  	_rc = int32(0)
 85868  	_pNew = (*XWhereLoop)(_pBuilder.XpNew)
 85869  	_pParse = (*XParse)((*XWhereInfo)(_pBuilder.XpWInfo).XpParse)
 85870  	_pSrc = elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)((*XWhereInfo)(_pBuilder.XpWInfo).XpTabList).Xa))), uintptr(_pNew.XiTab))
 85871  	_nConstraint = _pIdxInfo.XnConstraint
 85872  	func() {
 85873  		if (_mUsable & _mPrereq) != _mPrereq {
 85874  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133399), unsafe.Pointer(&_whereLoopAddVirtualOneØ00__func__Ø000), unsafe.Pointer(str(105195)))
 85875  			crt.X__builtin_abort(tls)
 85876  		}
 85877  	}()
 85878  	*_pbIn = int32(0)
 85879  	_pNew.Xprereq = _mPrereq
 85880  	_pIdxCons = *(**Tsqlite3_index_constraint)(unsafe.Pointer(&_pIdxInfo.XaConstraint))
 85881  	_i = int32(0)
 85882  _2:
 85883  	if _i >= _nConstraint {
 85884  		goto _5
 85885  	}
 85886  	_1_pTerm = elem100((*XWhereTerm)(_pWC.Xa), uintptr(_pIdxCons.XiTermOffset))
 85887  	_pIdxCons.Xusable = 0
 85888  	if ((_1_pTerm.XprereqRight & _mUsable) == _1_pTerm.XprereqRight) && ((int32(_1_pTerm.XeOperator) & int32(_mExclude)) == int32(0)) {
 85889  		_pIdxCons.Xusable = uint8(1)
 85890  	}
 85891  	*(*uintptr)(unsafe.Pointer(func() **Tsqlite3_index_constraint { _i += 1; return &_pIdxCons }())) += uintptr(12)
 85892  	goto _2
 85893  _5:
 85894  	crt.Xmemset(tls, unsafe.Pointer(_pUsage), int32(0), uint32(8)*uint32(_nConstraint))
 85895  	func() {
 85896  		if _pIdxInfo.XneedToFreeIdxStr != int32(0) {
 85897  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133418), unsafe.Pointer(&_whereLoopAddVirtualOneØ00__func__Ø000), unsafe.Pointer(str(105224)))
 85898  			crt.X__builtin_abort(tls)
 85899  		}
 85900  	}()
 85901  	_pIdxInfo.XidxStr = nil
 85902  	_pIdxInfo.XidxNum = int32(0)
 85903  	_pIdxInfo.XorderByConsumed = int32(0)
 85904  	_pIdxInfo.XestimatedCost = float64(5e+98)
 85905  	_pIdxInfo.XestimatedRows = int64(25)
 85906  	_pIdxInfo.XidxFlags = int32(0)
 85907  	_pIdxInfo.XcolUsed = uint64(int64(_pSrc.XcolUsed))
 85908  	_rc = _vtabBestIndex(tls, _pParse, (*XTable)(_pSrc.XpTab), _pIdxInfo)
 85909  	if _rc != 0 {
 85910  		return _rc
 85911  	}
 85912  	_mxTerm = int32(-1)
 85913  	func() {
 85914  		if int32(_pNew.XnLSlot) < _nConstraint {
 85915  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133432), unsafe.Pointer(&_whereLoopAddVirtualOneØ00__func__Ø000), unsafe.Pointer(str(105254)))
 85916  			crt.X__builtin_abort(tls)
 85917  		}
 85918  	}()
 85919  	_i = int32(0)
 85920  _13:
 85921  	if _i >= _nConstraint {
 85922  		goto _16
 85923  	}
 85924  	*elem104((**XWhereTerm)(unsafe.Pointer(_pNew.XaLTerm)), uintptr(_i)) = nil
 85925  	_i += 1
 85926  	goto _13
 85927  _16:
 85928  	(*t105)(unsafe.Pointer(&_pNew.Xu)).XomitMask = 0
 85929  	_pIdxCons = *(**Tsqlite3_index_constraint)(unsafe.Pointer(&_pIdxInfo.XaConstraint))
 85930  	_i = int32(0)
 85931  _17:
 85932  	if _i >= _nConstraint {
 85933  		goto _20
 85934  	}
 85935  	if store2(&_3_iTerm, (elem96(_pUsage, uintptr(_i)).XargvIndex)-int32(1)) < int32(0) {
 85936  		goto _21
 85937  	}
 85938  	_4_j = _pIdxCons.XiTermOffset
 85939  	if ((((_3_iTerm >= _nConstraint) || (_4_j < int32(0))) || (_4_j >= _pWC.XnTerm)) || ((*elem104((**XWhereTerm)(unsafe.Pointer(_pNew.XaLTerm)), uintptr(_3_iTerm))) != nil)) || (int32(_pIdxCons.Xusable) == int32(0)) {
 85940  		_rc = int32(1)
 85941  		_sqlite3ErrorMsg(tls, _pParse, str(105280), unsafe.Pointer((*XTable)(_pSrc.XpTab).XzName))
 85942  		return _rc
 85943  	}
 85944  	_4_pTerm = elem100((*XWhereTerm)(_pWC.Xa), uintptr(_4_j))
 85945  	_pNew.Xprereq |= _4_pTerm.XprereqRight
 85946  	func() {
 85947  		if _3_iTerm >= int32(_pNew.XnLSlot) {
 85948  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133456), unsafe.Pointer(&_whereLoopAddVirtualOneØ00__func__Ø000), unsafe.Pointer(str(105306)))
 85949  			crt.X__builtin_abort(tls)
 85950  		}
 85951  	}()
 85952  	*elem104((**XWhereTerm)(unsafe.Pointer(_pNew.XaLTerm)), uintptr(_3_iTerm)) = _4_pTerm
 85953  	if _3_iTerm > _mxTerm {
 85954  		_mxTerm = _3_iTerm
 85955  	}
 85956  	if (_3_iTerm < int32(16)) && ((elem96(_pUsage, uintptr(_i)).Xomit) != 0) {
 85957  		{
 85958  			p := &((*t105)(unsafe.Pointer(&_pNew.Xu)).XomitMask)
 85959  			*p = uint16(int32(*p) | (int32(1) << uint(_3_iTerm)))
 85960  		}
 85961  	}
 85962  	if (int32(_4_pTerm.XeOperator) & int32(1)) != int32(0) {
 85963  		_pIdxInfo.XorderByConsumed = int32(0)
 85964  		_pIdxInfo.XidxFlags &= int32(-2)
 85965  		*_pbIn = int32(1)
 85966  		func() {
 85967  			if (int32(_mExclude) & int32(1)) != int32(0) {
 85968  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133470), unsafe.Pointer(&_whereLoopAddVirtualOneØ00__func__Ø000), unsafe.Pointer(str(105325)))
 85969  				crt.X__builtin_abort(tls)
 85970  			}
 85971  		}()
 85972  	}
 85973  _21:
 85974  	*(*uintptr)(unsafe.Pointer(func() **Tsqlite3_index_constraint { _i += 1; return &_pIdxCons }())) += uintptr(12)
 85975  	goto _17
 85976  _20:
 85977  	{
 85978  		p := &((*t105)(unsafe.Pointer(&_pNew.Xu)).XomitMask)
 85979  		*p = uint16(int32(*p) & (^int32(_mNoOmit)))
 85980  	}
 85981  	_pNew.XnLTerm = uint16(_mxTerm + int32(1))
 85982  	func() {
 85983  		if int32(_pNew.XnLTerm) > int32(_pNew.XnLSlot) {
 85984  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133477), unsafe.Pointer(&_whereLoopAddVirtualOneØ00__func__Ø000), unsafe.Pointer(str(105347)))
 85985  			crt.X__builtin_abort(tls)
 85986  		}
 85987  	}()
 85988  	(*t105)(unsafe.Pointer(&_pNew.Xu)).XidxNum = _pIdxInfo.XidxNum
 85989  	(*t105)(unsafe.Pointer(&_pNew.Xu)).XneedFree = uint8(_pIdxInfo.XneedToFreeIdxStr)
 85990  	_pIdxInfo.XneedToFreeIdxStr = int32(0)
 85991  	(*t105)(unsafe.Pointer(&_pNew.Xu)).XidxStr = _pIdxInfo.XidxStr
 85992  	(*t105)(unsafe.Pointer(&_pNew.Xu)).XisOrdered = int8(func() int32 {
 85993  		if _pIdxInfo.XorderByConsumed != 0 {
 85994  			return _pIdxInfo.XnOrderBy
 85995  		}
 85996  		return int32(0)
 85997  	}())
 85998  	_pNew.XrSetup = 0
 85999  	_pNew.XrRun = _sqlite3LogEstFromDouble(tls, _pIdxInfo.XestimatedCost)
 86000  	_pNew.XnOut = _sqlite3LogEst(tls, uint64(_pIdxInfo.XestimatedRows))
 86001  	if (_pIdxInfo.XidxFlags & int32(1)) != 0 {
 86002  		_pNew.XwsFlags |= uint32(4096)
 86003  		goto _40
 86004  	}
 86005  	_pNew.XwsFlags &= uint32(4294963199)
 86006  _40:
 86007  	_rc = _whereLoopInsert(tls, _pBuilder, _pNew)
 86008  	if ((*t105)(unsafe.Pointer(&_pNew.Xu)).XneedFree) != 0 {
 86009  		Xsqlite3_free(tls, unsafe.Pointer((*t105)(unsafe.Pointer(&_pNew.Xu)).XidxStr))
 86010  		(*t105)(unsafe.Pointer(&_pNew.Xu)).XneedFree = 0
 86011  	}
 86012  	return _rc
 86013  }
 86014  
 86015  var _whereLoopAddVirtualOneØ00__func__Ø000 [23]int8
 86016  
 86017  func init() {
 86018  	crt.Xstrncpy(nil, &_whereLoopAddVirtualOneØ00__func__Ø000[0], str(105374), 23)
 86019  }
 86020  
 86021  // C comment
 86022  //  /*
 86023  //  ** The table object reference passed as the second argument to this function
 86024  //  ** must represent a virtual table. This function invokes the xBestIndex()
 86025  //  ** method of the virtual table with the sqlite3_index_info object that
 86026  //  ** comes in as the 3rd argument to this function.
 86027  //  **
 86028  //  ** If an error occurs, pParse is populated with an error message and a
 86029  //  ** non-zero value is returned. Otherwise, 0 is returned and the output
 86030  //  ** part of the sqlite3_index_info structure is left populated.
 86031  //  **
 86032  //  ** Whether or not an error is returned, it is the responsibility of the
 86033  //  ** caller to eventually free p->idxStr if p->needToFreeIdxStr indicates
 86034  //  ** that this is required.
 86035  //  */
 86036  func _vtabBestIndex(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _p *Xsqlite3_index_info) (r0 int32) {
 86037  	var _rc int32
 86038  	var _pVtab *Xsqlite3_vtab
 86039  	_pVtab = (*Xsqlite3_vtab)(_sqlite3GetVTable(tls, (*Xsqlite3)(_pParse.Xdb), _pTab).XpVtab)
 86040  	_rc = func() func(*crt.TLS, *Xsqlite3_vtab, *Xsqlite3_index_info) int32 {
 86041  		v := (*Xsqlite3_module)(_pVtab.XpModule).XxBestIndex
 86042  		return *(*func(*crt.TLS, *Xsqlite3_vtab, *Xsqlite3_index_info) int32)(unsafe.Pointer(&v))
 86043  	}()(tls, _pVtab, _p)
 86044  	if _rc == int32(0) {
 86045  		goto _0
 86046  	}
 86047  	if _rc == int32(7) {
 86048  		_sqlite3OomFault(tls, (*Xsqlite3)(_pParse.Xdb))
 86049  		goto _4
 86050  	}
 86051  	if _pVtab.XzErrMsg == nil {
 86052  		_sqlite3ErrorMsg(tls, _pParse, str(24531), unsafe.Pointer(_sqlite3ErrStr(tls, _rc)))
 86053  		goto _4
 86054  	}
 86055  	_sqlite3ErrorMsg(tls, _pParse, str(24531), unsafe.Pointer(_pVtab.XzErrMsg))
 86056  _4:
 86057  _0:
 86058  	Xsqlite3_free(tls, unsafe.Pointer(_pVtab.XzErrMsg))
 86059  	_pVtab.XzErrMsg = nil
 86060  	return _pParse.XnErr
 86061  }
 86062  
 86063  // C comment
 86064  //  /*
 86065  //  ** Convert a double into a LogEst
 86066  //  ** In other words, compute an approximation for 10*log2(x).
 86067  //  */
 86068  func _sqlite3LogEstFromDouble(tls *crt.TLS, _x float64) (r0 int16) {
 86069  	var _e int16
 86070  	var _a uint64
 86071  
 86072  	if _x <= (1) {
 86073  		return 0
 86074  	}
 86075  	if _x <= (2e+09) {
 86076  		return _sqlite3LogEst(tls, uint64(_x))
 86077  	}
 86078  	crt.Xmemcpy(tls, unsafe.Pointer(&_a), unsafe.Pointer(&_x), uint32(8))
 86079  	_e = int16((_a >> 52) - uint64(1022))
 86080  	return int16(int32(_e) * int32(10))
 86081  }
 86082  
 86083  // C comment
 86084  //  /*
 86085  //  ** Insert or replace a WhereLoop entry using the template supplied.
 86086  //  **
 86087  //  ** An existing WhereLoop entry might be overwritten if the new template
 86088  //  ** is better and has fewer dependencies.  Or the template will be ignored
 86089  //  ** and no insert will occur if an existing WhereLoop is faster and has
 86090  //  ** fewer dependencies than the template.  Otherwise a new WhereLoop is
 86091  //  ** added based on the template.
 86092  //  **
 86093  //  ** If pBuilder->pOrSet is not NULL then we care about only the
 86094  //  ** prerequisites and rRun and nOut costs of the N best loops.  That
 86095  //  ** information is gathered in the pBuilder->pOrSet object.  This special
 86096  //  ** processing mode is used only for OR clause processing.
 86097  //  **
 86098  //  ** When accumulating multiple loops (when pBuilder->pOrSet is NULL) we
 86099  //  ** still might overwrite similar loops with the new template if the
 86100  //  ** new template is better.  Loops may be overwritten if the following
 86101  //  ** conditions are met:
 86102  //  **
 86103  //  **    (1)  They have the same iTab.
 86104  //  **    (2)  They have the same iSortIdx.
 86105  //  **    (3)  The template has same or fewer dependencies than the current loop
 86106  //  **    (4)  The template has the same or lower cost than the current loop
 86107  //  */
 86108  func _whereLoopInsert(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _pTemplate *XWhereLoop) (r0 int32) {
 86109  	var _rc int32
 86110  	var _db *Xsqlite3
 86111  	var _8_pIndex *XIndex
 86112  	var _pWInfo *XWhereInfo
 86113  	var _p, _6_pToDel *XWhereLoop
 86114  	var _ppPrev, _6_ppTail **XWhereLoop
 86115  	_pWInfo = (*XWhereInfo)(_pBuilder.XpWInfo)
 86116  	_db = (*Xsqlite3)((*XParse)(_pWInfo.XpParse).Xdb)
 86117  	if (*XWhereOrSet)(_pBuilder.XpOrSet) == nil {
 86118  		goto _0
 86119  	}
 86120  	if _pTemplate.XnLTerm != 0 {
 86121  		_whereOrInsert(tls, (*XWhereOrSet)(_pBuilder.XpOrSet), _pTemplate.Xprereq, _pTemplate.XrRun, _pTemplate.XnOut)
 86122  	}
 86123  	return int32(0)
 86124  
 86125  _0:
 86126  	_whereLoopAdjustCost(tls, (*XWhereLoop)(_pWInfo.XpLoops), _pTemplate)
 86127  	_ppPrev = _whereLoopFindLesser(tls, (**XWhereLoop)(unsafe.Pointer(&_pWInfo.XpLoops)), _pTemplate)
 86128  	if _ppPrev == nil {
 86129  		return int32(0)
 86130  	}
 86131  	_p = *_ppPrev
 86132  	if _p != nil {
 86133  		goto _4
 86134  	}
 86135  	*_ppPrev = store109(&_p, (*XWhereLoop)(_sqlite3DbMallocRawNN(tls, _db, uint64(72))))
 86136  	if _p == nil {
 86137  		return _sqlite3NomemError(tls, int32(132499))
 86138  	}
 86139  	_whereLoopInit(tls, _p)
 86140  	*(**XWhereLoop)(unsafe.Pointer(&_p.XpNextLoop)) = nil
 86141  	goto _6
 86142  _4:
 86143  	_6_ppTail = (**XWhereLoop)(unsafe.Pointer(&_p.XpNextLoop))
 86144  _7:
 86145  	if (*_6_ppTail) == nil {
 86146  		goto _8
 86147  	}
 86148  	_6_ppTail = _whereLoopFindLesser(tls, _6_ppTail, _pTemplate)
 86149  	if _6_ppTail == nil {
 86150  		goto _8
 86151  	}
 86152  	_6_pToDel = *_6_ppTail
 86153  	if _6_pToDel == nil {
 86154  		goto _8
 86155  	}
 86156  	*_6_ppTail = (*XWhereLoop)(_6_pToDel.XpNextLoop)
 86157  	_whereLoopDelete(tls, _db, _6_pToDel)
 86158  	goto _7
 86159  _8:
 86160  _6:
 86161  	_rc = _whereLoopXfer(tls, _db, _p, _pTemplate)
 86162  	if (_p.XwsFlags & uint32(1024)) != (0) {
 86163  		goto _11
 86164  	}
 86165  	_8_pIndex = (*XIndex)((*t101)(unsafe.Pointer(&_p.Xu)).XpIndex)
 86166  	if (_8_pIndex != nil) && (_8_pIndex.Xtnum == int32(0)) {
 86167  		*(**XIndex)(unsafe.Pointer(&((*t101)(unsafe.Pointer(&_p.Xu)).XpIndex))) = nil
 86168  	}
 86169  _11:
 86170  	return _rc
 86171  }
 86172  
 86173  // C comment
 86174  //  /*
 86175  //  ** Try to insert a new prerequisite/cost entry into the WhereOrSet pSet.
 86176  //  **
 86177  //  ** The new entry might overwrite an existing entry, or it might be
 86178  //  ** appended, or it might be discarded.  Do whatever is the right thing
 86179  //  ** so that pSet keeps the N_OR_COST best entries seen so far.
 86180  //  */
 86181  func _whereOrInsert(tls *crt.TLS, _pSet *XWhereOrSet, _prereq uint64, _rRun int16, _nOut int16) (r0 int32) {
 86182  	var _i uint16
 86183  	var _p *XWhereOrCost
 86184  	*func() **XWhereOrCost { _i = _pSet.Xn; return &_p }() = (*XWhereOrCost)(unsafe.Pointer(&_pSet.Xa))
 86185  _0:
 86186  	if int32(_i) <= int32(0) {
 86187  		goto _3
 86188  	}
 86189  	if (int32(_rRun) <= int32(_p.XrRun)) && ((_prereq & _p.Xprereq) == _prereq) {
 86190  		goto _whereOrInsert_done
 86191  	}
 86192  	if (int32(_p.XrRun) <= int32(_rRun)) && ((_p.Xprereq & _prereq) == _p.Xprereq) {
 86193  		return int32(0)
 86194  	}
 86195  	*(*uintptr)(unsafe.Pointer(func() **XWhereOrCost { _i -= 1; return &_p }())) += uintptr(12)
 86196  	goto _0
 86197  _3:
 86198  	if int32(_pSet.Xn) < int32(3) {
 86199  		_p = elem110((*XWhereOrCost)(unsafe.Pointer(&_pSet.Xa)), uintptr(postInc76(&_pSet.Xn, uint16(1))))
 86200  		_p.XnOut = _nOut
 86201  		goto _whereOrInsert_done
 86202  	}
 86203  	_p = (*XWhereOrCost)(unsafe.Pointer(&_pSet.Xa))
 86204  	_i = uint16(1)
 86205  _10:
 86206  	if int32(_i) >= int32(_pSet.Xn) {
 86207  		goto _13
 86208  	}
 86209  	if int32(_p.XrRun) > int32(elem110((*XWhereOrCost)(unsafe.Pointer(&_pSet.Xa)), uintptr(_i)).XrRun) {
 86210  		_p = (*XWhereOrCost)(unsafe.Pointer(uintptr(unsafe.Pointer(&_pSet.Xa)) + uintptr(unsafe.Pointer((*XWhereOrCost)(unsafe.Pointer(uintptr(_i)*uintptr(unsafe.Pointer((*XWhereOrCost)(unsafe.Pointer(uintptr(12)))))))))))
 86211  	}
 86212  	_i += 1
 86213  	goto _10
 86214  _13:
 86215  	if int32(_p.XrRun) <= int32(_rRun) {
 86216  		return int32(0)
 86217  	}
 86218  _whereOrInsert_done:
 86219  	_p.Xprereq = _prereq
 86220  	_p.XrRun = _rRun
 86221  	if int32(_p.XnOut) > int32(_nOut) {
 86222  		_p.XnOut = _nOut
 86223  	}
 86224  	return int32(1)
 86225  }
 86226  
 86227  // C comment
 86228  //  /*
 86229  //  ** Try to adjust the cost of WhereLoop pTemplate upwards or downwards so
 86230  //  ** that:
 86231  //  **
 86232  //  **   (1) pTemplate costs less than any other WhereLoops that are a proper
 86233  //  **       subset of pTemplate
 86234  //  **
 86235  //  **   (2) pTemplate costs more than any other WhereLoops for which pTemplate
 86236  //  **       is a proper subset.
 86237  //  **
 86238  //  ** To say "WhereLoop X is a proper subset of Y" means that X uses fewer
 86239  //  ** WHERE clause terms than Y and that every WHERE clause term used by X is
 86240  //  ** also used by Y.
 86241  //  */
 86242  func _whereLoopAdjustCost(tls *crt.TLS, _p *XWhereLoop, _pTemplate *XWhereLoop) {
 86243  	if (_pTemplate.XwsFlags & uint32(512)) == (0) {
 86244  		return
 86245  	}
 86246  _0:
 86247  	if _p == nil {
 86248  		goto _4
 86249  	}
 86250  	if int32(_p.XiTab) != int32(_pTemplate.XiTab) {
 86251  		goto _2
 86252  	}
 86253  	if (_p.XwsFlags & uint32(512)) == (0) {
 86254  		goto _2
 86255  	}
 86256  	if _whereLoopCheaperProperSubset(tls, _p, _pTemplate) != 0 {
 86257  		_pTemplate.XrRun = _p.XrRun
 86258  		_pTemplate.XnOut = int16(int32(_p.XnOut) - int32(1))
 86259  		goto _9
 86260  	}
 86261  	if _whereLoopCheaperProperSubset(tls, _pTemplate, _p) != 0 {
 86262  		_pTemplate.XrRun = _p.XrRun
 86263  		_pTemplate.XnOut = int16(int32(_p.XnOut) + int32(1))
 86264  	}
 86265  _9:
 86266  _2:
 86267  	_p = (*XWhereLoop)(_p.XpNextLoop)
 86268  	goto _0
 86269  _4:
 86270  }
 86271  
 86272  // C comment
 86273  //  /*
 86274  //  ** Return TRUE if all of the following are true:
 86275  //  **
 86276  //  **   (1)  X has the same or lower cost that Y
 86277  //  **   (2)  X is a proper subset of Y
 86278  //  **   (3)  X skips at least as many columns as Y
 86279  //  **
 86280  //  ** By "proper subset" we mean that X uses fewer WHERE clause terms
 86281  //  ** than Y and that every WHERE clause term used by X is also used
 86282  //  ** by Y.
 86283  //  **
 86284  //  ** If X is a proper subset of Y then Y is a better choice and ought
 86285  //  ** to have a lower cost.  This routine returns TRUE when that cost
 86286  //  ** relationship is inverted and needs to be adjusted.  The third rule
 86287  //  ** was added because if X uses skip-scan less than Y it still might
 86288  //  ** deserve a lower cost even if it is a proper subset of Y.
 86289  //  */
 86290  func _whereLoopCheaperProperSubset(tls *crt.TLS, _pX *XWhereLoop, _pY *XWhereLoop) (r0 int32) {
 86291  	var _i, _j int32
 86292  	if (int32(_pX.XnLTerm) - int32(_pX.XnSkip)) >= (int32(_pY.XnLTerm) - int32(_pY.XnSkip)) {
 86293  		return int32(0)
 86294  	}
 86295  	if int32(_pY.XnSkip) > int32(_pX.XnSkip) {
 86296  		return int32(0)
 86297  	}
 86298  	if int32(_pX.XrRun) < int32(_pY.XrRun) {
 86299  		goto _2
 86300  	}
 86301  	if int32(_pX.XrRun) > int32(_pY.XrRun) {
 86302  		return int32(0)
 86303  	}
 86304  	if int32(_pX.XnOut) > int32(_pY.XnOut) {
 86305  		return int32(0)
 86306  	}
 86307  _2:
 86308  	_i = int32(_pX.XnLTerm) - int32(1)
 86309  _5:
 86310  	if _i < int32(0) {
 86311  		goto _8
 86312  	}
 86313  	if (*elem104((**XWhereTerm)(unsafe.Pointer(_pX.XaLTerm)), uintptr(_i))) == nil {
 86314  		goto _6
 86315  	}
 86316  	_j = int32(_pY.XnLTerm) - int32(1)
 86317  _10:
 86318  	if _j < int32(0) {
 86319  		goto _13
 86320  	}
 86321  	if (*elem104((**XWhereTerm)(unsafe.Pointer(_pY.XaLTerm)), uintptr(_j))) == (*elem104((**XWhereTerm)(unsafe.Pointer(_pX.XaLTerm)), uintptr(_i))) {
 86322  		goto _13
 86323  	}
 86324  	_j -= 1
 86325  	goto _10
 86326  _13:
 86327  	if _j < int32(0) {
 86328  		return int32(0)
 86329  	}
 86330  _6:
 86331  	_i -= 1
 86332  	goto _5
 86333  _8:
 86334  	return int32(1)
 86335  }
 86336  
 86337  // C comment
 86338  //  /*
 86339  //  ** Search the list of WhereLoops in *ppPrev looking for one that can be
 86340  //  ** supplanted by pTemplate.
 86341  //  **
 86342  //  ** Return NULL if the WhereLoop list contains an entry that can supplant
 86343  //  ** pTemplate, in other words if pTemplate does not belong on the list.
 86344  //  **
 86345  //  ** If pX is a WhereLoop that pTemplate can supplant, then return the
 86346  //  ** link that points to pX.
 86347  //  **
 86348  //  ** If pTemplate cannot supplant any existing element of the list but needs
 86349  //  ** to be added to the list, then return a pointer to the tail of the list.
 86350  //  */
 86351  func _whereLoopFindLesser(tls *crt.TLS, _ppPrev **XWhereLoop, _pTemplate *XWhereLoop) (r0 **XWhereLoop) {
 86352  	var _p *XWhereLoop
 86353  	_p = *_ppPrev
 86354  _0:
 86355  	if _p == nil {
 86356  		goto _3
 86357  	}
 86358  	if (int32(_p.XiTab) != int32(_pTemplate.XiTab)) || (int32(_p.XiSortIdx) != int32(_pTemplate.XiSortIdx)) {
 86359  		goto _1
 86360  	}
 86361  	func() {
 86362  		if int32(_p.XrSetup) != int32(0) && int32(_pTemplate.XrSetup) != int32(0) && int32(_p.XrSetup) != int32(_pTemplate.XrSetup) {
 86363  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132363), unsafe.Pointer(&_whereLoopFindLesserØ00__func__Ø000), unsafe.Pointer(str(105397)))
 86364  			crt.X__builtin_abort(tls)
 86365  		}
 86366  	}()
 86367  	func() {
 86368  		if int32(_p.XrSetup) < int32(_pTemplate.XrSetup) {
 86369  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132369), unsafe.Pointer(&_whereLoopFindLesserØ00__func__Ø000), unsafe.Pointer(str(105466)))
 86370  			crt.X__builtin_abort(tls)
 86371  		}
 86372  	}()
 86373  	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) {
 86374  		goto _3
 86375  	}
 86376  	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)) {
 86377  		return nil
 86378  	}
 86379  	if (((_p.Xprereq & _pTemplate.Xprereq) == _pTemplate.Xprereq) && (int32(_p.XrRun) >= int32(_pTemplate.XrRun))) && (int32(_p.XnOut) >= int32(_pTemplate.XnOut)) {
 86380  		func() {
 86381  			if int32(_p.XrSetup) < int32(_pTemplate.XrSetup) {
 86382  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132405), unsafe.Pointer(&_whereLoopFindLesserØ00__func__Ø000), unsafe.Pointer(str(105466)))
 86383  				crt.X__builtin_abort(tls)
 86384  			}
 86385  		}()
 86386  		goto _3
 86387  	}
 86388  _1:
 86389  	*func() **XWhereLoop { _ppPrev = (**XWhereLoop)(unsafe.Pointer(&_p.XpNextLoop)); return &_p }() = *_ppPrev
 86390  	goto _0
 86391  _3:
 86392  	return _ppPrev
 86393  }
 86394  
 86395  var _whereLoopFindLesserØ00__func__Ø000 [20]int8
 86396  
 86397  func init() {
 86398  	crt.Xstrncpy(nil, &_whereLoopFindLesserØ00__func__Ø000[0], str(105495), 20)
 86399  }
 86400  
 86401  // C comment
 86402  //  /*
 86403  //  ** Delete a WhereLoop object
 86404  //  */
 86405  func _whereLoopDelete(tls *crt.TLS, _db *Xsqlite3, _p *XWhereLoop) {
 86406  	_whereLoopClear(tls, _db, _p)
 86407  	_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_p))
 86408  }
 86409  
 86410  // C comment
 86411  //  /*
 86412  //  ** Deallocate internal memory used by a WhereLoop object
 86413  //  */
 86414  func _whereLoopClear(tls *crt.TLS, _db *Xsqlite3, _p *XWhereLoop) {
 86415  	if (**XWhereTerm)(unsafe.Pointer(_p.XaLTerm)) != (**XWhereTerm)(unsafe.Pointer(&_p.XaLTermSpace)) {
 86416  		_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_p.XaLTerm))
 86417  	}
 86418  	_whereLoopClearUnion(tls, _db, _p)
 86419  	_whereLoopInit(tls, _p)
 86420  }
 86421  
 86422  // C comment
 86423  //  /*
 86424  //  ** Clear the WhereLoop.u union.  Leave WhereLoop.pLTerm intact.
 86425  //  */
 86426  func _whereLoopClearUnion(tls *crt.TLS, _db *Xsqlite3, _p *XWhereLoop) {
 86427  	if (_p.XwsFlags & uint32(17408)) == 0 {
 86428  		goto _0
 86429  	}
 86430  	if ((_p.XwsFlags & uint32(1024)) != (0)) && (((*t105)(unsafe.Pointer(&_p.Xu)).XneedFree) != 0) {
 86431  		Xsqlite3_free(tls, unsafe.Pointer((*t105)(unsafe.Pointer(&_p.Xu)).XidxStr))
 86432  		(*t105)(unsafe.Pointer(&_p.Xu)).XneedFree = 0
 86433  		(*t105)(unsafe.Pointer(&_p.Xu)).XidxStr = nil
 86434  		goto _5
 86435  	}
 86436  	if ((_p.XwsFlags & uint32(16384)) != (0)) && ((*XIndex)((*t101)(unsafe.Pointer(&_p.Xu)).XpIndex) != nil) {
 86437  		_sqlite3DbFree(tls, _db, unsafe.Pointer((*XIndex)((*t101)(unsafe.Pointer(&_p.Xu)).XpIndex).XzColAff))
 86438  		_sqlite3DbFreeNN(tls, _db, (*t101)(unsafe.Pointer(&_p.Xu)).XpIndex)
 86439  		*(**XIndex)(unsafe.Pointer(&((*t101)(unsafe.Pointer(&_p.Xu)).XpIndex))) = nil
 86440  	}
 86441  _5:
 86442  _0:
 86443  }
 86444  
 86445  // C comment
 86446  //  /*
 86447  //  ** Transfer content from the second pLoop into the first.
 86448  //  */
 86449  func _whereLoopXfer(tls *crt.TLS, _db *Xsqlite3, _pTo *XWhereLoop, _pFrom *XWhereLoop) (r0 int32) {
 86450  	_whereLoopClearUnion(tls, _db, _pTo)
 86451  	if _whereLoopResize(tls, _db, _pTo, int32(_pFrom.XnLTerm)) != 0 {
 86452  		crt.Xmemset(tls, unsafe.Pointer(&_pTo.Xu), int32(0), uint32(12))
 86453  		return _sqlite3NomemError(tls, int32(132216))
 86454  	}
 86455  	crt.Xmemcpy(tls, unsafe.Pointer(_pTo), unsafe.Pointer(_pFrom), uint32(48))
 86456  	crt.Xmemcpy(tls, unsafe.Pointer(_pTo.XaLTerm), unsafe.Pointer(_pFrom.XaLTerm), uint32(_pTo.XnLTerm)*uint32(4))
 86457  	if (_pFrom.XwsFlags & uint32(1024)) != 0 {
 86458  		(*t105)(unsafe.Pointer(&_pFrom.Xu)).XneedFree = 0
 86459  		goto _3
 86460  	}
 86461  	if (_pFrom.XwsFlags & uint32(16384)) != (0) {
 86462  		*(**XIndex)(unsafe.Pointer(&((*t101)(unsafe.Pointer(&_pFrom.Xu)).XpIndex))) = nil
 86463  	}
 86464  _3:
 86465  	return int32(0)
 86466  }
 86467  
 86468  // C comment
 86469  //  /*
 86470  //  ** Add all WhereLoop objects for a single table of the join where the table
 86471  //  ** is identified by pBuilder->pNew->iTab.  That table is guaranteed to be
 86472  //  ** a b-tree table, not a virtual table.
 86473  //  **
 86474  //  ** The costs (WhereLoop.rRun) of the b-tree loops added by this function
 86475  //  ** are calculated as follows:
 86476  //  **
 86477  //  ** For a full scan, assuming the table (or index) contains nRow rows:
 86478  //  **
 86479  //  **     cost = nRow * 3.0                    // full-table scan
 86480  //  **     cost = nRow * K                      // scan of covering index
 86481  //  **     cost = nRow * (K+3.0)                // scan of non-covering index
 86482  //  **
 86483  //  ** where K is a value between 1.1 and 3.0 set based on the relative
 86484  //  ** estimated average size of the index and table records.
 86485  //  **
 86486  //  ** For an index scan, where nVisit is the number of index rows visited
 86487  //  ** by the scan, and nSeek is the number of seek operations required on
 86488  //  ** the index b-tree:
 86489  //  **
 86490  //  **     cost = nSeek * (log(nRow) + K * nVisit)          // covering index
 86491  //  **     cost = nSeek * (log(nRow) + (K+3.0) * nVisit)    // non-covering index
 86492  //  **
 86493  //  ** Normally, nSeek is 1. nSeek values greater than 1 come about if the
 86494  //  ** WHERE clause includes "x IN (....)" terms used in place of "x=?". Or when
 86495  //  ** implicit "x IN (SELECT x FROM tbl)" terms are added for skip-scans.
 86496  //  **
 86497  //  ** The estimated values (nRow, nVisit, nSeek) often contain a large amount
 86498  //  ** of uncertainty.  For this reason, scoring is designed to pick plans that
 86499  //  ** "do the least harm" if the estimates are inaccurate.  For example, a
 86500  //  ** log(nRow) factor is omitted from a non-covering index scan in order to
 86501  //  ** bias the scoring in favor of using an index, since the worst-case
 86502  //  ** performance of using an index is far better than the worst-case performance
 86503  //  ** of a full table scan.
 86504  //  */
 86505  func _whereLoopAddBtree(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _mPrereq uint64) (r0 int32) {
 86506  	var _aiColumnPk, _rSize, _rLogSize, _16_nLookup int16
 86507  	var _rc, _iSortIdx, _b, _16_ii, _16_iCur int32
 86508  	var _12_m uint64
 86509  	var _pTab *XTable
 86510  	var _pTabList *XSrcList
 86511  	var _pSrc *TSrcList_item
 86512  	var _pProbe, _3_pFirst *XIndex
 86513  	var _sPk XIndex
 86514  	var _pWInfo *XWhereInfo
 86515  	var _pNew *XWhereLoop
 86516  	var _5_pTerm, _5_pWCEnd, _17_pTerm *XWhereTerm
 86517  	var _pWC, _16_pWC2 *XWhereClause
 86518  	var _aiRowEstPk [2]int16
 86519  	_aiColumnPk = int16(-1)
 86520  	_rc = int32(0)
 86521  	_iSortIdx = int32(1)
 86522  	_pNew = (*XWhereLoop)(_pBuilder.XpNew)
 86523  	_pWInfo = (*XWhereInfo)(_pBuilder.XpWInfo)
 86524  	_pTabList = (*XSrcList)(_pWInfo.XpTabList)
 86525  	_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(68)))))))))))
 86526  	_pTab = (*XTable)(_pSrc.XpTab)
 86527  	_pWC = (*XWhereClause)(_pBuilder.XpWC)
 86528  	func() {
 86529  		if ((*XTable)(_pSrc.XpTab).XnModuleArg) != 0 {
 86530  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133153), unsafe.Pointer(&_whereLoopAddBtreeØ00__func__Ø000), unsafe.Pointer(str(105515)))
 86531  			crt.X__builtin_abort(tls)
 86532  		}
 86533  	}()
 86534  	if _pSrc.XpIBIndex != nil {
 86535  		_pProbe = (*XIndex)(_pSrc.XpIBIndex)
 86536  		goto _5
 86537  	}
 86538  	if (_pTab.XtabFlags & uint32(32)) != (0) {
 86539  		_pProbe = (*XIndex)(_pTab.XpIndex)
 86540  		goto _5
 86541  	}
 86542  	crt.Xmemset(tls, unsafe.Pointer(&_sPk), int32(0), uint32(56))
 86543  	_sPk.XnKeyCol = uint16(1)
 86544  	_sPk.XnColumn = uint16(1)
 86545  	_sPk.XaiColumn = &_aiColumnPk
 86546  	_sPk.XaiRowLogEst = (*int16)(unsafe.Pointer(&_aiRowEstPk))
 86547  	_sPk.XonError = uint8(5)
 86548  	*(**XTable)(unsafe.Pointer(&_sPk.XpTable)) = _pTab
 86549  	_sPk.XszIdxRow = _pTab.XszTabRow
 86550  	*elem50((*int16)(unsafe.Pointer(&_aiRowEstPk)), 0) = _pTab.XnRowLogEst
 86551  	*elem50((*int16)(unsafe.Pointer(&_aiRowEstPk)), uintptr(1)) = 0
 86552  	_3_pFirst = (*XIndex)((*XTable)(_pSrc.XpTab).XpIndex)
 86553  	if int32((uint32(_pSrc.Xfg.XnotIndexed)<<31)>>31) == int32(0) {
 86554  		*(**XIndex)(unsafe.Pointer(&_sPk.XpNext)) = _3_pFirst
 86555  	}
 86556  	_pProbe = &_sPk
 86557  _5:
 86558  	_rSize = _pTab.XnRowLogEst
 86559  	_rLogSize = _estLog(tls, _rSize)
 86560  	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 {
 86561  		goto _14
 86562  	}
 86563  	_5_pWCEnd = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.Xa) + uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.XnTerm)*uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(48)))))))))))
 86564  	_5_pTerm = (*XWhereTerm)(_pWC.Xa)
 86565  _15:
 86566  	if _rc != int32(0) || crt.P2U(unsafe.Pointer(_5_pTerm)) >= crt.P2U(unsafe.Pointer(_5_pWCEnd)) {
 86567  		goto _19
 86568  	}
 86569  	if (_5_pTerm.XprereqRight & _pNew.XmaskSelf) != 0 {
 86570  		goto _16
 86571  	}
 86572  	if _termCanDriveIndex(tls, _5_pTerm, _pSrc, 0) == 0 {
 86573  		goto _21
 86574  	}
 86575  	(*t101)(unsafe.Pointer(&_pNew.Xu)).XnEq = uint16(1)
 86576  	_pNew.XnSkip = 0
 86577  	*(**XIndex)(unsafe.Pointer(&((*t101)(unsafe.Pointer(&_pNew.Xu)).XpIndex))) = nil
 86578  	_pNew.XnLTerm = uint16(1)
 86579  	*elem104((**XWhereTerm)(unsafe.Pointer(_pNew.XaLTerm)), 0) = _5_pTerm
 86580  	_pNew.XrSetup = int16((int32(_rLogSize) + int32(_rSize)) + int32(4))
 86581  	if ((*XSelect)(_pTab.XpSelect) == nil) && ((_pTab.XtabFlags & uint32(2)) == (0)) {
 86582  		{
 86583  			p := &_pNew.XrSetup
 86584  			*p = int16(int32(*p) + int32(24))
 86585  		}
 86586  	}
 86587  	if int32(_pNew.XrSetup) < int32(0) {
 86588  		_pNew.XrSetup = 0
 86589  	}
 86590  	_pNew.XnOut = int16(43)
 86591  	func() {
 86592  		if int32(43) != int32(_sqlite3LogEst(tls, uint64(20))) {
 86593  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133227), unsafe.Pointer(&_whereLoopAddBtreeØ00__func__Ø000), unsafe.Pointer(str(105538)))
 86594  			crt.X__builtin_abort(tls)
 86595  		}
 86596  	}()
 86597  	_pNew.XrRun = _sqlite3LogEstAdd(tls, _rLogSize, _pNew.XnOut)
 86598  	_pNew.XwsFlags = uint32(16384)
 86599  	_pNew.Xprereq = _mPrereq | _5_pTerm.XprereqRight
 86600  	_rc = _whereLoopInsert(tls, _pBuilder, _pNew)
 86601  _21:
 86602  _16:
 86603  	*(*uintptr)(unsafe.Pointer(&_5_pTerm)) += uintptr(48)
 86604  	goto _15
 86605  _19:
 86606  _14:
 86607  	if _rc != int32(0) || _pProbe == nil {
 86608  		goto _31
 86609  	}
 86610  	if ((*XExpr)(_pProbe.XpPartIdxWhere) != nil) && (_whereUsablePartialIndex(tls, _pSrc.XiCursor, _pWC, (*XExpr)(_pProbe.XpPartIdxWhere)) == 0) {
 86611  		goto _28
 86612  	}
 86613  	_rSize = *elem50(_pProbe.XaiRowLogEst, 0)
 86614  	(*t101)(unsafe.Pointer(&_pNew.Xu)).XnEq = 0
 86615  	(*t101)(unsafe.Pointer(&_pNew.Xu)).XnBtm = 0
 86616  	(*t101)(unsafe.Pointer(&_pNew.Xu)).XnTop = 0
 86617  	_pNew.XnSkip = 0
 86618  	_pNew.XnLTerm = 0
 86619  	_pNew.XiSortIdx = 0
 86620  	_pNew.XrSetup = 0
 86621  	_pNew.Xprereq = _mPrereq
 86622  	_pNew.XnOut = _rSize
 86623  	*(**XIndex)(unsafe.Pointer(&((*t101)(unsafe.Pointer(&_pNew.Xu)).XpIndex))) = _pProbe
 86624  	_b = _indexMightHelpWithOrderBy(tls, _pBuilder, _pProbe, _pSrc.XiCursor)
 86625  	func() {
 86626  		if (int32(_pWInfo.XwctrlFlags)&int32(4)) != int32(0) && _b != int32(0) {
 86627  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133258), unsafe.Pointer(&_whereLoopAddBtreeØ00__func__Ø000), unsafe.Pointer(str(105560)))
 86628  			crt.X__builtin_abort(tls)
 86629  		}
 86630  	}()
 86631  	if _pProbe.Xtnum > int32(0) {
 86632  		goto _37
 86633  	}
 86634  	_pNew.XwsFlags = uint32(256)
 86635  	_pNew.XiSortIdx = uint8(func() int32 {
 86636  		if _b != 0 {
 86637  			return _iSortIdx
 86638  		}
 86639  		return int32(0)
 86640  	}())
 86641  	_pNew.XrRun = int16(int32(_rSize) + int32(16))
 86642  	_whereLoopOutputAdjust(tls, _pWC, _pNew, _rSize)
 86643  	_rc = _whereLoopInsert(tls, _pBuilder, _pNew)
 86644  	_pNew.XnOut = _rSize
 86645  	if _rc != 0 {
 86646  		goto _31
 86647  	}
 86648  	goto _41
 86649  _37:
 86650  	if ((uint32(_pProbe.XidxType>>5) << 31) >> 31) != 0 {
 86651  		_pNew.XwsFlags = uint32(576)
 86652  		_12_m = 0
 86653  		goto _43
 86654  	}
 86655  	_12_m = _pSrc.XcolUsed & (^_columnsInIndex(tls, _pProbe))
 86656  	_pNew.XwsFlags = uint32(func() int32 {
 86657  		if _12_m == (0) {
 86658  			return int32(576)
 86659  		}
 86660  		return int32(512)
 86661  	}())
 86662  _43:
 86663  	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)) {
 86664  		goto _54
 86665  	}
 86666  	_pNew.XiSortIdx = uint8(func() int32 {
 86667  		if _b != 0 {
 86668  			return _iSortIdx
 86669  		}
 86670  		return int32(0)
 86671  	}())
 86672  	_pNew.XrRun = int16((int32(_rSize) + int32(1)) + ((int32(15) * int32(_pProbe.XszIdxRow)) / int32(_pTab.XszTabRow)))
 86673  	if _12_m == (0) {
 86674  		goto _57
 86675  	}
 86676  	_16_nLookup = int16(int32(_rSize) + int32(16))
 86677  	_16_iCur = _pSrc.XiCursor
 86678  	_16_pWC2 = &_pWInfo.XsWC
 86679  	_16_ii = int32(0)
 86680  _58:
 86681  	if _16_ii >= _16_pWC2.XnTerm {
 86682  		goto _61
 86683  	}
 86684  	_17_pTerm = elem100((*XWhereTerm)(_16_pWC2.Xa), uintptr(_16_ii))
 86685  	if _sqlite3ExprCoveredByIndex(tls, (*XExpr)(_17_pTerm.XpExpr), _16_iCur, _pProbe) == 0 {
 86686  		goto _61
 86687  	}
 86688  	if int32(_17_pTerm.XtruthProb) <= int32(0) {
 86689  		{
 86690  			p := &_16_nLookup
 86691  			*p = int16(int32(*p) + int32(_17_pTerm.XtruthProb))
 86692  		}
 86693  		goto _64
 86694  	}
 86695  	_16_nLookup -= 1
 86696  	if (int32(_17_pTerm.XeOperator) & int32(130)) != 0 {
 86697  		{
 86698  			p := &_16_nLookup
 86699  			*p = int16(int32(*p) - int32(19))
 86700  		}
 86701  	}
 86702  _64:
 86703  	_16_ii += 1
 86704  	goto _58
 86705  _61:
 86706  	_pNew.XrRun = _sqlite3LogEstAdd(tls, _pNew.XrRun, _16_nLookup)
 86707  _57:
 86708  	_whereLoopOutputAdjust(tls, _pWC, _pNew, _rSize)
 86709  	_rc = _whereLoopInsert(tls, _pBuilder, _pNew)
 86710  	_pNew.XnOut = _rSize
 86711  	if _rc != 0 {
 86712  		goto _31
 86713  	}
 86714  _54:
 86715  _41:
 86716  	_pBuilder.XbldFlags = 0
 86717  	_rc = _whereLoopAddBtreeIndex(tls, _pBuilder, _pSrc, _pProbe, 0)
 86718  	if _pBuilder.XbldFlags == uint32(1) {
 86719  		_pTab.XtabFlags |= uint32(256)
 86720  	}
 86721  	if _pSrc.XpIBIndex != nil {
 86722  		goto _31
 86723  	}
 86724  _28:
 86725  	*func() *int32 { _pProbe = (*XIndex)(_pProbe.XpNext); return &_iSortIdx }() += 1
 86726  	goto _14
 86727  _31:
 86728  	return _rc
 86729  
 86730  	_ = _aiRowEstPk
 86731  	_ = _aiColumnPk
 86732  	panic(0)
 86733  }
 86734  
 86735  var _whereLoopAddBtreeØ00__func__Ø000 [18]int8
 86736  
 86737  func init() {
 86738  	crt.Xstrncpy(nil, &_whereLoopAddBtreeØ00__func__Ø000[0], str(105616), 18)
 86739  }
 86740  
 86741  // C comment
 86742  //  /*
 86743  //  ** Estimate the logarithm of the input value to base 2.
 86744  //  */
 86745  func _estLog(tls *crt.TLS, _N int16) (r0 int16) {
 86746  	return int16(func() int32 {
 86747  		if int32(_N) <= int32(10) {
 86748  			return int32(0)
 86749  		}
 86750  		return (int32(_sqlite3LogEst(tls, uint64(_N))) - int32(33))
 86751  	}())
 86752  }
 86753  
 86754  // C comment
 86755  //  /*
 86756  //  ** Return TRUE if the WHERE clause term pTerm is of a form where it
 86757  //  ** could be used with an index to access pSrc, assuming an appropriate
 86758  //  ** index existed.
 86759  //  */
 86760  func _termCanDriveIndex(tls *crt.TLS, _pTerm *XWhereTerm, _pSrc *TSrcList_item, _notReady uint64) (r0 int32) {
 86761  	var _aff int8
 86762  	if _pTerm.XleftCursor != _pSrc.XiCursor {
 86763  		return int32(0)
 86764  	}
 86765  	if (int32(_pTerm.XeOperator) & int32(130)) == int32(0) {
 86766  		return int32(0)
 86767  	}
 86768  	if (_pTerm.XprereqRight & _notReady) != (0) {
 86769  		return int32(0)
 86770  	}
 86771  	if (*(*int32)(unsafe.Pointer(&_pTerm.Xu))) < int32(0) {
 86772  		return int32(0)
 86773  	}
 86774  	_aff = elem41((*XColumn)((*XTable)(_pSrc.XpTab).XaCol), uintptr(*(*int32)(unsafe.Pointer(&_pTerm.Xu)))).Xaffinity
 86775  	if _sqlite3IndexAffinityOk(tls, (*XExpr)(_pTerm.XpExpr), _aff) == 0 {
 86776  		return int32(0)
 86777  	}
 86778  	return int32(1)
 86779  }
 86780  
 86781  // C comment
 86782  //  /* Check to see if a partial index with pPartIndexWhere can be used
 86783  //  ** in the current query.  Return true if it can be and false if not.
 86784  //  */
 86785  func _whereUsablePartialIndex(tls *crt.TLS, _iTab int32, _pWC *XWhereClause, _pWhere *XExpr) (r0 int32) {
 86786  	var _i int32
 86787  	var _2_pExpr *XExpr
 86788  	var _pTerm *XWhereTerm
 86789  _0:
 86790  	if int32(_pWhere.Xop) != int32(71) {
 86791  		goto _1
 86792  	}
 86793  	if _whereUsablePartialIndex(tls, _iTab, _pWC, (*XExpr)(_pWhere.XpLeft)) == 0 {
 86794  		return int32(0)
 86795  	}
 86796  	_pWhere = (*XExpr)(_pWhere.XpRight)
 86797  	goto _0
 86798  _1:
 86799  	*func() **XWhereTerm { _i = int32(0); return &_pTerm }() = (*XWhereTerm)(_pWC.Xa)
 86800  _3:
 86801  	if _i >= _pWC.XnTerm {
 86802  		goto _6
 86803  	}
 86804  	_2_pExpr = (*XExpr)(_pTerm.XpExpr)
 86805  	if _sqlite3ExprImpliesExpr(tls, _2_pExpr, _pWhere, _iTab) != 0 && (((_2_pExpr.Xflags & uint32(1)) == (0)) || (int32(_2_pExpr.XiRightJoinTable) == _iTab)) {
 86806  		return int32(1)
 86807  	}
 86808  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i += 1; return &_pTerm }())) += uintptr(48)
 86809  	goto _3
 86810  _6:
 86811  	return int32(0)
 86812  }
 86813  
 86814  // C comment
 86815  //  /*
 86816  //  ** Return true if we can prove the pE2 will always be true if pE1 is
 86817  //  ** true.  Return false if we cannot complete the proof or if pE2 might
 86818  //  ** be false.  Examples:
 86819  //  **
 86820  //  **     pE1: x==5       pE2: x==5             Result: true
 86821  //  **     pE1: x>0        pE2: x==5             Result: false
 86822  //  **     pE1: x=21       pE2: x=21 OR y=43     Result: true
 86823  //  **     pE1: x!=123     pE2: x IS NOT NULL    Result: true
 86824  //  **     pE1: x!=?1      pE2: x IS NOT NULL    Result: true
 86825  //  **     pE1: x IS NULL  pE2: x IS NOT NULL    Result: false
 86826  //  **     pE1: x IS ?2    pE2: x IS NOT NULL    Reuslt: false
 86827  //  **
 86828  //  ** When comparing TK_COLUMN nodes between pE1 and pE2, if pE2 has
 86829  //  ** Expr.iTable<0 then assume a table number given by iTab.
 86830  //  **
 86831  //  ** When in doubt, return false.  Returning true might give a performance
 86832  //  ** improvement.  Returning false might cause a performance reduction, but
 86833  //  ** it will always give the correct answer and is hence always safe.
 86834  //  */
 86835  func _sqlite3ExprImpliesExpr(tls *crt.TLS, _pE1 *XExpr, _pE2 *XExpr, _iTab int32) (r0 int32) {
 86836  	var _3_pX *XExpr
 86837  	if _sqlite3ExprCompare(tls, _pE1, _pE2, _iTab) == int32(0) {
 86838  		return int32(1)
 86839  	}
 86840  	if (int32(_pE2.Xop) == int32(70)) && (_sqlite3ExprImpliesExpr(tls, _pE1, (*XExpr)(_pE2.XpLeft), _iTab) != 0 || _sqlite3ExprImpliesExpr(tls, _pE1, (*XExpr)(_pE2.XpRight), _iTab) != 0) {
 86841  		return int32(1)
 86842  	}
 86843  	if int32(_pE2.Xop) != int32(76) || int32(_pE1.Xop) == int32(75) || int32(_pE1.Xop) == int32(72) {
 86844  		goto _6
 86845  	}
 86846  	_3_pX = _sqlite3ExprSkipCollate(tls, (*XExpr)(_pE1.XpLeft))
 86847  	if _sqlite3ExprCompare(tls, _3_pX, (*XExpr)(_pE2.XpLeft), _iTab) == int32(0) {
 86848  		return int32(1)
 86849  	}
 86850  _6:
 86851  	return int32(0)
 86852  }
 86853  
 86854  // C comment
 86855  //  /*
 86856  //  ** Return True if it is possible that pIndex might be useful in
 86857  //  ** implementing the ORDER BY clause in pBuilder.
 86858  //  **
 86859  //  ** Return False if pBuilder does not contain an ORDER BY clause or
 86860  //  ** if there is no way for pIndex to be useful in implementing that
 86861  //  ** ORDER BY clause.
 86862  //  */
 86863  func _indexMightHelpWithOrderBy(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _pIndex *XIndex, _iCursor int32) (r0 int32) {
 86864  	var _ii, _jj int32
 86865  	var _pOB, _aColExpr *XExprList
 86866  	var _1_pExpr *XExpr
 86867  	if ((uint32(_pIndex.XidxType>>2) << 31) >> 31) != 0 {
 86868  		return int32(0)
 86869  	}
 86870  	if store70(&_pOB, (*XExprList)((*XWhereInfo)(_pBuilder.XpWInfo).XpOrderBy)) == nil {
 86871  		return int32(0)
 86872  	}
 86873  	_ii = int32(0)
 86874  _2:
 86875  	if _ii >= _pOB.XnExpr {
 86876  		goto _5
 86877  	}
 86878  	_1_pExpr = _sqlite3ExprSkipCollate(tls, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pOB.Xa)), uintptr(_ii)).XpExpr))
 86879  	if int32(_1_pExpr.Xop) != int32(152) || _1_pExpr.XiTable != _iCursor {
 86880  		goto _7
 86881  	}
 86882  	if int32(_1_pExpr.XiColumn) < int32(0) {
 86883  		return int32(1)
 86884  	}
 86885  	_jj = int32(0)
 86886  _9:
 86887  	if _jj >= int32(_pIndex.XnKeyCol) {
 86888  		goto _12
 86889  	}
 86890  	if int32(_1_pExpr.XiColumn) == int32(*elem50(_pIndex.XaiColumn, uintptr(_jj))) {
 86891  		return int32(1)
 86892  	}
 86893  	_jj += 1
 86894  	goto _9
 86895  _12:
 86896  	goto _15
 86897  _7:
 86898  	if store70(&_aColExpr, (*XExprList)(_pIndex.XaColExpr)) == nil {
 86899  		goto _15
 86900  	}
 86901  	_jj = int32(0)
 86902  _16:
 86903  	if _jj >= int32(_pIndex.XnKeyCol) {
 86904  		goto _19
 86905  	}
 86906  	if int32(*elem50(_pIndex.XaiColumn, uintptr(_jj))) != int32(-2) {
 86907  		goto _17
 86908  	}
 86909  	if _sqlite3ExprCompare(tls, _1_pExpr, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_aColExpr.Xa)), uintptr(_jj)).XpExpr), _iCursor) == int32(0) {
 86910  		return int32(1)
 86911  	}
 86912  _17:
 86913  	_jj += 1
 86914  	goto _16
 86915  _19:
 86916  _15:
 86917  	_ii += 1
 86918  	goto _2
 86919  _5:
 86920  	return int32(0)
 86921  }
 86922  
 86923  // C comment
 86924  //  /*
 86925  //  ** Adjust the WhereLoop.nOut value downward to account for terms of the
 86926  //  ** WHERE clause that reference the loop but which are not used by an
 86927  //  ** index.
 86928  //  *
 86929  //  ** For every WHERE clause term that is not used by the index
 86930  //  ** and which has a truth probability assigned by one of the likelihood(),
 86931  //  ** likely(), or unlikely() SQL functions, reduce the estimated number
 86932  //  ** of output rows by the probability specified.
 86933  //  **
 86934  //  ** TUNING:  For every WHERE clause term that is not used by the index
 86935  //  ** and which does not have an assigned truth probability, heuristics
 86936  //  ** described below are used to try to estimate the truth probability.
 86937  //  ** TODO --> Perhaps this is something that could be improved by better
 86938  //  ** table statistics.
 86939  //  **
 86940  //  ** Heuristic 1:  Estimate the truth probability as 93.75%.  The 93.75%
 86941  //  ** value corresponds to -1 in LogEst notation, so this means decrement
 86942  //  ** the WhereLoop.nOut field for every such WHERE clause term.
 86943  //  **
 86944  //  ** Heuristic 2:  If there exists one or more WHERE clause terms of the
 86945  //  ** form "x==EXPR" and EXPR is not a constant 0 or 1, then make sure the
 86946  //  ** final output row estimate is no greater than 1/4 of the total number
 86947  //  ** of rows in the table.  In other words, assume that x==EXPR will filter
 86948  //  ** out at least 3 out of 4 rows.  If EXPR is -1 or 0 or 1, then maybe the
 86949  //  ** "x" column is boolean or else -1 or 0 or 1 is a common default value
 86950  //  ** on the "x" column and so in that case only cap the output row estimate
 86951  //  ** at 1/2 instead of 1/4.
 86952  //  */
 86953  func _whereLoopOutputAdjust(tls *crt.TLS, _pWC *XWhereClause, _pLoop *XWhereLoop, _nRow int16) {
 86954  	var _iReduce int16
 86955  	var _i, _j, _k int32
 86956  	var _notAllowed uint64
 86957  	var _6_pRight *XExpr
 86958  	var _pTerm, _pX *XWhereTerm
 86959  	_notAllowed = ^(_pLoop.Xprereq | _pLoop.XmaskSelf)
 86960  	_iReduce = int16(0)
 86961  	func() {
 86962  		if (_pLoop.XwsFlags & uint32(16384)) != (0) {
 86963  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132572), unsafe.Pointer(&_whereLoopOutputAdjustØ00__func__Ø000), unsafe.Pointer(str(105634)))
 86964  			crt.X__builtin_abort(tls)
 86965  		}
 86966  	}()
 86967  	*func() **XWhereTerm { _i = _pWC.XnTerm; return &_pTerm }() = (*XWhereTerm)(_pWC.Xa)
 86968  _2:
 86969  	if _i <= int32(0) {
 86970  		goto _5
 86971  	}
 86972  	if (int32(_pTerm.XwtFlags) & int32(2)) != int32(0) {
 86973  		goto _5
 86974  	}
 86975  	if (_pTerm.XprereqAll & _pLoop.XmaskSelf) == (0) {
 86976  		goto _3
 86977  	}
 86978  	if (_pTerm.XprereqAll & _notAllowed) != (0) {
 86979  		goto _3
 86980  	}
 86981  	_j = int32(_pLoop.XnLTerm) - int32(1)
 86982  _9:
 86983  	if _j < int32(0) {
 86984  		goto _12
 86985  	}
 86986  	_pX = *elem104((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(_j))
 86987  	if _pX == nil {
 86988  		goto _10
 86989  	}
 86990  	if _pX == _pTerm {
 86991  		goto _12
 86992  	}
 86993  	if (_pX.XiParent >= int32(0)) && (elem100((*XWhereTerm)(_pWC.Xa), uintptr(_pX.XiParent)) == _pTerm) {
 86994  		goto _12
 86995  	}
 86996  _10:
 86997  	_j -= 1
 86998  	goto _9
 86999  _12:
 87000  	if _j >= int32(0) {
 87001  		goto _17
 87002  	}
 87003  	if int32(_pTerm.XtruthProb) <= int32(0) {
 87004  		{
 87005  			p := &_pLoop.XnOut
 87006  			*p = int16(int32(*p) + int32(_pTerm.XtruthProb))
 87007  		}
 87008  		goto _19
 87009  	}
 87010  	_pLoop.XnOut -= 1
 87011  	if (int32(_pTerm.XeOperator) & int32(130)) == 0 {
 87012  		goto _20
 87013  	}
 87014  	_6_pRight = (*XExpr)((*XExpr)(_pTerm.XpExpr).XpRight)
 87015  	if (_sqlite3ExprIsInteger(tls, _6_pRight, &_k) != 0 && (_k >= int32(-1))) && (_k <= int32(1)) {
 87016  		_k = int32(10)
 87017  		goto _24
 87018  	}
 87019  	_k = int32(20)
 87020  _24:
 87021  	if int32(_iReduce) < _k {
 87022  		_iReduce = int16(_k)
 87023  	}
 87024  _20:
 87025  _19:
 87026  _17:
 87027  _3:
 87028  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i -= 1; return &_pTerm }())) += uintptr(48)
 87029  	goto _2
 87030  _5:
 87031  	if int32(_pLoop.XnOut) > (int32(_nRow) - int32(_iReduce)) {
 87032  		_pLoop.XnOut = int16(int32(_nRow) - int32(_iReduce))
 87033  	}
 87034  }
 87035  
 87036  var _whereLoopOutputAdjustØ00__func__Ø000 [22]int8
 87037  
 87038  func init() {
 87039  	crt.Xstrncpy(nil, &_whereLoopOutputAdjustØ00__func__Ø000[0], str(105673), 22)
 87040  }
 87041  
 87042  // C comment
 87043  //  /*
 87044  //  ** Determine if an index pIdx on table with cursor iCur contains will
 87045  //  ** the expression pExpr.  Return true if the index does cover the
 87046  //  ** expression and false if the pExpr expression references table columns
 87047  //  ** that are not found in the index pIdx.
 87048  //  **
 87049  //  ** An index covering an expression means that the expression can be
 87050  //  ** evaluated using only the index and without having to lookup the
 87051  //  ** corresponding table entry.
 87052  //  */
 87053  func _sqlite3ExprCoveredByIndex(tls *crt.TLS, _pExpr *XExpr, _iCur int32, _pIdx *XIndex) (r0 int32) {
 87054  	var _w XWalker
 87055  	var _xcov TIdxCover
 87056  	crt.Xmemset(tls, unsafe.Pointer(&_w), int32(0), uint32(28))
 87057  	_xcov.XiCur = _iCur
 87058  	*(**XIndex)(unsafe.Pointer(&_xcov.XpIdx)) = _pIdx
 87059  	*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_w.XxExprCallback)) = _exprIdxCover
 87060  	*(**TIdxCover)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_w.Xu)))) = &_xcov
 87061  	_sqlite3WalkExpr(tls, &_w, _pExpr)
 87062  	return bool2int(_w.XeCode == 0)
 87063  }
 87064  
 87065  // C comment
 87066  //  /*
 87067  //  ** Check to see if there are references to columns in table
 87068  //  ** pWalker->u.pIdxCover->iCur can be satisfied using the index
 87069  //  ** pWalker->u.pIdxCover->pIdx.
 87070  //  */
 87071  func _exprIdxCover(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
 87072  	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)) {
 87073  		_pWalker.XeCode = uint8(1)
 87074  		return int32(2)
 87075  	}
 87076  	return int32(0)
 87077  }
 87078  
 87079  // C comment
 87080  //  /*
 87081  //  ** We have so far matched pBuilder->pNew->u.btree.nEq terms of the
 87082  //  ** index pIndex. Try to match one more.
 87083  //  **
 87084  //  ** When this function is called, pBuilder->pNew->nOut contains the
 87085  //  ** number of rows expected to be visited by filtering using the nEq
 87086  //  ** terms only. If it is modified, this value is restored before this
 87087  //  ** function returns.
 87088  //  **
 87089  //  ** If pProbe->tnum==0, that means pIndex is a fake index used for the
 87090  //  ** INTEGER PRIMARY KEY.
 87091  //  */
 87092  func _whereLoopAddBtreeIndex(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _pSrc *TSrcList_item, _pProbe *XIndex, _nInMul int16) (r0 int32) {
 87093  	var _saved_nOut, _rSize, _rLogSize, _3_rCostIdx, _3_nOutUnadjusted, _30_nIter int16
 87094  	var _opMask, _rc, _3_nIn, _9_i, _12_iCol, _21_nEq int32
 87095  	var _saved_wsFlags uint32
 87096  	var _saved_prereq uint64
 87097  	var _saved_nLTerm, _saved_nEq, _saved_nBtm, _saved_nTop, _saved_nSkip, _3_eOp uint16
 87098  	var _db *Xsqlite3
 87099  	var _8_pExpr *XExpr
 87100  	var _pParse *XParse
 87101  	var _pWInfo *XWhereInfo
 87102  	var _pNew *XWhereLoop
 87103  	var _pTerm, _pTop, _pBtm *XWhereTerm
 87104  	var _scan XWhereScan
 87105  	_pWInfo = (*XWhereInfo)(_pBuilder.XpWInfo)
 87106  	_pParse = (*XParse)(_pWInfo.XpParse)
 87107  	_db = (*Xsqlite3)(_pParse.Xdb)
 87108  	_rc = int32(0)
 87109  	_pTop = nil
 87110  	_pBtm = nil
 87111  	_pNew = (*XWhereLoop)(_pBuilder.XpNew)
 87112  	if _db.XmallocFailed != 0 {
 87113  		return _sqlite3NomemError(tls, int32(132723))
 87114  	}
 87115  	func() {
 87116  		if (_pNew.XwsFlags & uint32(1024)) != (0) {
 87117  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132727), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(105695)))
 87118  			crt.X__builtin_abort(tls)
 87119  		}
 87120  	}()
 87121  	func() {
 87122  		if (_pNew.XwsFlags & uint32(16)) != (0) {
 87123  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132728), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(105735)))
 87124  			crt.X__builtin_abort(tls)
 87125  		}
 87126  	}()
 87127  	if (_pNew.XwsFlags & uint32(32)) != 0 {
 87128  		_opMask = int32(24)
 87129  		goto _6
 87130  	}
 87131  	func() {
 87132  		if int32((*t101)(unsafe.Pointer(&_pNew.Xu)).XnBtm) != int32(0) {
 87133  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132732), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(105772)))
 87134  			crt.X__builtin_abort(tls)
 87135  		}
 87136  	}()
 87137  	_opMask = int32(447)
 87138  _6:
 87139  	if ((uint32(_pProbe.XidxType>>2) << 31) >> 31) != 0 {
 87140  		_opMask &= int32(-61)
 87141  	}
 87142  	func() {
 87143  		if int32((*t101)(unsafe.Pointer(&_pNew.Xu)).XnEq) >= int32(_pProbe.XnColumn) {
 87144  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132737), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(105794)))
 87145  			crt.X__builtin_abort(tls)
 87146  		}
 87147  	}()
 87148  	_saved_nEq = (*t101)(unsafe.Pointer(&_pNew.Xu)).XnEq
 87149  	_saved_nBtm = (*t101)(unsafe.Pointer(&_pNew.Xu)).XnBtm
 87150  	_saved_nTop = (*t101)(unsafe.Pointer(&_pNew.Xu)).XnTop
 87151  	_saved_nSkip = _pNew.XnSkip
 87152  	_saved_nLTerm = _pNew.XnLTerm
 87153  	_saved_wsFlags = _pNew.XwsFlags
 87154  	_saved_prereq = _pNew.Xprereq
 87155  	_saved_nOut = _pNew.XnOut
 87156  	_pTerm = _whereScanInit(tls, &_scan, (*XWhereClause)(_pBuilder.XpWC), _pSrc.XiCursor, int32(_saved_nEq), uint32(_opMask), _pProbe)
 87157  	_pNew.XrSetup = 0
 87158  	_rSize = *elem50(_pProbe.XaiRowLogEst, 0)
 87159  	_rLogSize = _estLog(tls, _rSize)
 87160  _12:
 87161  	if _rc != int32(0) || _pTerm == nil {
 87162  		goto _16
 87163  	}
 87164  	_3_eOp = _pTerm.XeOperator
 87165  	_3_nIn = int32(0)
 87166  	if ((int32(_3_eOp) == int32(256)) || ((int32(_pTerm.XwtFlags) & int32(0)) != int32(0))) && _indexColumnNotNull(tls, _pProbe, int32(_saved_nEq)) != 0 {
 87167  		goto _13
 87168  	}
 87169  	if (_pTerm.XprereqRight & _pNew.XmaskSelf) != 0 {
 87170  		goto _13
 87171  	}
 87172  	if (int32(_pTerm.XwtFlags)&int32(256)) != 0 && (int32(_pTerm.XeOperator) == int32(16)) {
 87173  		goto _13
 87174  	}
 87175  	if (((int32(_pSrc.Xfg.Xjointype) & int32(8)) != int32(0)) && ((((*XExpr)(_pTerm.XpExpr).Xflags) & uint32(1)) == (0))) && ((int32(_3_eOp) & int32(384)) != int32(0)) {
 87176  		goto _13
 87177  	}
 87178  	if (int32(_pProbe.XonError) != int32(0)) && (int32(_saved_nEq) == (int32(_pProbe.XnKeyCol) - int32(1))) {
 87179  		_pBuilder.XbldFlags |= uint32(2)
 87180  		goto _28
 87181  	}
 87182  	_pBuilder.XbldFlags |= uint32(1)
 87183  _28:
 87184  	_pNew.XwsFlags = _saved_wsFlags
 87185  	(*t101)(unsafe.Pointer(&_pNew.Xu)).XnEq = _saved_nEq
 87186  	(*t101)(unsafe.Pointer(&_pNew.Xu)).XnBtm = _saved_nBtm
 87187  	(*t101)(unsafe.Pointer(&_pNew.Xu)).XnTop = _saved_nTop
 87188  	_pNew.XnLTerm = _saved_nLTerm
 87189  	if _whereLoopResize(tls, _db, _pNew, int32(_pNew.XnLTerm)+int32(1)) != 0 {
 87190  		goto _16
 87191  	}
 87192  	*elem104((**XWhereTerm)(unsafe.Pointer(_pNew.XaLTerm)), uintptr(postInc76(&_pNew.XnLTerm, uint16(1)))) = _pTerm
 87193  	_pNew.Xprereq = (_saved_prereq | _pTerm.XprereqRight) & (^_pNew.XmaskSelf)
 87194  	func() {
 87195  		if int32(_nInMul) != int32(0) && (_pNew.XwsFlags&uint32(8)) == (0) && (_pNew.XwsFlags&uint32(4)) == (0) && (_pNew.XwsFlags&uint32(32768)) == (0) {
 87196  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132797), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(105828)))
 87197  			crt.X__builtin_abort(tls)
 87198  		}
 87199  	}()
 87200  	if (int32(_3_eOp) & int32(1)) == 0 {
 87201  		goto _35
 87202  	}
 87203  	_8_pExpr = (*XExpr)(_pTerm.XpExpr)
 87204  	_pNew.XwsFlags |= uint32(4)
 87205  	if (_8_pExpr.Xflags & uint32(2048)) == (0) {
 87206  		goto _36
 87207  	}
 87208  	_3_nIn = int32(46)
 87209  	func() {
 87210  		if int32(46) != int32(_sqlite3LogEst(tls, uint64(25))) {
 87211  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132809), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(105959)))
 87212  			crt.X__builtin_abort(tls)
 87213  		}
 87214  	}()
 87215  	_9_i = int32(0)
 87216  _39:
 87217  	if _9_i >= (int32(_pNew.XnLTerm) - int32(1)) {
 87218  		goto _42
 87219  	}
 87220  	if ((*elem104((**XWhereTerm)(unsafe.Pointer(_pNew.XaLTerm)), uintptr(_9_i))) != nil) && ((*XExpr)((*elem104((**XWhereTerm)(unsafe.Pointer(_pNew.XaLTerm)), uintptr(_9_i))).XpExpr) == _8_pExpr) {
 87221  		_3_nIn = int32(0)
 87222  	}
 87223  	_9_i += 1
 87224  	goto _39
 87225  _42:
 87226  	goto _49
 87227  _36:
 87228  	if func() int32 {
 87229  		if ((*(*unsafe.Pointer)(unsafe.Pointer(&_8_pExpr.Xx))) != nil) && ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_8_pExpr.Xx))).XnExpr) != 0 {
 87230  			return int32(1)
 87231  		}
 87232  		return func() int32 {
 87233  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132819), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(4809)))
 87234  			crt.X__builtin_abort(tls)
 87235  			return int32(0)
 87236  		}()
 87237  	}() != 0 {
 87238  		_3_nIn = int32(_sqlite3LogEst(tls, uint64((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_8_pExpr.Xx))).XnExpr)))
 87239  		func() {
 87240  			if _3_nIn <= int32(0) {
 87241  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132822), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(105981)))
 87242  				crt.X__builtin_abort(tls)
 87243  			}
 87244  		}()
 87245  	}
 87246  _49:
 87247  	goto _75
 87248  _35:
 87249  	if (int32(_3_eOp) & int32(130)) == 0 {
 87250  		goto _53
 87251  	}
 87252  	_12_iCol = int32(*elem50(_pProbe.XaiColumn, uintptr(_saved_nEq)))
 87253  	_pNew.XwsFlags |= uint32(1)
 87254  	func() {
 87255  		if int32(_saved_nEq) != int32((*t101)(unsafe.Pointer(&_pNew.Xu)).XnEq) {
 87256  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132828), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(105987)))
 87257  			crt.X__builtin_abort(tls)
 87258  		}
 87259  	}()
 87260  	if _12_iCol != int32(-1) && (_12_iCol <= int32(0) || int32(_nInMul) != int32(0) || int32(_saved_nEq) != (int32(_pProbe.XnKeyCol)-int32(1))) {
 87261  		goto _59
 87262  	}
 87263  	if (_12_iCol >= int32(0)) && (int32((uint32(_pProbe.XidxType>>3)<<31)>>31) == int32(0)) {
 87264  		_pNew.XwsFlags |= uint32(65536)
 87265  		goto _62
 87266  	}
 87267  	_pNew.XwsFlags |= uint32(4096)
 87268  _62:
 87269  _59:
 87270  	goto _75
 87271  _53:
 87272  	if (int32(_3_eOp) & int32(256)) != 0 {
 87273  		_pNew.XwsFlags |= uint32(8)
 87274  		goto _75
 87275  	}
 87276  	if (int32(_3_eOp) & int32(36)) == 0 {
 87277  		goto _66
 87278  	}
 87279  	_pNew.XwsFlags |= uint32(34)
 87280  	(*t101)(unsafe.Pointer(&_pNew.Xu)).XnBtm = uint16(_whereRangeVectorLen(tls, _pParse, _pSrc.XiCursor, _pProbe, int32(_saved_nEq), _pTerm))
 87281  	_pBtm = _pTerm
 87282  	_pTop = nil
 87283  	if (int32(_pTerm.XwtFlags) & int32(256)) == 0 {
 87284  		goto _67
 87285  	}
 87286  	_pTop = elem100(_pTerm, uintptr(1))
 87287  	func() {
 87288  		if int32((uintptr(unsafe.Pointer(_pTop))-uintptr((*XWhereClause)(_pTerm.XpWC).Xa))/48) >= ((*XWhereClause)(_pTerm.XpWC).XnTerm) {
 87289  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132853), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(106016)))
 87290  			crt.X__builtin_abort(tls)
 87291  		}
 87292  	}()
 87293  	func() {
 87294  		if (int32(_pTop.XwtFlags) & int32(256)) == 0 {
 87295  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132854), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(106057)))
 87296  			crt.X__builtin_abort(tls)
 87297  		}
 87298  	}()
 87299  	func() {
 87300  		if int32(_pTop.XeOperator) != int32(16) {
 87301  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132855), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(106086)))
 87302  			crt.X__builtin_abort(tls)
 87303  		}
 87304  	}()
 87305  	if _whereLoopResize(tls, _db, _pNew, int32(_pNew.XnLTerm)+int32(1)) != 0 {
 87306  		goto _16
 87307  	}
 87308  	*elem104((**XWhereTerm)(unsafe.Pointer(_pNew.XaLTerm)), uintptr(postInc76(&_pNew.XnLTerm, uint16(1)))) = _pTop
 87309  	_pNew.XwsFlags |= uint32(16)
 87310  	(*t101)(unsafe.Pointer(&_pNew.Xu)).XnTop = uint16(1)
 87311  _67:
 87312  	goto _75
 87313  _66:
 87314  	func() {
 87315  		if (int32(_3_eOp) & int32(24)) == 0 {
 87316  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132862), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(106109)))
 87317  			crt.X__builtin_abort(tls)
 87318  		}
 87319  	}()
 87320  	_pNew.XwsFlags |= uint32(18)
 87321  	(*t101)(unsafe.Pointer(&_pNew.Xu)).XnTop = uint16(_whereRangeVectorLen(tls, _pParse, _pSrc.XiCursor, _pProbe, int32(_saved_nEq), _pTerm))
 87322  	_pTop = _pTerm
 87323  	_pBtm = func() *XWhereTerm {
 87324  		if (_pNew.XwsFlags & uint32(32)) != (0) {
 87325  			return (*elem104((**XWhereTerm)(unsafe.Pointer(_pNew.XaLTerm)), uintptr(int32(_pNew.XnLTerm)-int32(2))))
 87326  		}
 87327  		return nil
 87328  	}()
 87329  _75:
 87330  	func() {
 87331  		if int32(_pNew.XnOut) != int32(_saved_nOut) {
 87332  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132879), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(106129)))
 87333  			crt.X__builtin_abort(tls)
 87334  		}
 87335  	}()
 87336  	if (_pNew.XwsFlags & uint32(2)) != 0 {
 87337  		_whereRangeScanEst(tls, _pParse, _pBuilder, _pBtm, _pTop, _pNew)
 87338  		goto _83
 87339  	}
 87340  	_21_nEq = int32(preInc76(&((*t101)(unsafe.Pointer(&_pNew.Xu)).XnEq), uint16(1)))
 87341  	func() {
 87342  		if (int32(_3_eOp) & int32(387)) == 0 {
 87343  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132886), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(106152)))
 87344  			crt.X__builtin_abort(tls)
 87345  		}
 87346  	}()
 87347  	func() {
 87348  		if int32(_pNew.XnOut) != int32(_saved_nOut) {
 87349  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132888), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(106129)))
 87350  			crt.X__builtin_abort(tls)
 87351  		}
 87352  	}()
 87353  	if (int32(_pTerm.XtruthProb) <= int32(0)) && (int32(*elem50(_pProbe.XaiColumn, uintptr(_saved_nEq))) >= int32(0)) {
 87354  		func() {
 87355  			if (int32(_3_eOp)&int32(1)) == 0 && _3_nIn != int32(0) {
 87356  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132890), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(106188)))
 87357  				crt.X__builtin_abort(tls)
 87358  			}
 87359  		}()
 87360  		{
 87361  			p := &_pNew.XnOut
 87362  			*p = int16(int32(*p) + int32(_pTerm.XtruthProb))
 87363  		}
 87364  		{
 87365  			p := &_pNew.XnOut
 87366  			*p = int16(int32(*p) - _3_nIn)
 87367  		}
 87368  		goto _93
 87369  	}
 87370  	{
 87371  		p := &_pNew.XnOut
 87372  		*p = int16(int32(*p) + (int32(*elem50(_pProbe.XaiRowLogEst, uintptr(_21_nEq))) - int32(*elem50(_pProbe.XaiRowLogEst, uintptr(_21_nEq-int32(1))))))
 87373  	}
 87374  	if (int32(_3_eOp) & int32(256)) != 0 {
 87375  		{
 87376  			p := &_pNew.XnOut
 87377  			*p = int16(int32(*p) + int32(10))
 87378  		}
 87379  	}
 87380  _93:
 87381  _83:
 87382  	_3_rCostIdx = int16((int32(_pNew.XnOut) + int32(1)) + ((int32(15) * int32(_pProbe.XszIdxRow)) / int32((*XTable)(_pSrc.XpTab).XszTabRow)))
 87383  	_pNew.XrRun = _sqlite3LogEstAdd(tls, _rLogSize, _3_rCostIdx)
 87384  	if (_pNew.XwsFlags & uint32(320)) == (0) {
 87385  		_pNew.XrRun = _sqlite3LogEstAdd(tls, _pNew.XrRun, int16(int32(_pNew.XnOut)+int32(16)))
 87386  	}
 87387  	_3_nOutUnadjusted = _pNew.XnOut
 87388  	{
 87389  		p := &_pNew.XrRun
 87390  		*p = int16(int32(*p) + (int32(_nInMul) + _3_nIn))
 87391  	}
 87392  	{
 87393  		p := &_pNew.XnOut
 87394  		*p = int16(int32(*p) + (int32(_nInMul) + _3_nIn))
 87395  	}
 87396  	_whereLoopOutputAdjust(tls, (*XWhereClause)(_pBuilder.XpWC), _pNew, _rSize)
 87397  	_rc = _whereLoopInsert(tls, _pBuilder, _pNew)
 87398  	if (_pNew.XwsFlags & uint32(2)) != 0 {
 87399  		_pNew.XnOut = _saved_nOut
 87400  		goto _97
 87401  	}
 87402  	_pNew.XnOut = _3_nOutUnadjusted
 87403  _97:
 87404  	if ((_pNew.XwsFlags & uint32(16)) == (0)) && (int32((*t101)(unsafe.Pointer(&_pNew.Xu)).XnEq) < int32(_pProbe.XnColumn)) {
 87405  		_whereLoopAddBtreeIndex(tls, _pBuilder, _pSrc, _pProbe, int16(int32(_nInMul)+_3_nIn))
 87406  	}
 87407  	_pNew.XnOut = _saved_nOut
 87408  _13:
 87409  	_pTerm = _whereScanNext(tls, &_scan)
 87410  	goto _12
 87411  _16:
 87412  	_pNew.Xprereq = _saved_prereq
 87413  	(*t101)(unsafe.Pointer(&_pNew.Xu)).XnEq = _saved_nEq
 87414  	(*t101)(unsafe.Pointer(&_pNew.Xu)).XnBtm = _saved_nBtm
 87415  	(*t101)(unsafe.Pointer(&_pNew.Xu)).XnTop = _saved_nTop
 87416  	_pNew.XnSkip = _saved_nSkip
 87417  	_pNew.XwsFlags = _saved_wsFlags
 87418  	_pNew.XnOut = _saved_nOut
 87419  	_pNew.XnLTerm = _saved_nLTerm
 87420  	func() {
 87421  		if int32(42) != int32(_sqlite3LogEst(tls, uint64(18))) {
 87422  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132985), unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000), unsafe.Pointer(str(106212)))
 87423  			crt.X__builtin_abort(tls)
 87424  		}
 87425  	}()
 87426  	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(*elem50(_pProbe.XaiRowLogEst, uintptr(int32(_saved_nEq)+int32(1)))) >= int32(42))) && (store2(&_rc, _whereLoopResize(tls, _db, _pNew, int32(_pNew.XnLTerm)+int32(1))) == int32(0)) {
 87427  		(*t101)(unsafe.Pointer(&_pNew.Xu)).XnEq += 1
 87428  		_pNew.XnSkip += 1
 87429  		*elem104((**XWhereTerm)(unsafe.Pointer(_pNew.XaLTerm)), uintptr(postInc76(&_pNew.XnLTerm, uint16(1)))) = nil
 87430  		_pNew.XwsFlags |= uint32(32768)
 87431  		_30_nIter = int16(int32(*elem50(_pProbe.XaiRowLogEst, uintptr(_saved_nEq))) - int32(*elem50(_pProbe.XaiRowLogEst, uintptr(int32(_saved_nEq)+int32(1)))))
 87432  		{
 87433  			p := &_pNew.XnOut
 87434  			*p = int16(int32(*p) - int32(_30_nIter))
 87435  		}
 87436  		{
 87437  			p := &_30_nIter
 87438  			*p = int16(int32(*p) + int32(5))
 87439  		}
 87440  		_whereLoopAddBtreeIndex(tls, _pBuilder, _pSrc, _pProbe, int16(int32(_30_nIter)+int32(_nInMul)))
 87441  		_pNew.XnOut = _saved_nOut
 87442  		(*t101)(unsafe.Pointer(&_pNew.Xu)).XnEq = _saved_nEq
 87443  		_pNew.XnSkip = _saved_nSkip
 87444  		_pNew.XwsFlags = _saved_wsFlags
 87445  	}
 87446  	return _rc
 87447  }
 87448  
 87449  var _whereLoopAddBtreeIndexØ00__func__Ø000 [23]int8
 87450  
 87451  func init() {
 87452  	crt.Xstrncpy(nil, &_whereLoopAddBtreeIndexØ00__func__Ø000[0], str(106234), 23)
 87453  }
 87454  
 87455  // C comment
 87456  //  /*
 87457  //  ** Term pTerm is a vector range comparison operation. The first comparison
 87458  //  ** in the vector can be optimized using column nEq of the index. This
 87459  //  ** function returns the total number of vector elements that can be used
 87460  //  ** as part of the range comparison.
 87461  //  **
 87462  //  ** For example, if the query is:
 87463  //  **
 87464  //  **   WHERE a = ? AND (b, c, d) > (?, ?, ?)
 87465  //  **
 87466  //  ** and the index:
 87467  //  **
 87468  //  **   CREATE INDEX ... ON (a, b, c, d, e)
 87469  //  **
 87470  //  ** then this function would be invoked with nEq=1. The value returned in
 87471  //  ** this case is 3.
 87472  //  */
 87473  func _whereRangeVectorLen(tls *crt.TLS, _pParse *XParse, _iCur int32, _pIdx *XIndex, _nEq int32, _pTerm *XWhereTerm) (r0 int32) {
 87474  	var _nCmp, _i int32
 87475  	var _1_aff, _1_idxaff int8
 87476  	var _1_pLhs, _1_pRhs *XExpr
 87477  	var _1_pColl *XCollSeq
 87478  	_nCmp = _sqlite3ExprVectorSize(tls, (*XExpr)((*XExpr)(_pTerm.XpExpr).XpLeft))
 87479  	_nCmp = func() int32 {
 87480  		if _nCmp < (int32(_pIdx.XnColumn) - _nEq) {
 87481  			return _nCmp
 87482  		}
 87483  		return (int32(_pIdx.XnColumn) - _nEq)
 87484  	}()
 87485  	_i = int32(1)
 87486  _2:
 87487  	if _i >= _nCmp {
 87488  		goto _5
 87489  	}
 87490  	_1_idxaff = 0
 87491  	_1_pLhs = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&((*XExpr)((*XExpr)(_pTerm.XpExpr).XpLeft).Xx)))).Xa))), uintptr(_i)).XpExpr)
 87492  	_1_pRhs = (*XExpr)((*XExpr)(_pTerm.XpExpr).XpRight)
 87493  	if (_1_pRhs.Xflags & uint32(2048)) != 0 {
 87494  		_1_pRhs = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_1_pRhs.Xx))).XpEList).Xa))), uintptr(_i)).XpExpr)
 87495  		goto _7
 87496  	}
 87497  	_1_pRhs = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_1_pRhs.Xx))).Xa))), uintptr(_i)).XpExpr)
 87498  _7:
 87499  	if (((int32(_1_pLhs.Xop) != int32(152)) || (_1_pLhs.XiTable != _iCur)) || (int32(_1_pLhs.XiColumn) != int32(*elem50(_pIdx.XaiColumn, uintptr(_i+_nEq))))) || (int32(*elem15(_pIdx.XaSortOrder, uintptr(_i+_nEq))) != int32(*elem15(_pIdx.XaSortOrder, uintptr(_nEq)))) {
 87500  		goto _5
 87501  	}
 87502  	_1_aff = _sqlite3CompareAffinity(tls, _1_pRhs, _sqlite3ExprAffinity(tls, _1_pLhs))
 87503  	_1_idxaff = _sqlite3TableColumnAffinity(tls, (*XTable)(_pIdx.XpTable), int32(_1_pLhs.XiColumn))
 87504  	if int32(_1_aff) != int32(_1_idxaff) {
 87505  		goto _5
 87506  	}
 87507  	_1_pColl = _sqlite3BinaryCompareCollSeq(tls, _pParse, _1_pLhs, _1_pRhs)
 87508  	if _1_pColl == nil {
 87509  		goto _5
 87510  	}
 87511  	if _sqlite3StrICmp(tls, _1_pColl.XzName, *elem0(_pIdx.XazColl, uintptr(_i+_nEq))) != 0 {
 87512  		goto _5
 87513  	}
 87514  	_i += 1
 87515  	goto _2
 87516  _5:
 87517  	return _i
 87518  }
 87519  
 87520  // C comment
 87521  //  /*
 87522  //  ** This function is used to estimate the number of rows that will be visited
 87523  //  ** by scanning an index for a range of values. The range may have an upper
 87524  //  ** bound, a lower bound, or both. The WHERE clause terms that set the upper
 87525  //  ** and lower bounds are represented by pLower and pUpper respectively. For
 87526  //  ** example, assuming that index p is on t1(a):
 87527  //  **
 87528  //  **   ... FROM t1 WHERE a > ? AND a < ? ...
 87529  //  **                    |_____|   |_____|
 87530  //  **                       |         |
 87531  //  **                     pLower    pUpper
 87532  //  **
 87533  //  ** If either of the upper or lower bound is not present, then NULL is passed in
 87534  //  ** place of the corresponding WhereTerm.
 87535  //  **
 87536  //  ** The value in (pBuilder->pNew->u.btree.nEq) is the number of the index
 87537  //  ** column subject to the range constraint. Or, equivalently, the number of
 87538  //  ** equality constraints optimized by the proposed index scan. For example,
 87539  //  ** assuming index p is on t1(a, b), and the SQL query is:
 87540  //  **
 87541  //  **   ... FROM t1 WHERE a = ? AND b > ? AND b < ? ...
 87542  //  **
 87543  //  ** then nEq is set to 1 (as the range restricted column, b, is the second
 87544  //  ** left-most column of the index). Or, if the query is:
 87545  //  **
 87546  //  **   ... FROM t1 WHERE a > ? AND a < ? ...
 87547  //  **
 87548  //  ** then nEq is set to 0.
 87549  //  **
 87550  //  ** When this function is called, *pnOut is set to the sqlite3LogEst() of the
 87551  //  ** number of rows that the index scan is expected to visit without
 87552  //  ** considering the range constraints. If nEq is 0, then *pnOut is the number of
 87553  //  ** rows in the index. Assuming no error occurs, *pnOut is adjusted (reduced)
 87554  //  ** to account for the range constraints pLower and pUpper.
 87555  //  **
 87556  //  ** In the absence of sqlite_stat4 ANALYZE data, or if such data cannot be
 87557  //  ** used, a single range inequality reduces the search space by a factor of 4.
 87558  //  ** and a pair of constraints (x>? AND x<?) reduces the expected number of
 87559  //  ** rows visited by a factor of 64.
 87560  //  */
 87561  func _whereRangeScanEst(tls *crt.TLS, _pParse *XParse, _pBuilder *XWhereLoopBuilder, _pLower *XWhereTerm, _pUpper *XWhereTerm, _pLoop *XWhereLoop) (r0 int32) {
 87562  	var _nNew int16
 87563  	var _rc, _nOut int32
 87564  	_rc = int32(0)
 87565  	_nOut = int32(_pLoop.XnOut)
 87566  
 87567  	func() {
 87568  		if _pLower == nil && _pUpper == nil {
 87569  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131911), unsafe.Pointer(&_whereRangeScanEstØ00__func__Ø000), unsafe.Pointer(str(106257)))
 87570  			crt.X__builtin_abort(tls)
 87571  		}
 87572  	}()
 87573  	func() {
 87574  		if _pUpper != nil && (int32(_pUpper.XwtFlags)&int32(0)) != int32(0) {
 87575  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131913), unsafe.Pointer(&_whereRangeScanEstØ00__func__Ø000), unsafe.Pointer(str(106274)))
 87576  			crt.X__builtin_abort(tls)
 87577  		}
 87578  	}()
 87579  	_nNew = _whereRangeAdjust(tls, _pLower, int16(_nOut))
 87580  	_nNew = _whereRangeAdjust(tls, _pUpper, _nNew)
 87581  	if (((_pLower != nil) && (int32(_pLower.XtruthProb) > int32(0))) && (_pUpper != nil)) && (int32(_pUpper.XtruthProb) > int32(0)) {
 87582  		{
 87583  			p := &_nNew
 87584  			*p = int16(int32(*p) - int32(20))
 87585  		}
 87586  	}
 87587  	_nOut -= bool2int(_pLower != nil) + bool2int(_pUpper != nil)
 87588  	if int32(_nNew) < int32(10) {
 87589  		_nNew = int16(10)
 87590  	}
 87591  	if int32(_nNew) < _nOut {
 87592  		_nOut = int32(_nNew)
 87593  	}
 87594  	_pLoop.XnOut = int16(_nOut)
 87595  	return _rc
 87596  }
 87597  
 87598  var _whereRangeScanEstØ00__func__Ø000 [18]int8
 87599  
 87600  func init() {
 87601  	crt.Xstrncpy(nil, &_whereRangeScanEstØ00__func__Ø000[0], str(106321), 18)
 87602  }
 87603  
 87604  // C comment
 87605  //  /*
 87606  //  ** If it is not NULL, pTerm is a term that provides an upper or lower
 87607  //  ** bound on a range scan. Without considering pTerm, it is estimated
 87608  //  ** that the scan will visit nNew rows. This function returns the number
 87609  //  ** estimated to be visited after taking pTerm into account.
 87610  //  **
 87611  //  ** If the user explicitly specified a likelihood() value for this term,
 87612  //  ** then the return value is the likelihood multiplied by the number of
 87613  //  ** input rows. Otherwise, this function assumes that an "IS NOT NULL" term
 87614  //  ** has a likelihood of 0.50, and any other term a likelihood of 0.25.
 87615  //  */
 87616  func _whereRangeAdjust(tls *crt.TLS, _pTerm *XWhereTerm, _nNew int16) (r0 int16) {
 87617  	var _nRet int16
 87618  	_nRet = _nNew
 87619  	if _pTerm == nil {
 87620  		goto _0
 87621  	}
 87622  	if int32(_pTerm.XtruthProb) <= int32(0) {
 87623  		{
 87624  			p := &_nRet
 87625  			*p = int16(int32(*p) + int32(_pTerm.XtruthProb))
 87626  		}
 87627  		goto _3
 87628  	}
 87629  	if (int32(_pTerm.XwtFlags) & int32(0)) == int32(0) {
 87630  		{
 87631  			p := &_nRet
 87632  			*p = int16(int32(*p) - int32(20))
 87633  		}
 87634  		func() {
 87635  			if int32(20) != int32(_sqlite3LogEst(tls, uint64(4))) {
 87636  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131610), unsafe.Pointer(&_whereRangeAdjustØ00__func__Ø000), unsafe.Pointer(str(106339)))
 87637  				crt.X__builtin_abort(tls)
 87638  			}
 87639  		}()
 87640  	}
 87641  _3:
 87642  _0:
 87643  	return _nRet
 87644  }
 87645  
 87646  var _whereRangeAdjustØ00__func__Ø000 [17]int8
 87647  
 87648  func init() {
 87649  	crt.Xstrncpy(nil, &_whereRangeAdjustØ00__func__Ø000[0], str(106360), 17)
 87650  }
 87651  
 87652  // C comment
 87653  //  /*
 87654  //  ** Add WhereLoop entries to handle OR terms.  This works for either
 87655  //  ** btrees or virtual tables.
 87656  //  */
 87657  func _whereLoopAddOr(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _mPrereq uint64, _mUnusable uint64) (r0 int32) {
 87658  	var _rc, _iCur, _2_once, _2_i, _2_j int32
 87659  	var _pItem *TSrcList_item
 87660  	var _pWInfo *XWhereInfo
 87661  	var _tempWC XWhereClause
 87662  	var _pNew *XWhereLoop
 87663  	var _pTerm, _pWCEnd, _2_pOrWCEnd, _2_pOrTerm *XWhereTerm
 87664  	var _pWC, _2_pOrWC *XWhereClause
 87665  	var _sSum, _sCur, _12_sPrev XWhereOrSet
 87666  	var _sSubBuild XWhereLoopBuilder
 87667  	_pWInfo = (*XWhereInfo)(_pBuilder.XpWInfo)
 87668  	_rc = int32(0)
 87669  	_pWC = (*XWhereClause)(_pBuilder.XpWC)
 87670  	_pWCEnd = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.Xa) + uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.XnTerm)*uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(48)))))))))))
 87671  	_pNew = (*XWhereLoop)(_pBuilder.XpNew)
 87672  	crt.Xmemset(tls, unsafe.Pointer(&_sSum), int32(0), uint32(40))
 87673  	_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(68)))))))))))
 87674  	_iCur = _pItem.XiCursor
 87675  	_pTerm = (*XWhereTerm)(_pWC.Xa)
 87676  _0:
 87677  	if crt.P2U(unsafe.Pointer(_pTerm)) >= crt.P2U(unsafe.Pointer(_pWCEnd)) || _rc != int32(0) {
 87678  		goto _4
 87679  	}
 87680  	if (int32(_pTerm.XeOperator)&int32(512)) == int32(0) || (((*XWhereOrInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_pTerm.Xu))).Xindexable)&_pNew.XmaskSelf) == (0) {
 87681  		goto _6
 87682  	}
 87683  	_2_pOrWC = &((*XWhereOrInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_pTerm.Xu))).Xwc)
 87684  	_2_pOrWCEnd = elem100((*XWhereTerm)(_2_pOrWC.Xa), uintptr(_2_pOrWC.XnTerm))
 87685  	_2_once = int32(1)
 87686  	_sSubBuild = *_pBuilder
 87687  	*(**XExprList)(unsafe.Pointer(&_sSubBuild.XpOrderBy)) = nil
 87688  	*(**XWhereOrSet)(unsafe.Pointer(&_sSubBuild.XpOrSet)) = &_sCur
 87689  	_2_pOrTerm = (*XWhereTerm)(_2_pOrWC.Xa)
 87690  _7:
 87691  	if crt.P2U(unsafe.Pointer(_2_pOrTerm)) >= crt.P2U(unsafe.Pointer(_2_pOrWCEnd)) {
 87692  		goto _10
 87693  	}
 87694  	if (int32(_2_pOrTerm.XeOperator) & int32(1024)) != int32(0) {
 87695  		*(**XWhereClause)(unsafe.Pointer(&_sSubBuild.XpWC)) = &((*XWhereAndInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_2_pOrTerm.Xu))).Xwc)
 87696  		goto _14
 87697  	}
 87698  	if _2_pOrTerm.XleftCursor == _iCur {
 87699  		*(**XWhereInfo)(unsafe.Pointer(&_tempWC.XpWInfo)) = (*XWhereInfo)(_pWC.XpWInfo)
 87700  		*(**XWhereClause)(unsafe.Pointer(&_tempWC.XpOuter)) = _pWC
 87701  		_tempWC.Xop = uint8(71)
 87702  		_tempWC.XnTerm = int32(1)
 87703  		*(**XWhereTerm)(unsafe.Pointer(&_tempWC.Xa)) = _2_pOrTerm
 87704  		*(**XWhereClause)(unsafe.Pointer(&_sSubBuild.XpWC)) = &_tempWC
 87705  		goto _14
 87706  	}
 87707  	goto _8
 87708  _14:
 87709  	_sCur.Xn = 0
 87710  	if ((*XTable)(_pItem.XpTab).XnModuleArg) != 0 {
 87711  		_rc = _whereLoopAddVirtual(tls, &_sSubBuild, _mPrereq, _mUnusable)
 87712  		goto _16
 87713  	}
 87714  	_rc = _whereLoopAddBtree(tls, &_sSubBuild, _mPrereq)
 87715  _16:
 87716  	if _rc == int32(0) {
 87717  		_rc = _whereLoopAddOr(tls, &_sSubBuild, _mPrereq, _mUnusable)
 87718  	}
 87719  	func() {
 87720  		if _rc != int32(0) && int32(_sCur.Xn) != int32(0) {
 87721  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133724), unsafe.Pointer(&_whereLoopAddOrØ00__func__Ø000), unsafe.Pointer(str(106377)))
 87722  			crt.X__builtin_abort(tls)
 87723  		}
 87724  	}()
 87725  	if int32(_sCur.Xn) == int32(0) {
 87726  		_sSum.Xn = 0
 87727  		goto _10
 87728  	}
 87729  	if _2_once != 0 {
 87730  		_whereOrMove(tls, &_sSum, &_sCur)
 87731  		_2_once = int32(0)
 87732  		goto _24
 87733  	}
 87734  	_whereOrMove(tls, &_12_sPrev, &_sSum)
 87735  	_sSum.Xn = 0
 87736  	_2_i = int32(0)
 87737  _25:
 87738  	if _2_i >= int32(_12_sPrev.Xn) {
 87739  		goto _28
 87740  	}
 87741  	_2_j = int32(0)
 87742  _29:
 87743  	if _2_j >= int32(_sCur.Xn) {
 87744  		goto _32
 87745  	}
 87746  	_whereOrInsert(tls, &_sSum, (elem110((*XWhereOrCost)(unsafe.Pointer(&_12_sPrev.Xa)), uintptr(_2_i)).Xprereq)|(elem110((*XWhereOrCost)(unsafe.Pointer(&_sCur.Xa)), uintptr(_2_j)).Xprereq), _sqlite3LogEstAdd(tls, elem110((*XWhereOrCost)(unsafe.Pointer(&_12_sPrev.Xa)), uintptr(_2_i)).XrRun, elem110((*XWhereOrCost)(unsafe.Pointer(&_sCur.Xa)), uintptr(_2_j)).XrRun), _sqlite3LogEstAdd(tls, elem110((*XWhereOrCost)(unsafe.Pointer(&_12_sPrev.Xa)), uintptr(_2_i)).XnOut, elem110((*XWhereOrCost)(unsafe.Pointer(&_sCur.Xa)), uintptr(_2_j)).XnOut))
 87747  	_2_j += 1
 87748  	goto _29
 87749  _32:
 87750  	_2_i += 1
 87751  	goto _25
 87752  _28:
 87753  _24:
 87754  _8:
 87755  	*(*uintptr)(unsafe.Pointer(&_2_pOrTerm)) += uintptr(48)
 87756  	goto _7
 87757  _10:
 87758  	_pNew.XnLTerm = uint16(1)
 87759  	*elem104((**XWhereTerm)(unsafe.Pointer(_pNew.XaLTerm)), 0) = _pTerm
 87760  	_pNew.XwsFlags = uint32(8192)
 87761  	_pNew.XrSetup = 0
 87762  	_pNew.XiSortIdx = 0
 87763  	crt.Xmemset(tls, unsafe.Pointer(&_pNew.Xu), int32(0), uint32(12))
 87764  	_2_i = int32(0)
 87765  _33:
 87766  	if _rc != int32(0) || _2_i >= int32(_sSum.Xn) {
 87767  		goto _37
 87768  	}
 87769  	_pNew.XrRun = int16(int32(elem110((*XWhereOrCost)(unsafe.Pointer(&_sSum.Xa)), uintptr(_2_i)).XrRun) + int32(1))
 87770  	_pNew.XnOut = elem110((*XWhereOrCost)(unsafe.Pointer(&_sSum.Xa)), uintptr(_2_i)).XnOut
 87771  	_pNew.Xprereq = elem110((*XWhereOrCost)(unsafe.Pointer(&_sSum.Xa)), uintptr(_2_i)).Xprereq
 87772  	_rc = _whereLoopInsert(tls, _pBuilder, _pNew)
 87773  	_2_i += 1
 87774  	goto _33
 87775  _37:
 87776  _6:
 87777  	*(*uintptr)(unsafe.Pointer(&_pTerm)) += uintptr(48)
 87778  	goto _0
 87779  _4:
 87780  	return _rc
 87781  }
 87782  
 87783  var _whereLoopAddOrØ00__func__Ø000 [15]int8
 87784  
 87785  func init() {
 87786  	crt.Xstrncpy(nil, &_whereLoopAddOrØ00__func__Ø000[0], str(106404), 15)
 87787  }
 87788  
 87789  // C comment
 87790  //  /*
 87791  //  ** Move the content of pSrc into pDest
 87792  //  */
 87793  func _whereOrMove(tls *crt.TLS, _pDest *XWhereOrSet, _pSrc *XWhereOrSet) {
 87794  	_pDest.Xn = _pSrc.Xn
 87795  	crt.Xmemcpy(tls, unsafe.Pointer(&_pDest.Xa), unsafe.Pointer(&_pSrc.Xa), uint32(_pDest.Xn)*uint32(12))
 87796  }
 87797  
 87798  // C comment
 87799  //  /*
 87800  //  ** Given the list of WhereLoop objects at pWInfo->pLoops, this routine
 87801  //  ** attempts to find the lowest cost path that visits each WhereLoop
 87802  //  ** once.  This path is then loaded into the pWInfo->a[].pWLoop fields.
 87803  //  **
 87804  //  ** Assume that the total number of output rows that will need to be sorted
 87805  //  ** will be nRowEst (in the 10*log2 representation).  Or, ignore sorting
 87806  //  ** costs if nRowEst==0.
 87807  //  **
 87808  //  ** Return SQLITE_OK on success or SQLITE_NOMEM of a memory allocation
 87809  //  ** error occurs.
 87810  //  */
 87811  func _wherePathSolver(tls *crt.TLS, _pWInfo *XWhereInfo, _nRowEst int16) (r0 int32) {
 87812  	var _mxCost, _mxUnsorted, _8_nOut, _8_rCost, _8_rUnsorted int16
 87813  	var _mxChoice, _nLoop, _iLoop, _ii, _jj, _mxI, _nOrderBy, _nTo, _nFrom, _nSpace, _29_rc, _37_rc, _39_nOrder int32
 87814  	var _8_isOrdered int8
 87815  	var _36_wsFlags uint32
 87816  	var _8_maskNew, _8_revMask, _29_notUsed, _37_m, _39_revMask uint64
 87817  	var _pSpace *int8
 87818  	var _db *Xsqlite3
 87819  	var _pParse *XParse
 87820  	var _aSortCost *int16
 87821  	var _pWLoop *XWhereLoop
 87822  	var _28_pLevel *XWhereLevel
 87823  	var _pX **XWhereLoop
 87824  	var _aFrom, _aTo, _pFrom, _pTo *XWherePath
 87825  	_mxI = int32(0)
 87826  	_mxCost = int16(0)
 87827  	_mxUnsorted = int16(0)
 87828  	_aSortCost = nil
 87829  	_pParse = (*XParse)(_pWInfo.XpParse)
 87830  	_db = (*Xsqlite3)(_pParse.Xdb)
 87831  	_nLoop = int32(_pWInfo.XnLevel)
 87832  	_mxChoice = func() int32 {
 87833  		if _nLoop <= int32(1) {
 87834  			return int32(1)
 87835  		}
 87836  		return func() int32 {
 87837  			if _nLoop == int32(2) {
 87838  				return int32(5)
 87839  			}
 87840  			return int32(10)
 87841  		}()
 87842  	}()
 87843  	func() {
 87844  		if _nLoop > ((*XSrcList)(_pWInfo.XpTabList).XnSrc) {
 87845  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134255), unsafe.Pointer(&_wherePathSolverØ00__func__Ø000), unsafe.Pointer(str(106419)))
 87846  			crt.X__builtin_abort(tls)
 87847  		}
 87848  	}()
 87849  	if ((*XExprList)(_pWInfo.XpOrderBy) == nil) || (int32(_nRowEst) == int32(0)) {
 87850  		_nOrderBy = int32(0)
 87851  		goto _8
 87852  	}
 87853  	_nOrderBy = (*XExprList)(_pWInfo.XpOrderBy).XnExpr
 87854  _8:
 87855  	_nSpace = int32(((uint32(28) + (uint32(4) * uint32(_nLoop))) * uint32(_mxChoice)) * uint32(2))
 87856  	{
 87857  		p := &_nSpace
 87858  		*p = int32(uint32(*p) + (uint32(2) * uint32(_nOrderBy)))
 87859  	}
 87860  	_pSpace = (*int8)(_sqlite3DbMallocRawNN(tls, _db, uint64(_nSpace)))
 87861  	if _pSpace == nil {
 87862  		return _sqlite3NomemError(tls, int32(134273))
 87863  	}
 87864  	_aTo = (*XWherePath)(unsafe.Pointer(_pSpace))
 87865  	_aFrom = (*XWherePath)(unsafe.Pointer(uintptr(unsafe.Pointer(_aTo)) + uintptr(unsafe.Pointer((*XWherePath)(unsafe.Pointer(uintptr(_mxChoice)*uintptr(unsafe.Pointer((*XWherePath)(unsafe.Pointer(uintptr(28)))))))))))
 87866  	crt.Xmemset(tls, unsafe.Pointer(_aFrom), int32(0), uint32(28))
 87867  	_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(28)))))))))))))
 87868  	*func() **XWherePath { _ii = _mxChoice * int32(2); return &_pFrom }() = _aTo
 87869  _10:
 87870  	if _ii <= int32(0) {
 87871  		goto _13
 87872  	}
 87873  	*(***XWhereLoop)(unsafe.Pointer(&_pFrom.XaLoop)) = _pX
 87874  	*(*uintptr)(unsafe.Pointer(func() ***XWhereLoop {
 87875  		*(*uintptr)(unsafe.Pointer(func() **XWherePath { _ii -= 1; return &_pFrom }())) += uintptr(28)
 87876  		return &_pX
 87877  	}())) += 4 * uintptr(_nLoop)
 87878  	goto _10
 87879  _13:
 87880  	if _nOrderBy != 0 {
 87881  		_aSortCost = (*int16)(unsafe.Pointer(_pX))
 87882  		crt.Xmemset(tls, unsafe.Pointer(_aSortCost), int32(0), uint32(2)*uint32(_nOrderBy))
 87883  	}
 87884  	func() {
 87885  		if _aSortCost != nil && elem1(_pSpace, uintptr(_nSpace)) != (*int8)(unsafe.Pointer(elem50(_aSortCost, uintptr(_nOrderBy)))) {
 87886  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134291), unsafe.Pointer(&_wherePathSolverØ00__func__Ø000), unsafe.Pointer(str(106449)))
 87887  			crt.X__builtin_abort(tls)
 87888  		}
 87889  	}()
 87890  	func() {
 87891  		if _aSortCost == nil && elem1(_pSpace, uintptr(_nSpace)) != (*int8)(unsafe.Pointer(_pX)) {
 87892  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134292), unsafe.Pointer(&_wherePathSolverØ00__func__Ø000), unsafe.Pointer(str(106510)))
 87893  			crt.X__builtin_abort(tls)
 87894  		}
 87895  	}()
 87896  	elem111(_aFrom, 0).XnRow = int16(func() uint32 {
 87897  		if _pParse.XnQueryLoop < uint32(48) {
 87898  			return _pParse.XnQueryLoop
 87899  		}
 87900  		return uint32(48)
 87901  	}())
 87902  	func() {
 87903  		if int32(48) != int32(_sqlite3LogEst(tls, uint64(28))) {
 87904  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134299), unsafe.Pointer(&_wherePathSolverØ00__func__Ø000), unsafe.Pointer(str(106553)))
 87905  			crt.X__builtin_abort(tls)
 87906  		}
 87907  	}()
 87908  	_nFrom = int32(1)
 87909  	func() {
 87910  		if int32(elem111(_aFrom, 0).XisOrdered) != int32(0) {
 87911  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134301), unsafe.Pointer(&_wherePathSolverØ00__func__Ø000), unsafe.Pointer(str(106575)))
 87912  			crt.X__builtin_abort(tls)
 87913  		}
 87914  	}()
 87915  	if _nOrderBy != 0 {
 87916  		elem111(_aFrom, 0).XisOrdered = int8(func() int32 {
 87917  			if _nLoop > int32(0) {
 87918  				return int32(-1)
 87919  			}
 87920  			return _nOrderBy
 87921  		}())
 87922  	}
 87923  	_iLoop = int32(0)
 87924  _30:
 87925  	if _iLoop >= _nLoop {
 87926  		goto _33
 87927  	}
 87928  	_nTo = int32(0)
 87929  	*func() **XWherePath { _ii = int32(0); return &_pFrom }() = _aFrom
 87930  _34:
 87931  	if _ii >= _nFrom {
 87932  		goto _37
 87933  	}
 87934  	_pWLoop = (*XWhereLoop)(_pWInfo.XpLoops)
 87935  _38:
 87936  	if _pWLoop == nil {
 87937  		goto _41
 87938  	}
 87939  	_8_isOrdered = _pFrom.XisOrdered
 87940  	_8_revMask = 0
 87941  	if (_pWLoop.Xprereq & (^_pFrom.XmaskLoop)) != (0) {
 87942  		goto _39
 87943  	}
 87944  	if (_pWLoop.XmaskSelf & _pFrom.XmaskLoop) != (0) {
 87945  		goto _39
 87946  	}
 87947  	if ((_pWLoop.XwsFlags & uint32(16384)) != (0)) && (int32(_pFrom.XnRow) < int32(10)) {
 87948  		func() {
 87949  			if int32(10) != int32(_sqlite3LogEst(tls, uint64(2))) {
 87950  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134331), unsafe.Pointer(&_wherePathSolverØ00__func__Ø000), unsafe.Pointer(str(86888)))
 87951  				crt.X__builtin_abort(tls)
 87952  			}
 87953  		}()
 87954  		goto _39
 87955  	}
 87956  	_8_rUnsorted = _sqlite3LogEstAdd(tls, _pWLoop.XrSetup, int16(int32(_pWLoop.XrRun)+int32(_pFrom.XnRow)))
 87957  	_8_rUnsorted = _sqlite3LogEstAdd(tls, _8_rUnsorted, _pFrom.XrUnsorted)
 87958  	_8_nOut = int16(int32(_pFrom.XnRow) + int32(_pWLoop.XnOut))
 87959  	_8_maskNew = _pFrom.XmaskLoop | _pWLoop.XmaskSelf
 87960  	if int32(_8_isOrdered) < int32(0) {
 87961  		_8_isOrdered = _wherePathSatisfiesOrderBy(tls, _pWInfo, (*XExprList)(_pWInfo.XpOrderBy), _pFrom, _pWInfo.XwctrlFlags, uint16(_iLoop), _pWLoop, &_8_revMask)
 87962  		goto _49
 87963  	}
 87964  	_8_revMask = _pFrom.XrevLoop
 87965  _49:
 87966  	if int32(_8_isOrdered) < int32(0) || int32(_8_isOrdered) >= _nOrderBy {
 87967  		goto _51
 87968  	}
 87969  	if int32(*elem50(_aSortCost, uintptr(_8_isOrdered))) == int32(0) {
 87970  		*elem50(_aSortCost, uintptr(_8_isOrdered)) = _whereSortingCost(tls, _pWInfo, _nRowEst, _nOrderBy, int32(_8_isOrdered))
 87971  	}
 87972  	_8_rCost = _sqlite3LogEstAdd(tls, _8_rUnsorted, *elem50(_aSortCost, uintptr(_8_isOrdered)))
 87973  	goto _53
 87974  _51:
 87975  	_8_rCost = _8_rUnsorted
 87976  _53:
 87977  	*func() **XWherePath { _jj = int32(0); return &_pTo }() = _aTo
 87978  _54:
 87979  	if _jj >= _nTo {
 87980  		goto _57
 87981  	}
 87982  	if (_pTo.XmaskLoop == _8_maskNew) && (((int32(_pTo.XisOrdered) ^ int32(_8_isOrdered)) & int32(128)) == int32(0)) {
 87983  		goto _57
 87984  	}
 87985  	*(*uintptr)(unsafe.Pointer(func() **XWherePath { _jj += 1; return &_pTo }())) += uintptr(28)
 87986  	goto _54
 87987  _57:
 87988  	if _jj < _nTo {
 87989  		goto _60
 87990  	}
 87991  	if (_nTo >= _mxChoice) && ((int32(_8_rCost) > int32(_mxCost)) || ((int32(_8_rCost) == int32(_mxCost)) && (int32(_8_rUnsorted) >= int32(_mxUnsorted)))) {
 87992  		goto _39
 87993  	}
 87994  	if _nTo < _mxChoice {
 87995  		_jj = postInc2(&_nTo, 1)
 87996  		goto _66
 87997  	}
 87998  	_jj = _mxI
 87999  _66:
 88000  	_pTo = elem111(_aTo, uintptr(_jj))
 88001  	goto _67
 88002  _60:
 88003  	if (int32(_pTo.XrCost) < int32(_8_rCost)) || ((int32(_pTo.XrCost) == int32(_8_rCost)) && (int32(_pTo.XnRow) <= int32(_8_nOut))) {
 88004  		goto _39
 88005  	}
 88006  _67:
 88007  	_pTo.XmaskLoop = _pFrom.XmaskLoop | _pWLoop.XmaskSelf
 88008  	_pTo.XrevLoop = _8_revMask
 88009  	_pTo.XnRow = _8_nOut
 88010  	_pTo.XrCost = _8_rCost
 88011  	_pTo.XrUnsorted = _8_rUnsorted
 88012  	_pTo.XisOrdered = _8_isOrdered
 88013  	crt.Xmemcpy(tls, unsafe.Pointer(_pTo.XaLoop), unsafe.Pointer(_pFrom.XaLoop), uint32(4)*uint32(_iLoop))
 88014  	*elem112((**XWhereLoop)(unsafe.Pointer(_pTo.XaLoop)), uintptr(_iLoop)) = _pWLoop
 88015  	if _nTo < _mxChoice {
 88016  		goto _71
 88017  	}
 88018  	_mxI = int32(0)
 88019  	_mxCost = elem111(_aTo, 0).XrCost
 88020  	_mxUnsorted = elem111(_aTo, 0).XnRow
 88021  	*func() **XWherePath { _jj = int32(1); return &_pTo }() = elem111(_aTo, uintptr(1))
 88022  _72:
 88023  	if _jj >= _mxChoice {
 88024  		goto _75
 88025  	}
 88026  	if (int32(_pTo.XrCost) > int32(_mxCost)) || ((int32(_pTo.XrCost) == int32(_mxCost)) && (int32(_pTo.XrUnsorted) > int32(_mxUnsorted))) {
 88027  		_mxCost = _pTo.XrCost
 88028  		_mxUnsorted = _pTo.XrUnsorted
 88029  		_mxI = _jj
 88030  	}
 88031  	*(*uintptr)(unsafe.Pointer(func() **XWherePath { _jj += 1; return &_pTo }())) += uintptr(28)
 88032  	goto _72
 88033  _75:
 88034  _71:
 88035  _39:
 88036  	_pWLoop = (*XWhereLoop)(_pWLoop.XpNextLoop)
 88037  	goto _38
 88038  _41:
 88039  	*(*uintptr)(unsafe.Pointer(func() **XWherePath { _ii += 1; return &_pFrom }())) += uintptr(28)
 88040  	goto _34
 88041  _37:
 88042  	_pFrom = _aTo
 88043  	_aTo = _aFrom
 88044  	_aFrom = _pFrom
 88045  	_nFrom = _nTo
 88046  	_iLoop += 1
 88047  	goto _30
 88048  _33:
 88049  	if _nFrom == int32(0) {
 88050  		_sqlite3ErrorMsg(tls, _pParse, str(106597))
 88051  		_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_pSpace))
 88052  		return int32(1)
 88053  	}
 88054  	_pFrom = _aFrom
 88055  	_ii = int32(1)
 88056  _80:
 88057  	if _ii >= _nFrom {
 88058  		goto _83
 88059  	}
 88060  	if int32(_pFrom.XrCost) > int32(elem111(_aFrom, uintptr(_ii)).XrCost) {
 88061  		_pFrom = elem111(_aFrom, uintptr(_ii))
 88062  	}
 88063  	_ii += 1
 88064  	goto _80
 88065  _83:
 88066  	func() {
 88067  		if int32(_pWInfo.XnLevel) != _nLoop {
 88068  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134512), unsafe.Pointer(&_wherePathSolverØ00__func__Ø000), unsafe.Pointer(str(106615)))
 88069  			crt.X__builtin_abort(tls)
 88070  		}
 88071  	}()
 88072  	_iLoop = int32(0)
 88073  _87:
 88074  	if _iLoop >= _nLoop {
 88075  		goto _90
 88076  	}
 88077  	_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(76)))))))))))
 88078  	*(**XWhereLoop)(unsafe.Pointer(&_28_pLevel.XpWLoop)) = store109(&_pWLoop, *elem112((**XWhereLoop)(unsafe.Pointer(_pFrom.XaLoop)), uintptr(_iLoop)))
 88079  	_28_pLevel.XiFrom = _pWLoop.XiTab
 88080  	_28_pLevel.XiTabCur = elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.XpTabList).Xa))), uintptr(_28_pLevel.XiFrom)).XiCursor
 88081  	_iLoop += 1
 88082  	goto _87
 88083  _90:
 88084  	if (int32(_pWInfo.XwctrlFlags)&int32(256)) == int32(0) || (int32(_pWInfo.XwctrlFlags)&int32(128)) != int32(0) || int32(_pWInfo.XeDistinct) != int32(0) || _nRowEst == 0 {
 88085  		goto _94
 88086  	}
 88087  	_29_rc = int32(_wherePathSatisfiesOrderBy(tls, _pWInfo, (*XExprList)(_pWInfo.XpResultSet), _pFrom, uint16(128), uint16(_nLoop-int32(1)), *elem112((**XWhereLoop)(unsafe.Pointer(_pFrom.XaLoop)), uintptr(_nLoop-int32(1))), &_29_notUsed))
 88088  	if _29_rc == ((*XExprList)(_pWInfo.XpResultSet).XnExpr) {
 88089  		_pWInfo.XeDistinct = uint8(2)
 88090  	}
 88091  _94:
 88092  	if _pWInfo.XpOrderBy == nil {
 88093  		goto _96
 88094  	}
 88095  	if (int32(_pWInfo.XwctrlFlags) & int32(128)) == 0 {
 88096  		goto _97
 88097  	}
 88098  	if int32(_pFrom.XisOrdered) == ((*XExprList)(_pWInfo.XpOrderBy).XnExpr) {
 88099  		_pWInfo.XeDistinct = uint8(2)
 88100  	}
 88101  	goto _99
 88102  _97:
 88103  	_pWInfo.XnOBSat = _pFrom.XisOrdered
 88104  	_pWInfo.XrevMask = _pFrom.XrevLoop
 88105  	if int32(_pWInfo.XnOBSat) > int32(0) {
 88106  		goto _100
 88107  	}
 88108  	_pWInfo.XnOBSat = 0
 88109  	if _nLoop <= int32(0) {
 88110  		goto _101
 88111  	}
 88112  	_36_wsFlags = (*elem112((**XWhereLoop)(unsafe.Pointer(_pFrom.XaLoop)), uintptr(_nLoop-int32(1)))).XwsFlags
 88113  	if (_36_wsFlags&uint32(4096)) != (0) || (_36_wsFlags&uint32(260)) == uint32(260) {
 88114  		goto _103
 88115  	}
 88116  	_37_m = uint64(0)
 88117  	_37_rc = int32(_wherePathSatisfiesOrderBy(tls, _pWInfo, (*XExprList)(_pWInfo.XpOrderBy), _pFrom, uint16(2048), uint16(_nLoop-int32(1)), *elem112((**XWhereLoop)(unsafe.Pointer(_pFrom.XaLoop)), uintptr(_nLoop-int32(1))), &_37_m))
 88118  	if _37_rc == ((*XExprList)(_pWInfo.XpOrderBy).XnExpr) {
 88119  		_pWInfo.XbOrderedInnerLoop = uint8(1)
 88120  		_pWInfo.XrevMask = _37_m
 88121  	}
 88122  _103:
 88123  _101:
 88124  _100:
 88125  _99:
 88126  	if (int32(_pWInfo.XwctrlFlags)&int32(512)) == 0 || int32(_pWInfo.XnOBSat) != ((*XExprList)(_pWInfo.XpOrderBy).XnExpr) || _nLoop <= int32(0) {
 88127  		goto _107
 88128  	}
 88129  	_39_revMask = uint64(0)
 88130  	_39_nOrder = int32(_wherePathSatisfiesOrderBy(tls, _pWInfo, (*XExprList)(_pWInfo.XpOrderBy), _pFrom, 0, uint16(_nLoop-int32(1)), *elem112((**XWhereLoop)(unsafe.Pointer(_pFrom.XaLoop)), uintptr(_nLoop-int32(1))), &_39_revMask))
 88131  	func() {
 88132  		if int32(_pWInfo.Xsorted) != int32(0) {
 88133  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134567), unsafe.Pointer(&_wherePathSolverØ00__func__Ø000), unsafe.Pointer(str(106637)))
 88134  			crt.X__builtin_abort(tls)
 88135  		}
 88136  	}()
 88137  	if _39_nOrder == ((*XExprList)(_pWInfo.XpOrderBy).XnExpr) {
 88138  		_pWInfo.Xsorted = uint8(1)
 88139  		_pWInfo.XrevMask = _39_revMask
 88140  	}
 88141  _107:
 88142  _96:
 88143  	_pWInfo.XnRowOut = _pFrom.XnRow
 88144  	_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_pSpace))
 88145  	return int32(0)
 88146  }
 88147  
 88148  var _wherePathSolverØ00__func__Ø000 [16]int8
 88149  
 88150  func init() {
 88151  	crt.Xstrncpy(nil, &_wherePathSolverØ00__func__Ø000[0], str(106655), 16)
 88152  }
 88153  
 88154  // C comment
 88155  //  /*
 88156  //  ** Examine a WherePath (with the addition of the extra WhereLoop of the 6th
 88157  //  ** parameters) to see if it outputs rows in the requested ORDER BY
 88158  //  ** (or GROUP BY) without requiring a separate sort operation.  Return N:
 88159  //  **
 88160  //  **   N>0:   N terms of the ORDER BY clause are satisfied
 88161  //  **   N==0:  No terms of the ORDER BY clause are satisfied
 88162  //  **   N<0:   Unknown yet how many terms of ORDER BY might be satisfied.
 88163  //  **
 88164  //  ** Note that processing for WHERE_GROUPBY and WHERE_DISTINCTBY is not as
 88165  //  ** strict.  With GROUP BY and DISTINCT the only requirement is that
 88166  //  ** equivalent rows appear immediately adjacent to one another.  GROUP BY
 88167  //  ** and DISTINCT do not require rows to appear in any particular order as long
 88168  //  ** as equivalent rows are grouped together.  Thus for GROUP BY and DISTINCT
 88169  //  ** the pOrderBy terms can be matched in any order.  With ORDER BY, the
 88170  //  ** pOrderBy terms must be matched in strict left-to-right order.
 88171  //  */
 88172  func _wherePathSatisfiesOrderBy(tls *crt.TLS, _pWInfo *XWhereInfo, _pOrderBy *XExprList, _pPath *XWherePath, _wctrlFlags uint16, _nLoop uint16, _pLast *XWhereLoop, _pRevMask *uint64) (r0 int8) {
 88173  	var _iLoop, _i, _j, _iCur, _iColumn int32
 88174  	var _obSat, _obDone, _orderDistinctMask, _ready, _38_mTerm, _41_m uint64
 88175  	var _9_z1, _9_z2 *int8
 88176  	var _eqOpMask, _nKeyCol, _nColumn, _nOrderBy, _15_eOp uint16
 88177  	var _revSet, _rev, _revIdx, _isOrderDistinct, _distinctColumns, _isMatch, _14_bOnce uint8
 88178  	var _db *Xsqlite3
 88179  	var _pOBExpr, _18_pX, _38_p *XExpr
 88180  	var _pIndex *XIndex
 88181  	var _pColl *XCollSeq
 88182  	var _pLoop *XWhereLoop
 88183  	var _pTerm *XWhereTerm
 88184  	_pLoop = nil
 88185  	_db = (*Xsqlite3)((*XParse)(_pWInfo.XpParse).Xdb)
 88186  	_obSat = uint64(0)
 88187  	func() {
 88188  		if _pOrderBy == nil {
 88189  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133901), unsafe.Pointer(&_wherePathSatisfiesOrderByØ00__func__Ø000), unsafe.Pointer(str(106671)))
 88190  			crt.X__builtin_abort(tls)
 88191  		}
 88192  	}()
 88193  	if (_nLoop != 0) && ((int32(_db.XdbOptFlags) & int32(128)) != int32(0)) {
 88194  		return 0
 88195  	}
 88196  	_nOrderBy = uint16(_pOrderBy.XnExpr)
 88197  	if int32(_nOrderBy) > int32(63) {
 88198  		return 0
 88199  	}
 88200  	_isOrderDistinct = uint8(1)
 88201  	_obDone = (uint64(1) << uint(int32(_nOrderBy))) - uint64(1)
 88202  	_orderDistinctMask = 0
 88203  	_ready = 0
 88204  	_eqOpMask = uint16(386)
 88205  	if (int32(_wctrlFlags) & int32(2048)) != 0 {
 88206  		{
 88207  			p := &_eqOpMask
 88208  			*p = uint16(int32(*p) | int32(1))
 88209  		}
 88210  	}
 88211  	_iLoop = int32(0)
 88212  _6:
 88213  	if _isOrderDistinct == 0 || _obSat >= _obDone || _iLoop > int32(_nLoop) {
 88214  		goto _11
 88215  	}
 88216  	if _iLoop > int32(0) {
 88217  		_ready |= _pLoop.XmaskSelf
 88218  	}
 88219  	if _iLoop >= int32(_nLoop) {
 88220  		goto _13
 88221  	}
 88222  	_pLoop = *elem112((**XWhereLoop)(unsafe.Pointer(_pPath.XaLoop)), uintptr(_iLoop))
 88223  	if (int32(_wctrlFlags) & int32(2048)) != 0 {
 88224  		goto _7
 88225  	}
 88226  	goto _15
 88227  _13:
 88228  	_pLoop = _pLast
 88229  _15:
 88230  	if (_pLoop.XwsFlags & uint32(1024)) == 0 {
 88231  		goto _16
 88232  	}
 88233  	if ((*t105)(unsafe.Pointer(&_pLoop.Xu)).XisOrdered) != 0 {
 88234  		_obSat = _obDone
 88235  	}
 88236  	goto _11
 88237  _16:
 88238  	(*t101)(unsafe.Pointer(&_pLoop.Xu)).XnIdxCol = 0
 88239  	_iCur = elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.XpTabList).Xa))), uintptr(_pLoop.XiTab)).XiCursor
 88240  	_i = int32(0)
 88241  _19:
 88242  	if _i >= int32(_nOrderBy) {
 88243  		goto _22
 88244  	}
 88245  	if ((uint64(1) << uint(_i)) & _obSat) != 0 {
 88246  		goto _20
 88247  	}
 88248  	_pOBExpr = _sqlite3ExprSkipCollate(tls, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_i)).XpExpr))
 88249  	if int32(_pOBExpr.Xop) != int32(152) {
 88250  		goto _20
 88251  	}
 88252  	if _pOBExpr.XiTable != _iCur {
 88253  		goto _20
 88254  	}
 88255  	_pTerm = _sqlite3WhereFindTerm(tls, &_pWInfo.XsWC, _iCur, int32(_pOBExpr.XiColumn), ^_ready, uint32(_eqOpMask), nil)
 88256  	if _pTerm == nil {
 88257  		goto _20
 88258  	}
 88259  	if int32(_pTerm.XeOperator) != int32(1) {
 88260  		goto _27
 88261  	}
 88262  	func() {
 88263  		if (int32(_wctrlFlags) & int32(2048)) == 0 {
 88264  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133946), unsafe.Pointer(&_wherePathSatisfiesOrderByØ00__func__Ø000), unsafe.Pointer(str(106683)))
 88265  			crt.X__builtin_abort(tls)
 88266  		}
 88267  	}()
 88268  	_j = int32(0)
 88269  _30:
 88270  	if _j >= int32(_pLoop.XnLTerm) || _pTerm == (*elem104((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(_j))) {
 88271  		goto _34
 88272  	}
 88273  	_j += 1
 88274  	goto _30
 88275  _34:
 88276  	if _j >= int32(_pLoop.XnLTerm) {
 88277  		goto _20
 88278  	}
 88279  _27:
 88280  	if (int32(_pTerm.XeOperator)&int32(130)) == int32(0) || int32(_pOBExpr.XiColumn) < int32(0) {
 88281  		goto _37
 88282  	}
 88283  	_pColl = _sqlite3ExprCollSeq(tls, (*XParse)(_pWInfo.XpParse), (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_i)).XpExpr))
 88284  	if _pColl == nil {
 88285  		_pColl = (*XCollSeq)(_db.XpDfltColl)
 88286  	}
 88287  	_9_z1 = _pColl.XzName
 88288  	_pColl = _sqlite3ExprCollSeq(tls, (*XParse)(_pWInfo.XpParse), (*XExpr)(_pTerm.XpExpr))
 88289  	if _pColl == nil {
 88290  		_pColl = (*XCollSeq)(_db.XpDfltColl)
 88291  	}
 88292  	_9_z2 = _pColl.XzName
 88293  	if _sqlite3StrICmp(tls, _9_z1, _9_z2) != int32(0) {
 88294  		goto _20
 88295  	}
 88296  _37:
 88297  	_obSat |= uint64(1) << uint(_i)
 88298  _20:
 88299  	_i += 1
 88300  	goto _19
 88301  _22:
 88302  	if (_pLoop.XwsFlags & uint32(4096)) != (0) {
 88303  		goto _41
 88304  	}
 88305  	if (_pLoop.XwsFlags & uint32(256)) != 0 {
 88306  		_pIndex = nil
 88307  		_nKeyCol = 0
 88308  		_nColumn = uint16(1)
 88309  		goto _46
 88310  	}
 88311  	if (store113(&_pIndex, (*XIndex)((*t101)(unsafe.Pointer(&_pLoop.Xu)).XpIndex)) == nil) || (((uint32(_pIndex.XidxType>>2) << 31) >> 31) != 0) {
 88312  		return 0
 88313  	}
 88314  	_nKeyCol = _pIndex.XnKeyCol
 88315  	_nColumn = _pIndex.XnColumn
 88316  	func() {
 88317  		if int32(_nColumn) != (int32(_nKeyCol)+int32(1)) && (((*XTable)(_pIndex.XpTable).XtabFlags)&uint32(32)) == (0) {
 88318  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133974), unsafe.Pointer(&_wherePathSatisfiesOrderByØ00__func__Ø000), unsafe.Pointer(str(106716)))
 88319  			crt.X__builtin_abort(tls)
 88320  		}
 88321  	}()
 88322  	func() {
 88323  		if int32(*elem50(_pIndex.XaiColumn, uintptr(int32(_nColumn)-int32(1)))) != int32(-1) && (((*XTable)(_pIndex.XpTable).XtabFlags)&uint32(32)) == (0) {
 88324  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133975), unsafe.Pointer(&_wherePathSatisfiesOrderByØ00__func__Ø000), unsafe.Pointer(str(106764)))
 88325  			crt.X__builtin_abort(tls)
 88326  		}
 88327  	}()
 88328  	_isOrderDistinct = uint8(bool2int(int32(_pIndex.XonError) != int32(0)))
 88329  _46:
 88330  	_rev = store3(&_revSet, 0)
 88331  	_distinctColumns = 0
 88332  	_j = int32(0)
 88333  _53:
 88334  	if _j >= int32(_nColumn) {
 88335  		goto _56
 88336  	}
 88337  	_14_bOnce = uint8(1)
 88338  	func() {
 88339  		if _j < int32((*t101)(unsafe.Pointer(&_pLoop.Xu)).XnEq) && ((*elem104((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(_j))) == nil) != (_j < int32(_pLoop.XnSkip)) {
 88340  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(133988), unsafe.Pointer(&_wherePathSatisfiesOrderByØ00__func__Ø000), unsafe.Pointer(str(106831)))
 88341  			crt.X__builtin_abort(tls)
 88342  		}
 88343  	}()
 88344  	if _j >= int32((*t101)(unsafe.Pointer(&_pLoop.Xu)).XnEq) || _j < int32(_pLoop.XnSkip) {
 88345  		goto _61
 88346  	}
 88347  	_15_eOp = (*elem104((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(_j))).XeOperator
 88348  	if (int32(_15_eOp) & int32(_eqOpMask)) == int32(0) {
 88349  		goto _62
 88350  	}
 88351  	if (int32(_15_eOp) & int32(256)) != 0 {
 88352  		_isOrderDistinct = 0
 88353  	}
 88354  	goto _54
 88355  _62:
 88356  	if func() int32 {
 88357  		if (int32(_15_eOp) & int32(1)) != 0 {
 88358  			return int32(1)
 88359  		}
 88360  		return func() int32 {
 88361  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134008), unsafe.Pointer(&_wherePathSatisfiesOrderByØ00__func__Ø000), unsafe.Pointer(str(4809)))
 88362  			crt.X__builtin_abort(tls)
 88363  			return int32(0)
 88364  		}()
 88365  	}() == 0 {
 88366  		goto _67
 88367  	}
 88368  	_18_pX = (*XExpr)((*elem104((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(_j))).XpExpr)
 88369  	_i = _j + int32(1)
 88370  _68:
 88371  	if _i >= int32((*t101)(unsafe.Pointer(&_pLoop.Xu)).XnEq) {
 88372  		goto _71
 88373  	}
 88374  	if (*XExpr)((*elem104((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(_i))).XpExpr) == _18_pX {
 88375  		func() {
 88376  			if (int32((*elem104((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(_i))).XeOperator) & int32(1)) == 0 {
 88377  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134016), unsafe.Pointer(&_wherePathSatisfiesOrderByØ00__func__Ø000), unsafe.Pointer(str(106896)))
 88378  				crt.X__builtin_abort(tls)
 88379  			}
 88380  		}()
 88381  		_14_bOnce = 0
 88382  		goto _71
 88383  	}
 88384  	_i += 1
 88385  	goto _68
 88386  _71:
 88387  _67:
 88388  _61:
 88389  	if _pIndex == nil {
 88390  		goto _75
 88391  	}
 88392  	_iColumn = int32(*elem50(_pIndex.XaiColumn, uintptr(_j)))
 88393  	_revIdx = *elem15(_pIndex.XaSortOrder, uintptr(_j))
 88394  	if _iColumn == int32((*XTable)(_pIndex.XpTable).XiPKey) {
 88395  		_iColumn = int32(-1)
 88396  	}
 88397  	goto _77
 88398  _75:
 88399  	_iColumn = int32(-1)
 88400  	_revIdx = 0
 88401  _77:
 88402  	if (((_isOrderDistinct != 0) && (_iColumn >= int32(0))) && (_j >= int32((*t101)(unsafe.Pointer(&_pLoop.Xu)).XnEq))) && (int32(elem41((*XColumn)((*XTable)(_pIndex.XpTable).XaCol), uintptr(_iColumn)).XnotNull) == int32(0)) {
 88403  		_isOrderDistinct = 0
 88404  	}
 88405  	_isMatch = 0
 88406  	_i = int32(0)
 88407  _82:
 88408  	if _14_bOnce == 0 || _i >= int32(_nOrderBy) {
 88409  		goto _86
 88410  	}
 88411  	if ((uint64(1) << uint(_i)) & _obSat) != 0 {
 88412  		goto _83
 88413  	}
 88414  	_pOBExpr = _sqlite3ExprSkipCollate(tls, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_i)).XpExpr))
 88415  	if (int32(_wctrlFlags) & int32(192)) == int32(0) {
 88416  		_14_bOnce = 0
 88417  	}
 88418  	if _iColumn < int32(-1) {
 88419  		goto _89
 88420  	}
 88421  	if int32(_pOBExpr.Xop) != int32(152) {
 88422  		goto _83
 88423  	}
 88424  	if _pOBExpr.XiTable != _iCur {
 88425  		goto _83
 88426  	}
 88427  	if int32(_pOBExpr.XiColumn) != _iColumn {
 88428  		goto _83
 88429  	}
 88430  	goto _93
 88431  _89:
 88432  	if _sqlite3ExprCompare(tls, _pOBExpr, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIndex.XaColExpr).Xa))), uintptr(_j)).XpExpr), _iCur) != 0 {
 88433  		goto _83
 88434  	}
 88435  _93:
 88436  	if _iColumn < int32(0) {
 88437  		goto _95
 88438  	}
 88439  	_pColl = _sqlite3ExprCollSeq(tls, (*XParse)(_pWInfo.XpParse), (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_i)).XpExpr))
 88440  	if _pColl == nil {
 88441  		_pColl = (*XCollSeq)(_db.XpDfltColl)
 88442  	}
 88443  	if _sqlite3StrICmp(tls, _pColl.XzName, *elem0(_pIndex.XazColl, uintptr(_j))) != int32(0) {
 88444  		goto _83
 88445  	}
 88446  _95:
 88447  	(*t101)(unsafe.Pointer(&_pLoop.Xu)).XnIdxCol = uint16(_j + int32(1))
 88448  	_isMatch = uint8(1)
 88449  	goto _86
 88450  _83:
 88451  	_i += 1
 88452  	goto _82
 88453  _86:
 88454  	if _isMatch == 0 || (int32(_wctrlFlags)&int32(64)) != int32(0) {
 88455  		goto _99
 88456  	}
 88457  	if _revSet == 0 {
 88458  		goto _100
 88459  	}
 88460  	if (int32(_rev) ^ int32(_revIdx)) != int32(elem57((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_i)).XsortOrder) {
 88461  		_isMatch = 0
 88462  	}
 88463  	goto _102
 88464  _100:
 88465  	_rev = uint8(int32(_revIdx) ^ int32(elem57((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_i)).XsortOrder))
 88466  	if _rev != 0 {
 88467  		*_pRevMask |= uint64(1) << uint(_iLoop)
 88468  	}
 88469  	_revSet = uint8(1)
 88470  _102:
 88471  _99:
 88472  	if _isMatch == 0 {
 88473  		goto _104
 88474  	}
 88475  	if _iColumn == int32(-1) {
 88476  		_distinctColumns = uint8(1)
 88477  	}
 88478  	_obSat |= uint64(1) << uint(_i)
 88479  	goto _106
 88480  _104:
 88481  	if (_j == int32(0)) || (_j < int32(_nKeyCol)) {
 88482  		_isOrderDistinct = 0
 88483  	}
 88484  	goto _56
 88485  _106:
 88486  _54:
 88487  	_j += 1
 88488  	goto _53
 88489  _56:
 88490  	if _distinctColumns != 0 {
 88491  		_isOrderDistinct = uint8(1)
 88492  	}
 88493  _41:
 88494  	if _isOrderDistinct == 0 {
 88495  		goto _110
 88496  	}
 88497  	_orderDistinctMask |= _pLoop.XmaskSelf
 88498  	_i = int32(0)
 88499  _111:
 88500  	if _i >= int32(_nOrderBy) {
 88501  		goto _114
 88502  	}
 88503  	if ((uint64(1) << uint(_i)) & _obSat) != 0 {
 88504  		goto _112
 88505  	}
 88506  	_38_p = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pOrderBy.Xa)), uintptr(_i)).XpExpr)
 88507  	_38_mTerm = _sqlite3WhereExprUsage(tls, &_pWInfo.XsMaskSet, _38_p)
 88508  	if (_38_mTerm == (0)) && (_sqlite3ExprIsConstant(tls, _38_p) == 0) {
 88509  		goto _112
 88510  	}
 88511  	if (_38_mTerm & (^_orderDistinctMask)) == (0) {
 88512  		_obSat |= uint64(1) << uint(_i)
 88513  	}
 88514  _112:
 88515  	_i += 1
 88516  	goto _111
 88517  _114:
 88518  _110:
 88519  _7:
 88520  	_iLoop += 1
 88521  	goto _6
 88522  _11:
 88523  	if _obSat == _obDone {
 88524  		return int8(_nOrderBy)
 88525  	}
 88526  	if _isOrderDistinct != 0 {
 88527  		goto _120
 88528  	}
 88529  	_i = int32(_nOrderBy) - int32(1)
 88530  _121:
 88531  	if _i <= int32(0) {
 88532  		goto _124
 88533  	}
 88534  	_41_m = (uint64(1) << uint(_i)) - uint64(1)
 88535  	if (_obSat & _41_m) == _41_m {
 88536  		return int8(_i)
 88537  	}
 88538  	_i -= 1
 88539  	goto _121
 88540  _124:
 88541  	return 0
 88542  
 88543  _120:
 88544  	return int8(-1)
 88545  }
 88546  
 88547  var _wherePathSatisfiesOrderByØ00__func__Ø000 [26]int8
 88548  
 88549  func init() {
 88550  	crt.Xstrncpy(nil, &_wherePathSatisfiesOrderByØ00__func__Ø000[0], str(106934), 26)
 88551  }
 88552  
 88553  // C comment
 88554  //  /*
 88555  //  ** Return the cost of sorting nRow rows, assuming that the keys have
 88556  //  ** nOrderby columns and that the first nSorted columns are already in
 88557  //  ** order.
 88558  //  */
 88559  func _whereSortingCost(tls *crt.TLS, _pWInfo *XWhereInfo, _nRow int16, _nOrderBy int32, _nSorted int32) (r0 int16) {
 88560  	var _rScale, _rSortCost int16
 88561  	func() {
 88562  		if _nOrderBy <= int32(0) || int32(66) != int32(_sqlite3LogEst(tls, uint64(100))) {
 88563  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134201), unsafe.Pointer(&_whereSortingCostØ00__func__Ø000), unsafe.Pointer(str(106960)))
 88564  			crt.X__builtin_abort(tls)
 88565  		}
 88566  	}()
 88567  	_rScale = int16(int32(_sqlite3LogEst(tls, uint64(((_nOrderBy-_nSorted)*int32(100))/_nOrderBy))) - int32(66))
 88568  	_rSortCost = int16((int32(_nRow) + int32(_rScale)) + int32(16))
 88569  	if ((int32(_pWInfo.XwctrlFlags) & int32(16384)) != int32(0)) && (int32(_pWInfo.XiLimit) < int32(_nRow)) {
 88570  		_nRow = _pWInfo.XiLimit
 88571  	}
 88572  	{
 88573  		p := &_rSortCost
 88574  		*p = int16(int32(*p) + int32(_estLog(tls, _nRow)))
 88575  	}
 88576  	return _rSortCost
 88577  }
 88578  
 88579  var _whereSortingCostØ00__func__Ø000 [17]int8
 88580  
 88581  func init() {
 88582  	crt.Xstrncpy(nil, &_whereSortingCostØ00__func__Ø000[0], str(106997), 17)
 88583  }
 88584  
 88585  // C comment
 88586  //  /*
 88587  //  ** Generate code to construct the Index object for an automatic index
 88588  //  ** and to set up the WhereLevel object pLevel so that the code generator
 88589  //  ** makes use of the automatic index.
 88590  //  */
 88591  func _constructAutomaticIndex(tls *crt.TLS, _pParse *XParse, _pWC *XWhereClause, _pSrc *TSrcList_item, _notReady uint64, _pLevel *XWhereLevel) {
 88592  	var _nKeyCol, _addrInit, _addrTop, _regRecord, _n, _i, _mxBitCol, _iContinue, _addrCounter, _regBase, _3_iCol, _10_iCol, _16_regYield int32
 88593  	var _idxCols, _extraCols, _3_cMask, _10_cMask uint64
 88594  	var _zNotUsed *int8
 88595  	var _sentWarning uint8
 88596  	var _pTable *XTable
 88597  	var _v *TVdbe
 88598  	var _pTabItem *TSrcList_item
 88599  	var _pPartial, _1_pExpr, _11_pX *XExpr
 88600  	var _pIdx *XIndex
 88601  	var _pColl *XCollSeq
 88602  	var _pLoop *XWhereLoop
 88603  	var _pTerm, _pWCEnd *XWhereTerm
 88604  	_sentWarning = uint8(0)
 88605  	_pPartial = nil
 88606  	_iContinue = int32(0)
 88607  	_addrCounter = int32(0)
 88608  	_v = (*TVdbe)(_pParse.XpVdbe)
 88609  	func() {
 88610  		if _v == nil {
 88611  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131050), unsafe.Pointer(&_constructAutomaticIndexØ00__func__Ø000), unsafe.Pointer(str(42019)))
 88612  			crt.X__builtin_abort(tls)
 88613  		}
 88614  	}()
 88615  	_addrInit = _sqlite3VdbeAddOp0(tls, _v, int32(20))
 88616  	_nKeyCol = int32(0)
 88617  	_pTable = (*XTable)(_pSrc.XpTab)
 88618  	_pWCEnd = elem100((*XWhereTerm)(_pWC.Xa), uintptr(_pWC.XnTerm))
 88619  	_pLoop = (*XWhereLoop)(_pLevel.XpWLoop)
 88620  	_idxCols = 0
 88621  	_pTerm = (*XWhereTerm)(_pWC.Xa)
 88622  _2:
 88623  	if crt.P2U(unsafe.Pointer(_pTerm)) >= crt.P2U(unsafe.Pointer(_pWCEnd)) {
 88624  		goto _5
 88625  	}
 88626  	_1_pExpr = (*XExpr)(_pTerm.XpExpr)
 88627  	func() {
 88628  		if (_1_pExpr.Xflags&uint32(1)) != (0) && int32(_1_pExpr.XiRightJoinTable) == _pSrc.XiCursor && _pLoop.Xprereq == (0) {
 88629  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131062), unsafe.Pointer(&_constructAutomaticIndexØ00__func__Ø000), unsafe.Pointer(str(107014)))
 88630  			crt.X__builtin_abort(tls)
 88631  		}
 88632  	}()
 88633  	if (((_pLoop.Xprereq == (0)) && ((int32(_pTerm.XwtFlags) & int32(2)) == int32(0))) && ((_1_pExpr.Xflags & uint32(1)) == (0))) && _sqlite3ExprIsTableConstant(tls, _1_pExpr, _pSrc.XiCursor) != 0 {
 88634  		_pPartial = _sqlite3ExprAnd(tls, (*Xsqlite3)(_pParse.Xdb), _pPartial, _sqlite3ExprDup(tls, (*Xsqlite3)(_pParse.Xdb), _1_pExpr, int32(0)))
 88635  	}
 88636  	if _termCanDriveIndex(tls, _pTerm, _pSrc, _notReady) == 0 {
 88637  		goto _14
 88638  	}
 88639  	_3_iCol = *(*int32)(unsafe.Pointer(&_pTerm.Xu))
 88640  	_3_cMask = func() uint64 {
 88641  		if _3_iCol >= int32(64) {
 88642  			return uint64(9223372036854775808)
 88643  		}
 88644  		return (uint64(1) << uint(_3_iCol))
 88645  	}()
 88646  	if _sentWarning == 0 {
 88647  		Xsqlite3_log(tls, int32(284), str(107112), unsafe.Pointer(_pTable.XzName), unsafe.Pointer(elem41((*XColumn)(_pTable.XaCol), uintptr(_3_iCol)).XzName))
 88648  		_sentWarning = uint8(1)
 88649  	}
 88650  	if (_idxCols & _3_cMask) != (0) {
 88651  		goto _18
 88652  	}
 88653  	if _whereLoopResize(tls, (*Xsqlite3)(_pParse.Xdb), _pLoop, _nKeyCol+int32(1)) != 0 {
 88654  		goto _end_auto_index_create
 88655  	}
 88656  	*elem104((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(postInc2(&_nKeyCol, 1))) = _pTerm
 88657  	_idxCols |= _3_cMask
 88658  _18:
 88659  _14:
 88660  	*(*uintptr)(unsafe.Pointer(&_pTerm)) += uintptr(48)
 88661  	goto _2
 88662  _5:
 88663  	func() {
 88664  		if _nKeyCol <= int32(0) {
 88665  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131092), unsafe.Pointer(&_constructAutomaticIndexØ00__func__Ø000), unsafe.Pointer(str(107138)))
 88666  			crt.X__builtin_abort(tls)
 88667  		}
 88668  	}()
 88669  	(*t101)(unsafe.Pointer(&_pLoop.Xu)).XnEq = store76(&_pLoop.XnLTerm, uint16(_nKeyCol))
 88670  	_pLoop.XwsFlags = uint32(16961)
 88671  	_extraCols = _pSrc.XcolUsed & ((^_idxCols) | uint64(9223372036854775808))
 88672  	_mxBitCol = func() int32 {
 88673  		if int32(63) < int32(_pTable.XnCol) {
 88674  			return int32(63)
 88675  		}
 88676  		return int32(_pTable.XnCol)
 88677  	}()
 88678  	_i = int32(0)
 88679  _24:
 88680  	if _i >= _mxBitCol {
 88681  		goto _27
 88682  	}
 88683  	if (_extraCols & (uint64(1) << uint(_i))) != 0 {
 88684  		_nKeyCol += 1
 88685  	}
 88686  	_i += 1
 88687  	goto _24
 88688  _27:
 88689  	if (_pSrc.XcolUsed & uint64(9223372036854775808)) != 0 {
 88690  		_nKeyCol += (int32(_pTable.XnCol) - int32(64)) + int32(1)
 88691  	}
 88692  	_pIdx = _sqlite3AllocateIndexObject(tls, (*Xsqlite3)(_pParse.Xdb), int16(_nKeyCol+int32(1)), int32(0), &_zNotUsed)
 88693  	if _pIdx == nil {
 88694  		goto _end_auto_index_create
 88695  	}
 88696  	*(**XIndex)(unsafe.Pointer(&((*t101)(unsafe.Pointer(&_pLoop.Xu)).XpIndex))) = _pIdx
 88697  	_pIdx.XzName = str(107148)
 88698  	*(**XTable)(unsafe.Pointer(&_pIdx.XpTable)) = _pTable
 88699  	_n = int32(0)
 88700  	_idxCols = 0
 88701  	_pTerm = (*XWhereTerm)(_pWC.Xa)
 88702  _31:
 88703  	if crt.P2U(unsafe.Pointer(_pTerm)) >= crt.P2U(unsafe.Pointer(_pWCEnd)) {
 88704  		goto _34
 88705  	}
 88706  	if _termCanDriveIndex(tls, _pTerm, _pSrc, _notReady) == 0 {
 88707  		goto _35
 88708  	}
 88709  	_10_iCol = *(*int32)(unsafe.Pointer(&_pTerm.Xu))
 88710  	_10_cMask = func() uint64 {
 88711  		if _10_iCol >= int32(64) {
 88712  			return uint64(9223372036854775808)
 88713  		}
 88714  		return (uint64(1) << uint(_10_iCol))
 88715  	}()
 88716  	if (_idxCols & _10_cMask) == (0) {
 88717  		_11_pX = (*XExpr)(_pTerm.XpExpr)
 88718  		_idxCols |= _10_cMask
 88719  		*elem50(_pIdx.XaiColumn, uintptr(_n)) = int16(*(*int32)(unsafe.Pointer(&_pTerm.Xu)))
 88720  		_pColl = _sqlite3BinaryCompareCollSeq(tls, _pParse, (*XExpr)(_11_pX.XpLeft), (*XExpr)(_11_pX.XpRight))
 88721  		*elem0(_pIdx.XazColl, uintptr(_n)) = func() *int8 {
 88722  			if _pColl != nil {
 88723  				return _pColl.XzName
 88724  			}
 88725  			return (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
 88726  		}()
 88727  		_n += 1
 88728  	}
 88729  _35:
 88730  	*(*uintptr)(unsafe.Pointer(&_pTerm)) += uintptr(48)
 88731  	goto _31
 88732  _34:
 88733  	func() {
 88734  		if uint32(_n) != uint32((*t101)(unsafe.Pointer(&_pLoop.Xu)).XnEq) {
 88735  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131140), unsafe.Pointer(&_constructAutomaticIndexØ00__func__Ø000), unsafe.Pointer(str(107159)))
 88736  			crt.X__builtin_abort(tls)
 88737  		}
 88738  	}()
 88739  	_i = int32(0)
 88740  _43:
 88741  	if _i >= _mxBitCol {
 88742  		goto _46
 88743  	}
 88744  	if (_extraCols & (uint64(1) << uint(_i))) != 0 {
 88745  		*elem50(_pIdx.XaiColumn, uintptr(_n)) = int16(_i)
 88746  		*elem0(_pIdx.XazColl, uintptr(_n)) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
 88747  		_n += 1
 88748  	}
 88749  	_i += 1
 88750  	goto _43
 88751  _46:
 88752  	if (_pSrc.XcolUsed & uint64(9223372036854775808)) == 0 {
 88753  		goto _48
 88754  	}
 88755  	_i = int32(63)
 88756  _49:
 88757  	if _i >= int32(_pTable.XnCol) {
 88758  		goto _52
 88759  	}
 88760  	*elem50(_pIdx.XaiColumn, uintptr(_n)) = int16(_i)
 88761  	*elem0(_pIdx.XazColl, uintptr(_n)) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
 88762  	_n += 1
 88763  	_i += 1
 88764  	goto _49
 88765  _52:
 88766  _48:
 88767  	func() {
 88768  		if _n != _nKeyCol {
 88769  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131158), unsafe.Pointer(&_constructAutomaticIndexØ00__func__Ø000), unsafe.Pointer(str(107186)))
 88770  			crt.X__builtin_abort(tls)
 88771  		}
 88772  	}()
 88773  	*elem50(_pIdx.XaiColumn, uintptr(_n)) = int16(-1)
 88774  	*elem0(_pIdx.XazColl, uintptr(_n)) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
 88775  	func() {
 88776  		if _pLevel.XiIdxCur < int32(0) {
 88777  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(131163), unsafe.Pointer(&_constructAutomaticIndexØ00__func__Ø000), unsafe.Pointer(str(107197)))
 88778  			crt.X__builtin_abort(tls)
 88779  		}
 88780  	}()
 88781  	_pLevel.XiIdxCur = postInc2(&_pParse.XnTab, 1)
 88782  	_sqlite3VdbeAddOp2(tls, _v, int32(109), _pLevel.XiIdxCur, _nKeyCol+int32(1))
 88783  	_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pIdx)
 88784  	_sqlite3VdbeComment(tls, _v, str(107216), unsafe.Pointer(_pTable.XzName))
 88785  	_sqlite3ExprCachePush(tls, _pParse)
 88786  	_pTabItem = elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)((*XWhereInfo)(_pWC.XpWInfo).XpTabList).Xa))), uintptr(_pLevel.XiFrom))
 88787  	if ((uint32((_pTabItem.Xfg.XnotIndexed)>>4) << 31) >> 31) != 0 {
 88788  		_16_regYield = _pTabItem.XregReturn
 88789  		_addrCounter = _sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), int32(0))
 88790  		_sqlite3VdbeAddOp3(tls, _v, int32(15), _16_regYield, int32(0), _pTabItem.XaddrFillSub)
 88791  		_addrTop = _sqlite3VdbeAddOp1(tls, _v, int32(16), _16_regYield)
 88792  		_sqlite3VdbeComment(tls, _v, str(107223), unsafe.Pointer((*XTable)(_pTabItem.XpTab).XzName))
 88793  		goto _58
 88794  	}
 88795  	_addrTop = _sqlite3VdbeAddOp1(tls, _v, int32(37), _pLevel.XiTabCur)
 88796  _58:
 88797  	if _pPartial != nil {
 88798  		_iContinue = _sqlite3VdbeMakeLabel(tls, _v)
 88799  		_sqlite3ExprIfFalse(tls, _pParse, _pPartial, _iContinue, int32(16))
 88800  		_pLoop.XwsFlags |= uint32(131072)
 88801  	}
 88802  	_regRecord = _sqlite3GetTempReg(tls, _pParse)
 88803  	_regBase = _sqlite3GenerateIndexKey(tls, _pParse, _pIdx, _pLevel.XiTabCur, _regRecord, int32(0), nil, nil, int32(0))
 88804  	_sqlite3VdbeAddOp2(tls, _v, int32(128), _pLevel.XiIdxCur, _regRecord)
 88805  	_sqlite3VdbeChangeP5(tls, _v, uint16(16))
 88806  	if _pPartial != nil {
 88807  		_sqlite3VdbeResolveLabel(tls, _v, _iContinue)
 88808  	}
 88809  	if ((uint32((_pTabItem.Xfg.XnotIndexed)>>4) << 31) >> 31) != 0 {
 88810  		_sqlite3VdbeChangeP2(tls, _v, uint32(_addrCounter), _regBase+_n)
 88811  		_translateColumnToCopy(tls, _pParse, _addrTop, _pLevel.XiTabCur, _pTabItem.XregResult, int32(1))
 88812  		_sqlite3VdbeGoto(tls, _v, _addrTop)
 88813  		storebits5(&(_pTabItem.Xfg.XnotIndexed), 0, 16, 4)
 88814  		goto _62
 88815  	}
 88816  	_sqlite3VdbeAddOp2(tls, _v, int32(7), _pLevel.XiTabCur, _addrTop+int32(1))
 88817  _62:
 88818  	_sqlite3VdbeChangeP5(tls, _v, uint16(3))
 88819  	_sqlite3VdbeJumpHere(tls, _v, _addrTop)
 88820  	_sqlite3ReleaseTempReg(tls, _pParse, _regRecord)
 88821  	_sqlite3ExprCachePop(tls, _pParse)
 88822  	_sqlite3VdbeJumpHere(tls, _v, _addrInit)
 88823  _end_auto_index_create:
 88824  	_sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.Xdb), _pPartial)
 88825  }
 88826  
 88827  var _constructAutomaticIndexØ00__func__Ø000 [24]int8
 88828  
 88829  func init() {
 88830  	crt.Xstrncpy(nil, &_constructAutomaticIndexØ00__func__Ø000[0], str(107240), 24)
 88831  }
 88832  
 88833  // C comment
 88834  //  /*
 88835  //  ** Allocate heap space to hold an Index object with nCol columns.
 88836  //  **
 88837  //  ** Increase the allocation size to provide an extra nExtra bytes
 88838  //  ** of 8-byte aligned space after the Index object and return a
 88839  //  ** pointer to this extra space in *ppExtra.
 88840  //  */
 88841  func _sqlite3AllocateIndexObject(tls *crt.TLS, _db *Xsqlite3, _nCol int16, _nExtra int32, _ppExtra **int8) (r0 *XIndex) {
 88842  	var _nByte int32
 88843  	var _1_pExtra *int8
 88844  	var _p *XIndex
 88845  	_nByte = int32((uint32(56) + (((uint32(4) * uint32(_nCol)) + uint32(7)) & uint32(4294967288))) + (((((uint32(2) * uint32(int32(_nCol)+int32(1))) + (uint32(2) * uint32(_nCol))) + (uint32(1) * uint32(_nCol))) + uint32(7)) & uint32(4294967288)))
 88846  	_p = (*XIndex)(_sqlite3DbMallocZero(tls, _db, uint64(_nByte+_nExtra)))
 88847  	if _p != nil {
 88848  		_1_pExtra = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + uintptr(uint32(56))))
 88849  		_p.XazColl = (**int8)(unsafe.Pointer(_1_pExtra))
 88850  		*(*uintptr)(unsafe.Pointer(&_1_pExtra)) += uintptr(((uint32(4) * uint32(_nCol)) + uint32(7)) & uint32(4294967288))
 88851  		_p.XaiRowLogEst = (*int16)(unsafe.Pointer(_1_pExtra))
 88852  		*(*uintptr)(unsafe.Pointer(&_1_pExtra)) += uintptr(uint32(2) * uint32(int32(_nCol)+int32(1)))
 88853  		_p.XaiColumn = (*int16)(unsafe.Pointer(_1_pExtra))
 88854  		*(*uintptr)(unsafe.Pointer(&_1_pExtra)) += uintptr(uint32(2) * uint32(_nCol))
 88855  		_p.XaSortOrder = (*uint8)(unsafe.Pointer(_1_pExtra))
 88856  		_p.XnColumn = uint16(_nCol)
 88857  		_p.XnKeyCol = uint16(int32(_nCol) - int32(1))
 88858  		*_ppExtra = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + uintptr(_nByte)))
 88859  	}
 88860  	return _p
 88861  }
 88862  
 88863  // C comment
 88864  //  /*
 88865  //  ** Generate code that will assemble an index key and stores it in register
 88866  //  ** regOut.  The key with be for index pIdx which is an index on pTab.
 88867  //  ** iCur is the index of a cursor open on the pTab table and pointing to
 88868  //  ** the entry that needs indexing.  If pTab is a WITHOUT ROWID table, then
 88869  //  ** iCur must be the cursor of the PRIMARY KEY index.
 88870  //  **
 88871  //  ** Return a register number which is the first in a block of
 88872  //  ** registers that holds the elements of the index key.  The
 88873  //  ** block of registers has already been deallocated by the time
 88874  //  ** this routine returns.
 88875  //  **
 88876  //  ** If *piPartIdxLabel is not NULL, fill it in with a label and jump
 88877  //  ** to that label if pIdx is a partial index that should be skipped.
 88878  //  ** The label should be resolved using sqlite3ResolvePartIdxLabel().
 88879  //  ** A partial index should be skipped if its WHERE clause evaluates
 88880  //  ** to false or null.  If pIdx is not a partial index, *piPartIdxLabel
 88881  //  ** will be set to zero which is an empty label that is ignored by
 88882  //  ** sqlite3ResolvePartIdxLabel().
 88883  //  **
 88884  //  ** The pPrior and regPrior parameters are used to implement a cache to
 88885  //  ** avoid unnecessary register loads.  If pPrior is not NULL, then it is
 88886  //  ** a pointer to a different index for which an index key has just been
 88887  //  ** computed into register regPrior.  If the current pIdx index is generating
 88888  //  ** its key into the same sequence of registers and if pPrior and pIdx share
 88889  //  ** a column in common, then the register corresponding to that column already
 88890  //  ** holds the correct value and the loading of that register is skipped.
 88891  //  ** This optimization is helpful when doing a DELETE or an INTEGRITY_CHECK
 88892  //  ** on a table with multiple indices, and especially with the ROWID or
 88893  //  ** PRIMARY KEY columns of the index.
 88894  //  */
 88895  func _sqlite3GenerateIndexKey(tls *crt.TLS, _pParse *XParse, _pIdx *XIndex, _iDataCur int32, _regOut int32, _prefixOnly int32, _piPartIdxLabel *int32, _pPrior *XIndex, _regPrior int32) (r0 int32) {
 88896  	var _j, _regBase, _nCol int32
 88897  	var _7_zAff *int8
 88898  	var _v *TVdbe
 88899  	_v = (*TVdbe)(_pParse.XpVdbe)
 88900  	if _piPartIdxLabel == nil {
 88901  		goto _0
 88902  	}
 88903  	if _pIdx.XpPartIdxWhere != nil {
 88904  		*_piPartIdxLabel = _sqlite3VdbeMakeLabel(tls, _v)
 88905  		_pParse.XiSelfTab = _iDataCur
 88906  		_sqlite3ExprCachePush(tls, _pParse)
 88907  		_sqlite3ExprIfFalseDup(tls, _pParse, (*XExpr)(_pIdx.XpPartIdxWhere), *_piPartIdxLabel, int32(16))
 88908  		goto _2
 88909  	}
 88910  	*_piPartIdxLabel = int32(0)
 88911  _2:
 88912  _0:
 88913  	_nCol = int32(func() uint16 {
 88914  		if _prefixOnly != 0 && (((uint32(_pIdx.XidxType>>3) << 31) >> 31) != 0) {
 88915  			return _pIdx.XnKeyCol
 88916  		}
 88917  		return _pIdx.XnColumn
 88918  	}())
 88919  	_regBase = _sqlite3GetTempRange(tls, _pParse, _nCol)
 88920  	if (_pPrior != nil) && ((_regBase != _regPrior) || (_pPrior.XpPartIdxWhere != nil)) {
 88921  		_pPrior = nil
 88922  	}
 88923  	_j = int32(0)
 88924  _9:
 88925  	if _j >= _nCol {
 88926  		goto _12
 88927  	}
 88928  	if ((_pPrior != nil) && (int32(*elem50(_pPrior.XaiColumn, uintptr(_j))) == int32(*elem50(_pIdx.XaiColumn, uintptr(_j))))) && (int32(*elem50(_pPrior.XaiColumn, uintptr(_j))) != int32(-2)) {
 88929  		goto _10
 88930  	}
 88931  	_sqlite3ExprCodeLoadIndexColumn(tls, _pParse, _pIdx, _iDataCur, _j, _regBase+_j)
 88932  	_sqlite3VdbeDeletePriorOpcode(tls, _v, uint8(74))
 88933  _10:
 88934  	_j += 1
 88935  	goto _9
 88936  _12:
 88937  	if _regOut == 0 {
 88938  		goto _16
 88939  	}
 88940  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _regBase, _nCol, _regOut)
 88941  	if ((*XTable)(_pIdx.XpTable).XpSelect) != nil {
 88942  		_7_zAff = _sqlite3IndexAffinityStr(tls, (*Xsqlite3)(_pParse.Xdb), _pIdx)
 88943  		_sqlite3VdbeChangeP4(tls, _v, int32(-1), _7_zAff, int32(0))
 88944  	}
 88945  _16:
 88946  	_sqlite3ReleaseTempRange(tls, _pParse, _regBase, _nCol)
 88947  	return _regBase
 88948  }
 88949  
 88950  // C comment
 88951  //  /*
 88952  //  ** Like sqlite3ExprIfFalse() except that a copy is made of pExpr before
 88953  //  ** code generation, and that copy is deleted after code generation. This
 88954  //  ** ensures that the original pExpr is unchanged.
 88955  //  */
 88956  func _sqlite3ExprIfFalseDup(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _dest int32, _jumpIfNull int32) {
 88957  	var _db *Xsqlite3
 88958  	var _pCopy *XExpr
 88959  	_db = (*Xsqlite3)(_pParse.Xdb)
 88960  	_pCopy = _sqlite3ExprDup(tls, _db, _pExpr, int32(0))
 88961  	if int32(_db.XmallocFailed) == int32(0) {
 88962  		_sqlite3ExprIfFalse(tls, _pParse, _pCopy, _dest, _jumpIfNull)
 88963  	}
 88964  	_sqlite3ExprDelete(tls, _db, _pCopy)
 88965  }
 88966  
 88967  // C comment
 88968  //  /* Generate code that will load into register regOut a value that is
 88969  //  ** appropriate for the iIdxCol-th column of index pIdx.
 88970  //  */
 88971  func _sqlite3ExprCodeLoadIndexColumn(tls *crt.TLS, _pParse *XParse, _pIdx *XIndex, _iTabCur int32, _iIdxCol int32, _regOut int32) {
 88972  	var _iTabCol int16
 88973  	_iTabCol = *elem50(_pIdx.XaiColumn, uintptr(_iIdxCol))
 88974  	if int32(_iTabCol) == int32(-2) {
 88975  		func() {
 88976  			if _pIdx.XaColExpr == nil {
 88977  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94130), unsafe.Pointer(&_sqlite3ExprCodeLoadIndexColumnØ00__func__Ø000), unsafe.Pointer(str(107264)))
 88978  				crt.X__builtin_abort(tls)
 88979  			}
 88980  		}()
 88981  		func() {
 88982  			if ((*XExprList)(_pIdx.XaColExpr).XnExpr) <= _iIdxCol {
 88983  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(94131), unsafe.Pointer(&_sqlite3ExprCodeLoadIndexColumnØ00__func__Ø000), unsafe.Pointer(str(107279)))
 88984  				crt.X__builtin_abort(tls)
 88985  			}
 88986  		}()
 88987  		_pParse.XiSelfTab = _iTabCur
 88988  		_sqlite3ExprCodeCopy(tls, _pParse, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.XaColExpr).Xa))), uintptr(_iIdxCol)).XpExpr), _regOut)
 88989  		goto _5
 88990  	}
 88991  	_sqlite3ExprCodeGetColumnOfTable(tls, (*TVdbe)(_pParse.XpVdbe), (*XTable)(_pIdx.XpTable), _iTabCur, int32(_iTabCol), _regOut)
 88992  _5:
 88993  }
 88994  
 88995  var _sqlite3ExprCodeLoadIndexColumnØ00__func__Ø000 [31]int8
 88996  
 88997  func init() {
 88998  	crt.Xstrncpy(nil, &_sqlite3ExprCodeLoadIndexColumnØ00__func__Ø000[0], str(107309), 31)
 88999  }
 89000  
 89001  // C comment
 89002  //  /*
 89003  //  ** Make a transient copy of expression pExpr and then code it using
 89004  //  ** sqlite3ExprCode().  This routine works just like sqlite3ExprCode()
 89005  //  ** except that the input expression is guaranteed to be unchanged.
 89006  //  */
 89007  func _sqlite3ExprCodeCopy(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _target int32) {
 89008  	var _db *Xsqlite3
 89009  	_db = (*Xsqlite3)(_pParse.Xdb)
 89010  	_pExpr = _sqlite3ExprDup(tls, _db, _pExpr, int32(0))
 89011  	if _db.XmallocFailed == 0 {
 89012  		_sqlite3ExprCode(tls, _pParse, _pExpr, _target)
 89013  	}
 89014  	_sqlite3ExprDelete(tls, _db, _pExpr)
 89015  }
 89016  
 89017  // C comment
 89018  //  /*
 89019  //  ** If the last opcode is "op" and it is not a jump destination,
 89020  //  ** then remove it.  Return true if and only if an opcode was removed.
 89021  //  */
 89022  func _sqlite3VdbeDeletePriorOpcode(tls *crt.TLS, _p *TVdbe, _op uint8) (r0 int32) {
 89023  	if (_p.XnOp > int32(0)) && (int32(elem61((*XVdbeOp)(_p.XaOp), uintptr(_p.XnOp-int32(1))).Xopcode) == int32(_op)) {
 89024  		return _sqlite3VdbeChangeToNoop(tls, _p, _p.XnOp-int32(1))
 89025  	}
 89026  	return int32(0)
 89027  }
 89028  
 89029  // C comment
 89030  //  /*
 89031  //  ** Return a pointer to the column affinity string associated with index
 89032  //  ** pIdx. A column affinity string has one character for each column in
 89033  //  ** the table, according to the affinity of the column:
 89034  //  **
 89035  //  **  Character      Column affinity
 89036  //  **  ------------------------------
 89037  //  **  'A'            BLOB
 89038  //  **  'B'            TEXT
 89039  //  **  'C'            NUMERIC
 89040  //  **  'D'            INTEGER
 89041  //  **  'F'            REAL
 89042  //  **
 89043  //  ** An extra 'D' is appended to the end of the string to cover the
 89044  //  ** rowid that appears as the last column in every index.
 89045  //  **
 89046  //  ** Memory for the buffer containing the column index affinity string
 89047  //  ** is managed along with the rest of the Index structure. It will be
 89048  //  ** released when sqlite3DeleteIndex() is called.
 89049  //  */
 89050  func _sqlite3IndexAffinityStr(tls *crt.TLS, _db *Xsqlite3, _pIdx *XIndex) (r0 *int8) {
 89051  	var _3_x int16
 89052  	var _1_n int32
 89053  	var _6_aff int8
 89054  	var _1_pTab *XTable
 89055  	if _pIdx.XzColAff != nil {
 89056  		goto _0
 89057  	}
 89058  	_1_pTab = (*XTable)(_pIdx.XpTable)
 89059  	_pIdx.XzColAff = (*int8)(_sqlite3DbMallocRaw(tls, nil, uint64(int32(_pIdx.XnColumn)+int32(1))))
 89060  	if _pIdx.XzColAff == nil {
 89061  		_sqlite3OomFault(tls, _db)
 89062  		return nil
 89063  	}
 89064  	_1_n = int32(0)
 89065  _2:
 89066  	if _1_n >= int32(_pIdx.XnColumn) {
 89067  		goto _5
 89068  	}
 89069  	_3_x = *elem50(_pIdx.XaiColumn, uintptr(_1_n))
 89070  	if int32(_3_x) >= int32(0) {
 89071  		*elem1(_pIdx.XzColAff, uintptr(_1_n)) = elem41((*XColumn)(_1_pTab.XaCol), uintptr(_3_x)).Xaffinity
 89072  		goto _9
 89073  	}
 89074  	if int32(_3_x) == int32(-1) {
 89075  		*elem1(_pIdx.XzColAff, uintptr(_1_n)) = int8(68)
 89076  		goto _9
 89077  	}
 89078  	func() {
 89079  		if int32(_3_x) != int32(-2) {
 89080  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108932), unsafe.Pointer(&_sqlite3IndexAffinityStrØ00__func__Ø000), unsafe.Pointer(str(107340)))
 89081  			crt.X__builtin_abort(tls)
 89082  		}
 89083  	}()
 89084  	func() {
 89085  		if (*XExprList)(_pIdx.XaColExpr) == nil {
 89086  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108933), unsafe.Pointer(&_sqlite3IndexAffinityStrØ00__func__Ø000), unsafe.Pointer(str(107351)))
 89087  			crt.X__builtin_abort(tls)
 89088  		}
 89089  	}()
 89090  	_6_aff = _sqlite3ExprAffinity(tls, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.XaColExpr).Xa))), uintptr(_1_n)).XpExpr))
 89091  	if int32(_6_aff) == int32(0) {
 89092  		_6_aff = int8(65)
 89093  	}
 89094  	*elem1(_pIdx.XzColAff, uintptr(_1_n)) = _6_aff
 89095  _9:
 89096  	_1_n += 1
 89097  	goto _2
 89098  _5:
 89099  	*elem1(_pIdx.XzColAff, uintptr(_1_n)) = 0
 89100  _0:
 89101  	return _pIdx.XzColAff
 89102  }
 89103  
 89104  var _sqlite3IndexAffinityStrØ00__func__Ø000 [24]int8
 89105  
 89106  func init() {
 89107  	crt.Xstrncpy(nil, &_sqlite3IndexAffinityStrØ00__func__Ø000[0], str(107369), 24)
 89108  }
 89109  
 89110  // C comment
 89111  //  /*
 89112  //  ** Convert OP_Column opcodes to OP_Copy in previously generated code.
 89113  //  **
 89114  //  ** This routine runs over generated VDBE code and translates OP_Column
 89115  //  ** opcodes into OP_Copy when the table is being accessed via co-routine
 89116  //  ** instead of via table lookup.
 89117  //  **
 89118  //  ** If the bIncrRowid parameter is 0, then any OP_Rowid instructions on
 89119  //  ** cursor iTabCur are transformed into OP_Null. Or, if bIncrRowid is non-zero,
 89120  //  ** then each OP_Rowid is transformed into an instruction to increment the
 89121  //  ** value stored in its output register.
 89122  //  */
 89123  func _translateColumnToCopy(tls *crt.TLS, _pParse *XParse, _iStart int32, _iTabCur int32, _iRegister int32, _bIncrRowid int32) {
 89124  	var _iEnd int32
 89125  	var _v *TVdbe
 89126  	var _pOp *XVdbeOp
 89127  	_v = (*TVdbe)(_pParse.XpVdbe)
 89128  	_pOp = _sqlite3VdbeGetOp(tls, _v, _iStart)
 89129  	_iEnd = _sqlite3VdbeCurrentAddr(tls, _v)
 89130  	if ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) != 0 {
 89131  		return
 89132  	}
 89133  _0:
 89134  	if _iStart >= _iEnd {
 89135  		goto _4
 89136  	}
 89137  	if _pOp.Xp1 != _iTabCur {
 89138  		goto _2
 89139  	}
 89140  	if int32(_pOp.Xopcode) == int32(99) {
 89141  		_pOp.Xopcode = uint8(64)
 89142  		_pOp.Xp1 = _pOp.Xp2 + _iRegister
 89143  		_pOp.Xp2 = _pOp.Xp3
 89144  		_pOp.Xp3 = int32(0)
 89145  		goto _8
 89146  	}
 89147  	if int32(_pOp.Xopcode) != int32(125) {
 89148  		goto _8
 89149  	}
 89150  	if _bIncrRowid != 0 {
 89151  		_pOp.Xopcode = uint8(73)
 89152  		_pOp.Xp1 = _pOp.Xp2
 89153  		_pOp.Xp2 = int32(1)
 89154  		goto _10
 89155  	}
 89156  	_pOp.Xopcode = uint8(59)
 89157  	_pOp.Xp1 = int32(0)
 89158  	_pOp.Xp3 = int32(0)
 89159  _10:
 89160  _8:
 89161  _2:
 89162  	*(*uintptr)(unsafe.Pointer(func() **XVdbeOp { _iStart += 1; return &_pOp }())) += uintptr(24)
 89163  	goto _0
 89164  _4:
 89165  }
 89166  
 89167  // C comment
 89168  //  /*
 89169  //  ** This function is a no-op unless currently processing an EXPLAIN QUERY PLAN
 89170  //  ** command, or if either SQLITE_DEBUG or SQLITE_ENABLE_STMT_SCANSTATUS was
 89171  //  ** defined at compile-time. If it is not a no-op, a single OP_Explain opcode
 89172  //  ** is added to the output to describe the table scan strategy in pLevel.
 89173  //  **
 89174  //  ** If an OP_Explain opcode is added to the VM, its address is returned.
 89175  //  ** Otherwise, if no OP_Explain is coded, zero is returned.
 89176  //  */
 89177  func _sqlite3WhereExplainOneScan(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pLevel *XWhereLevel, _iLevel int32, _iFrom int32, _wctrlFlags uint16) (r0 int32) {
 89178  	var _ret, _1_iId, _1_isSearch int32
 89179  	var _1_flags uint32
 89180  	var _1_zMsg, _5_zFmt, _13_zRangeOp *int8
 89181  	var _1_db *Xsqlite3
 89182  	var _1_v *TVdbe
 89183  	var _1_zBuf [100]int8
 89184  	var _1_str XStrAccum
 89185  	var _1_pItem *TSrcList_item
 89186  	var _5_pIdx *XIndex
 89187  	var _1_pLoop *XWhereLoop
 89188  	_ret = int32(0)
 89189  	_1_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_pLevel.XiFrom))
 89190  	_1_v = (*TVdbe)(_pParse.XpVdbe)
 89191  	_1_db = (*Xsqlite3)(_pParse.Xdb)
 89192  	_1_iId = _pParse.XiSelectId
 89193  	_1_pLoop = (*XWhereLoop)(_pLevel.XpWLoop)
 89194  	_1_flags = _1_pLoop.XwsFlags
 89195  	if ((_1_flags & uint32(8192)) != 0) || (int32(_wctrlFlags)&int32(32)) != 0 {
 89196  		return int32(0)
 89197  	}
 89198  	_1_isSearch = bool2int((((_1_flags & uint32(48)) != (0)) || (((_1_flags & uint32(1024)) == (0)) && (int32((*t101)(unsafe.Pointer(&_1_pLoop.Xu)).XnEq) > int32(0)))) || (int32(_wctrlFlags)&int32(3)) != 0)
 89199  	_sqlite3StrAccumInit(tls, &_1_str, _1_db, (*int8)(unsafe.Pointer(&_1_zBuf)), int32(100), int32(1000000000))
 89200  	_sqlite3StrAccumAppendAll(tls, &_1_str, func() *int8 {
 89201  		if _1_isSearch != 0 {
 89202  			return str(107393)
 89203  		}
 89204  		return str(107400)
 89205  	}())
 89206  	if _1_pItem.XpSelect != nil {
 89207  		_sqlite3XPrintf(tls, &_1_str, str(107405), int32(_1_pItem.XiSelectId))
 89208  		goto _8
 89209  	}
 89210  	_sqlite3XPrintf(tls, &_1_str, str(107418), unsafe.Pointer(_1_pItem.XzName))
 89211  _8:
 89212  	if _1_pItem.XzAlias != nil {
 89213  		_sqlite3XPrintf(tls, &_1_str, str(107428), unsafe.Pointer(_1_pItem.XzAlias))
 89214  	}
 89215  	if (_1_flags & uint32(1280)) != (0) {
 89216  		goto _10
 89217  	}
 89218  	_5_zFmt = nil
 89219  	func() {
 89220  		if (*XIndex)((*t101)(unsafe.Pointer(&_1_pLoop.Xu)).XpIndex) == nil {
 89221  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(126959), unsafe.Pointer(&_sqlite3WhereExplainOneScanØ00__func__Ø000), unsafe.Pointer(str(107435)))
 89222  			crt.X__builtin_abort(tls)
 89223  		}
 89224  	}()
 89225  	_5_pIdx = (*XIndex)((*t101)(unsafe.Pointer(&_1_pLoop.Xu)).XpIndex)
 89226  	func() {
 89227  		if (_1_flags&uint32(16384)) != 0 && (_1_flags&uint32(64)) == 0 {
 89228  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(126961), unsafe.Pointer(&_sqlite3WhereExplainOneScanØ00__func__Ø000), unsafe.Pointer(str(107460)))
 89229  			crt.X__builtin_abort(tls)
 89230  		}
 89231  	}()
 89232  	if (((*XTable)(_1_pItem.XpTab).XtabFlags)&uint32(32)) == (0) || int32((uint32(_5_pIdx.XidxType)<<30)>>30) != int32(2) {
 89233  		goto _17
 89234  	}
 89235  	if _1_isSearch != 0 {
 89236  		_5_zFmt = str(107512)
 89237  	}
 89238  	goto _25
 89239  _17:
 89240  	if (_1_flags & uint32(131072)) != 0 {
 89241  		_5_zFmt = str(107524)
 89242  		goto _25
 89243  	}
 89244  	if (_1_flags & uint32(16384)) != 0 {
 89245  		_5_zFmt = str(107557)
 89246  		goto _25
 89247  	}
 89248  	if (_1_flags & uint32(64)) != 0 {
 89249  		_5_zFmt = str(107582)
 89250  		goto _25
 89251  	}
 89252  	_5_zFmt = str(107600)
 89253  _25:
 89254  	if _5_zFmt != nil {
 89255  		_sqlite3StrAccumAppend(tls, &_1_str, str(107609), int32(7))
 89256  		_sqlite3XPrintf(tls, &_1_str, _5_zFmt, unsafe.Pointer(_5_pIdx.XzName))
 89257  		_explainIndexRange(tls, &_1_str, _1_pLoop)
 89258  	}
 89259  	goto _39
 89260  _10:
 89261  	if (_1_flags&uint32(256)) == (0) || (_1_flags&uint32(15)) == (0) {
 89262  		goto _29
 89263  	}
 89264  	if (_1_flags & uint32(5)) != 0 {
 89265  		_13_zRangeOp = str(107617)
 89266  		goto _35
 89267  	}
 89268  	if (_1_flags & uint32(48)) == uint32(48) {
 89269  		_13_zRangeOp = str(107619)
 89270  		goto _35
 89271  	}
 89272  	if (_1_flags & uint32(32)) != 0 {
 89273  		_13_zRangeOp = str(107633)
 89274  		goto _35
 89275  	}
 89276  	func() {
 89277  		if (_1_flags & uint32(16)) == 0 {
 89278  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(126989), unsafe.Pointer(&_sqlite3WhereExplainOneScanØ00__func__Ø000), unsafe.Pointer(str(107635)))
 89279  			crt.X__builtin_abort(tls)
 89280  		}
 89281  	}()
 89282  	_13_zRangeOp = str(107657)
 89283  _35:
 89284  	_sqlite3XPrintf(tls, &_1_str, str(107659), unsafe.Pointer(_13_zRangeOp))
 89285  	goto _39
 89286  _29:
 89287  	if (_1_flags & uint32(1024)) != (0) {
 89288  		_sqlite3XPrintf(tls, &_1_str, str(107697), (*t105)(unsafe.Pointer(&_1_pLoop.Xu)).XidxNum, unsafe.Pointer((*t105)(unsafe.Pointer(&_1_pLoop.Xu)).XidxStr))
 89289  	}
 89290  _39:
 89291  	_1_zMsg = _sqlite3StrAccumFinish(tls, &_1_str)
 89292  	_ret = _sqlite3VdbeAddOp4(tls, _1_v, int32(165), _1_iId, _iLevel, _iFrom, _1_zMsg, int32(-1))
 89293  	return _ret
 89294  
 89295  	_ = _1_zBuf
 89296  	panic(0)
 89297  }
 89298  
 89299  var _sqlite3WhereExplainOneScanØ00__func__Ø000 [27]int8
 89300  
 89301  func init() {
 89302  	crt.Xstrncpy(nil, &_sqlite3WhereExplainOneScanØ00__func__Ø000[0], str(107724), 27)
 89303  }
 89304  
 89305  // C comment
 89306  //  /*
 89307  //  ** Argument pLevel describes a strategy for scanning table pTab. This
 89308  //  ** function appends text to pStr that describes the subset of table
 89309  //  ** rows scanned by the strategy in the form of an SQL expression.
 89310  //  **
 89311  //  ** For example, if the query:
 89312  //  **
 89313  //  **   SELECT * FROM t1 WHERE a=1 AND b>2;
 89314  //  **
 89315  //  ** is run and there is an index on (a, b), then this function returns a
 89316  //  ** string similar to:
 89317  //  **
 89318  //  **   "a=? AND b>?"
 89319  //  */
 89320  func _explainIndexRange(tls *crt.TLS, _pStr *XStrAccum, _pLoop *XWhereLoop) {
 89321  	var _i, _j int32
 89322  	var _1_z *int8
 89323  	var _nEq, _nSkip uint16
 89324  	var _pIndex *XIndex
 89325  	_pIndex = (*XIndex)((*t101)(unsafe.Pointer(&_pLoop.Xu)).XpIndex)
 89326  	_nEq = (*t101)(unsafe.Pointer(&_pLoop.Xu)).XnEq
 89327  	_nSkip = _pLoop.XnSkip
 89328  	if (int32(_nEq) == int32(0)) && ((_pLoop.XwsFlags & uint32(48)) == (0)) {
 89329  		return
 89330  	}
 89331  	_sqlite3StrAccumAppend(tls, _pStr, str(107751), int32(2))
 89332  	_i = int32(0)
 89333  _2:
 89334  	if _i >= int32(_nEq) {
 89335  		goto _5
 89336  	}
 89337  	_1_z = _explainIndexColumnName(tls, _pIndex, _i)
 89338  	if _i != 0 {
 89339  		_sqlite3StrAccumAppend(tls, _pStr, str(107754), int32(5))
 89340  	}
 89341  	_sqlite3XPrintf(tls, _pStr, func() *int8 {
 89342  		if _i >= int32(_nSkip) {
 89343  			return str(107760)
 89344  		}
 89345  		return str(107765)
 89346  	}(), unsafe.Pointer(_1_z))
 89347  	_i += 1
 89348  	goto _2
 89349  _5:
 89350  	_j = _i
 89351  	if (_pLoop.XwsFlags & uint32(32)) != 0 {
 89352  		_explainAppendTerm(tls, _pStr, _pIndex, int32((*t101)(unsafe.Pointer(&_pLoop.Xu)).XnBtm), _j, _i, str(107633))
 89353  		_i = int32(1)
 89354  	}
 89355  	if (_pLoop.XwsFlags & uint32(16)) != 0 {
 89356  		_explainAppendTerm(tls, _pStr, _pIndex, int32((*t101)(unsafe.Pointer(&_pLoop.Xu)).XnTop), _j, _i, str(107657))
 89357  	}
 89358  	_sqlite3StrAccumAppend(tls, _pStr, str(37853), int32(1))
 89359  }
 89360  
 89361  // C comment
 89362  //  /*
 89363  //  ** Return the name of the i-th column of the pIdx index.
 89364  //  */
 89365  func _explainIndexColumnName(tls *crt.TLS, _pIdx *XIndex, _i int32) (r0 *int8) {
 89366  	_i = int32(*elem50(_pIdx.XaiColumn, uintptr(_i)))
 89367  	if _i == int32(-2) {
 89368  		return str(107773)
 89369  	}
 89370  	if _i == int32(-1) {
 89371  		return str(27182)
 89372  	}
 89373  	return elem41((*XColumn)((*XTable)(_pIdx.XpTable).XaCol), uintptr(_i)).XzName
 89374  }
 89375  
 89376  // C comment
 89377  //  /*
 89378  //  ** This routine is a helper for explainIndexRange() below
 89379  //  **
 89380  //  ** pStr holds the text of an expression that we are building up one term
 89381  //  ** at a time.  This routine adds a new term to the end of the expression.
 89382  //  ** Terms are separated by AND so add the "AND" text for second and subsequent
 89383  //  ** terms only.
 89384  //  */
 89385  func _explainAppendTerm(tls *crt.TLS, _pStr *XStrAccum, _pIdx *XIndex, _nTerm int32, _iTerm int32, _bAnd int32, _zOp *int8) {
 89386  	var _i int32
 89387  	func() {
 89388  		if _nTerm < int32(1) {
 89389  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(126844), unsafe.Pointer(&_explainAppendTermØ00__func__Ø000), unsafe.Pointer(str(107780)))
 89390  			crt.X__builtin_abort(tls)
 89391  		}
 89392  	}()
 89393  	if _bAnd != 0 {
 89394  		_sqlite3StrAccumAppend(tls, _pStr, str(107754), int32(5))
 89395  	}
 89396  	if _nTerm > int32(1) {
 89397  		_sqlite3StrAccumAppend(tls, _pStr, str(107789), int32(1))
 89398  	}
 89399  	_i = int32(0)
 89400  _4:
 89401  	if _i >= _nTerm {
 89402  		goto _7
 89403  	}
 89404  	if _i != 0 {
 89405  		_sqlite3StrAccumAppend(tls, _pStr, str(107791), int32(1))
 89406  	}
 89407  	_sqlite3StrAccumAppendAll(tls, _pStr, _explainIndexColumnName(tls, _pIdx, _iTerm+_i))
 89408  	_i += 1
 89409  	goto _4
 89410  _7:
 89411  	if _nTerm > int32(1) {
 89412  		_sqlite3StrAccumAppend(tls, _pStr, str(37853), int32(1))
 89413  	}
 89414  	_sqlite3StrAccumAppend(tls, _pStr, _zOp, int32(1))
 89415  	if _nTerm > int32(1) {
 89416  		_sqlite3StrAccumAppend(tls, _pStr, str(107789), int32(1))
 89417  	}
 89418  	_i = int32(0)
 89419  _11:
 89420  	if _i >= _nTerm {
 89421  		goto _14
 89422  	}
 89423  	if _i != 0 {
 89424  		_sqlite3StrAccumAppend(tls, _pStr, str(107791), int32(1))
 89425  	}
 89426  	_sqlite3StrAccumAppend(tls, _pStr, str(50378), int32(1))
 89427  	_i += 1
 89428  	goto _11
 89429  _14:
 89430  	if _nTerm > int32(1) {
 89431  		_sqlite3StrAccumAppend(tls, _pStr, str(37853), int32(1))
 89432  	}
 89433  }
 89434  
 89435  var _explainAppendTermØ00__func__Ø000 [18]int8
 89436  
 89437  func init() {
 89438  	crt.Xstrncpy(nil, &_explainAppendTermØ00__func__Ø000[0], str(107793), 18)
 89439  }
 89440  
 89441  // C comment
 89442  //  /*
 89443  //  ** Generate code for the start of the iLevel-th loop in the WHERE clause
 89444  //  ** implementation described by pWInfo.
 89445  //  */
 89446  func _sqlite3WhereCodeOneLoopStart(tls *crt.TLS, _pWInfo *XWhereInfo, _iLevel int32, _notReady uint64) (r0 uint64) {
 89447  	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
 89448  	var _96_x uint32
 89449  	var _26_zStartAff, _26_zEndAff *int8
 89450  	var _26_nEq, _26_nBtm, _26_nTop, _65_wctrlFlags uint16
 89451  	var _26_bSeekPastNull, _26_bStopAtNull, _35_t, _36_t uint8
 89452  	var _db *Xsqlite3
 89453  	var _65_pTab *XTable
 89454  	var _v *TVdbe
 89455  	var _65_pOrTab *XSrcList
 89456  	var _pTabItem, _66_origSrc *TSrcList_item
 89457  	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
 89458  	var _97_sEAlt XExpr
 89459  	var _pParse *XParse
 89460  	var _17_aMoveOp [4]uint8
 89461  	var _pIdx, _58_pPk, _65_pCov, _71_pPk, _81_pPk *XIndex
 89462  	var _10_pOp *XVdbeOp
 89463  	var _76_pSubWInfo *XWhereInfo
 89464  	var _pLoop, _78_pSubLoop *XWhereLoop
 89465  	var _pLevel *XWhereLevel
 89466  	var _pTerm, _15_pStart, _15_pEnd, _26_pRangeStart, _26_pRangeEnd, _34_t, _75_pOrTerm, _97_pAlt *XWhereTerm
 89467  	var _pWC, _65_pOrWc *XWhereClause
 89468  	_iRowidReg = int32(0)
 89469  	_iReleaseReg = int32(0)
 89470  	_pIdx = nil
 89471  	_pParse = (*XParse)(_pWInfo.XpParse)
 89472  	_v = (*TVdbe)(_pParse.XpVdbe)
 89473  	_pWC = &_pWInfo.XsWC
 89474  	_db = (*Xsqlite3)(_pParse.Xdb)
 89475  	_pLevel = elem99((*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa)), uintptr(_iLevel))
 89476  	_pLoop = (*XWhereLoop)(_pLevel.XpWLoop)
 89477  	_pTabItem = elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.XpTabList).Xa))), uintptr(_pLevel.XiFrom))
 89478  	_iCur = _pTabItem.XiCursor
 89479  	_pLevel.XnotReady = _notReady & (^_sqlite3WhereGetMask(tls, &_pWInfo.XsMaskSet, _iCur))
 89480  	_bRev = int32((_pWInfo.XrevMask >> uint(_iLevel)) & uint64(1))
 89481  	_omitTable = bool2int(((_pLoop.XwsFlags & uint32(64)) != (0)) && ((int32(_pWInfo.XwctrlFlags) & int32(32)) == int32(0)))
 89482  	_addrBrk = store2(&_pLevel.XaddrBrk, store2(&_pLevel.XaddrNxt, _sqlite3VdbeMakeLabel(tls, _v)))
 89483  	_addrCont = store2(&_pLevel.XaddrCont, _sqlite3VdbeMakeLabel(tls, _v))
 89484  	if (int32(_pLevel.XiFrom) > int32(0)) && ((int32((elem6(_pTabItem, 0).Xfg).Xjointype) & int32(8)) != int32(0)) {
 89485  		_pLevel.XiLeftJoin = preInc2(&_pParse.XnMem, 1)
 89486  		_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _pLevel.XiLeftJoin)
 89487  		_sqlite3VdbeComment(tls, _v, str(107811))
 89488  	}
 89489  	_j = _iLevel
 89490  _3:
 89491  	if _j <= int32(0) || (elem99((*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa)), uintptr(_j)).XiLeftJoin) != int32(0) {
 89492  		goto _7
 89493  	}
 89494  	_j -= 1
 89495  	goto _3
 89496  _7:
 89497  	_addrHalt = elem99((*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa)), uintptr(_j)).XaddrBrk
 89498  	if ((uint32((_pTabItem.Xfg.XnotIndexed)>>4) << 31) >> 31) != 0 {
 89499  		_3_regYield = _pTabItem.XregReturn
 89500  		_sqlite3VdbeAddOp3(tls, _v, int32(15), _3_regYield, int32(0), _pTabItem.XaddrFillSub)
 89501  		_pLevel.Xp2 = _sqlite3VdbeAddOp2(tls, _v, int32(16), _3_regYield, _addrBrk)
 89502  		_sqlite3VdbeComment(tls, _v, str(107223), unsafe.Pointer((*XTable)(_pTabItem.XpTab).XzName))
 89503  		_pLevel.Xop = uint8(13)
 89504  		goto _270
 89505  	}
 89506  	if (_pLoop.XwsFlags & uint32(1024)) == (0) {
 89507  		goto _10
 89508  	}
 89509  	_4_nConstraint = int32(_pLoop.XnLTerm)
 89510  	_sqlite3ExprCachePush(tls, _pParse)
 89511  	_4_iReg = _sqlite3GetTempRange(tls, _pParse, _4_nConstraint+int32(2))
 89512  	_4_addrNotFound = _pLevel.XaddrBrk
 89513  	_j = int32(0)
 89514  _11:
 89515  	if _j >= _4_nConstraint {
 89516  		goto _14
 89517  	}
 89518  	_5_iTarget = (_4_iReg + _j) + int32(2)
 89519  	_pTerm = *elem104((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(_j))
 89520  	if func() int32 {
 89521  		if _pTerm == nil {
 89522  			return func() int32 {
 89523  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127994), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(4809)))
 89524  				crt.X__builtin_abort(tls)
 89525  				return int32(1)
 89526  			}()
 89527  		}
 89528  		return int32(0)
 89529  	}() != 0 {
 89530  		goto _12
 89531  	}
 89532  	if (int32(_pTerm.XeOperator) & int32(1)) != 0 {
 89533  		_codeEqualityTerm(tls, _pParse, _pTerm, _pLevel, _j, _bRev, _5_iTarget)
 89534  		_4_addrNotFound = _pLevel.XaddrNxt
 89535  		goto _19
 89536  	}
 89537  	_7_pRight = (*XExpr)((*XExpr)(_pTerm.XpExpr).XpRight)
 89538  	_codeExprOrVector(tls, _pParse, _7_pRight, _5_iTarget, int32(1))
 89539  _19:
 89540  _12:
 89541  	_j += 1
 89542  	goto _11
 89543  _14:
 89544  	_sqlite3VdbeAddOp2(tls, _v, int32(56), (*t105)(unsafe.Pointer(&_pLoop.Xu)).XidxNum, _4_iReg)
 89545  	_sqlite3VdbeAddOp2(tls, _v, int32(56), _4_nConstraint, _4_iReg+int32(1))
 89546  	_sqlite3VdbeAddOp4(tls, _v, int32(11), _iCur, _4_addrNotFound, _4_iReg, (*t105)(unsafe.Pointer(&_pLoop.Xu)).XidxStr, func() int32 {
 89547  		if ((*t105)(unsafe.Pointer(&_pLoop.Xu)).XneedFree) != 0 {
 89548  			return int32(-1)
 89549  		}
 89550  		return int32(-2)
 89551  	}())
 89552  	(*t105)(unsafe.Pointer(&_pLoop.Xu)).XneedFree = 0
 89553  	_pLevel.Xp1 = _iCur
 89554  	_pLevel.Xop = uint8(func() int32 {
 89555  		if _pWInfo.XeOnePass != 0 {
 89556  			return int32(164)
 89557  		}
 89558  		return int32(50)
 89559  	}())
 89560  	_pLevel.Xp2 = _sqlite3VdbeCurrentAddr(tls, _v)
 89561  	_4_iIn = (*t114)(unsafe.Pointer(&_pLevel.Xu)).XnIn
 89562  	_j = _4_nConstraint - int32(1)
 89563  _24:
 89564  	if _j < int32(0) {
 89565  		goto _27
 89566  	}
 89567  	_pTerm = *elem104((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(_j))
 89568  	if (_j < int32(16)) && ((int32((*t105)(unsafe.Pointer(&_pLoop.Xu)).XomitMask)>>uint(_j))&int32(1)) != 0 {
 89569  		_disableTerm(tls, _pLevel, _pTerm)
 89570  		goto _31
 89571  	}
 89572  	if (int32(_pTerm.XeOperator) & int32(1)) == int32(0) {
 89573  		goto _31
 89574  	}
 89575  	func() {
 89576  		if (*TInLoop)((*t114)(unsafe.Pointer(&_pLevel.Xu)).XaInLoop) == nil && _db.XmallocFailed == 0 {
 89577  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128027), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(107840)))
 89578  			crt.X__builtin_abort(tls)
 89579  		}
 89580  	}()
 89581  	if _db.XmallocFailed == 0 {
 89582  		func() {
 89583  			if _4_iIn <= int32(0) {
 89584  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128029), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(107884)))
 89585  				crt.X__builtin_abort(tls)
 89586  			}
 89587  		}()
 89588  		_10_pOp = _sqlite3VdbeGetOp(tls, _v, elem115((*TInLoop)((*t114)(unsafe.Pointer(&_pLevel.Xu)).XaInLoop), uintptr(preInc2(&_4_iIn, -1))).XaddrInTop)
 89589  		func() {
 89590  			if int32(_10_pOp.Xopcode) != int32(99) && int32(_10_pOp.Xopcode) != int32(125) {
 89591  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128031), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(107890)))
 89592  				crt.X__builtin_abort(tls)
 89593  			}
 89594  		}()
 89595  		func() {
 89596  			if int32(_10_pOp.Xopcode) == int32(99) && _10_pOp.Xp3 != ((_4_iReg+_j)+int32(2)) {
 89597  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128032), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(107938)))
 89598  				crt.X__builtin_abort(tls)
 89599  			}
 89600  		}()
 89601  		func() {
 89602  			if int32(_10_pOp.Xopcode) == int32(125) && _10_pOp.Xp2 != ((_4_iReg+_j)+int32(2)) {
 89603  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128033), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(107982)))
 89604  				crt.X__builtin_abort(tls)
 89605  			}
 89606  		}()
 89607  		_sqlite3VdbeAddOp3(tls, _v, int32(_10_pOp.Xopcode), _10_pOp.Xp1, _10_pOp.Xp2, _10_pOp.Xp3)
 89608  	}
 89609  	_10_pCompare = _sqlite3PExpr(tls, _pParse, int32(78), nil, nil)
 89610  	func() {
 89611  		if _10_pCompare == nil && _db.XmallocFailed == 0 {
 89612  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128041), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108025)))
 89613  			crt.X__builtin_abort(tls)
 89614  		}
 89615  	}()
 89616  	if _10_pCompare == nil {
 89617  		goto _50
 89618  	}
 89619  	*(**XExpr)(unsafe.Pointer(&_10_pCompare.XpLeft)) = (*XExpr)((*XExpr)(_pTerm.XpExpr).XpLeft)
 89620  	*(**XExpr)(unsafe.Pointer(&_10_pCompare.XpRight)) = store58(&_10_pRight, _sqlite3Expr(tls, _db, int32(157), nil))
 89621  	if _10_pRight != nil {
 89622  		_10_pRight.XiTable = (_4_iReg + _j) + int32(2)
 89623  		_sqlite3ExprIfFalse(tls, _pParse, _10_pCompare, _pLevel.XaddrCont, int32(0))
 89624  	}
 89625  	*(**XExpr)(unsafe.Pointer(&_10_pCompare.XpLeft)) = nil
 89626  	_sqlite3ExprDelete(tls, _db, _10_pCompare)
 89627  _50:
 89628  _31:
 89629  	_j -= 1
 89630  	goto _24
 89631  _27:
 89632  	_sqlite3ExprCachePop(tls, _pParse)
 89633  	goto _270
 89634  _10:
 89635  	if (_pLoop.XwsFlags&uint32(256)) == (0) || (_pLoop.XwsFlags&uint32(5)) == (0) {
 89636  		goto _54
 89637  	}
 89638  	func() {
 89639  		if int32((*t101)(unsafe.Pointer(&_pLoop.Xu)).XnEq) != int32(1) {
 89640  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128073), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108057)))
 89641  			crt.X__builtin_abort(tls)
 89642  		}
 89643  	}()
 89644  	_pTerm = *elem104((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), 0)
 89645  	func() {
 89646  		if _pTerm == nil {
 89647  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128075), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108079)))
 89648  			crt.X__builtin_abort(tls)
 89649  		}
 89650  	}()
 89651  	func() {
 89652  		if (*XExpr)(_pTerm.XpExpr) == nil {
 89653  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128076), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108088)))
 89654  			crt.X__builtin_abort(tls)
 89655  		}
 89656  	}()
 89657  	func() {
 89658  		if _omitTable != int32(0) {
 89659  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128077), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108104)))
 89660  			crt.X__builtin_abort(tls)
 89661  		}
 89662  	}()
 89663  	_iReleaseReg = preInc2(&_pParse.XnMem, 1)
 89664  	_iRowidReg = _codeEqualityTerm(tls, _pParse, _pTerm, _pLevel, int32(0), _bRev, _iReleaseReg)
 89665  	if _iRowidReg != _iReleaseReg {
 89666  		_sqlite3ReleaseTempReg(tls, _pParse, _iReleaseReg)
 89667  	}
 89668  	_addrNxt = _pLevel.XaddrNxt
 89669  	_sqlite3VdbeAddOp3(tls, _v, int32(31), _iCur, _addrNxt, _iRowidReg)
 89670  	_sqlite3ExprCacheAffinityChange(tls, _pParse, _iRowidReg, int32(1))
 89671  	_sqlite3ExprCacheStore(tls, _pParse, _iCur, int32(-1), _iRowidReg)
 89672  	_sqlite3VdbeComment(tls, _v, str(93736))
 89673  	_pLevel.Xop = uint8(164)
 89674  	goto _270
 89675  _54:
 89676  	if (_pLoop.XwsFlags&uint32(256)) == (0) || (_pLoop.XwsFlags&uint32(2)) == (0) {
 89677  		goto _66
 89678  	}
 89679  	_15_testOp = int32(164)
 89680  	_15_memEndValue = int32(0)
 89681  	func() {
 89682  		if _omitTable != int32(0) {
 89683  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128099), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108104)))
 89684  			crt.X__builtin_abort(tls)
 89685  		}
 89686  	}()
 89687  	_j = int32(0)
 89688  	_15_pStart = store100(&_15_pEnd, nil)
 89689  	if (_pLoop.XwsFlags & uint32(32)) != 0 {
 89690  		_15_pStart = *elem104((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(postInc2(&_j, 1)))
 89691  	}
 89692  	if (_pLoop.XwsFlags & uint32(16)) != 0 {
 89693  		_15_pEnd = *elem104((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(postInc2(&_j, 1)))
 89694  	}
 89695  	func() {
 89696  		if _15_pStart == nil && _15_pEnd == nil {
 89697  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128104), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108117)))
 89698  			crt.X__builtin_abort(tls)
 89699  		}
 89700  	}()
 89701  	if _bRev != 0 {
 89702  		_pTerm = _15_pStart
 89703  		_15_pStart = _15_pEnd
 89704  		_15_pEnd = _pTerm
 89705  	}
 89706  	if _15_pStart == nil {
 89707  		goto _75
 89708  	}
 89709  	_17_aMoveOp = [4]uint8{uint8(27), uint8(25), uint8(24), uint8(26)}
 89710  
 89711  	func() {
 89712  		if (int32(_15_pStart.XwtFlags) & int32(0)) != int32(0) {
 89713  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128129), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108138)))
 89714  			crt.X__builtin_abort(tls)
 89715  		}
 89716  	}()
 89717  	_17_pX = (*XExpr)(_15_pStart.XpExpr)
 89718  	func() {
 89719  		if _17_pX == nil {
 89720  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128132), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(65696)))
 89721  			crt.X__builtin_abort(tls)
 89722  		}
 89723  	}()
 89724  	if _sqlite3ExprIsVector(tls, (*XExpr)(_17_pX.XpRight)) != 0 {
 89725  		_17_r1 = store2(&_17_rTemp, _sqlite3GetTempReg(tls, _pParse))
 89726  		_codeExprOrVector(tls, _pParse, (*XExpr)(_17_pX.XpRight), _17_r1, int32(1))
 89727  		_17_op = int32(*elem15((*uint8)(unsafe.Pointer(&_17_aMoveOp)), uintptr((int32(_17_pX.Xop)-int32(79))|int32(1))))
 89728  		goto _81
 89729  	}
 89730  	_17_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_17_pX.XpRight), &_17_rTemp)
 89731  	_disableTerm(tls, _pLevel, _15_pStart)
 89732  	_17_op = int32(*elem15((*uint8)(unsafe.Pointer(&_17_aMoveOp)), uintptr(int32(_17_pX.Xop)-int32(79))))
 89733  _81:
 89734  	_sqlite3VdbeAddOp3(tls, _v, _17_op, _iCur, _addrBrk, _17_r1)
 89735  	_sqlite3VdbeComment(tls, _v, str(93736))
 89736  	_sqlite3ExprCacheAffinityChange(tls, _pParse, _17_r1, int32(1))
 89737  	_sqlite3ReleaseTempReg(tls, _pParse, _17_rTemp)
 89738  	goto _82
 89739  _75:
 89740  	_sqlite3VdbeAddOp2(tls, _v, func() int32 {
 89741  		if _bRev != 0 {
 89742  			return int32(33)
 89743  		}
 89744  		return int32(37)
 89745  	}(), _iCur, _addrHalt)
 89746  _82:
 89747  	if _15_pEnd == nil {
 89748  		goto _85
 89749  	}
 89750  	_21_pX = (*XExpr)(_15_pEnd.XpExpr)
 89751  	func() {
 89752  		if _21_pX == nil {
 89753  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128159), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(65696)))
 89754  			crt.X__builtin_abort(tls)
 89755  		}
 89756  	}()
 89757  	func() {
 89758  		if (int32(_15_pEnd.XwtFlags) & int32(0)) != int32(0) {
 89759  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128160), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108172)))
 89760  			crt.X__builtin_abort(tls)
 89761  		}
 89762  	}()
 89763  	_15_memEndValue = preInc2(&_pParse.XnMem, 1)
 89764  	_codeExprOrVector(tls, _pParse, (*XExpr)(_21_pX.XpRight), _15_memEndValue, int32(1))
 89765  	if (int32(0) == _sqlite3ExprIsVector(tls, (*XExpr)(_21_pX.XpRight))) && ((int32(_21_pX.Xop) == int32(81)) || (int32(_21_pX.Xop) == int32(79))) {
 89766  		_15_testOp = func() int32 {
 89767  			if _bRev != 0 {
 89768  				return int32(80)
 89769  			}
 89770  			return int32(82)
 89771  		}()
 89772  		goto _95
 89773  	}
 89774  	_15_testOp = func() int32 {
 89775  		if _bRev != 0 {
 89776  			return int32(81)
 89777  		}
 89778  		return int32(79)
 89779  	}()
 89780  _95:
 89781  	if int32(0) == _sqlite3ExprIsVector(tls, (*XExpr)(_21_pX.XpRight)) {
 89782  		_disableTerm(tls, _pLevel, _15_pEnd)
 89783  	}
 89784  _85:
 89785  	_15_start = _sqlite3VdbeCurrentAddr(tls, _v)
 89786  	_pLevel.Xop = uint8(func() int32 {
 89787  		if _bRev != 0 {
 89788  			return int32(6)
 89789  		}
 89790  		return int32(7)
 89791  	}())
 89792  	_pLevel.Xp1 = _iCur
 89793  	_pLevel.Xp2 = _15_start
 89794  	func() {
 89795  		if int32(_pLevel.Xp5) != int32(0) {
 89796  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128180), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108204)))
 89797  			crt.X__builtin_abort(tls)
 89798  		}
 89799  	}()
 89800  	if _15_testOp != int32(164) {
 89801  		_iRowidReg = preInc2(&_pParse.XnMem, 1)
 89802  		_sqlite3VdbeAddOp2(tls, _v, int32(125), _iCur, _iRowidReg)
 89803  		_sqlite3ExprCacheStore(tls, _pParse, _iCur, int32(-1), _iRowidReg)
 89804  		_sqlite3VdbeAddOp3(tls, _v, _15_testOp, _15_memEndValue, _addrBrk, _iRowidReg)
 89805  		_sqlite3VdbeChangeP5(tls, _v, uint16(83))
 89806  	}
 89807  	goto _270
 89808  _66:
 89809  	if (_pLoop.XwsFlags & uint32(512)) == 0 {
 89810  		goto _105
 89811  	}
 89812  	_26_nEq = (*t101)(unsafe.Pointer(&_pLoop.Xu)).XnEq
 89813  	_26_nBtm = (*t101)(unsafe.Pointer(&_pLoop.Xu)).XnBtm
 89814  	_26_nTop = (*t101)(unsafe.Pointer(&_pLoop.Xu)).XnTop
 89815  	_26_pRangeStart = nil
 89816  	_26_pRangeEnd = nil
 89817  	_26_nExtraReg = int32(0)
 89818  	_26_zEndAff = nil
 89819  	_26_bSeekPastNull = uint8(0)
 89820  	_26_bStopAtNull = uint8(0)
 89821  	_pIdx = (*XIndex)((*t101)(unsafe.Pointer(&_pLoop.Xu)).XpIndex)
 89822  	_26_iIdxCur = _pLevel.XiIdxCur
 89823  	func() {
 89824  		if int32(_26_nEq) < int32(_pLoop.XnSkip) {
 89825  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128260), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108218)))
 89826  			crt.X__builtin_abort(tls)
 89827  		}
 89828  	}()
 89829  	func() {
 89830  		if (*XExprList)(_pWInfo.XpOrderBy) != nil && ((*XExprList)(_pWInfo.XpOrderBy).XnExpr) != int32(1) && (int32(_pWInfo.XwctrlFlags)&int32(1)) != int32(0) {
 89831  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128270), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108236)))
 89832  			crt.X__builtin_abort(tls)
 89833  		}
 89834  	}()
 89835  	if (((int32(_pWInfo.XwctrlFlags) & int32(1)) != int32(0)) && (int32(_pWInfo.XnOBSat) > int32(0))) && (int32(_pIdx.XnKeyCol) > int32(_26_nEq)) {
 89836  		func() {
 89837  			if int32(_pLoop.XnSkip) != int32(0) {
 89838  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128277), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108331)))
 89839  				crt.X__builtin_abort(tls)
 89840  			}
 89841  		}()
 89842  		_26_bSeekPastNull = uint8(1)
 89843  		_26_nExtraReg = int32(1)
 89844  	}
 89845  	_j = int32(_26_nEq)
 89846  	if (_pLoop.XwsFlags & uint32(32)) != 0 {
 89847  		_26_pRangeStart = *elem104((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(postInc2(&_j, 1)))
 89848  		_26_nExtraReg = func() int32 {
 89849  			if _26_nExtraReg > int32((*t101)(unsafe.Pointer(&_pLoop.Xu)).XnBtm) {
 89850  				return _26_nExtraReg
 89851  			}
 89852  			return int32((*t101)(unsafe.Pointer(&_pLoop.Xu)).XnBtm)
 89853  		}()
 89854  		func() {
 89855  			if (int32(_26_pRangeStart.XwtFlags)&int32(256)) != int32(0) && (_pLoop.XwsFlags&uint32(16)) == (0) {
 89856  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128290), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108347)))
 89857  				crt.X__builtin_abort(tls)
 89858  			}
 89859  		}()
 89860  	}
 89861  	if (_pLoop.XwsFlags & uint32(16)) == 0 {
 89862  		goto _123
 89863  	}
 89864  	_26_pRangeEnd = *elem104((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(postInc2(&_j, 1)))
 89865  	_26_nExtraReg = func() int32 {
 89866  		if _26_nExtraReg > int32((*t101)(unsafe.Pointer(&_pLoop.Xu)).XnTop) {
 89867  			return _26_nExtraReg
 89868  		}
 89869  		return int32((*t101)(unsafe.Pointer(&_pLoop.Xu)).XnTop)
 89870  	}()
 89871  	if (int32(_26_pRangeEnd.XwtFlags) & int32(256)) != int32(0) {
 89872  		func() {
 89873  			if _26_pRangeStart == nil {
 89874  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128298), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108429)))
 89875  				crt.X__builtin_abort(tls)
 89876  			}
 89877  		}()
 89878  		func() {
 89879  			if (int32(_26_pRangeStart.XwtFlags) & int32(256)) == 0 {
 89880  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128299), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108444)))
 89881  				crt.X__builtin_abort(tls)
 89882  			}
 89883  		}()
 89884  		_pLevel.XiLikeRepCntr = uint32(preInc2(&_pParse.XnMem, 1))
 89885  		_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(1), int32(_pLevel.XiLikeRepCntr))
 89886  		_sqlite3VdbeComment(tls, _v, str(108480))
 89887  		_pLevel.XaddrLikeRep = _sqlite3VdbeCurrentAddr(tls, _v)
 89888  		func() {
 89889  			if (_bRev & int32(-2)) != int32(0) {
 89890  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128308), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108498)))
 89891  				crt.X__builtin_abort(tls)
 89892  			}
 89893  		}()
 89894  		_pLevel.XiLikeRepCntr <<= 1
 89895  		_pLevel.XiLikeRepCntr |= uint32(_bRev ^ bool2int(int32(*elem15(_pIdx.XaSortOrder, uintptr(_26_nEq))) == int32(1)))
 89896  	}
 89897  	if _26_pRangeStart != nil {
 89898  		goto _133
 89899  	}
 89900  	_j = int32(*elem50(_pIdx.XaiColumn, uintptr(_26_nEq)))
 89901  	if ((_j >= int32(0)) && (int32(elem41((*XColumn)((*XTable)(_pIdx.XpTable).XaCol), uintptr(_j)).XnotNull) == int32(0))) || (_j == int32(-2)) {
 89902  		_26_bSeekPastNull = uint8(1)
 89903  	}
 89904  _133:
 89905  _123:
 89906  	func() {
 89907  		if _26_pRangeEnd != nil && (int32(_26_pRangeEnd.XwtFlags)&int32(0)) != int32(0) {
 89908  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128320), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108513)))
 89909  			crt.X__builtin_abort(tls)
 89910  		}
 89911  	}()
 89912  	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))) {
 89913  		_34_t = _26_pRangeEnd
 89914  		_26_pRangeEnd = _26_pRangeStart
 89915  		_26_pRangeStart = _34_t
 89916  		_35_t = _26_bSeekPastNull
 89917  		_26_bSeekPastNull = _26_bStopAtNull
 89918  		_26_bStopAtNull = _35_t
 89919  		_36_t = uint8(_26_nBtm)
 89920  		_26_nBtm = _26_nTop
 89921  		_26_nTop = uint16(_36_t)
 89922  	}
 89923  	_26_regBase = _codeAllEqualityTerms(tls, _pParse, _pLevel, _bRev, _26_nExtraReg, &_26_zStartAff)
 89924  	func() {
 89925  		if _26_zStartAff != nil && _sqlite3Strlen30(tls, _26_zStartAff) < int32(_26_nEq) {
 89926  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128340), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108566)))
 89927  			crt.X__builtin_abort(tls)
 89928  		}
 89929  	}()
 89930  	if (_26_zStartAff != nil) && (_26_nTop != 0) {
 89931  		_26_zEndAff = _sqlite3DbStrDup(tls, _db, elem1(_26_zStartAff, uintptr(_26_nEq)))
 89932  	}
 89933  	_addrNxt = _pLevel.XaddrNxt
 89934  	_26_startEq = bool2int((_26_pRangeStart == nil) || (int32(_26_pRangeStart.XeOperator)&int32(40)) != 0)
 89935  	_26_endEq = bool2int((_26_pRangeEnd == nil) || (int32(_26_pRangeEnd.XeOperator)&int32(40)) != 0)
 89936  	_26_start_constraints = bool2int((_26_pRangeStart != nil) || (int32(_26_nEq) > int32(0)))
 89937  	_26_nConstraint = int32(_26_nEq)
 89938  	if _26_pRangeStart == nil {
 89939  		goto _152
 89940  	}
 89941  	_38_pRight = (*XExpr)((*XExpr)(_26_pRangeStart.XpExpr).XpRight)
 89942  	_codeExprOrVector(tls, _pParse, _38_pRight, _26_regBase+int32(_26_nEq), int32(_26_nBtm))
 89943  	_whereLikeOptimizationStringFixup(tls, _v, _pLevel, _26_pRangeStart)
 89944  	if ((int32(_26_pRangeStart.XwtFlags) & int32(0)) == int32(0)) && _sqlite3ExprCanBeNull(tls, _38_pRight) != 0 {
 89945  		_sqlite3VdbeAddOp2(tls, _v, int32(75), _26_regBase+int32(_26_nEq), _addrNxt)
 89946  	}
 89947  	if _26_zStartAff != nil {
 89948  		_updateRangeAffinityStr(tls, _38_pRight, int32(_26_nBtm), elem1(_26_zStartAff, uintptr(_26_nEq)))
 89949  	}
 89950  	_26_nConstraint += int32(_26_nBtm)
 89951  	if _sqlite3ExprIsVector(tls, _38_pRight) == int32(0) {
 89952  		_disableTerm(tls, _pLevel, _26_pRangeStart)
 89953  		goto _157
 89954  	}
 89955  	_26_startEq = int32(1)
 89956  _157:
 89957  	_26_bSeekPastNull = 0
 89958  	goto _159
 89959  _152:
 89960  	if _26_bSeekPastNull != 0 {
 89961  		_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _26_regBase+int32(_26_nEq))
 89962  		_26_nConstraint += 1
 89963  		_26_startEq = int32(0)
 89964  		_26_start_constraints = int32(1)
 89965  	}
 89966  _159:
 89967  	_codeApplyAffinity(tls, _pParse, _26_regBase, _26_nConstraint-int32(_26_bSeekPastNull), _26_zStartAff)
 89968  	if (int32(_pLoop.XnSkip) > int32(0)) && (_26_nConstraint == int32(_pLoop.XnSkip)) {
 89969  		goto _162
 89970  	}
 89971  	_26_op = int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00aStartOpØ001)), uintptr(((_26_start_constraints<<2)+(_26_startEq<<1))+_bRev)))
 89972  	func() {
 89973  		if _26_op == int32(0) {
 89974  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128390), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108614)))
 89975  			crt.X__builtin_abort(tls)
 89976  		}
 89977  	}()
 89978  	_sqlite3VdbeAddOp4Int(tls, _v, _26_op, _26_iIdxCur, _addrNxt, _26_regBase, _26_nConstraint)
 89979  _162:
 89980  	_26_nConstraint = int32(_26_nEq)
 89981  	if _26_pRangeEnd == nil {
 89982  		goto _165
 89983  	}
 89984  	_46_pRight = (*XExpr)((*XExpr)(_26_pRangeEnd.XpExpr).XpRight)
 89985  	_sqlite3ExprCacheRemove(tls, _pParse, _26_regBase+int32(_26_nEq), int32(1))
 89986  	_codeExprOrVector(tls, _pParse, _46_pRight, _26_regBase+int32(_26_nEq), int32(_26_nTop))
 89987  	_whereLikeOptimizationStringFixup(tls, _v, _pLevel, _26_pRangeEnd)
 89988  	if ((int32(_26_pRangeEnd.XwtFlags) & int32(0)) == int32(0)) && _sqlite3ExprCanBeNull(tls, _46_pRight) != 0 {
 89989  		_sqlite3VdbeAddOp2(tls, _v, int32(75), _26_regBase+int32(_26_nEq), _addrNxt)
 89990  	}
 89991  	if _26_zEndAff != nil {
 89992  		_updateRangeAffinityStr(tls, _46_pRight, int32(_26_nTop), _26_zEndAff)
 89993  		_codeApplyAffinity(tls, _pParse, _26_regBase+int32(_26_nEq), int32(_26_nTop), _26_zEndAff)
 89994  		goto _169
 89995  	}
 89996  	func() {
 89997  		if ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == 0 {
 89998  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128420), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(42441)))
 89999  			crt.X__builtin_abort(tls)
 90000  		}
 90001  	}()
 90002  _169:
 90003  	_26_nConstraint += int32(_26_nTop)
 90004  	if _sqlite3ExprIsVector(tls, _46_pRight) == int32(0) {
 90005  		_disableTerm(tls, _pLevel, _26_pRangeEnd)
 90006  		goto _173
 90007  	}
 90008  	_26_endEq = int32(1)
 90009  _173:
 90010  	goto _175
 90011  _165:
 90012  	if _26_bStopAtNull != 0 {
 90013  		_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _26_regBase+int32(_26_nEq))
 90014  		_26_endEq = int32(0)
 90015  		_26_nConstraint += 1
 90016  	}
 90017  _175:
 90018  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_26_zStartAff))
 90019  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_26_zEndAff))
 90020  	_pLevel.Xp2 = _sqlite3VdbeCurrentAddr(tls, _v)
 90021  	if _26_nConstraint != 0 {
 90022  		_26_op = int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00aEndOpØ002)), uintptr((_bRev*int32(2))+_26_endEq)))
 90023  		_sqlite3VdbeAddOp4Int(tls, _v, _26_op, _26_iIdxCur, _addrNxt, _26_regBase, _26_nConstraint)
 90024  	}
 90025  	if _omitTable != 0 {
 90026  		goto _185
 90027  	}
 90028  	if (((*XTable)(_pIdx.XpTable).XtabFlags) & uint32(32)) != (0) {
 90029  		goto _179
 90030  	}
 90031  	if (int32(_pWInfo.XwctrlFlags)&int32(1024)) != 0 || ((int32(_pWInfo.XwctrlFlags)&int32(4096)) != 0 && (int32(_pWInfo.XeOnePass) == int32(1))) {
 90032  		_iRowidReg = preInc2(&_pParse.XnMem, 1)
 90033  		_sqlite3VdbeAddOp2(tls, _v, int32(131), _26_iIdxCur, _iRowidReg)
 90034  		_sqlite3ExprCacheStore(tls, _pParse, _iCur, int32(-1), _iRowidReg)
 90035  		_sqlite3VdbeAddOp3(tls, _v, int32(32), _iCur, int32(0), _iRowidReg)
 90036  		goto _183
 90037  	}
 90038  	_codeDeferredSeek(tls, _pWInfo, _pIdx, _iCur, _26_iIdxCur)
 90039  _183:
 90040  	goto _185
 90041  _179:
 90042  	if _iCur == _26_iIdxCur {
 90043  		goto _185
 90044  	}
 90045  	_58_pPk = _sqlite3PrimaryKeyIndex(tls, (*XTable)(_pIdx.XpTable))
 90046  	_iRowidReg = _sqlite3GetTempRange(tls, _pParse, int32(_58_pPk.XnKeyCol))
 90047  	_j = int32(0)
 90048  _186:
 90049  	if _j >= int32(_58_pPk.XnKeyCol) {
 90050  		goto _189
 90051  	}
 90052  	_k = int32(_sqlite3ColumnOfIndex(tls, _pIdx, *elem50(_58_pPk.XaiColumn, uintptr(_j))))
 90053  	_sqlite3VdbeAddOp3(tls, _v, int32(99), _26_iIdxCur, _k, _iRowidReg+_j)
 90054  	_j += 1
 90055  	goto _186
 90056  _189:
 90057  	_sqlite3VdbeAddOp4Int(tls, _v, int32(29), _iCur, _addrCont, _iRowidReg, int32(_58_pPk.XnKeyCol))
 90058  _185:
 90059  	_whereIndexExprTrans(tls, _pIdx, _iCur, _26_iIdxCur, _pWInfo)
 90060  	if (_pLoop.XwsFlags & uint32(4096)) != 0 {
 90061  		_pLevel.Xop = uint8(164)
 90062  		goto _193
 90063  	}
 90064  	if _bRev != 0 {
 90065  		_pLevel.Xop = uint8(6)
 90066  		goto _193
 90067  	}
 90068  	_pLevel.Xop = uint8(7)
 90069  _193:
 90070  	_pLevel.Xp1 = _26_iIdxCur
 90071  	_pLevel.Xp3 = uint8(func() int32 {
 90072  		if (_pLoop.XwsFlags & uint32(65536)) != (0) {
 90073  			return int32(1)
 90074  		}
 90075  		return int32(0)
 90076  	}())
 90077  	if (_pLoop.XwsFlags & uint32(15)) == (0) {
 90078  		_pLevel.Xp5 = uint8(1)
 90079  		goto _197
 90080  	}
 90081  	func() {
 90082  		if int32(_pLevel.Xp5) != int32(0) {
 90083  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128498), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108204)))
 90084  			crt.X__builtin_abort(tls)
 90085  		}
 90086  	}()
 90087  _197:
 90088  	if _omitTable != 0 {
 90089  		_pIdx = nil
 90090  	}
 90091  	goto _270
 90092  _105:
 90093  	if (_pLoop.XwsFlags & uint32(8192)) == 0 {
 90094  		goto _202
 90095  	}
 90096  	_65_pCov = nil
 90097  	_65_iCovCur = postInc2(&_pParse.XnTab, 1)
 90098  	_65_regReturn = preInc2(&_pParse.XnMem, 1)
 90099  	_65_regRowset = int32(0)
 90100  	_65_regRowid = int32(0)
 90101  	_65_iLoopBody = _sqlite3VdbeMakeLabel(tls, _v)
 90102  	_65_untestedTerms = int32(0)
 90103  	_65_pAndExpr = nil
 90104  	_65_pTab = (*XTable)(_pTabItem.XpTab)
 90105  	_pTerm = *elem104((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), 0)
 90106  	func() {
 90107  		if _pTerm == nil {
 90108  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128565), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108079)))
 90109  			crt.X__builtin_abort(tls)
 90110  		}
 90111  	}()
 90112  	func() {
 90113  		if (int32(_pTerm.XeOperator) & int32(512)) == 0 {
 90114  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128566), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108620)))
 90115  			crt.X__builtin_abort(tls)
 90116  		}
 90117  	}()
 90118  	func() {
 90119  		if (int32(_pTerm.XwtFlags) & int32(16)) == int32(0) {
 90120  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128567), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108645)))
 90121  			crt.X__builtin_abort(tls)
 90122  		}
 90123  	}()
 90124  	_65_pOrWc = &((*XWhereOrInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_pTerm.Xu))).Xwc)
 90125  	_pLevel.Xop = uint8(52)
 90126  	_pLevel.Xp1 = _65_regReturn
 90127  	if int32(_pWInfo.XnLevel) <= int32(1) {
 90128  		goto _209
 90129  	}
 90130  	_66_nNotReady = (int32(_pWInfo.XnLevel) - _iLevel) - int32(1)
 90131  	_65_pOrTab = (*XSrcList)(_sqlite3DbMallocRaw(tls, _db, uint64(uint32(76)+(uint32(_66_nNotReady)*uint32(68)))))
 90132  	if _65_pOrTab == nil {
 90133  		return _notReady
 90134  	}
 90135  	_65_pOrTab.XnAlloc = uint32(uint8(_66_nNotReady + int32(1)))
 90136  	_65_pOrTab.XnSrc = int32(_65_pOrTab.XnAlloc)
 90137  	crt.Xmemcpy(tls, unsafe.Pointer(&_65_pOrTab.Xa), unsafe.Pointer(_pTabItem), uint32(68))
 90138  	_66_origSrc = (*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.XpTabList).Xa)))
 90139  	_k = int32(1)
 90140  _211:
 90141  	if _k > _66_nNotReady {
 90142  		goto _214
 90143  	}
 90144  	crt.Xmemcpy(tls, unsafe.Pointer(elem6((*TSrcList_item)(unsafe.Pointer(&_65_pOrTab.Xa)), uintptr(_k))), unsafe.Pointer(elem6(_66_origSrc, uintptr(elem99(_pLevel, uintptr(_k)).XiFrom))), uint32(68))
 90145  	_k += 1
 90146  	goto _211
 90147  _214:
 90148  	goto _215
 90149  _209:
 90150  	_65_pOrTab = (*XSrcList)(_pWInfo.XpTabList)
 90151  _215:
 90152  	if (int32(_pWInfo.XwctrlFlags) & int32(16)) != int32(0) {
 90153  		goto _216
 90154  	}
 90155  	if (_65_pTab.XtabFlags & uint32(32)) == (0) {
 90156  		_65_regRowset = preInc2(&_pParse.XnMem, 1)
 90157  		_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _65_regRowset)
 90158  		goto _218
 90159  	}
 90160  	_71_pPk = _sqlite3PrimaryKeyIndex(tls, _65_pTab)
 90161  	_65_regRowset = postInc2(&_pParse.XnTab, 1)
 90162  	_sqlite3VdbeAddOp2(tls, _v, int32(110), _65_regRowset, int32(_71_pPk.XnKeyCol))
 90163  	_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _71_pPk)
 90164  _218:
 90165  	_65_regRowid = preInc2(&_pParse.XnMem, 1)
 90166  _216:
 90167  	_65_iRetInit = _sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _65_regReturn)
 90168  	if _pWC.XnTerm <= int32(1) {
 90169  		goto _219
 90170  	}
 90171  	_72_iTerm = int32(0)
 90172  _220:
 90173  	if _72_iTerm >= _pWC.XnTerm {
 90174  		goto _223
 90175  	}
 90176  	_73_pExpr = (*XExpr)(elem100((*XWhereTerm)(_pWC.Xa), uintptr(_72_iTerm)).XpExpr)
 90177  	if elem100((*XWhereTerm)(_pWC.Xa), uintptr(_72_iTerm)) == _pTerm {
 90178  		goto _221
 90179  	}
 90180  	if (_73_pExpr.Xflags & uint32(1)) != (0) {
 90181  		goto _221
 90182  	}
 90183  	if (int32(elem100((*XWhereTerm)(_pWC.Xa), uintptr(_72_iTerm)).XwtFlags) & int32(6)) != int32(0) {
 90184  		goto _221
 90185  	}
 90186  	if (int32(elem100((*XWhereTerm)(_pWC.Xa), uintptr(_72_iTerm)).XeOperator) & int32(8191)) == int32(0) {
 90187  		goto _221
 90188  	}
 90189  	_73_pExpr = _sqlite3ExprDup(tls, _db, _73_pExpr, int32(0))
 90190  	_65_pAndExpr = _sqlite3ExprAnd(tls, _db, _65_pAndExpr, _73_pExpr)
 90191  _221:
 90192  	_72_iTerm += 1
 90193  	goto _220
 90194  _223:
 90195  	if _65_pAndExpr != nil {
 90196  		_65_pAndExpr = _sqlite3PExpr(tls, _pParse, int32(327), nil, _65_pAndExpr)
 90197  	}
 90198  _219:
 90199  	_65_wctrlFlags = uint16(int32(32) | (int32(_pWInfo.XwctrlFlags) & int32(1024)))
 90200  	_65_ii = int32(0)
 90201  _229:
 90202  	if _65_ii >= _65_pOrWc.XnTerm {
 90203  		goto _232
 90204  	}
 90205  	_75_pOrTerm = elem100((*XWhereTerm)(_65_pOrWc.Xa), uintptr(_65_ii))
 90206  	if _75_pOrTerm.XleftCursor != _iCur && (int32(_75_pOrTerm.XeOperator)&int32(1024)) == int32(0) {
 90207  		goto _234
 90208  	}
 90209  	_76_pOrExpr = (*XExpr)(_75_pOrTerm.XpExpr)
 90210  	_76_jmp1 = int32(0)
 90211  	if (_65_pAndExpr != nil) && ((_76_pOrExpr.Xflags & uint32(1)) == (0)) {
 90212  		*(**XExpr)(unsafe.Pointer(&_65_pAndExpr.XpLeft)) = _76_pOrExpr
 90213  		_76_pOrExpr = _65_pAndExpr
 90214  	}
 90215  	_76_pSubWInfo = _sqlite3WhereBegin(tls, _pParse, _65_pOrTab, _76_pOrExpr, nil, nil, _65_wctrlFlags, _65_iCovCur)
 90216  	func() {
 90217  		if _76_pSubWInfo == nil && _pParse.XnErr == 0 && _db.XmallocFailed == 0 {
 90218  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128672), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108679)))
 90219  			crt.X__builtin_abort(tls)
 90220  		}
 90221  	}()
 90222  	if _76_pSubWInfo == nil {
 90223  		goto _241
 90224  	}
 90225  	_78_addrExplain = _sqlite3WhereExplainOneScan(tls, _pParse, _65_pOrTab, elem99((*XWhereLevel)(unsafe.Pointer(&_76_pSubWInfo.Xa)), 0), _iLevel, int32(_pLevel.XiFrom), 0)
 90226  
 90227  	if (int32(_pWInfo.XwctrlFlags) & int32(16)) != int32(0) {
 90228  		goto _242
 90229  	}
 90230  	_79_iSet = func() int32 {
 90231  		if _65_ii == (_65_pOrWc.XnTerm - int32(1)) {
 90232  			return int32(-1)
 90233  		}
 90234  		return _65_ii
 90235  	}()
 90236  	if (_65_pTab.XtabFlags & uint32(32)) == (0) {
 90237  		_79_r = _sqlite3ExprCodeGetColumn(tls, _pParse, _65_pTab, int32(-1), _iCur, _65_regRowid, 0)
 90238  		_76_jmp1 = _sqlite3VdbeAddOp4Int(tls, _v, int32(43), _65_regRowset, int32(0), _79_r, _79_iSet)
 90239  		goto _246
 90240  	}
 90241  	_81_pPk = _sqlite3PrimaryKeyIndex(tls, _65_pTab)
 90242  	_81_nPk = int32(_81_pPk.XnKeyCol)
 90243  	_79_r = _sqlite3GetTempRange(tls, _pParse, _81_nPk)
 90244  	_81_iPk = int32(0)
 90245  _247:
 90246  	if _81_iPk >= _81_nPk {
 90247  		goto _250
 90248  	}
 90249  	_82_iCol = int32(*elem50(_81_pPk.XaiColumn, uintptr(_81_iPk)))
 90250  	_sqlite3ExprCodeGetColumnToReg(tls, _pParse, _65_pTab, _82_iCol, _iCur, _79_r+_81_iPk)
 90251  	_81_iPk += 1
 90252  	goto _247
 90253  _250:
 90254  	if _79_iSet != 0 {
 90255  		_76_jmp1 = _sqlite3VdbeAddOp4Int(tls, _v, int32(30), _65_regRowset, int32(0), _79_r, _81_nPk)
 90256  	}
 90257  	if _79_iSet < int32(0) {
 90258  		goto _252
 90259  	}
 90260  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _79_r, _81_nPk, _65_regRowid)
 90261  	_sqlite3VdbeAddOp4Int(tls, _v, int32(128), _65_regRowset, _65_regRowid, _79_r, _81_nPk)
 90262  	if _79_iSet != 0 {
 90263  		_sqlite3VdbeChangeP5(tls, _v, uint16(16))
 90264  	}
 90265  _252:
 90266  	_sqlite3ReleaseTempRange(tls, _pParse, _79_r, _81_nPk)
 90267  _246:
 90268  _242:
 90269  	_sqlite3VdbeAddOp2(tls, _v, int32(14), _65_regReturn, _65_iLoopBody)
 90270  	if _76_jmp1 != 0 {
 90271  		_sqlite3VdbeJumpHere(tls, _v, _76_jmp1)
 90272  	}
 90273  	if _76_pSubWInfo.XuntestedTerms != 0 {
 90274  		_65_untestedTerms = int32(1)
 90275  	}
 90276  	_78_pSubLoop = (*XWhereLoop)(elem99((*XWhereLevel)(unsafe.Pointer(&_76_pSubWInfo.Xa)), 0).XpWLoop)
 90277  	func() {
 90278  		if (_78_pSubLoop.XwsFlags & uint32(16384)) != (0) {
 90279  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128759), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108725)))
 90280  			crt.X__builtin_abort(tls)
 90281  		}
 90282  	}()
 90283  	if (((_78_pSubLoop.XwsFlags & uint32(512)) != (0)) && ((_65_ii == int32(0)) || ((*XIndex)((*t101)(unsafe.Pointer(&_78_pSubLoop.Xu)).XpIndex) == _65_pCov))) && (((_65_pTab.XtabFlags & uint32(32)) == (0)) || (int32((uint32((*XIndex)((*t101)(unsafe.Pointer(&_78_pSubLoop.Xu)).XpIndex).XidxType)<<30)>>30) != int32(2))) {
 90284  		func() {
 90285  			if (elem99((*XWhereLevel)(unsafe.Pointer(&_76_pSubWInfo.Xa)), 0).XiIdxCur) != _65_iCovCur {
 90286  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128764), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108767)))
 90287  				crt.X__builtin_abort(tls)
 90288  			}
 90289  		}()
 90290  		_65_pCov = (*XIndex)((*t101)(unsafe.Pointer(&_78_pSubLoop.Xu)).XpIndex)
 90291  		goto _265
 90292  	}
 90293  	_65_pCov = nil
 90294  _265:
 90295  	_sqlite3WhereEnd(tls, _76_pSubWInfo)
 90296  _241:
 90297  _234:
 90298  	_65_ii += 1
 90299  	goto _229
 90300  _232:
 90301  	*(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pLevel.Xu)))) = _65_pCov
 90302  	if _65_pCov != nil {
 90303  		_pLevel.XiIdxCur = _65_iCovCur
 90304  	}
 90305  	if _65_pAndExpr != nil {
 90306  		*(**XExpr)(unsafe.Pointer(&_65_pAndExpr.XpLeft)) = nil
 90307  		_sqlite3ExprDelete(tls, _db, _65_pAndExpr)
 90308  	}
 90309  	_sqlite3VdbeChangeP1(tls, _v, uint32(_65_iRetInit), _sqlite3VdbeCurrentAddr(tls, _v))
 90310  	_sqlite3VdbeGoto(tls, _v, _pLevel.XaddrBrk)
 90311  	_sqlite3VdbeResolveLabel(tls, _v, _65_iLoopBody)
 90312  	if int32(_pWInfo.XnLevel) > int32(1) {
 90313  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_65_pOrTab))
 90314  	}
 90315  	if _65_untestedTerms == 0 {
 90316  		_disableTerm(tls, _pLevel, _pTerm)
 90317  	}
 90318  	goto _270
 90319  _202:
 90320  	func() {
 90321  		if _bRev != int32(0) && _bRev != int32(1) {
 90322  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128796), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108800)))
 90323  			crt.X__builtin_abort(tls)
 90324  		}
 90325  	}()
 90326  	if ((uint32((_pTabItem.Xfg.XnotIndexed)>>5) << 31) >> 31) != 0 {
 90327  		_pLevel.Xop = uint8(164)
 90328  		goto _275
 90329  	}
 90330  	_pLevel.Xop = *elem15((*uint8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00aStepØ003)), uintptr(_bRev))
 90331  	_pLevel.Xp1 = _iCur
 90332  	_pLevel.Xp2 = int32(1) + _sqlite3VdbeAddOp2(tls, _v, int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00aStartØ004)), uintptr(_bRev))), _iCur, _addrHalt)
 90333  	_pLevel.Xp5 = uint8(1)
 90334  _275:
 90335  _270:
 90336  	_loopAgain = int32(0)
 90337  	*func() *int32 { _pTerm = (*XWhereTerm)(_pWC.Xa); return &_j }() = _pWC.XnTerm
 90338  _277:
 90339  	if _j <= int32(0) {
 90340  		goto _280
 90341  	}
 90342  	_92_skipLikeAddr = int32(0)
 90343  	if (int32(_pTerm.XwtFlags) & int32(6)) != 0 {
 90344  		goto _278
 90345  	}
 90346  	if (_pTerm.XprereqAll & _pLevel.XnotReady) != (0) {
 90347  		_pWInfo.XuntestedTerms = uint8(1)
 90348  		goto _278
 90349  	}
 90350  	_92_pE = (*XExpr)(_pTerm.XpExpr)
 90351  	func() {
 90352  		if _92_pE == nil {
 90353  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128839), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108819)))
 90354  			crt.X__builtin_abort(tls)
 90355  		}
 90356  	}()
 90357  	if _pLevel.XiLeftJoin != 0 && ((_92_pE.Xflags & uint32(1)) == (0)) {
 90358  		goto _278
 90359  	}
 90360  	if (_pIdx != nil) && (_sqlite3ExprCoveredByIndex(tls, _92_pE, _pLevel.XiTabCur, _pIdx) == 0) {
 90361  		_loopAgain = int32(1)
 90362  		goto _278
 90363  	}
 90364  	if (int32(_pTerm.XwtFlags) & int32(512)) != 0 {
 90365  		_96_x = _pLevel.XiLikeRepCntr
 90366  		func() {
 90367  			if _96_x <= (0) {
 90368  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128857), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108825)))
 90369  				crt.X__builtin_abort(tls)
 90370  			}
 90371  		}()
 90372  		_92_skipLikeAddr = _sqlite3VdbeAddOp1(tls, _v, func() int32 {
 90373  			if (_96_x & uint32(1)) != 0 {
 90374  				return int32(22)
 90375  			}
 90376  			return int32(21)
 90377  		}(), int32(_96_x>>1))
 90378  	}
 90379  	_sqlite3ExprIfFalse(tls, _pParse, _92_pE, _addrCont, int32(16))
 90380  	if _92_skipLikeAddr != 0 {
 90381  		_sqlite3VdbeJumpHere(tls, _v, _92_skipLikeAddr)
 90382  	}
 90383  	{
 90384  		p := &_pTerm.XwtFlags
 90385  		*p = uint16(int32(*p) | int32(4))
 90386  	}
 90387  _278:
 90388  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _j -= 1; return &_pTerm }())) += uintptr(48)
 90389  	goto _277
 90390  _280:
 90391  	_pIdx = nil
 90392  	if _loopAgain != 0 {
 90393  		goto _270
 90394  	}
 90395  	*func() *int32 { _pTerm = (*XWhereTerm)(_pWC.Xa); return &_j }() = _pWC.XnTerm
 90396  _295:
 90397  	if _j <= int32(0) {
 90398  		goto _298
 90399  	}
 90400  	if (int32(_pTerm.XwtFlags) & int32(6)) != 0 {
 90401  		goto _296
 90402  	}
 90403  	if (int32(_pTerm.XeOperator) & int32(130)) == int32(0) {
 90404  		goto _296
 90405  	}
 90406  	if (int32(_pTerm.XeOperator) & int32(2048)) == int32(0) {
 90407  		goto _296
 90408  	}
 90409  	if _pTerm.XleftCursor != _iCur {
 90410  		goto _296
 90411  	}
 90412  	if _pLevel.XiLeftJoin != 0 {
 90413  		goto _296
 90414  	}
 90415  	_97_pE = (*XExpr)(_pTerm.XpExpr)
 90416  	func() {
 90417  		if (_97_pE.Xflags & uint32(1)) != (0) {
 90418  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128886), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108829)))
 90419  			crt.X__builtin_abort(tls)
 90420  		}
 90421  	}()
 90422  	func() {
 90423  		if (_pTerm.XprereqRight & _pLevel.XnotReady) == (0) {
 90424  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128887), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108863)))
 90425  			crt.X__builtin_abort(tls)
 90426  		}
 90427  	}()
 90428  	_97_pAlt = _sqlite3WhereFindTerm(tls, _pWC, _iCur, *(*int32)(unsafe.Pointer(&_pTerm.Xu)), _notReady, uint32(131), nil)
 90429  	if _97_pAlt == nil {
 90430  		goto _296
 90431  	}
 90432  	if (int32(_97_pAlt.XwtFlags) & int32(4)) != 0 {
 90433  		goto _296
 90434  	}
 90435  	_97_sEAlt = *(*XExpr)(_97_pAlt.XpExpr)
 90436  	*(**XExpr)(unsafe.Pointer(&_97_sEAlt.XpLeft)) = (*XExpr)(_97_pE.XpLeft)
 90437  	_sqlite3ExprIfFalse(tls, _pParse, &_97_sEAlt, _addrCont, int32(16))
 90438  _296:
 90439  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _j -= 1; return &_pTerm }())) += uintptr(48)
 90440  	goto _295
 90441  _298:
 90442  	if _pLevel.XiLeftJoin == 0 {
 90443  		goto _310
 90444  	}
 90445  	_pLevel.XaddrFirst = _sqlite3VdbeCurrentAddr(tls, _v)
 90446  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(1), _pLevel.XiLeftJoin)
 90447  	_sqlite3VdbeComment(tls, _v, str(108906))
 90448  	_sqlite3ExprCacheClear(tls, _pParse)
 90449  	*func() *int32 { _pTerm = (*XWhereTerm)(_pWC.Xa); return &_j }() = int32(0)
 90450  _311:
 90451  	if _j >= _pWC.XnTerm {
 90452  		goto _314
 90453  	}
 90454  	if (int32(_pTerm.XwtFlags) & int32(6)) != 0 {
 90455  		goto _312
 90456  	}
 90457  	if (_pTerm.XprereqAll & _pLevel.XnotReady) != (0) {
 90458  		func() {
 90459  			if _pWInfo.XuntestedTerms == 0 {
 90460  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128914), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108927)))
 90461  				crt.X__builtin_abort(tls)
 90462  			}
 90463  		}()
 90464  		goto _312
 90465  	}
 90466  	func() {
 90467  		if _pTerm.XpExpr == nil {
 90468  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(128917), unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000), unsafe.Pointer(str(108949)))
 90469  			crt.X__builtin_abort(tls)
 90470  		}
 90471  	}()
 90472  	_sqlite3ExprIfFalse(tls, _pParse, (*XExpr)(_pTerm.XpExpr), _addrCont, int32(16))
 90473  	{
 90474  		p := &_pTerm.XwtFlags
 90475  		*p = uint16(int32(*p) | int32(4))
 90476  	}
 90477  _312:
 90478  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _j += 1; return &_pTerm }())) += uintptr(48)
 90479  	goto _311
 90480  _314:
 90481  _310:
 90482  	return _pLevel.XnotReady
 90483  
 90484  	_ = _17_aMoveOp
 90485  	_ = _78_addrExplain
 90486  	panic(0)
 90487  }
 90488  
 90489  var _sqlite3WhereCodeOneLoopStartØ00__func__Ø000 [29]int8
 90490  
 90491  func init() {
 90492  	crt.Xstrncpy(nil, &_sqlite3WhereCodeOneLoopStartØ00__func__Ø000[0], str(108962), 29)
 90493  }
 90494  
 90495  // C comment
 90496  //  /*
 90497  //  ** Generate code for a single equality term of the WHERE clause.  An equality
 90498  //  ** term can be either X=expr or X IN (...).   pTerm is the term to be
 90499  //  ** coded.
 90500  //  **
 90501  //  ** The current value for the constraint is left in a register, the index
 90502  //  ** of which is returned.  An attempt is made store the result in iTarget but
 90503  //  ** this is only guaranteed for TK_ISNULL and TK_IN constraints.  If the
 90504  //  ** constraint is a TK_EQ or TK_IS, then the current value might be left in
 90505  //  ** some other register and it is the caller's responsibility to compensate.
 90506  //  **
 90507  //  ** For a constraint of the form X=expr, the expression is evaluated in
 90508  //  ** straight-line code.  For constraints of the form X IN (...)
 90509  //  ** this routine sets up a loop that will iterate over all values of X.
 90510  //  */
 90511  func _codeEqualityTerm(tls *crt.TLS, _pParse *XParse, _pTerm *XWhereTerm, _pLevel *XWhereLevel, _iEq int32, _bRev int32, _iTarget int32) (r0 int32) {
 90512  	var _iReg, _3_eType, _3_iTab, _3_i, _3_nEq, _11_iField, _19_iMap, _21_iOut, _23_iCol int32
 90513  	var _3_aiMap *int32
 90514  	var _9_savedDbOptFlags uint16
 90515  	var _9_db *Xsqlite3
 90516  	var _v *TVdbe
 90517  	var _9_pOrigRhs, _9_pOrigLhs, _9_pRhs, _9_pLhs, _13_pOrderBy *XExprList
 90518  	var _9_pSelect *XSelect
 90519  	var _pX, _11_pNewRhs, _11_pNewLhs, _12_pLeft *XExpr
 90520  	var _3_pLoop *XWhereLoop
 90521  	var _3_pIn *TInLoop
 90522  	_pX = (*XExpr)(_pTerm.XpExpr)
 90523  	_v = (*TVdbe)(_pParse.XpVdbe)
 90524  	func() {
 90525  		if (*elem104((**XWhereTerm)(unsafe.Pointer((*XWhereLoop)(_pLevel.XpWLoop).XaLTerm)), uintptr(_iEq))) != _pTerm {
 90526  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127197), unsafe.Pointer(&_codeEqualityTermØ00__func__Ø000), unsafe.Pointer(str(108991)))
 90527  			crt.X__builtin_abort(tls)
 90528  		}
 90529  	}()
 90530  	func() {
 90531  		if _iTarget <= int32(0) {
 90532  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127198), unsafe.Pointer(&_codeEqualityTermØ00__func__Ø000), unsafe.Pointer(str(109026)))
 90533  			crt.X__builtin_abort(tls)
 90534  		}
 90535  	}()
 90536  	if (int32(_pX.Xop) == int32(78)) || (int32(_pX.Xop) == int32(72)) {
 90537  		_iReg = _sqlite3ExprCodeTarget(tls, _pParse, (*XExpr)(_pX.XpRight), _iTarget)
 90538  		goto _8
 90539  	}
 90540  	if int32(_pX.Xop) == int32(75) {
 90541  		_iReg = _iTarget
 90542  		_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _iReg)
 90543  		goto _8
 90544  	}
 90545  	_3_eType = int32(5)
 90546  	_3_pLoop = (*XWhereLoop)(_pLevel.XpWLoop)
 90547  	_3_nEq = int32(0)
 90548  	_3_aiMap = nil
 90549  	if (((_3_pLoop.XwsFlags & uint32(1024)) == (0)) && ((*XIndex)((*t101)(unsafe.Pointer(&_3_pLoop.Xu)).XpIndex) != nil)) && ((*elem15((*XIndex)((*t101)(unsafe.Pointer(&_3_pLoop.Xu)).XpIndex).XaSortOrder, uintptr(_iEq))) != 0) {
 90550  		_bRev = bool2int(_bRev == 0)
 90551  	}
 90552  	func() {
 90553  		if int32(_pX.Xop) != int32(74) {
 90554  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127222), unsafe.Pointer(&_codeEqualityTermØ00__func__Ø000), unsafe.Pointer(str(102033)))
 90555  			crt.X__builtin_abort(tls)
 90556  		}
 90557  	}()
 90558  	_iReg = _iTarget
 90559  	_3_i = int32(0)
 90560  _14:
 90561  	if _3_i >= _iEq {
 90562  		goto _17
 90563  	}
 90564  	if ((*elem104((**XWhereTerm)(unsafe.Pointer(_3_pLoop.XaLTerm)), uintptr(_3_i))) != nil) && ((*XExpr)((*elem104((**XWhereTerm)(unsafe.Pointer(_3_pLoop.XaLTerm)), uintptr(_3_i))).XpExpr) == _pX) {
 90565  		_disableTerm(tls, _pLevel, _pTerm)
 90566  		return _iTarget
 90567  	}
 90568  	_3_i += 1
 90569  	goto _14
 90570  _17:
 90571  	_3_i = _iEq
 90572  _20:
 90573  	if _3_i >= int32(_3_pLoop.XnLTerm) {
 90574  		goto _23
 90575  	}
 90576  	if func() int32 {
 90577  		if (*elem104((**XWhereTerm)(unsafe.Pointer(_3_pLoop.XaLTerm)), uintptr(_3_i))) != nil {
 90578  			return int32(1)
 90579  		}
 90580  		return func() int32 {
 90581  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127232), unsafe.Pointer(&_codeEqualityTermØ00__func__Ø000), unsafe.Pointer(str(4809)))
 90582  			crt.X__builtin_abort(tls)
 90583  			return int32(0)
 90584  		}()
 90585  	}() != 0 && ((*XExpr)((*elem104((**XWhereTerm)(unsafe.Pointer(_3_pLoop.XaLTerm)), uintptr(_3_i))).XpExpr) == _pX) {
 90586  		_3_nEq += 1
 90587  	}
 90588  	_3_i += 1
 90589  	goto _20
 90590  _23:
 90591  	if ((_pX.Xflags & uint32(2048)) == (0)) || (((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pX.Xx))).XpEList).XnExpr) == int32(1)) {
 90592  		_3_eType = _sqlite3FindInIndex(tls, _pParse, _pX, uint32(4), nil, nil)
 90593  		goto _30
 90594  	}
 90595  	_9_pSelect = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pX.Xx)))
 90596  	_9_db = (*Xsqlite3)(_pParse.Xdb)
 90597  	_9_savedDbOptFlags = _9_db.XdbOptFlags
 90598  	_9_pOrigRhs = (*XExprList)(_9_pSelect.XpEList)
 90599  	_9_pOrigLhs = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&((*XExpr)(_pX.XpLeft).Xx))))
 90600  	_9_pRhs = nil
 90601  	_9_pLhs = nil
 90602  	_3_i = _iEq
 90603  _31:
 90604  	if _3_i >= int32(_3_pLoop.XnLTerm) {
 90605  		goto _34
 90606  	}
 90607  	if (*XExpr)((*elem104((**XWhereTerm)(unsafe.Pointer(_3_pLoop.XaLTerm)), uintptr(_3_i))).XpExpr) == _pX {
 90608  		_11_iField = ((*elem104((**XWhereTerm)(unsafe.Pointer(_3_pLoop.XaLTerm)), uintptr(_3_i))).XiField) - int32(1)
 90609  		_11_pNewRhs = _sqlite3ExprDup(tls, _9_db, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_9_pOrigRhs.Xa)), uintptr(_11_iField)).XpExpr), int32(0))
 90610  		_11_pNewLhs = _sqlite3ExprDup(tls, _9_db, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_9_pOrigLhs.Xa)), uintptr(_11_iField)).XpExpr), int32(0))
 90611  		_9_pRhs = _sqlite3ExprListAppend(tls, _pParse, _9_pRhs, _11_pNewRhs)
 90612  		_9_pLhs = _sqlite3ExprListAppend(tls, _pParse, _9_pLhs, _11_pNewLhs)
 90613  	}
 90614  	_3_i += 1
 90615  	goto _31
 90616  _34:
 90617  	if _9_db.XmallocFailed != 0 {
 90618  		goto _36
 90619  	}
 90620  	_12_pLeft = (*XExpr)(_pX.XpLeft)
 90621  	if _9_pSelect.XpOrderBy == nil {
 90622  		goto _37
 90623  	}
 90624  	_13_pOrderBy = (*XExprList)(_9_pSelect.XpOrderBy)
 90625  	_3_i = int32(0)
 90626  _38:
 90627  	if _3_i >= _13_pOrderBy.XnExpr {
 90628  		goto _41
 90629  	}
 90630  	(*t71)(unsafe.Pointer(&(elem57((*TExprList_item)(unsafe.Pointer(&_13_pOrderBy.Xa)), uintptr(_3_i)).Xu))).XiOrderByCol = 0
 90631  	_3_i += 1
 90632  	goto _38
 90633  _41:
 90634  _37:
 90635  	if _9_pLhs.XnExpr == int32(1) {
 90636  		*(**XExpr)(unsafe.Pointer(&_pX.XpLeft)) = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_9_pLhs.Xa)), 0).XpExpr)
 90637  		goto _43
 90638  	}
 90639  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_12_pLeft.Xx)))) = _9_pLhs
 90640  	_3_aiMap = (*int32)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pParse.Xdb), uint64(uint32(4)*uint32(_3_nEq))))
 90641  _43:
 90642  	*(**XExprList)(unsafe.Pointer(&_9_pSelect.XpEList)) = _9_pRhs
 90643  	{
 90644  		p := &_9_db.XdbOptFlags
 90645  		*p = uint16(int32(*p) | int32(1))
 90646  	}
 90647  	_3_eType = _sqlite3FindInIndex(tls, _pParse, _pX, uint32(4), nil, _3_aiMap)
 90648  	_9_db.XdbOptFlags = _9_savedDbOptFlags
 90649  	*(**XExprList)(unsafe.Pointer(&_9_pSelect.XpEList)) = _9_pOrigRhs
 90650  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_12_pLeft.Xx)))) = _9_pOrigLhs
 90651  	*(**XExpr)(unsafe.Pointer(&_pX.XpLeft)) = _12_pLeft
 90652  _36:
 90653  	_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.Xdb), _9_pLhs)
 90654  	_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.Xdb), _9_pRhs)
 90655  _30:
 90656  	if _3_eType == int32(4) {
 90657  		_bRev = bool2int(_bRev == 0)
 90658  	}
 90659  	_3_iTab = _pX.XiTable
 90660  	_sqlite3VdbeAddOp2(tls, _v, func() int32 {
 90661  		if _bRev != 0 {
 90662  			return int32(33)
 90663  		}
 90664  		return int32(37)
 90665  	}(), _3_iTab, int32(0))
 90666  	func() {
 90667  		if (_3_pLoop.XwsFlags & uint32(8192)) != (0) {
 90668  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127304), unsafe.Pointer(&_codeEqualityTermØ00__func__Ø000), unsafe.Pointer(str(109036)))
 90669  			crt.X__builtin_abort(tls)
 90670  		}
 90671  	}()
 90672  	_3_pLoop.XwsFlags |= uint32(2048)
 90673  	if ((*t114)(unsafe.Pointer(&_pLevel.Xu)).XnIn) == int32(0) {
 90674  		_pLevel.XaddrNxt = _sqlite3VdbeMakeLabel(tls, _v)
 90675  	}
 90676  	_3_i = (*t114)(unsafe.Pointer(&_pLevel.Xu)).XnIn
 90677  	(*t114)(unsafe.Pointer(&_pLevel.Xu)).XnIn += _3_nEq
 90678  	*(**TInLoop)(unsafe.Pointer(&((*t114)(unsafe.Pointer(&_pLevel.Xu)).XaInLoop))) = (*TInLoop)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_pParse.Xdb), (*t114)(unsafe.Pointer(&_pLevel.Xu)).XaInLoop, uint64(uint32(12)*uint32((*t114)(unsafe.Pointer(&_pLevel.Xu)).XnIn))))
 90679  	_3_pIn = (*TInLoop)((*t114)(unsafe.Pointer(&_pLevel.Xu)).XaInLoop)
 90680  	if _3_pIn == nil {
 90681  		goto _50
 90682  	}
 90683  	_19_iMap = int32(0)
 90684  	*(*uintptr)(unsafe.Pointer(&_3_pIn)) += 12 * uintptr(_3_i)
 90685  	_3_i = _iEq
 90686  _51:
 90687  	if _3_i >= int32(_3_pLoop.XnLTerm) {
 90688  		goto _54
 90689  	}
 90690  	if (*XExpr)((*elem104((**XWhereTerm)(unsafe.Pointer(_3_pLoop.XaLTerm)), uintptr(_3_i))).XpExpr) != _pX {
 90691  		goto _55
 90692  	}
 90693  	_21_iOut = (_iReg + _3_i) - _iEq
 90694  	if _3_eType == int32(1) {
 90695  		_3_pIn.XaddrInTop = _sqlite3VdbeAddOp2(tls, _v, int32(125), _3_iTab, _21_iOut)
 90696  		goto _57
 90697  	}
 90698  	_23_iCol = func() int32 {
 90699  		if _3_aiMap != nil {
 90700  			return (*elem8(_3_aiMap, uintptr(postInc2(&_19_iMap, 1))))
 90701  		}
 90702  		return int32(0)
 90703  	}()
 90704  	_3_pIn.XaddrInTop = _sqlite3VdbeAddOp3(tls, _v, int32(99), _3_iTab, _23_iCol, _21_iOut)
 90705  _57:
 90706  	_sqlite3VdbeAddOp1(tls, _v, int32(75), _21_iOut)
 90707  	if _3_i == _iEq {
 90708  		_3_pIn.XiCur = _3_iTab
 90709  		_3_pIn.XeEndLoopOp = uint8(func() int32 {
 90710  			if _bRev != 0 {
 90711  				return int32(4)
 90712  			}
 90713  			return int32(5)
 90714  		}())
 90715  		goto _63
 90716  	}
 90717  	_3_pIn.XeEndLoopOp = uint8(164)
 90718  _63:
 90719  	*(*uintptr)(unsafe.Pointer(&_3_pIn)) += uintptr(12)
 90720  _55:
 90721  	_3_i += 1
 90722  	goto _51
 90723  _54:
 90724  	goto _64
 90725  _50:
 90726  	(*t114)(unsafe.Pointer(&_pLevel.Xu)).XnIn = int32(0)
 90727  _64:
 90728  	_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.Xdb), unsafe.Pointer(_3_aiMap))
 90729  _8:
 90730  	_disableTerm(tls, _pLevel, _pTerm)
 90731  	return _iReg
 90732  
 90733  	_ = _19_iMap
 90734  	panic(0)
 90735  }
 90736  
 90737  var _codeEqualityTermØ00__func__Ø000 [17]int8
 90738  
 90739  func init() {
 90740  	crt.Xstrncpy(nil, &_codeEqualityTermØ00__func__Ø000[0], str(109073), 17)
 90741  }
 90742  
 90743  // C comment
 90744  //  /*
 90745  //  ** Disable a term in the WHERE clause.  Except, do not disable the term
 90746  //  ** if it controls a LEFT OUTER JOIN and it did not originate in the ON
 90747  //  ** or USING clause of that join.
 90748  //  **
 90749  //  ** Consider the term t2.z='ok' in the following queries:
 90750  //  **
 90751  //  **   (1)  SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.x WHERE t2.z='ok'
 90752  //  **   (2)  SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.x AND t2.z='ok'
 90753  //  **   (3)  SELECT * FROM t1, t2 WHERE t1.a=t2.x AND t2.z='ok'
 90754  //  **
 90755  //  ** The t2.z='ok' is disabled in the in (2) because it originates
 90756  //  ** in the ON clause.  The term is disabled in (3) because it is not part
 90757  //  ** of a LEFT OUTER JOIN.  In (1), the term is not disabled.
 90758  //  **
 90759  //  ** Disabling a term causes that term to not be tested in the inner loop
 90760  //  ** of the join.  Disabling is an optimization.  When terms are satisfied
 90761  //  ** by indices, we disable them to prevent redundant tests in the inner
 90762  //  ** loop.  We would get the correct results if nothing were ever disabled,
 90763  //  ** but joins might run a little slower.  The trick is to disable as much
 90764  //  ** as we can without disabling too much.  If we disabled in (1), we'd get
 90765  //  ** the wrong answer.  See ticket #813.
 90766  //  **
 90767  //  ** If all the children of a term are disabled, then that term is also
 90768  //  ** automatically disabled.  In this way, terms get disabled if derived
 90769  //  ** virtual terms are tested first.  For example:
 90770  //  **
 90771  //  **      x GLOB 'abc*' AND x>='abc' AND x<'acd'
 90772  //  **      \___________/     \______/     \_____/
 90773  //  **         parent          child1       child2
 90774  //  **
 90775  //  ** Only the parent term was in the original WHERE clause.  The child1
 90776  //  ** and child2 terms were added by the LIKE optimization.  If both of
 90777  //  ** the virtual child terms are valid, then testing of the parent can be
 90778  //  ** skipped.
 90779  //  **
 90780  //  ** Usually the parent term is marked as TERM_CODED.  But if the parent
 90781  //  ** term was originally TERM_LIKE, then the parent gets TERM_LIKECOND instead.
 90782  //  ** The TERM_LIKECOND marking indicates that the term should be coded inside
 90783  //  ** a conditional such that is only evaluated on the second pass of a
 90784  //  ** LIKE-optimization loop, when scanning BLOBs instead of strings.
 90785  //  */
 90786  func _disableTerm(tls *crt.TLS, _pLevel *XWhereLevel, _pTerm *XWhereTerm) {
 90787  	var _nLoop int32
 90788  	_nLoop = int32(0)
 90789  _0:
 90790  	if func() int32 {
 90791  		if _pTerm != nil {
 90792  			return int32(1)
 90793  		}
 90794  		return func() int32 {
 90795  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127088), unsafe.Pointer(&_disableTermØ00__func__Ø000), unsafe.Pointer(str(4809)))
 90796  			crt.X__builtin_abort(tls)
 90797  			return int32(0)
 90798  		}()
 90799  	}() == 0 || (int32(_pTerm.XwtFlags)&int32(4)) != int32(0) || _pLevel.XiLeftJoin != int32(0) && (((*XExpr)(_pTerm.XpExpr).Xflags)&uint32(1)) == (0) || (_pLevel.XnotReady&_pTerm.XprereqAll) != (0) {
 90800  		goto _1
 90801  	}
 90802  	if _nLoop != 0 && ((int32(_pTerm.XwtFlags) & int32(1024)) != int32(0)) {
 90803  		{
 90804  			p := &_pTerm.XwtFlags
 90805  			*p = uint16(int32(*p) | int32(512))
 90806  		}
 90807  		goto _10
 90808  	}
 90809  	{
 90810  		p := &_pTerm.XwtFlags
 90811  		*p = uint16(int32(*p) | int32(4))
 90812  	}
 90813  _10:
 90814  	if _pTerm.XiParent < int32(0) {
 90815  		goto _1
 90816  	}
 90817  	_pTerm = elem100((*XWhereTerm)((*XWhereClause)(_pTerm.XpWC).Xa), uintptr(_pTerm.XiParent))
 90818  	_pTerm.XnChild -= 1
 90819  	if int32(_pTerm.XnChild) != int32(0) {
 90820  		goto _1
 90821  	}
 90822  	_nLoop += 1
 90823  	goto _0
 90824  _1:
 90825  }
 90826  
 90827  var _disableTermØ00__func__Ø000 [12]int8
 90828  
 90829  func init() {
 90830  	crt.Xstrncpy(nil, &_disableTermØ00__func__Ø000[0], str(109090), 12)
 90831  }
 90832  
 90833  // C comment
 90834  //  /*
 90835  //  ** If the expression passed as the second argument is a vector, generate
 90836  //  ** code to write the first nReg elements of the vector into an array
 90837  //  ** of registers starting with iReg.
 90838  //  **
 90839  //  ** If the expression is not a vector, then nReg must be passed 1. In
 90840  //  ** this case, generate code to evaluate the expression and leave the
 90841  //  ** result in register iReg.
 90842  //  */
 90843  func _codeExprOrVector(tls *crt.TLS, _pParse *XParse, _p *XExpr, _iReg int32, _nReg int32) {
 90844  	var _2_iSelect, _3_i int32
 90845  	var _2_v *TVdbe
 90846  	var _3_pList *XExprList
 90847  	func() {
 90848  		if _nReg <= int32(0) {
 90849  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127810), unsafe.Pointer(&_codeExprOrVectorØ00__func__Ø000), unsafe.Pointer(str(109102)))
 90850  			crt.X__builtin_abort(tls)
 90851  		}
 90852  	}()
 90853  	if _sqlite3ExprIsVector(tls, _p) == 0 {
 90854  		goto _2
 90855  	}
 90856  	if (_p.Xflags & uint32(2048)) != 0 {
 90857  		_2_v = (*TVdbe)(_pParse.XpVdbe)
 90858  		_2_iSelect = _sqlite3CodeSubselect(tls, _pParse, _p, int32(0), int32(0))
 90859  		_sqlite3VdbeAddOp3(tls, _2_v, int32(64), _2_iSelect, _iReg, _nReg-int32(1))
 90860  		goto _4
 90861  	}
 90862  	_3_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xx)))
 90863  	func() {
 90864  		if _nReg > _3_pList.XnExpr {
 90865  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127822), unsafe.Pointer(&_codeExprOrVectorØ00__func__Ø000), unsafe.Pointer(str(109109)))
 90866  			crt.X__builtin_abort(tls)
 90867  		}
 90868  	}()
 90869  	_3_i = int32(0)
 90870  _7:
 90871  	if _3_i >= _nReg {
 90872  		goto _10
 90873  	}
 90874  	_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_3_pList.Xa)), uintptr(_3_i)).XpExpr), _iReg+_3_i)
 90875  	_3_i += 1
 90876  	goto _7
 90877  _10:
 90878  _4:
 90879  	goto _11
 90880  _2:
 90881  	func() {
 90882  		if _nReg != int32(1) {
 90883  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127828), unsafe.Pointer(&_codeExprOrVectorØ00__func__Ø000), unsafe.Pointer(str(109128)))
 90884  			crt.X__builtin_abort(tls)
 90885  		}
 90886  	}()
 90887  	_sqlite3ExprCode(tls, _pParse, _p, _iReg)
 90888  _11:
 90889  }
 90890  
 90891  var _codeExprOrVectorØ00__func__Ø000 [17]int8
 90892  
 90893  func init() {
 90894  	crt.Xstrncpy(nil, &_codeExprOrVectorØ00__func__Ø000[0], str(109136), 17)
 90895  }
 90896  
 90897  // C comment
 90898  //  /*
 90899  //  ** Generate code that will evaluate all == and IN constraints for an
 90900  //  ** index scan.
 90901  //  **
 90902  //  ** For example, consider table t1(a,b,c,d,e,f) with index i1(a,b,c).
 90903  //  ** Suppose the WHERE clause is this:  a==5 AND b IN (1,2,3) AND c>5 AND c<10
 90904  //  ** The index has as many as three equality constraints, but in this
 90905  //  ** example, the third "c" value is an inequality.  So only two
 90906  //  ** constraints are coded.  This routine will generate code to evaluate
 90907  //  ** a==5 and b IN (1,2,3).  The current values for a and b will be stored
 90908  //  ** in consecutive registers and the index of the first register is returned.
 90909  //  **
 90910  //  ** In the example above nEq==2.  But this subroutine works for any value
 90911  //  ** of nEq including 0.  If nEq==0, this routine is nearly a no-op.
 90912  //  ** The only thing it does is allocate the pLevel->iMem memory cell and
 90913  //  ** compute the affinity string.
 90914  //  **
 90915  //  ** The nExtraReg parameter is 0 or 1.  It is 0 if all WHERE clause constraints
 90916  //  ** are == or IN and are covered by the nEq.  nExtraReg is 1 if there is
 90917  //  ** an inequality constraint (such as the "c>=5 AND c<10" in the example) that
 90918  //  ** occurs after the nEq quality constraints.
 90919  //  **
 90920  //  ** This routine allocates a range of nEq+nExtraReg memory cells and returns
 90921  //  ** the index of the first memory cell in that range. The code that
 90922  //  ** calls this routine will use that memory range to store keys for
 90923  //  ** start and termination conditions of the loop.
 90924  //  ** key value of the loop.  If one or more IN operators appear, then
 90925  //  ** this routine allocates an additional nEq memory cells for internal
 90926  //  ** use.
 90927  //  **
 90928  //  ** Before returning, *pzAff is set to point to a buffer containing a
 90929  //  ** copy of the column affinity string of the index allocated using
 90930  //  ** sqlite3DbMalloc(). Except, entries in the copy of the string associated
 90931  //  ** with equality constraints that use BLOB or NONE affinity are set to
 90932  //  ** SQLITE_AFF_BLOB. This is to deal with SQL such as the following:
 90933  //  **
 90934  //  **   CREATE TABLE t1(a TEXT PRIMARY KEY, b);
 90935  //  **   SELECT ... FROM t1 AS t2, t1 WHERE t1.a = t2.b;
 90936  //  **
 90937  //  ** In the example above, the index on t1(a) has TEXT affinity. But since
 90938  //  ** the right hand side of the equality constraint (t2.b) has BLOB/NONE affinity,
 90939  //  ** no conversion should be attempted before using a t2.b value as part of
 90940  //  ** a key to search the index. Hence the first byte in the returned affinity
 90941  //  ** string in this example would be set to SQLITE_AFF_BLOB.
 90942  //  */
 90943  func _codeAllEqualityTerms(tls *crt.TLS, _pParse *XParse, _pLevel *XWhereLevel, _bRev int32, _nExtraReg int32, _pzAff **int8) (r0 int32) {
 90944  	var _j, _regBase, _nReg, _1_iIdxCur, _3_r1 int32
 90945  	var _zAff *int8
 90946  	var _nEq, _nSkip uint16
 90947  	var _v *TVdbe
 90948  	var _9_pRight *XExpr
 90949  	var _pIdx *XIndex
 90950  	var _pLoop *XWhereLoop
 90951  	var _pTerm *XWhereTerm
 90952  	_v = (*TVdbe)(_pParse.XpVdbe)
 90953  	_pLoop = (*XWhereLoop)(_pLevel.XpWLoop)
 90954  	func() {
 90955  		if (_pLoop.XwsFlags & uint32(1024)) != (0) {
 90956  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127415), unsafe.Pointer(&_codeAllEqualityTermsØ00__func__Ø000), unsafe.Pointer(str(109153)))
 90957  			crt.X__builtin_abort(tls)
 90958  		}
 90959  	}()
 90960  	_nEq = (*t101)(unsafe.Pointer(&_pLoop.Xu)).XnEq
 90961  	_nSkip = _pLoop.XnSkip
 90962  	_pIdx = (*XIndex)((*t101)(unsafe.Pointer(&_pLoop.Xu)).XpIndex)
 90963  	func() {
 90964  		if _pIdx == nil {
 90965  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127419), unsafe.Pointer(&_codeAllEqualityTermsØ00__func__Ø000), unsafe.Pointer(str(42024)))
 90966  			crt.X__builtin_abort(tls)
 90967  		}
 90968  	}()
 90969  	_regBase = _pParse.XnMem + int32(1)
 90970  	_nReg = int32((*t101)(unsafe.Pointer(&_pLoop.Xu)).XnEq) + _nExtraReg
 90971  	_pParse.XnMem += _nReg
 90972  	_zAff = _sqlite3DbStrDup(tls, (*Xsqlite3)(_pParse.Xdb), _sqlite3IndexAffinityStr(tls, (*Xsqlite3)(_pParse.Xdb), _pIdx))
 90973  	func() {
 90974  		if _zAff == nil && ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == 0 {
 90975  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127428), unsafe.Pointer(&_codeAllEqualityTermsØ00__func__Ø000), unsafe.Pointer(str(109194)))
 90976  			crt.X__builtin_abort(tls)
 90977  		}
 90978  	}()
 90979  	if _nSkip == 0 {
 90980  		goto _7
 90981  	}
 90982  	_1_iIdxCur = _pLevel.XiIdxCur
 90983  	_sqlite3VdbeAddOp1(tls, _v, func() int32 {
 90984  		if _bRev != 0 {
 90985  			return int32(33)
 90986  		}
 90987  		return int32(37)
 90988  	}(), _1_iIdxCur)
 90989  	_sqlite3VdbeComment(tls, _v, str(109230), unsafe.Pointer(_pIdx.XzName))
 90990  	_j = _sqlite3VdbeAddOp0(tls, _v, int32(13))
 90991  	_pLevel.XaddrSkip = _sqlite3VdbeAddOp4Int(tls, _v, func() int32 {
 90992  		if _bRev != 0 {
 90993  			return int32(24)
 90994  		}
 90995  		return int32(27)
 90996  	}(), _1_iIdxCur, int32(0), _regBase, int32(_nSkip))
 90997  	_sqlite3VdbeJumpHere(tls, _v, _j)
 90998  	_j = int32(0)
 90999  _12:
 91000  	if _j >= int32(_nSkip) {
 91001  		goto _15
 91002  	}
 91003  	_sqlite3VdbeAddOp3(tls, _v, int32(99), _1_iIdxCur, _j, _regBase+_j)
 91004  	_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(_explainIndexColumnName(tls, _pIdx, _j)))
 91005  	_j += 1
 91006  	goto _12
 91007  _15:
 91008  _7:
 91009  	func() {
 91010  		if _zAff != nil && int32(crt.Xstrlen(tls, _zAff)) < int32(_nEq) {
 91011  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127451), unsafe.Pointer(&_codeAllEqualityTermsØ00__func__Ø000), unsafe.Pointer(str(109252)))
 91012  			crt.X__builtin_abort(tls)
 91013  		}
 91014  	}()
 91015  	_j = int32(_nSkip)
 91016  _19:
 91017  	if _j >= int32(_nEq) {
 91018  		goto _22
 91019  	}
 91020  	_pTerm = *elem104((**XWhereTerm)(unsafe.Pointer(_pLoop.XaLTerm)), uintptr(_j))
 91021  	func() {
 91022  		if _pTerm == nil {
 91023  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127455), unsafe.Pointer(&_codeAllEqualityTermsØ00__func__Ø000), unsafe.Pointer(str(108079)))
 91024  			crt.X__builtin_abort(tls)
 91025  		}
 91026  	}()
 91027  	_3_r1 = _codeEqualityTerm(tls, _pParse, _pTerm, _pLevel, _j, _bRev, _regBase+_j)
 91028  	if _3_r1 == (_regBase + _j) {
 91029  		goto _25
 91030  	}
 91031  	if _nReg == int32(1) {
 91032  		_sqlite3ReleaseTempReg(tls, _pParse, _regBase)
 91033  		_regBase = _3_r1
 91034  		goto _27
 91035  	}
 91036  	_sqlite3VdbeAddOp2(tls, _v, int32(65), _3_r1, _regBase+_j)
 91037  _27:
 91038  _25:
 91039  	if (int32(_pTerm.XeOperator) & int32(1)) == 0 {
 91040  		goto _28
 91041  	}
 91042  	if (((*XExpr)(_pTerm.XpExpr).Xflags) & uint32(2048)) == 0 {
 91043  		goto _29
 91044  	}
 91045  	if _zAff != nil {
 91046  		*elem1(_zAff, uintptr(_j)) = int8(65)
 91047  	}
 91048  _29:
 91049  	goto _32
 91050  _28:
 91051  	if (int32(_pTerm.XeOperator) & int32(256)) != int32(0) {
 91052  		goto _32
 91053  	}
 91054  	_9_pRight = (*XExpr)((*XExpr)(_pTerm.XpExpr).XpRight)
 91055  	if ((int32(_pTerm.XwtFlags) & int32(2048)) == int32(0)) && _sqlite3ExprCanBeNull(tls, _9_pRight) != 0 {
 91056  		_sqlite3VdbeAddOp2(tls, _v, int32(75), _regBase+_j, _pLevel.XaddrBrk)
 91057  	}
 91058  	if _zAff == nil {
 91059  		goto _35
 91060  	}
 91061  	if int32(_sqlite3CompareAffinity(tls, _9_pRight, *elem1(_zAff, uintptr(_j)))) == int32(65) {
 91062  		*elem1(_zAff, uintptr(_j)) = int8(65)
 91063  	}
 91064  	if _sqlite3ExprNeedsNoAffinityChange(tls, _9_pRight, *elem1(_zAff, uintptr(_j))) != 0 {
 91065  		*elem1(_zAff, uintptr(_j)) = int8(65)
 91066  	}
 91067  _35:
 91068  _32:
 91069  	_j += 1
 91070  	goto _19
 91071  _22:
 91072  	*_pzAff = _zAff
 91073  	return _regBase
 91074  }
 91075  
 91076  var _codeAllEqualityTermsØ00__func__Ø000 [21]int8
 91077  
 91078  func init() {
 91079  	crt.Xstrncpy(nil, &_codeAllEqualityTermsØ00__func__Ø000[0], str(109286), 21)
 91080  }
 91081  
 91082  // C comment
 91083  //  /*
 91084  //  ** Return TRUE if the given expression is a constant which would be
 91085  //  ** unchanged by OP_Affinity with the affinity given in the second
 91086  //  ** argument.
 91087  //  **
 91088  //  ** This routine is used to determine if the OP_Affinity operation
 91089  //  ** can be omitted.  When in doubt return FALSE.  A false negative
 91090  //  ** is harmless.  A false positive, however, can result in the wrong
 91091  //  ** answer.
 91092  //  */
 91093  func _sqlite3ExprNeedsNoAffinityChange(tls *crt.TLS, _p *XExpr, _aff int8) (r0 int32) {
 91094  	var _op uint8
 91095  	if int32(_aff) == int32(65) {
 91096  		return int32(1)
 91097  	}
 91098  _0:
 91099  	if (int32(_p.Xop) == int32(156)) || (int32(_p.Xop) == int32(155)) {
 91100  		_p = (*XExpr)(_p.XpLeft)
 91101  		goto _0
 91102  	}
 91103  	_op = _p.Xop
 91104  	if int32(_op) == int32(157) {
 91105  		_op = _p.Xop2
 91106  	}
 91107  	switch int32(_op) {
 91108  	case int32(97):
 91109  		goto _8
 91110  	case int32(132):
 91111  		goto _7
 91112  	case int32(133):
 91113  		goto _9
 91114  	case int32(134):
 91115  		goto _6
 91116  	case int32(152):
 91117  		goto _10
 91118  	default:
 91119  		goto _11
 91120  	}
 91121  
 91122  _6:
 91123  	return bool2int((int32(_aff) == int32(68)) || (int32(_aff) == int32(67)))
 91124  
 91125  _7:
 91126  	return bool2int((int32(_aff) == int32(69)) || (int32(_aff) == int32(67)))
 91127  
 91128  _8:
 91129  	return bool2int(int32(_aff) == int32(66))
 91130  
 91131  _9:
 91132  	return int32(1)
 91133  
 91134  _10:
 91135  	func() {
 91136  		if _p.XiTable < int32(0) {
 91137  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92905), unsafe.Pointer(&_sqlite3ExprNeedsNoAffinityChangeØ00__func__Ø000), unsafe.Pointer(str(109307)))
 91138  			crt.X__builtin_abort(tls)
 91139  		}
 91140  	}()
 91141  	return bool2int((int32(_p.XiColumn) < int32(0)) && ((int32(_aff) == int32(68)) || (int32(_aff) == int32(67))))
 91142  
 91143  _11:
 91144  	return int32(0)
 91145  }
 91146  
 91147  var _sqlite3ExprNeedsNoAffinityChangeØ00__func__Ø000 [33]int8
 91148  
 91149  func init() {
 91150  	crt.Xstrncpy(nil, &_sqlite3ExprNeedsNoAffinityChangeØ00__func__Ø000[0], str(109320), 33)
 91151  }
 91152  
 91153  // C comment
 91154  //  /*
 91155  //  ** If the most recently coded instruction is a constant range constraint
 91156  //  ** (a string literal) that originated from the LIKE optimization, then
 91157  //  ** set P3 and P5 on the OP_String opcode so that the string will be cast
 91158  //  ** to a BLOB at appropriate times.
 91159  //  **
 91160  //  ** The LIKE optimization trys to evaluate "x LIKE 'abc%'" as a range
 91161  //  ** expression: "x>='ABC' AND x<'abd'".  But this requires that the range
 91162  //  ** scan loop run twice, once for strings and a second time for BLOBs.
 91163  //  ** The OP_String opcodes on the second pass convert the upper and lower
 91164  //  ** bound string constants to blobs.  This routine makes the necessary changes
 91165  //  ** to the OP_String opcodes for that to happen.
 91166  //  **
 91167  //  ** Except, of course, if SQLITE_LIKE_DOESNT_MATCH_BLOBS is defined, then
 91168  //  ** only the one pass through the string space is required, so this routine
 91169  //  ** becomes a no-op.
 91170  //  */
 91171  func _whereLikeOptimizationStringFixup(tls *crt.TLS, _v *TVdbe, _pLevel *XWhereLevel, _pTerm *XWhereTerm) {
 91172  	var _1_pOp *XVdbeOp
 91173  	if (int32(_pTerm.XwtFlags) & int32(256)) != 0 {
 91174  		func() {
 91175  			if _pLevel.XiLikeRepCntr <= (0) {
 91176  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127522), unsafe.Pointer(&_whereLikeOptimizationStringFixupØ00__func__Ø000), unsafe.Pointer(str(109353)))
 91177  				crt.X__builtin_abort(tls)
 91178  			}
 91179  		}()
 91180  		_1_pOp = _sqlite3VdbeGetOp(tls, _v, int32(-1))
 91181  		func() {
 91182  			if _1_pOp == nil {
 91183  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127524), unsafe.Pointer(&_whereLikeOptimizationStringFixupØ00__func__Ø000), unsafe.Pointer(str(109376)))
 91184  				crt.X__builtin_abort(tls)
 91185  			}
 91186  		}()
 91187  		func() {
 91188  			if int32(_1_pOp.Xopcode) != int32(97) && ((*Xsqlite3)((*XParse)((*XWhereInfo)((*XWhereClause)(_pTerm.XpWC).XpWInfo).XpParse).Xdb).XmallocFailed) == 0 {
 91189  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127525), unsafe.Pointer(&_whereLikeOptimizationStringFixupØ00__func__Ø000), unsafe.Pointer(str(109383)))
 91190  				crt.X__builtin_abort(tls)
 91191  			}
 91192  		}()
 91193  		_1_pOp.Xp3 = int32(_pLevel.XiLikeRepCntr >> 1)
 91194  		_1_pOp.Xp5 = uint16(uint8(_pLevel.XiLikeRepCntr & uint32(1)))
 91195  	}
 91196  }
 91197  
 91198  var _whereLikeOptimizationStringFixupØ00__func__Ø000 [33]int8
 91199  
 91200  func init() {
 91201  	crt.Xstrncpy(nil, &_whereLikeOptimizationStringFixupØ00__func__Ø000[0], str(109455), 33)
 91202  }
 91203  
 91204  // C comment
 91205  //  /*
 91206  //  ** Expression pRight, which is the RHS of a comparison operation, is
 91207  //  ** either a vector of n elements or, if n==1, a scalar expression.
 91208  //  ** Before the comparison operation, affinity zAff is to be applied
 91209  //  ** to the pRight values. This function modifies characters within the
 91210  //  ** affinity string to SQLITE_AFF_BLOB if either:
 91211  //  **
 91212  //  **   * the comparison will be performed with no affinity, or
 91213  //  **   * the affinity change in zAff is guaranteed not to change the value.
 91214  //  */
 91215  func _updateRangeAffinityStr(tls *crt.TLS, _pRight *XExpr, _n int32, _zAff *int8) {
 91216  	var _i int32
 91217  	var _1_p *XExpr
 91218  	_i = int32(0)
 91219  _0:
 91220  	if _i >= _n {
 91221  		goto _3
 91222  	}
 91223  	_1_p = _sqlite3VectorFieldSubexpr(tls, _pRight, _i)
 91224  	if (int32(_sqlite3CompareAffinity(tls, _1_p, *elem1(_zAff, uintptr(_i)))) == int32(65)) || _sqlite3ExprNeedsNoAffinityChange(tls, _1_p, *elem1(_zAff, uintptr(_i))) != 0 {
 91225  		*elem1(_zAff, uintptr(_i)) = int8(65)
 91226  	}
 91227  	_i += 1
 91228  	goto _0
 91229  _3:
 91230  }
 91231  
 91232  // C comment
 91233  //  /*
 91234  //  ** Code an OP_Affinity opcode to apply the column affinity string zAff
 91235  //  ** to the n registers starting at base.
 91236  //  **
 91237  //  ** As an optimization, SQLITE_AFF_BLOB entries (which are no-ops) at the
 91238  //  ** beginning and end of zAff are ignored.  If all entries in zAff are
 91239  //  ** SQLITE_AFF_BLOB, then no code gets generated.
 91240  //  **
 91241  //  ** This routine makes its own copy of zAff so that the caller is free
 91242  //  ** to modify zAff after this routine returns.
 91243  //  */
 91244  func _codeApplyAffinity(tls *crt.TLS, _pParse *XParse, _base int32, _n int32, _zAff *int8) {
 91245  	var _v *TVdbe
 91246  	_v = (*TVdbe)(_pParse.XpVdbe)
 91247  	if _zAff == nil {
 91248  		func() {
 91249  			if ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == 0 {
 91250  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127120), unsafe.Pointer(&_codeApplyAffinityØ00__func__Ø000), unsafe.Pointer(str(42441)))
 91251  				crt.X__builtin_abort(tls)
 91252  			}
 91253  		}()
 91254  		return
 91255  	}
 91256  	func() {
 91257  		if _v == nil {
 91258  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127123), unsafe.Pointer(&_codeApplyAffinityØ00__func__Ø000), unsafe.Pointer(str(42019)))
 91259  			crt.X__builtin_abort(tls)
 91260  		}
 91261  	}()
 91262  _5:
 91263  	if (_n > int32(0)) && (int32(*elem1(_zAff, 0)) == int32(65)) {
 91264  		_n -= 1
 91265  		_base += 1
 91266  		*(*uintptr)(unsafe.Pointer(&_zAff)) += uintptr(1)
 91267  		goto _5
 91268  	}
 91269  _6:
 91270  	if (_n > int32(1)) && (int32(*elem1(_zAff, uintptr(_n-int32(1)))) == int32(65)) {
 91271  		_n -= 1
 91272  		goto _6
 91273  	}
 91274  	if _n > int32(0) {
 91275  		_sqlite3VdbeAddOp4(tls, _v, int32(100), _base, _n, int32(0), _zAff, _n)
 91276  		_sqlite3ExprCacheAffinityChange(tls, _pParse, _base, _n)
 91277  	}
 91278  }
 91279  
 91280  var _codeApplyAffinityØ00__func__Ø000 [18]int8
 91281  
 91282  func init() {
 91283  	crt.Xstrncpy(nil, &_codeApplyAffinityØ00__func__Ø000[0], str(109488), 18)
 91284  }
 91285  
 91286  var _sqlite3WhereCodeOneLoopStartØ00aStartOpØ001 [8]uint8
 91287  
 91288  func init() {
 91289  	_sqlite3WhereCodeOneLoopStartØ00aStartOpØ001 = [8]uint8{0, 0, 37, 33, 27, 24, 26, 25}
 91290  }
 91291  
 91292  var _sqlite3WhereCodeOneLoopStartØ00aEndOpØ002 [4]uint8
 91293  
 91294  func init() {
 91295  	_sqlite3WhereCodeOneLoopStartØ00aEndOpØ002 = [4]uint8{41, 39, 38, 40}
 91296  }
 91297  
 91298  // C comment
 91299  //  /*
 91300  //  ** Cursor iCur is open on an intkey b-tree (a table). Register iRowid contains
 91301  //  ** a rowid value just read from cursor iIdxCur, open on index pIdx. This
 91302  //  ** function generates code to do a deferred seek of cursor iCur to the
 91303  //  ** rowid stored in register iRowid.
 91304  //  **
 91305  //  ** Normally, this is just:
 91306  //  **
 91307  //  **   OP_Seek $iCur $iRowid
 91308  //  **
 91309  //  ** However, if the scan currently being coded is a branch of an OR-loop and
 91310  //  ** the statement currently being coded is a SELECT, then P3 of the OP_Seek
 91311  //  ** is set to iIdxCur and P4 is set to point to an array of integers
 91312  //  ** containing one entry for each column of the table cursor iCur is open
 91313  //  ** on. For each table column, if the column is the i'th column of the
 91314  //  ** index, then the corresponding array entry is set to (i+1). If the column
 91315  //  ** does not appear in the index at all, the array entry is set to 0.
 91316  //  */
 91317  func _codeDeferredSeek(tls *crt.TLS, _pWInfo *XWhereInfo, _pIdx *XIndex, _iCur int32, _iIdxCur int32) {
 91318  	var _1_i int32
 91319  	var _1_ai *int32
 91320  	var _1_pTab *XTable
 91321  	var _v *TVdbe
 91322  	var _pParse *XParse
 91323  	_pParse = (*XParse)(_pWInfo.XpParse)
 91324  	_v = (*TVdbe)(_pParse.XpVdbe)
 91325  	func() {
 91326  		if _iIdxCur <= int32(0) {
 91327  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127779), unsafe.Pointer(&_codeDeferredSeekØ00__func__Ø000), unsafe.Pointer(str(109506)))
 91328  			crt.X__builtin_abort(tls)
 91329  		}
 91330  	}()
 91331  	func() {
 91332  		if int32(*elem50(_pIdx.XaiColumn, uintptr(int32(_pIdx.XnColumn)-int32(1)))) != int32(-1) {
 91333  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127780), unsafe.Pointer(&_codeDeferredSeekØ00__func__Ø000), unsafe.Pointer(str(109516)))
 91334  			crt.X__builtin_abort(tls)
 91335  		}
 91336  	}()
 91337  	_sqlite3VdbeAddOp3(tls, _v, int32(130), _iIdxCur, int32(0), _iCur)
 91338  	if (int32(_pWInfo.XwctrlFlags)&int32(32)) == 0 || (func() *XParse {
 91339  		if _pParse.XpToplevel != nil {
 91340  			return (*XParse)(_pParse.XpToplevel)
 91341  		}
 91342  		return _pParse
 91343  	}().XwriteMask) != (0) {
 91344  		goto _7
 91345  	}
 91346  	_1_pTab = (*XTable)(_pIdx.XpTable)
 91347  	_1_ai = (*int32)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pParse.Xdb), uint64(uint32(4)*uint32(int32(_1_pTab.XnCol)+int32(1)))))
 91348  	if _1_ai == nil {
 91349  		goto _8
 91350  	}
 91351  	*elem8(_1_ai, 0) = int32(_1_pTab.XnCol)
 91352  	_1_i = int32(0)
 91353  _9:
 91354  	if _1_i >= (int32(_pIdx.XnColumn) - int32(1)) {
 91355  		goto _12
 91356  	}
 91357  	func() {
 91358  		if int32(*elem50(_pIdx.XaiColumn, uintptr(_1_i))) >= int32(_1_pTab.XnCol) {
 91359  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127792), unsafe.Pointer(&_codeDeferredSeekØ00__func__Ø000), unsafe.Pointer(str(109552)))
 91360  			crt.X__builtin_abort(tls)
 91361  		}
 91362  	}()
 91363  	if int32(*elem50(_pIdx.XaiColumn, uintptr(_1_i))) >= int32(0) {
 91364  		*elem8(_1_ai, uintptr(int32(*elem50(_pIdx.XaiColumn, uintptr(_1_i)))+int32(1))) = _1_i + int32(1)
 91365  	}
 91366  	_1_i += 1
 91367  	goto _9
 91368  _12:
 91369  	_sqlite3VdbeChangeP4(tls, _v, int32(-1), (*int8)(unsafe.Pointer(_1_ai)), int32(-12))
 91370  _8:
 91371  _7:
 91372  }
 91373  
 91374  var _codeDeferredSeekØ00__func__Ø000 [17]int8
 91375  
 91376  func init() {
 91377  	crt.Xstrncpy(nil, &_codeDeferredSeekØ00__func__Ø000[0], str(109581), 17)
 91378  }
 91379  
 91380  // C comment
 91381  //  /*
 91382  //  ** For an indexes on expression X, locate every instance of expression X in pExpr
 91383  //  ** and change that subexpression into a reference to the appropriate column of
 91384  //  ** the index.
 91385  //  */
 91386  func _whereIndexExprTrans(tls *crt.TLS, _pIdx *XIndex, _iTabCur int32, _iIdxCur int32, _pWInfo *XWhereInfo) {
 91387  	var _iIdxCol int32
 91388  	var _aColExpr *XExprList
 91389  	var _w XWalker
 91390  	var _x XIdxExprTrans
 91391  	_aColExpr = (*XExprList)(_pIdx.XaColExpr)
 91392  	if _aColExpr == nil {
 91393  		return
 91394  	}
 91395  	crt.Xmemset(tls, unsafe.Pointer(&_w), int32(0), uint32(28))
 91396  	*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_w.XxExprCallback)) = _whereIndexExprTransNode
 91397  	*(**XIdxExprTrans)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_w.Xu)))) = &_x
 91398  	_x.XiTabCur = _iTabCur
 91399  	_x.XiIdxCur = _iIdxCur
 91400  	_iIdxCol = int32(0)
 91401  _1:
 91402  	if _iIdxCol >= _aColExpr.XnExpr {
 91403  		goto _4
 91404  	}
 91405  	if int32(*elem50(_pIdx.XaiColumn, uintptr(_iIdxCol))) != int32(-2) {
 91406  		goto _2
 91407  	}
 91408  	func() {
 91409  		if (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_aColExpr.Xa)), uintptr(_iIdxCol)).XpExpr) == nil {
 91410  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(127887), unsafe.Pointer(&_whereIndexExprTransØ00__func__Ø000), unsafe.Pointer(str(109598)))
 91411  			crt.X__builtin_abort(tls)
 91412  		}
 91413  	}()
 91414  	_x.XiIdxCol = _iIdxCol
 91415  	*(**XExpr)(unsafe.Pointer(&_x.XpIdxExpr)) = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_aColExpr.Xa)), uintptr(_iIdxCol)).XpExpr)
 91416  	_sqlite3WalkExpr(tls, &_w, (*XExpr)(_pWInfo.XpWhere))
 91417  	_sqlite3WalkExprList(tls, &_w, (*XExprList)(_pWInfo.XpOrderBy))
 91418  	_sqlite3WalkExprList(tls, &_w, (*XExprList)(_pWInfo.XpResultSet))
 91419  _2:
 91420  	_iIdxCol += 1
 91421  	goto _1
 91422  _4:
 91423  }
 91424  
 91425  // C comment
 91426  //  /* The walker node callback used to transform matching expressions into
 91427  //  ** a reference to an index column for an index on an expression.
 91428  //  **
 91429  //  ** If pExpr matches, then transform it into a reference to the index column
 91430  //  ** that contains the value of pExpr.
 91431  //  */
 91432  func _whereIndexExprTransNode(tls *crt.TLS, _p *XWalker, _pExpr *XExpr) (r0 int32) {
 91433  	var _pX *XIdxExprTrans
 91434  	_pX = (*XIdxExprTrans)(*(*unsafe.Pointer)(unsafe.Pointer(&_p.Xu)))
 91435  	if _sqlite3ExprCompare(tls, _pExpr, (*XExpr)(_pX.XpIdxExpr), _pX.XiTabCur) == int32(0) {
 91436  		_pExpr.Xop = uint8(152)
 91437  		_pExpr.XiTable = _pX.XiIdxCur
 91438  		_pExpr.XiColumn = int16(_pX.XiIdxCol)
 91439  		*(**XTable)(unsafe.Pointer(&_pExpr.XpTab)) = nil
 91440  		return int32(1)
 91441  	}
 91442  	return int32(0)
 91443  }
 91444  
 91445  var _whereIndexExprTransØ00__func__Ø000 [20]int8
 91446  
 91447  func init() {
 91448  	crt.Xstrncpy(nil, &_whereIndexExprTransØ00__func__Ø000[0], str(109628), 20)
 91449  }
 91450  
 91451  func _sqlite3ExprCodeGetColumnToReg(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _iColumn int32, _iTable int32, _iReg int32) {
 91452  	var _r1 int32
 91453  	_r1 = _sqlite3ExprCodeGetColumn(tls, _pParse, _pTab, _iColumn, _iTable, _iReg, 0)
 91454  	if _r1 != _iReg {
 91455  		_sqlite3VdbeAddOp2(tls, (*TVdbe)(_pParse.XpVdbe), int32(65), _r1, _iReg)
 91456  	}
 91457  }
 91458  
 91459  // C comment
 91460  //  /*
 91461  //  ** Generate the end of the WHERE loop.  See comments on
 91462  //  ** sqlite3WhereBegin() for additional information.
 91463  //  */
 91464  func _sqlite3WhereEnd(tls *crt.TLS, _pWInfo *XWhereInfo) {
 91465  	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
 91466  	var _db *Xsqlite3
 91467  	var _16_pTab *XTable
 91468  	var _v *TVdbe
 91469  	var _pTabList *XSrcList
 91470  	var _16_pTabItem *TSrcList_item
 91471  	var _pParse *XParse
 91472  	var _2_pIdx, _16_pIdx, _23_pPk *XIndex
 91473  	var _16_pOp *XVdbeOp
 91474  	var _pLoop *XWhereLoop
 91475  	var _pLevel *XWhereLevel
 91476  	var _6_pIn *TInLoop
 91477  	_pParse = (*XParse)(_pWInfo.XpParse)
 91478  	_v = (*TVdbe)(_pParse.XpVdbe)
 91479  	_pTabList = (*XSrcList)(_pWInfo.XpTabList)
 91480  	_db = (*Xsqlite3)(_pParse.Xdb)
 91481  	_sqlite3ExprCacheClear(tls, _pParse)
 91482  	_i = int32(_pWInfo.XnLevel) - int32(1)
 91483  _0:
 91484  	if _i < int32(0) {
 91485  		goto _3
 91486  	}
 91487  	_pLevel = elem99((*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa)), uintptr(_i))
 91488  	_pLoop = (*XWhereLoop)(_pLevel.XpWLoop)
 91489  	if int32(_pLevel.Xop) == int32(164) {
 91490  		goto _4
 91491  	}
 91492  	_2_addrSeek = int32(0)
 91493  	if int32(_pWInfo.XeDistinct) != int32(2) || (_pLoop.XwsFlags&uint32(512)) == (0) || ((uint32((store113(&_2_pIdx, (*XIndex)((*t101)(unsafe.Pointer(&_pLoop.Xu)).XpIndex)).XidxType)>>7)<<31)>>31) == 0 || store2(&_2_n, int32((*t101)(unsafe.Pointer(&_pLoop.Xu)).XnIdxCol)) <= int32(0) || int32(*elem50(_2_pIdx.XaiRowLogEst, uintptr(_2_n))) < int32(36) {
 91494  		goto _9
 91495  	}
 91496  	_3_r1 = _pParse.XnMem + int32(1)
 91497  	_3_j = int32(0)
 91498  _10:
 91499  	if _3_j >= _2_n {
 91500  		goto _13
 91501  	}
 91502  	_sqlite3VdbeAddOp3(tls, _v, int32(99), _pLevel.XiIdxCur, _3_j, _3_r1+_3_j)
 91503  	_3_j += 1
 91504  	goto _10
 91505  _13:
 91506  	_pParse.XnMem += _2_n + int32(1)
 91507  	_3_op = func() int32 {
 91508  		if int32(_pLevel.Xop) == int32(6) {
 91509  			return int32(24)
 91510  		}
 91511  		return int32(27)
 91512  	}()
 91513  	_2_addrSeek = _sqlite3VdbeAddOp4Int(tls, _v, _3_op, _pLevel.XiIdxCur, int32(0), _3_r1, _2_n)
 91514  	_sqlite3VdbeAddOp2(tls, _v, int32(13), int32(1), _pLevel.Xp2)
 91515  _9:
 91516  	_sqlite3VdbeResolveLabel(tls, _v, _pLevel.XaddrCont)
 91517  	_sqlite3VdbeAddOp3(tls, _v, int32(_pLevel.Xop), _pLevel.Xp1, _pLevel.Xp2, int32(_pLevel.Xp3))
 91518  	_sqlite3VdbeChangeP5(tls, _v, uint16(_pLevel.Xp5))
 91519  	if _2_addrSeek != 0 {
 91520  		_sqlite3VdbeJumpHere(tls, _v, _2_addrSeek)
 91521  	}
 91522  	goto _17
 91523  _4:
 91524  	_sqlite3VdbeResolveLabel(tls, _v, _pLevel.XaddrCont)
 91525  _17:
 91526  	if (_pLoop.XwsFlags&uint32(2048)) == 0 || ((*t114)(unsafe.Pointer(&_pLevel.Xu)).XnIn) <= int32(0) {
 91527  		goto _19
 91528  	}
 91529  	_sqlite3VdbeResolveLabel(tls, _v, _pLevel.XaddrNxt)
 91530  	*func() **TInLoop { _6_j = (*t114)(unsafe.Pointer(&_pLevel.Xu)).XnIn; return &_6_pIn }() = elem115((*TInLoop)((*t114)(unsafe.Pointer(&_pLevel.Xu)).XaInLoop), uintptr(_6_j-int32(1)))
 91531  _20:
 91532  	if _6_j <= int32(0) {
 91533  		goto _23
 91534  	}
 91535  	_sqlite3VdbeJumpHere(tls, _v, _6_pIn.XaddrInTop+int32(1))
 91536  	if int32(_6_pIn.XeEndLoopOp) != int32(164) {
 91537  		_sqlite3VdbeAddOp2(tls, _v, int32(_6_pIn.XeEndLoopOp), _6_pIn.XiCur, _6_pIn.XaddrInTop)
 91538  	}
 91539  	_sqlite3VdbeJumpHere(tls, _v, _6_pIn.XaddrInTop-int32(1))
 91540  	*(*uintptr)(unsafe.Pointer(func() **TInLoop { _6_j -= 1; return &_6_pIn }())) += uintptr(4294967284)
 91541  	goto _20
 91542  _23:
 91543  _19:
 91544  	_sqlite3VdbeResolveLabel(tls, _v, _pLevel.XaddrBrk)
 91545  	if _pLevel.XaddrSkip != 0 {
 91546  		_sqlite3VdbeGoto(tls, _v, _pLevel.XaddrSkip)
 91547  		_sqlite3VdbeComment(tls, _v, str(109648), unsafe.Pointer((*XIndex)((*t101)(unsafe.Pointer(&_pLoop.Xu)).XpIndex).XzName))
 91548  		_sqlite3VdbeJumpHere(tls, _v, _pLevel.XaddrSkip)
 91549  		_sqlite3VdbeJumpHere(tls, _v, _pLevel.XaddrSkip-int32(2))
 91550  	}
 91551  	if _pLevel.XaddrLikeRep != 0 {
 91552  		_sqlite3VdbeAddOp2(tls, _v, int32(48), int32(_pLevel.XiLikeRepCntr>>1), _pLevel.XaddrLikeRep)
 91553  	}
 91554  	if _pLevel.XiLeftJoin == 0 {
 91555  		goto _27
 91556  	}
 91557  	_11_ws = int32(_pLoop.XwsFlags)
 91558  	_1_addr = _sqlite3VdbeAddOp1(tls, _v, int32(46), _pLevel.XiLeftJoin)
 91559  	func() {
 91560  		if (_11_ws&int32(64)) != int32(0) && (_11_ws&int32(512)) == int32(0) {
 91561  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135312), unsafe.Pointer(&_sqlite3WhereEndØ00__func__Ø000), unsafe.Pointer(str(109669)))
 91562  			crt.X__builtin_abort(tls)
 91563  		}
 91564  	}()
 91565  	if (_11_ws & int32(64)) == int32(0) {
 91566  		_sqlite3VdbeAddOp1(tls, _v, int32(126), elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_i)).XiCursor)
 91567  	}
 91568  	if (_11_ws&int32(512)) != 0 || ((_11_ws&int32(8192)) != 0 && ((*(*unsafe.Pointer)(unsafe.Pointer(&_pLevel.Xu))) != nil)) {
 91569  		_sqlite3VdbeAddOp1(tls, _v, int32(126), _pLevel.XiIdxCur)
 91570  	}
 91571  	if int32(_pLevel.Xop) == int32(52) {
 91572  		_sqlite3VdbeAddOp2(tls, _v, int32(14), _pLevel.Xp1, _pLevel.XaddrFirst)
 91573  		goto _36
 91574  	}
 91575  	_sqlite3VdbeGoto(tls, _v, _pLevel.XaddrFirst)
 91576  _36:
 91577  	_sqlite3VdbeJumpHere(tls, _v, _1_addr)
 91578  _27:
 91579  	_i -= 1
 91580  	goto _0
 91581  _3:
 91582  	_sqlite3VdbeResolveLabel(tls, _v, _pWInfo.XiBreak)
 91583  	func() {
 91584  		if int32(_pWInfo.XnLevel) > _pTabList.XnSrc {
 91585  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135337), unsafe.Pointer(&_sqlite3WhereEndØ00__func__Ø000), unsafe.Pointer(str(109721)))
 91586  			crt.X__builtin_abort(tls)
 91587  		}
 91588  	}()
 91589  	*func() **XWhereLevel { _i = int32(0); return &_pLevel }() = (*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa))
 91590  _39:
 91591  	if _i >= int32(_pWInfo.XnLevel) {
 91592  		goto _42
 91593  	}
 91594  	_16_pIdx = nil
 91595  	_16_pTabItem = elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), uintptr(_pLevel.XiFrom))
 91596  	_16_pTab = (*XTable)(_16_pTabItem.XpTab)
 91597  	func() {
 91598  		if _16_pTab == nil {
 91599  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135344), unsafe.Pointer(&_sqlite3WhereEndØ00__func__Ø000), unsafe.Pointer(str(43549)))
 91600  			crt.X__builtin_abort(tls)
 91601  		}
 91602  	}()
 91603  	_pLoop = (*XWhereLoop)(_pLevel.XpWLoop)
 91604  	if ((uint32((_16_pTabItem.Xfg.XnotIndexed)>>4) << 31) >> 31) != 0 {
 91605  		_translateColumnToCopy(tls, _pParse, _pLevel.XaddrBody, _pLevel.XiTabCur, _16_pTabItem.XregResult, int32(0))
 91606  		goto _40
 91607  	}
 91608  	if (_pLoop.XwsFlags & uint32(576)) != 0 {
 91609  		_16_pIdx = (*XIndex)((*t101)(unsafe.Pointer(&_pLoop.Xu)).XpIndex)
 91610  		goto _48
 91611  	}
 91612  	if (_pLoop.XwsFlags & uint32(8192)) != 0 {
 91613  		_16_pIdx = (*XIndex)(*(*unsafe.Pointer)(unsafe.Pointer(&_pLevel.Xu)))
 91614  	}
 91615  _48:
 91616  	if _16_pIdx == nil || int32(_pWInfo.XeOnePass) != int32(0) && (((*XTable)(_16_pIdx.XpTable).XtabFlags)&uint32(32)) == (0) || _db.XmallocFailed != 0 {
 91617  		goto _52
 91618  	}
 91619  	_16_last = _sqlite3VdbeCurrentAddr(tls, _v)
 91620  	_16_k = _pLevel.XaddrBody
 91621  	_16_pOp = _sqlite3VdbeGetOp(tls, _v, _16_k)
 91622  _53:
 91623  	if _16_k >= _16_last {
 91624  		goto _56
 91625  	}
 91626  	if _16_pOp.Xp1 != _pLevel.XiTabCur {
 91627  		goto _54
 91628  	}
 91629  	if int32(_16_pOp.Xopcode) != int32(99) {
 91630  		goto _58
 91631  	}
 91632  	_22_x = _16_pOp.Xp2
 91633  	func() {
 91634  		if (*XTable)(_16_pIdx.XpTable) != _16_pTab {
 91635  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135385), unsafe.Pointer(&_sqlite3WhereEndØ00__func__Ø000), unsafe.Pointer(str(109752)))
 91636  			crt.X__builtin_abort(tls)
 91637  		}
 91638  	}()
 91639  	if (_16_pTab.XtabFlags & uint32(32)) != (0) {
 91640  		_23_pPk = _sqlite3PrimaryKeyIndex(tls, _16_pTab)
 91641  		_22_x = int32(*elem50(_23_pPk.XaiColumn, uintptr(_22_x)))
 91642  		func() {
 91643  			if _22_x < int32(0) {
 91644  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135389), unsafe.Pointer(&_sqlite3WhereEndØ00__func__Ø000), unsafe.Pointer(str(109771)))
 91645  				crt.X__builtin_abort(tls)
 91646  			}
 91647  		}()
 91648  	}
 91649  	_22_x = int32(_sqlite3ColumnOfIndex(tls, _16_pIdx, int16(_22_x)))
 91650  	if _22_x >= int32(0) {
 91651  		_16_pOp.Xp2 = _22_x
 91652  		_16_pOp.Xp1 = _pLevel.XiIdxCur
 91653  	}
 91654  	func() {
 91655  		if (_pLoop.XwsFlags&uint32(64)) != (0) && _22_x < int32(0) && _pWInfo.XeOnePass == 0 {
 91656  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(135396), unsafe.Pointer(&_sqlite3WhereEndØ00__func__Ø000), unsafe.Pointer(str(109776)))
 91657  			crt.X__builtin_abort(tls)
 91658  		}
 91659  	}()
 91660  	goto _72
 91661  _58:
 91662  	if int32(_16_pOp.Xopcode) == int32(125) {
 91663  		_16_pOp.Xp1 = _pLevel.XiIdxCur
 91664  		_16_pOp.Xopcode = uint8(131)
 91665  		goto _72
 91666  	}
 91667  	if int32(_16_pOp.Xopcode) == int32(23) {
 91668  		_16_pOp.Xp1 = _pLevel.XiIdxCur
 91669  	}
 91670  _72:
 91671  _54:
 91672  	*(*uintptr)(unsafe.Pointer(func() **XVdbeOp { _16_k += 1; return &_16_pOp }())) += uintptr(24)
 91673  	goto _53
 91674  _56:
 91675  _52:
 91676  _40:
 91677  	*(*uintptr)(unsafe.Pointer(func() **XWhereLevel { _i += 1; return &_pLevel }())) += uintptr(76)
 91678  	goto _39
 91679  _42:
 91680  	_pParse.XnQueryLoop = uint32(_pWInfo.XsavedNQueryLoop)
 91681  	_whereInfoFree(tls, _db, _pWInfo)
 91682  }
 91683  
 91684  var _sqlite3WhereEndØ00__func__Ø000 [16]int8
 91685  
 91686  func init() {
 91687  	crt.Xstrncpy(nil, &_sqlite3WhereEndØ00__func__Ø000[0], str(109841), 16)
 91688  }
 91689  
 91690  // C comment
 91691  //  /*
 91692  //  ** Free a WhereInfo structure
 91693  //  */
 91694  func _whereInfoFree(tls *crt.TLS, _db *Xsqlite3, _pWInfo *XWhereInfo) {
 91695  	var _1_i int32
 91696  	var _4_p *XWhereLoop
 91697  	var _2_pLevel *XWhereLevel
 91698  	if func() int32 {
 91699  		if _pWInfo != nil {
 91700  			return int32(1)
 91701  		}
 91702  		return func() int32 {
 91703  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(132240), unsafe.Pointer(&_whereInfoFreeØ00__func__Ø000), unsafe.Pointer(str(4809)))
 91704  			crt.X__builtin_abort(tls)
 91705  			return int32(0)
 91706  		}()
 91707  	}() == 0 {
 91708  		goto _2
 91709  	}
 91710  	_1_i = int32(0)
 91711  _3:
 91712  	if _1_i >= int32(_pWInfo.XnLevel) {
 91713  		goto _6
 91714  	}
 91715  	_2_pLevel = elem99((*XWhereLevel)(unsafe.Pointer(&_pWInfo.Xa)), uintptr(_1_i))
 91716  	if (_2_pLevel.XpWLoop != nil) && ((((*XWhereLoop)(_2_pLevel.XpWLoop).XwsFlags) & uint32(2048)) != 0) {
 91717  		_sqlite3DbFree(tls, _db, (*t114)(unsafe.Pointer(&_2_pLevel.Xu)).XaInLoop)
 91718  	}
 91719  	_1_i += 1
 91720  	goto _3
 91721  _6:
 91722  	_sqlite3WhereClauseClear(tls, &_pWInfo.XsWC)
 91723  _9:
 91724  	if _pWInfo.XpLoops != nil {
 91725  		_4_p = (*XWhereLoop)(_pWInfo.XpLoops)
 91726  		*(**XWhereLoop)(unsafe.Pointer(&_pWInfo.XpLoops)) = (*XWhereLoop)(_4_p.XpNextLoop)
 91727  		_whereLoopDelete(tls, _db, _4_p)
 91728  		goto _9
 91729  	}
 91730  	_sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_pWInfo))
 91731  _2:
 91732  }
 91733  
 91734  var _whereInfoFreeØ00__func__Ø000 [14]int8
 91735  
 91736  func init() {
 91737  	crt.Xstrncpy(nil, &_whereInfoFreeØ00__func__Ø000[0], str(109857), 14)
 91738  }
 91739  
 91740  // C comment
 91741  //  /*
 91742  //  ** Deallocate a WhereClause structure.  The WhereClause structure
 91743  //  ** itself is not freed.  This routine is the inverse of
 91744  //  ** sqlite3WhereClauseInit().
 91745  //  */
 91746  func _sqlite3WhereClauseClear(tls *crt.TLS, _pWC *XWhereClause) {
 91747  	var _i int32
 91748  	var _db *Xsqlite3
 91749  	var _a *XWhereTerm
 91750  	_db = (*Xsqlite3)((*XParse)((*XWhereInfo)(_pWC.XpWInfo).XpParse).Xdb)
 91751  	*func() **XWhereTerm { _i = _pWC.XnTerm - int32(1); return &_a }() = (*XWhereTerm)(_pWC.Xa)
 91752  _0:
 91753  	if _i < int32(0) {
 91754  		goto _3
 91755  	}
 91756  	if (int32(_a.XwtFlags) & int32(1)) != 0 {
 91757  		_sqlite3ExprDelete(tls, _db, (*XExpr)(_a.XpExpr))
 91758  	}
 91759  	if (int32(_a.XwtFlags) & int32(16)) != 0 {
 91760  		_whereOrInfoDelete(tls, _db, (*XWhereOrInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_a.Xu))))
 91761  		goto _7
 91762  	}
 91763  	if (int32(_a.XwtFlags) & int32(32)) != 0 {
 91764  		_whereAndInfoDelete(tls, _db, (*XWhereAndInfo)(*(*unsafe.Pointer)(unsafe.Pointer(&_a.Xu))))
 91765  	}
 91766  _7:
 91767  	*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i -= 1; return &_a }())) += uintptr(48)
 91768  	goto _0
 91769  _3:
 91770  	if (*XWhereTerm)(_pWC.Xa) != (*XWhereTerm)(unsafe.Pointer(&_pWC.XaStatic)) {
 91771  		_sqlite3DbFree(tls, _db, _pWC.Xa)
 91772  	}
 91773  }
 91774  
 91775  // C comment
 91776  //  /*
 91777  //  ** Deallocate all memory associated with a WhereOrInfo object.
 91778  //  */
 91779  func _whereOrInfoDelete(tls *crt.TLS, _db *Xsqlite3, _p *XWhereOrInfo) {
 91780  	_sqlite3WhereClauseClear(tls, &_p.Xwc)
 91781  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_p))
 91782  }
 91783  
 91784  // C comment
 91785  //  /*
 91786  //  ** Deallocate all memory associated with a WhereAndInfo object.
 91787  //  */
 91788  func _whereAndInfoDelete(tls *crt.TLS, _db *Xsqlite3, _p *XWhereAndInfo) {
 91789  	_sqlite3WhereClauseClear(tls, &_p.Xwc)
 91790  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_p))
 91791  }
 91792  
 91793  var _sqlite3WhereCodeOneLoopStartØ00aStepØ003 [2]uint8
 91794  
 91795  func init() {
 91796  	_sqlite3WhereCodeOneLoopStartØ00aStepØ003 = [2]uint8{7, 6}
 91797  }
 91798  
 91799  var _sqlite3WhereCodeOneLoopStartØ00aStartØ004 [2]uint8
 91800  
 91801  func init() {
 91802  	_sqlite3WhereCodeOneLoopStartØ00aStartØ004 = [2]uint8{37, 33}
 91803  }
 91804  
 91805  // C comment
 91806  //  /*
 91807  //  ** Return the estimated number of output rows from a WHERE clause
 91808  //  */
 91809  func _sqlite3WhereOutputRowCount(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int16) {
 91810  	return _pWInfo.XnRowOut
 91811  }
 91812  
 91813  // C comment
 91814  //  /*
 91815  //  ** Return one of the WHERE_DISTINCT_xxxxx values to indicate how this
 91816  //  ** WHERE clause returns outputs for DISTINCT processing.
 91817  //  */
 91818  func _sqlite3WhereIsDistinct(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int32) {
 91819  	return int32(_pWInfo.XeDistinct)
 91820  }
 91821  
 91822  // C comment
 91823  //  /*
 91824  //  ** Return TRUE if the WHERE clause returns rows in ORDER BY order.
 91825  //  ** Return FALSE if the output needs to be sorted.
 91826  //  */
 91827  func _sqlite3WhereIsOrdered(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int32) {
 91828  	return int32(_pWInfo.XnOBSat)
 91829  }
 91830  
 91831  // C comment
 91832  //  /*
 91833  //  ** Return TRUE if the innermost loop of the WHERE clause implementation
 91834  //  ** returns rows in ORDER BY order for complete run of the inner loop.
 91835  //  **
 91836  //  ** Across multiple iterations of outer loops, the output rows need not be
 91837  //  ** sorted.  As long as rows are sorted for just the innermost loop, this
 91838  //  ** routine can return TRUE.
 91839  //  */
 91840  func _sqlite3WhereOrderedInnerLoop(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int32) {
 91841  	return int32(_pWInfo.XbOrderedInnerLoop)
 91842  }
 91843  
 91844  // C comment
 91845  //  /*
 91846  //  ** Return the VDBE address or label to jump to in order to continue
 91847  //  ** immediately with the next row of a WHERE clause.
 91848  //  */
 91849  func _sqlite3WhereContinueLabel(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int32) {
 91850  	func() {
 91851  		if _pWInfo.XiContinue == int32(0) {
 91852  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(130460), unsafe.Pointer(&_sqlite3WhereContinueLabelØ00__func__Ø000), unsafe.Pointer(str(109871)))
 91853  			crt.X__builtin_abort(tls)
 91854  		}
 91855  	}()
 91856  	return _pWInfo.XiContinue
 91857  }
 91858  
 91859  var _sqlite3WhereContinueLabelØ00__func__Ø000 [26]int8
 91860  
 91861  func init() {
 91862  	crt.Xstrncpy(nil, &_sqlite3WhereContinueLabelØ00__func__Ø000[0], str(109892), 26)
 91863  }
 91864  
 91865  // C comment
 91866  //  /*
 91867  //  ** Return the VDBE address or label to jump to in order to break
 91868  //  ** out of a WHERE loop.
 91869  //  */
 91870  func _sqlite3WhereBreakLabel(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int32) {
 91871  	return _pWInfo.XiBreak
 91872  }
 91873  
 91874  // C comment
 91875  //  /*
 91876  //  ** Call sqlite3ExprAnalyzeAggregates() for every expression in an
 91877  //  ** expression list.  Return the number of errors.
 91878  //  **
 91879  //  ** If an error is found, the analysis is cut short.
 91880  //  */
 91881  func _sqlite3ExprAnalyzeAggList(tls *crt.TLS, _pNC *XNameContext, _pList *XExprList) {
 91882  	var _i int32
 91883  	var _pItem *TExprList_item
 91884  	if _pList == nil {
 91885  		goto _0
 91886  	}
 91887  	*func() *int32 { _pItem = (*TExprList_item)(unsafe.Pointer(&_pList.Xa)); return &_i }() = int32(0)
 91888  _1:
 91889  	if _i >= _pList.XnExpr {
 91890  		goto _4
 91891  	}
 91892  	_sqlite3ExprAnalyzeAggregates(tls, _pNC, (*XExpr)(_pItem.XpExpr))
 91893  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pItem }())) += uintptr(20)
 91894  	goto _1
 91895  _4:
 91896  _0:
 91897  }
 91898  
 91899  // C comment
 91900  //  /*
 91901  //  ** Analyze the pExpr expression looking for aggregate functions and
 91902  //  ** for variables that need to be added to AggInfo object that pNC->pAggInfo
 91903  //  ** points to.  Additional entries are made on the AggInfo object as
 91904  //  ** necessary.
 91905  //  **
 91906  //  ** This routine should only be called after the expression has been
 91907  //  ** analyzed by sqlite3ResolveExprNames().
 91908  //  */
 91909  func _sqlite3ExprAnalyzeAggregates(tls *crt.TLS, _pNC *XNameContext, _pExpr *XExpr) {
 91910  	var _w XWalker
 91911  	crt.Xmemset(tls, unsafe.Pointer(&_w), int32(0), uint32(28))
 91912  	*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_w.XxExprCallback)) = _analyzeAggregate
 91913  	*(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer(&_w.XxSelectCallback)) = _analyzeAggregatesInSelect
 91914  	*(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_w.Xu)))) = _pNC
 91915  	func() {
 91916  		if (*XSrcList)(_pNC.XpSrcList) == nil {
 91917  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95995), unsafe.Pointer(&_sqlite3ExprAnalyzeAggregatesØ00__func__Ø000), unsafe.Pointer(str(94487)))
 91918  			crt.X__builtin_abort(tls)
 91919  		}
 91920  	}()
 91921  	_sqlite3WalkExpr(tls, &_w, _pExpr)
 91922  }
 91923  
 91924  // C comment
 91925  //  /*
 91926  //  ** This is the xExprCallback for a tree walker.  It is used to
 91927  //  ** implement sqlite3ExprAnalyzeAggregates().  See sqlite3ExprAnalyzeAggregates
 91928  //  ** for additional information.
 91929  //  */
 91930  func _analyzeAggregate(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
 91931  	var _i, _5_k, _9_j, _9_n int32
 91932  	var _17_enc uint8
 91933  	var _pSrcList *XSrcList
 91934  	var _3_pItem *TSrcList_item
 91935  	var _9_pGB *XExprList
 91936  	var _9_pTerm *TExprList_item
 91937  	var _10_pE *XExpr
 91938  	var _pParse *XParse
 91939  	var _pNC *XNameContext
 91940  	var _pAggInfo *XAggInfo
 91941  	var _4_pCol *TAggInfo_col
 91942  	var _14_pItem *TAggInfo_func
 91943  	_pNC = (*XNameContext)(*(*unsafe.Pointer)(unsafe.Pointer(&_pWalker.Xu)))
 91944  	_pParse = (*XParse)(_pNC.XpParse)
 91945  	_pSrcList = (*XSrcList)(_pNC.XpSrcList)
 91946  	_pAggInfo = (*XAggInfo)(_pNC.XpAggInfo)
 91947  	switch int32(_pExpr.Xop) {
 91948  	case int32(152):
 91949  		goto _1
 91950  	case int32(153):
 91951  		goto _3
 91952  	case int32(154):
 91953  		goto _1
 91954  	default:
 91955  		goto _4
 91956  	}
 91957  
 91958  _1:
 91959  	if func() int32 {
 91960  		if _pSrcList != nil {
 91961  			return int32(1)
 91962  		}
 91963  		return func() int32 {
 91964  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95863), unsafe.Pointer(&_analyzeAggregateØ00__func__Ø000), unsafe.Pointer(str(4809)))
 91965  			crt.X__builtin_abort(tls)
 91966  			return int32(0)
 91967  		}()
 91968  	}() == 0 {
 91969  		goto _7
 91970  	}
 91971  	_3_pItem = (*TSrcList_item)(unsafe.Pointer(&_pSrcList.Xa))
 91972  	_i = int32(0)
 91973  _8:
 91974  	if _i >= _pSrcList.XnSrc {
 91975  		goto _11
 91976  	}
 91977  	func() {
 91978  		if (_pExpr.Xflags & uint32(24576)) != (0) {
 91979  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95867), unsafe.Pointer(&_analyzeAggregateØ00__func__Ø000), unsafe.Pointer(str(96033)))
 91980  			crt.X__builtin_abort(tls)
 91981  		}
 91982  	}()
 91983  	if _pExpr.XiTable != _3_pItem.XiCursor {
 91984  		goto _14
 91985  	}
 91986  	_4_pCol = (*TAggInfo_col)(_pAggInfo.XaCol)
 91987  	_5_k = int32(0)
 91988  _15:
 91989  	if _5_k >= _pAggInfo.XnColumn {
 91990  		goto _18
 91991  	}
 91992  	if (_4_pCol.XiTable == _pExpr.XiTable) && (_4_pCol.XiColumn == int32(_pExpr.XiColumn)) {
 91993  		goto _18
 91994  	}
 91995  	*(*uintptr)(unsafe.Pointer(func() **TAggInfo_col { _5_k += 1; return &_4_pCol }())) += uintptr(24)
 91996  	goto _15
 91997  _18:
 91998  	if _5_k < _pAggInfo.XnColumn || store2(&_5_k, _addAggInfoColumn(tls, (*Xsqlite3)(_pParse.Xdb), _pAggInfo)) < int32(0) {
 91999  		goto _22
 92000  	}
 92001  	_4_pCol = elem66((*TAggInfo_col)(_pAggInfo.XaCol), uintptr(_5_k))
 92002  	*(**XTable)(unsafe.Pointer(&_4_pCol.XpTab)) = (*XTable)(_pExpr.XpTab)
 92003  	_4_pCol.XiTable = _pExpr.XiTable
 92004  	_4_pCol.XiColumn = int32(_pExpr.XiColumn)
 92005  	_4_pCol.XiMem = preInc2(&_pParse.XnMem, 1)
 92006  	_4_pCol.XiSorterColumn = int32(-1)
 92007  	*(**XExpr)(unsafe.Pointer(&_4_pCol.XpExpr)) = _pExpr
 92008  	if _pAggInfo.XpGroupBy == nil {
 92009  		goto _23
 92010  	}
 92011  	_9_pGB = (*XExprList)(_pAggInfo.XpGroupBy)
 92012  	_9_pTerm = (*TExprList_item)(unsafe.Pointer(&_9_pGB.Xa))
 92013  	_9_n = _9_pGB.XnExpr
 92014  	_9_j = int32(0)
 92015  _24:
 92016  	if _9_j >= _9_n {
 92017  		goto _27
 92018  	}
 92019  	_10_pE = (*XExpr)(_9_pTerm.XpExpr)
 92020  	if ((int32(_10_pE.Xop) == int32(152)) && (_10_pE.XiTable == _pExpr.XiTable)) && (int32(_10_pE.XiColumn) == int32(_pExpr.XiColumn)) {
 92021  		_4_pCol.XiSorterColumn = _9_j
 92022  		goto _27
 92023  	}
 92024  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _9_j += 1; return &_9_pTerm }())) += uintptr(20)
 92025  	goto _24
 92026  _27:
 92027  _23:
 92028  	if _4_pCol.XiSorterColumn < int32(0) {
 92029  		_4_pCol.XiSorterColumn = postInc2(&_pAggInfo.XnSortingColumn, 1)
 92030  	}
 92031  _22:
 92032  	_pExpr.Xflags |= uint32(131072)
 92033  	*(**XAggInfo)(unsafe.Pointer(&_pExpr.XpAggInfo)) = _pAggInfo
 92034  	_pExpr.Xop = uint8(154)
 92035  	_pExpr.XiAgg = int16(_5_k)
 92036  	goto _11
 92037  _14:
 92038  	*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_3_pItem }())) += uintptr(68)
 92039  	goto _8
 92040  _11:
 92041  _7:
 92042  	return int32(1)
 92043  
 92044  _3:
 92045  	if (int32(_pNC.XncFlags)&int32(8)) != int32(0) || _pWalker.XwalkerDepth != int32(_pExpr.Xop2) {
 92046  		goto _33
 92047  	}
 92048  	_14_pItem = (*TAggInfo_func)(_pAggInfo.XaFunc)
 92049  	_i = int32(0)
 92050  _34:
 92051  	if _i >= _pAggInfo.XnFunc {
 92052  		goto _37
 92053  	}
 92054  	if _sqlite3ExprCompare(tls, (*XExpr)(_14_pItem.XpExpr), _pExpr, int32(-1)) == int32(0) {
 92055  		goto _37
 92056  	}
 92057  	*(*uintptr)(unsafe.Pointer(func() **TAggInfo_func { _i += 1; return &_14_pItem }())) += uintptr(16)
 92058  	goto _34
 92059  _37:
 92060  	if _i < _pAggInfo.XnFunc {
 92061  		goto _39
 92062  	}
 92063  	_17_enc = (*Xsqlite3)(_pParse.Xdb).Xenc
 92064  	_i = _addAggInfoFunc(tls, (*Xsqlite3)(_pParse.Xdb), _pAggInfo)
 92065  	if _i < int32(0) {
 92066  		goto _40
 92067  	}
 92068  	func() {
 92069  		if (_pExpr.Xflags & uint32(2048)) != (0) {
 92070  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95945), unsafe.Pointer(&_analyzeAggregateØ00__func__Ø000), unsafe.Pointer(str(42733)))
 92071  			crt.X__builtin_abort(tls)
 92072  		}
 92073  	}()
 92074  	_14_pItem = elem67((*TAggInfo_func)(_pAggInfo.XaFunc), uintptr(_i))
 92075  	*(**XExpr)(unsafe.Pointer(&_14_pItem.XpExpr)) = _pExpr
 92076  	_14_pItem.XiMem = preInc2(&_pParse.XnMem, 1)
 92077  	func() {
 92078  		if (_pExpr.Xflags & uint32(1024)) != (0) {
 92079  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95949), unsafe.Pointer(&_analyzeAggregateØ00__func__Ø000), unsafe.Pointer(str(42479)))
 92080  			crt.X__builtin_abort(tls)
 92081  		}
 92082  	}()
 92083  	*(**XFuncDef)(unsafe.Pointer(&_14_pItem.XpFunc)) = _sqlite3FindFunction(tls, (*Xsqlite3)(_pParse.Xdb), *(**int8)(unsafe.Pointer(&_pExpr.Xu)), func() int32 {
 92084  		if (*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))) != nil {
 92085  			return ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx))).XnExpr)
 92086  		}
 92087  		return int32(0)
 92088  	}(), _17_enc, 0)
 92089  	if (_pExpr.Xflags & uint32(16)) != 0 {
 92090  		_14_pItem.XiDistinct = postInc2(&_pParse.XnTab, 1)
 92091  		goto _48
 92092  	}
 92093  	_14_pItem.XiDistinct = int32(-1)
 92094  _48:
 92095  _40:
 92096  _39:
 92097  	func() {
 92098  		if (_pExpr.Xflags & uint32(24576)) != (0) {
 92099  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95962), unsafe.Pointer(&_analyzeAggregateØ00__func__Ø000), unsafe.Pointer(str(96033)))
 92100  			crt.X__builtin_abort(tls)
 92101  		}
 92102  	}()
 92103  	_pExpr.Xflags |= uint32(131072)
 92104  	_pExpr.XiAgg = int16(_i)
 92105  	*(**XAggInfo)(unsafe.Pointer(&_pExpr.XpAggInfo)) = _pAggInfo
 92106  	return int32(1)
 92107  
 92108  _33:
 92109  	return int32(0)
 92110  
 92111  _4:
 92112  	return int32(0)
 92113  }
 92114  
 92115  var _analyzeAggregateØ00__func__Ø000 [17]int8
 92116  
 92117  func init() {
 92118  	crt.Xstrncpy(nil, &_analyzeAggregateØ00__func__Ø000[0], str(109918), 17)
 92119  }
 92120  
 92121  // C comment
 92122  //  /*
 92123  //  ** Add a new element to the pAggInfo->aCol[] array.  Return the index of
 92124  //  ** the new element.  Return a negative number if malloc fails.
 92125  //  */
 92126  func _addAggInfoColumn(tls *crt.TLS, _db *Xsqlite3, _pInfo *XAggInfo) (r0 int32) {
 92127  	var _i int32
 92128  	*(**TAggInfo_col)(unsafe.Pointer(&_pInfo.XaCol)) = (*TAggInfo_col)(_sqlite3ArrayAllocate(tls, _db, _pInfo.XaCol, int32(24), &_pInfo.XnColumn, &_i))
 92129  	return _i
 92130  }
 92131  
 92132  // C comment
 92133  //  /*
 92134  //  ** pArray is a pointer to an array of objects. Each object in the
 92135  //  ** array is szEntry bytes in size. This routine uses sqlite3DbRealloc()
 92136  //  ** to extend the array so that there is space for a new object at the end.
 92137  //  **
 92138  //  ** When this function is called, *pnEntry contains the current size of
 92139  //  ** the array (in entries - so the allocation is ((*pnEntry) * szEntry) bytes
 92140  //  ** in total).
 92141  //  **
 92142  //  ** If the realloc() is successful (i.e. if no OOM condition occurs), the
 92143  //  ** space allocated for the new object is zeroed, *pnEntry updated to
 92144  //  ** reflect the new size of the array and a pointer to the new allocation
 92145  //  ** returned. *pIdx is set to the index of the new array entry in this case.
 92146  //  **
 92147  //  ** Otherwise, if the realloc() fails, *pIdx is set to -1, *pnEntry remains
 92148  //  ** unchanged and a copy of pArray returned.
 92149  //  */
 92150  func _sqlite3ArrayAllocate(tls *crt.TLS, _db *Xsqlite3, _pArray unsafe.Pointer, _szEntry int32, _pnEntry *int32, _pIdx *int32) (r0 unsafe.Pointer) {
 92151  	var _n, _1_sz int32
 92152  	var _z *int8
 92153  	var _1_pNew unsafe.Pointer
 92154  	_n = *_pnEntry
 92155  	if (_n & (_n - int32(1))) != int32(0) {
 92156  		goto _0
 92157  	}
 92158  	_1_sz = func() int32 {
 92159  		if _n == int32(0) {
 92160  			return int32(1)
 92161  		}
 92162  		return (int32(2) * _n)
 92163  	}()
 92164  	_1_pNew = _sqlite3DbRealloc(tls, _db, _pArray, uint64(_1_sz*_szEntry))
 92165  	if _1_pNew == nil {
 92166  		*_pIdx = int32(-1)
 92167  		return _pArray
 92168  	}
 92169  	_pArray = _1_pNew
 92170  _0:
 92171  	_z = (*int8)(_pArray)
 92172  	crt.Xmemset(tls, unsafe.Pointer(elem1(_z, uintptr(_n*_szEntry))), int32(0), uint32(_szEntry))
 92173  	*_pIdx = _n
 92174  	*_pnEntry += 1
 92175  	return _pArray
 92176  }
 92177  
 92178  // C comment
 92179  //  /*
 92180  //  ** Add a new element to the pAggInfo->aFunc[] array.  Return the index of
 92181  //  ** the new element.  Return a negative number if malloc fails.
 92182  //  */
 92183  func _addAggInfoFunc(tls *crt.TLS, _db *Xsqlite3, _pInfo *XAggInfo) (r0 int32) {
 92184  	var _i int32
 92185  	*(**TAggInfo_func)(unsafe.Pointer(&_pInfo.XaFunc)) = (*TAggInfo_func)(_sqlite3ArrayAllocate(tls, _db, _pInfo.XaFunc, int32(16), &_pInfo.XnFunc, &_i))
 92186  	return _i
 92187  }
 92188  
 92189  func _analyzeAggregatesInSelect(tls *crt.TLS, _pWalker *XWalker, _pSelect *XSelect) (r0 int32) {
 92190  	return int32(0)
 92191  }
 92192  
 92193  var _sqlite3ExprAnalyzeAggregatesØ00__func__Ø000 [29]int8
 92194  
 92195  func init() {
 92196  	crt.Xstrncpy(nil, &_sqlite3ExprAnalyzeAggregatesØ00__func__Ø000[0], str(109935), 29)
 92197  }
 92198  
 92199  // C comment
 92200  //  /*
 92201  //  ** Transfer eligible terms from the HAVING clause of a query, which is
 92202  //  ** processed after grouping, to the WHERE clause, which is processed before
 92203  //  ** grouping. For example, the query:
 92204  //  **
 92205  //  **   SELECT * FROM <tables> WHERE a=? GROUP BY b HAVING b=? AND c=?
 92206  //  **
 92207  //  ** can be rewritten as:
 92208  //  **
 92209  //  **   SELECT * FROM <tables> WHERE a=? AND b=? GROUP BY b HAVING c=?
 92210  //  **
 92211  //  ** A term of the HAVING expression is eligible for transfer if it consists
 92212  //  ** entirely of constants and expressions that are also GROUP BY terms that
 92213  //  ** use the "BINARY" collation sequence.
 92214  //  */
 92215  func _havingToWhere(tls *crt.TLS, _pParse *XParse, _pGroupBy *XExprList, _pHaving *XExpr, _ppWhere **XExpr) {
 92216  	var _sWalker XWalker
 92217  	var _sCtx THavingToWhereCtx
 92218  	*(***XExpr)(unsafe.Pointer(&_sCtx.XppWhere)) = _ppWhere
 92219  	*(**XExprList)(unsafe.Pointer(&_sCtx.XpGroupBy)) = _pGroupBy
 92220  	crt.Xmemset(tls, unsafe.Pointer(&_sWalker), int32(0), uint32(28))
 92221  	*(**XParse)(unsafe.Pointer(&_sWalker.XpParse)) = _pParse
 92222  	*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_sWalker.XxExprCallback)) = _havingToWhereExprCb
 92223  	*(**THavingToWhereCtx)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sWalker.Xu)))) = &_sCtx
 92224  	_sqlite3WalkExpr(tls, &_sWalker, _pHaving)
 92225  }
 92226  
 92227  // C comment
 92228  //  /*
 92229  //  ** sqlite3WalkExpr() callback used by havingToWhere().
 92230  //  **
 92231  //  ** If the node passed to the callback is a TK_AND node, return
 92232  //  ** WRC_Continue to tell sqlite3WalkExpr() to iterate through child nodes.
 92233  //  **
 92234  //  ** Otherwise, return WRC_Prune. In this case, also check if the
 92235  //  ** sub-expression matches the criteria for being moved to the WHERE
 92236  //  ** clause. If so, add it to the WHERE clause and replace the sub-expression
 92237  //  ** within the HAVING expression with a constant "1".
 92238  //  */
 92239  func _havingToWhereExprCb(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
 92240  	var _2_db *Xsqlite3
 92241  	var _2_pNew, _3_pWhere *XExpr
 92242  	var _4_t XExpr
 92243  	var _1_p *THavingToWhereCtx
 92244  	if int32(_pExpr.Xop) == int32(71) {
 92245  		goto _0
 92246  	}
 92247  	_1_p = (*THavingToWhereCtx)(*(*unsafe.Pointer)(unsafe.Pointer(&_pWalker.Xu)))
 92248  	if _sqlite3ExprIsConstantOrGroupBy(tls, (*XParse)(_pWalker.XpParse), _pExpr, (*XExprList)(_1_p.XpGroupBy)) == 0 {
 92249  		goto _1
 92250  	}
 92251  	_2_db = (*Xsqlite3)((*XParse)(_pWalker.XpParse).Xdb)
 92252  	_2_pNew = _sqlite3ExprAlloc(tls, _2_db, int32(134), elem56((*XToken)(unsafe.Pointer(&_sqlite3IntTokens)), uintptr(1)), int32(0))
 92253  	if _2_pNew != nil {
 92254  		_3_pWhere = *(**XExpr)(unsafe.Pointer(_1_p.XppWhere))
 92255  		_4_t = *_2_pNew
 92256  		*_2_pNew = *_pExpr
 92257  		*_pExpr = _4_t
 92258  		_2_pNew = _sqlite3ExprAnd(tls, _2_db, _3_pWhere, _2_pNew)
 92259  		*(**XExpr)(unsafe.Pointer(_1_p.XppWhere)) = _2_pNew
 92260  	}
 92261  _1:
 92262  	return int32(1)
 92263  
 92264  _0:
 92265  	return int32(0)
 92266  }
 92267  
 92268  // C comment
 92269  //  /*
 92270  //  ** Walk the expression tree passed as the first argument. Return non-zero
 92271  //  ** if the expression consists entirely of constants or copies of terms
 92272  //  ** in pGroupBy that sort with the BINARY collation sequence.
 92273  //  **
 92274  //  ** This routine is used to determine if a term of the HAVING clause can
 92275  //  ** be promoted into the WHERE clause.  In order for such a promotion to work,
 92276  //  ** the value of the HAVING clause term must be the same for all members of
 92277  //  ** a "group".  The requirement that the GROUP BY term must be BINARY
 92278  //  ** assumes that no other collating sequence will have a finer-grained
 92279  //  ** grouping than binary.  In other words (A=B COLLATE binary) implies
 92280  //  ** A=B in every other collating sequence.  The requirement that the
 92281  //  ** GROUP BY be BINARY is stricter than necessary.  It would also work
 92282  //  ** to promote HAVING clauses that use the same alternative collating
 92283  //  ** sequence as the GROUP BY term, but that is much harder to check,
 92284  //  ** alternative collating sequences are uncommon, and this is only an
 92285  //  ** optimization, so we take the easy way out and simply require the
 92286  //  ** GROUP BY to use the BINARY collating sequence.
 92287  //  */
 92288  func _sqlite3ExprIsConstantOrGroupBy(tls *crt.TLS, _pParse *XParse, _p *XExpr, _pGroupBy *XExprList) (r0 int32) {
 92289  	var _w XWalker
 92290  	crt.Xmemset(tls, unsafe.Pointer(&_w), int32(0), uint32(28))
 92291  	_w.XeCode = uint8(1)
 92292  	*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_w.XxExprCallback)) = _exprNodeIsConstantOrGroupBy
 92293  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_w.Xu)))) = _pGroupBy
 92294  	*(**XParse)(unsafe.Pointer(&_w.XpParse)) = _pParse
 92295  	_sqlite3WalkExpr(tls, &_w, _p)
 92296  	return int32(_w.XeCode)
 92297  }
 92298  
 92299  // C comment
 92300  //  /*
 92301  //  ** sqlite3WalkExpr() callback used by sqlite3ExprIsConstantOrGroupBy().
 92302  //  */
 92303  func _exprNodeIsConstantOrGroupBy(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
 92304  	var _i int32
 92305  	var _pGroupBy *XExprList
 92306  	var _1_p *XExpr
 92307  	var _2_pColl *XCollSeq
 92308  	_pGroupBy = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pWalker.Xu)))
 92309  	_i = int32(0)
 92310  _0:
 92311  	if _i >= _pGroupBy.XnExpr {
 92312  		goto _3
 92313  	}
 92314  	_1_p = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pGroupBy.Xa)), uintptr(_i)).XpExpr)
 92315  	if _sqlite3ExprCompare(tls, _pExpr, _1_p, int32(-1)) >= int32(2) {
 92316  		goto _4
 92317  	}
 92318  	_2_pColl = _sqlite3ExprCollSeq(tls, (*XParse)(_pWalker.XpParse), _1_p)
 92319  	if (_2_pColl == nil) || (Xsqlite3_stricmp(tls, str(37836), _2_pColl.XzName) == int32(0)) {
 92320  		return int32(1)
 92321  	}
 92322  _4:
 92323  	_i += 1
 92324  	goto _0
 92325  _3:
 92326  	if (_pExpr.Xflags & uint32(2048)) != (0) {
 92327  		_pWalker.XeCode = 0
 92328  		return int32(2)
 92329  	}
 92330  	return _exprNodeIsConstant(tls, _pWalker, _pExpr)
 92331  }
 92332  
 92333  // C comment
 92334  //  /*
 92335  //  ** Unless an "EXPLAIN QUERY PLAN" command is being processed, this function
 92336  //  ** is a no-op. Otherwise, it adds a single row of output to the EQP result,
 92337  //  ** where the caption is of the form:
 92338  //  **
 92339  //  **   "USE TEMP B-TREE FOR xxx"
 92340  //  **
 92341  //  ** where xxx is one of "DISTINCT", "ORDER BY" or "GROUP BY". Exactly which
 92342  //  ** is determined by the zUsage argument.
 92343  //  */
 92344  func _explainTempTable(tls *crt.TLS, _pParse *XParse, _zUsage *int8) {
 92345  	var _1_zMsg *int8
 92346  	var _1_v *TVdbe
 92347  	if int32(_pParse.Xexplain) == int32(2) {
 92348  		_1_v = (*TVdbe)(_pParse.XpVdbe)
 92349  		_1_zMsg = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.Xdb), str(109964), unsafe.Pointer(_zUsage))
 92350  		_sqlite3VdbeAddOp4(tls, _1_v, int32(165), _pParse.XiSelectId, int32(0), int32(0), _1_zMsg, int32(-1))
 92351  	}
 92352  }
 92353  
 92354  // C comment
 92355  //  /*
 92356  //  ** If the WHERE_GROUPBY flag is set in the mask passed to sqlite3WhereBegin(),
 92357  //  ** the planner assumes that the specified pOrderBy list is actually a GROUP
 92358  //  ** BY clause - and so any order that groups rows as required satisfies the
 92359  //  ** request.
 92360  //  **
 92361  //  ** Normally, in this case it is not possible for the caller to determine
 92362  //  ** whether or not the rows are really being delivered in sorted order, or
 92363  //  ** just in some other order that provides the required grouping. However,
 92364  //  ** if the WHERE_SORTBYGROUP flag is also passed to sqlite3WhereBegin(), then
 92365  //  ** this function may be called on the returned WhereInfo object. It returns
 92366  //  ** true if the rows really will be sorted in the specified order, or false
 92367  //  ** otherwise.
 92368  //  **
 92369  //  ** For example, assuming:
 92370  //  **
 92371  //  **   CREATE INDEX i1 ON t1(x, Y);
 92372  //  **
 92373  //  ** then
 92374  //  **
 92375  //  **   SELECT * FROM t1 GROUP BY x,y ORDER BY x,y;   -- IsSorted()==1
 92376  //  **   SELECT * FROM t1 GROUP BY y,x ORDER BY y,x;   -- IsSorted()==0
 92377  //  */
 92378  func _sqlite3WhereIsSorted(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int32) {
 92379  	func() {
 92380  		if (int32(_pWInfo.XwctrlFlags) & int32(64)) == 0 {
 92381  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134159), unsafe.Pointer(&_sqlite3WhereIsSortedØ00__func__Ø000), unsafe.Pointer(str(109987)))
 92382  			crt.X__builtin_abort(tls)
 92383  		}
 92384  	}()
 92385  	func() {
 92386  		if (int32(_pWInfo.XwctrlFlags) & int32(512)) == 0 {
 92387  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(134160), unsafe.Pointer(&_sqlite3WhereIsSortedØ00__func__Ø000), unsafe.Pointer(str(110022)))
 92388  			crt.X__builtin_abort(tls)
 92389  		}
 92390  	}()
 92391  	return int32(_pWInfo.Xsorted)
 92392  }
 92393  
 92394  var _sqlite3WhereIsSortedØ00__func__Ø000 [21]int8
 92395  
 92396  func init() {
 92397  	crt.Xstrncpy(nil, &_sqlite3WhereIsSortedØ00__func__Ø000[0], str(110061), 21)
 92398  }
 92399  
 92400  // C comment
 92401  //  /*
 92402  //  ** Update the accumulator memory cells for an aggregate based on
 92403  //  ** the current cursor position.
 92404  //  */
 92405  func _updateAccumulator(tls *crt.TLS, _pParse *XParse, _pAggInfo *XAggInfo) {
 92406  	var _i, _regHit, _addrHitTest, _1_nArg, _1_addrNext, _1_regAgg, _5_j int32
 92407  	var _v *TVdbe
 92408  	var _1_pList *XExprList
 92409  	var _5_pItem *TExprList_item
 92410  	var _5_pColl *XCollSeq
 92411  	var _pC *TAggInfo_col
 92412  	var _pF *TAggInfo_func
 92413  	_v = (*TVdbe)(_pParse.XpVdbe)
 92414  	_regHit = int32(0)
 92415  	_addrHitTest = int32(0)
 92416  	_pAggInfo.XdirectMode = uint8(1)
 92417  	*func() **TAggInfo_func { _i = int32(0); return &_pF }() = (*TAggInfo_func)(_pAggInfo.XaFunc)
 92418  _0:
 92419  	if _i >= _pAggInfo.XnFunc {
 92420  		goto _3
 92421  	}
 92422  	_1_addrNext = int32(0)
 92423  	_1_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&((*XExpr)(_pF.XpExpr).Xx))))
 92424  	func() {
 92425  		if (((*XExpr)(_pF.XpExpr).Xflags) & uint32(2048)) != (0) {
 92426  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121330), unsafe.Pointer(&_updateAccumulatorØ00__func__Ø000), unsafe.Pointer(str(110082)))
 92427  			crt.X__builtin_abort(tls)
 92428  		}
 92429  	}()
 92430  	if _1_pList != nil {
 92431  		_1_nArg = _1_pList.XnExpr
 92432  		_1_regAgg = _sqlite3GetTempRange(tls, _pParse, _1_nArg)
 92433  		_sqlite3ExprCodeExprList(tls, _pParse, _1_pList, _1_regAgg, int32(0), uint8(1))
 92434  		goto _7
 92435  	}
 92436  	_1_nArg = int32(0)
 92437  	_1_regAgg = int32(0)
 92438  _7:
 92439  	if _pF.XiDistinct >= int32(0) {
 92440  		_1_addrNext = _sqlite3VdbeMakeLabel(tls, _v)
 92441  		_codeDistinct(tls, _pParse, _pF.XiDistinct, _1_addrNext, int32(1), _1_regAgg)
 92442  	}
 92443  	if (int32((*XFuncDef)(_pF.XpFunc).XfuncFlags) & int32(32)) == 0 {
 92444  		goto _9
 92445  	}
 92446  	_5_pColl = nil
 92447  	func() {
 92448  		if _1_pList == nil {
 92449  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121349), unsafe.Pointer(&_updateAccumulatorØ00__func__Ø000), unsafe.Pointer(str(88609)))
 92450  			crt.X__builtin_abort(tls)
 92451  		}
 92452  	}()
 92453  	*func() **TExprList_item { _5_j = int32(0); return &_5_pItem }() = (*TExprList_item)(unsafe.Pointer(&_1_pList.Xa))
 92454  _12:
 92455  	if _5_pColl != nil || _5_j >= _1_nArg {
 92456  		goto _16
 92457  	}
 92458  	_5_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_5_pItem.XpExpr))
 92459  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _5_j += 1; return &_5_pItem }())) += uintptr(20)
 92460  	goto _12
 92461  _16:
 92462  	if _5_pColl == nil {
 92463  		_5_pColl = (*XCollSeq)((*Xsqlite3)(_pParse.Xdb).XpDfltColl)
 92464  	}
 92465  	if (_regHit == int32(0)) && _pAggInfo.XnAccumulator != 0 {
 92466  		_regHit = preInc2(&_pParse.XnMem, 1)
 92467  	}
 92468  	_sqlite3VdbeAddOp4(tls, _v, int32(68), _regHit, int32(0), int32(0), (*int8)(unsafe.Pointer(_5_pColl)), int32(-3))
 92469  _9:
 92470  	_sqlite3VdbeAddOp3(tls, _v, int32(150), int32(0), _1_regAgg, _pF.XiMem)
 92471  	_sqlite3VdbeAppendP4(tls, _v, _pF.XpFunc, int32(-4))
 92472  	_sqlite3VdbeChangeP5(tls, _v, uint16(uint8(_1_nArg)))
 92473  	_sqlite3ExprCacheAffinityChange(tls, _pParse, _1_regAgg, _1_nArg)
 92474  	_sqlite3ReleaseTempRange(tls, _pParse, _1_regAgg, _1_nArg)
 92475  	if _1_addrNext != 0 {
 92476  		_sqlite3VdbeResolveLabel(tls, _v, _1_addrNext)
 92477  		_sqlite3ExprCacheClear(tls, _pParse)
 92478  	}
 92479  	*(*uintptr)(unsafe.Pointer(func() **TAggInfo_func { _i += 1; return &_pF }())) += uintptr(16)
 92480  	goto _0
 92481  _3:
 92482  	if _regHit != 0 {
 92483  		_addrHitTest = _sqlite3VdbeAddOp1(tls, _v, int32(21), _regHit)
 92484  	}
 92485  	_sqlite3ExprCacheClear(tls, _pParse)
 92486  	*func() **TAggInfo_col { _i = int32(0); return &_pC }() = (*TAggInfo_col)(_pAggInfo.XaCol)
 92487  _22:
 92488  	if _i >= _pAggInfo.XnAccumulator {
 92489  		goto _25
 92490  	}
 92491  	_sqlite3ExprCode(tls, _pParse, (*XExpr)(_pC.XpExpr), _pC.XiMem)
 92492  	*(*uintptr)(unsafe.Pointer(func() **TAggInfo_col { _i += 1; return &_pC }())) += uintptr(24)
 92493  	goto _22
 92494  _25:
 92495  	_pAggInfo.XdirectMode = 0
 92496  	_sqlite3ExprCacheClear(tls, _pParse)
 92497  	if _addrHitTest != 0 {
 92498  		_sqlite3VdbeJumpHere(tls, _v, _addrHitTest)
 92499  	}
 92500  }
 92501  
 92502  var _updateAccumulatorØ00__func__Ø000 [18]int8
 92503  
 92504  func init() {
 92505  	crt.Xstrncpy(nil, &_updateAccumulatorØ00__func__Ø000[0], str(110124), 18)
 92506  }
 92507  
 92508  // C comment
 92509  //  /*
 92510  //  ** Invoke the OP_AggFinalize opcode for every aggregate function
 92511  //  ** in the AggInfo structure.
 92512  //  */
 92513  func _finalizeAggFunctions(tls *crt.TLS, _pParse *XParse, _pAggInfo *XAggInfo) {
 92514  	var _i int32
 92515  	var _v *TVdbe
 92516  	var _1_pList *XExprList
 92517  	var _pF *TAggInfo_func
 92518  	_v = (*TVdbe)(_pParse.XpVdbe)
 92519  	*func() **TAggInfo_func { _i = int32(0); return &_pF }() = (*TAggInfo_func)(_pAggInfo.XaFunc)
 92520  _0:
 92521  	if _i >= _pAggInfo.XnFunc {
 92522  		goto _3
 92523  	}
 92524  	_1_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&((*XExpr)(_pF.XpExpr).Xx))))
 92525  	func() {
 92526  		if (((*XExpr)(_pF.XpExpr).Xflags) & uint32(2048)) != (0) {
 92527  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121306), unsafe.Pointer(&_finalizeAggFunctionsØ00__func__Ø000), unsafe.Pointer(str(110082)))
 92528  			crt.X__builtin_abort(tls)
 92529  		}
 92530  	}()
 92531  	_sqlite3VdbeAddOp2(tls, _v, int32(152), _pF.XiMem, func() int32 {
 92532  		if _1_pList != nil {
 92533  			return _1_pList.XnExpr
 92534  		}
 92535  		return int32(0)
 92536  	}())
 92537  	_sqlite3VdbeAppendP4(tls, _v, _pF.XpFunc, int32(-4))
 92538  	*(*uintptr)(unsafe.Pointer(func() **TAggInfo_func { _i += 1; return &_pF }())) += uintptr(16)
 92539  	goto _0
 92540  _3:
 92541  }
 92542  
 92543  var _finalizeAggFunctionsØ00__func__Ø000 [21]int8
 92544  
 92545  func init() {
 92546  	crt.Xstrncpy(nil, &_finalizeAggFunctionsØ00__func__Ø000[0], str(110142), 21)
 92547  }
 92548  
 92549  // C comment
 92550  //  /*
 92551  //  ** Reset the aggregate accumulator.
 92552  //  **
 92553  //  ** The aggregate accumulator is a set of memory cells that hold
 92554  //  ** intermediate results while calculating an aggregate.  This
 92555  //  ** routine generates code that stores NULLs in all of those memory
 92556  //  ** cells.
 92557  //  */
 92558  func _resetAccumulator(tls *crt.TLS, _pParse *XParse, _pAggInfo *XAggInfo) {
 92559  	var _i, _nReg int32
 92560  	var _v *TVdbe
 92561  	var _4_pE *XExpr
 92562  	var _6_pKeyInfo *XKeyInfo
 92563  	var _pFunc *TAggInfo_func
 92564  	_v = (*TVdbe)(_pParse.XpVdbe)
 92565  	_nReg = _pAggInfo.XnFunc + _pAggInfo.XnColumn
 92566  	if _nReg == int32(0) {
 92567  		return
 92568  	}
 92569  	func() {
 92570  		if _nReg != ((_pAggInfo.XmxReg - _pAggInfo.XmnReg) + int32(1)) {
 92571  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121268), unsafe.Pointer(&_resetAccumulatorØ00__func__Ø000), unsafe.Pointer(str(110163)))
 92572  			crt.X__builtin_abort(tls)
 92573  		}
 92574  	}()
 92575  	_i = int32(0)
 92576  _3:
 92577  	if _i >= _pAggInfo.XnColumn {
 92578  		goto _6
 92579  	}
 92580  	func() {
 92581  		if (elem66((*TAggInfo_col)(_pAggInfo.XaCol), uintptr(_i)).XiMem) < _pAggInfo.XmnReg || (elem66((*TAggInfo_col)(_pAggInfo.XaCol), uintptr(_i)).XiMem) > _pAggInfo.XmxReg {
 92582  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121270), unsafe.Pointer(&_resetAccumulatorØ00__func__Ø000), unsafe.Pointer(str(110203)))
 92583  			crt.X__builtin_abort(tls)
 92584  		}
 92585  	}()
 92586  	_i += 1
 92587  	goto _3
 92588  _6:
 92589  	_i = int32(0)
 92590  _10:
 92591  	if _i >= _pAggInfo.XnFunc {
 92592  		goto _13
 92593  	}
 92594  	func() {
 92595  		if (elem67((*TAggInfo_func)(_pAggInfo.XaFunc), uintptr(_i)).XiMem) < _pAggInfo.XmnReg || (elem67((*TAggInfo_func)(_pAggInfo.XaFunc), uintptr(_i)).XiMem) > _pAggInfo.XmxReg {
 92596  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121274), unsafe.Pointer(&_resetAccumulatorØ00__func__Ø000), unsafe.Pointer(str(110286)))
 92597  			crt.X__builtin_abort(tls)
 92598  		}
 92599  	}()
 92600  	_i += 1
 92601  	goto _10
 92602  _13:
 92603  	_sqlite3VdbeAddOp3(tls, _v, int32(59), int32(0), _pAggInfo.XmnReg, _pAggInfo.XmxReg)
 92604  	*func() *int32 { _pFunc = (*TAggInfo_func)(_pAggInfo.XaFunc); return &_i }() = int32(0)
 92605  _17:
 92606  	if _i >= _pAggInfo.XnFunc {
 92607  		goto _20
 92608  	}
 92609  	if _pFunc.XiDistinct < int32(0) {
 92610  		goto _21
 92611  	}
 92612  	_4_pE = (*XExpr)(_pFunc.XpExpr)
 92613  	func() {
 92614  		if (_4_pE.Xflags & uint32(2048)) != (0) {
 92615  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(121282), unsafe.Pointer(&_resetAccumulatorØ00__func__Ø000), unsafe.Pointer(str(110371)))
 92616  			crt.X__builtin_abort(tls)
 92617  		}
 92618  	}()
 92619  	if ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_4_pE.Xx))) == nil) || (((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_4_pE.Xx))).XnExpr) != int32(1)) {
 92620  		_sqlite3ErrorMsg(tls, _pParse, str(110406))
 92621  		_pFunc.XiDistinct = int32(-1)
 92622  		goto _26
 92623  	}
 92624  	_6_pKeyInfo = _keyInfoFromExprList(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_4_pE.Xx))), int32(0), int32(0))
 92625  	_sqlite3VdbeAddOp4(tls, _v, int32(110), _pFunc.XiDistinct, int32(0), int32(0), (*int8)(unsafe.Pointer(_6_pKeyInfo)), int32(-5))
 92626  _26:
 92627  _21:
 92628  	*(*uintptr)(unsafe.Pointer(func() **TAggInfo_func { _i += 1; return &_pFunc }())) += uintptr(16)
 92629  	goto _17
 92630  _20:
 92631  }
 92632  
 92633  var _resetAccumulatorØ00__func__Ø000 [17]int8
 92634  
 92635  func init() {
 92636  	crt.Xstrncpy(nil, &_resetAccumulatorØ00__func__Ø000[0], str(110457), 17)
 92637  }
 92638  
 92639  // C comment
 92640  //  /*
 92641  //  ** The select statement passed as the first argument is an aggregate query.
 92642  //  ** The second argument is the associated aggregate-info object. This
 92643  //  ** function tests if the SELECT is of the form:
 92644  //  **
 92645  //  **   SELECT count(*) FROM <tbl>
 92646  //  **
 92647  //  ** where table is a database table, not a sub-select or view. If the query
 92648  //  ** does match this pattern, then a pointer to the Table object representing
 92649  //  ** <tbl> is returned. Otherwise, 0 is returned.
 92650  //  */
 92651  func _isSimpleCount(tls *crt.TLS, _p *XSelect, _pAggInfo *XAggInfo) (r0 *XTable) {
 92652  	var _pTab *XTable
 92653  	var _pExpr *XExpr
 92654  	func() {
 92655  		if _p.XpGroupBy != nil {
 92656  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120492), unsafe.Pointer(&_isSimpleCountØ00__func__Ø000), unsafe.Pointer(str(110474)))
 92657  			crt.X__builtin_abort(tls)
 92658  		}
 92659  	}()
 92660  	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) {
 92661  		return nil
 92662  	}
 92663  	_pTab = (*XTable)(elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.XpSrc).Xa))), 0).XpTab)
 92664  	_pExpr = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.XpEList).Xa))), 0).XpExpr)
 92665  	func() {
 92666  		if _pTab == nil || _pTab.XpSelect != nil || _pExpr == nil {
 92667  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120501), unsafe.Pointer(&_isSimpleCountØ00__func__Ø000), unsafe.Pointer(str(110487)))
 92668  			crt.X__builtin_abort(tls)
 92669  		}
 92670  	}()
 92671  	if _pTab.XnModuleArg != 0 {
 92672  		return nil
 92673  	}
 92674  	if int32(_pExpr.Xop) != int32(153) {
 92675  		return nil
 92676  	}
 92677  	if func() int32 {
 92678  		if _pAggInfo.XnFunc == int32(0) {
 92679  			return func() int32 {
 92680  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120505), unsafe.Pointer(&_isSimpleCountØ00__func__Ø000), unsafe.Pointer(str(4809)))
 92681  				crt.X__builtin_abort(tls)
 92682  				return int32(1)
 92683  			}()
 92684  		}
 92685  		return int32(0)
 92686  	}() != 0 {
 92687  		return nil
 92688  	}
 92689  	if (int32((*XFuncDef)(elem67((*TAggInfo_func)(_pAggInfo.XaFunc), 0).XpFunc).XfuncFlags) & int32(256)) == int32(0) {
 92690  		return nil
 92691  	}
 92692  	if (_pExpr.Xflags & uint32(16)) != 0 {
 92693  		return nil
 92694  	}
 92695  	return _pTab
 92696  }
 92697  
 92698  var _isSimpleCountØ00__func__Ø000 [14]int8
 92699  
 92700  func init() {
 92701  	crt.Xstrncpy(nil, &_isSimpleCountØ00__func__Ø000[0], str(110519), 14)
 92702  }
 92703  
 92704  func _explainSimpleCount(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pIdx *XIndex) {
 92705  	var _1_bCover int32
 92706  	var _1_zEqp *int8
 92707  	if int32(_pParse.Xexplain) == int32(2) {
 92708  		_1_bCover = bool2int((_pIdx != nil) && (((_pTab.XtabFlags & uint32(32)) == (0)) || (int32((uint32(_pIdx.XidxType)<<30)>>30) != int32(2))))
 92709  		_1_zEqp = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.Xdb), str(110533), unsafe.Pointer(_pTab.XzName), unsafe.Pointer(func() *int8 {
 92710  			if _1_bCover != 0 {
 92711  				return str(110551)
 92712  			}
 92713  			return str(284)
 92714  		}()), unsafe.Pointer(func() *int8 {
 92715  			if _1_bCover != 0 {
 92716  				return _pIdx.XzName
 92717  			}
 92718  			return str(284)
 92719  		}()))
 92720  		_sqlite3VdbeAddOp4(tls, (*TVdbe)(_pParse.XpVdbe), int32(165), _pParse.XiSelectId, int32(0), int32(0), _1_zEqp, int32(-1))
 92721  	}
 92722  }
 92723  
 92724  // C comment
 92725  //  /*
 92726  //  ** Based on the contents of the AggInfo structure indicated by the first
 92727  //  ** argument, this function checks if the following are true:
 92728  //  **
 92729  //  **    * the query contains just a single aggregate function,
 92730  //  **    * the aggregate function is either min() or max(), and
 92731  //  **    * the argument to the aggregate function is a column value.
 92732  //  **
 92733  //  ** If all of the above are true, then WHERE_ORDERBY_MIN or WHERE_ORDERBY_MAX
 92734  //  ** is returned as appropriate. Also, *ppMinMax is set to point to the
 92735  //  ** list of arguments passed to the aggregate before returning.
 92736  //  **
 92737  //  ** Or, if the conditions above are not met, *ppMinMax is set to 0 and
 92738  //  ** WHERE_ORDERBY_NORMAL is returned.
 92739  //  */
 92740  func _minMaxQuery(tls *crt.TLS, _pAggInfo *XAggInfo, _ppMinMax **XExprList) (r0 uint8) {
 92741  	var _eRet int32
 92742  	var _2_zFunc *int8
 92743  	var _1_pEList *XExprList
 92744  	var _1_pExpr *XExpr
 92745  	_eRet = int32(0)
 92746  	*_ppMinMax = nil
 92747  	if _pAggInfo.XnFunc != int32(1) {
 92748  		goto _0
 92749  	}
 92750  	_1_pExpr = (*XExpr)(elem67((*TAggInfo_func)(_pAggInfo.XaFunc), 0).XpExpr)
 92751  	_1_pEList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_1_pExpr.Xx)))
 92752  	func() {
 92753  		if int32(_1_pExpr.Xop) != int32(153) {
 92754  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120460), unsafe.Pointer(&_minMaxQueryØ00__func__Ø000), unsafe.Pointer(str(96806)))
 92755  			crt.X__builtin_abort(tls)
 92756  		}
 92757  	}()
 92758  	if _1_pEList == nil || _1_pEList.XnExpr != int32(1) || int32((*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_1_pEList.Xa)), 0).XpExpr).Xop) != int32(154) {
 92759  		goto _5
 92760  	}
 92761  	_2_zFunc = *(**int8)(unsafe.Pointer(&_1_pExpr.Xu))
 92762  	if _sqlite3StrICmp(tls, _2_zFunc, str(7610)) == int32(0) {
 92763  		_eRet = int32(1)
 92764  		*_ppMinMax = _1_pEList
 92765  		goto _8
 92766  	}
 92767  	if _sqlite3StrICmp(tls, _2_zFunc, str(7614)) == int32(0) {
 92768  		_eRet = int32(2)
 92769  		*_ppMinMax = _1_pEList
 92770  	}
 92771  _8:
 92772  _5:
 92773  _0:
 92774  	func() {
 92775  		if (*_ppMinMax) != nil && ((*_ppMinMax).XnExpr) != int32(1) {
 92776  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(120473), unsafe.Pointer(&_minMaxQueryØ00__func__Ø000), unsafe.Pointer(str(110574)))
 92777  			crt.X__builtin_abort(tls)
 92778  		}
 92779  	}()
 92780  	return uint8(_eRet)
 92781  }
 92782  
 92783  var _minMaxQueryØ00__func__Ø000 [12]int8
 92784  
 92785  func init() {
 92786  	crt.Xstrncpy(nil, &_minMaxQueryØ00__func__Ø000[0], str(110612), 12)
 92787  }
 92788  
 92789  // C comment
 92790  //  /*
 92791  //  ** If the inner loop was generated using a non-null pOrderBy argument,
 92792  //  ** then the results were placed in a sorter.  After the loop is terminated
 92793  //  ** we need to run the sorter and output the results.  The following
 92794  //  ** routine generates the code needed to do that.
 92795  //  */
 92796  func _generateSortTail(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pSort *XSortCtx, _nColumn int32, _pDest *XSelectDest) {
 92797  	var _addrBreak, _addrContinue, _addr, _addrOnce, _iTab, _eDest, _iParm, _regRow, _regRowid, _iCol, _nKey, _iSortTab, _nSortData, _i, _bSeq, _4_regSortOut, _7_iRead int32
 92798  	var _v *TVdbe
 92799  	var _pOrderBy *XExprList
 92800  	var _aOutEx *TExprList_item
 92801  	_v = (*TVdbe)(_pParse.XpVdbe)
 92802  	_addrBreak = _pSort.XlabelDone
 92803  	_addrContinue = _sqlite3VdbeMakeLabel(tls, _v)
 92804  	_addrOnce = int32(0)
 92805  	_pOrderBy = (*XExprList)(_pSort.XpOrderBy)
 92806  	_eDest = int32(_pDest.XeDest)
 92807  	_iParm = _pDest.XiSDParm
 92808  	_aOutEx = (*TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.XpEList).Xa)))
 92809  	func() {
 92810  		if _addrBreak >= int32(0) {
 92811  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117761), unsafe.Pointer(&_generateSortTailØ00__func__Ø000), unsafe.Pointer(str(110624)))
 92812  			crt.X__builtin_abort(tls)
 92813  		}
 92814  	}()
 92815  	if _pSort.XlabelBkOut != 0 {
 92816  		_sqlite3VdbeAddOp2(tls, _v, int32(14), _pSort.XregReturn, _pSort.XlabelBkOut)
 92817  		_sqlite3VdbeGoto(tls, _v, _addrBreak)
 92818  		_sqlite3VdbeResolveLabel(tls, _v, _pSort.XlabelBkOut)
 92819  	}
 92820  	_iTab = _pSort.XiECursor
 92821  	if ((_eDest == int32(9)) || (_eDest == int32(13))) || (_eDest == int32(10)) {
 92822  		_regRowid = int32(0)
 92823  		_regRow = _pDest.XiSdst
 92824  		_nSortData = _nColumn
 92825  		goto _6
 92826  	}
 92827  	_regRowid = _sqlite3GetTempReg(tls, _pParse)
 92828  	_regRow = _sqlite3GetTempRange(tls, _pParse, _nColumn)
 92829  	_nSortData = _nColumn
 92830  _6:
 92831  	_nKey = _pOrderBy.XnExpr - _pSort.XnOBSat
 92832  	if (int32(_pSort.XsortFlags) & int32(1)) == 0 {
 92833  		goto _7
 92834  	}
 92835  	_4_regSortOut = preInc2(&_pParse.XnMem, 1)
 92836  	_iSortTab = postInc2(&_pParse.XnTab, 1)
 92837  	if _pSort.XlabelBkOut != 0 {
 92838  		_addrOnce = _sqlite3VdbeAddOp0(tls, _v, int32(20))
 92839  	}
 92840  	_sqlite3VdbeAddOp3(tls, _v, int32(113), _iSortTab, _4_regSortOut, (_nKey+int32(1))+_nSortData)
 92841  	if _addrOnce != 0 {
 92842  		_sqlite3VdbeJumpHere(tls, _v, _addrOnce)
 92843  	}
 92844  	_addr = int32(1) + _sqlite3VdbeAddOp2(tls, _v, int32(35), _iTab, _addrBreak)
 92845  	_codeOffset(tls, _v, _p.XiOffset, _addrContinue)
 92846  	_sqlite3VdbeAddOp3(tls, _v, int32(123), _iTab, _4_regSortOut, _iSortTab)
 92847  	_bSeq = int32(0)
 92848  	goto _10
 92849  _7:
 92850  	_addr = int32(1) + _sqlite3VdbeAddOp2(tls, _v, int32(36), _iTab, _addrBreak)
 92851  	_codeOffset(tls, _v, _p.XiOffset, _addrContinue)
 92852  	_iSortTab = _iTab
 92853  	_bSeq = int32(1)
 92854  _10:
 92855  	*func() *int32 { _i = int32(0); return &_iCol }() = _nKey + _bSeq
 92856  _11:
 92857  	if _i >= _nSortData {
 92858  		goto _14
 92859  	}
 92860  	if ((*t71)(unsafe.Pointer(&(elem57(_aOutEx, uintptr(_i)).Xu))).XiOrderByCol) != 0 {
 92861  		_7_iRead = int32((*t71)(unsafe.Pointer(&(elem57(_aOutEx, uintptr(_i)).Xu))).XiOrderByCol) - int32(1)
 92862  		goto _16
 92863  	}
 92864  	_7_iRead = postInc2(&_iCol, 1)
 92865  _16:
 92866  	_sqlite3VdbeAddOp3(tls, _v, int32(99), _iSortTab, _7_iRead, _regRow+_i)
 92867  	_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(func() *int8 {
 92868  		if (elem57(_aOutEx, uintptr(_i)).XzName) != nil {
 92869  			return (elem57(_aOutEx, uintptr(_i)).XzName)
 92870  		}
 92871  		return (elem57(_aOutEx, uintptr(_i)).XzSpan)
 92872  	}()))
 92873  	_i += 1
 92874  	goto _11
 92875  _14:
 92876  	switch _eDest {
 92877  	case int32(10):
 92878  		goto _23
 92879  	case int32(11):
 92880  		goto _22
 92881  	case int32(12):
 92882  		goto _20
 92883  	case int32(14):
 92884  		goto _20
 92885  	default:
 92886  		goto _24
 92887  	}
 92888  
 92889  _20:
 92890  	_sqlite3VdbeAddOp2(tls, _v, int32(117), _iParm, _regRowid)
 92891  	_sqlite3VdbeAddOp3(tls, _v, int32(118), _iParm, _regRow, _regRowid)
 92892  	_sqlite3VdbeChangeP5(tls, _v, uint16(8))
 92893  	goto _25
 92894  _22:
 92895  	func() {
 92896  		if _nColumn != _sqlite3Strlen30(tls, _pDest.XzAffSdst) {
 92897  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117817), unsafe.Pointer(&_generateSortTailØ00__func__Ø000), unsafe.Pointer(str(110636)))
 92898  			crt.X__builtin_abort(tls)
 92899  		}
 92900  	}()
 92901  	_sqlite3VdbeAddOp4(tls, _v, int32(101), _regRow, _nColumn, _regRowid, _pDest.XzAffSdst, _nColumn)
 92902  	_sqlite3ExprCacheAffinityChange(tls, _pParse, _regRow, _nColumn)
 92903  	_sqlite3VdbeAddOp4Int(tls, _v, int32(128), _iParm, _regRowid, _regRow, _nColumn)
 92904  	goto _25
 92905  _23:
 92906  	goto _25
 92907  _24:
 92908  	func() {
 92909  		if _eDest != int32(9) && _eDest != int32(13) {
 92910  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(117830), unsafe.Pointer(&_generateSortTailØ00__func__Ø000), unsafe.Pointer(str(110678)))
 92911  			crt.X__builtin_abort(tls)
 92912  		}
 92913  	}()
 92914  	if _eDest == int32(9) {
 92915  		_sqlite3VdbeAddOp2(tls, _v, int32(67), _pDest.XiSdst, _nColumn)
 92916  		_sqlite3ExprCacheAffinityChange(tls, _pParse, _pDest.XiSdst, _nColumn)
 92917  		goto _32
 92918  	}
 92919  	_sqlite3VdbeAddOp1(tls, _v, int32(16), _pDest.XiSDParm)
 92920  _32:
 92921  	goto _25
 92922  _25:
 92923  	if _regRowid == 0 {
 92924  		goto _33
 92925  	}
 92926  	if _eDest == int32(11) {
 92927  		_sqlite3ReleaseTempRange(tls, _pParse, _regRow, _nColumn)
 92928  		goto _35
 92929  	}
 92930  	_sqlite3ReleaseTempReg(tls, _pParse, _regRow)
 92931  _35:
 92932  	_sqlite3ReleaseTempReg(tls, _pParse, _regRowid)
 92933  _33:
 92934  	_sqlite3VdbeResolveLabel(tls, _v, _addrContinue)
 92935  	if (int32(_pSort.XsortFlags) & int32(1)) != 0 {
 92936  		_sqlite3VdbeAddOp2(tls, _v, int32(3), _iTab, _addr)
 92937  		goto _37
 92938  	}
 92939  	_sqlite3VdbeAddOp2(tls, _v, int32(7), _iTab, _addr)
 92940  _37:
 92941  	if _pSort.XregReturn != 0 {
 92942  		_sqlite3VdbeAddOp1(tls, _v, int32(52), _pSort.XregReturn)
 92943  	}
 92944  	_sqlite3VdbeResolveLabel(tls, _v, _addrBreak)
 92945  	_ = _iCol
 92946  }
 92947  
 92948  var _generateSortTailØ00__func__Ø000 [17]int8
 92949  
 92950  func init() {
 92951  	crt.Xstrncpy(nil, &_generateSortTailØ00__func__Ø000[0], str(110720), 17)
 92952  }
 92953  
 92954  // C comment
 92955  //  /*
 92956  //  ** Argument pVector points to a vector expression - either a TK_VECTOR
 92957  //  ** or TK_SELECT that returns more than one column. This function returns
 92958  //  ** the register number of a register that contains the value of
 92959  //  ** element iField of the vector.
 92960  //  **
 92961  //  ** If pVector is a TK_SELECT expression, then code for it must have
 92962  //  ** already been generated using the exprCodeSubselect() routine. In this
 92963  //  ** case parameter regSelect should be the first in an array of registers
 92964  //  ** containing the results of the sub-select.
 92965  //  **
 92966  //  ** If pVector is of type TK_VECTOR, then code for the requested field
 92967  //  ** is generated. In this case (*pRegFree) may be set to the number of
 92968  //  ** a temporary register to be freed by the caller before returning.
 92969  //  **
 92970  //  ** Before returning, output parameter (*ppExpr) is set to point to the
 92971  //  ** Expr object corresponding to element iElem of the vector.
 92972  //  */
 92973  func _exprVectorRegister(tls *crt.TLS, _pParse *XParse, _pVector *XExpr, _iField int32, _regSelect int32, _ppExpr **XExpr, _pRegFree *int32) (r0 int32) {
 92974  	var _op uint8
 92975  	_op = _pVector.Xop
 92976  	func() {
 92977  		if int32(_op) != int32(158) && int32(_op) != int32(157) && int32(_op) != int32(119) {
 92978  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91384), unsafe.Pointer(&_exprVectorRegisterØ00__func__Ø000), unsafe.Pointer(str(110737)))
 92979  			crt.X__builtin_abort(tls)
 92980  		}
 92981  	}()
 92982  	if int32(_op) == int32(157) {
 92983  		*_ppExpr = _sqlite3VectorFieldSubexpr(tls, _pVector, _iField)
 92984  		return _pVector.XiTable + _iField
 92985  	}
 92986  	if int32(_op) == int32(119) {
 92987  		*_ppExpr = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pVector.Xx))).XpEList).Xa))), uintptr(_iField)).XpExpr)
 92988  		return _regSelect + _iField
 92989  	}
 92990  	*_ppExpr = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pVector.Xx))).Xa))), uintptr(_iField)).XpExpr)
 92991  	return _sqlite3ExprCodeTemp(tls, _pParse, *_ppExpr, _pRegFree)
 92992  }
 92993  
 92994  var _exprVectorRegisterØ00__func__Ø000 [19]int8
 92995  
 92996  func init() {
 92997  	crt.Xstrncpy(nil, &_exprVectorRegisterØ00__func__Ø000[0], str(110787), 19)
 92998  }
 92999  
 93000  // C comment
 93001  //  /*
 93002  //  ** The first parameter (pDef) is a function implementation.  The
 93003  //  ** second parameter (pExpr) is the first argument to this function.
 93004  //  ** If pExpr is a column in a virtual table, then let the virtual
 93005  //  ** table implementation have an opportunity to overload the function.
 93006  //  **
 93007  //  ** This routine is used to allow virtual table implementations to
 93008  //  ** overload MATCH, LIKE, GLOB, and REGEXP operators.
 93009  //  **
 93010  //  ** Return either the pDef argument (indicating no change) or a
 93011  //  ** new FuncDef structure that is marked as ephemeral using the
 93012  //  ** SQLITE_FUNC_EPHEM flag.
 93013  //  */
 93014  func _sqlite3VtabOverloadFunction(tls *crt.TLS, _db *Xsqlite3, _pDef *XFuncDef, _nArg int32, _pExpr *XExpr) (r0 *XFuncDef) {
 93015  	var _rc int32
 93016  	var _zLowerName *int8
 93017  	var _pArg unsafe.Pointer
 93018  	var _z *uint8
 93019  	var _pTab *XTable
 93020  	var _xSFunc func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
 93021  	var _pNew *XFuncDef
 93022  	var _pVtab *Xsqlite3_vtab
 93023  	var _pMod *Xsqlite3_module
 93024  	_xSFunc = nil
 93025  	_pArg = nil
 93026  	_rc = int32(0)
 93027  	if func() int32 {
 93028  		if _pExpr == nil {
 93029  			return func() int32 {
 93030  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(126040), unsafe.Pointer(&_sqlite3VtabOverloadFunctionØ00__func__Ø000), unsafe.Pointer(str(4809)))
 93031  				crt.X__builtin_abort(tls)
 93032  				return int32(1)
 93033  			}()
 93034  		}
 93035  		return int32(0)
 93036  	}() != 0 {
 93037  		return _pDef
 93038  	}
 93039  	if int32(_pExpr.Xop) != int32(152) {
 93040  		return _pDef
 93041  	}
 93042  	_pTab = (*XTable)(_pExpr.XpTab)
 93043  	if _pTab == nil {
 93044  		return _pDef
 93045  	}
 93046  	if _pTab.XnModuleArg == 0 {
 93047  		return _pDef
 93048  	}
 93049  	_pVtab = (*Xsqlite3_vtab)(_sqlite3GetVTable(tls, _db, _pTab).XpVtab)
 93050  	func() {
 93051  		if _pVtab == nil {
 93052  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(126046), unsafe.Pointer(&_sqlite3VtabOverloadFunctionØ00__func__Ø000), unsafe.Pointer(str(110806)))
 93053  			crt.X__builtin_abort(tls)
 93054  		}
 93055  	}()
 93056  	func() {
 93057  		if (*Xsqlite3_module)(_pVtab.XpModule) == nil {
 93058  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(126047), unsafe.Pointer(&_sqlite3VtabOverloadFunctionØ00__func__Ø000), unsafe.Pointer(str(110815)))
 93059  			crt.X__builtin_abort(tls)
 93060  		}
 93061  	}()
 93062  	_pMod = (*Xsqlite3_module)(_pVtab.XpModule)
 93063  	if func() func(*crt.TLS, *Xsqlite3_vtab, int32, *int8, *func(*crt.TLS, *Xsqlite3_context, int32, **XMem), *unsafe.Pointer) int32 {
 93064  		v := _pMod.XxFindFunction
 93065  		return *(*func(*crt.TLS, *Xsqlite3_vtab, int32, *int8, *func(*crt.TLS, *Xsqlite3_context, int32, **XMem), *unsafe.Pointer) int32)(unsafe.Pointer(&v))
 93066  	}() == nil {
 93067  		return _pDef
 93068  	}
 93069  	_zLowerName = _sqlite3DbStrDup(tls, _db, _pDef.XzName)
 93070  	if _zLowerName == nil {
 93071  		goto _11
 93072  	}
 93073  	_z = (*uint8)(unsafe.Pointer(_zLowerName))
 93074  _12:
 93075  	if (*_z) == 0 {
 93076  		goto _15
 93077  	}
 93078  	*_z = *elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(*_z))
 93079  	*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
 93080  	goto _12
 93081  _15:
 93082  	_rc = func() func(*crt.TLS, *Xsqlite3_vtab, int32, *int8, *func(*crt.TLS, *Xsqlite3_context, int32, **XMem), *unsafe.Pointer) int32 {
 93083  		v := _pMod.XxFindFunction
 93084  		return *(*func(*crt.TLS, *Xsqlite3_vtab, int32, *int8, *func(*crt.TLS, *Xsqlite3_context, int32, **XMem), *unsafe.Pointer) int32)(unsafe.Pointer(&v))
 93085  	}()(tls, _pVtab, _nArg, _zLowerName, &_xSFunc, &_pArg)
 93086  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zLowerName))
 93087  _11:
 93088  	if _rc == int32(0) {
 93089  		return _pDef
 93090  	}
 93091  	_pNew = (*XFuncDef)(_sqlite3DbMallocZero(tls, _db, uint64((uint32(28)+uint32(_sqlite3Strlen30(tls, _pDef.XzName)))+uint32(1))))
 93092  	if _pNew == nil {
 93093  		return _pDef
 93094  	}
 93095  	*_pNew = *_pDef
 93096  	_pNew.XzName = (*int8)(unsafe.Pointer(elem17(_pNew, uintptr(1))))
 93097  	crt.Xmemcpy(tls, unsafe.Pointer(elem17(_pNew, uintptr(1))), unsafe.Pointer(_pDef.XzName), uint32(_sqlite3Strlen30(tls, _pDef.XzName)+int32(1)))
 93098  	*(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer(&_pNew.XxSFunc)) = _xSFunc
 93099  	_pNew.XpUserData = _pArg
 93100  	{
 93101  		p := &_pNew.XfuncFlags
 93102  		*p = uint16(int32(*p) | int32(16))
 93103  	}
 93104  	return _pNew
 93105  }
 93106  
 93107  var _sqlite3VtabOverloadFunctionØ00__func__Ø000 [28]int8
 93108  
 93109  func init() {
 93110  	crt.Xstrncpy(nil, &_sqlite3VtabOverloadFunctionØ00__func__Ø000[0], str(110833), 28)
 93111  }
 93112  
 93113  // C comment
 93114  //  /*
 93115  //  ** The code generator calls this routine if is discovers that it is
 93116  //  ** possible to abort a statement prior to completion.  In order to
 93117  //  ** perform this abort without corrupting the database, we need to make
 93118  //  ** sure that the statement is protected by a statement transaction.
 93119  //  **
 93120  //  ** Technically, we only need to set the mayAbort flag if the
 93121  //  ** isMultiWrite flag was previously set.  There is a time dependency
 93122  //  ** such that the abort must occur after the multiwrite.  This makes
 93123  //  ** some statements involving the REPLACE conflict resolution algorithm
 93124  //  ** go a little faster.  But taking advantage of this time dependency
 93125  //  ** makes it more difficult to prove that the code is correct (in
 93126  //  ** particular, it prevents us from writing an effective
 93127  //  ** implementation of sqlite3AssertMayAbort()) and so we have chosen
 93128  //  ** to take the safe route and skip the optimization.
 93129  //  */
 93130  func _sqlite3MayAbort(tls *crt.TLS, _pParse *XParse) {
 93131  	var _pToplevel *XParse
 93132  	_pToplevel = func() *XParse {
 93133  		if _pParse.XpToplevel != nil {
 93134  			return (*XParse)(_pParse.XpToplevel)
 93135  		}
 93136  		return _pParse
 93137  	}()
 93138  	_pToplevel.XmayAbort = uint8(1)
 93139  }
 93140  
 93141  // C comment
 93142  //  /*
 93143  //  ** Code an OP_Halt that causes the vdbe to return an SQLITE_CONSTRAINT
 93144  //  ** error. The onError parameter determines which (if any) of the statement
 93145  //  ** and/or current transaction is rolled back.
 93146  //  */
 93147  func _sqlite3HaltConstraint(tls *crt.TLS, _pParse *XParse, _errCode int32, _onError int32, _p4 *int8, _p4type int8, _p5Errmsg uint8) {
 93148  	var _v *TVdbe
 93149  	_v = _sqlite3GetVdbe(tls, _pParse)
 93150  	func() {
 93151  		if (_errCode & int32(255)) != int32(19) {
 93152  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103850), unsafe.Pointer(&_sqlite3HaltConstraintØ00__func__Ø000), unsafe.Pointer(str(110861)))
 93153  			crt.X__builtin_abort(tls)
 93154  		}
 93155  	}()
 93156  	if _onError == int32(2) {
 93157  		_sqlite3MayAbort(tls, _pParse)
 93158  	}
 93159  	_sqlite3VdbeAddOp4(tls, _v, int32(55), _errCode, _onError, int32(0), _p4, int32(_p4type))
 93160  	_sqlite3VdbeChangeP5(tls, _v, uint16(_p5Errmsg))
 93161  }
 93162  
 93163  var _sqlite3HaltConstraintØ00__func__Ø000 [22]int8
 93164  
 93165  func init() {
 93166  	crt.Xstrncpy(nil, &_sqlite3HaltConstraintØ00__func__Ø000[0], str(110895), 22)
 93167  }
 93168  
 93169  // C comment
 93170  //  /*
 93171  //  ** Prepare a virtual machine for execution for the first time after
 93172  //  ** creating the virtual machine.  This involves things such
 93173  //  ** as allocating registers and initializing the program counter.
 93174  //  ** After the VDBE has be prepped, it can be executed by one or more
 93175  //  ** calls to sqlite3VdbeExec().
 93176  //  **
 93177  //  ** This function may be called exactly once on each virtual machine.
 93178  //  ** After this routine is called the VM has been "packaged" and is ready
 93179  //  ** to run.  After this routine is called, further calls to
 93180  //  ** sqlite3VdbeAddOp() functions are prohibited.  This routine disconnects
 93181  //  ** the Vdbe from the Parse object that helped generate it so that the
 93182  //  ** the Vdbe becomes an independent entity and the Parse object can be
 93183  //  ** destroyed.
 93184  //  **
 93185  //  ** Use the sqlite3VdbeRewind() procedure to restore a virtual machine back
 93186  //  ** to its initial state after it has been run.
 93187  //  */
 93188  func _sqlite3VdbeMakeReady(tls *crt.TLS, _p *TVdbe, _pParse *XParse) {
 93189  	var _nVar, _nMem, _nCursor, _nArg, _n int32
 93190  	var _db *Xsqlite3
 93191  	var _x TReusableSpace
 93192  	func() {
 93193  		if _p == nil {
 93194  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73360), unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000), unsafe.Pointer(str(807)))
 93195  			crt.X__builtin_abort(tls)
 93196  		}
 93197  	}()
 93198  	func() {
 93199  		if _p.XnOp <= int32(0) {
 93200  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73361), unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000), unsafe.Pointer(str(41671)))
 93201  			crt.X__builtin_abort(tls)
 93202  		}
 93203  	}()
 93204  	func() {
 93205  		if _pParse == nil {
 93206  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73362), unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000), unsafe.Pointer(str(110917)))
 93207  			crt.X__builtin_abort(tls)
 93208  		}
 93209  	}()
 93210  	func() {
 93211  		if _p.Xmagic != uint32(381479589) {
 93212  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73363), unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000), unsafe.Pointer(str(37597)))
 93213  			crt.X__builtin_abort(tls)
 93214  		}
 93215  	}()
 93216  	func() {
 93217  		if _pParse != (*XParse)(_p.XpParse) {
 93218  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73364), unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000), unsafe.Pointer(str(110927)))
 93219  			crt.X__builtin_abort(tls)
 93220  		}
 93221  	}()
 93222  	_db = (*Xsqlite3)(_p.Xdb)
 93223  	func() {
 93224  		if int32(_db.XmallocFailed) != int32(0) {
 93225  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73366), unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000), unsafe.Pointer(str(1262)))
 93226  			crt.X__builtin_abort(tls)
 93227  		}
 93228  	}()
 93229  	_nVar = int32(_pParse.XnVar)
 93230  	_nMem = _pParse.XnMem
 93231  	_nCursor = _pParse.XnTab
 93232  	_nArg = _pParse.XnMaxArg
 93233  	_nMem += _nCursor
 93234  	if (_nCursor == int32(0)) && (_nMem > int32(0)) {
 93235  		_nMem += 1
 93236  	}
 93237  	_n = int32(((uint32(24) * uint32(_p.XnOp)) + uint32(7)) & uint32(4294967288))
 93238  	_x.XpSpace = elem15((*uint8)(unsafe.Pointer((*XVdbeOp)(_p.XaOp))), uintptr(_n))
 93239  	func() {
 93240  		if (int32(uintptr(unsafe.Pointer(_x.XpSpace))) & int32(7)) != int32(0) {
 93241  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73386), unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000), unsafe.Pointer(str(110945)))
 93242  			crt.X__builtin_abort(tls)
 93243  		}
 93244  	}()
 93245  	_x.XnFree = (_pParse.XszOpAlloc - _n) & int32(-8)
 93246  	func() {
 93247  		if _x.XnFree < int32(0) {
 93248  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73388), unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000), unsafe.Pointer(str(110976)))
 93249  			crt.X__builtin_abort(tls)
 93250  		}
 93251  	}()
 93252  	func() {
 93253  		if (int32(uintptr(unsafe.Pointer(elem15(_x.XpSpace, uintptr(_x.XnFree))))) & int32(7)) != int32(0) {
 93254  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73389), unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000), unsafe.Pointer(str(110987)))
 93255  			crt.X__builtin_abort(tls)
 93256  		}
 93257  	}()
 93258  	_resolveP2Values(tls, _p, &_nArg)
 93259  	storebits26(&_p.Xexpired, int16(uint8(bool2int((_pParse.XisMultiWrite != 0) && (_pParse.XmayAbort != 0)))), 64, 6)
 93260  	if (_pParse.Xexplain != 0) && (_nMem < int32(10)) {
 93261  		_nMem = int32(10)
 93262  	}
 93263  	storebits26(&_p.Xexpired, 0, 1, 0)
 93264  _23:
 93265  	_x.XnNeeded = int32(0)
 93266  	*(**XMem)(unsafe.Pointer(&_p.XaMem)) = (*XMem)(_allocSpace(tls, &_x, _p.XaMem, int32(uint32(_nMem)*uint32(48))))
 93267  	*(**XMem)(unsafe.Pointer(&_p.XaVar)) = (*XMem)(_allocSpace(tls, &_x, _p.XaVar, int32(uint32(_nVar)*uint32(48))))
 93268  	*(***XMem)(unsafe.Pointer(&_p.XapArg)) = (**XMem)(_allocSpace(tls, &_x, unsafe.Pointer(_p.XapArg), int32(uint32(_nArg)*uint32(4))))
 93269  	*(***XVdbeCursor)(unsafe.Pointer(&_p.XapCsr)) = (**XVdbeCursor)(_allocSpace(tls, &_x, unsafe.Pointer(_p.XapCsr), int32(uint32(_nCursor)*uint32(4))))
 93270  	if _x.XnNeeded == int32(0) {
 93271  		goto _25
 93272  	}
 93273  	_x.XpSpace = (*uint8)(store16(&_p.XpFree, _sqlite3DbMallocRawNN(tls, _db, uint64(_x.XnNeeded))))
 93274  	_x.XnFree = _x.XnNeeded
 93275  	if _db.XmallocFailed == 0 {
 93276  		goto _23
 93277  	}
 93278  _25:
 93279  	_p.XpVList = _pParse.XpVList
 93280  	_pParse.XpVList = nil
 93281  	storebits26(&_p.Xexpired, int16(_pParse.Xexplain), 12, 2)
 93282  	if _db.XmallocFailed != 0 {
 93283  		_p.XnVar = 0
 93284  		_p.XnCursor = int32(0)
 93285  		_p.XnMem = int32(0)
 93286  		goto _27
 93287  	}
 93288  	_p.XnCursor = _nCursor
 93289  	_p.XnVar = int16(_nVar)
 93290  	_initMemArray(tls, (*XMem)(_p.XaVar), _nVar, _db, uint16(1))
 93291  	_p.XnMem = _nMem
 93292  	_initMemArray(tls, (*XMem)(_p.XaMem), _nMem, _db, uint16(128))
 93293  	crt.Xmemset(tls, unsafe.Pointer(_p.XapCsr), int32(0), uint32(_nCursor)*uint32(4))
 93294  _27:
 93295  	_sqlite3VdbeRewind(tls, _p)
 93296  }
 93297  
 93298  var _sqlite3VdbeMakeReadyØ00__func__Ø000 [21]int8
 93299  
 93300  func init() {
 93301  	crt.Xstrncpy(nil, &_sqlite3VdbeMakeReadyØ00__func__Ø000[0], str(111028), 21)
 93302  }
 93303  
 93304  // C comment
 93305  //  /*
 93306  //  ** This routine is called after all opcodes have been inserted.  It loops
 93307  //  ** through all the opcodes and fixes up some details.
 93308  //  **
 93309  //  ** (1) For each jump instruction with a negative P2 value (a label)
 93310  //  **     resolve the P2 value to an actual address.
 93311  //  **
 93312  //  ** (2) Compute the maximum number of arguments used by any SQL function
 93313  //  **     and store that value in *pMaxFuncArgs.
 93314  //  **
 93315  //  ** (3) Update the Vdbe.readOnly and Vdbe.bIsReader flags to accurately
 93316  //  **     indicate what the prepared statement actually does.
 93317  //  **
 93318  //  ** (4) Initialize the p4.xAdvance pointer on opcodes that use it.
 93319  //  **
 93320  //  ** (5) Reclaim the memory allocated for storing labels.
 93321  //  **
 93322  //  ** This routine will only function correctly if the mkopcodeh.tcl generator
 93323  //  ** script numbers the opcodes correctly.  Changes to this routine must be
 93324  //  ** coordinated with changes to mkopcodeh.tcl.
 93325  //  */
 93326  func _resolveP2Values(tls *crt.TLS, _p *TVdbe, _pMaxFuncArgs *int32) {
 93327  	var _nMaxArgs, _8_n int32
 93328  	var _aLabel *int32
 93329  	var _pParse *XParse
 93330  	var _pOp *XVdbeOp
 93331  	_nMaxArgs = *_pMaxFuncArgs
 93332  	_pParse = (*XParse)(_p.XpParse)
 93333  	_aLabel = _pParse.XaLabel
 93334  	storebits26(&_p.Xexpired, int16(1), 128, 7)
 93335  	storebits26(&_p.Xexpired, 0, 256, 8)
 93336  	_pOp = elem61((*XVdbeOp)(_p.XaOp), uintptr(_p.XnOp-int32(1)))
 93337  _0:
 93338  	if int32(_pOp.Xopcode) > int32(83) {
 93339  		goto _2
 93340  	}
 93341  	switch int32(_pOp.Xopcode) {
 93342  	case int32(0):
 93343  		goto _5
 93344  	case int32(1):
 93345  		goto _5
 93346  	case int32(2):
 93347  		goto _4
 93348  	case int32(3):
 93349  		goto _12
 93350  	case int32(4):
 93351  		goto _15
 93352  	case int32(5):
 93353  		goto _12
 93354  	case int32(6):
 93355  		goto _15
 93356  	case int32(7):
 93357  		goto _12
 93358  	case int32(8):
 93359  		goto _7
 93360  	case int32(9):
 93361  		goto _7
 93362  	case int32(10):
 93363  		goto _7
 93364  	case int32(11):
 93365  		goto _11
 93366  	case int32(12):
 93367  		goto _10
 93368  	default:
 93369  		goto _17
 93370  	}
 93371  
 93372  _4:
 93373  	if _pOp.Xp2 != int32(0) {
 93374  		storebits26(&_p.Xexpired, 0, 128, 7)
 93375  	}
 93376  _5:
 93377  	storebits26(&_p.Xexpired, int16(1), 256, 8)
 93378  	goto _17
 93379  _7:
 93380  	storebits26(&_p.Xexpired, 0, 128, 7)
 93381  	storebits26(&_p.Xexpired, int16(1), 256, 8)
 93382  	goto _17
 93383  _10:
 93384  	if _pOp.Xp2 > _nMaxArgs {
 93385  		_nMaxArgs = _pOp.Xp2
 93386  	}
 93387  	goto _17
 93388  _11:
 93389  	func() {
 93390  		if int32((uintptr(unsafe.Pointer(_pOp))-uintptr(_p.XaOp))/24) < int32(3) {
 93391  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72021), unsafe.Pointer(&_resolveP2ValuesØ00__func__Ø000), unsafe.Pointer(str(111049)))
 93392  			crt.X__builtin_abort(tls)
 93393  		}
 93394  	}()
 93395  	func() {
 93396  		if int32(elem61(_pOp, uintptr(4294967295)).Xopcode) != int32(56) {
 93397  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72022), unsafe.Pointer(&_resolveP2ValuesØ00__func__Ø000), unsafe.Pointer(str(111069)))
 93398  			crt.X__builtin_abort(tls)
 93399  		}
 93400  	}()
 93401  	_8_n = elem61(_pOp, uintptr(4294967295)).Xp1
 93402  	if _8_n > _nMaxArgs {
 93403  		_nMaxArgs = _8_n
 93404  	}
 93405  	goto _17
 93406  _12:
 93407  	*(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer(&_pOp.Xp4)))) = _sqlite3BtreeNext
 93408  	_pOp.Xp4type = int8(-14)
 93409  	goto _17
 93410  _15:
 93411  	*(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer(&_pOp.Xp4)))) = _sqlite3BtreePrevious
 93412  	_pOp.Xp4type = int8(-14)
 93413  	goto _17
 93414  _17:
 93415  	if ((int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3OpcodeProperty)), uintptr(_pOp.Xopcode))) & int32(1)) != int32(0)) && (_pOp.Xp2 < int32(0)) {
 93416  		func() {
 93417  			if (int32(-1) - _pOp.Xp2) >= _pParse.XnLabel {
 93418  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72043), unsafe.Pointer(&_resolveP2ValuesØ00__func__Ø000), unsafe.Pointer(str(111096)))
 93419  				crt.X__builtin_abort(tls)
 93420  			}
 93421  		}()
 93422  		_pOp.Xp2 = *elem8(_aLabel, uintptr(int32(-1)-_pOp.Xp2))
 93423  	}
 93424  _2:
 93425  	if _pOp == (*XVdbeOp)(_p.XaOp) {
 93426  		goto _1
 93427  	}
 93428  	*(*uintptr)(unsafe.Pointer(&_pOp)) += uintptr(4294967272)
 93429  	goto _0
 93430  _1:
 93431  	_sqlite3DbFree(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(_pParse.XaLabel))
 93432  	_pParse.XaLabel = nil
 93433  	_pParse.XnLabel = int32(0)
 93434  	*_pMaxFuncArgs = _nMaxArgs
 93435  	func() {
 93436  		if int32((uint32(_p.Xexpired>>8)<<31)>>31) == int32(0) && _p.XbtreeMask != (0) {
 93437  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72054), unsafe.Pointer(&_resolveP2ValuesØ00__func__Ø000), unsafe.Pointer(str(111125)))
 93438  			crt.X__builtin_abort(tls)
 93439  		}
 93440  	}()
 93441  }
 93442  
 93443  var _resolveP2ValuesØ00__func__Ø000 [16]int8
 93444  
 93445  func init() {
 93446  	crt.Xstrncpy(nil, &_resolveP2ValuesØ00__func__Ø000[0], str(111172), 16)
 93447  }
 93448  
 93449  // C comment
 93450  //  /* Try to allocate nByte bytes of 8-byte aligned bulk memory for pBuf
 93451  //  ** from the ReusableSpace object.  Return a pointer to the allocated
 93452  //  ** memory on success.  If insufficient memory is available in the
 93453  //  ** ReusableSpace object, increase the ReusableSpace.nNeeded
 93454  //  ** value by the amount needed and return NULL.
 93455  //  **
 93456  //  ** If pBuf is not initially NULL, that means that the memory has already
 93457  //  ** been allocated by a prior call to this routine, so just return a copy
 93458  //  ** of pBuf and leave ReusableSpace unchanged.
 93459  //  **
 93460  //  ** This allocator is employed to repurpose unused slots at the end of the
 93461  //  ** opcode array of prepared state for other memory needs of the prepared
 93462  //  ** statement.
 93463  //  */
 93464  func _allocSpace(tls *crt.TLS, _p *TReusableSpace, _pBuf unsafe.Pointer, _nByte int32) (r0 unsafe.Pointer) {
 93465  	func() {
 93466  		if (int32(uintptr(unsafe.Pointer(_p.XpSpace))) & int32(7)) != int32(0) {
 93467  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73277), unsafe.Pointer(&_allocSpaceØ00__func__Ø000), unsafe.Pointer(str(111188)))
 93468  			crt.X__builtin_abort(tls)
 93469  		}
 93470  	}()
 93471  	if _pBuf != nil {
 93472  		goto _2
 93473  	}
 93474  	_nByte = (_nByte + int32(7)) & int32(-8)
 93475  	if _nByte <= _p.XnFree {
 93476  		_p.XnFree -= _nByte
 93477  		_pBuf = unsafe.Pointer(elem15(_p.XpSpace, uintptr(_p.XnFree)))
 93478  		goto _4
 93479  	}
 93480  	_p.XnNeeded += _nByte
 93481  _4:
 93482  _2:
 93483  	func() {
 93484  		if (int32(uintptr(_pBuf)) & int32(7)) != int32(0) {
 93485  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(73287), unsafe.Pointer(&_allocSpaceØ00__func__Ø000), unsafe.Pointer(str(111220)))
 93486  			crt.X__builtin_abort(tls)
 93487  		}
 93488  	}()
 93489  	return _pBuf
 93490  }
 93491  
 93492  var _allocSpaceØ00__func__Ø000 [11]int8
 93493  
 93494  func init() {
 93495  	crt.Xstrncpy(nil, &_allocSpaceØ00__func__Ø000[0], str(111247), 11)
 93496  }
 93497  
 93498  // C comment
 93499  //  /*
 93500  //  ** Generate VDBE code for a BEGIN statement.
 93501  //  */
 93502  func _sqlite3BeginTransaction(tls *crt.TLS, _pParse *XParse, _type int32) {
 93503  	var _i int32
 93504  	var _db *Xsqlite3
 93505  	var _v *TVdbe
 93506  	func() {
 93507  		if _pParse == nil {
 93508  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103643), unsafe.Pointer(&_sqlite3BeginTransactionØ00__func__Ø000), unsafe.Pointer(str(110917)))
 93509  			crt.X__builtin_abort(tls)
 93510  		}
 93511  	}()
 93512  	_db = (*Xsqlite3)(_pParse.Xdb)
 93513  	func() {
 93514  		if _db == nil {
 93515  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103645), unsafe.Pointer(&_sqlite3BeginTransactionØ00__func__Ø000), unsafe.Pointer(str(1219)))
 93516  			crt.X__builtin_abort(tls)
 93517  		}
 93518  	}()
 93519  	if _sqlite3AuthCheck(tls, _pParse, int32(22), str(24938), nil, nil) != 0 {
 93520  		return
 93521  	}
 93522  	_v = _sqlite3GetVdbe(tls, _pParse)
 93523  	if _v == nil {
 93524  		return
 93525  	}
 93526  	if _type == int32(7) {
 93527  		goto _6
 93528  	}
 93529  	_i = int32(0)
 93530  _7:
 93531  	if _i >= _db.XnDb {
 93532  		goto _10
 93533  	}
 93534  	_sqlite3VdbeAddOp2(tls, _v, int32(2), _i, bool2int(_type == int32(9))+int32(1))
 93535  	_sqlite3VdbeUsesBtree(tls, _v, _i)
 93536  	_i += 1
 93537  	goto _7
 93538  _10:
 93539  _6:
 93540  	_sqlite3VdbeAddOp0(tls, _v, int32(1))
 93541  }
 93542  
 93543  var _sqlite3BeginTransactionØ00__func__Ø000 [24]int8
 93544  
 93545  func init() {
 93546  	crt.Xstrncpy(nil, &_sqlite3BeginTransactionØ00__func__Ø000[0], str(111258), 24)
 93547  }
 93548  
 93549  // C comment
 93550  //  /*
 93551  //  ** Generate VDBE code for a COMMIT statement.
 93552  //  */
 93553  func _sqlite3CommitTransaction(tls *crt.TLS, _pParse *XParse) {
 93554  	var _v *TVdbe
 93555  	func() {
 93556  		if _pParse == nil {
 93557  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103666), unsafe.Pointer(&_sqlite3CommitTransactionØ00__func__Ø000), unsafe.Pointer(str(110917)))
 93558  			crt.X__builtin_abort(tls)
 93559  		}
 93560  	}()
 93561  	func() {
 93562  		if (*Xsqlite3)(_pParse.Xdb) == nil {
 93563  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103667), unsafe.Pointer(&_sqlite3CommitTransactionØ00__func__Ø000), unsafe.Pointer(str(111282)))
 93564  			crt.X__builtin_abort(tls)
 93565  		}
 93566  	}()
 93567  	if _sqlite3AuthCheck(tls, _pParse, int32(22), str(24985), nil, nil) != 0 {
 93568  		return
 93569  	}
 93570  	_v = _sqlite3GetVdbe(tls, _pParse)
 93571  	if _v != nil {
 93572  		_sqlite3VdbeAddOp1(tls, _v, int32(1), int32(1))
 93573  	}
 93574  }
 93575  
 93576  var _sqlite3CommitTransactionØ00__func__Ø000 [25]int8
 93577  
 93578  func init() {
 93579  	crt.Xstrncpy(nil, &_sqlite3CommitTransactionØ00__func__Ø000[0], str(111296), 25)
 93580  }
 93581  
 93582  // C comment
 93583  //  /*
 93584  //  ** Generate VDBE code for a ROLLBACK statement.
 93585  //  */
 93586  func _sqlite3RollbackTransaction(tls *crt.TLS, _pParse *XParse) {
 93587  	var _v *TVdbe
 93588  	func() {
 93589  		if _pParse == nil {
 93590  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103683), unsafe.Pointer(&_sqlite3RollbackTransactionØ00__func__Ø000), unsafe.Pointer(str(110917)))
 93591  			crt.X__builtin_abort(tls)
 93592  		}
 93593  	}()
 93594  	func() {
 93595  		if (*Xsqlite3)(_pParse.Xdb) == nil {
 93596  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103684), unsafe.Pointer(&_sqlite3RollbackTransactionØ00__func__Ø000), unsafe.Pointer(str(111282)))
 93597  			crt.X__builtin_abort(tls)
 93598  		}
 93599  	}()
 93600  	if _sqlite3AuthCheck(tls, _pParse, int32(22), str(24996), nil, nil) != 0 {
 93601  		return
 93602  	}
 93603  	_v = _sqlite3GetVdbe(tls, _pParse)
 93604  	if _v != nil {
 93605  		_sqlite3VdbeAddOp2(tls, _v, int32(1), int32(1), int32(1))
 93606  	}
 93607  }
 93608  
 93609  var _sqlite3RollbackTransactionØ00__func__Ø000 [27]int8
 93610  
 93611  func init() {
 93612  	crt.Xstrncpy(nil, &_sqlite3RollbackTransactionØ00__func__Ø000[0], str(111321), 27)
 93613  }
 93614  
 93615  // C comment
 93616  //  /*
 93617  //  ** This function is called by the parser when it parses a command to create,
 93618  //  ** release or rollback an SQL savepoint.
 93619  //  */
 93620  func _sqlite3Savepoint(tls *crt.TLS, _pParse *XParse, _op int32, _pName *XToken) {
 93621  	var _zName *int8
 93622  	var _1_v *TVdbe
 93623  	_zName = _sqlite3NameFromToken(tls, (*Xsqlite3)(_pParse.Xdb), _pName)
 93624  	if _zName == nil {
 93625  		goto _0
 93626  	}
 93627  	_1_v = _sqlite3GetVdbe(tls, _pParse)
 93628  
 93629  	if (_1_v == nil) || _sqlite3AuthCheck(tls, _pParse, int32(32), *elem0((**int8)(unsafe.Pointer(&_sqlite3SavepointØ00azØ001)), uintptr(_op)), _zName, nil) != 0 {
 93630  		_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.Xdb), unsafe.Pointer(_zName))
 93631  		return
 93632  	}
 93633  	_sqlite3VdbeAddOp4(tls, _1_v, int32(0), _op, int32(0), int32(0), _zName, int32(-1))
 93634  _0:
 93635  }
 93636  
 93637  var _sqlite3SavepointØ00azØ001 [3]*int8
 93638  
 93639  func init() {
 93640  	_sqlite3SavepointØ00azØ001 = [3]*int8{str(24938), str(25015), str(24996)}
 93641  }
 93642  
 93643  // C comment
 93644  //  /*
 93645  //  ** Begin constructing a new table representation in memory.  This is
 93646  //  ** the first of several action routines that get called in response
 93647  //  ** to a CREATE TABLE statement.  In particular, this routine is called
 93648  //  ** after seeing tokens "CREATE" and "TABLE" and the table name. The isTemp
 93649  //  ** flag is true if the table should be stored in the auxiliary database
 93650  //  ** file instead of in the main database file.  This is normally the case
 93651  //  ** when the "TEMP" or "TEMPORARY" keyword occurs in between
 93652  //  ** CREATE and TABLE.
 93653  //  **
 93654  //  ** The new table record is initialized and put in pParse->pNewTable.
 93655  //  ** As more of the CREATE TABLE statement is parsed, additional action
 93656  //  ** routines will be called to add more information to this record.
 93657  //  ** At the end of the CREATE TABLE statement, the sqlite3EndTable() routine
 93658  //  ** is called to complete the construction of the new table record.
 93659  //  */
 93660  func _sqlite3StartTable(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken, _isTemp int32, _isView int32, _isVirtual int32, _noErr int32) {
 93661  	var _iDb, _16_addr1, _16_fileFormat, _16_reg1, _16_reg2, _16_reg3 int32
 93662  	var _zName, _5_zDb, _8_zDb *int8
 93663  	var _db *Xsqlite3
 93664  	var _pTable *XTable
 93665  	var _v *TVdbe
 93666  	var _pName *XToken
 93667  	_zName = nil
 93668  	_db = (*Xsqlite3)(_pParse.Xdb)
 93669  	if ((_db.Xinit.Xbusy) != 0) && ((_db.Xinit.XnewTnum) == int32(1)) {
 93670  		_iDb = int32(_db.Xinit.XiDb)
 93671  		_zName = _sqlite3DbStrDup(tls, _db, func() *int8 {
 93672  			if int32(1) != 0 && (_iDb == int32(1)) {
 93673  				return str(49962)
 93674  			}
 93675  			return str(49981)
 93676  		}())
 93677  		_pName = _pName1
 93678  		goto _5
 93679  	}
 93680  	_iDb = _sqlite3TwoPartName(tls, _pParse, _pName1, _pName2, &_pName)
 93681  	if _iDb < int32(0) {
 93682  		return
 93683  	}
 93684  	if ((int32(1) != 0 && _isTemp != 0) && (_pName2.Xn > (0))) && (_iDb != int32(1)) {
 93685  		_sqlite3ErrorMsg(tls, _pParse, str(111348))
 93686  		return
 93687  	}
 93688  	if int32(1) != 0 && _isTemp != 0 {
 93689  		_iDb = int32(1)
 93690  	}
 93691  	_zName = _sqlite3NameFromToken(tls, _db, _pName)
 93692  _5:
 93693  	_pParse.XsNameToken = *_pName
 93694  	if _zName == nil {
 93695  		return
 93696  	}
 93697  	if int32(0) != _sqlite3CheckObjectName(tls, _pParse, _zName) {
 93698  		goto _begin_table_error
 93699  	}
 93700  	if int32(_db.Xinit.XiDb) == int32(1) {
 93701  		_isTemp = int32(1)
 93702  	}
 93703  	func() {
 93704  		if _isTemp != int32(0) && _isTemp != int32(1) {
 93705  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100579), unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000), unsafe.Pointer(str(111389)))
 93706  			crt.X__builtin_abort(tls)
 93707  		}
 93708  	}()
 93709  	func() {
 93710  		if _isView != int32(0) && _isView != int32(1) {
 93711  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100580), unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000), unsafe.Pointer(str(111412)))
 93712  			crt.X__builtin_abort(tls)
 93713  		}
 93714  	}()
 93715  	_5_zDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
 93716  	if _sqlite3AuthCheck(tls, _pParse, int32(18), func() *int8 {
 93717  		if int32(1) != 0 && (_isTemp == int32(1)) {
 93718  			return str(49962)
 93719  		}
 93720  		return str(49981)
 93721  	}(), nil, _5_zDb) != 0 {
 93722  		goto _begin_table_error
 93723  	}
 93724  	if (_isVirtual == 0) && _sqlite3AuthCheck(tls, _pParse, int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3StartTableØ00aCodeØ001)), uintptr(_isTemp+(int32(2)*_isView)))), _zName, nil, _5_zDb) != 0 {
 93725  		goto _begin_table_error
 93726  	}
 93727  	if _pParse.XdeclareVtab != 0 {
 93728  		goto _28
 93729  	}
 93730  	_8_zDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
 93731  	if int32(0) != _sqlite3ReadSchema(tls, _pParse) {
 93732  		goto _begin_table_error
 93733  	}
 93734  	_pTable = _sqlite3FindTable(tls, _db, _zName, _8_zDb)
 93735  	if _pTable == nil {
 93736  		goto _30
 93737  	}
 93738  	if _noErr == 0 {
 93739  		_sqlite3ErrorMsg(tls, _pParse, str(111435), unsafe.Pointer(_pName))
 93740  		goto _32
 93741  	}
 93742  	func() {
 93743  		if (_db.Xinit.Xbusy) != 0 && _sqlite3Config.XneverCorrupt != int32(0) {
 93744  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100616), unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000), unsafe.Pointer(str(111459)))
 93745  			crt.X__builtin_abort(tls)
 93746  		}
 93747  	}()
 93748  	_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
 93749  _32:
 93750  	goto _begin_table_error
 93751  _30:
 93752  	if _sqlite3FindIndex(tls, _db, _zName, _8_zDb) != nil {
 93753  		_sqlite3ErrorMsg(tls, _pParse, str(111488), unsafe.Pointer(_zName))
 93754  		goto _begin_table_error
 93755  	}
 93756  _28:
 93757  	_pTable = (*XTable)(_sqlite3DbMallocZero(tls, _db, uint64(80)))
 93758  	if _pTable == nil {
 93759  		func() {
 93760  			if _db.XmallocFailed == 0 {
 93761  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100629), unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000), unsafe.Pointer(str(47803)))
 93762  				crt.X__builtin_abort(tls)
 93763  			}
 93764  		}()
 93765  		_pParse.Xrc = _sqlite3NomemError(tls, int32(100630))
 93766  		_pParse.XnErr += 1
 93767  		goto _begin_table_error
 93768  	}
 93769  	_pTable.XzName = _zName
 93770  	_pTable.XiPKey = int16(-1)
 93771  	*(**XSchema)(unsafe.Pointer(&_pTable.XpSchema)) = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema)
 93772  	_pTable.XnTabRef = uint32(1)
 93773  	_pTable.XnRowLogEst = int16(200)
 93774  	func() {
 93775  		if int32(200) != int32(_sqlite3LogEst(tls, uint64(1048576))) {
 93776  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100638), unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000), unsafe.Pointer(str(48082)))
 93777  			crt.X__builtin_abort(tls)
 93778  		}
 93779  	}()
 93780  	func() {
 93781  		if (*XTable)(_pParse.XpNewTable) != nil {
 93782  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100639), unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000), unsafe.Pointer(str(24589)))
 93783  			crt.X__builtin_abort(tls)
 93784  		}
 93785  	}()
 93786  	*(**XTable)(unsafe.Pointer(&_pParse.XpNewTable)) = _pTable
 93787  	if (_pParse.Xnested == 0) && (crt.Xstrcmp(tls, _zName, str(111523)) == int32(0)) {
 93788  		func() {
 93789  			if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 93790  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100648), unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000), unsafe.Pointer(str(51126)))
 93791  				crt.X__builtin_abort(tls)
 93792  			}
 93793  		}()
 93794  		*(**XTable)(unsafe.Pointer(&((*XSchema)(_pTable.XpSchema).XpSeqTab))) = _pTable
 93795  	}
 93796  	if (_db.Xinit.Xbusy) != 0 || store60(&_v, _sqlite3GetVdbe(tls, _pParse)) == nil {
 93797  		goto _49
 93798  	}
 93799  	_sqlite3BeginWriteOperation(tls, _pParse, int32(1), _iDb)
 93800  	if _isVirtual != 0 {
 93801  		_sqlite3VdbeAddOp0(tls, _v, int32(155))
 93802  	}
 93803  	_16_reg1 = store2(&_pParse.XregRowid, preInc2(&_pParse.XnMem, 1))
 93804  	_16_reg2 = store2(&_pParse.XregRoot, preInc2(&_pParse.XnMem, 1))
 93805  	_16_reg3 = preInc2(&_pParse.XnMem, 1)
 93806  	_sqlite3VdbeAddOp3(tls, _v, int32(103), _iDb, _16_reg3, int32(2))
 93807  	_sqlite3VdbeUsesBtree(tls, _v, _iDb)
 93808  	_16_addr1 = _sqlite3VdbeAddOp1(tls, _v, int32(21), _16_reg3)
 93809  	_16_fileFormat = func() int32 {
 93810  		if (_db.Xflags & int32(32768)) != int32(0) {
 93811  			return int32(1)
 93812  		}
 93813  		return int32(4)
 93814  	}()
 93815  	_sqlite3VdbeAddOp3(tls, _v, int32(104), _iDb, int32(2), _16_fileFormat)
 93816  	_sqlite3VdbeAddOp3(tls, _v, int32(104), _iDb, int32(5), int32(_db.Xenc))
 93817  	_sqlite3VdbeJumpHere(tls, _v, _16_addr1)
 93818  	if _isView != 0 || _isVirtual != 0 {
 93819  		_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _16_reg2)
 93820  		goto _55
 93821  	}
 93822  	_pParse.XaddrCrTab = _sqlite3VdbeAddOp2(tls, _v, int32(137), _iDb, _16_reg2)
 93823  _55:
 93824  	_sqlite3OpenMasterTable(tls, _pParse, _iDb)
 93825  	_sqlite3VdbeAddOp2(tls, _v, int32(117), int32(0), _16_reg1)
 93826  	_sqlite3VdbeAddOp4(tls, _v, int32(61), int32(6), _16_reg3, int32(0), (*int8)(unsafe.Pointer(&_sqlite3StartTableØ00nullRowØ002)), int32(-2))
 93827  	_sqlite3VdbeAddOp3(tls, _v, int32(118), int32(0), _16_reg3, _16_reg1)
 93828  	_sqlite3VdbeChangeP5(tls, _v, uint16(8))
 93829  	_sqlite3VdbeAddOp0(tls, _v, int32(114))
 93830  _49:
 93831  	return
 93832  _begin_table_error:
 93833  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zName))
 93834  }
 93835  
 93836  // C comment
 93837  //  /* The table or view or trigger name is passed to this routine via tokens
 93838  //  ** pName1 and pName2. If the table name was fully qualified, for example:
 93839  //  **
 93840  //  ** CREATE TABLE xxx.yyy (...);
 93841  //  **
 93842  //  ** Then pName1 is set to "xxx" and pName2 "yyy". On the other hand if
 93843  //  ** the table name is not fully qualified, i.e.:
 93844  //  **
 93845  //  ** CREATE TABLE yyy(...);
 93846  //  **
 93847  //  ** Then pName1 is set to "yyy" and pName2 is "".
 93848  //  **
 93849  //  ** This routine sets the *ppUnqual pointer to point at the token (pName1 or
 93850  //  ** pName2) that stores the unqualified table name.  The index of the
 93851  //  ** database "xxx" is returned.
 93852  //  */
 93853  func _sqlite3TwoPartName(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken, _pUnqual **XToken) (r0 int32) {
 93854  	var _iDb int32
 93855  	var _db *Xsqlite3
 93856  	_db = (*Xsqlite3)(_pParse.Xdb)
 93857  	func() {
 93858  		if _pName2 == nil {
 93859  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100464), unsafe.Pointer(&_sqlite3TwoPartNameØ00__func__Ø000), unsafe.Pointer(str(111539)))
 93860  			crt.X__builtin_abort(tls)
 93861  		}
 93862  	}()
 93863  	if _pName2.Xn <= (0) {
 93864  		goto _2
 93865  	}
 93866  	if (_db.Xinit.Xbusy) != 0 {
 93867  		_sqlite3ErrorMsg(tls, _pParse, str(111549))
 93868  		return int32(-1)
 93869  	}
 93870  	*_pUnqual = _pName2
 93871  	_iDb = _sqlite3FindDb(tls, _db, _pName1)
 93872  	if _iDb < int32(0) {
 93873  		_sqlite3ErrorMsg(tls, _pParse, str(111566), unsafe.Pointer(_pName1))
 93874  		return int32(-1)
 93875  	}
 93876  	goto _5
 93877  _2:
 93878  	func() {
 93879  		if int32(_db.Xinit.XiDb) != int32(0) && (_db.Xinit.Xbusy) == 0 && (_db.Xflags&int32(268435456)) == int32(0) {
 93880  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100477), unsafe.Pointer(&_sqlite3TwoPartNameØ00__func__Ø000), unsafe.Pointer(str(111586)))
 93881  			crt.X__builtin_abort(tls)
 93882  		}
 93883  	}()
 93884  	_iDb = int32(_db.Xinit.XiDb)
 93885  	*_pUnqual = _pName1
 93886  _5:
 93887  	return _iDb
 93888  }
 93889  
 93890  var _sqlite3TwoPartNameØ00__func__Ø000 [19]int8
 93891  
 93892  func init() {
 93893  	crt.Xstrncpy(nil, &_sqlite3TwoPartNameØ00__func__Ø000[0], str(111653), 19)
 93894  }
 93895  
 93896  // C comment
 93897  //  /*
 93898  //  ** The token *pName contains the name of a database (either "main" or
 93899  //  ** "temp" or the name of an attached db). This routine returns the
 93900  //  ** index of the named database in db->aDb[], or -1 if the named db
 93901  //  ** does not exist.
 93902  //  */
 93903  func _sqlite3FindDb(tls *crt.TLS, _db *Xsqlite3, _pName *XToken) (r0 int32) {
 93904  	var _i int32
 93905  	var _zName *int8
 93906  	_zName = _sqlite3NameFromToken(tls, _db, _pName)
 93907  	_i = _sqlite3FindDbName(tls, _db, _zName)
 93908  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zName))
 93909  	return _i
 93910  }
 93911  
 93912  // C comment
 93913  //  /*
 93914  //  ** This routine is used to check if the UTF-8 string zName is a legal
 93915  //  ** unqualified name for a new schema object (table, index, view or
 93916  //  ** trigger). All names are legal except those that begin with the string
 93917  //  ** "sqlite_" (in upper, lower or mixed case). This portion of the namespace
 93918  //  ** is reserved for internal use.
 93919  //  */
 93920  func _sqlite3CheckObjectName(tls *crt.TLS, _pParse *XParse, _zName *int8) (r0 int32) {
 93921  	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))) {
 93922  		_sqlite3ErrorMsg(tls, _pParse, str(111680), unsafe.Pointer(_zName))
 93923  		return int32(1)
 93924  	}
 93925  	return int32(0)
 93926  }
 93927  
 93928  var _sqlite3StartTableØ00__func__Ø000 [18]int8
 93929  
 93930  func init() {
 93931  	crt.Xstrncpy(nil, &_sqlite3StartTableØ00__func__Ø000[0], str(111722), 18)
 93932  }
 93933  
 93934  var _sqlite3StartTableØ00aCodeØ001 [4]uint8
 93935  
 93936  func init() {
 93937  	_sqlite3StartTableØ00aCodeØ001 = [4]uint8{2, 4, 8, 6}
 93938  }
 93939  
 93940  // C comment
 93941  //  /*
 93942  //  ** Generate VDBE code that prepares for doing an operation that
 93943  //  ** might change the database.
 93944  //  **
 93945  //  ** This routine starts a new transaction if we are not already within
 93946  //  ** a transaction.  If we are already within a transaction, then a checkpoint
 93947  //  ** is set if the setStatement parameter is true.  A checkpoint should
 93948  //  ** be set for operations that might fail (due to a constraint) part of
 93949  //  ** the way through and which will need to undo some writes without having to
 93950  //  ** rollback the whole transaction.  For operations where all constraints
 93951  //  ** can be checked before any changes are made to the database, it is never
 93952  //  ** necessary to undo a write and the checkpoint should not be set.
 93953  //  */
 93954  func _sqlite3BeginWriteOperation(tls *crt.TLS, _pParse *XParse, _setStatement int32, _iDb int32) {
 93955  	var _pToplevel *XParse
 93956  	_pToplevel = func() *XParse {
 93957  		if _pParse.XpToplevel != nil {
 93958  			return (*XParse)(_pParse.XpToplevel)
 93959  		}
 93960  		return _pParse
 93961  	}()
 93962  	_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
 93963  	_pToplevel.XwriteMask |= uint32(1) << uint(_iDb)
 93964  	{
 93965  		p := &_pToplevel.XisMultiWrite
 93966  		*p = uint8(int32(*p) | _setStatement)
 93967  	}
 93968  }
 93969  
 93970  // C comment
 93971  //  /*
 93972  //  ** Open the sqlite_master table stored in database number iDb for
 93973  //  ** writing. The table is opened using cursor 0.
 93974  //  */
 93975  func _sqlite3OpenMasterTable(tls *crt.TLS, _p *XParse, _iDb int32) {
 93976  	var _v *TVdbe
 93977  	_v = _sqlite3GetVdbe(tls, _p)
 93978  	_sqlite3TableLock(tls, _p, _iDb, int32(1), uint8(1), str(49981))
 93979  	_sqlite3VdbeAddOp4Int(tls, _v, int32(107), int32(0), int32(1), _iDb, int32(5))
 93980  	if _p.XnTab == int32(0) {
 93981  		_p.XnTab = int32(1)
 93982  	}
 93983  }
 93984  
 93985  var _sqlite3StartTableØ00nullRowØ002 [6]int8
 93986  
 93987  func init() {
 93988  	_sqlite3StartTableØ00nullRowØ002 = [6]int8{6, 0, 0, 0, 0, 0}
 93989  }
 93990  
 93991  // C comment
 93992  //  /*
 93993  //  ** Disable lookaside memory allocation for objects that might be
 93994  //  ** shared across database connections.
 93995  //  */
 93996  func _disableLookaside(tls *crt.TLS, _pParse *XParse) {
 93997  	_pParse.XdisableLookaside += 1
 93998  	((*Xsqlite3)(_pParse.Xdb).Xlookaside).XbDisable += 1
 93999  }
 94000  
 94001  // C comment
 94002  //  /*
 94003  //  ** This routine is called to report the final ")" that terminates
 94004  //  ** a CREATE TABLE statement.
 94005  //  **
 94006  //  ** The table structure that other action routines have been building
 94007  //  ** is added to the internal hash tables, assuming no errors have
 94008  //  ** occurred.
 94009  //  **
 94010  //  ** An entry for the table is made in the master table on disk, unless
 94011  //  ** this is a temporary table or db->init.busy==1.  When db->init.busy==1
 94012  //  ** it means we are reading the sqlite_master table because we just
 94013  //  ** connected to the database or because the sqlite_master table has
 94014  //  ** recently changed, so the entry for this table already exists in
 94015  //  ** the sqlite_master table.  We do not want to create it again.
 94016  //  **
 94017  //  ** If the pSelect argument is not NULL, it means that this routine
 94018  //  ** was called to create a table generated from a
 94019  //  ** "CREATE TABLE ... AS SELECT ..." statement.  The column names of
 94020  //  ** the new table will match the result set of the SELECT.
 94021  //  */
 94022  func _sqlite3EndTable(tls *crt.TLS, _pParse *XParse, _pCons *XToken, _pEnd *XToken, _tabOpts uint8, _pSelect *XSelect) {
 94023  	var _iDb, _9_n, _12_regYield, _12_addrTop, _12_regRec, _12_regRowid, _12_addrInsLoop, _19_nName int32
 94024  	var _9_zType, _9_zType2, _9_zStmt, _19_zName *int8
 94025  	var _db *Xsqlite3
 94026  	var _15_pDb *XDb
 94027  	var _17_pSchema *XSchema
 94028  	var _p, _12_pSelTab, _17_pOld *XTable
 94029  	var _9_v *TVdbe
 94030  	var _14_pEnd2 *XToken
 94031  	var _pIdx *XIndex
 94032  	var _12_dest XSelectDest
 94033  	_db = (*Xsqlite3)(_pParse.Xdb)
 94034  	if (_pEnd == nil) && (_pSelect == nil) {
 94035  		return
 94036  	}
 94037  	func() {
 94038  		if _db.XmallocFailed != 0 {
 94039  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101544), unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000), unsafe.Pointer(str(23824)))
 94040  			crt.X__builtin_abort(tls)
 94041  		}
 94042  	}()
 94043  	_p = (*XTable)(_pParse.XpNewTable)
 94044  	if _p == nil {
 94045  		return
 94046  	}
 94047  	func() {
 94048  		if (_db.Xinit.Xbusy) != 0 && _pSelect != nil {
 94049  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101548), unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000), unsafe.Pointer(str(111740)))
 94050  			crt.X__builtin_abort(tls)
 94051  		}
 94052  	}()
 94053  	if (_db.Xinit.Xbusy) == 0 {
 94054  		goto _8
 94055  	}
 94056  	_p.Xtnum = _db.Xinit.XnewTnum
 94057  	if _p.Xtnum == int32(1) {
 94058  		_p.XtabFlags |= uint32(1)
 94059  	}
 94060  _8:
 94061  	if (int32(_tabOpts) & int32(32)) == 0 {
 94062  		goto _10
 94063  	}
 94064  	if (_p.XtabFlags & uint32(8)) != 0 {
 94065  		_sqlite3ErrorMsg(tls, _pParse, str(111767))
 94066  		return
 94067  	}
 94068  	if (_p.XtabFlags & uint32(4)) == (0) {
 94069  		_sqlite3ErrorMsg(tls, _pParse, str(111817), unsafe.Pointer(_p.XzName))
 94070  		goto _13
 94071  	}
 94072  	_p.XtabFlags |= uint32(96)
 94073  	_convertToWithoutRowidTable(tls, _pParse, _p)
 94074  _13:
 94075  _10:
 94076  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_p.XpSchema))
 94077  	if _p.XpCheck != nil {
 94078  		_sqlite3ResolveSelfReference(tls, _pParse, _p, int32(4), nil, (*XExprList)(_p.XpCheck))
 94079  	}
 94080  	_estimateTableWidth(tls, _p)
 94081  	_pIdx = (*XIndex)(_p.XpIndex)
 94082  _15:
 94083  	if _pIdx == nil {
 94084  		goto _18
 94085  	}
 94086  	_estimateIndexWidth(tls, _pIdx)
 94087  	_pIdx = (*XIndex)(_pIdx.XpNext)
 94088  	goto _15
 94089  _18:
 94090  	if (_db.Xinit.Xbusy) != 0 {
 94091  		goto _19
 94092  	}
 94093  	_9_v = _sqlite3GetVdbe(tls, _pParse)
 94094  	if func() int32 {
 94095  		if _9_v == nil {
 94096  			return func() int32 {
 94097  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101609), unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000), unsafe.Pointer(str(4809)))
 94098  				crt.X__builtin_abort(tls)
 94099  				return int32(1)
 94100  			}()
 94101  		}
 94102  		return int32(0)
 94103  	}() != 0 {
 94104  		return
 94105  	}
 94106  	_sqlite3VdbeAddOp1(tls, _9_v, int32(114), int32(0))
 94107  	if (*XSelect)(_p.XpSelect) == nil {
 94108  		_9_zType = str(93816)
 94109  		_9_zType2 = str(25026)
 94110  		goto _24
 94111  	}
 94112  	_9_zType = str(111849)
 94113  	_9_zType2 = str(25313)
 94114  _24:
 94115  	if _pSelect == nil {
 94116  		goto _25
 94117  	}
 94118  	_12_regYield = preInc2(&_pParse.XnMem, 1)
 94119  	_12_regRec = preInc2(&_pParse.XnMem, 1)
 94120  	_12_regRowid = preInc2(&_pParse.XnMem, 1)
 94121  	func() {
 94122  		if _pParse.XnTab != int32(1) {
 94123  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101653), unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000), unsafe.Pointer(str(111854)))
 94124  			crt.X__builtin_abort(tls)
 94125  		}
 94126  	}()
 94127  	_sqlite3MayAbort(tls, _pParse)
 94128  	_sqlite3VdbeAddOp3(tls, _9_v, int32(107), int32(1), _pParse.XregRoot, _iDb)
 94129  	_sqlite3VdbeChangeP5(tls, _9_v, uint16(16))
 94130  	_pParse.XnTab = int32(2)
 94131  	_12_addrTop = _sqlite3VdbeCurrentAddr(tls, _9_v) + int32(1)
 94132  	_sqlite3VdbeAddOp3(tls, _9_v, int32(15), _12_regYield, int32(0), _12_addrTop)
 94133  	_sqlite3SelectDestInit(tls, &_12_dest, int32(13), _12_regYield)
 94134  	_sqlite3Select(tls, _pParse, _pSelect, &_12_dest)
 94135  	_sqlite3VdbeEndCoroutine(tls, _9_v, _12_regYield)
 94136  	_sqlite3VdbeJumpHere(tls, _9_v, _12_addrTop-int32(1))
 94137  	if _pParse.XnErr != 0 {
 94138  		return
 94139  	}
 94140  	_12_pSelTab = _sqlite3ResultSetOfSelect(tls, _pParse, _pSelect)
 94141  	if _12_pSelTab == nil {
 94142  		return
 94143  	}
 94144  	func() {
 94145  		if (*XColumn)(_p.XaCol) != nil {
 94146  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101667), unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000), unsafe.Pointer(str(111870)))
 94147  			crt.X__builtin_abort(tls)
 94148  		}
 94149  	}()
 94150  	_p.XnCol = _12_pSelTab.XnCol
 94151  	*(**XColumn)(unsafe.Pointer(&_p.XaCol)) = (*XColumn)(_12_pSelTab.XaCol)
 94152  	_12_pSelTab.XnCol = 0
 94153  	*(**XColumn)(unsafe.Pointer(&_12_pSelTab.XaCol)) = nil
 94154  	_sqlite3DeleteTable(tls, _db, _12_pSelTab)
 94155  	_12_addrInsLoop = _sqlite3VdbeAddOp1(tls, _9_v, int32(16), _12_dest.XiSDParm)
 94156  	_sqlite3VdbeAddOp3(tls, _9_v, int32(101), _12_dest.XiSdst, _12_dest.XnSdst, _12_regRec)
 94157  	_sqlite3TableAffinity(tls, _9_v, _p, int32(0))
 94158  	_sqlite3VdbeAddOp2(tls, _9_v, int32(117), int32(1), _12_regRowid)
 94159  	_sqlite3VdbeAddOp3(tls, _9_v, int32(118), int32(1), _12_regRec, _12_regRowid)
 94160  	_sqlite3VdbeGoto(tls, _9_v, _12_addrInsLoop)
 94161  	_sqlite3VdbeJumpHere(tls, _9_v, _12_addrInsLoop)
 94162  	_sqlite3VdbeAddOp1(tls, _9_v, int32(114), int32(1))
 94163  _25:
 94164  	if _pSelect != nil {
 94165  		_9_zStmt = _createTableStmt(tls, _db, _p)
 94166  		goto _33
 94167  	}
 94168  	_14_pEnd2 = func() *XToken {
 94169  		if _tabOpts != 0 {
 94170  			return &_pParse.XsLastToken
 94171  		}
 94172  		return _pEnd
 94173  	}()
 94174  	_9_n = int32(uintptr(unsafe.Pointer(_14_pEnd2.Xz)) - uintptr(unsafe.Pointer(_pParse.XsNameToken.Xz)))
 94175  	if int32(*elem1(_14_pEnd2.Xz, 0)) != int32(59) {
 94176  		{
 94177  			p := &_9_n
 94178  			*p = int32(uint32(*p) + _14_pEnd2.Xn)
 94179  		}
 94180  	}
 94181  	_9_zStmt = _sqlite3MPrintf(tls, _db, str(111881), unsafe.Pointer(_9_zType2), _9_n, unsafe.Pointer(_pParse.XsNameToken.Xz))
 94182  _33:
 94183  	_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)
 94184  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_9_zStmt))
 94185  	_sqlite3ChangeCookie(tls, _pParse, _iDb)
 94186  	if (_p.XtabFlags & uint32(8)) == (0) {
 94187  		goto _37
 94188  	}
 94189  	_15_pDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb))
 94190  	func() {
 94191  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 94192  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101721), unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000), unsafe.Pointer(str(51126)))
 94193  			crt.X__builtin_abort(tls)
 94194  		}
 94195  	}()
 94196  	if (*XTable)((*XSchema)(_15_pDb.XpSchema).XpSeqTab) == nil {
 94197  		_sqlite3NestedParse(tls, _pParse, str(111983), unsafe.Pointer(_15_pDb.XzDbSName))
 94198  	}
 94199  _37:
 94200  	_sqlite3VdbeAddParseSchemaOp(tls, _9_v, _iDb, _sqlite3MPrintf(tls, _db, str(112025), unsafe.Pointer(_p.XzName)))
 94201  _19:
 94202  	if (_db.Xinit.Xbusy) == 0 {
 94203  		goto _41
 94204  	}
 94205  	_17_pSchema = (*XSchema)(_p.XpSchema)
 94206  	func() {
 94207  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 94208  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101742), unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000), unsafe.Pointer(str(51126)))
 94209  			crt.X__builtin_abort(tls)
 94210  		}
 94211  	}()
 94212  	_17_pOld = (*XTable)(_sqlite3HashInsert(tls, &_17_pSchema.XtblHash, _p.XzName, unsafe.Pointer(_p)))
 94213  	if _17_pOld != nil {
 94214  		func() {
 94215  			if _p != _17_pOld {
 94216  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101745), unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000), unsafe.Pointer(str(112059)))
 94217  				crt.X__builtin_abort(tls)
 94218  			}
 94219  		}()
 94220  		_sqlite3OomFault(tls, _db)
 94221  		return
 94222  	}
 94223  	*(**XTable)(unsafe.Pointer(&_pParse.XpNewTable)) = nil
 94224  	_db.Xflags |= int32(2)
 94225  	if _p.XpSelect != nil {
 94226  		goto _47
 94227  	}
 94228  	_19_zName = _pParse.XsNameToken.Xz
 94229  	func() {
 94230  		if _pSelect != nil || _pCons == nil || _pEnd == nil {
 94231  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101756), unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000), unsafe.Pointer(str(112067)))
 94232  			crt.X__builtin_abort(tls)
 94233  		}
 94234  	}()
 94235  	if _pCons.Xz == nil {
 94236  		_pCons = _pEnd
 94237  	}
 94238  	_19_nName = int32(uintptr(unsafe.Pointer(_pCons.Xz)) - uintptr(unsafe.Pointer(_19_zName)))
 94239  	_p.XaddColOffset = int32(13) + _sqlite3Utf8CharLen(tls, _19_zName, _19_nName)
 94240  _47:
 94241  _41:
 94242  }
 94243  
 94244  var _sqlite3EndTableØ00__func__Ø000 [16]int8
 94245  
 94246  func init() {
 94247  	crt.Xstrncpy(nil, &_sqlite3EndTableØ00__func__Ø000[0], str(112093), 16)
 94248  }
 94249  
 94250  // C comment
 94251  //  /*
 94252  //  ** This routine runs at the end of parsing a CREATE TABLE statement that
 94253  //  ** has a WITHOUT ROWID clause.  The job of this routine is to convert both
 94254  //  ** internal schema data structures and the generated VDBE code so that they
 94255  //  ** are appropriate for a WITHOUT ROWID table instead of a rowid table.
 94256  //  ** Changes include:
 94257  //  **
 94258  //  **     (1)  Set all columns of the PRIMARY KEY schema object to be NOT NULL.
 94259  //  **     (2)  Convert the OP_CreateTable into an OP_CreateIndex.  There is
 94260  //  **          no rowid btree for a WITHOUT ROWID.  Instead, the canonical
 94261  //  **          data storage is a covering index btree.
 94262  //  **     (3)  Bypass the creation of the sqlite_master table entry
 94263  //  **          for the PRIMARY KEY as the primary key index is now
 94264  //  **          identified by the sqlite_master table entry of the table itself.
 94265  //  **     (4)  Set the Index.tnum of the PRIMARY KEY Index object in the
 94266  //  **          schema to the rootpage from the main table.
 94267  //  **     (5)  Add all table columns to the PRIMARY KEY Index object
 94268  //  **          so that the PRIMARY KEY is a covering index.  The surplus
 94269  //  **          columns are part of KeyInfo.nXField and are not used for
 94270  //  **          sorting or lookup or uniqueness checks.
 94271  //  **     (6)  Replace the rowid tail on all automatically generated UNIQUE
 94272  //  **          indices with the PRIMARY KEY columns.
 94273  //  **
 94274  //  ** For virtual tables, only (1) is performed.
 94275  //  */
 94276  func _convertToWithoutRowidTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable) {
 94277  	var _nPk, _i, _j, _11_n int32
 94278  	var _5_ipkToken XToken
 94279  	var _db *Xsqlite3
 94280  	var _v *TVdbe
 94281  	var _5_pList *XExprList
 94282  	var _pIdx, _pPk *XIndex
 94283  	_db = (*Xsqlite3)(_pParse.Xdb)
 94284  	_v = (*TVdbe)(_pParse.XpVdbe)
 94285  	if (_db.Xinit.XimposterTable) != 0 {
 94286  		goto _0
 94287  	}
 94288  	_i = int32(0)
 94289  _1:
 94290  	if _i >= int32(_pTab.XnCol) {
 94291  		goto _4
 94292  	}
 94293  	if (int32(elem41((*XColumn)(_pTab.XaCol), uintptr(_i)).XcolFlags) & int32(1)) != int32(0) {
 94294  		elem41((*XColumn)(_pTab.XaCol), uintptr(_i)).XnotNull = uint8(2)
 94295  	}
 94296  	_i += 1
 94297  	goto _1
 94298  _4:
 94299  _0:
 94300  	if _pParse.XdeclareVtab != 0 {
 94301  		return
 94302  	}
 94303  	if _pParse.XaddrCrTab != 0 {
 94304  		func() {
 94305  			if _v == nil {
 94306  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101409), unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000), unsafe.Pointer(str(41816)))
 94307  				crt.X__builtin_abort(tls)
 94308  			}
 94309  		}()
 94310  		_sqlite3VdbeChangeOpcode(tls, _v, uint32(_pParse.XaddrCrTab), uint8(136))
 94311  	}
 94312  	if int32(_pTab.XiPKey) < int32(0) {
 94313  		goto _10
 94314  	}
 94315  	_sqlite3TokenInit(tls, &_5_ipkToken, elem41((*XColumn)(_pTab.XaCol), uintptr(_pTab.XiPKey)).XzName)
 94316  	_5_pList = _sqlite3ExprListAppend(tls, _pParse, nil, _sqlite3ExprAlloc(tls, _db, int32(27), &_5_ipkToken, int32(0)))
 94317  	if _5_pList == nil {
 94318  		return
 94319  	}
 94320  	elem57((*TExprList_item)(unsafe.Pointer(&_5_pList.Xa)), 0).XsortOrder = _pParse.XiPkSortOrder
 94321  	func() {
 94322  		if (*XTable)(_pParse.XpNewTable) != _pTab {
 94323  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101424), unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000), unsafe.Pointer(str(112109)))
 94324  			crt.X__builtin_abort(tls)
 94325  		}
 94326  	}()
 94327  	_sqlite3CreateIndex(tls, _pParse, nil, nil, nil, _5_pList, int32(_pTab.XkeyConf), nil, nil, int32(0), int32(0), uint8(2))
 94328  	if _db.XmallocFailed != 0 {
 94329  		return
 94330  	}
 94331  	_pPk = _sqlite3PrimaryKeyIndex(tls, _pTab)
 94332  	_pTab.XiPKey = int16(-1)
 94333  	goto _15
 94334  _10:
 94335  	_pPk = _sqlite3PrimaryKeyIndex(tls, _pTab)
 94336  	if _v != nil {
 94337  		func() {
 94338  			if int32(_db.Xinit.Xbusy) != int32(0) {
 94339  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101438), unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000), unsafe.Pointer(str(49851)))
 94340  				crt.X__builtin_abort(tls)
 94341  			}
 94342  		}()
 94343  		_sqlite3VdbeChangeOpcode(tls, _v, uint32(_pPk.Xtnum), uint8(13))
 94344  	}
 94345  	_i = store2(&_j, int32(1))
 94346  _19:
 94347  	if _i >= int32(_pPk.XnKeyCol) {
 94348  		goto _22
 94349  	}
 94350  	if _hasColumn(tls, _pPk.XaiColumn, _j, int32(*elem50(_pPk.XaiColumn, uintptr(_i)))) != 0 {
 94351  		_pPk.XnColumn -= 1
 94352  		goto _24
 94353  	}
 94354  	*elem50(_pPk.XaiColumn, uintptr(postInc2(&_j, 1))) = *elem50(_pPk.XaiColumn, uintptr(_i))
 94355  _24:
 94356  	_i += 1
 94357  	goto _19
 94358  _22:
 94359  	_pPk.XnKeyCol = uint16(_j)
 94360  _15:
 94361  	func() {
 94362  		if _pPk == nil {
 94363  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101456), unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000), unsafe.Pointer(str(41949)))
 94364  			crt.X__builtin_abort(tls)
 94365  		}
 94366  	}()
 94367  	storebits5(&_pPk.XidxType, int8(1), 32, 5)
 94368  	if (_db.Xinit.XimposterTable) == 0 {
 94369  		storebits5(&_pPk.XidxType, int8(1), 8, 3)
 94370  	}
 94371  	_nPk = int32(_pPk.XnKeyCol)
 94372  	_pPk.Xtnum = _pTab.Xtnum
 94373  	_pIdx = (*XIndex)(_pTab.XpIndex)
 94374  _28:
 94375  	if _pIdx == nil {
 94376  		goto _31
 94377  	}
 94378  	if int32((uint32(_pIdx.XidxType)<<30)>>30) == int32(2) {
 94379  		goto _29
 94380  	}
 94381  	_i = store2(&_11_n, int32(0))
 94382  _33:
 94383  	if _i >= _nPk {
 94384  		goto _36
 94385  	}
 94386  	if _hasColumn(tls, _pIdx.XaiColumn, int32(_pIdx.XnKeyCol), int32(*elem50(_pPk.XaiColumn, uintptr(_i)))) == 0 {
 94387  		_11_n += 1
 94388  	}
 94389  	_i += 1
 94390  	goto _33
 94391  _36:
 94392  	if _11_n == int32(0) {
 94393  		_pIdx.XnColumn = _pIdx.XnKeyCol
 94394  		goto _29
 94395  	}
 94396  	if _resizeIndexObject(tls, _db, _pIdx, int32(_pIdx.XnKeyCol)+_11_n) != 0 {
 94397  		return
 94398  	}
 94399  	*func() *int32 { _i = int32(0); return &_j }() = int32(_pIdx.XnKeyCol)
 94400  _40:
 94401  	if _i >= _nPk {
 94402  		goto _43
 94403  	}
 94404  	if _hasColumn(tls, _pIdx.XaiColumn, int32(_pIdx.XnKeyCol), int32(*elem50(_pPk.XaiColumn, uintptr(_i)))) == 0 {
 94405  		*elem50(_pIdx.XaiColumn, uintptr(_j)) = *elem50(_pPk.XaiColumn, uintptr(_i))
 94406  		*elem0(_pIdx.XazColl, uintptr(_j)) = *elem0(_pPk.XazColl, uintptr(_i))
 94407  		_j += 1
 94408  	}
 94409  	_i += 1
 94410  	goto _40
 94411  _43:
 94412  	func() {
 94413  		if int32(_pIdx.XnColumn) < (int32(_pIdx.XnKeyCol) + _11_n) {
 94414  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101486), unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000), unsafe.Pointer(str(112133)))
 94415  			crt.X__builtin_abort(tls)
 94416  		}
 94417  	}()
 94418  	func() {
 94419  		if int32(_pIdx.XnColumn) < _j {
 94420  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101487), unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000), unsafe.Pointer(str(112164)))
 94421  			crt.X__builtin_abort(tls)
 94422  		}
 94423  	}()
 94424  _29:
 94425  	_pIdx = (*XIndex)(_pIdx.XpNext)
 94426  	goto _28
 94427  _31:
 94428  	if _nPk >= int32(_pTab.XnCol) {
 94429  		goto _49
 94430  	}
 94431  	if _resizeIndexObject(tls, _db, _pPk, int32(_pTab.XnCol)) != 0 {
 94432  		return
 94433  	}
 94434  	*func() *int32 { _i = int32(0); return &_j }() = _nPk
 94435  _51:
 94436  	if _i >= int32(_pTab.XnCol) {
 94437  		goto _54
 94438  	}
 94439  	if _hasColumn(tls, _pPk.XaiColumn, _j, _i) == 0 {
 94440  		func() {
 94441  			if _j >= int32(_pPk.XnColumn) {
 94442  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101496), unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000), unsafe.Pointer(str(112181)))
 94443  				crt.X__builtin_abort(tls)
 94444  			}
 94445  		}()
 94446  		*elem50(_pPk.XaiColumn, uintptr(_j)) = int16(_i)
 94447  		*elem0(_pPk.XazColl, uintptr(_j)) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
 94448  		_j += 1
 94449  	}
 94450  	_i += 1
 94451  	goto _51
 94452  _54:
 94453  	func() {
 94454  		if int32(_pPk.XnColumn) != _j {
 94455  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101502), unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000), unsafe.Pointer(str(112196)))
 94456  			crt.X__builtin_abort(tls)
 94457  		}
 94458  	}()
 94459  	func() {
 94460  		if int32(_pTab.XnCol) != _j {
 94461  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101503), unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000), unsafe.Pointer(str(112212)))
 94462  			crt.X__builtin_abort(tls)
 94463  		}
 94464  	}()
 94465  	goto _62
 94466  _49:
 94467  	_pPk.XnColumn = uint16(_pTab.XnCol)
 94468  _62:
 94469  }
 94470  
 94471  var _convertToWithoutRowidTableØ00__func__Ø000 [27]int8
 94472  
 94473  func init() {
 94474  	crt.Xstrncpy(nil, &_convertToWithoutRowidTableØ00__func__Ø000[0], str(112226), 27)
 94475  }
 94476  
 94477  // C comment
 94478  //  /*
 94479  //  ** Create a new index for an SQL table.  pName1.pName2 is the name of the index
 94480  //  ** and pTblList is the name of the table that is to be indexed.  Both will
 94481  //  ** be NULL for a primary key or an index that is created to satisfy a
 94482  //  ** UNIQUE constraint.  If pTable and pIndex are NULL, use pParse->pNewTable
 94483  //  ** as the table to be indexed.  pParse->pNewTable is a table that is
 94484  //  ** currently being constructed by a CREATE TABLE statement.
 94485  //  **
 94486  //  ** pList is a list of columns to be indexed.  pList will be NULL if this
 94487  //  ** is a primary key or unique-constraint on the most recent column added
 94488  //  ** to the table currently under construction.
 94489  //  */
 94490  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) {
 94491  	var _nName, _i, _j, _sortOrderMask, _iDb, _nExtra, _nExtraCol, _20_n, _34_requestedSortOrder, _42_nColl, _46_x, _53_k, _62_iMem, _63_n int32
 94492  	var _zName, _zExtra, _23_zDb, _34_zColl, _54_z1, _54_z2, _62_zStmt *int8
 94493  	var _26_prevCol XToken
 94494  	var _db *Xsqlite3
 94495  	var _pDb *XDb
 94496  	var _pTab *XTable
 94497  	var _62_v *TVdbe
 94498  	var _pName *XToken
 94499  	var _37_pCopy *XExprList
 94500  	var _pListItem *TExprList_item
 94501  	var _28_pExpr, _34_pCExpr *XExpr
 94502  	var _pIndex, _pPk, _20_pLoop, _52_pIdx, _59_p, _68_pOther *XIndex
 94503  	var _sFix XDbFixer
 94504  	_pTab = nil
 94505  	_pIndex = nil
 94506  	_zName = nil
 94507  	_db = (*Xsqlite3)(_pParse.Xdb)
 94508  	_pName = nil
 94509  	_nExtra = int32(0)
 94510  	_zExtra = nil
 94511  	_pPk = nil
 94512  	if (_db.XmallocFailed != 0) || (_pParse.XnErr > int32(0)) {
 94513  		goto _exit_create_index
 94514  	}
 94515  	if (_pParse.XdeclareVtab != 0) && (int32(_idxType) != int32(2)) {
 94516  		goto _exit_create_index
 94517  	}
 94518  	if int32(0) != _sqlite3ReadSchema(tls, _pParse) {
 94519  		goto _exit_create_index
 94520  	}
 94521  	if _pTblName == nil {
 94522  		goto _5
 94523  	}
 94524  	func() {
 94525  		if _pName1 == nil || _pName2 == nil {
 94526  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102638), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112253)))
 94527  			crt.X__builtin_abort(tls)
 94528  		}
 94529  	}()
 94530  	_iDb = _sqlite3TwoPartName(tls, _pParse, _pName1, _pName2, &_pName)
 94531  	if _iDb < int32(0) {
 94532  		goto _exit_create_index
 94533  	}
 94534  	func() {
 94535  		if _pName == nil || _pName.Xz == nil {
 94536  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102641), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112270)))
 94537  			crt.X__builtin_abort(tls)
 94538  		}
 94539  	}()
 94540  	if (_db.Xinit.Xbusy) != 0 {
 94541  		goto _13
 94542  	}
 94543  	_pTab = _sqlite3SrcListLookup(tls, _pParse, _pTblName)
 94544  	if ((_pName2.Xn == (0)) && (_pTab != nil)) && ((*XSchema)(_pTab.XpSchema) == (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(1)).XpSchema)) {
 94545  		_iDb = int32(1)
 94546  	}
 94547  _13:
 94548  	_sqlite3FixInit(tls, &_sFix, _pParse, _iDb, str(112288), _pName)
 94549  	if _sqlite3FixSrcList(tls, &_sFix, _pTblName) != 0 {
 94550  		crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102660), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(4809)))
 94551  		crt.X__builtin_abort(tls)
 94552  	}
 94553  	_pTab = _sqlite3LocateTableItem(tls, _pParse, 0, elem6((*TSrcList_item)(unsafe.Pointer(&_pTblName.Xa)), 0))
 94554  	func() {
 94555  		if int32(_db.XmallocFailed) != int32(0) && _pTab != nil {
 94556  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102663), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112294)))
 94557  			crt.X__builtin_abort(tls)
 94558  		}
 94559  	}()
 94560  	if _pTab == nil {
 94561  		goto _exit_create_index
 94562  	}
 94563  	if (_iDb == int32(1)) && ((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema) != (*XSchema)(_pTab.XpSchema)) {
 94564  		_sqlite3ErrorMsg(tls, _pParse, str(112325), unsafe.Pointer(_pTab.XzName))
 94565  		goto _exit_create_index
 94566  	}
 94567  	if (_pTab.XtabFlags & uint32(32)) != (0) {
 94568  		_pPk = _sqlite3PrimaryKeyIndex(tls, _pTab)
 94569  	}
 94570  	goto _25
 94571  _5:
 94572  	func() {
 94573  		if _pName != nil {
 94574  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102673), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112375)))
 94575  			crt.X__builtin_abort(tls)
 94576  		}
 94577  	}()
 94578  	func() {
 94579  		if _pStart != nil {
 94580  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102674), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112384)))
 94581  			crt.X__builtin_abort(tls)
 94582  		}
 94583  	}()
 94584  	_pTab = (*XTable)(_pParse.XpNewTable)
 94585  	if _pTab == nil {
 94586  		goto _exit_create_index
 94587  	}
 94588  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.XpSchema))
 94589  _25:
 94590  	_pDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb))
 94591  	func() {
 94592  		if _pTab == nil {
 94593  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102681), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(43549)))
 94594  			crt.X__builtin_abort(tls)
 94595  		}
 94596  	}()
 94597  	func() {
 94598  		if _pParse.XnErr != int32(0) {
 94599  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102682), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112394)))
 94600  			crt.X__builtin_abort(tls)
 94601  		}
 94602  	}()
 94603  	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)) {
 94604  		_sqlite3ErrorMsg(tls, _pParse, str(112420), unsafe.Pointer(_pTab.XzName))
 94605  		goto _exit_create_index
 94606  	}
 94607  	if _pTab.XpSelect != nil {
 94608  		_sqlite3ErrorMsg(tls, _pParse, str(112448))
 94609  		goto _exit_create_index
 94610  	}
 94611  	if _pTab.XnModuleArg != 0 {
 94612  		_sqlite3ErrorMsg(tls, _pParse, str(112473))
 94613  		goto _exit_create_index
 94614  	}
 94615  	if _pName == nil {
 94616  		goto _40
 94617  	}
 94618  	_zName = _sqlite3NameFromToken(tls, _db, _pName)
 94619  	if _zName == nil {
 94620  		goto _exit_create_index
 94621  	}
 94622  	func() {
 94623  		if _pName.Xz == nil {
 94624  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102721), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112507)))
 94625  			crt.X__builtin_abort(tls)
 94626  		}
 94627  	}()
 94628  	if int32(0) != _sqlite3CheckObjectName(tls, _pParse, _zName) {
 94629  		goto _exit_create_index
 94630  	}
 94631  	if (_db.Xinit.Xbusy) != 0 {
 94632  		goto _45
 94633  	}
 94634  	if _sqlite3FindTable(tls, _db, _zName, nil) != nil {
 94635  		_sqlite3ErrorMsg(tls, _pParse, str(112519), unsafe.Pointer(_zName))
 94636  		goto _exit_create_index
 94637  	}
 94638  _45:
 94639  	if _sqlite3FindIndex(tls, _db, _zName, _pDb.XzDbSName) == nil {
 94640  		goto _47
 94641  	}
 94642  	if _ifNotExist == 0 {
 94643  		_sqlite3ErrorMsg(tls, _pParse, str(112553), unsafe.Pointer(_zName))
 94644  		goto _49
 94645  	}
 94646  	func() {
 94647  		if (_db.Xinit.Xbusy) != 0 {
 94648  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102735), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112577)))
 94649  			crt.X__builtin_abort(tls)
 94650  		}
 94651  	}()
 94652  	_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
 94653  _49:
 94654  	goto _exit_create_index
 94655  _47:
 94656  	goto _52
 94657  _40:
 94658  	*func() *int32 { _20_pLoop = (*XIndex)(_pTab.XpIndex); return &_20_n }() = int32(1)
 94659  _53:
 94660  	if _20_pLoop == nil {
 94661  		goto _56
 94662  	}
 94663  	*func() *int32 { _20_pLoop = (*XIndex)(_20_pLoop.XpNext); return &_20_n }() += 1
 94664  	goto _53
 94665  _56:
 94666  	_zName = _sqlite3MPrintf(tls, _db, str(112592), unsafe.Pointer(_pTab.XzName), _20_n)
 94667  	if _zName == nil {
 94668  		goto _exit_create_index
 94669  	}
 94670  	if _pParse.XdeclareVtab != 0 {
 94671  		*elem1(_zName, uintptr(7)) += 1
 94672  	}
 94673  _52:
 94674  	_23_zDb = _pDb.XzDbSName
 94675  	if _sqlite3AuthCheck(tls, _pParse, int32(18), func() *int8 {
 94676  		if int32(1) != 0 && (_iDb == int32(1)) {
 94677  			return str(49962)
 94678  		}
 94679  		return str(49981)
 94680  	}(), nil, _23_zDb) != 0 {
 94681  		goto _exit_create_index
 94682  	}
 94683  	_i = int32(1)
 94684  	if int32(1) != 0 && (_iDb == int32(1)) {
 94685  		_i = int32(3)
 94686  	}
 94687  	if _sqlite3AuthCheck(tls, _pParse, _i, _zName, _pTab.XzName, _23_zDb) != 0 {
 94688  		goto _exit_create_index
 94689  	}
 94690  	if _pList != nil {
 94691  		goto _66
 94692  	}
 94693  	_sqlite3TokenInit(tls, &_26_prevCol, elem41((*XColumn)(_pTab.XaCol), uintptr(int32(_pTab.XnCol)-int32(1))).XzName)
 94694  	_pList = _sqlite3ExprListAppend(tls, _pParse, nil, _sqlite3ExprAlloc(tls, _db, int32(27), &_26_prevCol, int32(0)))
 94695  	if _pList == nil {
 94696  		goto _exit_create_index
 94697  	}
 94698  	func() {
 94699  		if _pList.XnExpr != int32(1) {
 94700  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102783), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112615)))
 94701  			crt.X__builtin_abort(tls)
 94702  		}
 94703  	}()
 94704  	_sqlite3ExprListSetSortOrder(tls, _pList, _sortOrder)
 94705  	goto _70
 94706  _66:
 94707  	_sqlite3ExprListCheckLength(tls, _pParse, _pList, str(112288))
 94708  _70:
 94709  	_i = int32(0)
 94710  _71:
 94711  	if _i >= _pList.XnExpr {
 94712  		goto _74
 94713  	}
 94714  	_28_pExpr = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_i)).XpExpr)
 94715  	func() {
 94716  		if _28_pExpr == nil {
 94717  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102794), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(43591)))
 94718  			crt.X__builtin_abort(tls)
 94719  		}
 94720  	}()
 94721  	if int32(_28_pExpr.Xop) == int32(94) {
 94722  		_nExtra += int32(1) + _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer(&_28_pExpr.Xu)))
 94723  	}
 94724  	_i += 1
 94725  	goto _71
 94726  _74:
 94727  	_nName = _sqlite3Strlen30(tls, _zName)
 94728  	_nExtraCol = func() int32 {
 94729  		if _pPk != nil {
 94730  			return int32(_pPk.XnKeyCol)
 94731  		}
 94732  		return int32(1)
 94733  	}()
 94734  	_pIndex = _sqlite3AllocateIndexObject(tls, _db, int16(_pList.XnExpr+_nExtraCol), (_nName+_nExtra)+int32(1), &_zExtra)
 94735  	if _db.XmallocFailed != 0 {
 94736  		goto _exit_create_index
 94737  	}
 94738  	func() {
 94739  		if (int32(uintptr(unsafe.Pointer(_pIndex.XaiRowLogEst))) & int32(7)) != int32(0) {
 94740  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102810), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112631)))
 94741  			crt.X__builtin_abort(tls)
 94742  		}
 94743  	}()
 94744  	func() {
 94745  		if (int32(uintptr(unsafe.Pointer(_pIndex.XazColl))) & int32(7)) != int32(0) {
 94746  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102811), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112673)))
 94747  			crt.X__builtin_abort(tls)
 94748  		}
 94749  	}()
 94750  	_pIndex.XzName = _zExtra
 94751  	*(*uintptr)(unsafe.Pointer(&_zExtra)) += uintptr(_nName + int32(1))
 94752  	crt.Xmemcpy(tls, unsafe.Pointer(_pIndex.XzName), unsafe.Pointer(_zName), uint32(_nName+int32(1)))
 94753  	*(**XTable)(unsafe.Pointer(&_pIndex.XpTable)) = _pTab
 94754  	_pIndex.XonError = uint8(_onError)
 94755  	storebits5(&_pIndex.XidxType, int8(bool2int(_onError != int32(0))), 8, 3)
 94756  	storebits5(&_pIndex.XidxType, int8(_idxType), 3, 0)
 94757  	*(**XSchema)(unsafe.Pointer(&_pIndex.XpSchema)) = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema)
 94758  	_pIndex.XnKeyCol = uint16(_pList.XnExpr)
 94759  	if _pPIWhere != nil {
 94760  		_sqlite3ResolveSelfReference(tls, _pParse, _pTab, int32(2), _pPIWhere, nil)
 94761  		*(**XExpr)(unsafe.Pointer(&_pIndex.XpPartIdxWhere)) = _pPIWhere
 94762  		_pPIWhere = nil
 94763  	}
 94764  	func() {
 94765  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 94766  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102826), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(51126)))
 94767  			crt.X__builtin_abort(tls)
 94768  		}
 94769  	}()
 94770  	if int32((*XSchema)(_pDb.XpSchema).Xfile_format) >= int32(4) {
 94771  		_sortOrderMask = int32(-1)
 94772  		goto _89
 94773  	}
 94774  	_sortOrderMask = int32(0)
 94775  _89:
 94776  	*func() **TExprList_item { _i = int32(0); return &_pListItem }() = (*TExprList_item)(unsafe.Pointer(&_pList.Xa))
 94777  _90:
 94778  	if _i >= _pList.XnExpr {
 94779  		goto _93
 94780  	}
 94781  	_sqlite3StringToId(tls, (*XExpr)(_pListItem.XpExpr))
 94782  	_sqlite3ResolveSelfReference(tls, _pParse, _pTab, int32(32), (*XExpr)(_pListItem.XpExpr), nil)
 94783  	if _pParse.XnErr != 0 {
 94784  		goto _exit_create_index
 94785  	}
 94786  	_34_pCExpr = _sqlite3ExprSkipCollate(tls, (*XExpr)(_pListItem.XpExpr))
 94787  	if int32(_34_pCExpr.Xop) == int32(152) {
 94788  		goto _95
 94789  	}
 94790  	if _pTab == (*XTable)(_pParse.XpNewTable) {
 94791  		_sqlite3ErrorMsg(tls, _pParse, str(112710))
 94792  		goto _exit_create_index
 94793  	}
 94794  	if (*XExprList)(_pIndex.XaColExpr) != nil {
 94795  		goto _97
 94796  	}
 94797  	_37_pCopy = _sqlite3ExprListDup(tls, _db, _pList, int32(0))
 94798  	*(**XExprList)(unsafe.Pointer(&_pIndex.XaColExpr)) = _37_pCopy
 94799  	if _db.XmallocFailed == 0 {
 94800  		func() {
 94801  			if _37_pCopy == nil {
 94802  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102864), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112771)))
 94803  				crt.X__builtin_abort(tls)
 94804  			}
 94805  		}()
 94806  		_pListItem = elem57((*TExprList_item)(unsafe.Pointer(&_37_pCopy.Xa)), uintptr(_i))
 94807  	}
 94808  _97:
 94809  	_j = int32(-2)
 94810  	*elem50(_pIndex.XaiColumn, uintptr(_i)) = int16(-2)
 94811  	storebits5(&_pIndex.XidxType, 0, 8, 3)
 94812  	goto _101
 94813  _95:
 94814  	_j = int32(_34_pCExpr.XiColumn)
 94815  	func() {
 94816  		if _j > int32(32767) {
 94817  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102873), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112780)))
 94818  			crt.X__builtin_abort(tls)
 94819  		}
 94820  	}()
 94821  	if _j < int32(0) {
 94822  		_j = int32(_pTab.XiPKey)
 94823  		goto _106
 94824  	}
 94825  	if int32(elem41((*XColumn)(_pTab.XaCol), uintptr(_j)).XnotNull) == int32(0) {
 94826  		storebits5(&_pIndex.XidxType, 0, 8, 3)
 94827  	}
 94828  _106:
 94829  	*elem50(_pIndex.XaiColumn, uintptr(_i)) = int16(_j)
 94830  _101:
 94831  	_34_zColl = nil
 94832  	if int32((*XExpr)(_pListItem.XpExpr).Xop) == int32(94) {
 94833  		_34_zColl = *(**int8)(unsafe.Pointer(&((*XExpr)(_pListItem.XpExpr).Xu)))
 94834  		_42_nColl = _sqlite3Strlen30(tls, _34_zColl) + int32(1)
 94835  		func() {
 94836  			if _nExtra < _42_nColl {
 94837  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102886), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112790)))
 94838  				crt.X__builtin_abort(tls)
 94839  			}
 94840  		}()
 94841  		crt.Xmemcpy(tls, unsafe.Pointer(_zExtra), unsafe.Pointer(_34_zColl), uint32(_42_nColl))
 94842  		_34_zColl = _zExtra
 94843  		*(*uintptr)(unsafe.Pointer(&_zExtra)) += uintptr(_42_nColl)
 94844  		_nExtra -= _42_nColl
 94845  		goto _111
 94846  	}
 94847  	if _j >= int32(0) {
 94848  		_34_zColl = elem41((*XColumn)(_pTab.XaCol), uintptr(_j)).XzColl
 94849  	}
 94850  _111:
 94851  	if _34_zColl == nil {
 94852  		_34_zColl = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
 94853  	}
 94854  	if ((_db.Xinit.Xbusy) == 0) && (_sqlite3LocateCollSeq(tls, _pParse, _34_zColl) == nil) {
 94855  		goto _exit_create_index
 94856  	}
 94857  	*elem0(_pIndex.XazColl, uintptr(_i)) = _34_zColl
 94858  	_34_requestedSortOrder = int32(_pListItem.XsortOrder) & _sortOrderMask
 94859  	*elem15(_pIndex.XaSortOrder, uintptr(_i)) = uint8(_34_requestedSortOrder)
 94860  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pListItem }())) += uintptr(20)
 94861  	goto _90
 94862  _93:
 94863  	if _pPk == nil {
 94864  		goto _115
 94865  	}
 94866  	_j = int32(0)
 94867  _116:
 94868  	if _j >= int32(_pPk.XnKeyCol) {
 94869  		goto _119
 94870  	}
 94871  	_46_x = int32(*elem50(_pPk.XaiColumn, uintptr(_j)))
 94872  	func() {
 94873  		if _46_x < int32(0) {
 94874  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102910), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(109771)))
 94875  			crt.X__builtin_abort(tls)
 94876  		}
 94877  	}()
 94878  	if _hasColumn(tls, _pIndex.XaiColumn, int32(_pIndex.XnKeyCol), _46_x) != 0 {
 94879  		_pIndex.XnColumn -= 1
 94880  		goto _123
 94881  	}
 94882  	*elem50(_pIndex.XaiColumn, uintptr(_i)) = int16(_46_x)
 94883  	*elem0(_pIndex.XazColl, uintptr(_i)) = *elem0(_pPk.XazColl, uintptr(_j))
 94884  	*elem15(_pIndex.XaSortOrder, uintptr(_i)) = *elem15(_pPk.XaSortOrder, uintptr(_j))
 94885  	_i += 1
 94886  _123:
 94887  	_j += 1
 94888  	goto _116
 94889  _119:
 94890  	func() {
 94891  		if _i != int32(_pIndex.XnColumn) {
 94892  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102920), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112804)))
 94893  			crt.X__builtin_abort(tls)
 94894  		}
 94895  	}()
 94896  	goto _126
 94897  _115:
 94898  	*elem50(_pIndex.XaiColumn, uintptr(_i)) = int16(-1)
 94899  	*elem0(_pIndex.XazColl, uintptr(_i)) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
 94900  _126:
 94901  	_sqlite3DefaultRowEst(tls, _pIndex)
 94902  	if (*XTable)(_pParse.XpNewTable) == nil {
 94903  		_estimateIndexWidth(tls, _pIndex)
 94904  	}
 94905  	func() {
 94906  		if (_pTab.XtabFlags&uint32(32)) != (0) && int32(_pTab.XiPKey) >= int32(0) && int32(_sqlite3ColumnOfIndex(tls, _pIndex, _pTab.XiPKey)) < int32(0) {
 94907  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102930), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112823)))
 94908  			crt.X__builtin_abort(tls)
 94909  		}
 94910  	}()
 94911  	if _pTblName == nil || int32(_pIndex.XnColumn) < int32(_pTab.XnCol) {
 94912  		goto _133
 94913  	}
 94914  	storebits5(&_pIndex.XidxType, int8(1), 32, 5)
 94915  	_j = int32(0)
 94916  _134:
 94917  	if _j >= int32(_pTab.XnCol) {
 94918  		goto _137
 94919  	}
 94920  	if _j == int32(_pTab.XiPKey) {
 94921  		goto _135
 94922  	}
 94923  	if int32(_sqlite3ColumnOfIndex(tls, _pIndex, int16(_j))) >= int32(0) {
 94924  		goto _135
 94925  	}
 94926  	storebits5(&_pIndex.XidxType, 0, 32, 5)
 94927  	goto _137
 94928  _135:
 94929  	_j += 1
 94930  	goto _134
 94931  _137:
 94932  _133:
 94933  	if _pTab != (*XTable)(_pParse.XpNewTable) {
 94934  		goto _140
 94935  	}
 94936  	_52_pIdx = (*XIndex)(_pTab.XpIndex)
 94937  _141:
 94938  	if _52_pIdx == nil {
 94939  		goto _144
 94940  	}
 94941  	func() {
 94942  		if int32(_52_pIdx.XonError) == int32(0) {
 94943  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102967), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112903)))
 94944  			crt.X__builtin_abort(tls)
 94945  		}
 94946  	}()
 94947  	func() {
 94948  		if int32((uint32(_52_pIdx.XidxType)<<30)>>30) == int32(0) {
 94949  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102968), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112923)))
 94950  			crt.X__builtin_abort(tls)
 94951  		}
 94952  	}()
 94953  	func() {
 94954  		if int32(_pIndex.XonError) == int32(0) {
 94955  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102969), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112960)))
 94956  			crt.X__builtin_abort(tls)
 94957  		}
 94958  	}()
 94959  	if int32(_52_pIdx.XnKeyCol) != int32(_pIndex.XnKeyCol) {
 94960  		goto _142
 94961  	}
 94962  	_53_k = int32(0)
 94963  _152:
 94964  	if _53_k >= int32(_52_pIdx.XnKeyCol) {
 94965  		goto _155
 94966  	}
 94967  	func() {
 94968  		if int32(*elem50(_52_pIdx.XaiColumn, uintptr(_53_k))) < int32(0) {
 94969  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102975), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112982)))
 94970  			crt.X__builtin_abort(tls)
 94971  		}
 94972  	}()
 94973  	if int32(*elem50(_52_pIdx.XaiColumn, uintptr(_53_k))) != int32(*elem50(_pIndex.XaiColumn, uintptr(_53_k))) {
 94974  		goto _155
 94975  	}
 94976  	_54_z1 = *elem0(_52_pIdx.XazColl, uintptr(_53_k))
 94977  	_54_z2 = *elem0(_pIndex.XazColl, uintptr(_53_k))
 94978  	if _sqlite3StrICmp(tls, _54_z1, _54_z2) != 0 {
 94979  		goto _155
 94980  	}
 94981  	_53_k += 1
 94982  	goto _152
 94983  _155:
 94984  	if _53_k != int32(_52_pIdx.XnKeyCol) {
 94985  		goto _160
 94986  	}
 94987  	if int32(_52_pIdx.XonError) == int32(_pIndex.XonError) {
 94988  		goto _161
 94989  	}
 94990  	if int32(_52_pIdx.XonError) != int32(10) && int32(_pIndex.XonError) != int32(10) {
 94991  		_sqlite3ErrorMsg(tls, _pParse, str(113003), int32(0))
 94992  	}
 94993  	if int32(_52_pIdx.XonError) == int32(10) {
 94994  		_52_pIdx.XonError = _pIndex.XonError
 94995  	}
 94996  _161:
 94997  	if int32(_idxType) == int32(2) {
 94998  		storebits5(&_52_pIdx.XidxType, int8(_idxType), 3, 0)
 94999  	}
 95000  	goto _exit_create_index
 95001  _160:
 95002  _142:
 95003  	_52_pIdx = (*XIndex)(_52_pIdx.XpNext)
 95004  	goto _141
 95005  _144:
 95006  _140:
 95007  	func() {
 95008  		if _pParse.XnErr != int32(0) {
 95009  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103007), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(112394)))
 95010  			crt.X__builtin_abort(tls)
 95011  		}
 95012  	}()
 95013  	if (_db.Xinit.Xbusy) == 0 {
 95014  		goto _168
 95015  	}
 95016  	func() {
 95017  		if _pParse.XdeclareVtab != 0 {
 95018  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103010), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(113045)))
 95019  			crt.X__builtin_abort(tls)
 95020  		}
 95021  	}()
 95022  	func() {
 95023  		if _sqlite3SchemaMutexHeld(tls, _db, int32(0), (*XSchema)(_pIndex.XpSchema)) == 0 {
 95024  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103011), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(113062)))
 95025  			crt.X__builtin_abort(tls)
 95026  		}
 95027  	}()
 95028  	_59_p = (*XIndex)(_sqlite3HashInsert(tls, &((*XSchema)(_pIndex.XpSchema).XidxHash), _pIndex.XzName, unsafe.Pointer(_pIndex)))
 95029  	if _59_p != nil {
 95030  		func() {
 95031  			if _59_p != _pIndex {
 95032  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103015), unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000), unsafe.Pointer(str(113109)))
 95033  				crt.X__builtin_abort(tls)
 95034  			}
 95035  		}()
 95036  		_sqlite3OomFault(tls, _db)
 95037  		goto _exit_create_index
 95038  	}
 95039  	_db.Xflags |= int32(2)
 95040  	if _pTblName != nil {
 95041  		_pIndex.Xtnum = _db.Xinit.XnewTnum
 95042  	}
 95043  	goto _179
 95044  _168:
 95045  	if (_pTab.XtabFlags&uint32(32)) != (0) && _pTblName == nil {
 95046  		goto _179
 95047  	}
 95048  	_62_iMem = preInc2(&_pParse.XnMem, 1)
 95049  	_62_v = _sqlite3GetVdbe(tls, _pParse)
 95050  	if _62_v == nil {
 95051  		goto _exit_create_index
 95052  	}
 95053  	_sqlite3BeginWriteOperation(tls, _pParse, int32(1), _iDb)
 95054  	_pIndex.Xtnum = _sqlite3VdbeAddOp0(tls, _62_v, int32(164))
 95055  	_sqlite3VdbeAddOp2(tls, _62_v, int32(136), _iDb, _62_iMem)
 95056  	if _pStart == nil {
 95057  		goto _181
 95058  	}
 95059  	_63_n = int32(uint32(int32(uintptr(unsafe.Pointer(_pParse.XsLastToken.Xz))-uintptr(unsafe.Pointer(_pName.Xz)))) + (_pParse.XsLastToken.Xn))
 95060  	if int32(*elem1(_pName.Xz, uintptr(_63_n-int32(1)))) == int32(59) {
 95061  		_63_n -= 1
 95062  	}
 95063  	_62_zStmt = _sqlite3MPrintf(tls, _db, str(113119), unsafe.Pointer(func() *int8 {
 95064  		if _onError == int32(0) {
 95065  			return str(284)
 95066  		}
 95067  		return str(113139)
 95068  	}()), _63_n, unsafe.Pointer(_pName.Xz))
 95069  	goto _185
 95070  _181:
 95071  	_62_zStmt = nil
 95072  _185:
 95073  	_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))
 95074  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_62_zStmt))
 95075  	if _pTblName != nil {
 95076  		_sqlite3RefillIndex(tls, _pParse, _pIndex, _62_iMem)
 95077  		_sqlite3ChangeCookie(tls, _pParse, _iDb)
 95078  		_sqlite3VdbeAddParseSchemaOp(tls, _62_v, _iDb, _sqlite3MPrintf(tls, _db, str(113195), unsafe.Pointer(_pIndex.XzName)))
 95079  		_sqlite3VdbeAddOp0(tls, _62_v, int32(153))
 95080  	}
 95081  	_sqlite3VdbeJumpHere(tls, _62_v, _pIndex.Xtnum)
 95082  _179:
 95083  	if (_db.Xinit.Xbusy) == 0 && _pTblName != nil {
 95084  		goto _exit_create_index
 95085  	}
 95086  	if ((_onError != int32(5)) || ((*XIndex)(_pTab.XpIndex) == nil)) || (int32((*XIndex)(_pTab.XpIndex).XonError) == int32(5)) {
 95087  		*(**XIndex)(unsafe.Pointer(&_pIndex.XpNext)) = (*XIndex)(_pTab.XpIndex)
 95088  		*(**XIndex)(unsafe.Pointer(&_pTab.XpIndex)) = _pIndex
 95089  		goto _192
 95090  	}
 95091  	_68_pOther = (*XIndex)(_pTab.XpIndex)
 95092  _193:
 95093  	if (_68_pOther.XpNext != nil) && (int32((*XIndex)(_68_pOther.XpNext).XonError) != int32(5)) {
 95094  		_68_pOther = (*XIndex)(_68_pOther.XpNext)
 95095  		goto _193
 95096  	}
 95097  	*(**XIndex)(unsafe.Pointer(&_pIndex.XpNext)) = (*XIndex)(_68_pOther.XpNext)
 95098  	*(**XIndex)(unsafe.Pointer(&_68_pOther.XpNext)) = _pIndex
 95099  _192:
 95100  	_pIndex = nil
 95101  _exit_create_index:
 95102  	if _pIndex != nil {
 95103  		_freeIndex(tls, _db, _pIndex)
 95104  	}
 95105  	_sqlite3ExprDelete(tls, _db, _pPIWhere)
 95106  	_sqlite3ExprListDelete(tls, _db, _pList)
 95107  	_sqlite3SrcListDelete(tls, _db, _pTblName)
 95108  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zName))
 95109  }
 95110  
 95111  var _sqlite3CreateIndexØ00__func__Ø000 [19]int8
 95112  
 95113  func init() {
 95114  	crt.Xstrncpy(nil, &_sqlite3CreateIndexØ00__func__Ø000[0], str(113222), 19)
 95115  }
 95116  
 95117  // C comment
 95118  //  /*
 95119  //  ** While a SrcList can in general represent multiple tables and subqueries
 95120  //  ** (as in the FROM clause of a SELECT statement) in this case it contains
 95121  //  ** the name of a single table, as one might find in an INSERT, DELETE,
 95122  //  ** or UPDATE statement.  Look up that table in the symbol table and
 95123  //  ** return a pointer.  Set an error message and return NULL if the table
 95124  //  ** name is not found or if any other error occurs.
 95125  //  **
 95126  //  ** The following fields are initialized appropriate in pSrc:
 95127  //  **
 95128  //  **    pSrc->a[0].pTab       Pointer to the Table object
 95129  //  **    pSrc->a[0].pIndex     Pointer to the INDEXED BY index, if there is one
 95130  //  **
 95131  //  */
 95132  func _sqlite3SrcListLookup(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList) (r0 *XTable) {
 95133  	var _pTab *XTable
 95134  	var _pItem *TSrcList_item
 95135  	_pItem = (*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa))
 95136  	func() {
 95137  		if _pItem == nil || _pSrc.XnSrc != int32(1) {
 95138  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104667), unsafe.Pointer(&_sqlite3SrcListLookupØ00__func__Ø000), unsafe.Pointer(str(113241)))
 95139  			crt.X__builtin_abort(tls)
 95140  		}
 95141  	}()
 95142  	_pTab = _sqlite3LocateTableItem(tls, _pParse, 0, _pItem)
 95143  	_sqlite3DeleteTable(tls, (*Xsqlite3)(_pParse.Xdb), (*XTable)(_pItem.XpTab))
 95144  	*(**XTable)(unsafe.Pointer(&_pItem.XpTab)) = _pTab
 95145  	if _pTab != nil {
 95146  		_pTab.XnTabRef += 1
 95147  	}
 95148  	if _sqlite3IndexedByLookup(tls, _pParse, _pItem) != 0 {
 95149  		_pTab = nil
 95150  	}
 95151  	return _pTab
 95152  }
 95153  
 95154  var _sqlite3SrcListLookupØ00__func__Ø000 [21]int8
 95155  
 95156  func init() {
 95157  	crt.Xstrncpy(nil, &_sqlite3SrcListLookupØ00__func__Ø000[0], str(113264), 21)
 95158  }
 95159  
 95160  // C comment
 95161  //  /*
 95162  //  ** Initialize a DbFixer structure.  This routine must be called prior
 95163  //  ** to passing the structure to one of the sqliteFixAAAA() routines below.
 95164  //  */
 95165  func _sqlite3FixInit(tls *crt.TLS, _pFix *XDbFixer, _pParse *XParse, _iDb int32, _zType *int8, _pName *XToken) {
 95166  	var _db *Xsqlite3
 95167  	_db = (*Xsqlite3)(_pParse.Xdb)
 95168  	func() {
 95169  		if _db.XnDb <= _iDb {
 95170  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99270), unsafe.Pointer(&_sqlite3FixInitØ00__func__Ø000), unsafe.Pointer(str(113285)))
 95171  			crt.X__builtin_abort(tls)
 95172  		}
 95173  	}()
 95174  	*(**XParse)(unsafe.Pointer(&_pFix.XpParse)) = _pParse
 95175  	_pFix.XzDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
 95176  	*(**XSchema)(unsafe.Pointer(&_pFix.XpSchema)) = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema)
 95177  	_pFix.XzType = _zType
 95178  	*(**XToken)(unsafe.Pointer(&_pFix.XpName)) = _pName
 95179  	_pFix.XbVarOnly = bool2int(_iDb == int32(1))
 95180  }
 95181  
 95182  var _sqlite3FixInitØ00__func__Ø000 [15]int8
 95183  
 95184  func init() {
 95185  	crt.Xstrncpy(nil, &_sqlite3FixInitØ00__func__Ø000[0], str(113297), 15)
 95186  }
 95187  
 95188  // C comment
 95189  //  /*
 95190  //  ** The following set of routines walk through the parse tree and assign
 95191  //  ** a specific database to all table references where the database name
 95192  //  ** was left unspecified in the original SQL statement.  The pFix structure
 95193  //  ** must have been initialized by a prior call to sqlite3FixInit().
 95194  //  **
 95195  //  ** These routines are used to make sure that an index, trigger, or
 95196  //  ** view in one database does not refer to objects in a different database.
 95197  //  ** (Exception: indices, triggers, and views in the TEMP database are
 95198  //  ** allowed to refer to anything.)  If a reference is explicitly made
 95199  //  ** to an object in a different database, an error message is added to
 95200  //  ** pParse->zErrMsg and these routines return non-zero.  If everything
 95201  //  ** checks out, these routines return 0.
 95202  //  */
 95203  func _sqlite3FixSrcList(tls *crt.TLS, _pFix *XDbFixer, _pList *XSrcList) (r0 int32) {
 95204  	var _i int32
 95205  	var _zDb *int8
 95206  	var _pItem *TSrcList_item
 95207  	if func() int32 {
 95208  		if _pList == nil {
 95209  			return func() int32 {
 95210  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99301), unsafe.Pointer(&_sqlite3FixSrcListØ00__func__Ø000), unsafe.Pointer(str(4809)))
 95211  				crt.X__builtin_abort(tls)
 95212  				return int32(1)
 95213  			}()
 95214  		}
 95215  		return int32(0)
 95216  	}() != 0 {
 95217  		return int32(0)
 95218  	}
 95219  	_zDb = _pFix.XzDb
 95220  	*func() **TSrcList_item { _i = int32(0); return &_pItem }() = (*TSrcList_item)(unsafe.Pointer(&_pList.Xa))
 95221  _3:
 95222  	if _i >= _pList.XnSrc {
 95223  		goto _6
 95224  	}
 95225  	if _pFix.XbVarOnly != int32(0) {
 95226  		goto _7
 95227  	}
 95228  	if (_pItem.XzDatabase != nil) && _sqlite3StrICmp(tls, _pItem.XzDatabase, _zDb) != 0 {
 95229  		_sqlite3ErrorMsg(tls, (*XParse)(_pFix.XpParse), str(113312), unsafe.Pointer(_pFix.XzType), _pFix.XpName, unsafe.Pointer(_pItem.XzDatabase))
 95230  		return int32(1)
 95231  	}
 95232  	_sqlite3DbFree(tls, (*Xsqlite3)((*XParse)(_pFix.XpParse).Xdb), unsafe.Pointer(_pItem.XzDatabase))
 95233  	_pItem.XzDatabase = nil
 95234  	*(**XSchema)(unsafe.Pointer(&_pItem.XpSchema)) = (*XSchema)(_pFix.XpSchema)
 95235  _7:
 95236  	if _sqlite3FixSelect(tls, _pFix, (*XSelect)(_pItem.XpSelect)) != 0 {
 95237  		return int32(1)
 95238  	}
 95239  	if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pItem.XpOn)) != 0 {
 95240  		return int32(1)
 95241  	}
 95242  	*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pItem }())) += uintptr(68)
 95243  	goto _3
 95244  _6:
 95245  	return int32(0)
 95246  }
 95247  
 95248  var _sqlite3FixSrcListØ00__func__Ø000 [18]int8
 95249  
 95250  func init() {
 95251  	crt.Xstrncpy(nil, &_sqlite3FixSrcListØ00__func__Ø000[0], str(113358), 18)
 95252  }
 95253  
 95254  func _sqlite3FixSelect(tls *crt.TLS, _pFix *XDbFixer, _pSelect *XSelect) (r0 int32) {
 95255  _0:
 95256  	if _pSelect == nil {
 95257  		goto _1
 95258  	}
 95259  	if _sqlite3FixExprList(tls, _pFix, (*XExprList)(_pSelect.XpEList)) != 0 {
 95260  		return int32(1)
 95261  	}
 95262  	if _sqlite3FixSrcList(tls, _pFix, (*XSrcList)(_pSelect.XpSrc)) != 0 {
 95263  		return int32(1)
 95264  	}
 95265  	if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pSelect.XpWhere)) != 0 {
 95266  		return int32(1)
 95267  	}
 95268  	if _sqlite3FixExprList(tls, _pFix, (*XExprList)(_pSelect.XpGroupBy)) != 0 {
 95269  		return int32(1)
 95270  	}
 95271  	if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pSelect.XpHaving)) != 0 {
 95272  		return int32(1)
 95273  	}
 95274  	if _sqlite3FixExprList(tls, _pFix, (*XExprList)(_pSelect.XpOrderBy)) != 0 {
 95275  		return int32(1)
 95276  	}
 95277  	if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pSelect.XpLimit)) != 0 {
 95278  		return int32(1)
 95279  	}
 95280  	if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pSelect.XpOffset)) != 0 {
 95281  		return int32(1)
 95282  	}
 95283  	_pSelect = (*XSelect)(_pSelect.XpPrior)
 95284  	goto _0
 95285  _1:
 95286  	return int32(0)
 95287  }
 95288  
 95289  func _sqlite3FixExprList(tls *crt.TLS, _pFix *XDbFixer, _pList *XExprList) (r0 int32) {
 95290  	var _i int32
 95291  	var _pItem *TExprList_item
 95292  	if _pList == nil {
 95293  		return int32(0)
 95294  	}
 95295  	*func() **TExprList_item { _i = int32(0); return &_pItem }() = (*TExprList_item)(unsafe.Pointer(&_pList.Xa))
 95296  _1:
 95297  	if _i >= _pList.XnExpr {
 95298  		goto _4
 95299  	}
 95300  	if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pItem.XpExpr)) != 0 {
 95301  		return int32(1)
 95302  	}
 95303  	*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pItem }())) += uintptr(20)
 95304  	goto _1
 95305  _4:
 95306  	return int32(0)
 95307  }
 95308  
 95309  func _sqlite3FixExpr(tls *crt.TLS, _pFix *XDbFixer, _pExpr *XExpr) (r0 int32) {
 95310  _0:
 95311  	if _pExpr == nil {
 95312  		goto _1
 95313  	}
 95314  	if int32(_pExpr.Xop) != int32(135) {
 95315  		goto _2
 95316  	}
 95317  	if (((*Xsqlite3)((*XParse)(_pFix.XpParse).Xdb).Xinit).Xbusy) != 0 {
 95318  		_pExpr.Xop = uint8(101)
 95319  		goto _4
 95320  	}
 95321  	_sqlite3ErrorMsg(tls, (*XParse)(_pFix.XpParse), str(113376), unsafe.Pointer(_pFix.XzType))
 95322  	return int32(1)
 95323  
 95324  _4:
 95325  _2:
 95326  	if (_pExpr.Xflags & uint32(8404992)) != (0) {
 95327  		goto _1
 95328  	}
 95329  	if (_pExpr.Xflags & uint32(2048)) == (0) {
 95330  		goto _6
 95331  	}
 95332  	if _sqlite3FixSelect(tls, _pFix, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))) != 0 {
 95333  		return int32(1)
 95334  	}
 95335  	goto _8
 95336  _6:
 95337  	if _sqlite3FixExprList(tls, _pFix, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))) != 0 {
 95338  		return int32(1)
 95339  	}
 95340  _8:
 95341  	if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pExpr.XpRight)) != 0 {
 95342  		return int32(1)
 95343  	}
 95344  	_pExpr = (*XExpr)(_pExpr.XpLeft)
 95345  	goto _0
 95346  _1:
 95347  	return int32(0)
 95348  }
 95349  
 95350  // C comment
 95351  //  /*
 95352  //  ** Set the sort order for the last element on the given ExprList.
 95353  //  */
 95354  func _sqlite3ExprListSetSortOrder(tls *crt.TLS, _p *XExprList, _iSortOrder int32) {
 95355  	if _p == nil {
 95356  		return
 95357  	}
 95358  
 95359  	func() {
 95360  		if _p.XnExpr <= int32(0) {
 95361  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92474), unsafe.Pointer(&_sqlite3ExprListSetSortOrderØ00__func__Ø000), unsafe.Pointer(str(113400)))
 95362  			crt.X__builtin_abort(tls)
 95363  		}
 95364  	}()
 95365  	if _iSortOrder < int32(0) {
 95366  		func() {
 95367  			if int32(elem57((*TExprList_item)(unsafe.Pointer(&_p.Xa)), uintptr(_p.XnExpr-int32(1))).XsortOrder) != int32(0) {
 95368  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92476), unsafe.Pointer(&_sqlite3ExprListSetSortOrderØ00__func__Ø000), unsafe.Pointer(str(113411)))
 95369  				crt.X__builtin_abort(tls)
 95370  			}
 95371  		}()
 95372  		return
 95373  	}
 95374  	elem57((*TExprList_item)(unsafe.Pointer(&_p.Xa)), uintptr(_p.XnExpr-int32(1))).XsortOrder = uint8(_iSortOrder)
 95375  }
 95376  
 95377  var _sqlite3ExprListSetSortOrderØ00__func__Ø000 [28]int8
 95378  
 95379  func init() {
 95380  	crt.Xstrncpy(nil, &_sqlite3ExprListSetSortOrderØ00__func__Ø000[0], str(113453), 28)
 95381  }
 95382  
 95383  // C comment
 95384  //  /*
 95385  //  ** If the expression list pEList contains more than iLimit elements,
 95386  //  ** leave an error message in pParse.
 95387  //  */
 95388  func _sqlite3ExprListCheckLength(tls *crt.TLS, _pParse *XParse, _pEList *XExprList, _zObject *int8) {
 95389  	var _mx int32
 95390  	_mx = *elem8((*int32)(unsafe.Pointer(&((*Xsqlite3)(_pParse.Xdb).XaLimit))), uintptr(2))
 95391  	if (_pEList != nil) && (_pEList.XnExpr > _mx) {
 95392  		_sqlite3ErrorMsg(tls, _pParse, str(113481), unsafe.Pointer(_zObject))
 95393  	}
 95394  }
 95395  
 95396  // C comment
 95397  //  /*
 95398  //  ** Resolve names in expressions that can only reference a single table:
 95399  //  **
 95400  //  **    *   CHECK constraints
 95401  //  **    *   WHERE clauses on partial indices
 95402  //  **
 95403  //  ** The Expr.iTable value for Expr.op==TK_COLUMN nodes of the expression
 95404  //  ** is set to -1 and the Expr.iColumn value is set to the column number.
 95405  //  **
 95406  //  ** Any errors cause an error message to be set in pParse.
 95407  //  */
 95408  func _sqlite3ResolveSelfReference(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _type int32, _pExpr *XExpr, _pList *XExprList) {
 95409  	var _sSrc XSrcList
 95410  	var _sNC XNameContext
 95411  	func() {
 95412  		if _type != int32(4) && _type != int32(2) && _type != int32(32) {
 95413  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(90883), unsafe.Pointer(&_sqlite3ResolveSelfReferenceØ00__func__Ø000), unsafe.Pointer(str(113504)))
 95414  			crt.X__builtin_abort(tls)
 95415  		}
 95416  	}()
 95417  	crt.Xmemset(tls, unsafe.Pointer(&_sNC), int32(0), uint32(32))
 95418  	crt.Xmemset(tls, unsafe.Pointer(&_sSrc), int32(0), uint32(76))
 95419  	_sSrc.XnSrc = int32(1)
 95420  	elem6((*TSrcList_item)(unsafe.Pointer(&_sSrc.Xa)), 0).XzName = _pTab.XzName
 95421  	*(**XTable)(unsafe.Pointer(&(elem6((*TSrcList_item)(unsafe.Pointer(&_sSrc.Xa)), 0).XpTab))) = _pTab
 95422  	elem6((*TSrcList_item)(unsafe.Pointer(&_sSrc.Xa)), 0).XiCursor = int32(-1)
 95423  	*(**XParse)(unsafe.Pointer(&_sNC.XpParse)) = _pParse
 95424  	*(**XSrcList)(unsafe.Pointer(&_sNC.XpSrcList)) = &_sSrc
 95425  	_sNC.XncFlags = uint16(_type)
 95426  	if _sqlite3ResolveExprNames(tls, &_sNC, _pExpr) != 0 {
 95427  		return
 95428  	}
 95429  	if _pList != nil {
 95430  		_sqlite3ResolveExprListNames(tls, &_sNC, _pList)
 95431  	}
 95432  }
 95433  
 95434  var _sqlite3ResolveSelfReferenceØ00__func__Ø000 [28]int8
 95435  
 95436  func init() {
 95437  	crt.Xstrncpy(nil, &_sqlite3ResolveSelfReferenceØ00__func__Ø000[0], str(113561), 28)
 95438  }
 95439  
 95440  // C comment
 95441  //  /*
 95442  //  ** Backwards Compatibility Hack:
 95443  //  **
 95444  //  ** Historical versions of SQLite accepted strings as column names in
 95445  //  ** indexes and PRIMARY KEY constraints and in UNIQUE constraints.  Example:
 95446  //  **
 95447  //  **     CREATE TABLE xyz(a,b,c,d,e,PRIMARY KEY('a'),UNIQUE('b','c' COLLATE trim)
 95448  //  **     CREATE INDEX abc ON xyz('c','d' DESC,'e' COLLATE nocase DESC);
 95449  //  **
 95450  //  ** This is goofy.  But to preserve backwards compatibility we continue to
 95451  //  ** accept it.  This routine does the necessary conversion.  It converts
 95452  //  ** the expression given in its argument from a TK_STRING into a TK_ID
 95453  //  ** if the expression is just a TK_STRING with an optional COLLATE clause.
 95454  //  ** If the epxression is anything other than TK_STRING, the expression is
 95455  //  ** unchanged.
 95456  //  */
 95457  func _sqlite3StringToId(tls *crt.TLS, _p *XExpr) {
 95458  	if int32(_p.Xop) == int32(97) {
 95459  		_p.Xop = uint8(27)
 95460  		goto _3
 95461  	}
 95462  	if (int32(_p.Xop) == int32(94)) && (int32((*XExpr)(_p.XpLeft).Xop) == int32(97)) {
 95463  		(*XExpr)(_p.XpLeft).Xop = uint8(27)
 95464  	}
 95465  _3:
 95466  }
 95467  
 95468  // C comment
 95469  //  /* Return true if value x is found any of the first nCol entries of aiCol[]
 95470  //  */
 95471  func _hasColumn(tls *crt.TLS, _aiCol *int16, _nCol int32, _x int32) (r0 int32) {
 95472  _0:
 95473  	if postInc2(&_nCol, -1) <= int32(0) {
 95474  		goto _1
 95475  	}
 95476  	if _x == int32(*postInc50(&_aiCol, 2)) {
 95477  		return int32(1)
 95478  	}
 95479  	goto _0
 95480  _1:
 95481  	return int32(0)
 95482  }
 95483  
 95484  // C comment
 95485  //  /*
 95486  //  ** Estimate the average size of a row for an index.
 95487  //  */
 95488  func _estimateIndexWidth(tls *crt.TLS, _pIdx *XIndex) {
 95489  	var _1_x int16
 95490  	var _i int32
 95491  	var _wIndex uint32
 95492  	var _aCol *XColumn
 95493  	_wIndex = uint32(0)
 95494  	_aCol = (*XColumn)((*XTable)(_pIdx.XpTable).XaCol)
 95495  	_i = int32(0)
 95496  _0:
 95497  	if _i >= int32(_pIdx.XnColumn) {
 95498  		goto _3
 95499  	}
 95500  	_1_x = *elem50(_pIdx.XaiColumn, uintptr(_i))
 95501  	func() {
 95502  		if int32(_1_x) >= int32((*XTable)(_pIdx.XpTable).XnCol) {
 95503  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101344), unsafe.Pointer(&_estimateIndexWidthØ00__func__Ø000), unsafe.Pointer(str(113589)))
 95504  			crt.X__builtin_abort(tls)
 95505  		}
 95506  	}()
 95507  	_wIndex += uint32(func() int32 {
 95508  		if int32(_1_x) < int32(0) {
 95509  			return int32(1)
 95510  		}
 95511  		return int32(elem41(_aCol, uintptr(*elem50(_pIdx.XaiColumn, uintptr(_i)))).XszEst)
 95512  	}())
 95513  	_i += 1
 95514  	goto _0
 95515  _3:
 95516  	_pIdx.XszIdxRow = _sqlite3LogEst(tls, uint64(_wIndex*uint32(4)))
 95517  }
 95518  
 95519  var _estimateIndexWidthØ00__func__Ø000 [19]int8
 95520  
 95521  func init() {
 95522  	crt.Xstrncpy(nil, &_estimateIndexWidthØ00__func__Ø000[0], str(113610), 19)
 95523  }
 95524  
 95525  // C comment
 95526  //  /*
 95527  //  ** Run the parser and code generator recursively in order to generate
 95528  //  ** code for the SQL statement given onto the end of the pParse context
 95529  //  ** currently under construction.  When the parser is run recursively
 95530  //  ** this way, the final OP_Halt is not appended and other initialization
 95531  //  ** and finalization steps are omitted because those are handling by the
 95532  //  ** outermost parser.
 95533  //  **
 95534  //  ** Not everything is nestable.  This facility is designed to permit
 95535  //  ** INSERT, UPDATE, and DELETE operations against SQLITE_MASTER.  Use
 95536  //  ** care if you decide to try to use this routine for some other purposes.
 95537  //  */
 95538  func _sqlite3NestedParse(tls *crt.TLS, _pParse *XParse, _zFormat *int8, args ...interface{}) {
 95539  	var _zSql, _zErrMsg *int8
 95540  	var _ap []interface{}
 95541  	var _db *Xsqlite3
 95542  	var _saveBuf [84]int8
 95543  	_zErrMsg = nil
 95544  	_db = (*Xsqlite3)(_pParse.Xdb)
 95545  	if _pParse.XnErr != 0 {
 95546  		return
 95547  	}
 95548  	func() {
 95549  		if int32(_pParse.Xnested) >= int32(10) {
 95550  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99955), unsafe.Pointer(&_sqlite3NestedParseØ00__func__Ø000), unsafe.Pointer(str(113629)))
 95551  			crt.X__builtin_abort(tls)
 95552  		}
 95553  	}()
 95554  	_ap = args
 95555  	_zSql = _sqlite3VMPrintf(tls, _db, _zFormat, _ap)
 95556  	_ap = nil
 95557  	if _zSql == nil {
 95558  		return
 95559  	}
 95560  	_pParse.Xnested += 1
 95561  	crt.Xmemcpy(tls, unsafe.Pointer(&_saveBuf), unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParse))+uintptr(uint32(400))))), uint32(84))
 95562  	crt.Xmemset(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParse))+uintptr(uint32(400))))), int32(0), uint32(84))
 95563  	_sqlite3RunParser(tls, _pParse, _zSql, &_zErrMsg)
 95564  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErrMsg))
 95565  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zSql))
 95566  	crt.Xmemcpy(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParse))+uintptr(uint32(400))))), unsafe.Pointer(&_saveBuf), uint32(84))
 95567  	_pParse.Xnested -= 1
 95568  	_ = _saveBuf
 95569  }
 95570  
 95571  var _sqlite3NestedParseØ00__func__Ø000 [19]int8
 95572  
 95573  func init() {
 95574  	crt.Xstrncpy(nil, &_sqlite3NestedParseØ00__func__Ø000[0], str(113647), 19)
 95575  }
 95576  
 95577  // C comment
 95578  //  /*
 95579  //  ** Generate code that will erase and refill index *pIdx.  This is
 95580  //  ** used to initialize a newly created index or to recompute the
 95581  //  ** content of an index in response to a REINDEX command.
 95582  //  **
 95583  //  ** if memRootPage is not negative, it means that the index is newly
 95584  //  ** created.  The register specified by memRootPage contains the
 95585  //  ** root page number of the index.  If memRootPage is negative, then
 95586  //  ** the index already exists and must be cleared before being refilled and
 95587  //  ** the root page number of the index is taken from pIndex->tnum.
 95588  //  */
 95589  func _sqlite3RefillIndex(tls *crt.TLS, _pParse *XParse, _pIndex *XIndex, _memRootPage int32) {
 95590  	var _iTab, _iIdx, _iSorter, _addr1, _addr2, _tnum, _iPartIdxLabel, _regRecord, _iDb, _4_j2 int32
 95591  	var _db *Xsqlite3
 95592  	var _pTab *XTable
 95593  	var _v *TVdbe
 95594  	var _pKey *XKeyInfo
 95595  	_pTab = (*XTable)(_pIndex.XpTable)
 95596  	_iTab = postInc2(&_pParse.XnTab, 1)
 95597  	_iIdx = postInc2(&_pParse.XnTab, 1)
 95598  	_db = (*Xsqlite3)(_pParse.Xdb)
 95599  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pIndex.XpSchema))
 95600  	if _sqlite3AuthCheck(tls, _pParse, int32(27), _pIndex.XzName, nil, elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName) != 0 {
 95601  		return
 95602  	}
 95603  	_sqlite3TableLock(tls, _pParse, _iDb, _pTab.Xtnum, uint8(1), _pTab.XzName)
 95604  	_v = _sqlite3GetVdbe(tls, _pParse)
 95605  	if _v == nil {
 95606  		return
 95607  	}
 95608  	if _memRootPage >= int32(0) {
 95609  		_tnum = _memRootPage
 95610  		goto _3
 95611  	}
 95612  	_tnum = _pIndex.Xtnum
 95613  _3:
 95614  	_pKey = _sqlite3KeyInfoOfIndex(tls, _pParse, _pIndex)
 95615  	func() {
 95616  		if _pKey == nil && _db.XmallocFailed == 0 && _pParse.XnErr == 0 {
 95617  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102495), unsafe.Pointer(&_sqlite3RefillIndexØ00__func__Ø000), unsafe.Pointer(str(113666)))
 95618  			crt.X__builtin_abort(tls)
 95619  		}
 95620  	}()
 95621  	_iSorter = postInc2(&_pParse.XnTab, 1)
 95622  	_sqlite3VdbeAddOp4(tls, _v, int32(111), _iSorter, int32(0), int32(_pIndex.XnKeyCol), (*int8)(unsafe.Pointer(_sqlite3KeyInfoRef(tls, _pKey))), int32(-5))
 95623  	_sqlite3OpenTable(tls, _pParse, _iTab, _iDb, _pTab, int32(106))
 95624  	_addr1 = _sqlite3VdbeAddOp2(tls, _v, int32(37), _iTab, int32(0))
 95625  	_regRecord = _sqlite3GetTempReg(tls, _pParse)
 95626  	_sqlite3GenerateIndexKey(tls, _pParse, _pIndex, _iTab, _regRecord, int32(0), &_iPartIdxLabel, nil, int32(0))
 95627  	_sqlite3VdbeAddOp2(tls, _v, int32(127), _iSorter, _regRecord)
 95628  	_sqlite3ResolvePartIdxLabel(tls, _pParse, _iPartIdxLabel)
 95629  	_sqlite3VdbeAddOp2(tls, _v, int32(7), _iTab, _addr1+int32(1))
 95630  	_sqlite3VdbeJumpHere(tls, _v, _addr1)
 95631  	if _memRootPage < int32(0) {
 95632  		_sqlite3VdbeAddOp2(tls, _v, int32(134), _tnum, _iDb)
 95633  	}
 95634  	_sqlite3VdbeAddOp4(tls, _v, int32(107), _iIdx, _tnum, _iDb, (*int8)(unsafe.Pointer(_pKey)), int32(-5))
 95635  	_sqlite3VdbeChangeP5(tls, _v, uint16(int32(1)|func() int32 {
 95636  		if _memRootPage >= int32(0) {
 95637  			return int32(16)
 95638  		}
 95639  		return int32(0)
 95640  	}()))
 95641  	_addr1 = _sqlite3VdbeAddOp2(tls, _v, int32(35), _iSorter, int32(0))
 95642  	if int32(_pIndex.XonError) != int32(0) {
 95643  		_4_j2 = _sqlite3VdbeCurrentAddr(tls, _v) + int32(3)
 95644  		_sqlite3VdbeGoto(tls, _v, _4_j2)
 95645  		_addr2 = _sqlite3VdbeCurrentAddr(tls, _v)
 95646  		_sqlite3VdbeAddOp4Int(tls, _v, int32(122), _iSorter, _4_j2, _regRecord, int32(_pIndex.XnKeyCol))
 95647  		_sqlite3UniqueConstraint(tls, _pParse, int32(2), _pIndex)
 95648  		goto _12
 95649  	}
 95650  	_addr2 = _sqlite3VdbeCurrentAddr(tls, _v)
 95651  _12:
 95652  	_sqlite3VdbeAddOp3(tls, _v, int32(123), _iSorter, _regRecord, _iIdx)
 95653  	_sqlite3VdbeAddOp3(tls, _v, int32(33), _iIdx, int32(0), int32(-1))
 95654  	_sqlite3VdbeAddOp2(tls, _v, int32(128), _iIdx, _regRecord)
 95655  	_sqlite3VdbeChangeP5(tls, _v, uint16(16))
 95656  	_sqlite3ReleaseTempReg(tls, _pParse, _regRecord)
 95657  	_sqlite3VdbeAddOp2(tls, _v, int32(3), _iSorter, _addr2)
 95658  	_sqlite3VdbeJumpHere(tls, _v, _addr1)
 95659  	_sqlite3VdbeAddOp1(tls, _v, int32(114), _iTab)
 95660  	_sqlite3VdbeAddOp1(tls, _v, int32(114), _iIdx)
 95661  	_sqlite3VdbeAddOp1(tls, _v, int32(114), _iSorter)
 95662  }
 95663  
 95664  var _sqlite3RefillIndexØ00__func__Ø000 [19]int8
 95665  
 95666  func init() {
 95667  	crt.Xstrncpy(nil, &_sqlite3RefillIndexØ00__func__Ø000[0], str(113710), 19)
 95668  }
 95669  
 95670  // C comment
 95671  //  /*
 95672  //  ** If a prior call to sqlite3GenerateIndexKey() generated a jump-over label
 95673  //  ** because it was a partial index, then this routine should be called to
 95674  //  ** resolve that label.
 95675  //  */
 95676  func _sqlite3ResolvePartIdxLabel(tls *crt.TLS, _pParse *XParse, _iLabel int32) {
 95677  	if _iLabel != 0 {
 95678  		_sqlite3VdbeResolveLabel(tls, (*TVdbe)(_pParse.XpVdbe), _iLabel)
 95679  		_sqlite3ExprCachePop(tls, _pParse)
 95680  	}
 95681  }
 95682  
 95683  // C comment
 95684  //  /*
 95685  //  ** Code an OP_Halt due to UNIQUE or PRIMARY KEY constraint violation.
 95686  //  */
 95687  func _sqlite3UniqueConstraint(tls *crt.TLS, _pParse *XParse, _onError int32, _pIdx *XIndex) {
 95688  	var _j int32
 95689  	var _zErr, _3_zCol *int8
 95690  	var _pTab *XTable
 95691  	var _errMsg XStrAccum
 95692  	_pTab = (*XTable)(_pIdx.XpTable)
 95693  	_sqlite3StrAccumInit(tls, &_errMsg, (*Xsqlite3)(_pParse.Xdb), nil, int32(0), int32(200))
 95694  	if _pIdx.XaColExpr != nil {
 95695  		_sqlite3XPrintf(tls, &_errMsg, str(113729), unsafe.Pointer(_pIdx.XzName))
 95696  		goto _1
 95697  	}
 95698  	_j = int32(0)
 95699  _2:
 95700  	if _j >= int32(_pIdx.XnKeyCol) {
 95701  		goto _5
 95702  	}
 95703  	func() {
 95704  		if int32(*elem50(_pIdx.XaiColumn, uintptr(_j))) < int32(0) {
 95705  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103877), unsafe.Pointer(&_sqlite3UniqueConstraintØ00__func__Ø000), unsafe.Pointer(str(113740)))
 95706  			crt.X__builtin_abort(tls)
 95707  		}
 95708  	}()
 95709  	_3_zCol = elem41((*XColumn)(_pTab.XaCol), uintptr(*elem50(_pIdx.XaiColumn, uintptr(_j)))).XzName
 95710  	if _j != 0 {
 95711  		_sqlite3StrAccumAppend(tls, &_errMsg, str(113761), int32(2))
 95712  	}
 95713  	_sqlite3XPrintf(tls, &_errMsg, str(7919), unsafe.Pointer(_pTab.XzName), unsafe.Pointer(_3_zCol))
 95714  	_j += 1
 95715  	goto _2
 95716  _5:
 95717  _1:
 95718  	_zErr = _sqlite3StrAccumFinish(tls, &_errMsg)
 95719  	_sqlite3HaltConstraint(tls, _pParse, func() int32 {
 95720  		if int32((uint32(_pIdx.XidxType)<<30)>>30) == int32(2) {
 95721  			return int32(1555)
 95722  		}
 95723  		return int32(2067)
 95724  	}(), _onError, _zErr, int8(-1), uint8(2))
 95725  }
 95726  
 95727  var _sqlite3UniqueConstraintØ00__func__Ø000 [24]int8
 95728  
 95729  func init() {
 95730  	crt.Xstrncpy(nil, &_sqlite3UniqueConstraintØ00__func__Ø000[0], str(113764), 24)
 95731  }
 95732  
 95733  // C comment
 95734  //  /*
 95735  //  ** Generate code that will increment the schema cookie.
 95736  //  **
 95737  //  ** The schema cookie is used to determine when the schema for the
 95738  //  ** database changes.  After each schema change, the cookie value
 95739  //  ** changes.  When a process first reads the schema it records the
 95740  //  ** cookie.  Thereafter, whenever it goes to access the database,
 95741  //  ** it checks the cookie to make sure the schema has not changed
 95742  //  ** since it was last read.
 95743  //  **
 95744  //  ** This plan is not completely bullet-proof.  It is possible for
 95745  //  ** the schema to change multiple times and for the cookie to be
 95746  //  ** set back to prior value.  But schema changes are infrequent
 95747  //  ** and the probability of hitting the same cookie value is only
 95748  //  ** 1 chance in 2^32.  So we're safe enough.
 95749  //  **
 95750  //  ** IMPLEMENTATION-OF: R-34230-56049 SQLite automatically increments
 95751  //  ** the schema-version whenever the schema changes.
 95752  //  */
 95753  func _sqlite3ChangeCookie(tls *crt.TLS, _pParse *XParse, _iDb int32) {
 95754  	var _db *Xsqlite3
 95755  	var _v *TVdbe
 95756  	_db = (*Xsqlite3)(_pParse.Xdb)
 95757  	_v = (*TVdbe)(_pParse.XpVdbe)
 95758  	func() {
 95759  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
 95760  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101170), unsafe.Pointer(&_sqlite3ChangeCookieØ00__func__Ø000), unsafe.Pointer(str(51126)))
 95761  			crt.X__builtin_abort(tls)
 95762  		}
 95763  	}()
 95764  	_sqlite3VdbeAddOp3(tls, _v, int32(104), _iDb, int32(1), ((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema).Xschema_cookie)+int32(1))
 95765  }
 95766  
 95767  var _sqlite3ChangeCookieØ00__func__Ø000 [20]int8
 95768  
 95769  func init() {
 95770  	crt.Xstrncpy(nil, &_sqlite3ChangeCookieØ00__func__Ø000[0], str(113788), 20)
 95771  }
 95772  
 95773  // C comment
 95774  //  /*
 95775  //  ** Add an OP_ParseSchema opcode.  This routine is broken out from
 95776  //  ** sqlite3VdbeAddOp4() since it needs to also needs to mark all btrees
 95777  //  ** as having been used.
 95778  //  **
 95779  //  ** The zWhere string must have been obtained from sqlite3_malloc().
 95780  //  ** This routine will take ownership of the allocated memory.
 95781  //  */
 95782  func _sqlite3VdbeAddParseSchemaOp(tls *crt.TLS, _p *TVdbe, _iDb int32, _zWhere *int8) {
 95783  	var _j int32
 95784  	_sqlite3VdbeAddOp4(tls, _p, int32(139), _iDb, int32(0), int32(0), _zWhere, int32(-1))
 95785  	_j = int32(0)
 95786  _0:
 95787  	if _j >= ((*Xsqlite3)(_p.Xdb).XnDb) {
 95788  		goto _3
 95789  	}
 95790  	_sqlite3VdbeUsesBtree(tls, _p, _j)
 95791  	_j += 1
 95792  	goto _0
 95793  _3:
 95794  }
 95795  
 95796  // C comment
 95797  //  /*
 95798  //  ** Resize an Index object to hold N columns total.  Return SQLITE_OK
 95799  //  ** on success and SQLITE_NOMEM on an OOM error.
 95800  //  */
 95801  func _resizeIndexObject(tls *crt.TLS, _db *Xsqlite3, _pIdx *XIndex, _N int32) (r0 int32) {
 95802  	var _nByte int32
 95803  	var _zExtra *int8
 95804  	if int32(_pIdx.XnColumn) >= _N {
 95805  		return int32(0)
 95806  	}
 95807  	func() {
 95808  		if int32((uint32(_pIdx.XidxType>>4)<<31)>>31) != int32(0) {
 95809  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101304), unsafe.Pointer(&_resizeIndexObjectØ00__func__Ø000), unsafe.Pointer(str(113808)))
 95810  			crt.X__builtin_abort(tls)
 95811  		}
 95812  	}()
 95813  	_nByte = int32(uint32(7) * uint32(_N))
 95814  	_zExtra = (*int8)(_sqlite3DbMallocZero(tls, _db, uint64(_nByte)))
 95815  	if _zExtra == nil {
 95816  		return _sqlite3NomemError(tls, int32(101307))
 95817  	}
 95818  	crt.Xmemcpy(tls, unsafe.Pointer(_zExtra), unsafe.Pointer(_pIdx.XazColl), uint32(4)*uint32(_pIdx.XnColumn))
 95819  	_pIdx.XazColl = (**int8)(unsafe.Pointer(_zExtra))
 95820  	*(*uintptr)(unsafe.Pointer(&_zExtra)) += uintptr(uint32(4) * uint32(_N))
 95821  	crt.Xmemcpy(tls, unsafe.Pointer(_zExtra), unsafe.Pointer(_pIdx.XaiColumn), uint32(2)*uint32(_pIdx.XnColumn))
 95822  	_pIdx.XaiColumn = (*int16)(unsafe.Pointer(_zExtra))
 95823  	*(*uintptr)(unsafe.Pointer(&_zExtra)) += uintptr(uint32(2) * uint32(_N))
 95824  	crt.Xmemcpy(tls, unsafe.Pointer(_zExtra), unsafe.Pointer(_pIdx.XaSortOrder), uint32(_pIdx.XnColumn))
 95825  	_pIdx.XaSortOrder = (*uint8)(unsafe.Pointer(_zExtra))
 95826  	_pIdx.XnColumn = uint16(_N)
 95827  	storebits5(&_pIdx.XidxType, int8(1), 16, 4)
 95828  	return int32(0)
 95829  }
 95830  
 95831  var _resizeIndexObjectØ00__func__Ø000 [18]int8
 95832  
 95833  func init() {
 95834  	crt.Xstrncpy(nil, &_resizeIndexObjectØ00__func__Ø000[0], str(113827), 18)
 95835  }
 95836  
 95837  // C comment
 95838  //  /*
 95839  //  ** Estimate the total row width for a table.
 95840  //  */
 95841  func _estimateTableWidth(tls *crt.TLS, _pTab *XTable) {
 95842  	var _i int32
 95843  	var _wTable uint32
 95844  	var _pTabCol *XColumn
 95845  	_wTable = uint32(0)
 95846  	*func() **XColumn { _i = int32(_pTab.XnCol); return &_pTabCol }() = (*XColumn)(_pTab.XaCol)
 95847  _0:
 95848  	if _i <= int32(0) {
 95849  		goto _3
 95850  	}
 95851  	_wTable += uint32(_pTabCol.XszEst)
 95852  	*(*uintptr)(unsafe.Pointer(func() **XColumn { _i -= 1; return &_pTabCol }())) += uintptr(16)
 95853  	goto _0
 95854  _3:
 95855  	if int32(_pTab.XiPKey) < int32(0) {
 95856  		_wTable += 1
 95857  	}
 95858  	_pTab.XszTabRow = _sqlite3LogEst(tls, uint64(_wTable*uint32(4)))
 95859  }
 95860  
 95861  // C comment
 95862  //  /*
 95863  //  ** Compute the affinity string for table pTab, if it has not already been
 95864  //  ** computed.  As an optimization, omit trailing SQLITE_AFF_BLOB affinities.
 95865  //  **
 95866  //  ** If the affinity exists (if it is no entirely SQLITE_AFF_BLOB values) and
 95867  //  ** if iReg>0 then code an OP_Affinity opcode that will set the affinities
 95868  //  ** for register iReg and following.  Or if affinities exists and iReg==0,
 95869  //  ** then just set the P4 operand of the previous opcode (which should  be
 95870  //  ** an OP_MakeRecord) to the affinity string.
 95871  //  **
 95872  //  ** A column affinity string has one character per column:
 95873  //  **
 95874  //  **  Character      Column affinity
 95875  //  **  ------------------------------
 95876  //  **  'A'            BLOB
 95877  //  **  'B'            TEXT
 95878  //  **  'C'            NUMERIC
 95879  //  **  'D'            INTEGER
 95880  //  **  'E'            REAL
 95881  //  */
 95882  func _sqlite3TableAffinity(tls *crt.TLS, _v *TVdbe, _pTab *XTable, _iReg int32) {
 95883  	var _i int32
 95884  	var _zColAff *int8
 95885  	var _1_db *Xsqlite3
 95886  	_zColAff = _pTab.XzColAff
 95887  	if _zColAff != nil {
 95888  		goto _0
 95889  	}
 95890  	_1_db = _sqlite3VdbeDb(tls, _v)
 95891  	_zColAff = (*int8)(_sqlite3DbMallocRaw(tls, nil, uint64(int32(_pTab.XnCol)+int32(1))))
 95892  	if _zColAff == nil {
 95893  		_sqlite3OomFault(tls, _1_db)
 95894  		return
 95895  	}
 95896  	_i = int32(0)
 95897  _2:
 95898  	if _i >= int32(_pTab.XnCol) {
 95899  		goto _5
 95900  	}
 95901  	*elem1(_zColAff, uintptr(_i)) = elem41((*XColumn)(_pTab.XaCol), uintptr(_i)).Xaffinity
 95902  	_i += 1
 95903  	goto _2
 95904  _5:
 95905  	*elem1(_zColAff, uintptr(postInc2(&_i, -1))) = 0
 95906  	if (_i >= int32(0)) && (int32(*elem1(_zColAff, uintptr(_i))) == int32(65)) {
 95907  		goto _5
 95908  	}
 95909  	_pTab.XzColAff = _zColAff
 95910  _0:
 95911  	_i = _sqlite3Strlen30(tls, _zColAff)
 95912  	if _i == 0 {
 95913  		goto _8
 95914  	}
 95915  	if _iReg != 0 {
 95916  		_sqlite3VdbeAddOp4(tls, _v, int32(100), _iReg, _i, int32(0), _zColAff, _i)
 95917  		goto _10
 95918  	}
 95919  	_sqlite3VdbeChangeP4(tls, _v, int32(-1), _zColAff, _i)
 95920  _10:
 95921  _8:
 95922  }
 95923  
 95924  // C comment
 95925  //  /*
 95926  //  ** Generate a CREATE TABLE statement appropriate for the given
 95927  //  ** table.  Memory to hold the text of the statement is obtained
 95928  //  ** from sqliteMalloc() and must be freed by the calling function.
 95929  //  */
 95930  func _createTableStmt(tls *crt.TLS, _db *Xsqlite3, _p *XTable) (r0 *int8) {
 95931  	var _i, _k, _n, _5_len int32
 95932  	var _zStmt, _zSep, _zSep2, _zEnd, _5_zType *int8
 95933  	var _pCol *XColumn
 95934  	_n = int32(0)
 95935  	*func() *int32 { _pCol = (*XColumn)(_p.XaCol); return &_i }() = int32(0)
 95936  _0:
 95937  	if _i >= int32(_p.XnCol) {
 95938  		goto _3
 95939  	}
 95940  	_n += _identLength(tls, _pCol.XzName) + int32(5)
 95941  	*(*uintptr)(unsafe.Pointer(func() **XColumn { _i += 1; return &_pCol }())) += uintptr(16)
 95942  	goto _0
 95943  _3:
 95944  	_n += _identLength(tls, _p.XzName)
 95945  	if _n < int32(50) {
 95946  		_zSep = str(284)
 95947  		_zSep2 = str(107791)
 95948  		_zEnd = str(37853)
 95949  		goto _5
 95950  	}
 95951  	_zSep = str(113845)
 95952  	_zSep2 = str(113849)
 95953  	_zEnd = str(113854)
 95954  _5:
 95955  	_n += int32(35) + (int32(6) * int32(_p.XnCol))
 95956  	_zStmt = (*int8)(_sqlite3DbMallocRaw(tls, nil, uint64(_n)))
 95957  	if _zStmt == nil {
 95958  		_sqlite3OomFault(tls, _db)
 95959  		return nil
 95960  	}
 95961  	Xsqlite3_snprintf(tls, _n, _zStmt, str(113857))
 95962  	_k = _sqlite3Strlen30(tls, _zStmt)
 95963  	_identPut(tls, _zStmt, &_k, _p.XzName)
 95964  	*elem1(_zStmt, uintptr(postInc2(&_k, 1))) = int8(40)
 95965  	*func() *int32 { _pCol = (*XColumn)(_p.XaCol); return &_i }() = int32(0)
 95966  _7:
 95967  	if _i >= int32(_p.XnCol) {
 95968  		goto _10
 95969  	}
 95970  	Xsqlite3_snprintf(tls, _n-_k, elem1(_zStmt, uintptr(_k)), _zSep)
 95971  	_k += _sqlite3Strlen30(tls, elem1(_zStmt, uintptr(_k)))
 95972  	_zSep = _zSep2
 95973  	_identPut(tls, _zStmt, &_k, _pCol.XzName)
 95974  	func() {
 95975  		if (int32(_pCol.Xaffinity) - int32(65)) < int32(0) {
 95976  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101276), unsafe.Pointer(&_createTableStmtØ00__func__Ø000), unsafe.Pointer(str(113871)))
 95977  			crt.X__builtin_abort(tls)
 95978  		}
 95979  	}()
 95980  	func() {
 95981  		if (int32(_pCol.Xaffinity) - int32(65)) >= int32(5) {
 95982  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101277), unsafe.Pointer(&_createTableStmtØ00__func__Ø000), unsafe.Pointer(str(113907)))
 95983  			crt.X__builtin_abort(tls)
 95984  		}
 95985  	}()
 95986  	_5_zType = *elem0((**int8)(unsafe.Pointer(&_createTableStmtØ00azTypeØ001)), uintptr(int32(_pCol.Xaffinity)-int32(65)))
 95987  	_5_len = _sqlite3Strlen30(tls, _5_zType)
 95988  	func() {
 95989  		if int32(_pCol.Xaffinity) != int32(65) && int32(_pCol.Xaffinity) != int32(_sqlite3AffinityType(tls, _5_zType, nil)) {
 95990  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101286), unsafe.Pointer(&_createTableStmtØ00__func__Ø000), unsafe.Pointer(str(113958)))
 95991  			crt.X__builtin_abort(tls)
 95992  		}
 95993  	}()
 95994  	crt.Xmemcpy(tls, unsafe.Pointer(elem1(_zStmt, uintptr(_k))), unsafe.Pointer(_5_zType), uint32(_5_len))
 95995  	_k += _5_len
 95996  	func() {
 95997  		if _k > _n {
 95998  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101290), unsafe.Pointer(&_createTableStmtØ00__func__Ø000), unsafe.Pointer(str(114039)))
 95999  			crt.X__builtin_abort(tls)
 96000  		}
 96001  	}()
 96002  	*(*uintptr)(unsafe.Pointer(func() **XColumn { _i += 1; return &_pCol }())) += uintptr(16)
 96003  	goto _7
 96004  _10:
 96005  	Xsqlite3_snprintf(tls, _n-_k, elem1(_zStmt, uintptr(_k)), str(24531), unsafe.Pointer(_zEnd))
 96006  	return _zStmt
 96007  }
 96008  
 96009  // C comment
 96010  //  /*
 96011  //  ** Measure the number of characters needed to output the given
 96012  //  ** identifier.  The number returned includes any quotes used
 96013  //  ** but does not include the null terminator.
 96014  //  **
 96015  //  ** The estimate is conservative.  It might be larger that what is
 96016  //  ** really needed.
 96017  //  */
 96018  func _identLength(tls *crt.TLS, _z *int8) (r0 int32) {
 96019  	var _n int32
 96020  	_n = int32(0)
 96021  _0:
 96022  	if (*_z) == 0 {
 96023  		goto _3
 96024  	}
 96025  	if int32(*_z) == int32(34) {
 96026  		_n += 1
 96027  	}
 96028  	*(*uintptr)(unsafe.Pointer(func() **int8 { _n += 1; return &_z }())) += uintptr(1)
 96029  	goto _0
 96030  _3:
 96031  	return _n + int32(2)
 96032  }
 96033  
 96034  // C comment
 96035  //  /*
 96036  //  ** The first parameter is a pointer to an output buffer. The second
 96037  //  ** parameter is a pointer to an integer that contains the offset at
 96038  //  ** which to write into the output buffer. This function copies the
 96039  //  ** nul-terminated string pointed to by the third parameter, zSignedIdent,
 96040  //  ** to the specified offset in the buffer and updates *pIdx to refer
 96041  //  ** to the first byte after the last byte written before returning.
 96042  //  **
 96043  //  ** If the string zSignedIdent consists entirely of alpha-numeric
 96044  //  ** characters, does not begin with a digit and is not an SQL keyword,
 96045  //  ** then it is copied to the output buffer exactly as it is. Otherwise,
 96046  //  ** it is quoted using double-quotes.
 96047  //  */
 96048  func _identPut(tls *crt.TLS, _z *int8, _pIdx *int32, _zSignedIdent *int8) {
 96049  	var _i, _j, _needQuote int32
 96050  	var _zIdent *uint8
 96051  	_zIdent = (*uint8)(unsafe.Pointer(_zSignedIdent))
 96052  	_i = *_pIdx
 96053  	_j = int32(0)
 96054  _0:
 96055  	if (*elem15(_zIdent, uintptr(_j))) == 0 {
 96056  		goto _3
 96057  	}
 96058  	if ((int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(*elem15(_zIdent, uintptr(_j))))) & int32(6)) == 0) && (int32(*elem15(_zIdent, uintptr(_j))) != int32(95)) {
 96059  		goto _3
 96060  	}
 96061  	_j += 1
 96062  	goto _0
 96063  _3:
 96064  	_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)))
 96065  	if _needQuote != 0 {
 96066  		*elem1(_z, uintptr(postInc2(&_i, 1))) = int8(34)
 96067  	}
 96068  	_j = int32(0)
 96069  _10:
 96070  	if (*elem15(_zIdent, uintptr(_j))) == 0 {
 96071  		goto _13
 96072  	}
 96073  	*elem1(_z, uintptr(postInc2(&_i, 1))) = int8(*elem15(_zIdent, uintptr(_j)))
 96074  	if int32(*elem15(_zIdent, uintptr(_j))) == int32(34) {
 96075  		*elem1(_z, uintptr(postInc2(&_i, 1))) = int8(34)
 96076  	}
 96077  	_j += 1
 96078  	goto _10
 96079  _13:
 96080  	if _needQuote != 0 {
 96081  		*elem1(_z, uintptr(postInc2(&_i, 1))) = int8(34)
 96082  	}
 96083  	*elem1(_z, uintptr(_i)) = 0
 96084  	*_pIdx = _i
 96085  }
 96086  
 96087  func _sqlite3KeywordCode(tls *crt.TLS, _z *uint8, _n int32) (r0 int32) {
 96088  	var _id int32
 96089  	_id = int32(27)
 96090  	_keywordCode(tls, (*int8)(unsafe.Pointer(_z)), _n, &_id)
 96091  	return _id
 96092  }
 96093  
 96094  var _createTableStmtØ00__func__Ø000 [16]int8
 96095  
 96096  func init() {
 96097  	crt.Xstrncpy(nil, &_createTableStmtØ00__func__Ø000[0], str(114044), 16)
 96098  }
 96099  
 96100  var _createTableStmtØ00azTypeØ001 [5]*int8
 96101  
 96102  func init() {
 96103  	_createTableStmtØ00azTypeØ001 = [5]*int8{str(284), str(114060), str(114066), str(114071), str(114076)}
 96104  }
 96105  
 96106  // C comment
 96107  //  /*
 96108  //  ** pZ is a UTF-8 encoded unicode string. If nByte is less than zero,
 96109  //  ** return the number of unicode characters in pZ up to (but not including)
 96110  //  ** the first 0x00 byte. If nByte is not less than zero, return the
 96111  //  ** number of unicode characters in the first nByte of pZ (or up to
 96112  //  ** the first 0x00, whichever comes first).
 96113  //  */
 96114  func _sqlite3Utf8CharLen(tls *crt.TLS, _zIn *int8, _nByte int32) (r0 int32) {
 96115  	var _r int32
 96116  	var _z, _zTerm *uint8
 96117  	_r = int32(0)
 96118  	_z = (*uint8)(unsafe.Pointer(_zIn))
 96119  	if _nByte >= int32(0) {
 96120  		_zTerm = elem15(_z, uintptr(_nByte))
 96121  		goto _1
 96122  	}
 96123  	_zTerm = (*uint8)(crt.U2P(uintptr(uint32(4294967295))))
 96124  _1:
 96125  	func() {
 96126  		if crt.P2U(unsafe.Pointer(_z)) > crt.P2U(unsafe.Pointer(_zTerm)) {
 96127  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(27515), unsafe.Pointer(&_sqlite3Utf8CharLenØ00__func__Ø000), unsafe.Pointer(str(114082)))
 96128  			crt.X__builtin_abort(tls)
 96129  		}
 96130  	}()
 96131  _4:
 96132  	if int32(*_z) == int32(0) || crt.P2U(unsafe.Pointer(_z)) >= crt.P2U(unsafe.Pointer(_zTerm)) {
 96133  		goto _5
 96134  	}
 96135  	if int32(*postInc15(&_z, 1)) < int32(192) {
 96136  		goto _7
 96137  	}
 96138  _8:
 96139  	if (int32(*_z) & int32(192)) == int32(128) {
 96140  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
 96141  		goto _8
 96142  	}
 96143  _7:
 96144  	_r += 1
 96145  	goto _4
 96146  _5:
 96147  	return _r
 96148  }
 96149  
 96150  var _sqlite3Utf8CharLenØ00__func__Ø000 [19]int8
 96151  
 96152  func init() {
 96153  	crt.Xstrncpy(nil, &_sqlite3Utf8CharLenØ00__func__Ø000[0], str(114091), 19)
 96154  }
 96155  
 96156  // C comment
 96157  //  /*
 96158  //  ** Add a new column to the table currently being constructed.
 96159  //  **
 96160  //  ** The parser calls this routine once for each column declaration
 96161  //  ** in a CREATE TABLE statement.  sqlite3StartTable() gets called
 96162  //  ** first to get things going.  Then this routine is called for each
 96163  //  ** column.
 96164  //  */
 96165  func _sqlite3AddColumn(tls *crt.TLS, _pParse *XParse, _pName *XToken, _pType *XToken) {
 96166  	var _i int32
 96167  	var _z, _zType *int8
 96168  	var _db *Xsqlite3
 96169  	var _p *XTable
 96170  	var _pCol, _4_aNew *XColumn
 96171  	_db = (*Xsqlite3)(_pParse.Xdb)
 96172  	if store72(&_p, (*XTable)(_pParse.XpNewTable)) == nil {
 96173  		return
 96174  	}
 96175  	if (int32(_p.XnCol) + int32(1)) > (*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(2))) {
 96176  		_sqlite3ErrorMsg(tls, _pParse, str(114110), unsafe.Pointer(_p.XzName))
 96177  		return
 96178  	}
 96179  	_z = (*int8)(_sqlite3DbMallocRaw(tls, _db, uint64((_pName.Xn+_pType.Xn)+uint32(2))))
 96180  	if _z == nil {
 96181  		return
 96182  	}
 96183  	crt.Xmemcpy(tls, unsafe.Pointer(_z), unsafe.Pointer(_pName.Xz), _pName.Xn)
 96184  	*elem1(_z, uintptr(_pName.Xn)) = 0
 96185  	_sqlite3Dequote(tls, _z)
 96186  	_i = int32(0)
 96187  _3:
 96188  	if _i >= int32(_p.XnCol) {
 96189  		goto _6
 96190  	}
 96191  	if Xsqlite3_stricmp(tls, _z, elem41((*XColumn)(_p.XaCol), uintptr(_i)).XzName) == int32(0) {
 96192  		_sqlite3ErrorMsg(tls, _pParse, str(114133), unsafe.Pointer(_z))
 96193  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_z))
 96194  		return
 96195  	}
 96196  	_i += 1
 96197  	goto _3
 96198  _6:
 96199  	if (int32(_p.XnCol) & int32(7)) != int32(0) {
 96200  		goto _8
 96201  	}
 96202  	_4_aNew = (*XColumn)(_sqlite3DbRealloc(tls, _db, _p.XaCol, uint64(uint32(int32(_p.XnCol)+int32(8))*uint32(16))))
 96203  	if _4_aNew == nil {
 96204  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_z))
 96205  		return
 96206  	}
 96207  	*(**XColumn)(unsafe.Pointer(&_p.XaCol)) = _4_aNew
 96208  _8:
 96209  	_pCol = elem41((*XColumn)(_p.XaCol), uintptr(_p.XnCol))
 96210  	crt.Xmemset(tls, unsafe.Pointer(_pCol), int32(0), uint32(16))
 96211  	_pCol.XzName = _z
 96212  	if _pType.Xn == (0) {
 96213  		_pCol.Xaffinity = int8(65)
 96214  		_pCol.XszEst = uint8(1)
 96215  		goto _11
 96216  	}
 96217  	_zType = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(_sqlite3Strlen30(tls, _z)))))) + uintptr(int32(1))))
 96218  	crt.Xmemcpy(tls, unsafe.Pointer(_zType), unsafe.Pointer(_pType.Xz), _pType.Xn)
 96219  	*elem1(_zType, uintptr(_pType.Xn)) = 0
 96220  	_sqlite3Dequote(tls, _zType)
 96221  	_pCol.Xaffinity = _sqlite3AffinityType(tls, _zType, &_pCol.XszEst)
 96222  	{
 96223  		p := &_pCol.XcolFlags
 96224  		*p = uint8(int32(*p) | int32(4))
 96225  	}
 96226  _11:
 96227  	_p.XnCol += 1
 96228  	_pParse.XconstraintName.Xn = 0
 96229  }
 96230  
 96231  // C comment
 96232  //  /*
 96233  //  ** The expression is the default value for the most recently added column
 96234  //  ** of the table currently under construction.
 96235  //  **
 96236  //  ** Default value expressions must be constant.  Raise an exception if this
 96237  //  ** is not the case.
 96238  //  **
 96239  //  ** This routine is called by the parser while in the middle of
 96240  //  ** parsing a CREATE TABLE statement.
 96241  //  */
 96242  func _sqlite3AddDefaultValue(tls *crt.TLS, _pParse *XParse, _pSpan *XExprSpan) {
 96243  	var _db *Xsqlite3
 96244  	var _p *XTable
 96245  	var _3_x XExpr
 96246  	var _pCol *XColumn
 96247  	_db = (*Xsqlite3)(_pParse.Xdb)
 96248  	_p = (*XTable)(_pParse.XpNewTable)
 96249  	if _p == nil {
 96250  		goto _0
 96251  	}
 96252  	_pCol = elem41((*XColumn)(_p.XaCol), uintptr(int32(_p.XnCol)-int32(1)))
 96253  	if _sqlite3ExprIsConstantOrFunction(tls, (*XExpr)(_pSpan.XpExpr), _db.Xinit.Xbusy) == 0 {
 96254  		_sqlite3ErrorMsg(tls, _pParse, str(114159), unsafe.Pointer(_pCol.XzName))
 96255  		goto _2
 96256  	}
 96257  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_pCol.XpDflt))
 96258  	crt.Xmemset(tls, unsafe.Pointer(&_3_x), int32(0), uint32(48))
 96259  	_3_x.Xop = uint8(162)
 96260  	*(**int8)(unsafe.Pointer(&_3_x.Xu)) = _sqlite3DbStrNDup(tls, _db, _pSpan.XzStart, uint64(int32(uintptr(unsafe.Pointer(_pSpan.XzEnd))-uintptr(unsafe.Pointer(_pSpan.XzStart)))))
 96261  	*(**XExpr)(unsafe.Pointer(&_3_x.XpLeft)) = (*XExpr)(_pSpan.XpExpr)
 96262  	_3_x.Xflags = uint32(4096)
 96263  	*(**XExpr)(unsafe.Pointer(&_pCol.XpDflt)) = _sqlite3ExprDup(tls, _db, &_3_x, int32(1))
 96264  	_sqlite3DbFree(tls, _db, unsafe.Pointer(*(**int8)(unsafe.Pointer(&_3_x.Xu))))
 96265  _2:
 96266  _0:
 96267  	_sqlite3ExprDelete(tls, _db, (*XExpr)(_pSpan.XpExpr))
 96268  }
 96269  
 96270  // C comment
 96271  //  /*
 96272  //  ** Walk an expression tree.  Return non-zero if the expression is constant
 96273  //  ** or a function call with constant arguments.  Return and 0 if there
 96274  //  ** are any variables.
 96275  //  **
 96276  //  ** For the purposes of this function, a double-quoted string (ex: "abc")
 96277  //  ** is considered a variable but a single-quoted string (ex: 'abc') is
 96278  //  ** a constant.
 96279  //  */
 96280  func _sqlite3ExprIsConstantOrFunction(tls *crt.TLS, _p *XExpr, _isInit uint8) (r0 int32) {
 96281  	func() {
 96282  		if int32(_isInit) != int32(0) && int32(_isInit) != int32(1) {
 96283  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92783), unsafe.Pointer(&_sqlite3ExprIsConstantOrFunctionØ00__func__Ø000), unsafe.Pointer(str(114204)))
 96284  			crt.X__builtin_abort(tls)
 96285  		}
 96286  	}()
 96287  	return _exprIsConst(tls, _p, int32(4)+int32(_isInit), int32(0))
 96288  }
 96289  
 96290  var _sqlite3ExprIsConstantOrFunctionØ00__func__Ø000 [32]int8
 96291  
 96292  func init() {
 96293  	crt.Xstrncpy(nil, &_sqlite3ExprIsConstantOrFunctionØ00__func__Ø000[0], str(114227), 32)
 96294  }
 96295  
 96296  func _spanExpr(tls *crt.TLS, _pOut *XExprSpan, _pParse *XParse, _op int32, _t XToken) {
 96297  	var _p *XExpr
 96298  	_p = (*XExpr)(_sqlite3DbMallocRawNN(tls, (*Xsqlite3)(_pParse.Xdb), uint64((uint32(48)+_t.Xn)+uint32(1))))
 96299  	if _p == nil {
 96300  		goto _0
 96301  	}
 96302  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint32(48))
 96303  	_p.Xop = uint8(_op)
 96304  	_p.Xflags = uint32(8388608)
 96305  	_p.XiAgg = int16(-1)
 96306  	*(**int8)(unsafe.Pointer(&_p.Xu)) = (*int8)(unsafe.Pointer(elem58(_p, uintptr(1))))
 96307  	crt.Xmemcpy(tls, unsafe.Pointer(*(**int8)(unsafe.Pointer(&_p.Xu))), unsafe.Pointer(_t.Xz), _t.Xn)
 96308  	*elem1(*(**int8)(unsafe.Pointer(&_p.Xu)), uintptr(_t.Xn)) = 0
 96309  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(*(**int8)(unsafe.Pointer(&_p.Xu)), 0))))) & int32(128)) == 0 {
 96310  		goto _1
 96311  	}
 96312  	if int32(*elem1(*(**int8)(unsafe.Pointer(&_p.Xu)), 0)) == int32(34) {
 96313  		_p.Xflags |= uint32(64)
 96314  	}
 96315  	_sqlite3Dequote(tls, *(**int8)(unsafe.Pointer(&_p.Xu)))
 96316  _1:
 96317  	_p.XnHeight = int32(1)
 96318  _0:
 96319  	*(**XExpr)(unsafe.Pointer(&_pOut.XpExpr)) = _p
 96320  	_pOut.XzStart = _t.Xz
 96321  	_pOut.XzEnd = elem1(_t.Xz, uintptr(_t.Xn))
 96322  }
 96323  
 96324  // C comment
 96325  //  /*
 96326  //  ** This routine is called by the parser while in the middle of
 96327  //  ** parsing a CREATE TABLE statement.  A "NOT NULL" constraint has
 96328  //  ** been seen on a column.  This routine sets the notNull flag on
 96329  //  ** the column currently under construction.
 96330  //  */
 96331  func _sqlite3AddNotNull(tls *crt.TLS, _pParse *XParse, _onError int32) {
 96332  	var _p *XTable
 96333  	_p = (*XTable)(_pParse.XpNewTable)
 96334  	if (_p == nil) || func() int32 {
 96335  		if int32(_p.XnCol) < int32(1) {
 96336  			return func() int32 {
 96337  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(100812), unsafe.Pointer(&_sqlite3AddNotNullØ00__func__Ø000), unsafe.Pointer(str(4809)))
 96338  				crt.X__builtin_abort(tls)
 96339  				return int32(1)
 96340  			}()
 96341  		}
 96342  		return int32(0)
 96343  	}() != 0 {
 96344  		return
 96345  	}
 96346  	elem41((*XColumn)(_p.XaCol), uintptr(int32(_p.XnCol)-int32(1))).XnotNull = uint8(_onError)
 96347  	_p.XtabFlags |= uint32(512)
 96348  }
 96349  
 96350  var _sqlite3AddNotNullØ00__func__Ø000 [18]int8
 96351  
 96352  func init() {
 96353  	crt.Xstrncpy(nil, &_sqlite3AddNotNullØ00__func__Ø000[0], str(114259), 18)
 96354  }
 96355  
 96356  // C comment
 96357  //  /*
 96358  //  ** Designate the PRIMARY KEY for the table.  pList is a list of names
 96359  //  ** of columns that form the primary key.  If pList is NULL, then the
 96360  //  ** most recently added column of the table is the primary key.
 96361  //  **
 96362  //  ** A table can have at most one primary key.  If the table already has
 96363  //  ** a primary key (and this is the second primary key) then create an
 96364  //  ** error.
 96365  //  **
 96366  //  ** If the PRIMARY KEY is on a single column whose datatype is INTEGER,
 96367  //  ** then we will try to use that column as the rowid.  Set the Table.iPKey
 96368  //  ** field of the table under construction to be the index of the
 96369  //  ** INTEGER PRIMARY KEY column.  Table.iPKey is set to -1 if there is
 96370  //  ** no INTEGER PRIMARY KEY.
 96371  //  **
 96372  //  ** If the key is not an INTEGER PRIMARY KEY, then create a unique
 96373  //  ** index for the key.  No index is created for INTEGER PRIMARY KEYs.
 96374  //  */
 96375  func _sqlite3AddPrimaryKey(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _onError int32, _autoInc int32, _sortOrder int32) {
 96376  	var _iCol, _i, _nTerm int32
 96377  	var _5_zCName *int8
 96378  	var _pTab *XTable
 96379  	var _4_pCExpr *XExpr
 96380  	var _pCol *XColumn
 96381  	_pTab = (*XTable)(_pParse.XpNewTable)
 96382  	_pCol = nil
 96383  	_iCol = int32(-1)
 96384  	if _pTab == nil {
 96385  		goto _primary_key_exit
 96386  	}
 96387  	if (_pTab.XtabFlags & uint32(4)) != 0 {
 96388  		_sqlite3ErrorMsg(tls, _pParse, str(114277), unsafe.Pointer(_pTab.XzName))
 96389  		goto _primary_key_exit
 96390  	}
 96391  	_pTab.XtabFlags |= uint32(4)
 96392  	if _pList == nil {
 96393  		_iCol = int32(_pTab.XnCol) - int32(1)
 96394  		_pCol = elem41((*XColumn)(_pTab.XaCol), uintptr(_iCol))
 96395  		{
 96396  			p := &_pCol.XcolFlags
 96397  			*p = uint8(int32(*p) | int32(1))
 96398  		}
 96399  		_nTerm = int32(1)
 96400  		goto _3
 96401  	}
 96402  	_nTerm = _pList.XnExpr
 96403  	_i = int32(0)
 96404  _4:
 96405  	if _i >= _nTerm {
 96406  		goto _7
 96407  	}
 96408  	_4_pCExpr = _sqlite3ExprSkipCollate(tls, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_i)).XpExpr))
 96409  	func() {
 96410  		if _4_pCExpr == nil {
 96411  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101013), unsafe.Pointer(&_sqlite3AddPrimaryKeyØ00__func__Ø000), unsafe.Pointer(str(114318)))
 96412  			crt.X__builtin_abort(tls)
 96413  		}
 96414  	}()
 96415  	_sqlite3StringToId(tls, _4_pCExpr)
 96416  	if int32(_4_pCExpr.Xop) != int32(27) {
 96417  		goto _10
 96418  	}
 96419  	_5_zCName = *(**int8)(unsafe.Pointer(&_4_pCExpr.Xu))
 96420  	_iCol = int32(0)
 96421  _11:
 96422  	if _iCol >= int32(_pTab.XnCol) {
 96423  		goto _14
 96424  	}
 96425  	if _sqlite3StrICmp(tls, _5_zCName, elem41((*XColumn)(_pTab.XaCol), uintptr(_iCol)).XzName) == int32(0) {
 96426  		_pCol = elem41((*XColumn)(_pTab.XaCol), uintptr(_iCol))
 96427  		{
 96428  			p := &_pCol.XcolFlags
 96429  			*p = uint8(int32(*p) | int32(1))
 96430  		}
 96431  		goto _14
 96432  	}
 96433  	_iCol += 1
 96434  	goto _11
 96435  _14:
 96436  _10:
 96437  	_i += 1
 96438  	goto _4
 96439  _7:
 96440  _3:
 96441  	if _nTerm != int32(1) || _pCol == nil || _sqlite3StrICmp(tls, _sqlite3ColumnType(tls, _pCol, str(284)), str(25747)) != int32(0) || _sortOrder == int32(1) {
 96442  		goto _19
 96443  	}
 96444  	_pTab.XiPKey = int16(_iCol)
 96445  	_pTab.XkeyConf = uint8(_onError)
 96446  	func() {
 96447  		if _autoInc != int32(0) && _autoInc != int32(1) {
 96448  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101034), unsafe.Pointer(&_sqlite3AddPrimaryKeyØ00__func__Ø000), unsafe.Pointer(str(114328)))
 96449  			crt.X__builtin_abort(tls)
 96450  		}
 96451  	}()
 96452  	_pTab.XtabFlags |= uint32(_autoInc * int32(8))
 96453  	if _pList != nil {
 96454  		_pParse.XiPkSortOrder = elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), 0).XsortOrder
 96455  	}
 96456  	goto _primary_key_exit
 96457  _19:
 96458  	if _autoInc != 0 {
 96459  		_sqlite3ErrorMsg(tls, _pParse, str(114353))
 96460  		goto _primary_key_exit
 96461  	}
 96462  	_sqlite3CreateIndex(tls, _pParse, nil, nil, nil, _pList, _onError, nil, nil, _sortOrder, int32(0), uint8(2))
 96463  	_pList = nil
 96464  _primary_key_exit:
 96465  	_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.Xdb), _pList)
 96466  }
 96467  
 96468  var _sqlite3AddPrimaryKeyØ00__func__Ø000 [21]int8
 96469  
 96470  func init() {
 96471  	crt.Xstrncpy(nil, &_sqlite3AddPrimaryKeyØ00__func__Ø000[0], str(114409), 21)
 96472  }
 96473  
 96474  // C comment
 96475  //  /*
 96476  //  ** Add a new CHECK constraint to the table currently under construction.
 96477  //  */
 96478  func _sqlite3AddCheckConstraint(tls *crt.TLS, _pParse *XParse, _pCheckExpr *XExpr) {
 96479  	var _db *Xsqlite3
 96480  	var _pTab *XTable
 96481  	_pTab = (*XTable)(_pParse.XpNewTable)
 96482  	_db = (*Xsqlite3)(_pParse.Xdb)
 96483  	if _pTab == nil || _pParse.XdeclareVtab != 0 || _sqlite3BtreeIsReadonly(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_db.Xinit.XiDb)).XpBt)) != 0 {
 96484  		goto _2
 96485  	}
 96486  	*(**XExprList)(unsafe.Pointer(&_pTab.XpCheck)) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(_pTab.XpCheck), _pCheckExpr)
 96487  	if (_pParse.XconstraintName.Xn) != 0 {
 96488  		_sqlite3ExprListSetName(tls, _pParse, (*XExprList)(_pTab.XpCheck), &_pParse.XconstraintName, int32(1))
 96489  	}
 96490  	goto _4
 96491  _2:
 96492  	_sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.Xdb), _pCheckExpr)
 96493  _4:
 96494  }
 96495  
 96496  // C comment
 96497  //  /*
 96498  //  ** Return true if the given Btree is read-only.
 96499  //  */
 96500  func _sqlite3BtreeIsReadonly(tls *crt.TLS, _p *XBtree) (r0 int32) {
 96501  	return bool2int((int32((*XBtShared)(_p.XpBt).XbtsFlags) & int32(1)) != int32(0))
 96502  }
 96503  
 96504  // C comment
 96505  //  /*
 96506  //  ** This routine is called to create a new foreign key on the table
 96507  //  ** currently under construction.  pFromCol determines which columns
 96508  //  ** in the current table point to the foreign key.  If pFromCol==0 then
 96509  //  ** connect the key to the last column inserted.  pTo is the name of
 96510  //  ** the table referred to (a.k.a the "parent" table).  pToCol is a list
 96511  //  ** of tables in the parent pTo table.  flags contains all
 96512  //  ** information about the conflict resolution algorithms specified
 96513  //  ** in the ON DELETE, ON UPDATE and ON INSERT clauses.
 96514  //  **
 96515  //  ** An FKey structure is created and added to the table currently
 96516  //  ** under construction in the pParse->pNewTable field.
 96517  //  **
 96518  //  ** The foreign key is set for IMMEDIATE processing.  A subsequent call
 96519  //  ** to sqlite3DeferForeignKey() might change this to DEFERRED.
 96520  //  */
 96521  func _sqlite3CreateForeignKey(tls *crt.TLS, _pParse *XParse, _pFromCol *XExprList, _pTo *XToken, _pToCol *XExprList, _flags int32) {
 96522  	var _nByte, _i, _nCol, _1_iCol, _10_j, _15_n int32
 96523  	var _z *int8
 96524  	var _db *Xsqlite3
 96525  	var _p *XTable
 96526  	var _pFKey, _pNextTo *XFKey
 96527  	_db = (*Xsqlite3)(_pParse.Xdb)
 96528  	_pFKey = nil
 96529  	_p = (*XTable)(_pParse.XpNewTable)
 96530  	func() {
 96531  		if _pTo == nil {
 96532  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102337), unsafe.Pointer(&_sqlite3CreateForeignKeyØ00__func__Ø000), unsafe.Pointer(str(114430)))
 96533  			crt.X__builtin_abort(tls)
 96534  		}
 96535  	}()
 96536  	if (_p == nil) || (_pParse.XdeclareVtab != 0) {
 96537  		goto _fk_end
 96538  	}
 96539  	if _pFromCol != nil {
 96540  		goto _4
 96541  	}
 96542  	_1_iCol = int32(_p.XnCol) - int32(1)
 96543  	if func() int32 {
 96544  		if _1_iCol < int32(0) {
 96545  			return func() int32 {
 96546  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102341), unsafe.Pointer(&_sqlite3CreateForeignKeyØ00__func__Ø000), unsafe.Pointer(str(4809)))
 96547  				crt.X__builtin_abort(tls)
 96548  				return int32(1)
 96549  			}()
 96550  		}
 96551  		return int32(0)
 96552  	}() != 0 {
 96553  		goto _fk_end
 96554  	}
 96555  	if (_pToCol != nil) && (_pToCol.XnExpr != int32(1)) {
 96556  		_sqlite3ErrorMsg(tls, _pParse, str(114437), unsafe.Pointer(elem41((*XColumn)(_p.XaCol), uintptr(_1_iCol)).XzName), unsafe.Pointer(_pTo))
 96557  		goto _fk_end
 96558  	}
 96559  	_nCol = int32(1)
 96560  	goto _13
 96561  _4:
 96562  	if (_pToCol != nil) && (_pToCol.XnExpr != _pFromCol.XnExpr) {
 96563  		_sqlite3ErrorMsg(tls, _pParse, str(114500))
 96564  		goto _fk_end
 96565  	}
 96566  	_nCol = _pFromCol.XnExpr
 96567  _13:
 96568  	_nByte = int32(((uint32(44) + (uint32(_nCol-int32(1)) * uint32(8))) + _pTo.Xn) + uint32(1))
 96569  	if _pToCol == nil {
 96570  		goto _14
 96571  	}
 96572  	_i = int32(0)
 96573  _15:
 96574  	if _i >= _pToCol.XnExpr {
 96575  		goto _18
 96576  	}
 96577  	_nByte += _sqlite3Strlen30(tls, elem57((*TExprList_item)(unsafe.Pointer(&_pToCol.Xa)), uintptr(_i)).XzName) + int32(1)
 96578  	_i += 1
 96579  	goto _15
 96580  _18:
 96581  _14:
 96582  	_pFKey = (*XFKey)(_sqlite3DbMallocZero(tls, _db, uint64(_nByte)))
 96583  	if _pFKey == nil {
 96584  		goto _fk_end
 96585  	}
 96586  	*(**XTable)(unsafe.Pointer(&_pFKey.XpFrom)) = _p
 96587  	*(**XFKey)(unsafe.Pointer(&_pFKey.XpNextFrom)) = (*XFKey)(_p.XpFKey)
 96588  	_z = (*int8)(unsafe.Pointer(elem116((*t117)(unsafe.Pointer(&_pFKey.XaCol)), uintptr(_nCol))))
 96589  	_pFKey.XzTo = _z
 96590  	crt.Xmemcpy(tls, unsafe.Pointer(_z), unsafe.Pointer(_pTo.Xz), _pTo.Xn)
 96591  	*elem1(_z, uintptr(_pTo.Xn)) = 0
 96592  	_sqlite3Dequote(tls, _z)
 96593  	*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_pTo.Xn + uint32(1))
 96594  	_pFKey.XnCol = _nCol
 96595  	if _pFromCol == nil {
 96596  		elem116((*t117)(unsafe.Pointer(&_pFKey.XaCol)), 0).XiFrom = int32(_p.XnCol) - int32(1)
 96597  		goto _21
 96598  	}
 96599  	_i = int32(0)
 96600  _22:
 96601  	if _i >= _nCol {
 96602  		goto _25
 96603  	}
 96604  	_10_j = int32(0)
 96605  _26:
 96606  	if _10_j >= int32(_p.XnCol) {
 96607  		goto _29
 96608  	}
 96609  	if _sqlite3StrICmp(tls, elem41((*XColumn)(_p.XaCol), uintptr(_10_j)).XzName, elem57((*TExprList_item)(unsafe.Pointer(&_pFromCol.Xa)), uintptr(_i)).XzName) == int32(0) {
 96610  		elem116((*t117)(unsafe.Pointer(&_pFKey.XaCol)), uintptr(_i)).XiFrom = _10_j
 96611  		goto _29
 96612  	}
 96613  	_10_j += 1
 96614  	goto _26
 96615  _29:
 96616  	if _10_j >= int32(_p.XnCol) {
 96617  		_sqlite3ErrorMsg(tls, _pParse, str(114594), unsafe.Pointer(elem57((*TExprList_item)(unsafe.Pointer(&_pFromCol.Xa)), uintptr(_i)).XzName))
 96618  		goto _fk_end
 96619  	}
 96620  	_i += 1
 96621  	goto _22
 96622  _25:
 96623  _21:
 96624  	if _pToCol == nil {
 96625  		goto _32
 96626  	}
 96627  	_i = int32(0)
 96628  _33:
 96629  	if _i >= _nCol {
 96630  		goto _36
 96631  	}
 96632  	_15_n = _sqlite3Strlen30(tls, elem57((*TExprList_item)(unsafe.Pointer(&_pToCol.Xa)), uintptr(_i)).XzName)
 96633  	elem116((*t117)(unsafe.Pointer(&_pFKey.XaCol)), uintptr(_i)).XzCol = _z
 96634  	crt.Xmemcpy(tls, unsafe.Pointer(_z), unsafe.Pointer(elem57((*TExprList_item)(unsafe.Pointer(&_pToCol.Xa)), uintptr(_i)).XzName), uint32(_15_n))
 96635  	*elem1(_z, uintptr(_15_n)) = 0
 96636  	*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(_15_n + int32(1))
 96637  	_i += 1
 96638  	goto _33
 96639  _36:
 96640  _32:
 96641  	_pFKey.XisDeferred = 0
 96642  	*elem15((*uint8)(unsafe.Pointer(&_pFKey.XaAction)), 0) = uint8(_flags & int32(255))
 96643  	*elem15((*uint8)(unsafe.Pointer(&_pFKey.XaAction)), uintptr(1)) = uint8((_flags >> 8) & int32(255))
 96644  	func() {
 96645  		if _sqlite3SchemaMutexHeld(tls, _db, int32(0), (*XSchema)(_p.XpSchema)) == 0 {
 96646  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102408), unsafe.Pointer(&_sqlite3CreateForeignKeyØ00__func__Ø000), unsafe.Pointer(str(114640)))
 96647  			crt.X__builtin_abort(tls)
 96648  		}
 96649  	}()
 96650  	_pNextTo = (*XFKey)(_sqlite3HashInsert(tls, &((*XSchema)(_p.XpSchema).XfkeyHash), _pFKey.XzTo, unsafe.Pointer(_pFKey)))
 96651  	if _pNextTo == _pFKey {
 96652  		_sqlite3OomFault(tls, _db)
 96653  		goto _fk_end
 96654  	}
 96655  	if _pNextTo != nil {
 96656  		func() {
 96657  			if (*XFKey)(_pNextTo.XpPrevTo) != nil {
 96658  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102417), unsafe.Pointer(&_sqlite3CreateForeignKeyØ00__func__Ø000), unsafe.Pointer(str(114682)))
 96659  				crt.X__builtin_abort(tls)
 96660  			}
 96661  		}()
 96662  		*(**XFKey)(unsafe.Pointer(&_pFKey.XpNextTo)) = _pNextTo
 96663  		*(**XFKey)(unsafe.Pointer(&_pNextTo.XpPrevTo)) = _pFKey
 96664  	}
 96665  	*(**XFKey)(unsafe.Pointer(&_p.XpFKey)) = _pFKey
 96666  	_pFKey = nil
 96667  _fk_end:
 96668  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pFKey))
 96669  	_sqlite3ExprListDelete(tls, _db, _pFromCol)
 96670  	_sqlite3ExprListDelete(tls, _db, _pToCol)
 96671  }
 96672  
 96673  var _sqlite3CreateForeignKeyØ00__func__Ø000 [24]int8
 96674  
 96675  func init() {
 96676  	crt.Xstrncpy(nil, &_sqlite3CreateForeignKeyØ00__func__Ø000[0], str(114702), 24)
 96677  }
 96678  
 96679  // C comment
 96680  //  /*
 96681  //  ** This routine is called when an INITIALLY IMMEDIATE or INITIALLY DEFERRED
 96682  //  ** clause is seen as part of a foreign key definition.  The isDeferred
 96683  //  ** parameter is 1 for INITIALLY DEFERRED and 0 for INITIALLY IMMEDIATE.
 96684  //  ** The behavior of the most recently created foreign key is adjusted
 96685  //  ** accordingly.
 96686  //  */
 96687  func _sqlite3DeferForeignKey(tls *crt.TLS, _pParse *XParse, _isDeferred int32) {
 96688  	var _pTab *XTable
 96689  	var _pFKey *XFKey
 96690  	if (store72(&_pTab, (*XTable)(_pParse.XpNewTable)) == nil) || (store118(&_pFKey, (*XFKey)(_pTab.XpFKey)) == nil) {
 96691  		return
 96692  	}
 96693  	func() {
 96694  		if _isDeferred != int32(0) && _isDeferred != int32(1) {
 96695  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102446), unsafe.Pointer(&_sqlite3DeferForeignKeyØ00__func__Ø000), unsafe.Pointer(str(114726)))
 96696  			crt.X__builtin_abort(tls)
 96697  		}
 96698  	}()
 96699  	_pFKey.XisDeferred = uint8(_isDeferred)
 96700  }
 96701  
 96702  var _sqlite3DeferForeignKeyØ00__func__Ø000 [23]int8
 96703  
 96704  func init() {
 96705  	crt.Xstrncpy(nil, &_sqlite3DeferForeignKeyØ00__func__Ø000[0], str(114757), 23)
 96706  }
 96707  
 96708  // C comment
 96709  //  /*
 96710  //  ** Set the collation function of the most recently parsed table column
 96711  //  ** to the CollSeq given.
 96712  //  */
 96713  func _sqlite3AddCollateType(tls *crt.TLS, _pParse *XParse, _pToken *XToken) {
 96714  	var _i int32
 96715  	var _zColl *int8
 96716  	var _db *Xsqlite3
 96717  	var _p *XTable
 96718  	var _1_pIdx *XIndex
 96719  	if store72(&_p, (*XTable)(_pParse.XpNewTable)) == nil {
 96720  		return
 96721  	}
 96722  	_i = int32(_p.XnCol) - int32(1)
 96723  	_db = (*Xsqlite3)(_pParse.Xdb)
 96724  	_zColl = _sqlite3NameFromToken(tls, _db, _pToken)
 96725  	if _zColl == nil {
 96726  		return
 96727  	}
 96728  	if _sqlite3LocateCollSeq(tls, _pParse, _zColl) == nil {
 96729  		goto _2
 96730  	}
 96731  	_sqlite3DbFree(tls, _db, unsafe.Pointer(elem41((*XColumn)(_p.XaCol), uintptr(_i)).XzColl))
 96732  	elem41((*XColumn)(_p.XaCol), uintptr(_i)).XzColl = _zColl
 96733  	_1_pIdx = (*XIndex)(_p.XpIndex)
 96734  _3:
 96735  	if _1_pIdx == nil {
 96736  		goto _6
 96737  	}
 96738  	func() {
 96739  		if int32(_1_pIdx.XnKeyCol) != int32(1) {
 96740  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101103), unsafe.Pointer(&_sqlite3AddCollateTypeØ00__func__Ø000), unsafe.Pointer(str(114780)))
 96741  			crt.X__builtin_abort(tls)
 96742  		}
 96743  	}()
 96744  	if int32(*elem50(_1_pIdx.XaiColumn, 0)) == _i {
 96745  		*elem0(_1_pIdx.XazColl, 0) = elem41((*XColumn)(_p.XaCol), uintptr(_i)).XzColl
 96746  	}
 96747  	_1_pIdx = (*XIndex)(_1_pIdx.XpNext)
 96748  	goto _3
 96749  _6:
 96750  	goto _10
 96751  _2:
 96752  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zColl))
 96753  _10:
 96754  }
 96755  
 96756  var _sqlite3AddCollateTypeØ00__func__Ø000 [22]int8
 96757  
 96758  func init() {
 96759  	crt.Xstrncpy(nil, &_sqlite3AddCollateTypeØ00__func__Ø000[0], str(114797), 22)
 96760  }
 96761  
 96762  // C comment
 96763  //  /*
 96764  //  ** This routine is called to do the work of a DROP TABLE statement.
 96765  //  ** pName is the name of the table to be dropped.
 96766  //  */
 96767  func _sqlite3DropTable(tls *crt.TLS, _pParse *XParse, _pName *XSrcList, _isView int32, _noErr int32) {
 96768  	var _iDb, _4_code int32
 96769  	var _4_zTab, _4_zDb, _4_zArg2 *int8
 96770  	var _db *Xsqlite3
 96771  	var _pTab *XTable
 96772  	var _v *TVdbe
 96773  	_db = (*Xsqlite3)(_pParse.Xdb)
 96774  	if _db.XmallocFailed != 0 {
 96775  		goto _exit_drop_table
 96776  	}
 96777  	func() {
 96778  		if _pParse.XnErr != int32(0) {
 96779  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102213), unsafe.Pointer(&_sqlite3DropTableØ00__func__Ø000), unsafe.Pointer(str(112394)))
 96780  			crt.X__builtin_abort(tls)
 96781  		}
 96782  	}()
 96783  	func() {
 96784  		if _pName.XnSrc != int32(1) {
 96785  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102214), unsafe.Pointer(&_sqlite3DropTableØ00__func__Ø000), unsafe.Pointer(str(114819)))
 96786  			crt.X__builtin_abort(tls)
 96787  		}
 96788  	}()
 96789  	if _sqlite3ReadSchema(tls, _pParse) != 0 {
 96790  		goto _exit_drop_table
 96791  	}
 96792  	if _noErr != 0 {
 96793  		_db.XsuppressErr += 1
 96794  	}
 96795  	func() {
 96796  		if _isView != int32(0) && _isView != int32(1) {
 96797  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102217), unsafe.Pointer(&_sqlite3DropTableØ00__func__Ø000), unsafe.Pointer(str(114834)))
 96798  			crt.X__builtin_abort(tls)
 96799  		}
 96800  	}()
 96801  	_pTab = _sqlite3LocateTableItem(tls, _pParse, uint32(_isView), elem6((*TSrcList_item)(unsafe.Pointer(&_pName.Xa)), 0))
 96802  	if _noErr != 0 {
 96803  		_db.XsuppressErr -= 1
 96804  	}
 96805  	if _pTab != nil {
 96806  		goto _11
 96807  	}
 96808  	if _noErr != 0 {
 96809  		_sqlite3CodeVerifyNamedSchema(tls, _pParse, elem6((*TSrcList_item)(unsafe.Pointer(&_pName.Xa)), 0).XzDatabase)
 96810  	}
 96811  	goto _exit_drop_table
 96812  _11:
 96813  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.XpSchema))
 96814  	func() {
 96815  		if _iDb < int32(0) || _iDb >= _db.XnDb {
 96816  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102226), unsafe.Pointer(&_sqlite3DropTableØ00__func__Ø000), unsafe.Pointer(str(21693)))
 96817  			crt.X__builtin_abort(tls)
 96818  		}
 96819  	}()
 96820  	if _pTab.XnModuleArg != 0 && _sqlite3ViewGetColumnNames(tls, _pParse, _pTab) != 0 {
 96821  		goto _exit_drop_table
 96822  	}
 96823  	_4_zTab = func() *int8 {
 96824  		if int32(1) != 0 && (_iDb == int32(1)) {
 96825  			return str(49962)
 96826  		}
 96827  		return str(49981)
 96828  	}()
 96829  	_4_zDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
 96830  	_4_zArg2 = nil
 96831  	if _sqlite3AuthCheck(tls, _pParse, int32(9), _4_zTab, nil, _4_zDb) != 0 {
 96832  		goto _exit_drop_table
 96833  	}
 96834  	if _isView == 0 {
 96835  		goto _22
 96836  	}
 96837  	if int32(1) != 0 && (_iDb == int32(1)) {
 96838  		_4_code = int32(15)
 96839  		goto _25
 96840  	}
 96841  	_4_code = int32(17)
 96842  _25:
 96843  	goto _28
 96844  _22:
 96845  	if _pTab.XnModuleArg != 0 {
 96846  		_4_code = int32(30)
 96847  		_4_zArg2 = (*XModule)(_sqlite3GetVTable(tls, _db, _pTab).XpMod).XzName
 96848  		goto _28
 96849  	}
 96850  	if int32(1) != 0 && (_iDb == int32(1)) {
 96851  		_4_code = int32(13)
 96852  		goto _31
 96853  	}
 96854  	_4_code = int32(11)
 96855  _31:
 96856  _28:
 96857  	if _sqlite3AuthCheck(tls, _pParse, _4_code, _pTab.XzName, _4_zArg2, _4_zDb) != 0 {
 96858  		goto _exit_drop_table
 96859  	}
 96860  	if _sqlite3AuthCheck(tls, _pParse, int32(9), _pTab.XzName, nil, _4_zDb) != 0 {
 96861  		goto _exit_drop_table
 96862  	}
 96863  	if (Xsqlite3_strnicmp(tls, _pTab.XzName, str(111672), int32(7)) == int32(0)) && (Xsqlite3_strnicmp(tls, _pTab.XzName, str(114867), int32(11)) != int32(0)) {
 96864  		_sqlite3ErrorMsg(tls, _pParse, str(114879), unsafe.Pointer(_pTab.XzName))
 96865  		goto _exit_drop_table
 96866  	}
 96867  	if _isView != 0 && ((*XSelect)(_pTab.XpSelect) == nil) {
 96868  		_sqlite3ErrorMsg(tls, _pParse, str(114907), unsafe.Pointer(_pTab.XzName))
 96869  		goto _exit_drop_table
 96870  	}
 96871  	if (_isView == 0) && (_pTab.XpSelect != nil) {
 96872  		_sqlite3ErrorMsg(tls, _pParse, str(114941), unsafe.Pointer(_pTab.XzName))
 96873  		goto _exit_drop_table
 96874  	}
 96875  	_v = _sqlite3GetVdbe(tls, _pParse)
 96876  	if _v != nil {
 96877  		_sqlite3BeginWriteOperation(tls, _pParse, int32(1), _iDb)
 96878  		_sqlite3ClearStatTables(tls, _pParse, _iDb, str(93739), _pTab.XzName)
 96879  		_sqlite3FkDropTable(tls, _pParse, _pName, _pTab)
 96880  		_sqlite3CodeDropTable(tls, _pParse, _pTab, _iDb, _isView)
 96881  	}
 96882  _exit_drop_table:
 96883  	_sqlite3SrcListDelete(tls, _db, _pName)
 96884  }
 96885  
 96886  var _sqlite3DropTableØ00__func__Ø000 [17]int8
 96887  
 96888  func init() {
 96889  	crt.Xstrncpy(nil, &_sqlite3DropTableØ00__func__Ø000[0], str(114973), 17)
 96890  }
 96891  
 96892  // C comment
 96893  //  /*
 96894  //  ** If argument zDb is NULL, then call sqlite3CodeVerifySchema() for each
 96895  //  ** attached database. Otherwise, invoke it for the database named zDb only.
 96896  //  */
 96897  func _sqlite3CodeVerifyNamedSchema(tls *crt.TLS, _pParse *XParse, _zDb *int8) {
 96898  	var _i int32
 96899  	var _db *Xsqlite3
 96900  	var _1_pDb *XDb
 96901  	_db = (*Xsqlite3)(_pParse.Xdb)
 96902  	_i = int32(0)
 96903  _0:
 96904  	if _i >= _db.XnDb {
 96905  		goto _3
 96906  	}
 96907  	_1_pDb = elem27((*XDb)(_db.XaDb), uintptr(_i))
 96908  	if (_1_pDb.XpBt != nil) && ((_zDb == nil) || (int32(0) == _sqlite3StrICmp(tls, _zDb, _1_pDb.XzDbSName))) {
 96909  		_sqlite3CodeVerifySchema(tls, _pParse, _i)
 96910  	}
 96911  	_i += 1
 96912  	goto _0
 96913  _3:
 96914  }
 96915  
 96916  // C comment
 96917  //  /*
 96918  //  ** Remove entries from the sqlite_statN tables (for N in (1,2,3))
 96919  //  ** after a DROP INDEX or DROP TABLE command.
 96920  //  */
 96921  func _sqlite3ClearStatTables(tls *crt.TLS, _pParse *XParse, _iDb int32, _zType *int8, _zName *int8) {
 96922  	var _i int32
 96923  	var _zDbName *int8
 96924  	var _1_zTab [24]int8
 96925  	_zDbName = elem27((*XDb)((*Xsqlite3)(_pParse.Xdb).XaDb), uintptr(_iDb)).XzDbSName
 96926  	_i = int32(1)
 96927  _0:
 96928  	if _i > int32(4) {
 96929  		goto _3
 96930  	}
 96931  	Xsqlite3_snprintf(tls, int32(24), (*int8)(unsafe.Pointer(&_1_zTab)), str(114990), _i)
 96932  	if _sqlite3FindTable(tls, (*Xsqlite3)(_pParse.Xdb), (*int8)(unsafe.Pointer(&_1_zTab)), _zDbName) != nil {
 96933  		_sqlite3NestedParse(tls, _pParse, str(115004), unsafe.Pointer(_zDbName), unsafe.Pointer(&_1_zTab), unsafe.Pointer(_zType), unsafe.Pointer(_zName))
 96934  	}
 96935  	_i += 1
 96936  	goto _0
 96937  _3:
 96938  	_ = _1_zTab
 96939  }
 96940  
 96941  // C comment
 96942  //  /*
 96943  //  ** This function is called to generate code that runs when table pTab is
 96944  //  ** being dropped from the database. The SrcList passed as the second argument
 96945  //  ** to this function contains a single entry guaranteed to resolve to
 96946  //  ** table pTab.
 96947  //  **
 96948  //  ** Normally, no code is required. However, if either
 96949  //  **
 96950  //  **   (a) The table is the parent table of a FK constraint, or
 96951  //  **   (b) The table is the child table of a deferred FK constraint and it is
 96952  //  **       determined at runtime that there are outstanding deferred FK
 96953  //  **       constraint violations in the database,
 96954  //  **
 96955  //  ** then the equivalent of "DELETE FROM <tbl>" is executed before dropping
 96956  //  ** the table from the database. Triggers are disabled while running this
 96957  //  ** DELETE, but foreign key actions are not.
 96958  //  */
 96959  func _sqlite3FkDropTable(tls *crt.TLS, _pParse *XParse, _pName *XSrcList, _pTab *XTable) {
 96960  	var _1_iSkip int32
 96961  	var _db *Xsqlite3
 96962  	var _1_v *TVdbe
 96963  	var _2_p *XFKey
 96964  	_db = (*Xsqlite3)(_pParse.Xdb)
 96965  	if (_db.Xflags&int32(524288)) == 0 || _pTab.XnModuleArg != 0 || _pTab.XpSelect != nil {
 96966  		goto _2
 96967  	}
 96968  	_1_iSkip = int32(0)
 96969  	_1_v = _sqlite3GetVdbe(tls, _pParse)
 96970  	func() {
 96971  		if _1_v == nil {
 96972  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108122), unsafe.Pointer(&_sqlite3FkDropTableØ00__func__Ø000), unsafe.Pointer(str(41816)))
 96973  			crt.X__builtin_abort(tls)
 96974  		}
 96975  	}()
 96976  	if _sqlite3FkReferences(tls, _pTab) != nil {
 96977  		goto _5
 96978  	}
 96979  	_2_p = (*XFKey)(_pTab.XpFKey)
 96980  _6:
 96981  	if _2_p == nil {
 96982  		goto _9
 96983  	}
 96984  	if (_2_p.XisDeferred != 0) || (_db.Xflags&int32(33554432)) != 0 {
 96985  		goto _9
 96986  	}
 96987  	_2_p = (*XFKey)(_2_p.XpNextFrom)
 96988  	goto _6
 96989  _9:
 96990  	if _2_p == nil {
 96991  		return
 96992  	}
 96993  	_1_iSkip = _sqlite3VdbeMakeLabel(tls, _1_v)
 96994  	_sqlite3VdbeAddOp2(tls, _1_v, int32(45), int32(1), _1_iSkip)
 96995  _5:
 96996  	_pParse.XdisableTriggers = uint8(1)
 96997  	_sqlite3DeleteFrom(tls, _pParse, _sqlite3SrcListDup(tls, _db, _pName, int32(0)), nil)
 96998  	_pParse.XdisableTriggers = 0
 96999  	if (_db.Xflags & int32(33554432)) == int32(0) {
 97000  		_sqlite3VdbeAddOp2(tls, _1_v, int32(45), int32(0), _sqlite3VdbeCurrentAddr(tls, _1_v)+int32(2))
 97001  		_sqlite3HaltConstraint(tls, _pParse, int32(787), int32(2), nil, int8(-2), uint8(4))
 97002  	}
 97003  	if _1_iSkip != 0 {
 97004  		_sqlite3VdbeResolveLabel(tls, _1_v, _1_iSkip)
 97005  	}
 97006  _2:
 97007  }
 97008  
 97009  var _sqlite3FkDropTableØ00__func__Ø000 [19]int8
 97010  
 97011  func init() {
 97012  	crt.Xstrncpy(nil, &_sqlite3FkDropTableØ00__func__Ø000[0], str(115034), 19)
 97013  }
 97014  
 97015  // C comment
 97016  //  /*
 97017  //  ** This function returns a linked list of FKey objects (connected by
 97018  //  ** FKey.pNextTo) holding all children of table pTab.  For example,
 97019  //  ** given the following schema:
 97020  //  **
 97021  //  **   CREATE TABLE t1(a PRIMARY KEY);
 97022  //  **   CREATE TABLE t2(b REFERENCES t1(a);
 97023  //  **
 97024  //  ** Calling this function with table "t1" as an argument returns a pointer
 97025  //  ** to the FKey structure representing the foreign key constraint on table
 97026  //  ** "t2". Calling this function with "t2" as the argument would return a
 97027  //  ** NULL pointer (as there are no FK constraints for which t2 is the parent
 97028  //  ** table).
 97029  //  */
 97030  func _sqlite3FkReferences(tls *crt.TLS, _pTab *XTable) (r0 *XFKey) {
 97031  	return (*XFKey)(_sqlite3HashFind(tls, &((*XSchema)(_pTab.XpSchema).XfkeyHash), _pTab.XzName))
 97032  }
 97033  
 97034  // C comment
 97035  //  /*
 97036  //  ** Generate code for a DELETE FROM statement.
 97037  //  **
 97038  //  **     DELETE FROM table_wxyz WHERE a<5 AND b NOT NULL;
 97039  //  **                 \________/       \________________/
 97040  //  **                  pTabList              pWhere
 97041  //  */
 97042  func _sqlite3DeleteFrom(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pWhere *XExpr) {
 97043  	var _nPk, _nKey int16
 97044  	var _i, _iTabCur, _iDataCur, _iIdxCur, _nIdx, _iDb, _memCnt, _rcauth, _eOnePass, _iPk, _iKey, _iEphCur, _iRowSet, _addrBypass, _addrLoop, _addrEphOpen, _bComplex, _isView, _28_iAddrOnce, _36_count int32
 97045  	var _34_pVTab *int8
 97046  	var _14_wcf uint16
 97047  	var _aToOpen *uint8
 97048  	var _db *Xsqlite3
 97049  	var _pTrigger *XTrigger
 97050  	var _pTab *XTable
 97051  	var _v *TVdbe
 97052  	var _aiCurOnePass [2]int32
 97053  	var _pIdx, _pPk *XIndex
 97054  	var _sNC XNameContext
 97055  	var _sContext XAuthContext
 97056  	var _pWInfo *XWhereInfo
 97057  	_iDataCur = int32(0)
 97058  	_iIdxCur = int32(0)
 97059  	_memCnt = int32(-1)
 97060  	_aToOpen = nil
 97061  	_iPk = int32(0)
 97062  	_nPk = int16(1)
 97063  	_iEphCur = int32(0)
 97064  	_iRowSet = int32(0)
 97065  	_addrBypass = int32(0)
 97066  	_addrLoop = int32(0)
 97067  	_addrEphOpen = int32(0)
 97068  	crt.Xmemset(tls, unsafe.Pointer(&_sContext), int32(0), uint32(8))
 97069  	_db = (*Xsqlite3)(_pParse.Xdb)
 97070  	if _pParse.XnErr != 0 || (_db.XmallocFailed != 0) {
 97071  		goto _delete_from_cleanup
 97072  	}
 97073  	func() {
 97074  		if _pTabList.XnSrc != int32(1) {
 97075  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104887), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115053)))
 97076  			crt.X__builtin_abort(tls)
 97077  		}
 97078  	}()
 97079  	_pTab = _sqlite3SrcListLookup(tls, _pParse, _pTabList)
 97080  	if _pTab == nil {
 97081  		goto _delete_from_cleanup
 97082  	}
 97083  	_pTrigger = _sqlite3TriggersExist(tls, _pParse, _pTab, int32(109), nil, nil)
 97084  	_isView = bool2int((*XSelect)(_pTab.XpSelect) != nil)
 97085  	_bComplex = bool2int((_pTrigger != nil) || _sqlite3FkRequired(tls, _pParse, _pTab, nil, int32(0)) != 0)
 97086  	if _sqlite3ViewGetColumnNames(tls, _pParse, _pTab) != 0 {
 97087  		goto _delete_from_cleanup
 97088  	}
 97089  	if _sqlite3IsReadOnly(tls, _pParse, _pTab, func() int32 {
 97090  		if _pTrigger != nil {
 97091  			return int32(1)
 97092  		}
 97093  		return int32(0)
 97094  	}()) != 0 {
 97095  		goto _delete_from_cleanup
 97096  	}
 97097  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.XpSchema))
 97098  	func() {
 97099  		if _iDb >= _db.XnDb {
 97100  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104923), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(54304)))
 97101  			crt.X__builtin_abort(tls)
 97102  		}
 97103  	}()
 97104  	_rcauth = _sqlite3AuthCheck(tls, _pParse, int32(9), _pTab.XzName, nil, elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName)
 97105  	func() {
 97106  		if _rcauth != int32(0) && _rcauth != int32(1) && _rcauth != int32(2) {
 97107  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104926), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115071)))
 97108  			crt.X__builtin_abort(tls)
 97109  		}
 97110  	}()
 97111  	if _rcauth == int32(1) {
 97112  		goto _delete_from_cleanup
 97113  	}
 97114  	func() {
 97115  		if _isView != 0 && _pTrigger == nil {
 97116  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104930), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115137)))
 97117  			crt.X__builtin_abort(tls)
 97118  		}
 97119  	}()
 97120  	func() {
 97121  		if _pTabList.XnSrc != int32(1) {
 97122  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104934), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115053)))
 97123  			crt.X__builtin_abort(tls)
 97124  		}
 97125  	}()
 97126  	_iTabCur = store2(&(elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), 0).XiCursor), postInc2(&_pParse.XnTab, 1))
 97127  	*func() **XIndex { _nIdx = int32(0); return &_pIdx }() = (*XIndex)(_pTab.XpIndex)
 97128  _22:
 97129  	if _pIdx == nil {
 97130  		goto _25
 97131  	}
 97132  	_pParse.XnTab += 1
 97133  	*func() *int32 { _pIdx = (*XIndex)(_pIdx.XpNext); return &_nIdx }() += 1
 97134  	goto _22
 97135  _25:
 97136  	if _isView != 0 {
 97137  		_sqlite3AuthContextPush(tls, _pParse, &_sContext, _pTab.XzName)
 97138  	}
 97139  	_v = _sqlite3GetVdbe(tls, _pParse)
 97140  	if _v == nil {
 97141  		goto _delete_from_cleanup
 97142  	}
 97143  	if int32(_pParse.Xnested) == int32(0) {
 97144  		_sqlite3VdbeCountChanges(tls, _v)
 97145  	}
 97146  	_sqlite3BeginWriteOperation(tls, _pParse, int32(1), _iDb)
 97147  	if _isView != 0 {
 97148  		_sqlite3MaterializeView(tls, _pParse, _pTab, _pWhere, _iTabCur)
 97149  		_iDataCur = store2(&_iIdxCur, _iTabCur)
 97150  	}
 97151  	crt.Xmemset(tls, unsafe.Pointer(&_sNC), int32(0), uint32(32))
 97152  	*(**XParse)(unsafe.Pointer(&_sNC.XpParse)) = _pParse
 97153  	*(**XSrcList)(unsafe.Pointer(&_sNC.XpSrcList)) = _pTabList
 97154  	if _sqlite3ResolveExprNames(tls, &_sNC, _pWhere) != 0 {
 97155  		goto _delete_from_cleanup
 97156  	}
 97157  	if (_db.Xflags & int32(128)) != 0 {
 97158  		_memCnt = preInc2(&_pParse.XnMem, 1)
 97159  		_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _memCnt)
 97160  	}
 97161  	if _rcauth != int32(0) || _pWhere != nil || _bComplex != 0 || _pTab.XnModuleArg != 0 {
 97162  		goto _35
 97163  	}
 97164  	func() {
 97165  		if _isView != 0 {
 97166  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105002), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115157)))
 97167  			crt.X__builtin_abort(tls)
 97168  		}
 97169  	}()
 97170  	_sqlite3TableLock(tls, _pParse, _iDb, _pTab.Xtnum, uint8(1), _pTab.XzName)
 97171  	if (_pTab.XtabFlags & uint32(32)) == (0) {
 97172  		_sqlite3VdbeAddOp4(tls, _v, int32(134), _pTab.Xtnum, _iDb, _memCnt, _pTab.XzName, int32(-2))
 97173  	}
 97174  	_pIdx = (*XIndex)(_pTab.XpIndex)
 97175  _39:
 97176  	if _pIdx == nil {
 97177  		goto _42
 97178  	}
 97179  	func() {
 97180  		if (*XSchema)(_pIdx.XpSchema) != (*XSchema)(_pTab.XpSchema) {
 97181  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105009), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115165)))
 97182  			crt.X__builtin_abort(tls)
 97183  		}
 97184  	}()
 97185  	_sqlite3VdbeAddOp2(tls, _v, int32(134), _pIdx.Xtnum, _iDb)
 97186  	_pIdx = (*XIndex)(_pIdx.XpNext)
 97187  	goto _39
 97188  _42:
 97189  	goto _45
 97190  _35:
 97191  	_14_wcf = uint16(1044)
 97192  	if (int32(_sNC.XncFlags) & int32(64)) != 0 {
 97193  		_bComplex = int32(1)
 97194  	}
 97195  	{
 97196  		p := &_14_wcf
 97197  		*p = uint16(int32(*p) | func() int32 {
 97198  			if _bComplex != 0 {
 97199  				return int32(0)
 97200  			}
 97201  			return int32(8)
 97202  		}())
 97203  	}
 97204  	if (_pTab.XtabFlags & uint32(32)) == (0) {
 97205  		_pPk = nil
 97206  		_nPk = int16(1)
 97207  		_iRowSet = preInc2(&_pParse.XnMem, 1)
 97208  		_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _iRowSet)
 97209  		goto _50
 97210  	}
 97211  	_pPk = _sqlite3PrimaryKeyIndex(tls, _pTab)
 97212  	func() {
 97213  		if _pPk == nil {
 97214  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105028), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(41949)))
 97215  			crt.X__builtin_abort(tls)
 97216  		}
 97217  	}()
 97218  	_nPk = int16(_pPk.XnKeyCol)
 97219  	_iPk = _pParse.XnMem + int32(1)
 97220  	_pParse.XnMem += int32(_nPk)
 97221  	_iEphCur = postInc2(&_pParse.XnTab, 1)
 97222  	_addrEphOpen = _sqlite3VdbeAddOp2(tls, _v, int32(110), _iEphCur, int32(_nPk))
 97223  	_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pPk)
 97224  _50:
 97225  	_pWInfo = _sqlite3WhereBegin(tls, _pParse, _pTabList, _pWhere, nil, nil, _14_wcf, _iTabCur+int32(1))
 97226  	if _pWInfo == nil {
 97227  		goto _delete_from_cleanup
 97228  	}
 97229  	_eOnePass = _sqlite3WhereOkOnePass(tls, _pWInfo, (*int32)(unsafe.Pointer(&_aiCurOnePass)))
 97230  	func() {
 97231  		if _pTab.XnModuleArg != int32(0) && _eOnePass == int32(2) {
 97232  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105048), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115194)))
 97233  			crt.X__builtin_abort(tls)
 97234  		}
 97235  	}()
 97236  	func() {
 97237  		if _pTab.XnModuleArg == 0 && _bComplex == 0 && _eOnePass == int32(0) {
 97238  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105049), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115240)))
 97239  			crt.X__builtin_abort(tls)
 97240  		}
 97241  	}()
 97242  	if (_db.Xflags & int32(128)) != 0 {
 97243  		_sqlite3VdbeAddOp2(tls, _v, int32(73), _memCnt, int32(1))
 97244  	}
 97245  	if _pPk == nil {
 97246  		goto _62
 97247  	}
 97248  	_i = int32(0)
 97249  _63:
 97250  	if _i >= int32(_nPk) {
 97251  		goto _66
 97252  	}
 97253  	func() {
 97254  		if int32(*elem50(_pPk.XaiColumn, uintptr(_i))) < int32(0) {
 97255  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105059), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115293)))
 97256  			crt.X__builtin_abort(tls)
 97257  		}
 97258  	}()
 97259  	_sqlite3ExprCodeGetColumnOfTable(tls, _v, _pTab, _iTabCur, int32(*elem50(_pPk.XaiColumn, uintptr(_i))), _iPk+_i)
 97260  	_i += 1
 97261  	goto _63
 97262  _66:
 97263  	_iKey = _iPk
 97264  	goto _69
 97265  _62:
 97266  	_iKey = _pParse.XnMem + int32(1)
 97267  	_iKey = _sqlite3ExprCodeGetColumn(tls, _pParse, _pTab, int32(-1), _iTabCur, _iKey, 0)
 97268  	if _iKey > _pParse.XnMem {
 97269  		_pParse.XnMem = _iKey
 97270  	}
 97271  _69:
 97272  	if _eOnePass == int32(0) {
 97273  		goto _71
 97274  	}
 97275  	_nKey = _nPk
 97276  	_aToOpen = (*uint8)(_sqlite3DbMallocRawNN(tls, _db, uint64(_nIdx+int32(2))))
 97277  	if _aToOpen == nil {
 97278  		_sqlite3WhereEnd(tls, _pWInfo)
 97279  		goto _delete_from_cleanup
 97280  	}
 97281  	crt.Xmemset(tls, unsafe.Pointer(_aToOpen), int32(1), uint32(_nIdx+int32(1)))
 97282  	*elem15(_aToOpen, uintptr(_nIdx+int32(1))) = 0
 97283  	if (*elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), 0)) >= int32(0) {
 97284  		*elem15(_aToOpen, uintptr((*elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), 0))-_iTabCur)) = 0
 97285  	}
 97286  	if (*elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), uintptr(1))) >= int32(0) {
 97287  		*elem15(_aToOpen, uintptr((*elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), uintptr(1)))-_iTabCur)) = 0
 97288  	}
 97289  	if _addrEphOpen != 0 {
 97290  		_sqlite3VdbeChangeToNoop(tls, _v, _addrEphOpen)
 97291  	}
 97292  	goto _76
 97293  _71:
 97294  	if _pPk != nil {
 97295  		_iKey = preInc2(&_pParse.XnMem, 1)
 97296  		_nKey = 0
 97297  		_sqlite3VdbeAddOp4(tls, _v, int32(101), _iPk, int32(_nPk), _iKey, _sqlite3IndexAffinityStr(tls, (*Xsqlite3)(_pParse.Xdb), _pPk), int32(_nPk))
 97298  		_sqlite3VdbeAddOp4Int(tls, _v, int32(128), _iEphCur, _iKey, _iPk, int32(_nPk))
 97299  		goto _78
 97300  	}
 97301  	_nKey = int16(1)
 97302  	_sqlite3VdbeAddOp2(tls, _v, int32(145), _iRowSet, _iKey)
 97303  _78:
 97304  _76:
 97305  	if _eOnePass != int32(0) {
 97306  		_addrBypass = _sqlite3VdbeMakeLabel(tls, _v)
 97307  		goto _80
 97308  	}
 97309  	_sqlite3WhereEnd(tls, _pWInfo)
 97310  _80:
 97311  	if _isView != 0 {
 97312  		goto _81
 97313  	}
 97314  	_28_iAddrOnce = int32(0)
 97315  	if _eOnePass == int32(2) {
 97316  		_28_iAddrOnce = _sqlite3VdbeAddOp0(tls, _v, int32(20))
 97317  	}
 97318  	_sqlite3OpenTableAndIndices(tls, _pParse, _pTab, int32(107), uint8(8), _iTabCur, _aToOpen, &_iDataCur, &_iIdxCur)
 97319  	func() {
 97320  		if _pPk == nil && _pTab.XnModuleArg == 0 && _iDataCur != _iTabCur {
 97321  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105121), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115313)))
 97322  			crt.X__builtin_abort(tls)
 97323  		}
 97324  	}()
 97325  	func() {
 97326  		if _pPk == nil && _pTab.XnModuleArg == 0 && _iIdxCur != (_iDataCur+int32(1)) {
 97327  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105122), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115357)))
 97328  			crt.X__builtin_abort(tls)
 97329  		}
 97330  	}()
 97331  	if _eOnePass == int32(2) {
 97332  		_sqlite3VdbeJumpHere(tls, _v, _28_iAddrOnce)
 97333  	}
 97334  _81:
 97335  	if _eOnePass == int32(0) {
 97336  		goto _92
 97337  	}
 97338  	func() {
 97339  		if int32(_nKey) != int32(_nPk) {
 97340  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105130), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115403)))
 97341  			crt.X__builtin_abort(tls)
 97342  		}
 97343  	}()
 97344  	if (_pTab.XnModuleArg == 0) && ((*elem15(_aToOpen, uintptr(_iDataCur-_iTabCur))) != 0) {
 97345  		func() {
 97346  			if _pPk == nil && (*XSelect)(_pTab.XpSelect) == nil {
 97347  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105132), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115413)))
 97348  				crt.X__builtin_abort(tls)
 97349  			}
 97350  		}()
 97351  		_sqlite3VdbeAddOp4Int(tls, _v, int32(29), _iDataCur, _addrBypass, _iKey, int32(_nKey))
 97352  	}
 97353  	goto _104
 97354  _92:
 97355  	if _pPk != nil {
 97356  		_addrLoop = _sqlite3VdbeAddOp1(tls, _v, int32(37), _iEphCur)
 97357  		_sqlite3VdbeAddOp2(tls, _v, int32(124), _iEphCur, _iKey)
 97358  		func() {
 97359  			if int32(_nKey) != int32(0) {
 97360  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105139), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115440)))
 97361  				crt.X__builtin_abort(tls)
 97362  			}
 97363  		}()
 97364  		goto _104
 97365  	}
 97366  	_addrLoop = _sqlite3VdbeAddOp3(tls, _v, int32(42), _iRowSet, int32(0), _iKey)
 97367  	func() {
 97368  		if int32(_nKey) != int32(1) {
 97369  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105143), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115448)))
 97370  			crt.X__builtin_abort(tls)
 97371  		}
 97372  	}()
 97373  _104:
 97374  	if _pTab.XnModuleArg == 0 {
 97375  		goto _107
 97376  	}
 97377  	_34_pVTab = (*int8)(unsafe.Pointer(_sqlite3GetVTable(tls, _db, _pTab)))
 97378  	_sqlite3VtabMakeWritable(tls, _pParse, _pTab)
 97379  	_sqlite3VdbeAddOp4(tls, _v, int32(12), int32(0), int32(1), _iKey, _34_pVTab, int32(-8))
 97380  	_sqlite3VdbeChangeP5(tls, _v, uint16(2))
 97381  	func() {
 97382  		if _eOnePass != int32(0) && _eOnePass != int32(1) {
 97383  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105153), unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000), unsafe.Pointer(str(115456)))
 97384  			crt.X__builtin_abort(tls)
 97385  		}
 97386  	}()
 97387  	_sqlite3MayAbort(tls, _pParse)
 97388  	if (_eOnePass == int32(1)) && ((*XParse)(_pParse.XpToplevel) == nil) {
 97389  		_pParse.XisMultiWrite = 0
 97390  	}
 97391  	goto _113
 97392  _107:
 97393  	_36_count = bool2int(int32(_pParse.Xnested) == int32(0))
 97394  	_sqlite3GenerateRowDelete(tls, _pParse, _pTab, _pTrigger, _iDataCur, _iIdxCur, _iKey, _nKey, uint8(_36_count), uint8(10), uint8(_eOnePass), *elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), uintptr(1)))
 97395  _113:
 97396  	if _eOnePass != int32(0) {
 97397  		_sqlite3VdbeResolveLabel(tls, _v, _addrBypass)
 97398  		_sqlite3WhereEnd(tls, _pWInfo)
 97399  		goto _117
 97400  	}
 97401  	if _pPk != nil {
 97402  		_sqlite3VdbeAddOp2(tls, _v, int32(7), _iEphCur, _addrLoop+int32(1))
 97403  		_sqlite3VdbeJumpHere(tls, _v, _addrLoop)
 97404  		goto _117
 97405  	}
 97406  	_sqlite3VdbeGoto(tls, _v, _addrLoop)
 97407  	_sqlite3VdbeJumpHere(tls, _v, _addrLoop)
 97408  _117:
 97409  _45:
 97410  	if (int32(_pParse.Xnested) == int32(0)) && ((*XTable)(_pParse.XpTriggerTab) == nil) {
 97411  		_sqlite3AutoincrementEnd(tls, _pParse)
 97412  	}
 97413  	if ((_db.Xflags&int32(128)) != 0 && (_pParse.Xnested == 0)) && (_pParse.XpTriggerTab == nil) {
 97414  		_sqlite3VdbeAddOp2(tls, _v, int32(67), _memCnt, int32(1))
 97415  		_sqlite3VdbeSetNumCols(tls, _v, int32(1))
 97416  		_sqlite3VdbeSetColName(tls, _v, int32(0), int32(0), str(115506), nil)
 97417  	}
 97418  _delete_from_cleanup:
 97419  	_sqlite3AuthContextPop(tls, &_sContext)
 97420  	_sqlite3SrcListDelete(tls, _db, _pTabList)
 97421  	_sqlite3ExprDelete(tls, _db, _pWhere)
 97422  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_aToOpen))
 97423  	_ = _aiCurOnePass
 97424  }
 97425  
 97426  var _sqlite3DeleteFromØ00__func__Ø000 [18]int8
 97427  
 97428  func init() {
 97429  	crt.Xstrncpy(nil, &_sqlite3DeleteFromØ00__func__Ø000[0], str(115519), 18)
 97430  }
 97431  
 97432  // C comment
 97433  //  /*
 97434  //  ** Return a list of all triggers on table pTab if there exists at least
 97435  //  ** one trigger that must be fired when an operation of type 'op' is
 97436  //  ** performed on the table, and, if that operation is an UPDATE, if at
 97437  //  ** least one of the columns in pChanges is being modified.
 97438  //  */
 97439  func _sqlite3TriggersExist(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _op int32, _pChanges *XExprList, _pMask *int32) (r0 *XTrigger) {
 97440  	var _mask int32
 97441  	var _pList, _p *XTrigger
 97442  	_mask = int32(0)
 97443  	_pList = nil
 97444  	if (((*Xsqlite3)(_pParse.Xdb).Xflags) & int32(16777216)) != int32(0) {
 97445  		_pList = _sqlite3TriggerList(tls, _pParse, _pTab)
 97446  	}
 97447  	func() {
 97448  		if _pList != nil && _pTab.XnModuleArg != int32(0) {
 97449  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123273), unsafe.Pointer(&_sqlite3TriggersExistØ00__func__Ø000), unsafe.Pointer(str(115537)))
 97450  			crt.X__builtin_abort(tls)
 97451  		}
 97452  	}()
 97453  	_p = _pList
 97454  _4:
 97455  	if _p == nil {
 97456  		goto _7
 97457  	}
 97458  	if (int32(_p.Xop) == _op) && _checkColumnOverlap(tls, (*XIdList)(_p.XpColumns), _pChanges) != 0 {
 97459  		_mask |= int32(_p.Xtr_tm)
 97460  	}
 97461  	_p = (*XTrigger)(_p.XpNext)
 97462  	goto _4
 97463  _7:
 97464  	if _pMask != nil {
 97465  		*_pMask = _mask
 97466  	}
 97467  	return func() *XTrigger {
 97468  		if _mask != 0 {
 97469  			return _pList
 97470  		}
 97471  		return nil
 97472  	}()
 97473  }
 97474  
 97475  // C comment
 97476  //  /*
 97477  //  ** Given table pTab, return a list of all the triggers attached to
 97478  //  ** the table. The list is connected by Trigger.pNext pointers.
 97479  //  **
 97480  //  ** All of the triggers on pTab that are in the same database as pTab
 97481  //  ** are already attached to pTab->pTrigger.  But there might be additional
 97482  //  ** triggers on pTab in the TEMP schema.  This routine prepends all
 97483  //  ** TEMP triggers on pTab to the beginning of the pTab->pTrigger list
 97484  //  ** and returns the combined list.
 97485  //  **
 97486  //  ** To state it another way:  This routine returns a list of all triggers
 97487  //  ** that fire off of pTab.  The list will include any TEMP triggers on
 97488  //  ** pTab as well as the triggers lised in pTab->pTrigger.
 97489  //  */
 97490  func _sqlite3TriggerList(tls *crt.TLS, _pParse *XParse, _pTab *XTable) (r0 *XTrigger) {
 97491  	var _pTmpSchema *XSchema
 97492  	var _2_p *XHashElem
 97493  	var _pList, _3_pTrig *XTrigger
 97494  	_pTmpSchema = (*XSchema)(elem27((*XDb)((*Xsqlite3)(_pParse.Xdb).XaDb), uintptr(1)).XpSchema)
 97495  	_pList = nil
 97496  	if _pParse.XdisableTriggers != 0 {
 97497  		return nil
 97498  	}
 97499  	if _pTmpSchema == (*XSchema)(_pTab.XpSchema) {
 97500  		goto _1
 97501  	}
 97502  	func() {
 97503  		if _sqlite3SchemaMutexHeld(tls, (*Xsqlite3)(_pParse.Xdb), int32(0), _pTmpSchema) == 0 {
 97504  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122701), unsafe.Pointer(&_sqlite3TriggerListØ00__func__Ø000), unsafe.Pointer(str(115568)))
 97505  			crt.X__builtin_abort(tls)
 97506  		}
 97507  	}()
 97508  	_2_p = (*XHashElem)(_pTmpSchema.XtrigHash.Xfirst)
 97509  _4:
 97510  	if _2_p == nil {
 97511  		goto _7
 97512  	}
 97513  	_3_pTrig = (*XTrigger)(_2_p.Xdata)
 97514  	if ((*XSchema)(_3_pTrig.XpTabSchema) == (*XSchema)(_pTab.XpSchema)) && (int32(0) == _sqlite3StrICmp(tls, _3_pTrig.Xtable, _pTab.XzName)) {
 97515  		*(**XTrigger)(unsafe.Pointer(&_3_pTrig.XpNext)) = func() *XTrigger {
 97516  			if _pList != nil {
 97517  				return _pList
 97518  			}
 97519  			return (*XTrigger)(_pTab.XpTrigger)
 97520  		}()
 97521  		_pList = _3_pTrig
 97522  	}
 97523  	_2_p = (*XHashElem)(_2_p.Xnext)
 97524  	goto _4
 97525  _7:
 97526  _1:
 97527  	return func() *XTrigger {
 97528  		if _pList != nil {
 97529  			return _pList
 97530  		}
 97531  		return (*XTrigger)(_pTab.XpTrigger)
 97532  	}()
 97533  }
 97534  
 97535  var _sqlite3TriggerListØ00__func__Ø000 [19]int8
 97536  
 97537  func init() {
 97538  	crt.Xstrncpy(nil, &_sqlite3TriggerListØ00__func__Ø000[0], str(115618), 19)
 97539  }
 97540  
 97541  var _sqlite3TriggersExistØ00__func__Ø000 [21]int8
 97542  
 97543  func init() {
 97544  	crt.Xstrncpy(nil, &_sqlite3TriggersExistØ00__func__Ø000[0], str(115637), 21)
 97545  }
 97546  
 97547  // C comment
 97548  //  /*
 97549  //  ** pEList is the SET clause of an UPDATE statement.  Each entry
 97550  //  ** in pEList is of the format <id>=<expr>.  If any of the entries
 97551  //  ** in pEList have an <id> which matches an identifier in pIdList,
 97552  //  ** then return TRUE.  If pIdList==NULL, then it is considered a
 97553  //  ** wildcard that matches anything.  Likewise if pEList==NULL then
 97554  //  ** it matches anything so always return true.  Return false only
 97555  //  ** if there is no match.
 97556  //  */
 97557  func _checkColumnOverlap(tls *crt.TLS, _pIdList *XIdList, _pEList *XExprList) (r0 int32) {
 97558  	var _e int32
 97559  	if (_pIdList == nil) || func() int32 {
 97560  		if _pEList == nil {
 97561  			return func() int32 {
 97562  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123246), unsafe.Pointer(&_checkColumnOverlapØ00__func__Ø000), unsafe.Pointer(str(4809)))
 97563  				crt.X__builtin_abort(tls)
 97564  				return int32(1)
 97565  			}()
 97566  		}
 97567  		return int32(0)
 97568  	}() != 0 {
 97569  		return int32(1)
 97570  	}
 97571  	_e = int32(0)
 97572  _4:
 97573  	if _e >= _pEList.XnExpr {
 97574  		goto _7
 97575  	}
 97576  	if _sqlite3IdListIndex(tls, _pIdList, elem57((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), uintptr(_e)).XzName) >= int32(0) {
 97577  		return int32(1)
 97578  	}
 97579  	_e += 1
 97580  	goto _4
 97581  _7:
 97582  	return int32(0)
 97583  }
 97584  
 97585  var _checkColumnOverlapØ00__func__Ø000 [19]int8
 97586  
 97587  func init() {
 97588  	crt.Xstrncpy(nil, &_checkColumnOverlapØ00__func__Ø000[0], str(115658), 19)
 97589  }
 97590  
 97591  // C comment
 97592  //  /*
 97593  //  ** This function is called before generating code to update or delete a
 97594  //  ** row contained in table pTab. If the operation is a DELETE, then
 97595  //  ** parameter aChange is passed a NULL value. For an UPDATE, aChange points
 97596  //  ** to an array of size N, where N is the number of columns in table pTab.
 97597  //  ** If the i'th column is not modified by the UPDATE, then the corresponding
 97598  //  ** entry in the aChange[] array is set to -1. If the column is modified,
 97599  //  ** the value is 0 or greater. Parameter chngRowid is set to true if the
 97600  //  ** UPDATE statement modifies the rowid fields of the table.
 97601  //  **
 97602  //  ** If any foreign key processing will be required, this function returns
 97603  //  ** non-zero. If there is no foreign key related processing, this function
 97604  //  ** returns zero.
 97605  //  **
 97606  //  ** For an UPDATE, this function returns 2 if:
 97607  //  **
 97608  //  **   * There are any FKs for which pTab is the child and the parent table, or
 97609  //  **   * the UPDATE modifies one or more parent keys for which the action is
 97610  //  **     not "NO ACTION" (i.e. is CASCADE, SET DEFAULT or SET NULL).
 97611  //  **
 97612  //  ** Or, assuming some other foreign key processing is required, 1.
 97613  //  */
 97614  func _sqlite3FkRequired(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _aChange *int32, _chngRowid int32) (r0 int32) {
 97615  	var _eRet int32
 97616  	var _3_p *XFKey
 97617  	_eRet = int32(0)
 97618  	if (((*Xsqlite3)(_pParse.Xdb).Xflags) & int32(524288)) == 0 {
 97619  		goto _0
 97620  	}
 97621  	if _aChange == nil {
 97622  		_eRet = bool2int((_sqlite3FkReferences(tls, _pTab) != nil) || (_pTab.XpFKey != nil))
 97623  		goto _3
 97624  	}
 97625  	_3_p = (*XFKey)(_pTab.XpFKey)
 97626  _4:
 97627  	if _3_p == nil {
 97628  		goto _7
 97629  	}
 97630  	if int32(0) == Xsqlite3_stricmp(tls, _pTab.XzName, _3_p.XzTo) {
 97631  		return int32(2)
 97632  	}
 97633  	if _fkChildIsModified(tls, _pTab, _3_p, _aChange, _chngRowid) != 0 {
 97634  		_eRet = int32(1)
 97635  	}
 97636  	_3_p = (*XFKey)(_3_p.XpNextFrom)
 97637  	goto _4
 97638  _7:
 97639  	_3_p = _sqlite3FkReferences(tls, _pTab)
 97640  _10:
 97641  	if _3_p == nil {
 97642  		goto _13
 97643  	}
 97644  	if _fkParentIsModified(tls, _pTab, _3_p, _aChange, _chngRowid) == 0 {
 97645  		goto _14
 97646  	}
 97647  	if int32(*elem15((*uint8)(unsafe.Pointer(&_3_p.XaAction)), uintptr(1))) != int32(0) {
 97648  		return int32(2)
 97649  	}
 97650  	_eRet = int32(1)
 97651  _14:
 97652  	_3_p = (*XFKey)(_3_p.XpNextTo)
 97653  	goto _10
 97654  _13:
 97655  _3:
 97656  _0:
 97657  	return _eRet
 97658  }
 97659  
 97660  // C comment
 97661  //  /*
 97662  //  ** The second argument points to an FKey object representing a foreign key
 97663  //  ** for which pTab is the child table. An UPDATE statement against pTab
 97664  //  ** is currently being processed. For each column of the table that is
 97665  //  ** actually updated, the corresponding element in the aChange[] array
 97666  //  ** is zero or greater (if a column is unmodified the corresponding element
 97667  //  ** is set to -1). If the rowid column is modified by the UPDATE statement
 97668  //  ** the bChngRowid argument is non-zero.
 97669  //  **
 97670  //  ** This function returns true if any of the columns that are part of the
 97671  //  ** child key for FK constraint *p are modified.
 97672  //  */
 97673  func _fkChildIsModified(tls *crt.TLS, _pTab *XTable, _p *XFKey, _aChange *int32, _bChngRowid int32) (r0 int32) {
 97674  	var _i, _1_iChildKey int32
 97675  	_i = int32(0)
 97676  _0:
 97677  	if _i >= _p.XnCol {
 97678  		goto _3
 97679  	}
 97680  	_1_iChildKey = elem116((*t117)(unsafe.Pointer(&_p.XaCol)), uintptr(_i)).XiFrom
 97681  	if (*elem8(_aChange, uintptr(_1_iChildKey))) >= int32(0) {
 97682  		return int32(1)
 97683  	}
 97684  	if (_1_iChildKey == int32(_pTab.XiPKey)) && _bChngRowid != 0 {
 97685  		return int32(1)
 97686  	}
 97687  	_i += 1
 97688  	goto _0
 97689  _3:
 97690  	return int32(0)
 97691  }
 97692  
 97693  // C comment
 97694  //  /*
 97695  //  ** The second argument points to an FKey object representing a foreign key
 97696  //  ** for which pTab is the parent table. An UPDATE statement against pTab
 97697  //  ** is currently being processed. For each column of the table that is
 97698  //  ** actually updated, the corresponding element in the aChange[] array
 97699  //  ** is zero or greater (if a column is unmodified the corresponding element
 97700  //  ** is set to -1). If the rowid column is modified by the UPDATE statement
 97701  //  ** the bChngRowid argument is non-zero.
 97702  //  **
 97703  //  ** This function returns true if any of the columns that are part of the
 97704  //  ** parent key for FK constraint *p are modified.
 97705  //  */
 97706  func _fkParentIsModified(tls *crt.TLS, _pTab *XTable, _p *XFKey, _aChange *int32, _bChngRowid int32) (r0 int32) {
 97707  	var _i, _1_iKey int32
 97708  	var _1_zKey *int8
 97709  	var _3_pCol *XColumn
 97710  	_i = int32(0)
 97711  _0:
 97712  	if _i >= _p.XnCol {
 97713  		goto _3
 97714  	}
 97715  	_1_zKey = elem116((*t117)(unsafe.Pointer(&_p.XaCol)), uintptr(_i)).XzCol
 97716  	_1_iKey = int32(0)
 97717  _4:
 97718  	if _1_iKey >= int32(_pTab.XnCol) {
 97719  		goto _7
 97720  	}
 97721  	if (*elem8(_aChange, uintptr(_1_iKey))) < int32(0) && (_1_iKey != int32(_pTab.XiPKey) || _bChngRowid == 0) {
 97722  		goto _10
 97723  	}
 97724  	_3_pCol = elem41((*XColumn)(_pTab.XaCol), uintptr(_1_iKey))
 97725  	if _1_zKey == nil {
 97726  		goto _11
 97727  	}
 97728  	if int32(0) == _sqlite3StrICmp(tls, _3_pCol.XzName, _1_zKey) {
 97729  		return int32(1)
 97730  	}
 97731  	goto _14
 97732  _11:
 97733  	if (int32(_3_pCol.XcolFlags) & int32(1)) != 0 {
 97734  		return int32(1)
 97735  	}
 97736  _14:
 97737  _10:
 97738  	_1_iKey += 1
 97739  	goto _4
 97740  _7:
 97741  	_i += 1
 97742  	goto _0
 97743  _3:
 97744  	return int32(0)
 97745  }
 97746  
 97747  // C comment
 97748  //  /*
 97749  //  ** Check to make sure the given table is writable.  If it is not
 97750  //  ** writable, generate an error message and return 1.  If it is
 97751  //  ** writable return 0;
 97752  //  */
 97753  func _sqlite3IsReadOnly(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _viewOk int32) (r0 int32) {
 97754  	if (_pTab.XnModuleArg != 0 && (func() func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32 {
 97755  		v := (*Xsqlite3_module)((*XModule)(_sqlite3GetVTable(tls, (*Xsqlite3)(_pParse.Xdb), _pTab).XpMod).XpModule).XxUpdate
 97756  		return *(*func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32)(unsafe.Pointer(&v))
 97757  	}() == nil)) || ((((_pTab.XtabFlags & uint32(1)) != (0)) && ((((*Xsqlite3)(_pParse.Xdb).Xflags) & int32(2048)) == int32(0))) && (int32(_pParse.Xnested) == int32(0))) {
 97758  		_sqlite3ErrorMsg(tls, _pParse, str(115677), unsafe.Pointer(_pTab.XzName))
 97759  		return int32(1)
 97760  	}
 97761  	if (_viewOk == 0) && (_pTab.XpSelect != nil) {
 97762  		_sqlite3ErrorMsg(tls, _pParse, str(115706), unsafe.Pointer(_pTab.XzName))
 97763  		return int32(1)
 97764  	}
 97765  	return int32(0)
 97766  }
 97767  
 97768  // C comment
 97769  //  /*
 97770  //  ** Push an authorization context.  After this routine is called, the
 97771  //  ** zArg3 argument to authorization callbacks will be zContext until
 97772  //  ** popped.  Or if pParse==0, this routine is a no-op.
 97773  //  */
 97774  func _sqlite3AuthContextPush(tls *crt.TLS, _pParse *XParse, _pContext *XAuthContext, _zContext *int8) {
 97775  	func() {
 97776  		if _pParse == nil {
 97777  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99676), unsafe.Pointer(&_sqlite3AuthContextPushØ00__func__Ø000), unsafe.Pointer(str(115744)))
 97778  			crt.X__builtin_abort(tls)
 97779  		}
 97780  	}()
 97781  	*(**XParse)(unsafe.Pointer(&_pContext.XpParse)) = _pParse
 97782  	_pContext.XzAuthContext = _pParse.XzAuthContext
 97783  	_pParse.XzAuthContext = _zContext
 97784  }
 97785  
 97786  var _sqlite3AuthContextPushØ00__func__Ø000 [23]int8
 97787  
 97788  func init() {
 97789  	crt.Xstrncpy(nil, &_sqlite3AuthContextPushØ00__func__Ø000[0], str(115751), 23)
 97790  }
 97791  
 97792  // C comment
 97793  //  /*
 97794  //  ** Set a flag in the vdbe to update the change counter when it is finalised
 97795  //  ** or reset.
 97796  //  */
 97797  func _sqlite3VdbeCountChanges(tls *crt.TLS, _v *TVdbe) {
 97798  	storebits26(&_v.Xexpired, int16(1), 16, 4)
 97799  }
 97800  
 97801  // C comment
 97802  //  /*
 97803  //  ** Evaluate a view and store its result in an ephemeral table.  The
 97804  //  ** pWhere argument is an optional WHERE clause that restricts the
 97805  //  ** set of rows in the view that are to be added to the ephemeral table.
 97806  //  */
 97807  func _sqlite3MaterializeView(tls *crt.TLS, _pParse *XParse, _pView *XTable, _pWhere *XExpr, _iCur int32) {
 97808  	var _iDb int32
 97809  	var _db *Xsqlite3
 97810  	var _pFrom *XSrcList
 97811  	var _pSel *XSelect
 97812  	var _dest XSelectDest
 97813  	_db = (*Xsqlite3)(_pParse.Xdb)
 97814  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pView.XpSchema))
 97815  	_pWhere = _sqlite3ExprDup(tls, _db, _pWhere, int32(0))
 97816  	_pFrom = _sqlite3SrcListAppend(tls, _db, nil, nil, nil)
 97817  	if _pFrom != nil {
 97818  		func() {
 97819  			if _pFrom.XnSrc != int32(1) {
 97820  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104736), unsafe.Pointer(&_sqlite3MaterializeViewØ00__func__Ø000), unsafe.Pointer(str(115774)))
 97821  				crt.X__builtin_abort(tls)
 97822  			}
 97823  		}()
 97824  		elem6((*TSrcList_item)(unsafe.Pointer(&_pFrom.Xa)), 0).XzName = _sqlite3DbStrDup(tls, _db, _pView.XzName)
 97825  		elem6((*TSrcList_item)(unsafe.Pointer(&_pFrom.Xa)), 0).XzDatabase = _sqlite3DbStrDup(tls, _db, elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName)
 97826  		func() {
 97827  			if (*XExpr)(elem6((*TSrcList_item)(unsafe.Pointer(&_pFrom.Xa)), 0).XpOn) != nil {
 97828  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104739), unsafe.Pointer(&_sqlite3MaterializeViewØ00__func__Ø000), unsafe.Pointer(str(115789)))
 97829  				crt.X__builtin_abort(tls)
 97830  			}
 97831  		}()
 97832  		func() {
 97833  			if (*XIdList)(elem6((*TSrcList_item)(unsafe.Pointer(&_pFrom.Xa)), 0).XpUsing) != nil {
 97834  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104740), unsafe.Pointer(&_sqlite3MaterializeViewØ00__func__Ø000), unsafe.Pointer(str(115808)))
 97835  				crt.X__builtin_abort(tls)
 97836  			}
 97837  		}()
 97838  	}
 97839  	_pSel = _sqlite3SelectNew(tls, _pParse, nil, _pFrom, _pWhere, nil, nil, nil, uint32(131072), nil, nil)
 97840  	_sqlite3SelectDestInit(tls, &_dest, int32(12), _iCur)
 97841  	_sqlite3Select(tls, _pParse, _pSel, &_dest)
 97842  	_sqlite3SelectDelete(tls, _db, _pSel)
 97843  }
 97844  
 97845  var _sqlite3MaterializeViewØ00__func__Ø000 [23]int8
 97846  
 97847  func init() {
 97848  	crt.Xstrncpy(nil, &_sqlite3MaterializeViewØ00__func__Ø000[0], str(115830), 23)
 97849  }
 97850  
 97851  // C comment
 97852  //  /*
 97853  //  ** Allocate a new Select structure and return a pointer to that
 97854  //  ** structure.
 97855  //  */
 97856  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) {
 97857  	var _standin XSelect
 97858  	var _pNew *XSelect
 97859  	_pNew = (*XSelect)(_sqlite3DbMallocRawNN(tls, (*Xsqlite3)(_pParse.Xdb), uint64(80)))
 97860  	if _pNew == nil {
 97861  		func() {
 97862  			if ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == 0 {
 97863  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116638), unsafe.Pointer(&_sqlite3SelectNewØ00__func__Ø000), unsafe.Pointer(str(42441)))
 97864  				crt.X__builtin_abort(tls)
 97865  			}
 97866  		}()
 97867  		_pNew = &_standin
 97868  	}
 97869  	if _pEList == nil {
 97870  		_pEList = _sqlite3ExprListAppend(tls, _pParse, nil, _sqlite3Expr(tls, (*Xsqlite3)(_pParse.Xdb), int32(161), nil))
 97871  	}
 97872  	*(**XExprList)(unsafe.Pointer(&_pNew.XpEList)) = _pEList
 97873  	_pNew.Xop = uint8(119)
 97874  	_pNew.XselFlags = _selFlags
 97875  	_pNew.XiLimit = int32(0)
 97876  	_pNew.XiOffset = int32(0)
 97877  	*elem1((*int8)(unsafe.Pointer(&_pNew.XzSelName)), 0) = 0
 97878  	*elem8((*int32)(unsafe.Pointer(&_pNew.XaddrOpenEphm)), 0) = int32(-1)
 97879  	*elem8((*int32)(unsafe.Pointer(&_pNew.XaddrOpenEphm)), uintptr(1)) = int32(-1)
 97880  	_pNew.XnSelectRow = 0
 97881  	if _pSrc == nil {
 97882  		_pSrc = (*XSrcList)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pParse.Xdb), uint64(76)))
 97883  	}
 97884  	*(**XSrcList)(unsafe.Pointer(&_pNew.XpSrc)) = _pSrc
 97885  	*(**XExpr)(unsafe.Pointer(&_pNew.XpWhere)) = _pWhere
 97886  	*(**XExprList)(unsafe.Pointer(&_pNew.XpGroupBy)) = _pGroupBy
 97887  	*(**XExpr)(unsafe.Pointer(&_pNew.XpHaving)) = _pHaving
 97888  	*(**XExprList)(unsafe.Pointer(&_pNew.XpOrderBy)) = _pOrderBy
 97889  	*(**XSelect)(unsafe.Pointer(&_pNew.XpPrior)) = nil
 97890  	*(**XSelect)(unsafe.Pointer(&_pNew.XpNext)) = nil
 97891  	*(**XExpr)(unsafe.Pointer(&_pNew.XpLimit)) = _pLimit
 97892  	*(**XExpr)(unsafe.Pointer(&_pNew.XpOffset)) = _pOffset
 97893  	*(**XWith)(unsafe.Pointer(&_pNew.XpWith)) = nil
 97894  	func() {
 97895  		if _pOffset != nil && _pLimit == nil && _pParse.XnErr <= int32(0) && int32((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == int32(0) {
 97896  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116666), unsafe.Pointer(&_sqlite3SelectNewØ00__func__Ø000), unsafe.Pointer(str(115853)))
 97897  			crt.X__builtin_abort(tls)
 97898  		}
 97899  	}()
 97900  	if ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) != 0 {
 97901  		_clearSelect(tls, (*Xsqlite3)(_pParse.Xdb), _pNew, bool2int(_pNew != &_standin))
 97902  		_pNew = nil
 97903  		goto _11
 97904  	}
 97905  	func() {
 97906  		if (*XSrcList)(_pNew.XpSrc) == nil && _pParse.XnErr <= int32(0) {
 97907  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116671), unsafe.Pointer(&_sqlite3SelectNewØ00__func__Ø000), unsafe.Pointer(str(115926)))
 97908  			crt.X__builtin_abort(tls)
 97909  		}
 97910  	}()
 97911  _11:
 97912  	func() {
 97913  		if _pNew == &_standin {
 97914  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116673), unsafe.Pointer(&_sqlite3SelectNewØ00__func__Ø000), unsafe.Pointer(str(115958)))
 97915  			crt.X__builtin_abort(tls)
 97916  		}
 97917  	}()
 97918  	return _pNew
 97919  
 97920  	_ = _standin
 97921  	panic(0)
 97922  }
 97923  
 97924  var _sqlite3SelectNewØ00__func__Ø000 [17]int8
 97925  
 97926  func init() {
 97927  	crt.Xstrncpy(nil, &_sqlite3SelectNewØ00__func__Ø000[0], str(115973), 17)
 97928  }
 97929  
 97930  // C comment
 97931  //  /*
 97932  //  ** Return ONEPASS_OFF (0) if an UPDATE or DELETE statement is unable to
 97933  //  ** operate directly on the rowis returned by a WHERE clause.  Return
 97934  //  ** ONEPASS_SINGLE (1) if the statement can operation directly because only
 97935  //  ** a single row is to be changed.  Return ONEPASS_MULTI (2) if the one-pass
 97936  //  ** optimization can be used on multiple
 97937  //  **
 97938  //  ** If the ONEPASS optimization is used (if this routine returns true)
 97939  //  ** then also write the indices of open cursors used by ONEPASS
 97940  //  ** into aiCur[0] and aiCur[1].  iaCur[0] gets the cursor of the data
 97941  //  ** table and iaCur[1] gets the cursor used by an auxiliary index.
 97942  //  ** Either value may be -1, indicating that cursor is not used.
 97943  //  ** Any cursors returned will have been opened for writing.
 97944  //  **
 97945  //  ** aiCur[0] and aiCur[1] both get -1 if the where-clause logic is
 97946  //  ** unable to use the ONEPASS optimization.
 97947  //  */
 97948  func _sqlite3WhereOkOnePass(tls *crt.TLS, _pWInfo *XWhereInfo, _aiCur *int32) (r0 int32) {
 97949  	crt.Xmemcpy(tls, unsafe.Pointer(_aiCur), unsafe.Pointer(&_pWInfo.XaiCurOnePass), uint32(8))
 97950  	return int32(_pWInfo.XeOnePass)
 97951  }
 97952  
 97953  // C comment
 97954  //  /*
 97955  //  ** Allocate cursors for the pTab table and all its indices and generate
 97956  //  ** code to open and initialized those cursors.
 97957  //  **
 97958  //  ** The cursor for the object that contains the complete data (normally
 97959  //  ** the table itself, but the PRIMARY KEY index in the case of a WITHOUT
 97960  //  ** ROWID table) is returned in *piDataCur.  The first index cursor is
 97961  //  ** returned in *piIdxCur.  The number of indices is returned.
 97962  //  **
 97963  //  ** Use iBase as the first cursor (either the *piDataCur for rowid tables
 97964  //  ** or the first index for WITHOUT ROWID tables) if it is non-negative.
 97965  //  ** If iBase is negative, then allocate the next available cursor.
 97966  //  **
 97967  //  ** For a rowid table, *piDataCur will be exactly one less than *piIdxCur.
 97968  //  ** For a WITHOUT ROWID table, *piDataCur will be somewhere in the range
 97969  //  ** of *piIdxCurs, depending on where the PRIMARY KEY index appears on the
 97970  //  ** pTab->pIndex list.
 97971  //  **
 97972  //  ** If pTab is a virtual table, then this routine is a no-op and the
 97973  //  ** *piDataCur and *piIdxCur values are left uninitialized.
 97974  //  */
 97975  func _sqlite3OpenTableAndIndices(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _op int32, _p5 uint8, _iBase int32, _aToOpen *uint8, _piDataCur *int32, _piIdxCur *int32) (r0 int32) {
 97976  	var _i, _iDb, _iDataCur, _4_iIdxCur int32
 97977  	var _v *TVdbe
 97978  	var _pIdx *XIndex
 97979  	func() {
 97980  		if _op != int32(106) && _op != int32(107) {
 97981  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110658), unsafe.Pointer(&_sqlite3OpenTableAndIndicesØ00__func__Ø000), unsafe.Pointer(str(115990)))
 97982  			crt.X__builtin_abort(tls)
 97983  		}
 97984  	}()
 97985  	func() {
 97986  		if _op != int32(107) && int32(_p5) != int32(0) {
 97987  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110659), unsafe.Pointer(&_sqlite3OpenTableAndIndicesØ00__func__Ø000), unsafe.Pointer(str(116026)))
 97988  			crt.X__builtin_abort(tls)
 97989  		}
 97990  	}()
 97991  	if _pTab.XnModuleArg != 0 {
 97992  		return int32(0)
 97993  	}
 97994  	_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), (*XSchema)(_pTab.XpSchema))
 97995  	_v = _sqlite3GetVdbe(tls, _pParse)
 97996  	func() {
 97997  		if _v == nil {
 97998  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110668), unsafe.Pointer(&_sqlite3OpenTableAndIndicesØ00__func__Ø000), unsafe.Pointer(str(42019)))
 97999  			crt.X__builtin_abort(tls)
 98000  		}
 98001  	}()
 98002  	if _iBase < int32(0) {
 98003  		_iBase = _pParse.XnTab
 98004  	}
 98005  	_iDataCur = postInc2(&_iBase, 1)
 98006  	if _piDataCur != nil {
 98007  		*_piDataCur = _iDataCur
 98008  	}
 98009  	if ((_pTab.XtabFlags & uint32(32)) == (0)) && ((_aToOpen == nil) || ((*elem15(_aToOpen, 0)) != 0)) {
 98010  		_sqlite3OpenTable(tls, _pParse, _iDataCur, _iDb, _pTab, _op)
 98011  		goto _14
 98012  	}
 98013  	_sqlite3TableLock(tls, _pParse, _iDb, _pTab.Xtnum, uint8(bool2int(_op == int32(107))), _pTab.XzName)
 98014  _14:
 98015  	if _piIdxCur != nil {
 98016  		*_piIdxCur = _iBase
 98017  	}
 98018  	*func() **XIndex { _i = int32(0); return &_pIdx }() = (*XIndex)(_pTab.XpIndex)
 98019  _16:
 98020  	if _pIdx == nil {
 98021  		goto _19
 98022  	}
 98023  	_4_iIdxCur = postInc2(&_iBase, 1)
 98024  	func() {
 98025  		if (*XSchema)(_pIdx.XpSchema) != (*XSchema)(_pTab.XpSchema) {
 98026  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110680), unsafe.Pointer(&_sqlite3OpenTableAndIndicesØ00__func__Ø000), unsafe.Pointer(str(115165)))
 98027  			crt.X__builtin_abort(tls)
 98028  		}
 98029  	}()
 98030  	if int32((uint32(_pIdx.XidxType)<<30)>>30) != int32(2) || (_pTab.XtabFlags&uint32(32)) == (0) {
 98031  		goto _23
 98032  	}
 98033  	if _piDataCur != nil {
 98034  		*_piDataCur = _4_iIdxCur
 98035  	}
 98036  	_p5 = 0
 98037  _23:
 98038  	if (_aToOpen == nil) || ((*elem15(_aToOpen, uintptr(_i+int32(1)))) != 0) {
 98039  		_sqlite3VdbeAddOp3(tls, _v, _op, _4_iIdxCur, _pIdx.Xtnum, _iDb)
 98040  		_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pIdx)
 98041  		_sqlite3VdbeChangeP5(tls, _v, uint16(_p5))
 98042  		_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(_pIdx.XzName))
 98043  	}
 98044  	*func() *int32 { _pIdx = (*XIndex)(_pIdx.XpNext); return &_i }() += 1
 98045  	goto _16
 98046  _19:
 98047  	if _iBase > _pParse.XnTab {
 98048  		_pParse.XnTab = _iBase
 98049  	}
 98050  	return _i
 98051  }
 98052  
 98053  var _sqlite3OpenTableAndIndicesØ00__func__Ø000 [27]int8
 98054  
 98055  func init() {
 98056  	crt.Xstrncpy(nil, &_sqlite3OpenTableAndIndicesØ00__func__Ø000[0], str(116052), 27)
 98057  }
 98058  
 98059  // C comment
 98060  //  /*
 98061  //  ** Make sure virtual table pTab is contained in the pParse->apVirtualLock[]
 98062  //  ** array so that an OP_VBegin will get generated for it.  Add pTab to the
 98063  //  ** array if it is missing.  If pTab is already in the array, this routine
 98064  //  ** is a no-op.
 98065  //  */
 98066  func _sqlite3VtabMakeWritable(tls *crt.TLS, _pParse *XParse, _pTab *XTable) {
 98067  	var _i, _n int32
 98068  	var _pToplevel *XParse
 98069  	var _apVtabLock **XTable
 98070  	_pToplevel = func() *XParse {
 98071  		if _pParse.XpToplevel != nil {
 98072  			return (*XParse)(_pParse.XpToplevel)
 98073  		}
 98074  		return _pParse
 98075  	}()
 98076  	func() {
 98077  		if _pTab.XnModuleArg == 0 {
 98078  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(126093), unsafe.Pointer(&_sqlite3VtabMakeWritableØ00__func__Ø000), unsafe.Pointer(str(24484)))
 98079  			crt.X__builtin_abort(tls)
 98080  		}
 98081  	}()
 98082  	_i = int32(0)
 98083  _4:
 98084  	if _i >= _pToplevel.XnVtabLock {
 98085  		goto _7
 98086  	}
 98087  	if _pTab == (*elem59((**XTable)(unsafe.Pointer(_pToplevel.XapVtabLock)), uintptr(_i))) {
 98088  		return
 98089  	}
 98090  	_i += 1
 98091  	goto _4
 98092  _7:
 98093  	_n = int32(uint32(_pToplevel.XnVtabLock+int32(1)) * uint32(4))
 98094  	_apVtabLock = (**XTable)(Xsqlite3_realloc64(tls, unsafe.Pointer(_pToplevel.XapVtabLock), uint64(_n)))
 98095  	if _apVtabLock != nil {
 98096  		*(***XTable)(unsafe.Pointer(&_pToplevel.XapVtabLock)) = _apVtabLock
 98097  		*elem59((**XTable)(unsafe.Pointer(_pToplevel.XapVtabLock)), uintptr(postInc2(&_pToplevel.XnVtabLock, 1))) = _pTab
 98098  		goto _10
 98099  	}
 98100  	_sqlite3OomFault(tls, (*Xsqlite3)(_pToplevel.Xdb))
 98101  _10:
 98102  }
 98103  
 98104  var _sqlite3VtabMakeWritableØ00__func__Ø000 [24]int8
 98105  
 98106  func init() {
 98107  	crt.Xstrncpy(nil, &_sqlite3VtabMakeWritableØ00__func__Ø000[0], str(116079), 24)
 98108  }
 98109  
 98110  // C comment
 98111  //  /*
 98112  //  ** This routine generates VDBE code that causes a single row of a
 98113  //  ** single table to be deleted.  Both the original table entry and
 98114  //  ** all indices are removed.
 98115  //  **
 98116  //  ** Preconditions:
 98117  //  **
 98118  //  **   1.  iDataCur is an open cursor on the btree that is the canonical data
 98119  //  **       store for the table.  (This will be either the table itself,
 98120  //  **       in the case of a rowid table, or the PRIMARY KEY index in the case
 98121  //  **       of a WITHOUT ROWID table.)
 98122  //  **
 98123  //  **   2.  Read/write cursors for all indices of pTab must be open as
 98124  //  **       cursor number iIdxCur+i for the i-th index.
 98125  //  **
 98126  //  **   3.  The primary key for the row to be deleted must be stored in a
 98127  //  **       sequence of nPk memory cells starting at iPk.  If nPk==0 that means
 98128  //  **       that a search record formed from OP_MakeRecord is contained in the
 98129  //  **       single memory location iPk.
 98130  //  **
 98131  //  ** eMode:
 98132  //  **   Parameter eMode may be passed either ONEPASS_OFF (0), ONEPASS_SINGLE, or
 98133  //  **   ONEPASS_MULTI.  If eMode is not ONEPASS_OFF, then the cursor
 98134  //  **   iDataCur already points to the row to delete. If eMode is ONEPASS_OFF
 98135  //  **   then this function must seek iDataCur to the entry identified by iPk
 98136  //  **   and nPk before reading from it.
 98137  //  **
 98138  //  **   If eMode is ONEPASS_MULTI, then this call is being made as part
 98139  //  **   of a ONEPASS delete that affects multiple rows. In this case, if
 98140  //  **   iIdxNoSeek is a valid cursor number (>=0) and is not the same as
 98141  //  **   iDataCur, then its position should be preserved following the delete
 98142  //  **   operation. Or, if iIdxNoSeek is not a valid cursor number, the
 98143  //  **   position of iDataCur should be preserved instead.
 98144  //  **
 98145  //  ** iIdxNoSeek:
 98146  //  **   If iIdxNoSeek is a valid cursor number (>=0) not equal to iDataCur,
 98147  //  **   then it identifies an index cursor (from within array of cursors
 98148  //  **   starting at iIdxCur) that already points to the index entry to be deleted.
 98149  //  **   Except, this optimization is disabled if there are BEFORE triggers since
 98150  //  **   the trigger body might have moved the cursor.
 98151  //  */
 98152  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) {
 98153  	var _iOld, _iLabel, _2_iCol, _2_addrStart int32
 98154  	var _2_mask uint32
 98155  	var _opSeek, _6_p5 uint8
 98156  	var _v *TVdbe
 98157  	_v = (*TVdbe)(_pParse.XpVdbe)
 98158  	_iOld = int32(0)
 98159  	func() {
 98160  		if _v == nil {
 98161  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105274), unsafe.Pointer(&_sqlite3GenerateRowDeleteØ00__func__Ø000), unsafe.Pointer(str(41816)))
 98162  			crt.X__builtin_abort(tls)
 98163  		}
 98164  	}()
 98165  	_iLabel = _sqlite3VdbeMakeLabel(tls, _v)
 98166  	_opSeek = uint8(func() int32 {
 98167  		if (_pTab.XtabFlags & uint32(32)) == (0) {
 98168  			return int32(32)
 98169  		}
 98170  		return int32(29)
 98171  	}())
 98172  	if int32(_eMode) == int32(0) {
 98173  		_sqlite3VdbeAddOp4Int(tls, _v, int32(_opSeek), _iDataCur, _iLabel, _iPk, int32(_nPk))
 98174  	}
 98175  	if _sqlite3FkRequired(tls, _pParse, _pTab, nil, int32(0)) == 0 && _pTrigger == nil {
 98176  		goto _6
 98177  	}
 98178  	_2_mask = _sqlite3TriggerColmask(tls, _pParse, _pTrigger, nil, int32(0), int32(3), _pTab, int32(_onconf))
 98179  	_2_mask |= _sqlite3FkOldmask(tls, _pParse, _pTab)
 98180  	_iOld = _pParse.XnMem + int32(1)
 98181  	_pParse.XnMem += int32(1) + int32(_pTab.XnCol)
 98182  	_sqlite3VdbeAddOp2(tls, _v, int32(64), _iPk, _iOld)
 98183  	_2_iCol = int32(0)
 98184  _7:
 98185  	if _2_iCol >= int32(_pTab.XnCol) {
 98186  		goto _10
 98187  	}
 98188  	if (_2_mask == uint32(4294967295)) || ((_2_iCol <= int32(31)) && ((_2_mask & (uint32(1) << uint(_2_iCol))) != (0))) {
 98189  		_sqlite3ExprCodeGetColumnOfTable(tls, _v, _pTab, _iDataCur, _2_iCol, (_iOld+_2_iCol)+int32(1))
 98190  	}
 98191  	_2_iCol += 1
 98192  	goto _7
 98193  _10:
 98194  	_2_addrStart = _sqlite3VdbeCurrentAddr(tls, _v)
 98195  	_sqlite3CodeRowTrigger(tls, _pParse, _pTrigger, int32(109), nil, int32(1), _pTab, _iOld, int32(_onconf), _iLabel)
 98196  	if _2_addrStart < _sqlite3VdbeCurrentAddr(tls, _v) {
 98197  		_sqlite3VdbeAddOp4Int(tls, _v, int32(_opSeek), _iDataCur, _iLabel, _iPk, int32(_nPk))
 98198  		_iIdxNoSeek = int32(-1)
 98199  	}
 98200  	_sqlite3FkCheck(tls, _pParse, _pTab, _iOld, int32(0), nil, int32(0))
 98201  _6:
 98202  	if (*XSelect)(_pTab.XpSelect) != nil {
 98203  		goto _15
 98204  	}
 98205  	_6_p5 = uint8(0)
 98206  	_sqlite3GenerateRowIndexDelete(tls, _pParse, _pTab, _iDataCur, _iIdxCur, nil, _iIdxNoSeek)
 98207  	_sqlite3VdbeAddOp2(tls, _v, int32(120), _iDataCur, func() int32 {
 98208  		if _count != 0 {
 98209  			return int32(1)
 98210  		}
 98211  		return int32(0)
 98212  	}())
 98213  	if int32(_pParse.Xnested) == int32(0) {
 98214  		_sqlite3VdbeAppendP4(tls, _v, unsafe.Pointer(_pTab), int32(-15))
 98215  	}
 98216  	if int32(_eMode) != int32(0) {
 98217  		_sqlite3VdbeChangeP5(tls, _v, uint16(4))
 98218  	}
 98219  	if (_iIdxNoSeek >= int32(0)) && (_iIdxNoSeek != _iDataCur) {
 98220  		_sqlite3VdbeAddOp1(tls, _v, int32(120), _iIdxNoSeek)
 98221  	}
 98222  	if int32(_eMode) == int32(2) {
 98223  		{
 98224  			p := &_6_p5
 98225  			*p = uint8(int32(*p) | int32(2))
 98226  		}
 98227  	}
 98228  	_sqlite3VdbeChangeP5(tls, _v, uint16(_6_p5))
 98229  _15:
 98230  	_sqlite3FkActions(tls, _pParse, _pTab, nil, _iOld, nil, int32(0))
 98231  	_sqlite3CodeRowTrigger(tls, _pParse, _pTrigger, int32(109), nil, int32(2), _pTab, _iOld, int32(_onconf), _iLabel)
 98232  	_sqlite3VdbeResolveLabel(tls, _v, _iLabel)
 98233  }
 98234  
 98235  var _sqlite3GenerateRowDeleteØ00__func__Ø000 [25]int8
 98236  
 98237  func init() {
 98238  	crt.Xstrncpy(nil, &_sqlite3GenerateRowDeleteØ00__func__Ø000[0], str(116103), 25)
 98239  }
 98240  
 98241  // C comment
 98242  //  /*
 98243  //  ** Triggers may access values stored in the old.* or new.* pseudo-table.
 98244  //  ** This function returns a 32-bit bitmask indicating which columns of the
 98245  //  ** old.* or new.* tables actually are used by triggers. This information
 98246  //  ** may be used by the caller, for example, to avoid having to load the entire
 98247  //  ** old.* record into memory when executing an UPDATE or DELETE command.
 98248  //  **
 98249  //  ** Bit 0 of the returned mask is set if the left-most column of the
 98250  //  ** table may be accessed using an [old|new].<col> reference. Bit 1 is set if
 98251  //  ** the second leftmost column value is required, and so on. If there
 98252  //  ** are more than 32 columns in the table, and at least one of the columns
 98253  //  ** with an index greater than 32 may be accessed, 0xffffffff is returned.
 98254  //  **
 98255  //  ** It is not possible to determine if the old.rowid or new.rowid column is
 98256  //  ** accessed by triggers. The caller must always assume that it is.
 98257  //  **
 98258  //  ** Parameter isNew must be either 1 or 0. If it is 0, then the mask returned
 98259  //  ** applies to the old.* table. If 1, the new.* table.
 98260  //  **
 98261  //  ** Parameter tr_tm must be a mask with one or both of the TRIGGER_BEFORE
 98262  //  ** and TRIGGER_AFTER bits set. Values accessed by BEFORE triggers are only
 98263  //  ** included in the returned mask if the TRIGGER_BEFORE bit is set in the
 98264  //  ** tr_tm parameter. Similarly, values accessed by AFTER triggers are only
 98265  //  ** included in the returned mask if the TRIGGER_AFTER bit is set in tr_tm.
 98266  //  */
 98267  func _sqlite3TriggerColmask(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger, _pChanges *XExprList, _isNew int32, _tr_tm int32, _pTab *XTable, _orconf int32) (r0 uint32) {
 98268  	var _op int32
 98269  	var _mask uint32
 98270  	var _p *XTrigger
 98271  	var _2_pPrg *XTriggerPrg
 98272  	_op = func() int32 {
 98273  		if _pChanges != nil {
 98274  			return int32(110)
 98275  		}
 98276  		return int32(109)
 98277  	}()
 98278  	_mask = uint32(0)
 98279  	func() {
 98280  		if _isNew != int32(1) && _isNew != int32(0) {
 98281  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123727), unsafe.Pointer(&_sqlite3TriggerColmaskØ00__func__Ø000), unsafe.Pointer(str(116128)))
 98282  			crt.X__builtin_abort(tls)
 98283  		}
 98284  	}()
 98285  	_p = _pTrigger
 98286  _5:
 98287  	if _p == nil {
 98288  		goto _8
 98289  	}
 98290  	if int32(_p.Xop) != _op || (_tr_tm&int32(_p.Xtr_tm)) == 0 || _checkColumnOverlap(tls, (*XIdList)(_p.XpColumns), _pChanges) == 0 {
 98291  		goto _11
 98292  	}
 98293  	_2_pPrg = _getRowTrigger(tls, _pParse, _p, _pTab, _orconf)
 98294  	if _2_pPrg != nil {
 98295  		_mask |= *elem7((*uint32)(unsafe.Pointer(&_2_pPrg.XaColmask)), uintptr(_isNew))
 98296  	}
 98297  _11:
 98298  	_p = (*XTrigger)(_p.XpNext)
 98299  	goto _5
 98300  _8:
 98301  	return _mask
 98302  }
 98303  
 98304  var _sqlite3TriggerColmaskØ00__func__Ø000 [22]int8
 98305  
 98306  func init() {
 98307  	crt.Xstrncpy(nil, &_sqlite3TriggerColmaskØ00__func__Ø000[0], str(116149), 22)
 98308  }
 98309  
 98310  // C comment
 98311  //  /*
 98312  //  ** Return a pointer to a TriggerPrg object containing the sub-program for
 98313  //  ** trigger pTrigger with default ON CONFLICT algorithm orconf. If no such
 98314  //  ** TriggerPrg object exists, a new object is allocated and populated before
 98315  //  ** being returned.
 98316  //  */
 98317  func _getRowTrigger(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger, _pTab *XTable, _orconf int32) (r0 *XTriggerPrg) {
 98318  	var _pRoot *XParse
 98319  	var _pPrg *XTriggerPrg
 98320  	_pRoot = func() *XParse {
 98321  		if _pParse.XpToplevel != nil {
 98322  			return (*XParse)(_pParse.XpToplevel)
 98323  		}
 98324  		return _pParse
 98325  	}()
 98326  	func() {
 98327  		if _pTrigger.XzName != nil && _pTab != _tableOfTrigger(tls, _pTrigger) {
 98328  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123555), unsafe.Pointer(&_getRowTriggerØ00__func__Ø000), unsafe.Pointer(str(116171)))
 98329  			crt.X__builtin_abort(tls)
 98330  		}
 98331  	}()
 98332  	_pPrg = (*XTriggerPrg)(_pRoot.XpTriggerPrg)
 98333  _5:
 98334  	if _pPrg == nil || (*XTrigger)(_pPrg.XpTrigger) == _pTrigger && _pPrg.Xorconf == _orconf {
 98335  		goto _10
 98336  	}
 98337  	_pPrg = (*XTriggerPrg)(_pPrg.XpNext)
 98338  	goto _5
 98339  _10:
 98340  	if _pPrg == nil {
 98341  		_pPrg = _codeRowTrigger(tls, _pParse, _pTrigger, _pTab, _orconf)
 98342  	}
 98343  	return _pPrg
 98344  }
 98345  
 98346  var _getRowTriggerØ00__func__Ø000 [14]int8
 98347  
 98348  func init() {
 98349  	crt.Xstrncpy(nil, &_getRowTriggerØ00__func__Ø000[0], str(116224), 14)
 98350  }
 98351  
 98352  // C comment
 98353  //  /*
 98354  //  ** Create and populate a new TriggerPrg object with a sub-program
 98355  //  ** implementing trigger pTrigger with ON CONFLICT policy orconf.
 98356  //  */
 98357  func _codeRowTrigger(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger, _pTab *XTable, _orconf int32) (r0 *XTriggerPrg) {
 98358  	var _iEndTrigger int32
 98359  	var _db *Xsqlite3
 98360  	var _v *TVdbe
 98361  	var _pWhen *XExpr
 98362  	var _pTop, _pSubParse *XParse
 98363  	var _pProgram *XSubProgram
 98364  	var _sNC XNameContext
 98365  	var _pPrg *XTriggerPrg
 98366  	_pTop = func() *XParse {
 98367  		if _pParse.XpToplevel != nil {
 98368  			return (*XParse)(_pParse.XpToplevel)
 98369  		}
 98370  		return _pParse
 98371  	}()
 98372  	_db = (*Xsqlite3)(_pParse.Xdb)
 98373  	_pWhen = nil
 98374  	_pProgram = nil
 98375  	_iEndTrigger = int32(0)
 98376  	func() {
 98377  		if _pTrigger.XzName != nil && _pTab != _tableOfTrigger(tls, _pTrigger) {
 98378  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123449), unsafe.Pointer(&_codeRowTriggerØ00__func__Ø000), unsafe.Pointer(str(116171)))
 98379  			crt.X__builtin_abort(tls)
 98380  		}
 98381  	}()
 98382  	func() {
 98383  		if _pTop.XpVdbe == nil {
 98384  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123450), unsafe.Pointer(&_codeRowTriggerØ00__func__Ø000), unsafe.Pointer(str(116238)))
 98385  			crt.X__builtin_abort(tls)
 98386  		}
 98387  	}()
 98388  	_pPrg = (*XTriggerPrg)(_sqlite3DbMallocZero(tls, _db, uint64(24)))
 98389  	if _pPrg == nil {
 98390  		return nil
 98391  	}
 98392  	*(**XTriggerPrg)(unsafe.Pointer(&_pPrg.XpNext)) = (*XTriggerPrg)(_pTop.XpTriggerPrg)
 98393  	*(**XTriggerPrg)(unsafe.Pointer(&_pTop.XpTriggerPrg)) = _pPrg
 98394  	*(**XSubProgram)(unsafe.Pointer(&_pPrg.XpProgram)) = store119(&_pProgram, (*XSubProgram)(_sqlite3DbMallocZero(tls, _db, uint64(28))))
 98395  	if _pProgram == nil {
 98396  		return nil
 98397  	}
 98398  	_sqlite3VdbeLinkSubProgram(tls, (*TVdbe)(_pTop.XpVdbe), _pProgram)
 98399  	*(**XTrigger)(unsafe.Pointer(&_pPrg.XpTrigger)) = _pTrigger
 98400  	_pPrg.Xorconf = _orconf
 98401  	*elem7((*uint32)(unsafe.Pointer(&_pPrg.XaColmask)), 0) = uint32(4294967295)
 98402  	*elem7((*uint32)(unsafe.Pointer(&_pPrg.XaColmask)), uintptr(1)) = uint32(4294967295)
 98403  	_pSubParse = (*XParse)(_sqlite3DbMallocZero(tls, _db, uint64(484)))
 98404  	if _pSubParse == nil {
 98405  		return nil
 98406  	}
 98407  	crt.Xmemset(tls, unsafe.Pointer(&_sNC), int32(0), uint32(32))
 98408  	*(**XParse)(unsafe.Pointer(&_sNC.XpParse)) = _pSubParse
 98409  	*(**Xsqlite3)(unsafe.Pointer(&_pSubParse.Xdb)) = _db
 98410  	*(**XTable)(unsafe.Pointer(&_pSubParse.XpTriggerTab)) = _pTab
 98411  	*(**XParse)(unsafe.Pointer(&_pSubParse.XpToplevel)) = _pTop
 98412  	_pSubParse.XzAuthContext = _pTrigger.XzName
 98413  	_pSubParse.XeTriggerOp = _pTrigger.Xop
 98414  	_pSubParse.XnQueryLoop = _pParse.XnQueryLoop
 98415  	_v = _sqlite3GetVdbe(tls, _pSubParse)
 98416  	if _v == nil {
 98417  		goto _10
 98418  	}
 98419  	_sqlite3VdbeComment(tls, _v, str(116250), unsafe.Pointer(_pTrigger.XzName), unsafe.Pointer(_onErrorText(tls, _orconf)), unsafe.Pointer(func() *int8 {
 98420  		if int32(_pTrigger.Xtr_tm) == int32(1) {
 98421  			return str(25122)
 98422  		}
 98423  		return str(25097)
 98424  	}()), unsafe.Pointer(func() *int8 {
 98425  		if int32(_pTrigger.Xop) == int32(110) {
 98426  			return str(25595)
 98427  		}
 98428  		return str(284)
 98429  	}()), unsafe.Pointer(func() *int8 {
 98430  		if int32(_pTrigger.Xop) == int32(108) {
 98431  			return str(25581)
 98432  		}
 98433  		return str(284)
 98434  	}()), unsafe.Pointer(func() *int8 {
 98435  		if int32(_pTrigger.Xop) == int32(109) {
 98436  			return str(25588)
 98437  		}
 98438  		return str(284)
 98439  	}()), unsafe.Pointer(_pTab.XzName))
 98440  	_sqlite3VdbeChangeP4(tls, _v, int32(-1), _sqlite3MPrintf(tls, _db, str(116281), unsafe.Pointer(_pTrigger.XzName)), int32(-1))
 98441  	if _pTrigger.XpWhen == nil {
 98442  		goto _19
 98443  	}
 98444  	_pWhen = _sqlite3ExprDup(tls, _db, (*XExpr)(_pTrigger.XpWhen), int32(0))
 98445  	if (int32(0) == _sqlite3ResolveExprNames(tls, &_sNC, _pWhen)) && (int32(_db.XmallocFailed) == int32(0)) {
 98446  		_iEndTrigger = _sqlite3VdbeMakeLabel(tls, _v)
 98447  		_sqlite3ExprIfFalse(tls, _pSubParse, _pWhen, _iEndTrigger, int32(16))
 98448  	}
 98449  	_sqlite3ExprDelete(tls, _db, _pWhen)
 98450  _19:
 98451  	_codeTriggerProgram(tls, _pSubParse, (*XTriggerStep)(_pTrigger.Xstep_list), _orconf)
 98452  	if _iEndTrigger != 0 {
 98453  		_sqlite3VdbeResolveLabel(tls, _v, _iEndTrigger)
 98454  	}
 98455  	_sqlite3VdbeAddOp0(tls, _v, int32(55))
 98456  	_sqlite3VdbeComment(tls, _v, str(116295), unsafe.Pointer(_pTrigger.XzName), unsafe.Pointer(_onErrorText(tls, _orconf)))
 98457  	_transferParseError(tls, _pParse, _pSubParse)
 98458  	if int32(_db.XmallocFailed) == int32(0) {
 98459  		*(**XVdbeOp)(unsafe.Pointer(&_pProgram.XaOp)) = _sqlite3VdbeTakeOpArray(tls, _v, &_pProgram.XnOp, &_pTop.XnMaxArg)
 98460  	}
 98461  	_pProgram.XnMem = _pSubParse.XnMem
 98462  	_pProgram.XnCsr = _pSubParse.XnTab
 98463  	_pProgram.Xtoken = unsafe.Pointer(_pTrigger)
 98464  	*elem7((*uint32)(unsafe.Pointer(&_pPrg.XaColmask)), 0) = _pSubParse.Xoldmask
 98465  	*elem7((*uint32)(unsafe.Pointer(&_pPrg.XaColmask)), uintptr(1)) = _pSubParse.Xnewmask
 98466  	_sqlite3VdbeDelete(tls, _v)
 98467  _10:
 98468  	func() {
 98469  		if _pSubParse.XpAinc != nil || _pSubParse.XpZombieTab != nil {
 98470  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123532), unsafe.Pointer(&_codeRowTriggerØ00__func__Ø000), unsafe.Pointer(str(116306)))
 98471  			crt.X__builtin_abort(tls)
 98472  		}
 98473  	}()
 98474  	func() {
 98475  		if _pSubParse.XpTriggerPrg != nil || _pSubParse.XnMaxArg != 0 {
 98476  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123533), unsafe.Pointer(&_codeRowTriggerØ00__func__Ø000), unsafe.Pointer(str(116350)))
 98477  			crt.X__builtin_abort(tls)
 98478  		}
 98479  	}()
 98480  	_sqlite3ParserReset(tls, _pSubParse)
 98481  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pSubParse))
 98482  	return _pPrg
 98483  }
 98484  
 98485  var _codeRowTriggerØ00__func__Ø000 [15]int8
 98486  
 98487  func init() {
 98488  	crt.Xstrncpy(nil, &_codeRowTriggerØ00__func__Ø000[0], str(116397), 15)
 98489  }
 98490  
 98491  // C comment
 98492  //  /*
 98493  //  ** Link the SubProgram object passed as the second argument into the linked
 98494  //  ** list at Vdbe.pSubProgram. This list is used to delete all sub-program
 98495  //  ** objects when the VM is no longer required.
 98496  //  */
 98497  func _sqlite3VdbeLinkSubProgram(tls *crt.TLS, _pVdbe *TVdbe, _p *XSubProgram) {
 98498  	*(**XSubProgram)(unsafe.Pointer(&_p.XpNext)) = (*XSubProgram)(_pVdbe.XpProgram)
 98499  	*(**XSubProgram)(unsafe.Pointer(&_pVdbe.XpProgram)) = _p
 98500  }
 98501  
 98502  // C comment
 98503  //  /*
 98504  //  ** This function is used to add VdbeComment() annotations to a VDBE
 98505  //  ** program. It is not used in production code, only for debugging.
 98506  //  */
 98507  func _onErrorText(tls *crt.TLS, _onError int32) (r0 *int8) {
 98508  	switch _onError {
 98509  	case int32(1):
 98510  		goto _2
 98511  	case int32(2):
 98512  		goto _1
 98513  	case int32(3):
 98514  		goto _3
 98515  	case int32(4):
 98516  		goto _5
 98517  	case int32(5):
 98518  		goto _4
 98519  	case int32(10):
 98520  		goto _6
 98521  	default:
 98522  		goto _7
 98523  	}
 98524  
 98525  _1:
 98526  	return str(47486)
 98527  
 98528  _2:
 98529  	return str(47477)
 98530  
 98531  _3:
 98532  	return str(47492)
 98533  
 98534  _4:
 98535  	return str(7805)
 98536  
 98537  _5:
 98538  	return str(47497)
 98539  
 98540  _6:
 98541  	return str(116412)
 98542  
 98543  _7:
 98544  	return str(116420)
 98545  }
 98546  
 98547  // C comment
 98548  //  /*
 98549  //  ** Generate VDBE code for the statements inside the body of a single
 98550  //  ** trigger.
 98551  //  */
 98552  func _codeTriggerProgram(tls *crt.TLS, _pParse *XParse, _pStepList *XTriggerStep, _orconf int32) (r0 int32) {
 98553  	var _db *Xsqlite3
 98554  	var _v *TVdbe
 98555  	var _6_pSelect *XSelect
 98556  	var _6_sDest XSelectDest
 98557  	var _pStep *XTriggerStep
 98558  	_v = (*TVdbe)(_pParse.XpVdbe)
 98559  	_db = (*Xsqlite3)(_pParse.Xdb)
 98560  	func() {
 98561  		if _pParse.XpTriggerTab == nil || _pParse.XpToplevel == nil {
 98562  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123331), unsafe.Pointer(&_codeTriggerProgramØ00__func__Ø000), unsafe.Pointer(str(116424)))
 98563  			crt.X__builtin_abort(tls)
 98564  		}
 98565  	}()
 98566  	func() {
 98567  		if _pStepList == nil {
 98568  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123332), unsafe.Pointer(&_codeTriggerProgramØ00__func__Ø000), unsafe.Pointer(str(116465)))
 98569  			crt.X__builtin_abort(tls)
 98570  		}
 98571  	}()
 98572  	func() {
 98573  		if _v == nil {
 98574  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123333), unsafe.Pointer(&_codeTriggerProgramØ00__func__Ø000), unsafe.Pointer(str(42019)))
 98575  			crt.X__builtin_abort(tls)
 98576  		}
 98577  	}()
 98578  	_pStep = _pStepList
 98579  _7:
 98580  	if _pStep == nil {
 98581  		goto _10
 98582  	}
 98583  	_pParse.XeOrconf = func() uint8 {
 98584  		if _orconf == int32(10) {
 98585  			return _pStep.Xorconf
 98586  		}
 98587  		return uint8(_orconf)
 98588  	}()
 98589  	func() {
 98590  		if int32(_pParse.XokConstFactor) != int32(0) {
 98591  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123349), unsafe.Pointer(&_codeTriggerProgramØ00__func__Ø000), unsafe.Pointer(str(116475)))
 98592  			crt.X__builtin_abort(tls)
 98593  		}
 98594  	}()
 98595  	switch int32(_pStep.Xop) {
 98596  	case int32(108):
 98597  		goto _17
 98598  	case int32(109):
 98599  		goto _18
 98600  	case int32(110):
 98601  		goto _16
 98602  	default:
 98603  		goto _19
 98604  	}
 98605  
 98606  _16:
 98607  	_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))
 98608  	goto _20
 98609  _17:
 98610  	_sqlite3Insert(tls, _pParse, _targetSrcList(tls, _pParse, _pStep), _sqlite3SelectDup(tls, _db, (*XSelect)(_pStep.XpSelect), int32(0)), _sqlite3IdListDup(tls, _db, (*XIdList)(_pStep.XpIdList)), int32(_pParse.XeOrconf))
 98611  	goto _20
 98612  _18:
 98613  	_sqlite3DeleteFrom(tls, _pParse, _targetSrcList(tls, _pParse, _pStep), _sqlite3ExprDup(tls, _db, (*XExpr)(_pStep.XpWhere), int32(0)))
 98614  	goto _20
 98615  _19:
 98616  	func() {
 98617  		if int32(_pStep.Xop) != int32(119) {
 98618  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123377), unsafe.Pointer(&_codeTriggerProgramØ00__func__Ø000), unsafe.Pointer(str(116500)))
 98619  			crt.X__builtin_abort(tls)
 98620  		}
 98621  	}()
 98622  	_6_pSelect = _sqlite3SelectDup(tls, _db, (*XSelect)(_pStep.XpSelect), int32(0))
 98623  	_sqlite3SelectDestInit(tls, &_6_sDest, int32(4), int32(0))
 98624  	_sqlite3Select(tls, _pParse, _6_pSelect, &_6_sDest)
 98625  	_sqlite3SelectDelete(tls, _db, _6_pSelect)
 98626  	goto _20
 98627  _20:
 98628  	if int32(_pStep.Xop) != int32(119) {
 98629  		_sqlite3VdbeAddOp0(tls, _v, int32(121))
 98630  	}
 98631  	_pStep = (*XTriggerStep)(_pStep.XpNext)
 98632  	goto _7
 98633  _10:
 98634  	return int32(0)
 98635  }
 98636  
 98637  var _codeTriggerProgramØ00__func__Ø000 [19]int8
 98638  
 98639  func init() {
 98640  	crt.Xstrncpy(nil, &_codeTriggerProgramØ00__func__Ø000[0], str(116521), 19)
 98641  }
 98642  
 98643  // C comment
 98644  //  /*
 98645  //  ** Process an UPDATE statement.
 98646  //  **
 98647  //  **   UPDATE OR IGNORE table_wxyz SET a=b, c=d WHERE e<5 AND f NOT NULL;
 98648  //  **          \_______/ \________/     \______/       \________________/
 98649  //  *            onError   pTabList      pChanges             pWhere
 98650  //  */
 98651  func _sqlite3Update(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pChanges *XExprList, _pWhere *XExpr, _onError int32) {
 98652  	var _nPk, _21_iIdxCol int16
 98653  	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
 98654  	var _55_oldmask uint32
 98655  	var _aRegIdx, _aXRef *int32
 98656  	var _chngPk, _chngRowid, _chngKey uint8
 98657  	var _aToOpen *uint8
 98658  	var _db *Xsqlite3
 98659  	var _pTrigger *XTrigger
 98660  	var _pTab *XTable
 98661  	var _v *TVdbe
 98662  	var _aiCurOnePass [2]int32
 98663  	var _pRowidExpr *XExpr
 98664  	var _pIdx, _pPk *XIndex
 98665  	var _sNC XNameContext
 98666  	var _sContext XAuthContext
 98667  	var _pWInfo *XWhereInfo
 98668  	_addrTop = int32(0)
 98669  	_aRegIdx = nil
 98670  	_aXRef = nil
 98671  	_pRowidExpr = nil
 98672  	_iEph = int32(0)
 98673  	_nKey = int32(0)
 98674  	_addrOpen = int32(0)
 98675  	_iPk = int32(0)
 98676  	_nPk = int16(0)
 98677  	_bReplace = int32(0)
 98678  	_regRowCount = int32(0)
 98679  	_regOldRowid = int32(0)
 98680  	_regNewRowid = int32(0)
 98681  	_regNew = int32(0)
 98682  	_regOld = int32(0)
 98683  	_regRowSet = int32(0)
 98684  	_regKey = int32(0)
 98685  	crt.Xmemset(tls, unsafe.Pointer(&_sContext), int32(0), uint32(8))
 98686  	_db = (*Xsqlite3)(_pParse.Xdb)
 98687  	if _pParse.XnErr != 0 || (_db.XmallocFailed != 0) {
 98688  		goto _update_cleanup
 98689  	}
 98690  	func() {
 98691  		if _pTabList.XnSrc != int32(1) {
 98692  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123900), unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000), unsafe.Pointer(str(115053)))
 98693  			crt.X__builtin_abort(tls)
 98694  		}
 98695  	}()
 98696  	_pTab = _sqlite3SrcListLookup(tls, _pParse, _pTabList)
 98697  	if _pTab == nil {
 98698  		goto _update_cleanup
 98699  	}
 98700  	_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), (*XSchema)(_pTab.XpSchema))
 98701  	_pTrigger = _sqlite3TriggersExist(tls, _pParse, _pTab, int32(110), _pChanges, &_tmask)
 98702  	_isView = bool2int((*XSelect)(_pTab.XpSelect) != nil)
 98703  	func() {
 98704  		if _pTrigger == nil && _tmask != int32(0) {
 98705  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123914), unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000), unsafe.Pointer(str(116540)))
 98706  			crt.X__builtin_abort(tls)
 98707  		}
 98708  	}()
 98709  	if _sqlite3ViewGetColumnNames(tls, _pParse, _pTab) != 0 {
 98710  		goto _update_cleanup
 98711  	}
 98712  	if _sqlite3IsReadOnly(tls, _pParse, _pTab, _tmask) != 0 {
 98713  		goto _update_cleanup
 98714  	}
 98715  	elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), 0).XiCursor = store2(&_iBaseCur, store2(&_iDataCur, postInc2(&_pParse.XnTab, 1)))
 98716  	_iIdxCur = _iDataCur + int32(1)
 98717  	_pPk = func() *XIndex {
 98718  		if (_pTab.XtabFlags & uint32(32)) == (0) {
 98719  			return nil
 98720  		}
 98721  		return _sqlite3PrimaryKeyIndex(tls, _pTab)
 98722  	}()
 98723  	*func() **XIndex { _nIdx = int32(0); return &_pIdx }() = (*XIndex)(_pTab.XpIndex)
 98724  _12:
 98725  	if _pIdx == nil {
 98726  		goto _15
 98727  	}
 98728  	if (int32((uint32(_pIdx.XidxType)<<30)>>30) == int32(2)) && (_pPk != nil) {
 98729  		_iDataCur = _pParse.XnTab
 98730  		elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), 0).XiCursor = _iDataCur
 98731  	}
 98732  	_pParse.XnTab += 1
 98733  	*func() *int32 { _pIdx = (*XIndex)(_pIdx.XpNext); return &_nIdx }() += 1
 98734  	goto _12
 98735  _15:
 98736  	_aXRef = (*int32)(_sqlite3DbMallocRawNN(tls, _db, uint64(((uint32(4)*uint32(int32(_pTab.XnCol)+_nIdx))+uint32(_nIdx))+uint32(2))))
 98737  	if _aXRef == nil {
 98738  		goto _update_cleanup
 98739  	}
 98740  	_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)))))))))))
 98741  	_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)))))))))))))
 98742  	crt.Xmemset(tls, unsafe.Pointer(_aToOpen), int32(1), uint32(_nIdx+int32(1)))
 98743  	*elem15(_aToOpen, uintptr(_nIdx+int32(1))) = 0
 98744  	_i = int32(0)
 98745  _19:
 98746  	if _i >= int32(_pTab.XnCol) {
 98747  		goto _22
 98748  	}
 98749  	*elem8(_aXRef, uintptr(_i)) = int32(-1)
 98750  	_i += 1
 98751  	goto _19
 98752  _22:
 98753  	crt.Xmemset(tls, unsafe.Pointer(&_sNC), int32(0), uint32(32))
 98754  	*(**XParse)(unsafe.Pointer(&_sNC.XpParse)) = _pParse
 98755  	*(**XSrcList)(unsafe.Pointer(&_sNC.XpSrcList)) = _pTabList
 98756  	_chngRowid = store3(&_chngPk, 0)
 98757  	_i = int32(0)
 98758  _23:
 98759  	if _i >= _pChanges.XnExpr {
 98760  		goto _26
 98761  	}
 98762  	if _sqlite3ResolveExprNames(tls, &_sNC, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pChanges.Xa)), uintptr(_i)).XpExpr)) != 0 {
 98763  		goto _update_cleanup
 98764  	}
 98765  	_j = int32(0)
 98766  _28:
 98767  	if _j >= int32(_pTab.XnCol) {
 98768  		goto _31
 98769  	}
 98770  	if _sqlite3StrICmp(tls, elem41((*XColumn)(_pTab.XaCol), uintptr(_j)).XzName, elem57((*TExprList_item)(unsafe.Pointer(&_pChanges.Xa)), uintptr(_i)).XzName) != int32(0) {
 98771  		goto _32
 98772  	}
 98773  	if _j == int32(_pTab.XiPKey) {
 98774  		_chngRowid = uint8(1)
 98775  		_pRowidExpr = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pChanges.Xa)), uintptr(_i)).XpExpr)
 98776  		goto _36
 98777  	}
 98778  	if (_pPk != nil) && ((int32(elem41((*XColumn)(_pTab.XaCol), uintptr(_j)).XcolFlags) & int32(1)) != int32(0)) {
 98779  		_chngPk = uint8(1)
 98780  	}
 98781  _36:
 98782  	*elem8(_aXRef, uintptr(_j)) = _i
 98783  	goto _31
 98784  _32:
 98785  	_j += 1
 98786  	goto _28
 98787  _31:
 98788  	if _j < int32(_pTab.XnCol) {
 98789  		goto _37
 98790  	}
 98791  	if (_pPk == nil) && _sqlite3IsRowid(tls, elem57((*TExprList_item)(unsafe.Pointer(&_pChanges.Xa)), uintptr(_i)).XzName) != 0 {
 98792  		_j = int32(-1)
 98793  		_chngRowid = uint8(1)
 98794  		_pRowidExpr = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pChanges.Xa)), uintptr(_i)).XpExpr)
 98795  		goto _40
 98796  	}
 98797  	_sqlite3ErrorMsg(tls, _pParse, str(116561), unsafe.Pointer(elem57((*TExprList_item)(unsafe.Pointer(&_pChanges.Xa)), uintptr(_i)).XzName))
 98798  	_pParse.XcheckSchema = uint8(1)
 98799  	goto _update_cleanup
 98800  _40:
 98801  _37:
 98802  	_15_rc = _sqlite3AuthCheck(tls, _pParse, int32(23), _pTab.XzName, func() *int8 {
 98803  		if _j < int32(0) {
 98804  			return str(96484)
 98805  		}
 98806  		return (elem41((*XColumn)(_pTab.XaCol), uintptr(_j)).XzName)
 98807  	}(), elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName)
 98808  	if _15_rc == int32(1) {
 98809  		goto _update_cleanup
 98810  	}
 98811  	if _15_rc == int32(2) {
 98812  		*elem8(_aXRef, uintptr(_j)) = int32(-1)
 98813  	}
 98814  	_i += 1
 98815  	goto _23
 98816  _26:
 98817  	func() {
 98818  		if (int32(_chngRowid) & int32(_chngPk)) != int32(0) {
 98819  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124012), unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000), unsafe.Pointer(str(116580)))
 98820  			crt.X__builtin_abort(tls)
 98821  		}
 98822  	}()
 98823  	func() {
 98824  		if int32(_chngRowid) != int32(0) && int32(_chngRowid) != int32(1) {
 98825  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124013), unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000), unsafe.Pointer(str(116604)))
 98826  			crt.X__builtin_abort(tls)
 98827  		}
 98828  	}()
 98829  	func() {
 98830  		if int32(_chngPk) != int32(0) && int32(_chngPk) != int32(1) {
 98831  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124014), unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000), unsafe.Pointer(str(116633)))
 98832  			crt.X__builtin_abort(tls)
 98833  		}
 98834  	}()
 98835  	_chngKey = uint8(int32(_chngRowid) + int32(_chngPk))
 98836  	elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), 0).XcolUsed = func() uint64 {
 98837  		if _pTab.XnModuleArg != 0 {
 98838  			return uint64(18446744073709551615)
 98839  		}
 98840  		return (0)
 98841  	}()
 98842  	_hasFK = _sqlite3FkRequired(tls, _pParse, _pTab, _aXRef, int32(_chngKey))
 98843  	*func() **XIndex { _j = int32(0); return &_pIdx }() = (*XIndex)(_pTab.XpIndex)
 98844  _56:
 98845  	if _pIdx == nil {
 98846  		goto _59
 98847  	}
 98848  	if (((_chngKey != 0) || (_hasFK > int32(1))) || (_pIdx.XpPartIdxWhere != nil)) || (_pIdx == _pPk) {
 98849  		_18_reg = preInc2(&_pParse.XnMem, 1)
 98850  		_pParse.XnMem += int32(_pIdx.XnColumn)
 98851  		goto _64
 98852  	}
 98853  	_18_reg = int32(0)
 98854  	_i = int32(0)
 98855  _65:
 98856  	if _i >= int32(_pIdx.XnKeyCol) {
 98857  		goto _68
 98858  	}
 98859  	_21_iIdxCol = *elem50(_pIdx.XaiColumn, uintptr(_i))
 98860  	if int32(_21_iIdxCol) >= int32(0) && (*elem8(_aXRef, uintptr(_21_iIdxCol))) < int32(0) {
 98861  		goto _70
 98862  	}
 98863  	_18_reg = preInc2(&_pParse.XnMem, 1)
 98864  	_pParse.XnMem += int32(_pIdx.XnColumn)
 98865  	if (_onError == int32(5)) || ((_onError == int32(10)) && (int32(_pIdx.XonError) == int32(5))) {
 98866  		_bReplace = int32(1)
 98867  	}
 98868  	goto _68
 98869  _70:
 98870  	_i += 1
 98871  	goto _65
 98872  _68:
 98873  _64:
 98874  	if _18_reg == int32(0) {
 98875  		*elem15(_aToOpen, uintptr(_j+int32(1))) = 0
 98876  	}
 98877  	*elem8(_aRegIdx, uintptr(_j)) = _18_reg
 98878  	*func() *int32 { _pIdx = (*XIndex)(_pIdx.XpNext); return &_j }() += 1
 98879  	goto _56
 98880  _59:
 98881  	if _bReplace != 0 {
 98882  		crt.Xmemset(tls, unsafe.Pointer(_aToOpen), int32(1), uint32(_nIdx+int32(1)))
 98883  	}
 98884  	_v = _sqlite3GetVdbe(tls, _pParse)
 98885  	if _v == nil {
 98886  		goto _update_cleanup
 98887  	}
 98888  	if int32(_pParse.Xnested) == int32(0) {
 98889  		_sqlite3VdbeCountChanges(tls, _v)
 98890  	}
 98891  	_sqlite3BeginWriteOperation(tls, _pParse, int32(1), _iDb)
 98892  	if _pTab.XnModuleArg != 0 {
 98893  		goto _78
 98894  	}
 98895  	_regRowSet = preInc2(&_pParse.XnMem, 1)
 98896  	_regOldRowid = store2(&_regNewRowid, preInc2(&_pParse.XnMem, 1))
 98897  	if ((_chngPk != 0) || (_pTrigger != nil)) || _hasFK != 0 {
 98898  		_regOld = _pParse.XnMem + int32(1)
 98899  		_pParse.XnMem += int32(_pTab.XnCol)
 98900  	}
 98901  	if ((_chngKey != 0) || (_pTrigger != nil)) || _hasFK != 0 {
 98902  		_regNewRowid = preInc2(&_pParse.XnMem, 1)
 98903  	}
 98904  	_regNew = _pParse.XnMem + int32(1)
 98905  	_pParse.XnMem += int32(_pTab.XnCol)
 98906  _78:
 98907  	if _isView != 0 {
 98908  		_sqlite3AuthContextPush(tls, _pParse, &_sContext, _pTab.XzName)
 98909  	}
 98910  	if _isView != 0 {
 98911  		_sqlite3MaterializeView(tls, _pParse, _pTab, _pWhere, _iDataCur)
 98912  	}
 98913  	if _sqlite3ResolveExprNames(tls, &_sNC, _pWhere) != 0 {
 98914  		goto _update_cleanup
 98915  	}
 98916  	if _pTab.XnModuleArg != 0 {
 98917  		_updateVirtualTable(tls, _pParse, _pTabList, _pTab, _pChanges, _pRowidExpr, _aXRef, _pWhere, _onError)
 98918  		goto _update_cleanup
 98919  	}
 98920  	if (_db.Xflags&int32(128)) != 0 && (_pParse.XpTriggerTab == nil) {
 98921  		_regRowCount = preInc2(&_pParse.XnMem, 1)
 98922  		_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _regRowCount)
 98923  	}
 98924  	if (_pTab.XtabFlags & uint32(32)) == (0) {
 98925  		_sqlite3VdbeAddOp3(tls, _v, int32(59), int32(0), _regRowSet, _regOldRowid)
 98926  		goto _92
 98927  	}
 98928  	func() {
 98929  		if _pPk == nil {
 98930  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124122), unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000), unsafe.Pointer(str(41949)))
 98931  			crt.X__builtin_abort(tls)
 98932  		}
 98933  	}()
 98934  	_nPk = int16(_pPk.XnKeyCol)
 98935  	_iPk = _pParse.XnMem + int32(1)
 98936  	_pParse.XnMem += int32(_nPk)
 98937  	_regKey = preInc2(&_pParse.XnMem, 1)
 98938  	_iEph = postInc2(&_pParse.XnTab, 1)
 98939  	_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _iPk)
 98940  	_addrOpen = _sqlite3VdbeAddOp2(tls, _v, int32(110), _iEph, int32(_nPk))
 98941  	_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pPk)
 98942  _92:
 98943  	_flags = int32(4100)
 98944  	if ((((_pParse.Xnested == 0) && (_pTrigger == nil)) && (_hasFK == 0)) && (_chngKey == 0)) && (_bReplace == 0) {
 98945  		_flags |= int32(8)
 98946  	}
 98947  	_pWInfo = _sqlite3WhereBegin(tls, _pParse, _pTabList, _pWhere, nil, nil, uint16(_flags), _iIdxCur)
 98948  	if _pWInfo == nil {
 98949  		goto _update_cleanup
 98950  	}
 98951  	_eOnePass = _sqlite3WhereOkOnePass(tls, _pWInfo, (*int32)(unsafe.Pointer(&_aiCurOnePass)))
 98952  	if _eOnePass != int32(2) {
 98953  		goto _101
 98954  	}
 98955  	_36_iCur = *elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), uintptr(1))
 98956  	if ((_36_iCur >= int32(0)) && (_36_iCur != _iDataCur)) && ((*elem15(_aToOpen, uintptr(_36_iCur-_iBaseCur))) != 0) {
 98957  		_eOnePass = int32(0)
 98958  	}
 98959  	func() {
 98960  		if _36_iCur == _iDataCur && (_pTab.XtabFlags&uint32(32)) == (0) {
 98961  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124164), unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000), unsafe.Pointer(str(116656)))
 98962  			crt.X__builtin_abort(tls)
 98963  		}
 98964  	}()
 98965  _101:
 98966  	if (_pTab.XtabFlags & uint32(32)) != (0) {
 98967  		goto _108
 98968  	}
 98969  	_sqlite3VdbeAddOp2(tls, _v, int32(125), _iDataCur, _regOldRowid)
 98970  	if _eOnePass == int32(0) {
 98971  		_sqlite3VdbeAddOp2(tls, _v, int32(145), _regRowSet, _regOldRowid)
 98972  	}
 98973  	goto _110
 98974  _108:
 98975  	_i = int32(0)
 98976  _111:
 98977  	if _i >= int32(_nPk) {
 98978  		goto _114
 98979  	}
 98980  	func() {
 98981  		if int32(*elem50(_pPk.XaiColumn, uintptr(_i))) < int32(0) {
 98982  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124182), unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000), unsafe.Pointer(str(115293)))
 98983  			crt.X__builtin_abort(tls)
 98984  		}
 98985  	}()
 98986  	_sqlite3ExprCodeGetColumnOfTable(tls, _v, _pTab, _iDataCur, int32(*elem50(_pPk.XaiColumn, uintptr(_i))), _iPk+_i)
 98987  	_i += 1
 98988  	goto _111
 98989  _114:
 98990  	if _eOnePass != 0 {
 98991  		_sqlite3VdbeChangeToNoop(tls, _v, _addrOpen)
 98992  		_nKey = int32(_nPk)
 98993  		_regKey = _iPk
 98994  		goto _118
 98995  	}
 98996  	_sqlite3VdbeAddOp4(tls, _v, int32(101), _iPk, int32(_nPk), _regKey, _sqlite3IndexAffinityStr(tls, _db, _pPk), int32(_nPk))
 98997  	_sqlite3VdbeAddOp4Int(tls, _v, int32(128), _iEph, _regKey, _iPk, int32(_nPk))
 98998  _118:
 98999  _110:
 99000  	if _eOnePass != int32(2) {
 99001  		_sqlite3WhereEnd(tls, _pWInfo)
 99002  	}
 99003  	_labelBreak = _sqlite3VdbeMakeLabel(tls, _v)
 99004  	if _isView != 0 {
 99005  		goto _120
 99006  	}
 99007  	_45_addrOnce = int32(0)
 99008  	if _eOnePass == int32(0) {
 99009  		goto _121
 99010  	}
 99011  	if (*elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), 0)) >= int32(0) {
 99012  		*elem15(_aToOpen, uintptr((*elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), 0))-_iBaseCur)) = 0
 99013  	}
 99014  	if (*elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), uintptr(1))) >= int32(0) {
 99015  		*elem15(_aToOpen, uintptr((*elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), uintptr(1)))-_iBaseCur)) = 0
 99016  	}
 99017  _121:
 99018  	if (_eOnePass == int32(2)) && ((_nIdx - bool2int((*elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), uintptr(1))) >= int32(0))) > int32(0)) {
 99019  		_45_addrOnce = _sqlite3VdbeAddOp0(tls, _v, int32(20))
 99020  	}
 99021  	_sqlite3OpenTableAndIndices(tls, _pParse, _pTab, int32(107), 0, _iBaseCur, _aToOpen, nil, nil)
 99022  	if _45_addrOnce != 0 {
 99023  		_sqlite3VdbeJumpHere(tls, _v, _45_addrOnce)
 99024  	}
 99025  _120:
 99026  	if _eOnePass == int32(0) {
 99027  		goto _127
 99028  	}
 99029  	if ((_isView == 0) && ((*elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), 0)) != _iDataCur)) && ((*elem8((*int32)(unsafe.Pointer(&_aiCurOnePass)), uintptr(1))) != _iDataCur) {
 99030  		func() {
 99031  			if _pPk == nil {
 99032  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124221), unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000), unsafe.Pointer(str(116690)))
 99033  				crt.X__builtin_abort(tls)
 99034  			}
 99035  		}()
 99036  		_sqlite3VdbeAddOp4Int(tls, _v, int32(29), _iDataCur, _labelBreak, _regKey, _nKey)
 99037  	}
 99038  	if _eOnePass == int32(1) {
 99039  		_labelContinue = _labelBreak
 99040  		goto _134
 99041  	}
 99042  	_labelContinue = _sqlite3VdbeMakeLabel(tls, _v)
 99043  _134:
 99044  	_sqlite3VdbeAddOp2(tls, _v, int32(75), func() int32 {
 99045  		if _pPk != nil {
 99046  			return _regKey
 99047  		}
 99048  		return _regOldRowid
 99049  	}(), _labelBreak)
 99050  	goto _139
 99051  _127:
 99052  	if _pPk != nil {
 99053  		_labelContinue = _sqlite3VdbeMakeLabel(tls, _v)
 99054  		_sqlite3VdbeAddOp2(tls, _v, int32(37), _iEph, _labelBreak)
 99055  		_addrTop = _sqlite3VdbeAddOp2(tls, _v, int32(124), _iEph, _regKey)
 99056  		_sqlite3VdbeAddOp4Int(tls, _v, int32(29), _iDataCur, _labelContinue, _regKey, int32(0))
 99057  		goto _139
 99058  	}
 99059  	_labelContinue = _sqlite3VdbeAddOp3(tls, _v, int32(42), _regRowSet, _labelBreak, _regOldRowid)
 99060  	_sqlite3VdbeAddOp3(tls, _v, int32(32), _iDataCur, _labelContinue, _regOldRowid)
 99061  _139:
 99062  	func() {
 99063  		if _chngKey == 0 && _pTrigger == nil && _hasFK == 0 && _regOldRowid != _regNewRowid {
 99064  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124251), unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000), unsafe.Pointer(str(116694)))
 99065  			crt.X__builtin_abort(tls)
 99066  		}
 99067  	}()
 99068  	if _chngRowid != 0 {
 99069  		_sqlite3ExprCode(tls, _pParse, _pRowidExpr, _regNewRowid)
 99070  		_sqlite3VdbeAddOp1(tls, _v, int32(17), _regNewRowid)
 99071  	}
 99072  	if _chngPk == 0 && _hasFK == 0 && _pTrigger == nil {
 99073  		goto _148
 99074  	}
 99075  	_55_oldmask = func() uint32 {
 99076  		if _hasFK != 0 {
 99077  			return _sqlite3FkOldmask(tls, _pParse, _pTab)
 99078  		}
 99079  		return (0)
 99080  	}()
 99081  	_55_oldmask |= _sqlite3TriggerColmask(tls, _pParse, _pTrigger, _pChanges, int32(0), int32(3), _pTab, _onError)
 99082  	_i = int32(0)
 99083  _151:
 99084  	if _i >= int32(_pTab.XnCol) {
 99085  		goto _154
 99086  	}
 99087  	if ((_55_oldmask == uint32(4294967295)) || ((_i < int32(32)) && ((_55_oldmask & (uint32(1) << uint(_i))) != (0)))) || ((int32(elem41((*XColumn)(_pTab.XaCol), uintptr(_i)).XcolFlags) & int32(1)) != int32(0)) {
 99088  		_sqlite3ExprCodeGetColumnOfTable(tls, _v, _pTab, _iDataCur, _i, _regOld+_i)
 99089  		goto _159
 99090  	}
 99091  	_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _regOld+_i)
 99092  _159:
 99093  	_i += 1
 99094  	goto _151
 99095  _154:
 99096  	if (int32(_chngRowid) == int32(0)) && (_pPk == nil) {
 99097  		_sqlite3VdbeAddOp2(tls, _v, int32(64), _regOldRowid, _regNewRowid)
 99098  	}
 99099  _148:
 99100  	_newmask = int32(_sqlite3TriggerColmask(tls, _pParse, _pTrigger, _pChanges, int32(1), int32(1), _pTab, _onError))
 99101  	_i = int32(0)
 99102  _162:
 99103  	if _i >= int32(_pTab.XnCol) {
 99104  		goto _165
 99105  	}
 99106  	if _i == int32(_pTab.XiPKey) {
 99107  		_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _regNew+_i)
 99108  		goto _167
 99109  	}
 99110  	_j = *elem8(_aXRef, uintptr(_i))
 99111  	if _j >= int32(0) {
 99112  		_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pChanges.Xa)), uintptr(_j)).XpExpr), _regNew+_i)
 99113  		goto _173
 99114  	}
 99115  	if ((int32(0) == (_tmask & int32(1))) || (_i > int32(31))) || ((uint32(_newmask) & (uint32(1) << uint(_i))) != 0) {
 99116  		_sqlite3ExprCodeGetColumnToReg(tls, _pParse, _pTab, _i, _iDataCur, _regNew+_i)
 99117  		goto _173
 99118  	}
 99119  	_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _regNew+_i)
 99120  _173:
 99121  _167:
 99122  	_i += 1
 99123  	goto _162
 99124  _165:
 99125  	if (_tmask & int32(1)) == 0 {
 99126  		goto _174
 99127  	}
 99128  	_sqlite3TableAffinity(tls, _v, _pTab, _regNew)
 99129  	_sqlite3CodeRowTrigger(tls, _pParse, _pTrigger, int32(110), _pChanges, int32(1), _pTab, _regOldRowid, _onError, _labelContinue)
 99130  	if _pPk != nil {
 99131  		_sqlite3VdbeAddOp4Int(tls, _v, int32(29), _iDataCur, _labelContinue, _regKey, _nKey)
 99132  		goto _176
 99133  	}
 99134  	_sqlite3VdbeAddOp3(tls, _v, int32(32), _iDataCur, _labelContinue, _regOldRowid)
 99135  _176:
 99136  	_i = int32(0)
 99137  _177:
 99138  	if _i >= int32(_pTab.XnCol) {
 99139  		goto _180
 99140  	}
 99141  	if ((*elem8(_aXRef, uintptr(_i))) < int32(0)) && (_i != int32(_pTab.XiPKey)) {
 99142  		_sqlite3ExprCodeGetColumnOfTable(tls, _v, _pTab, _iDataCur, _i, _regNew+_i)
 99143  	}
 99144  	_i += 1
 99145  	goto _177
 99146  _180:
 99147  _174:
 99148  	if _isView != 0 {
 99149  		goto _183
 99150  	}
 99151  	_71_addr1 = int32(0)
 99152  	func() {
 99153  		if _regOldRowid <= int32(0) {
 99154  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124356), unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000), unsafe.Pointer(str(116751)))
 99155  			crt.X__builtin_abort(tls)
 99156  		}
 99157  	}()
 99158  	_sqlite3GenerateConstraintChecks(tls, _pParse, _pTab, _aRegIdx, _iDataCur, _iIdxCur, _regNewRowid, _regOldRowid, _chngKey, uint8(_onError), _labelContinue, &_bReplace, _aXRef)
 99159  	if _hasFK != 0 {
 99160  		_sqlite3FkCheck(tls, _pParse, _pTab, _regOldRowid, int32(0), _aXRef, int32(_chngKey))
 99161  	}
 99162  	if _bReplace == 0 && _chngKey == 0 {
 99163  		goto _188
 99164  	}
 99165  	if _pPk != nil {
 99166  		_71_addr1 = _sqlite3VdbeAddOp4Int(tls, _v, int32(29), _iDataCur, int32(0), _regKey, _nKey)
 99167  		goto _190
 99168  	}
 99169  	_71_addr1 = _sqlite3VdbeAddOp3(tls, _v, int32(32), _iDataCur, int32(0), _regOldRowid)
 99170  _190:
 99171  _188:
 99172  	_sqlite3GenerateRowIndexDelete(tls, _pParse, _pTab, _iDataCur, _iIdxCur, _aRegIdx, int32(-1))
 99173  	func() {
 99174  		if _regNew != (_regNewRowid + int32(1)) {
 99175  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124386), unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000), unsafe.Pointer(str(116765)))
 99176  			crt.X__builtin_abort(tls)
 99177  		}
 99178  	}()
 99179  	if (_hasFK > int32(1)) || (_chngKey != 0) {
 99180  		_sqlite3VdbeAddOp2(tls, _v, int32(120), _iDataCur, int32(0))
 99181  	}
 99182  	if _bReplace != 0 || (_chngKey != 0) {
 99183  		_sqlite3VdbeJumpHere(tls, _v, _71_addr1)
 99184  	}
 99185  	if _hasFK != 0 {
 99186  		_sqlite3FkCheck(tls, _pParse, _pTab, int32(0), _regNewRowid, _aXRef, int32(_chngKey))
 99187  	}
 99188  	_sqlite3CompleteInsertion(tls, _pParse, _pTab, _iDataCur, _iIdxCur, _regNewRowid, _aRegIdx, int32(4)|func() int32 {
 99189  		if _eOnePass == int32(2) {
 99190  			return int32(2)
 99191  		}
 99192  		return int32(0)
 99193  	}(), int32(0), int32(0))
 99194  	if _hasFK != 0 {
 99195  		_sqlite3FkActions(tls, _pParse, _pTab, _pChanges, _regOldRowid, _aXRef, int32(_chngKey))
 99196  	}
 99197  _183:
 99198  	if (_db.Xflags&int32(128)) != 0 && (_pParse.XpTriggerTab == nil) {
 99199  		_sqlite3VdbeAddOp2(tls, _v, int32(73), _regRowCount, int32(1))
 99200  	}
 99201  	_sqlite3CodeRowTrigger(tls, _pParse, _pTrigger, int32(110), _pChanges, int32(2), _pTab, _regOldRowid, _onError, _labelContinue)
 99202  	if _eOnePass == int32(1) {
 99203  		goto _208
 99204  	}
 99205  	if _eOnePass == int32(2) {
 99206  		_sqlite3VdbeResolveLabel(tls, _v, _labelContinue)
 99207  		_sqlite3WhereEnd(tls, _pWInfo)
 99208  		goto _208
 99209  	}
 99210  	if _pPk != nil {
 99211  		_sqlite3VdbeResolveLabel(tls, _v, _labelContinue)
 99212  		_sqlite3VdbeAddOp2(tls, _v, int32(7), _iEph, _addrTop)
 99213  		goto _208
 99214  	}
 99215  	_sqlite3VdbeGoto(tls, _v, _labelContinue)
 99216  _208:
 99217  	_sqlite3VdbeResolveLabel(tls, _v, _labelBreak)
 99218  	if (int32(_pParse.Xnested) == int32(0)) && ((*XTable)(_pParse.XpTriggerTab) == nil) {
 99219  		_sqlite3AutoincrementEnd(tls, _pParse)
 99220  	}
 99221  	if ((_db.Xflags&int32(128)) != 0 && (_pParse.XpTriggerTab == nil)) && (_pParse.Xnested == 0) {
 99222  		_sqlite3VdbeAddOp2(tls, _v, int32(67), _regRowCount, int32(1))
 99223  		_sqlite3VdbeSetNumCols(tls, _v, int32(1))
 99224  		_sqlite3VdbeSetColName(tls, _v, int32(0), int32(0), str(116787), nil)
 99225  	}
 99226  _update_cleanup:
 99227  	_sqlite3AuthContextPop(tls, &_sContext)
 99228  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_aXRef))
 99229  	_sqlite3SrcListDelete(tls, _db, _pTabList)
 99230  	_sqlite3ExprListDelete(tls, _db, _pChanges)
 99231  	_sqlite3ExprDelete(tls, _db, _pWhere)
 99232  	_ = _aiCurOnePass
 99233  }
 99234  
 99235  var _sqlite3UpdateØ00__func__Ø000 [14]int8
 99236  
 99237  func init() {
 99238  	crt.Xstrncpy(nil, &_sqlite3UpdateØ00__func__Ø000[0], str(116800), 14)
 99239  }
 99240  
 99241  // C comment
 99242  //  /*
 99243  //  ** Generate code for an UPDATE of a virtual table.
 99244  //  **
 99245  //  ** There are two possible strategies - the default and the special
 99246  //  ** "onepass" strategy. Onepass is only used if the virtual table
 99247  //  ** implementation indicates that pWhere may match at most one row.
 99248  //  **
 99249  //  ** The default strategy is to create an ephemeral table that contains
 99250  //  ** for each row to be changed:
 99251  //  **
 99252  //  **   (A)  The original rowid of that row.
 99253  //  **   (B)  The revised rowid for the row.
 99254  //  **   (C)  The content of every column in the row.
 99255  //  **
 99256  //  ** Then loop through the contents of this ephemeral table executing a
 99257  //  ** VUpdate for each row. When finished, drop the ephemeral table.
 99258  //  **
 99259  //  ** The "onepass" strategy does not use an ephemeral table. Instead, it
 99260  //  ** stores the same values (A, B and C above) in a register array and
 99261  //  ** makes a single invocation of VUpdate.
 99262  //  */
 99263  func _updateVirtualTable(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _pTab *XTable, _pChanges *XExprList, _pRowid *XExpr, _aXRef *int32, _pWhere *XExpr, _onError int32) {
 99264  	var _ephemTab, _i, _nArg, _regArg, _regRec, _regRowid, _iCsr, _bOnePass, _addr int32
 99265  	var _pVTab *int8
 99266  	var _db *Xsqlite3
 99267  	var _v *TVdbe
 99268  	var _aDummy [2]int32
 99269  	var _pWInfo *XWhereInfo
 99270  	_v = (*TVdbe)(_pParse.XpVdbe)
 99271  	_db = (*Xsqlite3)(_pParse.Xdb)
 99272  	_pVTab = (*int8)(unsafe.Pointer(_sqlite3GetVTable(tls, _db, _pTab)))
 99273  	_nArg = int32(2) + int32(_pTab.XnCol)
 99274  	_iCsr = elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), 0).XiCursor
 99275  	func() {
 99276  		if _v == nil {
 99277  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(124539), unsafe.Pointer(&_updateVirtualTableØ00__func__Ø000), unsafe.Pointer(str(41816)))
 99278  			crt.X__builtin_abort(tls)
 99279  		}
 99280  	}()
 99281  	_ephemTab = postInc2(&_pParse.XnTab, 1)
 99282  	_addr = _sqlite3VdbeAddOp2(tls, _v, int32(110), _ephemTab, _nArg)
 99283  	_regArg = _pParse.XnMem + int32(1)
 99284  	_pParse.XnMem += _nArg
 99285  	_regRec = preInc2(&_pParse.XnMem, 1)
 99286  	_regRowid = preInc2(&_pParse.XnMem, 1)
 99287  	_pWInfo = _sqlite3WhereBegin(tls, _pParse, _pSrc, _pWhere, nil, nil, uint16(4), int32(0))
 99288  	if _pWInfo == nil {
 99289  		return
 99290  	}
 99291  	_sqlite3VdbeAddOp2(tls, _v, int32(125), _iCsr, _regArg)
 99292  	if _pRowid != nil {
 99293  		_sqlite3ExprCode(tls, _pParse, _pRowid, _regArg+int32(1))
 99294  		goto _4
 99295  	}
 99296  	_sqlite3VdbeAddOp2(tls, _v, int32(125), _iCsr, _regArg+int32(1))
 99297  _4:
 99298  	_i = int32(0)
 99299  _5:
 99300  	if _i >= int32(_pTab.XnCol) {
 99301  		goto _8
 99302  	}
 99303  	if (*elem8(_aXRef, uintptr(_i))) >= int32(0) {
 99304  		_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pChanges.Xa)), uintptr(*elem8(_aXRef, uintptr(_i)))).XpExpr), (_regArg+int32(2))+_i)
 99305  		goto _10
 99306  	}
 99307  	_sqlite3VdbeAddOp3(tls, _v, int32(159), _iCsr, _i, (_regArg+int32(2))+_i)
 99308  _10:
 99309  	_i += 1
 99310  	goto _5
 99311  _8:
 99312  	_bOnePass = _sqlite3WhereOkOnePass(tls, _pWInfo, (*int32)(unsafe.Pointer(&_aDummy)))
 99313  	if _bOnePass == 0 {
 99314  		goto _11
 99315  	}
 99316  	_sqlite3VdbeChangeToNoop(tls, _v, _addr)
 99317  	if (*XParse)(_pParse.XpToplevel) == nil {
 99318  		_pParse.XisMultiWrite = 0
 99319  	}
 99320  	goto _13
 99321  _11:
 99322  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _regArg, _nArg, _regRec)
 99323  	_sqlite3VdbeAddOp2(tls, _v, int32(117), _ephemTab, _regRowid)
 99324  	_sqlite3VdbeAddOp3(tls, _v, int32(118), _ephemTab, _regRec, _regRowid)
 99325  _13:
 99326  	if _bOnePass != int32(0) {
 99327  		goto _14
 99328  	}
 99329  	_sqlite3WhereEnd(tls, _pWInfo)
 99330  	_addr = _sqlite3VdbeAddOp1(tls, _v, int32(37), _ephemTab)
 99331  	_i = int32(0)
 99332  _15:
 99333  	if _i >= _nArg {
 99334  		goto _18
 99335  	}
 99336  	_sqlite3VdbeAddOp3(tls, _v, int32(99), _ephemTab, _i, _regArg+_i)
 99337  	_i += 1
 99338  	goto _15
 99339  _18:
 99340  _14:
 99341  	_sqlite3VtabMakeWritable(tls, _pParse, _pTab)
 99342  	_sqlite3VdbeAddOp4(tls, _v, int32(12), int32(0), _nArg, _regArg, _pVTab, int32(-8))
 99343  	_sqlite3VdbeChangeP5(tls, _v, uint16(func() int32 {
 99344  		if _onError == int32(10) {
 99345  			return int32(2)
 99346  		}
 99347  		return _onError
 99348  	}()))
 99349  	_sqlite3MayAbort(tls, _pParse)
 99350  	if _bOnePass == int32(0) {
 99351  		_sqlite3VdbeAddOp2(tls, _v, int32(7), _ephemTab, _addr+int32(1))
 99352  		_sqlite3VdbeJumpHere(tls, _v, _addr)
 99353  		_sqlite3VdbeAddOp2(tls, _v, int32(114), _ephemTab, int32(0))
 99354  		goto _22
 99355  	}
 99356  	_sqlite3WhereEnd(tls, _pWInfo)
 99357  _22:
 99358  	_ = _aDummy
 99359  }
 99360  
 99361  var _updateVirtualTableØ00__func__Ø000 [19]int8
 99362  
 99363  func init() {
 99364  	crt.Xstrncpy(nil, &_updateVirtualTableØ00__func__Ø000[0], str(116814), 19)
 99365  }
 99366  
 99367  // C comment
 99368  //  /*
 99369  //  ** This function is called before generating code to update or delete a
 99370  //  ** row contained in table pTab.
 99371  //  */
 99372  func _sqlite3FkOldmask(tls *crt.TLS, _pParse *XParse, _pTab *XTable) (r0 uint32) {
 99373  	var _1_i int32
 99374  	var _mask uint32
 99375  	var _3_pIdx *XIndex
 99376  	var _1_p *XFKey
 99377  	_mask = uint32(0)
 99378  	if (((*Xsqlite3)(_pParse.Xdb).Xflags) & int32(524288)) == 0 {
 99379  		goto _0
 99380  	}
 99381  	_1_p = (*XFKey)(_pTab.XpFKey)
 99382  _1:
 99383  	if _1_p == nil {
 99384  		goto _4
 99385  	}
 99386  	_1_i = int32(0)
 99387  _5:
 99388  	if _1_i >= _1_p.XnCol {
 99389  		goto _8
 99390  	}
 99391  	_mask |= func() uint32 {
 99392  		if (elem116((*t117)(unsafe.Pointer(&_1_p.XaCol)), uintptr(_1_i)).XiFrom) > int32(31) {
 99393  			return uint32(4294967295)
 99394  		}
 99395  		return (uint32(1) << uint(elem116((*t117)(unsafe.Pointer(&_1_p.XaCol)), uintptr(_1_i)).XiFrom))
 99396  	}()
 99397  	_1_i += 1
 99398  	goto _5
 99399  _8:
 99400  	_1_p = (*XFKey)(_1_p.XpNextFrom)
 99401  	goto _1
 99402  _4:
 99403  	_1_p = _sqlite3FkReferences(tls, _pTab)
 99404  _11:
 99405  	if _1_p == nil {
 99406  		goto _14
 99407  	}
 99408  	_3_pIdx = nil
 99409  	_sqlite3FkLocateIndex(tls, _pParse, _pTab, _1_p, &_3_pIdx, nil)
 99410  	if _3_pIdx == nil {
 99411  		goto _15
 99412  	}
 99413  	_1_i = int32(0)
 99414  _16:
 99415  	if _1_i >= int32(_3_pIdx.XnKeyCol) {
 99416  		goto _19
 99417  	}
 99418  	func() {
 99419  		if int32(*elem50(_3_pIdx.XaiColumn, uintptr(_1_i))) < int32(0) {
 99420  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108482), unsafe.Pointer(&_sqlite3FkOldmaskØ00__func__Ø000), unsafe.Pointer(str(116833)))
 99421  			crt.X__builtin_abort(tls)
 99422  		}
 99423  	}()
 99424  	_mask |= func() uint32 {
 99425  		if int32(*elem50(_3_pIdx.XaiColumn, uintptr(_1_i))) > int32(31) {
 99426  			return uint32(4294967295)
 99427  		}
 99428  		return (uint32(1) << uint(int32(*elem50(_3_pIdx.XaiColumn, uintptr(_1_i)))))
 99429  	}()
 99430  	_1_i += 1
 99431  	goto _16
 99432  _19:
 99433  _15:
 99434  	_1_p = (*XFKey)(_1_p.XpNextTo)
 99435  	goto _11
 99436  _14:
 99437  _0:
 99438  	return _mask
 99439  }
 99440  
 99441  // C comment
 99442  //  /*
 99443  //  ** A foreign key constraint requires that the key columns in the parent
 99444  //  ** table are collectively subject to a UNIQUE or PRIMARY KEY constraint.
 99445  //  ** Given that pParent is the parent table for foreign key constraint pFKey,
 99446  //  ** search the schema for a unique index on the parent key columns.
 99447  //  **
 99448  //  ** If successful, zero is returned. If the parent key is an INTEGER PRIMARY
 99449  //  ** KEY column, then output variable *ppIdx is set to NULL. Otherwise, *ppIdx
 99450  //  ** is set to point to the unique index.
 99451  //  **
 99452  //  ** If the parent key consists of a single column (the foreign key constraint
 99453  //  ** is not a composite foreign key), output variable *paiCol is set to NULL.
 99454  //  ** Otherwise, it is set to point to an allocated array of size N, where
 99455  //  ** N is the number of columns in the parent key. The first element of the
 99456  //  ** array is the index of the child table column that is mapped by the FK
 99457  //  ** constraint to the parent table column stored in the left-most column
 99458  //  ** of index *ppIdx. The second element of the array is the index of the
 99459  //  ** child table column that corresponds to the second left-most column of
 99460  //  ** *ppIdx, and so on.
 99461  //  **
 99462  //  ** If the required index cannot be found, either because:
 99463  //  **
 99464  //  **   1) The named parent key columns do not exist, or
 99465  //  **
 99466  //  **   2) The named parent key columns do exist, but are not subject to a
 99467  //  **      UNIQUE or PRIMARY KEY constraint, or
 99468  //  **
 99469  //  **   3) No parent key columns were provided explicitly as part of the
 99470  //  **      foreign key definition, and the parent table does not have a
 99471  //  **      PRIMARY KEY, or
 99472  //  **
 99473  //  **   4) No parent key columns were provided explicitly as part of the
 99474  //  **      foreign key definition, and the PRIMARY KEY of the parent table
 99475  //  **      consists of a different number of columns to the child key in
 99476  //  **      the child table.
 99477  //  **
 99478  //  ** then non-zero is returned, and a "foreign key mismatch" error loaded
 99479  //  ** into pParse. If an OOM error occurs, non-zero is returned and the
 99480  //  ** pParse->db->mallocFailed flag is set.
 99481  //  */
 99482  func _sqlite3FkLocateIndex(tls *crt.TLS, _pParse *XParse, _pParent *XTable, _pFKey *XFKey, _ppIdx **XIndex, _paiCol **int32) (r0 int32) {
 99483  	var _10_iCol int16
 99484  	var _nCol, _8_i, _9_i, _9_j int32
 99485  	var _aiCol *int32
 99486  	var _zKey, _10_zDfltColl, _10_zIdxCol *int8
 99487  	var _pIdx *XIndex
 99488  	_pIdx = nil
 99489  	_aiCol = nil
 99490  	_nCol = _pFKey.XnCol
 99491  	_zKey = elem116((*t117)(unsafe.Pointer(&_pFKey.XaCol)), 0).XzCol
 99492  	func() {
 99493  		if _ppIdx == nil || (*_ppIdx) != nil {
 99494  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107609), unsafe.Pointer(&_sqlite3FkLocateIndexØ00__func__Ø000), unsafe.Pointer(str(116854)))
 99495  			crt.X__builtin_abort(tls)
 99496  		}
 99497  	}()
 99498  	func() {
 99499  		if _paiCol != nil && (*_paiCol) != nil {
 99500  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107610), unsafe.Pointer(&_sqlite3FkLocateIndexØ00__func__Ø000), unsafe.Pointer(str(116873)))
 99501  			crt.X__builtin_abort(tls)
 99502  		}
 99503  	}()
 99504  	func() {
 99505  		if _pParse == nil {
 99506  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107611), unsafe.Pointer(&_sqlite3FkLocateIndexØ00__func__Ø000), unsafe.Pointer(str(115744)))
 99507  			crt.X__builtin_abort(tls)
 99508  		}
 99509  	}()
 99510  	if _nCol != int32(1) {
 99511  		goto _8
 99512  	}
 99513  	if int32(_pParent.XiPKey) < int32(0) {
 99514  		goto _9
 99515  	}
 99516  	if _zKey == nil {
 99517  		return int32(0)
 99518  	}
 99519  	if _sqlite3StrICmp(tls, elem41((*XColumn)(_pParent.XaCol), uintptr(_pParent.XiPKey)).XzName, _zKey) == 0 {
 99520  		return int32(0)
 99521  	}
 99522  _9:
 99523  	goto _13
 99524  _8:
 99525  	if _paiCol == nil {
 99526  		goto _13
 99527  	}
 99528  	func() {
 99529  		if _nCol <= int32(1) {
 99530  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107634), unsafe.Pointer(&_sqlite3FkLocateIndexØ00__func__Ø000), unsafe.Pointer(str(116895)))
 99531  			crt.X__builtin_abort(tls)
 99532  		}
 99533  	}()
 99534  	_aiCol = (*int32)(_sqlite3DbMallocRawNN(tls, (*Xsqlite3)(_pParse.Xdb), uint64(uint32(_nCol)*uint32(4))))
 99535  	if _aiCol == nil {
 99536  		return int32(1)
 99537  	}
 99538  	*_paiCol = _aiCol
 99539  _13:
 99540  	_pIdx = (*XIndex)(_pParent.XpIndex)
 99541  _17:
 99542  	if _pIdx == nil {
 99543  		goto _20
 99544  	}
 99545  	if int32(_pIdx.XnKeyCol) != _nCol || int32(_pIdx.XonError) == int32(0) || (*XExpr)(_pIdx.XpPartIdxWhere) != nil {
 99546  		goto _23
 99547  	}
 99548  	if _zKey != nil {
 99549  		goto _24
 99550  	}
 99551  	if int32((uint32(_pIdx.XidxType)<<30)>>30) != int32(2) {
 99552  		goto _25
 99553  	}
 99554  	if _aiCol == nil {
 99555  		goto _26
 99556  	}
 99557  	_8_i = int32(0)
 99558  _27:
 99559  	if _8_i >= _nCol {
 99560  		goto _30
 99561  	}
 99562  	*elem8(_aiCol, uintptr(_8_i)) = elem116((*t117)(unsafe.Pointer(&_pFKey.XaCol)), uintptr(_8_i)).XiFrom
 99563  	_8_i += 1
 99564  	goto _27
 99565  _30:
 99566  _26:
 99567  	goto _20
 99568  _25:
 99569  	goto _31
 99570  _24:
 99571  	_9_i = int32(0)
 99572  _32:
 99573  	if _9_i >= _nCol {
 99574  		goto _35
 99575  	}
 99576  	_10_iCol = *elem50(_pIdx.XaiColumn, uintptr(_9_i))
 99577  	if int32(_10_iCol) < int32(0) {
 99578  		goto _35
 99579  	}
 99580  	_10_zDfltColl = elem41((*XColumn)(_pParent.XaCol), uintptr(_10_iCol)).XzColl
 99581  	if _10_zDfltColl == nil {
 99582  		_10_zDfltColl = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
 99583  	}
 99584  	if _sqlite3StrICmp(tls, *elem0(_pIdx.XazColl, uintptr(_9_i)), _10_zDfltColl) != 0 {
 99585  		goto _35
 99586  	}
 99587  	_10_zIdxCol = elem41((*XColumn)(_pParent.XaCol), uintptr(_10_iCol)).XzName
 99588  	_9_j = int32(0)
 99589  _39:
 99590  	if _9_j >= _nCol {
 99591  		goto _42
 99592  	}
 99593  	if _sqlite3StrICmp(tls, elem116((*t117)(unsafe.Pointer(&_pFKey.XaCol)), uintptr(_9_j)).XzCol, _10_zIdxCol) != int32(0) {
 99594  		goto _43
 99595  	}
 99596  	if _aiCol != nil {
 99597  		*elem8(_aiCol, uintptr(_9_i)) = elem116((*t117)(unsafe.Pointer(&_pFKey.XaCol)), uintptr(_9_j)).XiFrom
 99598  	}
 99599  	goto _42
 99600  _43:
 99601  	_9_j += 1
 99602  	goto _39
 99603  _42:
 99604  	if _9_j == _nCol {
 99605  		goto _35
 99606  	}
 99607  	_9_i += 1
 99608  	goto _32
 99609  _35:
 99610  	if _9_i == _nCol {
 99611  		goto _20
 99612  	}
 99613  _31:
 99614  _23:
 99615  	_pIdx = (*XIndex)(_pIdx.XpNext)
 99616  	goto _17
 99617  _20:
 99618  	if _pIdx != nil {
 99619  		goto _47
 99620  	}
 99621  	if _pParse.XdisableTriggers == 0 {
 99622  		_sqlite3ErrorMsg(tls, _pParse, str(116902), unsafe.Pointer((*XTable)(_pFKey.XpFrom).XzName), unsafe.Pointer(_pFKey.XzTo))
 99623  	}
 99624  	_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.Xdb), unsafe.Pointer(_aiCol))
 99625  	return int32(1)
 99626  
 99627  _47:
 99628  	*_ppIdx = _pIdx
 99629  	return int32(0)
 99630  }
 99631  
 99632  var _sqlite3FkLocateIndexØ00__func__Ø000 [21]int8
 99633  
 99634  func init() {
 99635  	crt.Xstrncpy(nil, &_sqlite3FkLocateIndexØ00__func__Ø000[0], str(116947), 21)
 99636  }
 99637  
 99638  var _sqlite3FkOldmaskØ00__func__Ø000 [17]int8
 99639  
 99640  func init() {
 99641  	crt.Xstrncpy(nil, &_sqlite3FkOldmaskØ00__func__Ø000[0], str(116968), 17)
 99642  }
 99643  
 99644  // C comment
 99645  //  /*
 99646  //  ** This is called to code the required FOR EACH ROW triggers for an operation
 99647  //  ** on table pTab. The operation to code triggers for (INSERT, UPDATE or DELETE)
 99648  //  ** is given by the op parameter. The tr_tm parameter determines whether the
 99649  //  ** BEFORE or AFTER triggers are coded. If the operation is an UPDATE, then
 99650  //  ** parameter pChanges is passed the list of columns being modified.
 99651  //  **
 99652  //  ** If there are no triggers that fire at the specified time for the specified
 99653  //  ** operation on pTab, this function is a no-op.
 99654  //  **
 99655  //  ** The reg argument is the address of the first in an array of registers
 99656  //  ** that contain the values substituted for the new.* and old.* references
 99657  //  ** in the trigger program. If N is the number of columns in table pTab
 99658  //  ** (a copy of pTab->nCol), then registers are populated as follows:
 99659  //  **
 99660  //  **   Register       Contains
 99661  //  **   ------------------------------------------------------
 99662  //  **   reg+0          OLD.rowid
 99663  //  **   reg+1          OLD.* value of left-most column of pTab
 99664  //  **   ...            ...
 99665  //  **   reg+N          OLD.* value of right-most column of pTab
 99666  //  **   reg+N+1        NEW.rowid
 99667  //  **   reg+N+2        OLD.* value of left-most column of pTab
 99668  //  **   ...            ...
 99669  //  **   reg+N+N+1      NEW.* value of right-most column of pTab
 99670  //  **
 99671  //  ** For ON DELETE triggers, the registers containing the NEW.* values will
 99672  //  ** never be accessed by the trigger program, so they are not allocated or
 99673  //  ** populated by the caller (there is no data to populate them with anyway).
 99674  //  ** Similarly, for ON INSERT triggers the values stored in the OLD.* registers
 99675  //  ** are never accessed, and so are not allocated by the caller. So, for an
 99676  //  ** ON INSERT trigger, the value passed to this function as parameter reg
 99677  //  ** is not a readable register, although registers (reg+N) through
 99678  //  ** (reg+N+N+1) are.
 99679  //  **
 99680  //  ** Parameter orconf is the default conflict resolution algorithm for the
 99681  //  ** trigger program to use (REPLACE, IGNORE etc.). Parameter ignoreJump
 99682  //  ** is the instruction that control should jump to if a trigger program
 99683  //  ** raises an IGNORE exception.
 99684  //  */
 99685  func _sqlite3CodeRowTrigger(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger, _op int32, _pChanges *XExprList, _tr_tm int32, _pTab *XTable, _reg int32, _orconf int32, _ignoreJump int32) {
 99686  	var _p *XTrigger
 99687  	func() {
 99688  		if _op != int32(110) && _op != int32(108) && _op != int32(109) {
 99689  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123665), unsafe.Pointer(&_sqlite3CodeRowTriggerØ00__func__Ø000), unsafe.Pointer(str(116985)))
 99690  			crt.X__builtin_abort(tls)
 99691  		}
 99692  	}()
 99693  	func() {
 99694  		if _tr_tm != int32(1) && _tr_tm != int32(2) {
 99695  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123666), unsafe.Pointer(&_sqlite3CodeRowTriggerØ00__func__Ø000), unsafe.Pointer(str(117033)))
 99696  			crt.X__builtin_abort(tls)
 99697  		}
 99698  	}()
 99699  	func() {
 99700  		if (_op == int32(110)) != (_pChanges != nil) {
 99701  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123667), unsafe.Pointer(&_sqlite3CodeRowTriggerØ00__func__Ø000), unsafe.Pointer(str(117079)))
 99702  			crt.X__builtin_abort(tls)
 99703  		}
 99704  	}()
 99705  	_p = _pTrigger
 99706  _9:
 99707  	if _p == nil {
 99708  		goto _12
 99709  	}
 99710  	func() {
 99711  		if (*XSchema)(_p.XpSchema) == nil {
 99712  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123674), unsafe.Pointer(&_sqlite3CodeRowTriggerØ00__func__Ø000), unsafe.Pointer(str(117110)))
 99713  			crt.X__builtin_abort(tls)
 99714  		}
 99715  	}()
 99716  	func() {
 99717  		if (*XSchema)(_p.XpTabSchema) == nil {
 99718  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123675), unsafe.Pointer(&_sqlite3CodeRowTriggerØ00__func__Ø000), unsafe.Pointer(str(117124)))
 99719  			crt.X__builtin_abort(tls)
 99720  		}
 99721  	}()
 99722  	func() {
 99723  		if (*XSchema)(_p.XpSchema) != (*XSchema)(_p.XpTabSchema) && (*XSchema)(_p.XpSchema) != (*XSchema)(elem27((*XDb)((*Xsqlite3)(_pParse.Xdb).XaDb), uintptr(1)).XpSchema) {
 99724  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123676), unsafe.Pointer(&_sqlite3CodeRowTriggerØ00__func__Ø000), unsafe.Pointer(str(117141)))
 99725  			crt.X__builtin_abort(tls)
 99726  		}
 99727  	}()
 99728  	if ((int32(_p.Xop) == _op) && (int32(_p.Xtr_tm) == _tr_tm)) && _checkColumnOverlap(tls, (*XIdList)(_p.XpColumns), _pChanges) != 0 {
 99729  		_sqlite3CodeRowTriggerDirect(tls, _pParse, _p, _pTab, _reg, _orconf, _ignoreJump)
 99730  	}
 99731  	_p = (*XTrigger)(_p.XpNext)
 99732  	goto _9
 99733  _12:
 99734  }
 99735  
 99736  var _sqlite3CodeRowTriggerØ00__func__Ø000 [22]int8
 99737  
 99738  func init() {
 99739  	crt.Xstrncpy(nil, &_sqlite3CodeRowTriggerØ00__func__Ø000[0], str(117209), 22)
 99740  }
 99741  
 99742  // C comment
 99743  //  /*
 99744  //  ** Generate code for the trigger program associated with trigger p on
 99745  //  ** table pTab. The reg, orconf and ignoreJump parameters passed to this
 99746  //  ** function are the same as those described in the header function for
 99747  //  ** sqlite3CodeRowTrigger()
 99748  //  */
 99749  func _sqlite3CodeRowTriggerDirect(tls *crt.TLS, _pParse *XParse, _p *XTrigger, _pTab *XTable, _reg int32, _orconf int32, _ignoreJump int32) {
 99750  	var _1_bRecursive int32
 99751  	var _v *TVdbe
 99752  	var _pPrg *XTriggerPrg
 99753  	_v = _sqlite3GetVdbe(tls, _pParse)
 99754  	_pPrg = _getRowTrigger(tls, _pParse, _p, _pTab, _orconf)
 99755  	func() {
 99756  		if _pPrg == nil && _pParse.XnErr == 0 && ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == 0 {
 99757  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123591), unsafe.Pointer(&_sqlite3CodeRowTriggerDirectØ00__func__Ø000), unsafe.Pointer(str(117231)))
 99758  			crt.X__builtin_abort(tls)
 99759  		}
 99760  	}()
 99761  	if _pPrg != nil {
 99762  		_1_bRecursive = bool2int((_p.XzName != nil) && (int32(0) == (((*Xsqlite3)(_pParse.Xdb).Xflags) & int32(262144))))
 99763  		_sqlite3VdbeAddOp4(tls, _v, int32(44), _reg, _ignoreJump, preInc2(&_pParse.XnMem, 1), (*int8)(unsafe.Pointer((*XSubProgram)(_pPrg.XpProgram))), int32(-13))
 99764  		_sqlite3VdbeComment(tls, _v, str(117280), unsafe.Pointer(func() *int8 {
 99765  			if _p.XzName != nil {
 99766  				return _p.XzName
 99767  			}
 99768  			return str(117292)
 99769  		}()), unsafe.Pointer(_onErrorText(tls, _orconf)))
 99770  		_sqlite3VdbeChangeP5(tls, _v, uint16(uint8(_1_bRecursive)))
 99771  	}
 99772  }
 99773  
 99774  var _sqlite3CodeRowTriggerDirectØ00__func__Ø000 [28]int8
 99775  
 99776  func init() {
 99777  	crt.Xstrncpy(nil, &_sqlite3CodeRowTriggerDirectØ00__func__Ø000[0], str(117297), 28)
 99778  }
 99779  
 99780  // C comment
 99781  //  /*
 99782  //  ** Generate code to do constraint checks prior to an INSERT or an UPDATE
 99783  //  ** on table pTab.
 99784  //  **
 99785  //  ** The regNewData parameter is the first register in a range that contains
 99786  //  ** the data to be inserted or the data after the update.  There will be
 99787  //  ** pTab->nCol+1 registers in this range.  The first register (the one
 99788  //  ** that regNewData points to) will contain the new rowid, or NULL in the
 99789  //  ** case of a WITHOUT ROWID table.  The second register in the range will
 99790  //  ** contain the content of the first table column.  The third register will
 99791  //  ** contain the content of the second table column.  And so forth.
 99792  //  **
 99793  //  ** The regOldData parameter is similar to regNewData except that it contains
 99794  //  ** the data prior to an UPDATE rather than afterwards.  regOldData is zero
 99795  //  ** for an INSERT.  This routine can distinguish between UPDATE and INSERT by
 99796  //  ** checking regOldData for zero.
 99797  //  **
 99798  //  ** For an UPDATE, the pkChng boolean is true if the true primary key (the
 99799  //  ** rowid for a normal table or the PRIMARY KEY for a WITHOUT ROWID table)
 99800  //  ** might be modified by the UPDATE.  If pkChng is false, then the key of
 99801  //  ** the iDataCur content table is guaranteed to be unchanged by the UPDATE.
 99802  //  **
 99803  //  ** For an INSERT, the pkChng boolean indicates whether or not the rowid
 99804  //  ** was explicitly specified as part of the INSERT statement.  If pkChng
 99805  //  ** is zero, it means that the either rowid is computed automatically or
 99806  //  ** that the table is a WITHOUT ROWID table and has no rowid.  On an INSERT,
 99807  //  ** pkChng will only be true if the INSERT statement provides an integer
 99808  //  ** value for either the rowid column or its INTEGER PRIMARY KEY alias.
 99809  //  **
 99810  //  ** The code generated by this routine will store new index entries into
 99811  //  ** registers identified by aRegIdx[].  No index entry is created for
 99812  //  ** indices where aRegIdx[i]==0.  The order of indices in aRegIdx[] is
 99813  //  ** the same as the order of indices on the linked list of indices
 99814  //  ** at pTab->pIndex.
 99815  //  **
 99816  //  ** The caller must have already opened writeable cursors on the main
 99817  //  ** table and all applicable indices (that is to say, all indices for which
 99818  //  ** aRegIdx[] is not zero).  iDataCur is the cursor for the main table when
 99819  //  ** inserting or updating a rowid table, or the cursor for the PRIMARY KEY
 99820  //  ** index when operating on a WITHOUT ROWID table.  iIdxCur is the cursor
 99821  //  ** for the first index in the pTab->pIndex list.  Cursors for other indices
 99822  //  ** are at iIdxCur+N for the N-th element of the pTab->pIndex list.
 99823  //  **
 99824  //  ** This routine also generates code to check constraints.  NOT NULL,
 99825  //  ** CHECK, and UNIQUE constraints are all checked.  If a constraint fails,
 99826  //  ** then the appropriate action is performed.  There are five possible
 99827  //  ** actions: ROLLBACK, ABORT, FAIL, REPLACE, and IGNORE.
 99828  //  **
 99829  //  **  Constraint type  Action       What Happens
 99830  //  **  ---------------  ----------   ----------------------------------------
 99831  //  **  any              ROLLBACK     The current transaction is rolled back and
 99832  //  **                                sqlite3_step() returns immediately with a
 99833  //  **                                return code of SQLITE_CONSTRAINT.
 99834  //  **
 99835  //  **  any              ABORT        Back out changes from the current command
 99836  //  **                                only (do not do a complete rollback) then
 99837  //  **                                cause sqlite3_step() to return immediately
 99838  //  **                                with SQLITE_CONSTRAINT.
 99839  //  **
 99840  //  **  any              FAIL         Sqlite3_step() returns immediately with a
 99841  //  **                                return code of SQLITE_CONSTRAINT.  The
 99842  //  **                                transaction is not rolled back and any
 99843  //  **                                changes to prior rows are retained.
 99844  //  **
 99845  //  **  any              IGNORE       The attempt in insert or update the current
 99846  //  **                                row is skipped, without throwing an error.
 99847  //  **                                Processing continues with the next row.
 99848  //  **                                (There is an immediate jump to ignoreDest.)
 99849  //  **
 99850  //  **  NOT NULL         REPLACE      The NULL value is replace by the default
 99851  //  **                                value for that column.  If the default value
 99852  //  **                                is NULL, the action is the same as ABORT.
 99853  //  **
 99854  //  **  UNIQUE           REPLACE      The other row that conflicts with the row
 99855  //  **                                being inserted is removed.
 99856  //  **
 99857  //  **  CHECK            REPLACE      Illegal.  The results in an exception.
 99858  //  **
 99859  //  ** Which action to take is determined by the overrideError parameter.
 99860  //  ** Or if overrideError==OE_Default, then the pParse->onError parameter
 99861  //  ** is used.  Or if pParse->onError==OE_Default then the onError value
 99862  //  ** for the constraint is used.
 99863  //  */
 99864  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) {
 99865  	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
 99866  	var _10_zMsg, _16_zName, _54_p4 *int8
 99867  	var _isUpdate, _bAffinityDone uint8
 99868  	var _db *Xsqlite3
 99869  	var _27_pTrigger, _59_pTrigger *XTrigger
 99870  	var _v *TVdbe
 99871  	var _13_pCheck *XExprList
 99872  	var _14_pExpr *XExpr
 99873  	var _pIdx, _pPk *XIndex
 99874  	_pPk = nil
 99875  	_seenReplace = int32(0)
 99876  	_ipkTop = int32(0)
 99877  	_ipkBottom = int32(0)
 99878  	_bAffinityDone = uint8(0)
 99879  	_isUpdate = uint8(bool2int(_regOldData != int32(0)))
 99880  	_db = (*Xsqlite3)(_pParse.Xdb)
 99881  	_v = _sqlite3GetVdbe(tls, _pParse)
 99882  	func() {
 99883  		if _v == nil {
 99884  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110093), unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000), unsafe.Pointer(str(42019)))
 99885  			crt.X__builtin_abort(tls)
 99886  		}
 99887  	}()
 99888  	func() {
 99889  		if (*XSelect)(_pTab.XpSelect) != nil {
 99890  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110094), unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000), unsafe.Pointer(str(102296)))
 99891  			crt.X__builtin_abort(tls)
 99892  		}
 99893  	}()
 99894  	_nCol = int32(_pTab.XnCol)
 99895  	if (_pTab.XtabFlags & uint32(32)) == (0) {
 99896  		_pPk = nil
 99897  		_nPkField = int32(1)
 99898  		goto _5
 99899  	}
 99900  	_pPk = _sqlite3PrimaryKeyIndex(tls, _pTab)
 99901  	_nPkField = int32(_pPk.XnKeyCol)
 99902  _5:
 99903  	_i = int32(0)
 99904  _6:
 99905  	if _i >= _nCol {
 99906  		goto _9
 99907  	}
 99908  	if _i == int32(_pTab.XiPKey) {
 99909  		goto _7
 99910  	}
 99911  	if (_aiChng != nil) && ((*elem8(_aiChng, uintptr(_i))) < int32(0)) {
 99912  		goto _7
 99913  	}
 99914  	_onError = int32(elem41((*XColumn)(_pTab.XaCol), uintptr(_i)).XnotNull)
 99915  	if _onError == int32(0) {
 99916  		goto _7
 99917  	}
 99918  	if int32(_overrideError) != int32(10) {
 99919  		_onError = int32(_overrideError)
 99920  		goto _16
 99921  	}
 99922  	if _onError == int32(10) {
 99923  		_onError = int32(2)
 99924  	}
 99925  _16:
 99926  	if (_onError == int32(5)) && ((*XExpr)(elem41((*XColumn)(_pTab.XaCol), uintptr(_i)).XpDflt) == nil) {
 99927  		_onError = int32(2)
 99928  	}
 99929  	func() {
 99930  		if _onError != int32(1) && _onError != int32(2) && _onError != int32(3) && _onError != int32(4) && _onError != int32(5) {
 99931  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110133), unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000), unsafe.Pointer(str(117325)))
 99932  			crt.X__builtin_abort(tls)
 99933  		}
 99934  	}()
 99935  	switch _onError {
 99936  	case int32(1):
 99937  		goto _27
 99938  	case int32(2):
 99939  		goto _26
 99940  	case int32(3):
 99941  		goto _27
 99942  	case int32(4):
 99943  		goto _29
 99944  	default:
 99945  		goto _30
 99946  	}
 99947  
 99948  _26:
 99949  	_sqlite3MayAbort(tls, _pParse)
 99950  _27:
 99951  	_10_zMsg = _sqlite3MPrintf(tls, _db, str(7919), unsafe.Pointer(_pTab.XzName), unsafe.Pointer(elem41((*XColumn)(_pTab.XaCol), uintptr(_i)).XzName))
 99952  	_sqlite3VdbeAddOp3(tls, _v, int32(54), int32(1299), _onError, (_regNewData+int32(1))+_i)
 99953  	_sqlite3VdbeAppendP4(tls, _v, unsafe.Pointer(_10_zMsg), int32(-1))
 99954  	_sqlite3VdbeChangeP5(tls, _v, uint16(1))
 99955  	goto _31
 99956  _29:
 99957  	_sqlite3VdbeAddOp2(tls, _v, int32(75), (_regNewData+int32(1))+_i, _ignoreDest)
 99958  	goto _31
 99959  _30:
 99960  	func() {
 99961  		if _onError != int32(5) {
 99962  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110156), unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000), unsafe.Pointer(str(117432)))
 99963  			crt.X__builtin_abort(tls)
 99964  		}
 99965  	}()
 99966  	_addr1 = _sqlite3VdbeAddOp1(tls, _v, int32(76), (_regNewData+int32(1))+_i)
 99967  	_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem41((*XColumn)(_pTab.XaCol), uintptr(_i)).XpDflt), (_regNewData+int32(1))+_i)
 99968  	_sqlite3VdbeJumpHere(tls, _v, _addr1)
 99969  	goto _31
 99970  _31:
 99971  _7:
 99972  	_i += 1
 99973  	goto _6
 99974  _9:
 99975  	if _pTab.XpCheck == nil || (_db.Xflags&int32(8192)) != int32(0) {
 99976  		goto _35
 99977  	}
 99978  	_13_pCheck = (*XExprList)(_pTab.XpCheck)
 99979  	_pParse.XckBase = _regNewData + int32(1)
 99980  	_onError = func() int32 {
 99981  		if int32(_overrideError) != int32(10) {
 99982  			return int32(_overrideError)
 99983  		}
 99984  		return int32(2)
 99985  	}()
 99986  	_i = int32(0)
 99987  _38:
 99988  	if _i >= _13_pCheck.XnExpr {
 99989  		goto _41
 99990  	}
 99991  	_14_pExpr = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_13_pCheck.Xa)), uintptr(_i)).XpExpr)
 99992  	if (_aiChng != nil) && _checkConstraintUnchanged(tls, _14_pExpr, _aiChng, int32(_pkChng)) != 0 {
 99993  		goto _39
 99994  	}
 99995  	_14_allOk = _sqlite3VdbeMakeLabel(tls, _v)
 99996  	_sqlite3ExprIfTrue(tls, _pParse, _14_pExpr, _14_allOk, int32(16))
 99997  	if _onError == int32(4) {
 99998  		_sqlite3VdbeGoto(tls, _v, _ignoreDest)
 99999  		goto _45
100000  	}
100001  	_16_zName = elem57((*TExprList_item)(unsafe.Pointer(&_13_pCheck.Xa)), uintptr(_i)).XzName
100002  	if _16_zName == nil {
100003  		_16_zName = _pTab.XzName
100004  	}
100005  	if _onError == int32(5) {
100006  		_onError = int32(2)
100007  	}
100008  	_sqlite3HaltConstraint(tls, _pParse, int32(275), _onError, _16_zName, 0, uint8(3))
100009  _45:
100010  	_sqlite3VdbeResolveLabel(tls, _v, _14_allOk)
100011  _39:
100012  	_i += 1
100013  	goto _38
100014  _41:
100015  _35:
100016  	if _pkChng == 0 || _pPk != nil {
100017  		goto _49
100018  	}
100019  	_17_addrRowidOk = _sqlite3VdbeMakeLabel(tls, _v)
100020  	_onError = int32(_pTab.XkeyConf)
100021  	if int32(_overrideError) != int32(10) {
100022  		_onError = int32(_overrideError)
100023  		goto _52
100024  	}
100025  	if _onError == int32(10) {
100026  		_onError = int32(2)
100027  	}
100028  _52:
100029  	if _isUpdate != 0 {
100030  		_sqlite3VdbeAddOp3(tls, _v, int32(78), _regNewData, _17_addrRowidOk, _regOldData)
100031  		_sqlite3VdbeChangeP5(tls, _v, uint16(144))
100032  	}
100033  	if _onError != int32(5) || int32(_overrideError) == int32(5) {
100034  		goto _55
100035  	}
100036  	_pIdx = (*XIndex)(_pTab.XpIndex)
100037  _56:
100038  	if _pIdx == nil {
100039  		goto _59
100040  	}
100041  	if (int32(_pIdx.XonError) == int32(4)) || (int32(_pIdx.XonError) == int32(3)) {
100042  		_ipkTop = _sqlite3VdbeAddOp0(tls, _v, int32(13))
100043  		goto _59
100044  	}
100045  	_pIdx = (*XIndex)(_pIdx.XpNext)
100046  	goto _56
100047  _59:
100048  _55:
100049  	_sqlite3VdbeAddOp3(tls, _v, int32(32), _iDataCur, _17_addrRowidOk, _regNewData)
100050  	switch _onError {
100051  	case int32(1):
100052  		goto _64
100053  	case int32(2):
100054  		goto _64
100055  	case int32(3):
100056  		goto _64
100057  	case int32(4):
100058  		goto _68
100059  	case int32(5):
100060  		goto _67
100061  	default:
100062  		goto _63
100063  	}
100064  
100065  _63:
100066  	_onError = int32(2)
100067  _64:
100068  	_sqlite3RowidConstraint(tls, _pParse, _onError, _pTab)
100069  	goto _69
100070  _67:
100071  	_27_pTrigger = nil
100072  	if (_db.Xflags & int32(262144)) != 0 {
100073  		_27_pTrigger = _sqlite3TriggersExist(tls, _pParse, _pTab, int32(109), nil, nil)
100074  	}
100075  	if (_27_pTrigger != nil) || _sqlite3FkRequired(tls, _pParse, _pTab, nil, int32(0)) != 0 {
100076  		_sqlite3MultiWrite(tls, _pParse)
100077  		_sqlite3GenerateRowDelete(tls, _pParse, _pTab, _27_pTrigger, _iDataCur, _iIdxCur, _regNewData, int16(1), 0, uint8(5), uint8(1), int32(-1))
100078  		goto _73
100079  	}
100080  	if _pTab.XpIndex != nil {
100081  		_sqlite3MultiWrite(tls, _pParse)
100082  		_sqlite3GenerateRowIndexDelete(tls, _pParse, _pTab, _iDataCur, _iIdxCur, nil, int32(-1))
100083  	}
100084  _73:
100085  	_seenReplace = int32(1)
100086  	goto _69
100087  _68:
100088  	_sqlite3VdbeGoto(tls, _v, _ignoreDest)
100089  	goto _69
100090  _69:
100091  	_sqlite3VdbeResolveLabel(tls, _v, _17_addrRowidOk)
100092  	if _ipkTop != 0 {
100093  		_ipkBottom = _sqlite3VdbeAddOp0(tls, _v, int32(13))
100094  		_sqlite3VdbeJumpHere(tls, _v, _ipkTop)
100095  	}
100096  _49:
100097  	*func() **XIndex { _ix = int32(0); return &_pIdx }() = (*XIndex)(_pTab.XpIndex)
100098  _76:
100099  	if _pIdx == nil {
100100  		goto _79
100101  	}
100102  	if (*elem8(_aRegIdx, uintptr(_ix))) == int32(0) {
100103  		goto _77
100104  	}
100105  	if int32(_bAffinityDone) == int32(0) {
100106  		_sqlite3TableAffinity(tls, _v, _pTab, _regNewData+int32(1))
100107  		_bAffinityDone = uint8(1)
100108  	}
100109  	_34_iThisCur = _iIdxCur + _ix
100110  	_34_addrUniqueOk = _sqlite3VdbeMakeLabel(tls, _v)
100111  	if _pIdx.XpPartIdxWhere != nil {
100112  		_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), *elem8(_aRegIdx, uintptr(_ix)))
100113  		_pParse.XckBase = _regNewData + int32(1)
100114  		_sqlite3ExprIfFalseDup(tls, _pParse, (*XExpr)(_pIdx.XpPartIdxWhere), _34_addrUniqueOk, int32(16))
100115  		_pParse.XckBase = int32(0)
100116  	}
100117  	_34_regIdx = (*elem8(_aRegIdx, uintptr(_ix))) + int32(1)
100118  	_i = int32(0)
100119  _83:
100120  	if _i >= int32(_pIdx.XnColumn) {
100121  		goto _86
100122  	}
100123  	_37_iField = int32(*elem50(_pIdx.XaiColumn, uintptr(_i)))
100124  	if _37_iField == int32(-2) {
100125  		_pParse.XckBase = _regNewData + int32(1)
100126  		_sqlite3ExprCodeCopy(tls, _pParse, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.XaColExpr).Xa))), uintptr(_i)).XpExpr), _34_regIdx+_i)
100127  		_pParse.XckBase = int32(0)
100128  		_sqlite3VdbeComment(tls, _v, str(117452), unsafe.Pointer(_pIdx.XzName), _i)
100129  		goto _88
100130  	}
100131  	if (_37_iField == int32(-1)) || (_37_iField == int32(_pTab.XiPKey)) {
100132  		_37_x = _regNewData
100133  		goto _91
100134  	}
100135  	_37_x = (_37_iField + _regNewData) + int32(1)
100136  _91:
100137  	_sqlite3VdbeAddOp2(tls, _v, func() int32 {
100138  		if _37_iField < int32(0) {
100139  			return int32(66)
100140  		}
100141  		return int32(65)
100142  	}(), _37_x, _34_regIdx+_i)
100143  	_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(func() *int8 {
100144  		if _37_iField < int32(0) {
100145  			return str(27182)
100146  		}
100147  		return (elem41((*XColumn)(_pTab.XaCol), uintptr(_37_iField)).XzName)
100148  	}()))
100149  _88:
100150  	_i += 1
100151  	goto _83
100152  _86:
100153  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _34_regIdx, int32(_pIdx.XnColumn), *elem8(_aRegIdx, uintptr(_ix)))
100154  	_sqlite3VdbeComment(tls, _v, str(107216), unsafe.Pointer(_pIdx.XzName))
100155  	if ((_isUpdate != 0) && (_pPk == _pIdx)) && (int32(_pkChng) == int32(0)) {
100156  		_sqlite3VdbeResolveLabel(tls, _v, _34_addrUniqueOk)
100157  		goto _77
100158  	}
100159  	_onError = int32(_pIdx.XonError)
100160  	if _onError == int32(0) {
100161  		_sqlite3VdbeResolveLabel(tls, _v, _34_addrUniqueOk)
100162  		goto _77
100163  	}
100164  	if int32(_overrideError) != int32(10) {
100165  		_onError = int32(_overrideError)
100166  		goto _102
100167  	}
100168  	if _onError == int32(10) {
100169  		_onError = int32(2)
100170  	}
100171  _102:
100172  	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)))) {
100173  		_sqlite3VdbeResolveLabel(tls, _v, _34_addrUniqueOk)
100174  		goto _77
100175  	}
100176  	_sqlite3VdbeAddOp4Int(tls, _v, int32(28), _34_iThisCur, _34_addrUniqueOk, _34_regIdx, int32(_pIdx.XnKeyCol))
100177  	_34_regR = func() int32 {
100178  		if _pIdx == _pPk {
100179  			return _34_regIdx
100180  		}
100181  		return _sqlite3GetTempRange(tls, _pParse, _nPkField)
100182  	}()
100183  	if _isUpdate == 0 && _onError != int32(5) {
100184  		goto _115
100185  	}
100186  	if (_pTab.XtabFlags & uint32(32)) != (0) {
100187  		goto _116
100188  	}
100189  	_sqlite3VdbeAddOp2(tls, _v, int32(131), _34_iThisCur, _34_regR)
100190  	if _isUpdate != 0 {
100191  		_sqlite3VdbeAddOp3(tls, _v, int32(78), _34_regR, _34_addrUniqueOk, _regOldData)
100192  		_sqlite3VdbeChangeP5(tls, _v, uint16(144))
100193  	}
100194  	goto _118
100195  _116:
100196  	if _pIdx == _pPk {
100197  		goto _119
100198  	}
100199  	_i = int32(0)
100200  _120:
100201  	if _i >= int32(_pPk.XnKeyCol) {
100202  		goto _123
100203  	}
100204  	func() {
100205  		if int32(*elem50(_pPk.XaiColumn, uintptr(_i))) < int32(0) {
100206  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110431), unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000), unsafe.Pointer(str(115293)))
100207  			crt.X__builtin_abort(tls)
100208  		}
100209  	}()
100210  	_50_x = int32(_sqlite3ColumnOfIndex(tls, _pIdx, *elem50(_pPk.XaiColumn, uintptr(_i))))
100211  	_sqlite3VdbeAddOp3(tls, _v, int32(99), _34_iThisCur, _50_x, _34_regR+_i)
100212  	_sqlite3VdbeComment(tls, _v, str(7919), unsafe.Pointer(_pTab.XzName), unsafe.Pointer(elem41((*XColumn)(_pTab.XaCol), uintptr(*elem50(_pPk.XaiColumn, uintptr(_i)))).XzName))
100213  	_i += 1
100214  	goto _120
100215  _123:
100216  _119:
100217  	if _isUpdate == 0 {
100218  		goto _126
100219  	}
100220  	_53_addrJump = _sqlite3VdbeCurrentAddr(tls, _v) + int32(_pPk.XnKeyCol)
100221  	_53_op = int32(77)
100222  	_53_regCmp = func() int32 {
100223  		if int32((uint32(_pIdx.XidxType)<<30)>>30) == int32(2) {
100224  			return _34_regIdx
100225  		}
100226  		return _34_regR
100227  	}()
100228  	_i = int32(0)
100229  _129:
100230  	if _i >= int32(_pPk.XnKeyCol) {
100231  		goto _132
100232  	}
100233  	_54_p4 = (*int8)(unsafe.Pointer(_sqlite3LocateCollSeq(tls, _pParse, *elem0(_pPk.XazColl, uintptr(_i)))))
100234  	_50_x = int32(*elem50(_pPk.XaiColumn, uintptr(_i)))
100235  	func() {
100236  		if _50_x < int32(0) {
100237  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110453), unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000), unsafe.Pointer(str(109771)))
100238  			crt.X__builtin_abort(tls)
100239  		}
100240  	}()
100241  	if _i == (int32(_pPk.XnKeyCol) - int32(1)) {
100242  		_53_addrJump = _34_addrUniqueOk
100243  		_53_op = int32(78)
100244  	}
100245  	_sqlite3VdbeAddOp4(tls, _v, _53_op, (_regOldData+int32(1))+_50_x, _53_addrJump, _53_regCmp+_i, _54_p4, int32(-3))
100246  	_sqlite3VdbeChangeP5(tls, _v, uint16(144))
100247  	_i += 1
100248  	goto _129
100249  _132:
100250  _126:
100251  _118:
100252  _115:
100253  	func() {
100254  		if _onError != int32(1) && _onError != int32(2) && _onError != int32(3) && _onError != int32(4) && _onError != int32(5) {
100255  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110470), unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000), unsafe.Pointer(str(117325)))
100256  			crt.X__builtin_abort(tls)
100257  		}
100258  	}()
100259  	switch _onError {
100260  	case int32(1):
100261  		goto _143
100262  	case int32(2):
100263  		goto _143
100264  	case int32(3):
100265  		goto _143
100266  	case int32(4):
100267  		goto _146
100268  	default:
100269  		goto _147
100270  	}
100271  
100272  _143:
100273  	_sqlite3UniqueConstraint(tls, _pParse, _onError, _pIdx)
100274  	goto _148
100275  _146:
100276  	_sqlite3VdbeGoto(tls, _v, _ignoreDest)
100277  	goto _148
100278  _147:
100279  	_59_pTrigger = nil
100280  	func() {
100281  		if _onError != int32(5) {
100282  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110485), unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000), unsafe.Pointer(str(117432)))
100283  			crt.X__builtin_abort(tls)
100284  		}
100285  	}()
100286  	_sqlite3MultiWrite(tls, _pParse)
100287  	if (_db.Xflags & int32(262144)) != 0 {
100288  		_59_pTrigger = _sqlite3TriggersExist(tls, _pParse, _pTab, int32(109), nil, nil)
100289  	}
100290  	_sqlite3GenerateRowDelete(tls, _pParse, _pTab, _59_pTrigger, _iDataCur, _iIdxCur, _34_regR, int16(_nPkField), 0, uint8(5), uint8(func() int32 {
100291  		if _pIdx == _pPk {
100292  			return int32(1)
100293  		}
100294  		return int32(0)
100295  	}()), _34_iThisCur)
100296  	_seenReplace = int32(1)
100297  	goto _148
100298  _148:
100299  	_sqlite3VdbeResolveLabel(tls, _v, _34_addrUniqueOk)
100300  	if _34_regR != _34_regIdx {
100301  		_sqlite3ReleaseTempRange(tls, _pParse, _34_regR, _nPkField)
100302  	}
100303  _77:
100304  	*func() *int32 { _pIdx = (*XIndex)(_pIdx.XpNext); return &_ix }() += 1
100305  	goto _76
100306  _79:
100307  	if _ipkTop != 0 {
100308  		_sqlite3VdbeGoto(tls, _v, _ipkTop+int32(1))
100309  		_sqlite3VdbeJumpHere(tls, _v, _ipkBottom)
100310  	}
100311  	*_pbMayReplace = _seenReplace
100312  }
100313  
100314  var _sqlite3GenerateConstraintChecksØ00__func__Ø000 [32]int8
100315  
100316  func init() {
100317  	crt.Xstrncpy(nil, &_sqlite3GenerateConstraintChecksØ00__func__Ø000[0], str(117465), 32)
100318  }
100319  
100320  // C comment
100321  //  /*
100322  //  ** pExpr is a CHECK constraint on a row that is being UPDATE-ed.  The
100323  //  ** only columns that are modified by the UPDATE are those for which
100324  //  ** aiChng[i]>=0, and also the ROWID is modified if chngRowid is true.
100325  //  **
100326  //  ** Return true if CHECK constraint pExpr does not use any of the
100327  //  ** changing columns (or the rowid if it is changing).  In other words,
100328  //  ** return true if this CHECK constraint can be skipped when validating
100329  //  ** the new row in the UPDATE statement.
100330  //  */
100331  func _checkConstraintUnchanged(tls *crt.TLS, _pExpr *XExpr, _aiChng *int32, _chngRowid int32) (r0 int32) {
100332  	var _w XWalker
100333  	crt.Xmemset(tls, unsafe.Pointer(&_w), int32(0), uint32(28))
100334  	_w.XeCode = 0
100335  	*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&_w.XxExprCallback)) = _checkConstraintExprNode
100336  	*(**int32)(unsafe.Pointer(&_w.Xu)) = _aiChng
100337  	_sqlite3WalkExpr(tls, &_w, _pExpr)
100338  	if _chngRowid == 0 {
100339  		{
100340  			p := &_w.XeCode
100341  			*p = uint8(int32(*p) & int32(-3))
100342  		}
100343  	}
100344  	return bool2int(_w.XeCode == 0)
100345  }
100346  
100347  // C comment
100348  //  /* This is the Walker callback from checkConstraintUnchanged().  Set
100349  //  ** bit 0x01 of pWalker->eCode if
100350  //  ** pWalker->eCode to 0 if this expression node references any of the
100351  //  ** columns that are being modifed by an UPDATE statement.
100352  //  */
100353  func _checkConstraintExprNode(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
100354  	if int32(_pExpr.Xop) != int32(152) {
100355  		goto _0
100356  	}
100357  	func() {
100358  		if int32(_pExpr.XiColumn) < int32(0) && int32(_pExpr.XiColumn) != int32(-1) {
100359  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109937), unsafe.Pointer(&_checkConstraintExprNodeØ00__func__Ø000), unsafe.Pointer(str(117497)))
100360  			crt.X__builtin_abort(tls)
100361  		}
100362  	}()
100363  	if int32(_pExpr.XiColumn) < int32(0) {
100364  		goto _4
100365  	}
100366  	if (*elem8(*(**int32)(unsafe.Pointer(&_pWalker.Xu)), uintptr(_pExpr.XiColumn))) >= int32(0) {
100367  		{
100368  			p := &_pWalker.XeCode
100369  			*p = uint8(int32(*p) | int32(1))
100370  		}
100371  	}
100372  	goto _6
100373  _4:
100374  	{
100375  		p := &_pWalker.XeCode
100376  		*p = uint8(int32(*p) | int32(2))
100377  	}
100378  _6:
100379  _0:
100380  	return int32(0)
100381  }
100382  
100383  var _checkConstraintExprNodeØ00__func__Ø000 [24]int8
100384  
100385  func init() {
100386  	crt.Xstrncpy(nil, &_checkConstraintExprNodeØ00__func__Ø000[0], str(117537), 24)
100387  }
100388  
100389  // C comment
100390  //  /*
100391  //  ** Code an OP_Halt due to non-unique rowid.
100392  //  */
100393  func _sqlite3RowidConstraint(tls *crt.TLS, _pParse *XParse, _onError int32, _pTab *XTable) {
100394  	var _rc int32
100395  	var _zMsg *int8
100396  	if int32(_pTab.XiPKey) >= int32(0) {
100397  		_zMsg = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.Xdb), str(7919), unsafe.Pointer(_pTab.XzName), unsafe.Pointer(elem41((*XColumn)(_pTab.XaCol), uintptr(_pTab.XiPKey)).XzName))
100398  		_rc = int32(1555)
100399  		goto _1
100400  	}
100401  	_zMsg = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.Xdb), str(117561), unsafe.Pointer(_pTab.XzName))
100402  	_rc = int32(2579)
100403  _1:
100404  	_sqlite3HaltConstraint(tls, _pParse, _rc, _onError, _zMsg, int8(-1), uint8(2))
100405  }
100406  
100407  // C comment
100408  //  /*
100409  //  ** Indicate that the statement currently under construction might write
100410  //  ** more than one entry (example: deleting one row then inserting another,
100411  //  ** inserting multiple rows in a table, or inserting a row and index entries.)
100412  //  ** If an abort occurs after some of these writes have completed, then it will
100413  //  ** be necessary to undo the completed writes.
100414  //  */
100415  func _sqlite3MultiWrite(tls *crt.TLS, _pParse *XParse) {
100416  	var _pToplevel *XParse
100417  	_pToplevel = func() *XParse {
100418  		if _pParse.XpToplevel != nil {
100419  			return (*XParse)(_pParse.XpToplevel)
100420  		}
100421  		return _pParse
100422  	}()
100423  	_pToplevel.XisMultiWrite = uint8(1)
100424  }
100425  
100426  // C comment
100427  //  /*
100428  //  ** This routine generates VDBE code that causes the deletion of all
100429  //  ** index entries associated with a single row of a single table, pTab
100430  //  **
100431  //  ** Preconditions:
100432  //  **
100433  //  **   1.  A read/write cursor "iDataCur" must be open on the canonical storage
100434  //  **       btree for the table pTab.  (This will be either the table itself
100435  //  **       for rowid tables or to the primary key index for WITHOUT ROWID
100436  //  **       tables.)
100437  //  **
100438  //  **   2.  Read/write cursors for all indices of pTab must be open as
100439  //  **       cursor number iIdxCur+i for the i-th index.  (The pTab->pIndex
100440  //  **       index is the 0-th index.)
100441  //  **
100442  //  **   3.  The "iDataCur" cursor must be already be positioned on the row
100443  //  **       that is to be deleted.
100444  //  */
100445  func _sqlite3GenerateRowIndexDelete(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _iDataCur int32, _iIdxCur int32, _aRegIdx *int32, _iIdxNoSeek int32) {
100446  	var _i, _r1, _iPartIdxLabel int32
100447  	var _v *TVdbe
100448  	var _pIdx, _pPrior, _pPk *XIndex
100449  	_r1 = int32(-1)
100450  	_pPrior = nil
100451  	_v = (*TVdbe)(_pParse.XpVdbe)
100452  	_pPk = func() *XIndex {
100453  		if (_pTab.XtabFlags & uint32(32)) == (0) {
100454  			return nil
100455  		}
100456  		return _sqlite3PrimaryKeyIndex(tls, _pTab)
100457  	}()
100458  	*func() **XIndex { _i = int32(0); return &_pIdx }() = (*XIndex)(_pTab.XpIndex)
100459  _2:
100460  	if _pIdx == nil {
100461  		goto _5
100462  	}
100463  	func() {
100464  		if (_iIdxCur+_i) == _iDataCur && _pPk != _pIdx {
100465  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105425), unsafe.Pointer(&_sqlite3GenerateRowIndexDeleteØ00__func__Ø000), unsafe.Pointer(str(117570)))
100466  			crt.X__builtin_abort(tls)
100467  		}
100468  	}()
100469  	if (_aRegIdx != nil) && ((*elem8(_aRegIdx, uintptr(_i))) == int32(0)) {
100470  		goto _3
100471  	}
100472  	if _pIdx == _pPk {
100473  		goto _3
100474  	}
100475  	if (_iIdxCur + _i) == _iIdxNoSeek {
100476  		goto _3
100477  	}
100478  	_r1 = _sqlite3GenerateIndexKey(tls, _pParse, _pIdx, _iDataCur, int32(0), int32(1), &_iPartIdxLabel, _pPrior, _r1)
100479  	_sqlite3VdbeAddOp3(tls, _v, int32(129), _iIdxCur+_i, _r1, int32(func() uint16 {
100480  		if ((uint32(_pIdx.XidxType>>3) << 31) >> 31) != 0 {
100481  			return _pIdx.XnKeyCol
100482  		}
100483  		return _pIdx.XnColumn
100484  	}()))
100485  	_sqlite3ResolvePartIdxLabel(tls, _pParse, _iPartIdxLabel)
100486  	_pPrior = _pIdx
100487  _3:
100488  	*func() **XIndex { _i += 1; return &_pIdx }() = (*XIndex)(_pIdx.XpNext)
100489  	goto _2
100490  _5:
100491  }
100492  
100493  var _sqlite3GenerateRowIndexDeleteØ00__func__Ø000 [30]int8
100494  
100495  func init() {
100496  	crt.Xstrncpy(nil, &_sqlite3GenerateRowIndexDeleteØ00__func__Ø000[0], str(117603), 30)
100497  }
100498  
100499  // C comment
100500  //  /*
100501  //  ** This function is called when inserting, deleting or updating a row of
100502  //  ** table pTab to generate VDBE code to perform foreign key constraint
100503  //  ** processing for the operation.
100504  //  **
100505  //  ** For a DELETE operation, parameter regOld is passed the index of the
100506  //  ** first register in an array of (pTab->nCol+1) registers containing the
100507  //  ** rowid of the row being deleted, followed by each of the column values
100508  //  ** of the row being deleted, from left to right. Parameter regNew is passed
100509  //  ** zero in this case.
100510  //  **
100511  //  ** For an INSERT operation, regOld is passed zero and regNew is passed the
100512  //  ** first register of an array of (pTab->nCol+1) registers containing the new
100513  //  ** row data.
100514  //  **
100515  //  ** For an UPDATE operation, this function is called twice. Once before
100516  //  ** the original record is deleted from the table using the calling convention
100517  //  ** described for DELETE. Then again after the original record is deleted
100518  //  ** but before the new record is inserted using the INSERT convention.
100519  //  */
100520  func _sqlite3FkCheck(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _regOld int32, _regNew int32, _aChange *int32, _bChngRowid int32) {
100521  	var _iDb, _isIgnoreErrors, _1_iCol, _1_i, _1_bIgnore, _6_iJump, _7_iReg, _12_rcauth, _21_eAction int32
100522  	var _1_aiFree, _1_aiCol, _15_aiCol *int32
100523  	var _zDb, _12_zCol *int8
100524  	var _db *Xsqlite3
100525  	var _1_pTo *XTable
100526  	var _6_v *TVdbe
100527  	var _15_pSrc *XSrcList
100528  	var _19_pItem *TSrcList_item
100529  	var _1_pIdx, _15_pIdx *XIndex
100530  	var _pFKey *XFKey
100531  	_db = (*Xsqlite3)(_pParse.Xdb)
100532  	_isIgnoreErrors = int32(_pParse.XdisableTriggers)
100533  	func() {
100534  		if (_regOld == int32(0)) == (_regNew == int32(0)) {
100535  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108281), unsafe.Pointer(&_sqlite3FkCheckØ00__func__Ø000), unsafe.Pointer(str(117633)))
100536  			crt.X__builtin_abort(tls)
100537  		}
100538  	}()
100539  	if (_db.Xflags & int32(524288)) == int32(0) {
100540  		return
100541  	}
100542  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.XpSchema))
100543  	_zDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
100544  	_pFKey = (*XFKey)(_pTab.XpFKey)
100545  _3:
100546  	if _pFKey == nil {
100547  		goto _6
100548  	}
100549  	_1_pIdx = nil
100550  	_1_aiFree = nil
100551  	_1_bIgnore = int32(0)
100552  	if ((_aChange != nil) && (Xsqlite3_stricmp(tls, _pTab.XzName, _pFKey.XzTo) != int32(0))) && (_fkChildIsModified(tls, _pTab, _pFKey, _aChange, _bChngRowid) == int32(0)) {
100553  		goto _4
100554  	}
100555  	if _pParse.XdisableTriggers != 0 {
100556  		_1_pTo = _sqlite3FindTable(tls, _db, _pFKey.XzTo, _zDb)
100557  		goto _11
100558  	}
100559  	_1_pTo = _sqlite3LocateTable(tls, _pParse, 0, _pFKey.XzTo, _zDb)
100560  _11:
100561  	if _1_pTo != nil && _sqlite3FkLocateIndex(tls, _pParse, _1_pTo, _pFKey, &_1_pIdx, &_1_aiFree) == 0 {
100562  		goto _13
100563  	}
100564  	func() {
100565  		if _isIgnoreErrors != int32(0) && (_regOld == int32(0) || _regNew != int32(0)) {
100566  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108317), unsafe.Pointer(&_sqlite3FkCheckØ00__func__Ø000), unsafe.Pointer(str(117658)))
100567  			crt.X__builtin_abort(tls)
100568  		}
100569  	}()
100570  	if (_isIgnoreErrors == 0) || (_db.XmallocFailed != 0) {
100571  		return
100572  	}
100573  	if _1_pTo != nil {
100574  		goto _20
100575  	}
100576  	_6_v = _sqlite3GetVdbe(tls, _pParse)
100577  	_6_iJump = (_sqlite3VdbeCurrentAddr(tls, _6_v) + _pFKey.XnCol) + int32(1)
100578  	_1_i = int32(0)
100579  _21:
100580  	if _1_i >= _pFKey.XnCol {
100581  		goto _24
100582  	}
100583  	_7_iReg = ((elem116((*t117)(unsafe.Pointer(&_pFKey.XaCol)), uintptr(_1_i)).XiFrom) + _regOld) + int32(1)
100584  	_sqlite3VdbeAddOp2(tls, _6_v, int32(75), _7_iReg, _6_iJump)
100585  	_1_i += 1
100586  	goto _21
100587  _24:
100588  	_sqlite3VdbeAddOp2(tls, _6_v, int32(147), int32(_pFKey.XisDeferred), int32(-1))
100589  _20:
100590  	goto _4
100591  _13:
100592  	func() {
100593  		if _pFKey.XnCol != int32(1) && (_1_aiFree == nil || _1_pIdx == nil) {
100594  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108337), unsafe.Pointer(&_sqlite3FkCheckØ00__func__Ø000), unsafe.Pointer(str(117704)))
100595  			crt.X__builtin_abort(tls)
100596  		}
100597  	}()
100598  	if _1_aiFree != nil {
100599  		_1_aiCol = _1_aiFree
100600  		goto _30
100601  	}
100602  	_1_iCol = elem116((*t117)(unsafe.Pointer(&_pFKey.XaCol)), 0).XiFrom
100603  	_1_aiCol = &_1_iCol
100604  _30:
100605  	_1_i = int32(0)
100606  _31:
100607  	if _1_i >= _pFKey.XnCol {
100608  		goto _34
100609  	}
100610  	if (*elem8(_1_aiCol, uintptr(_1_i))) == int32(_pTab.XiPKey) {
100611  		*elem8(_1_aiCol, uintptr(_1_i)) = int32(-1)
100612  	}
100613  	func() {
100614  		if _1_pIdx != nil && int32(*elem50(_1_pIdx.XaiColumn, uintptr(_1_i))) < int32(0) {
100615  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108349), unsafe.Pointer(&_sqlite3FkCheckØ00__func__Ø000), unsafe.Pointer(str(117739)))
100616  			crt.X__builtin_abort(tls)
100617  		}
100618  	}()
100619  	if _db.XxAuth != nil {
100620  		_12_zCol = elem41((*XColumn)(_1_pTo.XaCol), uintptr(func() int16 {
100621  			if _1_pIdx != nil {
100622  				return (*elem50(_1_pIdx.XaiColumn, uintptr(_1_i)))
100623  			}
100624  			return _1_pTo.XiPKey
100625  		}())).XzName
100626  		_12_rcauth = _sqlite3AuthReadCol(tls, _pParse, _1_pTo.XzName, _12_zCol, _iDb)
100627  		_1_bIgnore = bool2int(_12_rcauth == int32(2))
100628  	}
100629  	_1_i += 1
100630  	goto _31
100631  _34:
100632  	_sqlite3TableLock(tls, _pParse, _iDb, _1_pTo.Xtnum, 0, _1_pTo.XzName)
100633  	_pParse.XnTab += 1
100634  	if _regOld != int32(0) {
100635  		_fkLookupParent(tls, _pParse, _iDb, _1_pTo, _1_pIdx, _pFKey, _1_aiCol, _regOld, int32(-1), _1_bIgnore)
100636  	}
100637  	if (_regNew != int32(0)) && (_isSetNullAction(tls, _pParse, _pFKey) == 0) {
100638  		_fkLookupParent(tls, _pParse, _iDb, _1_pTo, _1_pIdx, _pFKey, _1_aiCol, _regNew, int32(1), _1_bIgnore)
100639  	}
100640  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_1_aiFree))
100641  _4:
100642  	_pFKey = (*XFKey)(_pFKey.XpNextFrom)
100643  	goto _3
100644  _6:
100645  	_pFKey = _sqlite3FkReferences(tls, _pTab)
100646  _45:
100647  	if _pFKey == nil {
100648  		goto _48
100649  	}
100650  	_15_pIdx = nil
100651  	_15_aiCol = nil
100652  	if (_aChange != nil) && (_fkParentIsModified(tls, _pTab, _pFKey, _aChange, _bChngRowid) == int32(0)) {
100653  		goto _46
100654  	}
100655  	if (((_pFKey.XisDeferred == 0) && ((_db.Xflags & int32(33554432)) == 0)) && (_pParse.XpToplevel == nil)) && (_pParse.XisMultiWrite == 0) {
100656  		func() {
100657  			if _regOld != int32(0) || _regNew == int32(0) {
100658  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108404), unsafe.Pointer(&_sqlite3FkCheckØ00__func__Ø000), unsafe.Pointer(str(117771)))
100659  				crt.X__builtin_abort(tls)
100660  			}
100661  		}()
100662  		goto _46
100663  	}
100664  	if _sqlite3FkLocateIndex(tls, _pParse, _pTab, _pFKey, &_15_pIdx, &_15_aiCol) == 0 {
100665  		goto _58
100666  	}
100667  	if (_isIgnoreErrors == 0) || (_db.XmallocFailed != 0) {
100668  		return
100669  	}
100670  	goto _46
100671  _58:
100672  	func() {
100673  		if _15_aiCol == nil && _pFKey.XnCol != int32(1) {
100674  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108414), unsafe.Pointer(&_sqlite3FkCheckØ00__func__Ø000), unsafe.Pointer(str(117794)))
100675  			crt.X__builtin_abort(tls)
100676  		}
100677  	}()
100678  	_15_pSrc = _sqlite3SrcListAppend(tls, _db, nil, nil, nil)
100679  	if _15_pSrc == nil {
100680  		goto _64
100681  	}
100682  	_19_pItem = (*TSrcList_item)(unsafe.Pointer(&_15_pSrc.Xa))
100683  	*(**XTable)(unsafe.Pointer(&_19_pItem.XpTab)) = (*XTable)(_pFKey.XpFrom)
100684  	_19_pItem.XzName = (*XTable)(_pFKey.XpFrom).XzName
100685  	(*XTable)(_19_pItem.XpTab).XnTabRef += 1
100686  	_19_pItem.XiCursor = postInc2(&_pParse.XnTab, 1)
100687  	if _regNew != int32(0) {
100688  		_fkScanChildren(tls, _pParse, _15_pSrc, _pTab, _15_pIdx, _pFKey, _15_aiCol, _regNew, int32(-1))
100689  	}
100690  	if _regOld == int32(0) {
100691  		goto _66
100692  	}
100693  	_21_eAction = int32(*elem15((*uint8)(unsafe.Pointer(&_pFKey.XaAction)), uintptr(bool2int(_aChange != nil))))
100694  	_fkScanChildren(tls, _pParse, _15_pSrc, _pTab, _15_pIdx, _pFKey, _15_aiCol, _regOld, int32(1))
100695  	if ((_pFKey.XisDeferred == 0) && (_21_eAction != int32(9))) && (_21_eAction != int32(7)) {
100696  		_sqlite3MayAbort(tls, _pParse)
100697  	}
100698  _66:
100699  	_19_pItem.XzName = nil
100700  	_sqlite3SrcListDelete(tls, _db, _15_pSrc)
100701  _64:
100702  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_15_aiCol))
100703  _46:
100704  	_pFKey = (*XFKey)(_pFKey.XpNextTo)
100705  	goto _45
100706  _48:
100707  	_ = _1_iCol
100708  }
100709  
100710  var _sqlite3FkCheckØ00__func__Ø000 [15]int8
100711  
100712  func init() {
100713  	crt.Xstrncpy(nil, &_sqlite3FkCheckØ00__func__Ø000[0], str(117818), 15)
100714  }
100715  
100716  // C comment
100717  //  /*
100718  //  ** This function is called when a row is inserted into or deleted from the
100719  //  ** child table of foreign key constraint pFKey. If an SQL UPDATE is executed
100720  //  ** on the child table of pFKey, this function is invoked twice for each row
100721  //  ** affected - once to "delete" the old row, and then again to "insert" the
100722  //  ** new row.
100723  //  **
100724  //  ** Each time it is called, this function generates VDBE code to locate the
100725  //  ** row in the parent table that corresponds to the row being inserted into
100726  //  ** or deleted from the child table. If the parent row can be found, no
100727  //  ** special action is taken. Otherwise, if the parent row can *not* be
100728  //  ** found in the parent table:
100729  //  **
100730  //  **   Operation | FK type   | Action taken
100731  //  **   --------------------------------------------------------------------------
100732  //  **   INSERT      immediate   Increment the "immediate constraint counter".
100733  //  **
100734  //  **   DELETE      immediate   Decrement the "immediate constraint counter".
100735  //  **
100736  //  **   INSERT      deferred    Increment the "deferred constraint counter".
100737  //  **
100738  //  **   DELETE      deferred    Decrement the "deferred constraint counter".
100739  //  **
100740  //  ** These operations are identified in the comment at the top of this file
100741  //  ** (fkey.c) as "I.1" and "D.1".
100742  //  */
100743  func _fkLookupParent(tls *crt.TLS, _pParse *XParse, _iDb int32, _pTab *XTable, _pIdx *XIndex, _pFKey *XFKey, _aiCol *int32, _regData int32, _nIncr int32, _isIgnore int32) {
100744  	var _i, _iCur, _iOk, _2_iReg, _4_iMustBeInt, _4_regTemp, _6_nCol, _6_regTemp, _6_regRec, _8_iJump, _9_iChild, _9_iParent int32
100745  	var _v *TVdbe
100746  	_v = _sqlite3GetVdbe(tls, _pParse)
100747  	_iCur = _pParse.XnTab - int32(1)
100748  	_iOk = _sqlite3VdbeMakeLabel(tls, _v)
100749  	if _nIncr < int32(0) {
100750  		_sqlite3VdbeAddOp2(tls, _v, int32(45), int32(_pFKey.XisDeferred), _iOk)
100751  	}
100752  	_i = int32(0)
100753  _1:
100754  	if _i >= _pFKey.XnCol {
100755  		goto _4
100756  	}
100757  	_2_iReg = ((*elem8(_aiCol, uintptr(_i))) + _regData) + int32(1)
100758  	_sqlite3VdbeAddOp2(tls, _v, int32(75), _2_iReg, _iOk)
100759  	_i += 1
100760  	goto _1
100761  _4:
100762  	if _isIgnore != int32(0) {
100763  		goto _5
100764  	}
100765  	if _pIdx != nil {
100766  		goto _6
100767  	}
100768  	_4_regTemp = _sqlite3GetTempReg(tls, _pParse)
100769  	_sqlite3VdbeAddOp2(tls, _v, int32(65), ((*elem8(_aiCol, 0))+int32(1))+_regData, _4_regTemp)
100770  	_4_iMustBeInt = _sqlite3VdbeAddOp2(tls, _v, int32(17), _4_regTemp, int32(0))
100771  	if (_pTab == (*XTable)(_pFKey.XpFrom)) && (_nIncr == int32(1)) {
100772  		_sqlite3VdbeAddOp3(tls, _v, int32(78), _regData, _iOk, _4_regTemp)
100773  		_sqlite3VdbeChangeP5(tls, _v, uint16(144))
100774  	}
100775  	_sqlite3OpenTable(tls, _pParse, _iCur, _iDb, _pTab, int32(106))
100776  	_sqlite3VdbeAddOp3(tls, _v, int32(32), _iCur, int32(0), _4_regTemp)
100777  	_sqlite3VdbeGoto(tls, _v, _iOk)
100778  	_sqlite3VdbeJumpHere(tls, _v, _sqlite3VdbeCurrentAddr(tls, _v)-int32(2))
100779  	_sqlite3VdbeJumpHere(tls, _v, _4_iMustBeInt)
100780  	_sqlite3ReleaseTempReg(tls, _pParse, _4_regTemp)
100781  	goto _9
100782  _6:
100783  	_6_nCol = _pFKey.XnCol
100784  	_6_regTemp = _sqlite3GetTempRange(tls, _pParse, _6_nCol)
100785  	_6_regRec = _sqlite3GetTempReg(tls, _pParse)
100786  	_sqlite3VdbeAddOp3(tls, _v, int32(106), _iCur, _pIdx.Xtnum, _iDb)
100787  	_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pIdx)
100788  	_i = int32(0)
100789  _10:
100790  	if _i >= _6_nCol {
100791  		goto _13
100792  	}
100793  	_sqlite3VdbeAddOp2(tls, _v, int32(64), ((*elem8(_aiCol, uintptr(_i)))+int32(1))+_regData, _6_regTemp+_i)
100794  	_i += 1
100795  	goto _10
100796  _13:
100797  	if _pTab != (*XTable)(_pFKey.XpFrom) || _nIncr != int32(1) {
100798  		goto _15
100799  	}
100800  	_8_iJump = (_sqlite3VdbeCurrentAddr(tls, _v) + _6_nCol) + int32(1)
100801  	_i = int32(0)
100802  _16:
100803  	if _i >= _6_nCol {
100804  		goto _19
100805  	}
100806  	_9_iChild = ((*elem8(_aiCol, uintptr(_i))) + int32(1)) + _regData
100807  	_9_iParent = (int32(*elem50(_pIdx.XaiColumn, uintptr(_i))) + int32(1)) + _regData
100808  	func() {
100809  		if int32(*elem50(_pIdx.XaiColumn, uintptr(_i))) < int32(0) {
100810  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107820), unsafe.Pointer(&_fkLookupParentØ00__func__Ø000), unsafe.Pointer(str(116833)))
100811  			crt.X__builtin_abort(tls)
100812  		}
100813  	}()
100814  	func() {
100815  		if (*elem8(_aiCol, uintptr(_i))) == int32(_pTab.XiPKey) {
100816  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107821), unsafe.Pointer(&_fkLookupParentØ00__func__Ø000), unsafe.Pointer(str(117833)))
100817  			crt.X__builtin_abort(tls)
100818  		}
100819  	}()
100820  	if int32(*elem50(_pIdx.XaiColumn, uintptr(_i))) == int32(_pTab.XiPKey) {
100821  		_9_iParent = _regData
100822  	}
100823  	_sqlite3VdbeAddOp3(tls, _v, int32(77), _9_iChild, _8_iJump, _9_iParent)
100824  	_sqlite3VdbeChangeP5(tls, _v, uint16(16))
100825  	_i += 1
100826  	goto _16
100827  _19:
100828  	_sqlite3VdbeGoto(tls, _v, _iOk)
100829  _15:
100830  	_sqlite3VdbeAddOp4(tls, _v, int32(101), _6_regTemp, _6_nCol, _6_regRec, _sqlite3IndexAffinityStr(tls, (*Xsqlite3)(_pParse.Xdb), _pIdx), _6_nCol)
100831  	_sqlite3VdbeAddOp4Int(tls, _v, int32(30), _iCur, _iOk, _6_regRec, int32(0))
100832  	_sqlite3ReleaseTempReg(tls, _pParse, _6_regRec)
100833  	_sqlite3ReleaseTempRange(tls, _pParse, _6_regTemp, _6_nCol)
100834  _9:
100835  _5:
100836  	if (((_pFKey.XisDeferred == 0) && ((((*Xsqlite3)(_pParse.Xdb).Xflags) & int32(33554432)) == 0)) && (_pParse.XpToplevel == nil)) && (_pParse.XisMultiWrite == 0) {
100837  		func() {
100838  			if _nIncr != int32(1) {
100839  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107849), unsafe.Pointer(&_fkLookupParentØ00__func__Ø000), unsafe.Pointer(str(117855)))
100840  				crt.X__builtin_abort(tls)
100841  			}
100842  		}()
100843  		_sqlite3HaltConstraint(tls, _pParse, int32(787), int32(2), nil, int8(-2), uint8(4))
100844  		goto _31
100845  	}
100846  	if (_nIncr > int32(0)) && (int32(_pFKey.XisDeferred) == int32(0)) {
100847  		_sqlite3MayAbort(tls, _pParse)
100848  	}
100849  	_sqlite3VdbeAddOp2(tls, _v, int32(147), int32(_pFKey.XisDeferred), _nIncr)
100850  _31:
100851  	_sqlite3VdbeResolveLabel(tls, _v, _iOk)
100852  	_sqlite3VdbeAddOp1(tls, _v, int32(114), _iCur)
100853  }
100854  
100855  var _fkLookupParentØ00__func__Ø000 [15]int8
100856  
100857  func init() {
100858  	crt.Xstrncpy(nil, &_fkLookupParentØ00__func__Ø000[0], str(117864), 15)
100859  }
100860  
100861  // C comment
100862  //  /*
100863  //  ** Return true if the parser passed as the first argument is being
100864  //  ** used to code a trigger that is really a "SET NULL" action belonging
100865  //  ** to trigger pFKey.
100866  //  */
100867  func _isSetNullAction(tls *crt.TLS, _pParse *XParse, _pFKey *XFKey) (r0 int32) {
100868  	var _1_p *XTrigger
100869  	var _pTop *XParse
100870  	_pTop = func() *XParse {
100871  		if _pParse.XpToplevel != nil {
100872  			return (*XParse)(_pParse.XpToplevel)
100873  		}
100874  		return _pParse
100875  	}()
100876  	if _pTop.XpTriggerPrg == nil {
100877  		goto _2
100878  	}
100879  	_1_p = (*XTrigger)((*XTriggerPrg)(_pTop.XpTriggerPrg).XpTrigger)
100880  	if ((_1_p == (*elem40((**XTrigger)(unsafe.Pointer(&_pFKey.XapTrigger)), 0))) && (int32(*elem15((*uint8)(unsafe.Pointer(&_pFKey.XaAction)), 0)) == int32(7))) || ((_1_p == (*elem40((**XTrigger)(unsafe.Pointer(&_pFKey.XapTrigger)), uintptr(1)))) && (int32(*elem15((*uint8)(unsafe.Pointer(&_pFKey.XaAction)), uintptr(1))) == int32(7))) {
100881  		return int32(1)
100882  	}
100883  _2:
100884  	return int32(0)
100885  }
100886  
100887  // C comment
100888  //  /*
100889  //  ** This function is called to generate code executed when a row is deleted
100890  //  ** from the parent table of foreign key constraint pFKey and, if pFKey is
100891  //  ** deferred, when a row is inserted into the same table. When generating
100892  //  ** code for an SQL UPDATE operation, this function may be called twice -
100893  //  ** once to "delete" the old row and once to "insert" the new row.
100894  //  **
100895  //  ** Parameter nIncr is passed -1 when inserting a row (as this may decrease
100896  //  ** the number of FK violations in the db) or +1 when deleting one (as this
100897  //  ** may increase the number of FK constraint problems).
100898  //  **
100899  //  ** The code generated by this function scans through the rows in the child
100900  //  ** table that correspond to the parent table row being deleted or inserted.
100901  //  ** For each child row found, one of the following actions is taken:
100902  //  **
100903  //  **   Operation | FK type   | Action taken
100904  //  **   --------------------------------------------------------------------------
100905  //  **   DELETE      immediate   Increment the "immediate constraint counter".
100906  //  **                           Or, if the ON (UPDATE|DELETE) action is RESTRICT,
100907  //  **                           throw a "FOREIGN KEY constraint failed" exception.
100908  //  **
100909  //  **   INSERT      immediate   Decrement the "immediate constraint counter".
100910  //  **
100911  //  **   DELETE      deferred    Increment the "deferred constraint counter".
100912  //  **                           Or, if the ON (UPDATE|DELETE) action is RESTRICT,
100913  //  **                           throw a "FOREIGN KEY constraint failed" exception.
100914  //  **
100915  //  **   INSERT      deferred    Decrement the "deferred constraint counter".
100916  //  **
100917  //  ** These operations are identified in the comment at the top of this file
100918  //  ** (fkey.c) as "I.2" and "D.2".
100919  //  */
100920  func _fkScanChildren(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _pTab *XTable, _pIdx *XIndex, _pFKey *XFKey, _aiCol *int32, _regData int32, _nIncr int32) {
100921  	var _2_iCol, _6_iCol int16
100922  	var _i, _iFkIfZero int32
100923  	var _2_zCol *int8
100924  	var _db *Xsqlite3
100925  	var _v *TVdbe
100926  	var _pWhere, _2_pLeft, _2_pRight, _2_pEq, _3_pNe, _3_pLeft, _3_pRight, _5_pEq, _5_pAll *XExpr
100927  	var _5_pPk *XIndex
100928  	var _sNameContext XNameContext
100929  	var _pWInfo *XWhereInfo
100930  	_db = (*Xsqlite3)(_pParse.Xdb)
100931  	_pWhere = nil
100932  	_iFkIfZero = int32(0)
100933  	_v = _sqlite3GetVdbe(tls, _pParse)
100934  	func() {
100935  		if _pIdx != nil && (*XTable)(_pIdx.XpTable) != _pTab {
100936  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107969), unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000), unsafe.Pointer(str(117879)))
100937  			crt.X__builtin_abort(tls)
100938  		}
100939  	}()
100940  	func() {
100941  		if _pIdx != nil && int32(_pIdx.XnKeyCol) != _pFKey.XnCol {
100942  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107970), unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000), unsafe.Pointer(str(117909)))
100943  			crt.X__builtin_abort(tls)
100944  		}
100945  	}()
100946  	func() {
100947  		if _pIdx == nil && _pFKey.XnCol != int32(1) {
100948  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107971), unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000), unsafe.Pointer(str(117947)))
100949  			crt.X__builtin_abort(tls)
100950  		}
100951  	}()
100952  	func() {
100953  		if _pIdx == nil && (_pTab.XtabFlags&uint32(32)) != (0) {
100954  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107972), unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000), unsafe.Pointer(str(117973)))
100955  			crt.X__builtin_abort(tls)
100956  		}
100957  	}()
100958  	if _nIncr < int32(0) {
100959  		_iFkIfZero = _sqlite3VdbeAddOp2(tls, _v, int32(45), int32(_pFKey.XisDeferred), int32(0))
100960  	}
100961  	_i = int32(0)
100962  _13:
100963  	if _i >= _pFKey.XnCol {
100964  		goto _16
100965  	}
100966  	_2_iCol = int16(func() int32 {
100967  		if _pIdx != nil {
100968  			return int32(*elem50(_pIdx.XaiColumn, uintptr(_i)))
100969  		}
100970  		return int32(-1)
100971  	}())
100972  	_2_pLeft = _exprTableRegister(tls, _pParse, _pTab, _regData, _2_iCol)
100973  	_2_iCol = int16(func() int32 {
100974  		if _aiCol != nil {
100975  			return (*elem8(_aiCol, uintptr(_i)))
100976  		}
100977  		return (elem116((*t117)(unsafe.Pointer(&_pFKey.XaCol)), 0).XiFrom)
100978  	}())
100979  	func() {
100980  		if int32(_2_iCol) < int32(0) {
100981  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107997), unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000), unsafe.Pointer(str(99210)))
100982  			crt.X__builtin_abort(tls)
100983  		}
100984  	}()
100985  	_2_zCol = elem41((*XColumn)((*XTable)(_pFKey.XpFrom).XaCol), uintptr(_2_iCol)).XzName
100986  	_2_pRight = _sqlite3Expr(tls, _db, int32(27), _2_zCol)
100987  	_2_pEq = _sqlite3PExpr(tls, _pParse, int32(78), _2_pLeft, _2_pRight)
100988  	_pWhere = _sqlite3ExprAnd(tls, _db, _pWhere, _2_pEq)
100989  	_i += 1
100990  	goto _13
100991  _16:
100992  	if _pTab != (*XTable)(_pFKey.XpFrom) || _nIncr <= int32(0) {
100993  		goto _24
100994  	}
100995  	if (_pTab.XtabFlags & uint32(32)) == (0) {
100996  		_3_pLeft = _exprTableRegister(tls, _pParse, _pTab, _regData, int16(-1))
100997  		_3_pRight = _exprTableColumn(tls, _db, _pTab, elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), 0).XiCursor, int16(-1))
100998  		_3_pNe = _sqlite3PExpr(tls, _pParse, int32(77), _3_pLeft, _3_pRight)
100999  		goto _26
101000  	}
101001  	_5_pAll = nil
101002  	_5_pPk = _sqlite3PrimaryKeyIndex(tls, _pTab)
101003  	func() {
101004  		if _pIdx == nil {
101005  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108026), unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000), unsafe.Pointer(str(42024)))
101006  			crt.X__builtin_abort(tls)
101007  		}
101008  	}()
101009  	_i = int32(0)
101010  _29:
101011  	if _i >= int32(_5_pPk.XnKeyCol) {
101012  		goto _32
101013  	}
101014  	_6_iCol = *elem50(_pIdx.XaiColumn, uintptr(_i))
101015  	func() {
101016  		if int32(_6_iCol) < int32(0) {
101017  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108029), unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000), unsafe.Pointer(str(99210)))
101018  			crt.X__builtin_abort(tls)
101019  		}
101020  	}()
101021  	_3_pLeft = _exprTableRegister(tls, _pParse, _pTab, _regData, _6_iCol)
101022  	_3_pRight = _exprTableColumn(tls, _db, _pTab, elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), 0).XiCursor, _6_iCol)
101023  	_5_pEq = _sqlite3PExpr(tls, _pParse, int32(78), _3_pLeft, _3_pRight)
101024  	_5_pAll = _sqlite3ExprAnd(tls, _db, _5_pAll, _5_pEq)
101025  	_i += 1
101026  	goto _29
101027  _32:
101028  	_3_pNe = _sqlite3PExpr(tls, _pParse, int32(19), _5_pAll, nil)
101029  _26:
101030  	_pWhere = _sqlite3ExprAnd(tls, _db, _pWhere, _3_pNe)
101031  _24:
101032  	crt.Xmemset(tls, unsafe.Pointer(&_sNameContext), int32(0), uint32(32))
101033  	*(**XSrcList)(unsafe.Pointer(&_sNameContext.XpSrcList)) = _pSrc
101034  	*(**XParse)(unsafe.Pointer(&_sNameContext.XpParse)) = _pParse
101035  	_sqlite3ResolveExprNames(tls, &_sNameContext, _pWhere)
101036  	_pWInfo = _sqlite3WhereBegin(tls, _pParse, _pSrc, _pWhere, nil, nil, 0, int32(0))
101037  	_sqlite3VdbeAddOp2(tls, _v, int32(147), int32(_pFKey.XisDeferred), _nIncr)
101038  	if _pWInfo != nil {
101039  		_sqlite3WhereEnd(tls, _pWInfo)
101040  	}
101041  	_sqlite3ExprDelete(tls, _db, _pWhere)
101042  	if _iFkIfZero != 0 {
101043  		_sqlite3VdbeJumpHere(tls, _v, _iFkIfZero)
101044  	}
101045  }
101046  
101047  var _fkScanChildrenØ00__func__Ø000 [15]int8
101048  
101049  func init() {
101050  	crt.Xstrncpy(nil, &_fkScanChildrenØ00__func__Ø000[0], str(117999), 15)
101051  }
101052  
101053  // C comment
101054  //  /*
101055  //  ** Return an Expr object that refers to a memory register corresponding
101056  //  ** to column iCol of table pTab.
101057  //  **
101058  //  ** regBase is the first of an array of register that contains the data
101059  //  ** for pTab.  regBase itself holds the rowid.  regBase+1 holds the first
101060  //  ** column.  regBase+2 holds the second column, and so forth.
101061  //  */
101062  func _exprTableRegister(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _regBase int32, _iCol int16) (r0 *XExpr) {
101063  	var _zColl *int8
101064  	var _db *Xsqlite3
101065  	var _pExpr *XExpr
101066  	var _pCol *XColumn
101067  	_db = (*Xsqlite3)(_pParse.Xdb)
101068  	_pExpr = _sqlite3Expr(tls, _db, int32(157), nil)
101069  	if _pExpr == nil {
101070  		goto _0
101071  	}
101072  	if int32(_iCol) < int32(0) || int32(_iCol) == int32(_pTab.XiPKey) {
101073  		goto _2
101074  	}
101075  	_pCol = elem41((*XColumn)(_pTab.XaCol), uintptr(_iCol))
101076  	_pExpr.XiTable = (_regBase + int32(_iCol)) + int32(1)
101077  	_pExpr.Xaffinity = _pCol.Xaffinity
101078  	_zColl = _pCol.XzColl
101079  	if _zColl == nil {
101080  		_zColl = (*XCollSeq)(_db.XpDfltColl).XzName
101081  	}
101082  	_pExpr = _sqlite3ExprAddCollateString(tls, _pParse, _pExpr, _zColl)
101083  	goto _4
101084  _2:
101085  	_pExpr.XiTable = _regBase
101086  	_pExpr.Xaffinity = int8(68)
101087  _4:
101088  _0:
101089  	return _pExpr
101090  }
101091  
101092  // C comment
101093  //  /*
101094  //  ** Return an Expr object that refers to column iCol of table pTab which
101095  //  ** has cursor iCur.
101096  //  */
101097  func _exprTableColumn(tls *crt.TLS, _db *Xsqlite3, _pTab *XTable, _iCursor int32, _iCol int16) (r0 *XExpr) {
101098  	var _pExpr *XExpr
101099  	_pExpr = _sqlite3Expr(tls, _db, int32(152), nil)
101100  	if _pExpr != nil {
101101  		*(**XTable)(unsafe.Pointer(&_pExpr.XpTab)) = _pTab
101102  		_pExpr.XiTable = _iCursor
101103  		_pExpr.XiColumn = _iCol
101104  	}
101105  	return _pExpr
101106  }
101107  
101108  // C comment
101109  //  /*
101110  //  ** This routine generates code to finish the INSERT or UPDATE operation
101111  //  ** that was started by a prior call to sqlite3GenerateConstraintChecks.
101112  //  ** A consecutive range of registers starting at regNewData contains the
101113  //  ** rowid and the content to be inserted.
101114  //  **
101115  //  ** The arguments to this routine should be the same as the first six
101116  //  ** arguments to sqlite3GenerateConstraintChecks.
101117  //  */
101118  func _sqlite3CompleteInsertion(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _iDataCur int32, _iIdxCur int32, _regNewData int32, _aRegIdx *int32, _update_flags int32, _appendBias int32, _useSeekResult int32) {
101119  	var _regData, _regRec, _i int32
101120  	var _pik_flags, _bAffinityDone uint8
101121  	var _v *TVdbe
101122  	var _pIdx *XIndex
101123  	_bAffinityDone = uint8(0)
101124  	func() {
101125  		if _update_flags != int32(0) && _update_flags != int32(4) && _update_flags != int32(6) {
101126  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110559), unsafe.Pointer(&_sqlite3CompleteInsertionØ00__func__Ø000), unsafe.Pointer(str(118014)))
101127  			crt.X__builtin_abort(tls)
101128  		}
101129  	}()
101130  	_v = _sqlite3GetVdbe(tls, _pParse)
101131  	func() {
101132  		if _v == nil {
101133  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110565), unsafe.Pointer(&_sqlite3CompleteInsertionØ00__func__Ø000), unsafe.Pointer(str(42019)))
101134  			crt.X__builtin_abort(tls)
101135  		}
101136  	}()
101137  	func() {
101138  		if (*XSelect)(_pTab.XpSelect) != nil {
101139  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110566), unsafe.Pointer(&_sqlite3CompleteInsertionØ00__func__Ø000), unsafe.Pointer(str(102296)))
101140  			crt.X__builtin_abort(tls)
101141  		}
101142  	}()
101143  	*func() **XIndex { _i = int32(0); return &_pIdx }() = (*XIndex)(_pTab.XpIndex)
101144  _8:
101145  	if _pIdx == nil {
101146  		goto _11
101147  	}
101148  	if (*elem8(_aRegIdx, uintptr(_i))) == int32(0) {
101149  		goto _9
101150  	}
101151  	_bAffinityDone = uint8(1)
101152  	if _pIdx.XpPartIdxWhere != nil {
101153  		_sqlite3VdbeAddOp2(tls, _v, int32(75), *elem8(_aRegIdx, uintptr(_i)), _sqlite3VdbeCurrentAddr(tls, _v)+int32(2))
101154  	}
101155  	_pik_flags = uint8(func() int32 {
101156  		if _useSeekResult != 0 {
101157  			return int32(16)
101158  		}
101159  		return int32(0)
101160  	}())
101161  	if (int32((uint32(_pIdx.XidxType)<<30)>>30) == int32(2)) && ((_pTab.XtabFlags & uint32(32)) != (0)) {
101162  		func() {
101163  			if int32(_pParse.Xnested) != int32(0) {
101164  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110576), unsafe.Pointer(&_sqlite3CompleteInsertionØ00__func__Ø000), unsafe.Pointer(str(118118)))
101165  				crt.X__builtin_abort(tls)
101166  			}
101167  		}()
101168  		{
101169  			p := &_pik_flags
101170  			*p = uint8(int32(*p) | int32(1))
101171  		}
101172  		{
101173  			p := &_pik_flags
101174  			*p = uint8(int32(*p) | (_update_flags & int32(2)))
101175  		}
101176  	}
101177  	_sqlite3VdbeAddOp4Int(tls, _v, int32(128), _iIdxCur+_i, *elem8(_aRegIdx, uintptr(_i)), (*elem8(_aRegIdx, uintptr(_i)))+int32(1), int32(func() uint16 {
101178  		if ((uint32(_pIdx.XidxType>>3) << 31) >> 31) != 0 {
101179  			return _pIdx.XnKeyCol
101180  		}
101181  		return _pIdx.XnColumn
101182  	}()))
101183  	_sqlite3VdbeChangeP5(tls, _v, uint16(_pik_flags))
101184  _9:
101185  	*func() *int32 { _pIdx = (*XIndex)(_pIdx.XpNext); return &_i }() += 1
101186  	goto _8
101187  _11:
101188  	if (_pTab.XtabFlags & uint32(32)) != (0) {
101189  		return
101190  	}
101191  	_regData = _regNewData + int32(1)
101192  	_regRec = _sqlite3GetTempReg(tls, _pParse)
101193  	_sqlite3VdbeAddOp3(tls, _v, int32(101), _regData, int32(_pTab.XnCol), _regRec)
101194  	if _bAffinityDone == 0 {
101195  		_sqlite3TableAffinity(tls, _v, _pTab, int32(0))
101196  		_sqlite3ExprCacheAffinityChange(tls, _pParse, _regData, int32(_pTab.XnCol))
101197  	}
101198  	if _pParse.Xnested != 0 {
101199  		_pik_flags = 0
101200  		goto _25
101201  	}
101202  	_pik_flags = uint8(1)
101203  	{
101204  		p := &_pik_flags
101205  		*p = uint8(int32(*p) | func() int32 {
101206  			if _update_flags != 0 {
101207  				return _update_flags
101208  			}
101209  			return int32(32)
101210  		}())
101211  	}
101212  _25:
101213  	if _appendBias != 0 {
101214  		{
101215  			p := &_pik_flags
101216  			*p = uint8(int32(*p) | int32(8))
101217  		}
101218  	}
101219  	if _useSeekResult != 0 {
101220  		{
101221  			p := &_pik_flags
101222  			*p = uint8(int32(*p) | int32(16))
101223  		}
101224  	}
101225  	_sqlite3VdbeAddOp3(tls, _v, int32(118), _iDataCur, _regRec, _regNewData)
101226  	if _pParse.Xnested == 0 {
101227  		_sqlite3VdbeAppendP4(tls, _v, unsafe.Pointer(_pTab), int32(-15))
101228  	}
101229  	_sqlite3VdbeChangeP5(tls, _v, uint16(_pik_flags))
101230  }
101231  
101232  var _sqlite3CompleteInsertionØ00__func__Ø000 [25]int8
101233  
101234  func init() {
101235  	crt.Xstrncpy(nil, &_sqlite3CompleteInsertionØ00__func__Ø000[0], str(118136), 25)
101236  }
101237  
101238  // C comment
101239  //  /*
101240  //  ** This function is called when deleting or updating a row to implement
101241  //  ** any required CASCADE, SET NULL or SET DEFAULT actions.
101242  //  */
101243  func _sqlite3FkActions(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pChanges *XExprList, _regOld int32, _aChange *int32, _bChngRowid int32) {
101244  	var _3_pAct *XTrigger
101245  	var _1_pFKey *XFKey
101246  	if (((*Xsqlite3)(_pParse.Xdb).Xflags) & int32(524288)) == 0 {
101247  		goto _0
101248  	}
101249  	_1_pFKey = _sqlite3FkReferences(tls, _pTab)
101250  _1:
101251  	if _1_pFKey == nil {
101252  		goto _4
101253  	}
101254  	if _aChange != nil && _fkParentIsModified(tls, _pTab, _1_pFKey, _aChange, _bChngRowid) == 0 {
101255  		goto _6
101256  	}
101257  	_3_pAct = _fkActionTrigger(tls, _pParse, _pTab, _1_pFKey, _pChanges)
101258  	if _3_pAct != nil {
101259  		_sqlite3CodeRowTriggerDirect(tls, _pParse, _3_pAct, _pTab, _regOld, int32(2), int32(0))
101260  	}
101261  _6:
101262  	_1_pFKey = (*XFKey)(_1_pFKey.XpNextTo)
101263  	goto _1
101264  _4:
101265  _0:
101266  }
101267  
101268  // C comment
101269  //  /*
101270  //  ** This function is called when an UPDATE or DELETE operation is being
101271  //  ** compiled on table pTab, which is the parent table of foreign-key pFKey.
101272  //  ** If the current operation is an UPDATE, then the pChanges parameter is
101273  //  ** passed a pointer to the list of columns being modified. If it is a
101274  //  ** DELETE, pChanges is passed a NULL pointer.
101275  //  **
101276  //  ** It returns a pointer to a Trigger structure containing a trigger
101277  //  ** equivalent to the ON UPDATE or ON DELETE action specified by pFKey.
101278  //  ** If the action is "NO ACTION" or "RESTRICT", then a NULL pointer is
101279  //  ** returned (these actions require no special handling by the triggers
101280  //  ** sub-system, code for them is created by fkScanChildren()).
101281  //  **
101282  //  ** For example, if pFKey is the foreign key and pTab is table "p" in
101283  //  ** the following schema:
101284  //  **
101285  //  **   CREATE TABLE p(pk PRIMARY KEY);
101286  //  **   CREATE TABLE c(ck REFERENCES p ON DELETE CASCADE);
101287  //  **
101288  //  ** then the returned trigger structure is equivalent to:
101289  //  **
101290  //  **   CREATE TRIGGER ... DELETE ON p BEGIN
101291  //  **     DELETE FROM c WHERE ck = old.pk;
101292  //  **   END;
101293  //  **
101294  //  ** The returned pointer is cached as part of the foreign key object. It
101295  //  ** is eventually freed along with the rest of the foreign key object by
101296  //  ** sqlite3FkDelete().
101297  //  */
101298  func _fkActionTrigger(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pFKey *XFKey, _pChanges *XExprList) (r0 *XTrigger) {
101299  	var _action, _iAction, _2_nFrom, _2_i, _3_iFromCol int32
101300  	var _2_aiCol *int32
101301  	var _2_zFrom *int8
101302  	var _3_tOld, _3_tNew, _3_tFromCol, _3_tToCol, _11_tFrom XToken
101303  	var _db *Xsqlite3
101304  	var _pTrigger *XTrigger
101305  	var _2_pList *XExprList
101306  	var _2_pSelect *XSelect
101307  	var _2_pWhere, _2_pWhen, _3_pEq, _5_pNew, _7_pDflt, _11_pRaise *XExpr
101308  	var _2_pIdx *XIndex
101309  	var _2_pStep *XTriggerStep
101310  	_db = (*Xsqlite3)(_pParse.Xdb)
101311  	_iAction = bool2int(_pChanges != nil)
101312  	_action = int32(*elem15((*uint8)(unsafe.Pointer(&_pFKey.XaAction)), uintptr(_iAction)))
101313  	if (_action == int32(6)) && (_db.Xflags&int32(33554432)) != 0 {
101314  		return nil
101315  	}
101316  	_pTrigger = *elem40((**XTrigger)(unsafe.Pointer(&_pFKey.XapTrigger)), uintptr(_iAction))
101317  	if _action == int32(0) || _pTrigger != nil {
101318  		goto _3
101319  	}
101320  	_2_pIdx = nil
101321  	_2_aiCol = nil
101322  	_2_pStep = nil
101323  	_2_pWhere = nil
101324  	_2_pList = nil
101325  	_2_pSelect = nil
101326  	_2_pWhen = nil
101327  	if _sqlite3FkLocateIndex(tls, _pParse, _pTab, _pFKey, &_2_pIdx, &_2_aiCol) != 0 {
101328  		return nil
101329  	}
101330  	func() {
101331  		if _2_aiCol == nil && _pFKey.XnCol != int32(1) {
101332  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108611), unsafe.Pointer(&_fkActionTriggerØ00__func__Ø000), unsafe.Pointer(str(117794)))
101333  			crt.X__builtin_abort(tls)
101334  		}
101335  	}()
101336  	_2_i = int32(0)
101337  _8:
101338  	if _2_i >= _pFKey.XnCol {
101339  		goto _11
101340  	}
101341  	_3_tOld = XToken{}
101342  	_3_tOld.Xz = str(43132)
101343  	_3_tOld.Xn = uint32(3)
101344  	_3_tNew = XToken{}
101345  	_3_tNew.Xz = str(43128)
101346  	_3_tNew.Xn = uint32(3)
101347  	_3_iFromCol = func() int32 {
101348  		if _2_aiCol != nil {
101349  			return (*elem8(_2_aiCol, uintptr(_2_i)))
101350  		}
101351  		return (elem116((*t117)(unsafe.Pointer(&_pFKey.XaCol)), 0).XiFrom)
101352  	}()
101353  	func() {
101354  		if _3_iFromCol < int32(0) {
101355  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108622), unsafe.Pointer(&_fkActionTriggerØ00__func__Ø000), unsafe.Pointer(str(118161)))
101356  			crt.X__builtin_abort(tls)
101357  		}
101358  	}()
101359  	func() {
101360  		if _2_pIdx == nil && (int32(_pTab.XiPKey) < int32(0) || int32(_pTab.XiPKey) >= int32(_pTab.XnCol)) {
101361  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108623), unsafe.Pointer(&_fkActionTriggerØ00__func__Ø000), unsafe.Pointer(str(118173)))
101362  			crt.X__builtin_abort(tls)
101363  		}
101364  	}()
101365  	func() {
101366  		if _2_pIdx != nil && int32(*elem50(_2_pIdx.XaiColumn, uintptr(_2_i))) < int32(0) {
101367  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108624), unsafe.Pointer(&_fkActionTriggerØ00__func__Ø000), unsafe.Pointer(str(117739)))
101368  			crt.X__builtin_abort(tls)
101369  		}
101370  	}()
101371  	_sqlite3TokenInit(tls, &_3_tToCol, elem41((*XColumn)(_pTab.XaCol), uintptr(func() int16 {
101372  		if _2_pIdx != nil {
101373  			return (*elem50(_2_pIdx.XaiColumn, uintptr(_2_i)))
101374  		}
101375  		return _pTab.XiPKey
101376  	}())).XzName)
101377  	_sqlite3TokenInit(tls, &_3_tFromCol, elem41((*XColumn)((*XTable)(_pFKey.XpFrom).XaCol), uintptr(_3_iFromCol)).XzName)
101378  	_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)))
101379  	_2_pWhere = _sqlite3ExprAnd(tls, _db, _2_pWhere, _3_pEq)
101380  	if _pChanges != nil {
101381  		_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))))
101382  		_2_pWhen = _sqlite3ExprAnd(tls, _db, _2_pWhen, _3_pEq)
101383  	}
101384  	if _action == int32(6) || _action == int32(9) && _pChanges == nil {
101385  		goto _28
101386  	}
101387  	if _action == int32(9) {
101388  		_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)))
101389  		goto _34
101390  	}
101391  	if _action != int32(8) {
101392  		goto _31
101393  	}
101394  	_7_pDflt = (*XExpr)(elem41((*XColumn)((*XTable)(_pFKey.XpFrom).XaCol), uintptr(_3_iFromCol)).XpDflt)
101395  	if _7_pDflt != nil {
101396  		_5_pNew = _sqlite3ExprDup(tls, _db, _7_pDflt, int32(0))
101397  		goto _33
101398  	}
101399  	_5_pNew = _sqlite3ExprAlloc(tls, _db, int32(101), nil, int32(0))
101400  _33:
101401  	goto _34
101402  _31:
101403  	_5_pNew = _sqlite3ExprAlloc(tls, _db, int32(101), nil, int32(0))
101404  _34:
101405  	_2_pList = _sqlite3ExprListAppend(tls, _pParse, _2_pList, _5_pNew)
101406  	_sqlite3ExprListSetName(tls, _pParse, _2_pList, &_3_tFromCol, int32(0))
101407  _28:
101408  	_2_i += 1
101409  	goto _8
101410  _11:
101411  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_2_aiCol))
101412  	_2_zFrom = (*XTable)(_pFKey.XpFrom).XzName
101413  	_2_nFrom = _sqlite3Strlen30(tls, _2_zFrom)
101414  	if _action != int32(6) {
101415  		goto _35
101416  	}
101417  	_11_tFrom.Xz = _2_zFrom
101418  	_11_tFrom.Xn = uint32(_2_nFrom)
101419  	_11_pRaise = _sqlite3Expr(tls, _db, int32(56), str(58210))
101420  	if _11_pRaise != nil {
101421  		_11_pRaise.Xaffinity = int8(2)
101422  	}
101423  	_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)
101424  	_2_pWhere = nil
101425  _35:
101426  	_db.Xlookaside.XbDisable += 1
101427  	_pTrigger = (*XTrigger)(_sqlite3DbMallocZero(tls, _db, uint64((uint32(72)+uint32(_2_nFrom))+uint32(1))))
101428  	if _pTrigger == nil {
101429  		goto _37
101430  	}
101431  	_2_pStep = store120((**XTriggerStep)(unsafe.Pointer(&_pTrigger.Xstep_list)), (*XTriggerStep)(unsafe.Pointer(elem121(_pTrigger, uintptr(1)))))
101432  	_2_pStep.XzTarget = (*int8)(unsafe.Pointer(elem120(_2_pStep, uintptr(1))))
101433  	crt.Xmemcpy(tls, unsafe.Pointer(_2_pStep.XzTarget), unsafe.Pointer(_2_zFrom), uint32(_2_nFrom))
101434  	*(**XExpr)(unsafe.Pointer(&_2_pStep.XpWhere)) = _sqlite3ExprDup(tls, _db, _2_pWhere, int32(1))
101435  	*(**XExprList)(unsafe.Pointer(&_2_pStep.XpExprList)) = _sqlite3ExprListDup(tls, _db, _2_pList, int32(1))
101436  	*(**XSelect)(unsafe.Pointer(&_2_pStep.XpSelect)) = _sqlite3SelectDup(tls, _db, _2_pSelect, int32(1))
101437  	if _2_pWhen != nil {
101438  		_2_pWhen = _sqlite3PExpr(tls, _pParse, int32(19), _2_pWhen, nil)
101439  		*(**XExpr)(unsafe.Pointer(&_pTrigger.XpWhen)) = _sqlite3ExprDup(tls, _db, _2_pWhen, int32(1))
101440  	}
101441  _37:
101442  	_db.Xlookaside.XbDisable -= 1
101443  	_sqlite3ExprDelete(tls, _db, _2_pWhere)
101444  	_sqlite3ExprDelete(tls, _db, _2_pWhen)
101445  	_sqlite3ExprListDelete(tls, _db, _2_pList)
101446  	_sqlite3SelectDelete(tls, _db, _2_pSelect)
101447  	if int32(_db.XmallocFailed) == int32(1) {
101448  		_fkTriggerDelete(tls, _db, _pTrigger)
101449  		return nil
101450  	}
101451  	func() {
101452  		if _2_pStep == nil {
101453  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(108735), unsafe.Pointer(&_fkActionTriggerØ00__func__Ø000), unsafe.Pointer(str(118227)))
101454  			crt.X__builtin_abort(tls)
101455  		}
101456  	}()
101457  	switch _action {
101458  	case int32(6):
101459  		goto _43
101460  	case int32(9):
101461  		goto _44
101462  	default:
101463  		goto _47
101464  	}
101465  
101466  _43:
101467  	_2_pStep.Xop = uint8(119)
101468  	goto _46
101469  _44:
101470  	if _pChanges == nil {
101471  		_2_pStep.Xop = uint8(109)
101472  		goto _46
101473  	}
101474  _47:
101475  	_2_pStep.Xop = uint8(110)
101476  _46:
101477  	*(**XTrigger)(unsafe.Pointer(&_2_pStep.XpTrig)) = _pTrigger
101478  	*(**XSchema)(unsafe.Pointer(&_pTrigger.XpSchema)) = (*XSchema)(_pTab.XpSchema)
101479  	*(**XSchema)(unsafe.Pointer(&_pTrigger.XpTabSchema)) = (*XSchema)(_pTab.XpSchema)
101480  	*elem40((**XTrigger)(unsafe.Pointer(&_pFKey.XapTrigger)), uintptr(_iAction)) = _pTrigger
101481  	_pTrigger.Xop = uint8(func() int32 {
101482  		if _pChanges != nil {
101483  			return int32(110)
101484  		}
101485  		return int32(109)
101486  	}())
101487  _3:
101488  	return _pTrigger
101489  }
101490  
101491  var _fkActionTriggerØ00__func__Ø000 [16]int8
101492  
101493  func init() {
101494  	crt.Xstrncpy(nil, &_fkActionTriggerØ00__func__Ø000[0], str(118236), 16)
101495  }
101496  
101497  func _sqlite3AutoincrementEnd(tls *crt.TLS, _pParse *XParse) {
101498  	if _pParse.XpAinc != nil {
101499  		_autoIncrementEnd(tls, _pParse)
101500  	}
101501  }
101502  
101503  // C comment
101504  //  /*
101505  //  ** This routine generates the code needed to write autoincrement
101506  //  ** maximum rowid values back into the sqlite_sequence register.
101507  //  ** Every statement that might do an INSERT into an autoincrement
101508  //  ** table (either directly or through triggers) needs to call this
101509  //  ** routine just before the "exit" code.
101510  //  */
101511  func _autoIncrementEnd(tls *crt.TLS, _pParse *XParse) {
101512  	var _1_iRec, _1_memId int32
101513  	var _db *Xsqlite3
101514  	var _1_pDb *XDb
101515  	var _v *TVdbe
101516  	var _1_aOp *XVdbeOp
101517  	var _p *XAutoincInfo
101518  	_v = (*TVdbe)(_pParse.XpVdbe)
101519  	_db = (*Xsqlite3)(_pParse.Xdb)
101520  	func() {
101521  		if _v == nil {
101522  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109164), unsafe.Pointer(&_autoIncrementEndØ00__func__Ø000), unsafe.Pointer(str(41816)))
101523  			crt.X__builtin_abort(tls)
101524  		}
101525  	}()
101526  	_p = (*XAutoincInfo)(_pParse.XpAinc)
101527  _2:
101528  	if _p == nil {
101529  		goto _5
101530  	}
101531  	_1_pDb = elem27((*XDb)(_db.XaDb), uintptr(_p.XiDb))
101532  	_1_memId = _p.XregCtr
101533  	_1_iRec = _sqlite3GetTempReg(tls, _pParse)
101534  	func() {
101535  		if _sqlite3SchemaMutexHeld(tls, _db, int32(0), (*XSchema)(_1_pDb.XpSchema)) == 0 {
101536  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109180), unsafe.Pointer(&_autoIncrementEndØ00__func__Ø000), unsafe.Pointer(str(41818)))
101537  			crt.X__builtin_abort(tls)
101538  		}
101539  	}()
101540  	_sqlite3OpenTable(tls, _pParse, int32(0), _p.XiDb, (*XTable)((*XSchema)(_1_pDb.XpSchema).XpSeqTab), int32(107))
101541  	_1_aOp = _sqlite3VdbeAddOpList(tls, _v, int32(5), (*XVdbeOpList)(unsafe.Pointer(&_autoIncrementEndØ00autoIncEndØ002)), _autoIncrementEndØ00iLnØ001)
101542  	if _1_aOp == nil {
101543  		goto _5
101544  	}
101545  	elem61(_1_aOp, 0).Xp1 = _1_memId + int32(1)
101546  	elem61(_1_aOp, uintptr(1)).Xp2 = _1_memId + int32(1)
101547  	elem61(_1_aOp, uintptr(2)).Xp1 = _1_memId - int32(1)
101548  	elem61(_1_aOp, uintptr(2)).Xp3 = _1_iRec
101549  	elem61(_1_aOp, uintptr(3)).Xp2 = _1_iRec
101550  	elem61(_1_aOp, uintptr(3)).Xp3 = _1_memId + int32(1)
101551  	elem61(_1_aOp, uintptr(3)).Xp5 = uint16(8)
101552  	_sqlite3ReleaseTempReg(tls, _pParse, _1_iRec)
101553  	_p = (*XAutoincInfo)(_p.XpNext)
101554  	goto _2
101555  _5:
101556  }
101557  
101558  var _autoIncrementEndØ00__func__Ø000 [17]int8
101559  
101560  func init() {
101561  	crt.Xstrncpy(nil, &_autoIncrementEndØ00__func__Ø000[0], str(118252), 17)
101562  }
101563  
101564  var _autoIncrementEndØ00autoIncEndØ002 [5]XVdbeOpList
101565  
101566  func init() {
101567  	_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)}}
101568  }
101569  
101570  var _autoIncrementEndØ00iLnØ001 int32
101571  
101572  // C comment
101573  //  /*
101574  //  ** Pop an authorization context that was previously pushed
101575  //  ** by sqlite3AuthContextPush
101576  //  */
101577  func _sqlite3AuthContextPop(tls *crt.TLS, _pContext *XAuthContext) {
101578  	if _pContext.XpParse != nil {
101579  		(*XParse)(_pContext.XpParse).XzAuthContext = _pContext.XzAuthContext
101580  		*(**XParse)(unsafe.Pointer(&_pContext.XpParse)) = nil
101581  	}
101582  }
101583  
101584  // C comment
101585  //  /*
101586  //  ** Convert the pStep->zTarget string into a SrcList and return a pointer
101587  //  ** to that SrcList.
101588  //  **
101589  //  ** This routine adds a specific database name, if needed, to the target when
101590  //  ** forming the SrcList.  This prevents a trigger in one database from
101591  //  ** referring to a target in another database.  An exception is when the
101592  //  ** trigger is in TEMP in which case it can refer to any other database it
101593  //  ** wants.
101594  //  */
101595  func _targetSrcList(tls *crt.TLS, _pParse *XParse, _pStep *XTriggerStep) (r0 *XSrcList) {
101596  	var _iDb int32
101597  	var _2_zDb *int8
101598  	var _db *Xsqlite3
101599  	var _pSrc *XSrcList
101600  	_db = (*Xsqlite3)(_pParse.Xdb)
101601  	_pSrc = _sqlite3SrcListAppend(tls, _db, nil, nil, nil)
101602  	if _pSrc == nil {
101603  		goto _0
101604  	}
101605  	func() {
101606  		if _pSrc.XnSrc <= int32(0) {
101607  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123305), unsafe.Pointer(&_targetSrcListØ00__func__Ø000), unsafe.Pointer(str(118269)))
101608  			crt.X__builtin_abort(tls)
101609  		}
101610  	}()
101611  	elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_pSrc.XnSrc-int32(1))).XzName = _sqlite3DbStrDup(tls, _db, _pStep.XzTarget)
101612  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)((*XTrigger)(_pStep.XpTrig).XpSchema))
101613  	if (_iDb == int32(0)) || (_iDb >= int32(2)) {
101614  		func() {
101615  			if _iDb >= _db.XnDb {
101616  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123310), unsafe.Pointer(&_targetSrcListØ00__func__Ø000), unsafe.Pointer(str(54304)))
101617  				crt.X__builtin_abort(tls)
101618  			}
101619  		}()
101620  		_2_zDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
101621  		elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), uintptr(_pSrc.XnSrc-int32(1))).XzDatabase = _sqlite3DbStrDup(tls, _db, _2_zDb)
101622  	}
101623  _0:
101624  	return _pSrc
101625  }
101626  
101627  var _targetSrcListØ00__func__Ø000 [14]int8
101628  
101629  func init() {
101630  	crt.Xstrncpy(nil, &_targetSrcListØ00__func__Ø000[0], str(118282), 14)
101631  }
101632  
101633  // C comment
101634  //  /*
101635  //  ** This routine is called to handle SQL of the following forms:
101636  //  **
101637  //  **    insert into TABLE (IDLIST) values(EXPRLIST),(EXPRLIST),...
101638  //  **    insert into TABLE (IDLIST) select
101639  //  **    insert into TABLE (IDLIST) default values
101640  //  **
101641  //  ** The IDLIST following the table name is always optional.  If omitted,
101642  //  ** then a list of all (non-hidden) columns for the table is substituted.
101643  //  ** The IDLIST appears in the pColumn parameter.  pColumn is NULL if IDLIST
101644  //  ** is omitted.
101645  //  **
101646  //  ** For the pSelect parameter holds the values to be inserted for the
101647  //  ** first two forms shown above.  A VALUES clause is really just short-hand
101648  //  ** for a SELECT statement that omits the FROM clause and everything else
101649  //  ** that follows.  If the pSelect parameter is NULL, that means that the
101650  //  ** DEFAULT VALUES form of the INSERT statement is intended.
101651  //  **
101652  //  ** The code generated follows one of four templates.  For a simple
101653  //  ** insert with data coming from a single-row VALUES clause, the code executes
101654  //  ** once straight down through.  Pseudo-code follows (we call this
101655  //  ** the "1st template"):
101656  //  **
101657  //  **         open write cursor to <table> and its indices
101658  //  **         put VALUES clause expressions into registers
101659  //  **         write the resulting record into <table>
101660  //  **         cleanup
101661  //  **
101662  //  ** The three remaining templates assume the statement is of the form
101663  //  **
101664  //  **   INSERT INTO <table> SELECT ...
101665  //  **
101666  //  ** If the SELECT clause is of the restricted form "SELECT * FROM <table2>" -
101667  //  ** in other words if the SELECT pulls all columns from a single table
101668  //  ** and there is no WHERE or LIMIT or GROUP BY or ORDER BY clauses, and
101669  //  ** if <table2> and <table1> are distinct tables but have identical
101670  //  ** schemas, including all the same indices, then a special optimization
101671  //  ** is invoked that copies raw records from <table2> over to <table1>.
101672  //  ** See the xferOptimization() function for the implementation of this
101673  //  ** template.  This is the 2nd template.
101674  //  **
101675  //  **         open a write cursor to <table>
101676  //  **         open read cursor on <table2>
101677  //  **         transfer all records in <table2> over to <table>
101678  //  **         close cursors
101679  //  **         foreach index on <table>
101680  //  **           open a write cursor on the <table> index
101681  //  **           open a read cursor on the corresponding <table2> index
101682  //  **           transfer all records from the read to the write cursors
101683  //  **           close cursors
101684  //  **         end foreach
101685  //  **
101686  //  ** The 3rd template is for when the second template does not apply
101687  //  ** and the SELECT clause does not read from <table> at any time.
101688  //  ** The generated code follows this template:
101689  //  **
101690  //  **         X <- A
101691  //  **         goto B
101692  //  **      A: setup for the SELECT
101693  //  **         loop over the rows in the SELECT
101694  //  **           load values into registers R..R+n
101695  //  **           yield X
101696  //  **         end loop
101697  //  **         cleanup after the SELECT
101698  //  **         end-coroutine X
101699  //  **      B: open write cursor to <table> and its indices
101700  //  **      C: yield X, at EOF goto D
101701  //  **         insert the select result into <table> from R..R+n
101702  //  **         goto C
101703  //  **      D: cleanup
101704  //  **
101705  //  ** The 4th template is used if the insert statement takes its
101706  //  ** values from a SELECT but the data is being inserted into a table
101707  //  ** that is also read as part of the SELECT.  In the third form,
101708  //  ** we have to use an intermediate table to store the results of
101709  //  ** the select.  The template is like this:
101710  //  **
101711  //  **         X <- A
101712  //  **         goto B
101713  //  **      A: setup for the SELECT
101714  //  **         loop over the tables in the SELECT
101715  //  **           load value into register R..R+n
101716  //  **           yield X
101717  //  **         end loop
101718  //  **         cleanup after the SELECT
101719  //  **         end co-routine R
101720  //  **      B: open temp table
101721  //  **      L: yield X, at EOF goto M
101722  //  **         insert row from R..R+n into temp table
101723  //  **         goto L
101724  //  **      M: open write cursor to <table> and its indices
101725  //  **         rewind temp table
101726  //  **      C: loop over rows of intermediate table
101727  //  **           transfer values form intermediate table into <table>
101728  //  **         end loop
101729  //  **      D: cleanup
101730  //  */
101731  func _sqlite3Insert(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pSelect *XSelect, _pColumn *XIdList, _onError int32) {
101732  	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
101733  	var _aRegIdx *int32
101734  	var _zTab, _71_pVTab *int8
101735  	var _useTempTable, _appendFlag, _withoutRowid, _bIdListInOrder uint8
101736  	var _db *Xsqlite3
101737  	var _pTrigger *XTrigger
101738  	var _pTab *XTable
101739  	var _v *TVdbe
101740  	var _pList *XExprList
101741  	var _pIdx *XIndex
101742  	var _52_pOp *XVdbeOp
101743  	var _21_sNC XNameContext
101744  	var _dest XSelectDest
101745  	_nHidden = int32(0)
101746  	_iDataCur = int32(0)
101747  	_iIdxCur = int32(0)
101748  	_ipkColumn = int32(-1)
101749  	_srcTab = int32(0)
101750  	_addrInsTop = int32(0)
101751  	_addrCont = int32(0)
101752  	_useTempTable = uint8(0)
101753  	_appendFlag = uint8(0)
101754  	_pList = nil
101755  	_regFromSelect = int32(0)
101756  	_regAutoinc = int32(0)
101757  	_regRowCount = int32(0)
101758  	_aRegIdx = nil
101759  	_db = (*Xsqlite3)(_pParse.Xdb)
101760  	crt.Xmemset(tls, unsafe.Pointer(&_dest), int32(0), uint32(24))
101761  	if _pParse.XnErr != 0 || (_db.XmallocFailed != 0) {
101762  		goto _insert_cleanup
101763  	}
101764  	if ((_pSelect != nil) && ((_pSelect.XselFlags & uint32(512)) != (0))) && ((*XSelect)(_pSelect.XpPrior) == nil) {
101765  		_pList = (*XExprList)(_pSelect.XpEList)
101766  		*(**XExprList)(unsafe.Pointer(&_pSelect.XpEList)) = nil
101767  		_sqlite3SelectDelete(tls, _db, _pSelect)
101768  		_pSelect = nil
101769  	}
101770  	func() {
101771  		if _pTabList.XnSrc != int32(1) {
101772  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109377), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(115053)))
101773  			crt.X__builtin_abort(tls)
101774  		}
101775  	}()
101776  	_zTab = elem6((*TSrcList_item)(unsafe.Pointer(&_pTabList.Xa)), 0).XzName
101777  	if func() int32 {
101778  		if _zTab == nil {
101779  			return func() int32 {
101780  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109379), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(4809)))
101781  				crt.X__builtin_abort(tls)
101782  				return int32(1)
101783  			}()
101784  		}
101785  		return int32(0)
101786  	}() != 0 {
101787  		goto _insert_cleanup
101788  	}
101789  	_pTab = _sqlite3SrcListLookup(tls, _pParse, _pTabList)
101790  	if _pTab == nil {
101791  		goto _insert_cleanup
101792  	}
101793  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.XpSchema))
101794  	func() {
101795  		if _iDb >= _db.XnDb {
101796  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109385), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(54304)))
101797  			crt.X__builtin_abort(tls)
101798  		}
101799  	}()
101800  	if _sqlite3AuthCheck(tls, _pParse, int32(18), _pTab.XzName, nil, elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName) != 0 {
101801  		goto _insert_cleanup
101802  	}
101803  	_withoutRowid = uint8(bool2int((_pTab.XtabFlags & uint32(32)) != (0)))
101804  	_pTrigger = _sqlite3TriggersExist(tls, _pParse, _pTab, int32(108), nil, &_tmask)
101805  	_isView = bool2int((*XSelect)(_pTab.XpSelect) != nil)
101806  	func() {
101807  		if (_pTrigger == nil || _tmask == 0) && (_pTrigger != nil || _tmask != int32(0)) {
101808  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109407), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(118296)))
101809  			crt.X__builtin_abort(tls)
101810  		}
101811  	}()
101812  	if _sqlite3ViewGetColumnNames(tls, _pParse, _pTab) != 0 {
101813  		goto _insert_cleanup
101814  	}
101815  	if _sqlite3IsReadOnly(tls, _pParse, _pTab, _tmask) != 0 {
101816  		goto _insert_cleanup
101817  	}
101818  	_v = _sqlite3GetVdbe(tls, _pParse)
101819  	if _v == nil {
101820  		goto _insert_cleanup
101821  	}
101822  	if int32(_pParse.Xnested) == int32(0) {
101823  		_sqlite3VdbeCountChanges(tls, _v)
101824  	}
101825  	_sqlite3BeginWriteOperation(tls, _pParse, bool2int((_pSelect != nil) || (_pTrigger != nil)), _iDb)
101826  	if (_pColumn == nil) && _xferOptimization(tls, _pParse, _pTab, _pSelect, _onError, _iDb) != 0 {
101827  		func() {
101828  			if _pTrigger != nil {
101829  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109440), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(118345)))
101830  				crt.X__builtin_abort(tls)
101831  			}
101832  		}()
101833  		func() {
101834  			if _pList != nil {
101835  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109441), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(118355)))
101836  				crt.X__builtin_abort(tls)
101837  			}
101838  		}()
101839  		goto _insert_end
101840  	}
101841  	_regAutoinc = _autoIncBegin(tls, _pParse, _iDb, _pTab)
101842  	_regRowid = store2(&_regIns, _pParse.XnMem+int32(1))
101843  	_pParse.XnMem += int32(_pTab.XnCol) + int32(1)
101844  	if _pTab.XnModuleArg != 0 {
101845  		_regRowid += 1
101846  		_pParse.XnMem += 1
101847  	}
101848  	_regData = _regRowid + int32(1)
101849  	_bIdListInOrder = uint8(bool2int((_pTab.XtabFlags & uint32(128)) == (0)))
101850  	if _pColumn == nil {
101851  		goto _31
101852  	}
101853  	_i = int32(0)
101854  _32:
101855  	if _i >= _pColumn.XnId {
101856  		goto _35
101857  	}
101858  	elem42((*TIdList_item)(_pColumn.Xa), uintptr(_i)).Xidx = int32(-1)
101859  	_i += 1
101860  	goto _32
101861  _35:
101862  	_i = int32(0)
101863  _36:
101864  	if _i >= _pColumn.XnId {
101865  		goto _39
101866  	}
101867  	_j = int32(0)
101868  _40:
101869  	if _j >= int32(_pTab.XnCol) {
101870  		goto _43
101871  	}
101872  	if _sqlite3StrICmp(tls, elem42((*TIdList_item)(_pColumn.Xa), uintptr(_i)).XzName, elem41((*XColumn)(_pTab.XaCol), uintptr(_j)).XzName) != int32(0) {
101873  		goto _44
101874  	}
101875  	elem42((*TIdList_item)(_pColumn.Xa), uintptr(_i)).Xidx = _j
101876  	if _i != _j {
101877  		_bIdListInOrder = 0
101878  	}
101879  	if _j == int32(_pTab.XiPKey) {
101880  		_ipkColumn = _i
101881  		func() {
101882  			if _withoutRowid != 0 {
101883  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109484), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(118364)))
101884  				crt.X__builtin_abort(tls)
101885  			}
101886  		}()
101887  	}
101888  	goto _43
101889  _44:
101890  	_j += 1
101891  	goto _40
101892  _43:
101893  	if _j < int32(_pTab.XnCol) {
101894  		goto _49
101895  	}
101896  	if _sqlite3IsRowid(tls, elem42((*TIdList_item)(_pColumn.Xa), uintptr(_i)).XzName) != 0 && (_withoutRowid == 0) {
101897  		_ipkColumn = _i
101898  		_bIdListInOrder = 0
101899  		goto _52
101900  	}
101901  	_sqlite3ErrorMsg(tls, _pParse, str(118378), unsafe.Pointer(_pTabList), int32(0), unsafe.Pointer(elem42((*TIdList_item)(_pColumn.Xa), uintptr(_i)).XzName))
101902  	_pParse.XcheckSchema = uint8(1)
101903  	goto _insert_cleanup
101904  _52:
101905  _49:
101906  	_i += 1
101907  	goto _36
101908  _39:
101909  _31:
101910  	if _pSelect == nil {
101911  		goto _53
101912  	}
101913  	_18_regYield = preInc2(&_pParse.XnMem, 1)
101914  	_18_addrTop = _sqlite3VdbeCurrentAddr(tls, _v) + int32(1)
101915  	_sqlite3VdbeAddOp3(tls, _v, int32(15), _18_regYield, int32(0), _18_addrTop)
101916  	_sqlite3SelectDestInit(tls, &_dest, int32(13), _18_regYield)
101917  	_dest.XiSdst = func() int32 {
101918  		if _bIdListInOrder != 0 {
101919  			return _regData
101920  		}
101921  		return int32(0)
101922  	}()
101923  	_dest.XnSdst = int32(_pTab.XnCol)
101924  	_18_rc = _sqlite3Select(tls, _pParse, _pSelect, &_dest)
101925  	_regFromSelect = _dest.XiSdst
101926  	if (_18_rc != 0 || (_db.XmallocFailed != 0)) || _pParse.XnErr != 0 {
101927  		goto _insert_cleanup
101928  	}
101929  	_sqlite3VdbeEndCoroutine(tls, _v, _18_regYield)
101930  	_sqlite3VdbeJumpHere(tls, _v, _18_addrTop-int32(1))
101931  	func() {
101932  		if _pSelect.XpEList == nil {
101933  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109526), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(118410)))
101934  			crt.X__builtin_abort(tls)
101935  		}
101936  	}()
101937  	_nColumn = (*XExprList)(_pSelect.XpEList).XnExpr
101938  	if (_pTrigger != nil) || _readsTable(tls, _pParse, _iDb, _pTab) != 0 {
101939  		_useTempTable = uint8(1)
101940  	}
101941  	if _useTempTable != 0 {
101942  		_srcTab = postInc2(&_pParse.XnTab, 1)
101943  		_20_regRec = _sqlite3GetTempReg(tls, _pParse)
101944  		_20_regTempRowid = _sqlite3GetTempReg(tls, _pParse)
101945  		_sqlite3VdbeAddOp2(tls, _v, int32(110), _srcTab, _nColumn)
101946  		_20_addrL = _sqlite3VdbeAddOp1(tls, _v, int32(16), _dest.XiSDParm)
101947  		_sqlite3VdbeAddOp3(tls, _v, int32(101), _regFromSelect, _nColumn, _20_regRec)
101948  		_sqlite3VdbeAddOp2(tls, _v, int32(117), _srcTab, _20_regTempRowid)
101949  		_sqlite3VdbeAddOp3(tls, _v, int32(118), _srcTab, _20_regRec, _20_regTempRowid)
101950  		_sqlite3VdbeGoto(tls, _v, _20_addrL)
101951  		_sqlite3VdbeJumpHere(tls, _v, _20_addrL)
101952  		_sqlite3ReleaseTempReg(tls, _pParse, _20_regRec)
101953  		_sqlite3ReleaseTempReg(tls, _pParse, _20_regTempRowid)
101954  	}
101955  	goto _64
101956  _53:
101957  	crt.Xmemset(tls, unsafe.Pointer(&_21_sNC), int32(0), uint32(32))
101958  	*(**XParse)(unsafe.Pointer(&_21_sNC.XpParse)) = _pParse
101959  	_srcTab = int32(-1)
101960  	func() {
101961  		if int32(_useTempTable) != int32(0) {
101962  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109578), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(118426)))
101963  			crt.X__builtin_abort(tls)
101964  		}
101965  	}()
101966  	if _pList == nil {
101967  		goto _67
101968  	}
101969  	_nColumn = _pList.XnExpr
101970  	if _sqlite3ResolveExprListNames(tls, &_21_sNC, _pList) != 0 {
101971  		goto _insert_cleanup
101972  	}
101973  	goto _69
101974  _67:
101975  	_nColumn = int32(0)
101976  _69:
101977  _64:
101978  	if (_pColumn == nil) && (_nColumn > int32(0)) {
101979  		_ipkColumn = int32(_pTab.XiPKey)
101980  	}
101981  	_i = int32(0)
101982  _72:
101983  	if _i >= int32(_pTab.XnCol) {
101984  		goto _75
101985  	}
101986  	_nHidden += func() int32 {
101987  		if (int32(elem41((*XColumn)(_pTab.XaCol), uintptr(_i)).XcolFlags) & int32(2)) != int32(0) {
101988  			return int32(1)
101989  		}
101990  		return int32(0)
101991  	}()
101992  	_i += 1
101993  	goto _72
101994  _75:
101995  	if ((_pColumn == nil) && _nColumn != 0) && (_nColumn != (int32(_pTab.XnCol) - _nHidden)) {
101996  		_sqlite3ErrorMsg(tls, _pParse, str(118442), unsafe.Pointer(_pTabList), int32(0), int32(_pTab.XnCol)-_nHidden, _nColumn)
101997  		goto _insert_cleanup
101998  	}
101999  	if (_pColumn != nil) && (_nColumn != _pColumn.XnId) {
102000  		_sqlite3ErrorMsg(tls, _pParse, str(118494), _nColumn, _pColumn.XnId)
102001  		goto _insert_cleanup
102002  	}
102003  	if (_db.Xflags & int32(128)) != 0 {
102004  		_regRowCount = preInc2(&_pParse.XnMem, 1)
102005  		_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _regRowCount)
102006  	}
102007  	if _isView != 0 {
102008  		goto _84
102009  	}
102010  	_30_nIdx = _sqlite3OpenTableAndIndices(tls, _pParse, _pTab, int32(107), 0, int32(-1), nil, &_iDataCur, &_iIdxCur)
102011  	_aRegIdx = (*int32)(_sqlite3DbMallocRawNN(tls, _db, uint64(uint32(4)*uint32(_30_nIdx+int32(1)))))
102012  	if _aRegIdx == nil {
102013  		goto _insert_cleanup
102014  	}
102015  	*func() **XIndex { _i = int32(0); return &_pIdx }() = (*XIndex)(_pTab.XpIndex)
102016  _86:
102017  	if _i >= _30_nIdx {
102018  		goto _89
102019  	}
102020  	func() {
102021  		if _pIdx == nil {
102022  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109631), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(118519)))
102023  			crt.X__builtin_abort(tls)
102024  		}
102025  	}()
102026  	*elem8(_aRegIdx, uintptr(_i)) = preInc2(&_pParse.XnMem, 1)
102027  	_pParse.XnMem += int32(_pIdx.XnColumn)
102028  	*func() *int32 { _pIdx = (*XIndex)(_pIdx.XpNext); return &_i }() += 1
102029  	goto _86
102030  _89:
102031  _84:
102032  	if _useTempTable != 0 {
102033  		_addrInsTop = _sqlite3VdbeAddOp1(tls, _v, int32(37), _srcTab)
102034  		_addrCont = _sqlite3VdbeCurrentAddr(tls, _v)
102035  		goto _94
102036  	}
102037  	if _pSelect != nil {
102038  		_addrInsTop = store2(&_addrCont, _sqlite3VdbeAddOp1(tls, _v, int32(16), _dest.XiSDParm))
102039  	}
102040  _94:
102041  	_endOfLoop = _sqlite3VdbeMakeLabel(tls, _v)
102042  	if (_tmask & int32(1)) == 0 {
102043  		goto _95
102044  	}
102045  	_35_regCols = _sqlite3GetTempRange(tls, _pParse, int32(_pTab.XnCol)+int32(1))
102046  	if _ipkColumn < int32(0) {
102047  		_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(-1), _35_regCols)
102048  		goto _97
102049  	}
102050  	func() {
102051  		if _withoutRowid != 0 {
102052  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109679), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(118364)))
102053  			crt.X__builtin_abort(tls)
102054  		}
102055  	}()
102056  	if _useTempTable != 0 {
102057  		_sqlite3VdbeAddOp3(tls, _v, int32(99), _srcTab, _ipkColumn, _35_regCols)
102058  		goto _101
102059  	}
102060  	func() {
102061  		if _pSelect != nil {
102062  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109683), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(118524)))
102063  			crt.X__builtin_abort(tls)
102064  		}
102065  	}()
102066  	_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_ipkColumn)).XpExpr), _35_regCols)
102067  _101:
102068  	_37_addr1 = _sqlite3VdbeAddOp1(tls, _v, int32(76), _35_regCols)
102069  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(-1), _35_regCols)
102070  	_sqlite3VdbeJumpHere(tls, _v, _37_addr1)
102071  	_sqlite3VdbeAddOp1(tls, _v, int32(17), _35_regCols)
102072  _97:
102073  	func() {
102074  		if _pTab.XnModuleArg != 0 {
102075  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109695), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(41888)))
102076  			crt.X__builtin_abort(tls)
102077  		}
102078  	}()
102079  	_i = store2(&_j, int32(0))
102080  _106:
102081  	if _i >= int32(_pTab.XnCol) {
102082  		goto _109
102083  	}
102084  	if _pColumn == nil {
102085  		goto _110
102086  	}
102087  	_j = int32(0)
102088  _111:
102089  	if _j >= _pColumn.XnId {
102090  		goto _114
102091  	}
102092  	if (elem42((*TIdList_item)(_pColumn.Xa), uintptr(_j)).Xidx) == _i {
102093  		goto _114
102094  	}
102095  	_j += 1
102096  	goto _111
102097  _114:
102098  _110:
102099  	if (((_useTempTable == 0) && (_pList == nil)) || ((_pColumn != nil) && (_j >= _pColumn.XnId))) || ((_pColumn == nil) && int32(0) != 0) {
102100  		_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem41((*XColumn)(_pTab.XaCol), uintptr(_i)).XpDflt), (_35_regCols+_i)+int32(1))
102101  		goto _124
102102  	}
102103  	if _useTempTable != 0 {
102104  		_sqlite3VdbeAddOp3(tls, _v, int32(99), _srcTab, _j, (_35_regCols+_i)+int32(1))
102105  		goto _124
102106  	}
102107  	func() {
102108  		if _pSelect != nil {
102109  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109711), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(118524)))
102110  			crt.X__builtin_abort(tls)
102111  		}
102112  	}()
102113  	_sqlite3ExprCodeAndCache(tls, _pParse, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_j)).XpExpr), (_35_regCols+_i)+int32(1))
102114  _124:
102115  	if (_pColumn == nil) && int32(1) != 0 {
102116  		_j += 1
102117  	}
102118  	_i += 1
102119  	goto _106
102120  _109:
102121  	if _isView == 0 {
102122  		_sqlite3TableAffinity(tls, _v, _pTab, _35_regCols+int32(1))
102123  	}
102124  	_sqlite3CodeRowTrigger(tls, _pParse, _pTrigger, int32(108), nil, int32(1), _pTab, (_35_regCols-int32(_pTab.XnCol))-int32(1), _onError, _endOfLoop)
102125  	_sqlite3ReleaseTempRange(tls, _pParse, _35_regCols, int32(_pTab.XnCol)+int32(1))
102126  _95:
102127  	if _isView != 0 {
102128  		goto _130
102129  	}
102130  	if _pTab.XnModuleArg != 0 {
102131  		_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _regIns)
102132  	}
102133  	if _ipkColumn < int32(0) {
102134  		goto _132
102135  	}
102136  	if _useTempTable != 0 {
102137  		_sqlite3VdbeAddOp3(tls, _v, int32(99), _srcTab, _ipkColumn, _regRowid)
102138  		goto _136
102139  	}
102140  	if _pSelect != nil {
102141  		_sqlite3VdbeAddOp2(tls, _v, int32(64), _regFromSelect+_ipkColumn, _regRowid)
102142  		goto _136
102143  	}
102144  	_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_ipkColumn)).XpExpr), _regRowid)
102145  	_52_pOp = _sqlite3VdbeGetOp(tls, _v, int32(-1))
102146  	if (func() int32 {
102147  		if _52_pOp != nil {
102148  			return int32(1)
102149  		}
102150  		return func() int32 {
102151  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109750), unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000), unsafe.Pointer(str(4809)))
102152  			crt.X__builtin_abort(tls)
102153  			return int32(0)
102154  		}()
102155  	}() != 0 && (int32(_52_pOp.Xopcode) == int32(59))) && (_pTab.XnModuleArg == 0) {
102156  		_appendFlag = uint8(1)
102157  		_52_pOp.Xopcode = uint8(117)
102158  		_52_pOp.Xp1 = _iDataCur
102159  		_52_pOp.Xp2 = _regRowid
102160  		_52_pOp.Xp3 = _regAutoinc
102161  	}
102162  _136:
102163  	if _appendFlag != 0 {
102164  		goto _142
102165  	}
102166  	if _pTab.XnModuleArg == 0 {
102167  		_54_addr1 = _sqlite3VdbeAddOp1(tls, _v, int32(76), _regRowid)
102168  		_sqlite3VdbeAddOp3(tls, _v, int32(117), _iDataCur, _regRowid, _regAutoinc)
102169  		_sqlite3VdbeJumpHere(tls, _v, _54_addr1)
102170  		goto _144
102171  	}
102172  	_54_addr1 = _sqlite3VdbeCurrentAddr(tls, _v)
102173  	_sqlite3VdbeAddOp2(tls, _v, int32(75), _regRowid, _54_addr1+int32(2))
102174  _144:
102175  	_sqlite3VdbeAddOp1(tls, _v, int32(17), _regRowid)
102176  _142:
102177  	goto _148
102178  _132:
102179  	if _pTab.XnModuleArg != 0 || (_withoutRowid != 0) {
102180  		_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _regRowid)
102181  		goto _148
102182  	}
102183  	_sqlite3VdbeAddOp3(tls, _v, int32(117), _iDataCur, _regRowid, _regAutoinc)
102184  	_appendFlag = uint8(1)
102185  _148:
102186  	_autoIncStep(tls, _pParse, _regAutoinc, _regRowid)
102187  	_nHidden = int32(0)
102188  	_i = int32(0)
102189  _149:
102190  	if _i >= int32(_pTab.XnCol) {
102191  		goto _152
102192  	}
102193  	_59_iRegStore = (_regRowid + int32(1)) + _i
102194  	if _i == int32(_pTab.XiPKey) {
102195  		_sqlite3VdbeAddOp1(tls, _v, int32(60), _59_iRegStore)
102196  		goto _150
102197  	}
102198  	if _pColumn != nil {
102199  		goto _154
102200  	}
102201  	if (int32(elem41((*XColumn)(_pTab.XaCol), uintptr(_i)).XcolFlags) & int32(2)) != int32(0) {
102202  		_j = int32(-1)
102203  		_nHidden += 1
102204  		goto _156
102205  	}
102206  	_j = _i - _nHidden
102207  _156:
102208  	goto _157
102209  _154:
102210  	_j = int32(0)
102211  _158:
102212  	if _j >= _pColumn.XnId {
102213  		goto _161
102214  	}
102215  	if (elem42((*TIdList_item)(_pColumn.Xa), uintptr(_j)).Xidx) == _i {
102216  		goto _161
102217  	}
102218  	_j += 1
102219  	goto _158
102220  _161:
102221  _157:
102222  	if ((_j < int32(0)) || (_nColumn == int32(0))) || ((_pColumn != nil) && (_j >= _pColumn.XnId)) {
102223  		_sqlite3ExprCodeFactorable(tls, _pParse, (*XExpr)(elem41((*XColumn)(_pTab.XaCol), uintptr(_i)).XpDflt), _59_iRegStore)
102224  		goto _172
102225  	}
102226  	if _useTempTable != 0 {
102227  		_sqlite3VdbeAddOp3(tls, _v, int32(99), _srcTab, _j, _59_iRegStore)
102228  		goto _172
102229  	}
102230  	if _pSelect == nil {
102231  		goto _170
102232  	}
102233  	if _regFromSelect != _regData {
102234  		_sqlite3VdbeAddOp2(tls, _v, int32(65), _regFromSelect+_j, _59_iRegStore)
102235  	}
102236  	goto _172
102237  _170:
102238  	_sqlite3ExprCode(tls, _pParse, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_j)).XpExpr), _59_iRegStore)
102239  _172:
102240  _150:
102241  	_i += 1
102242  	goto _149
102243  _152:
102244  	if _pTab.XnModuleArg != 0 {
102245  		_71_pVTab = (*int8)(unsafe.Pointer(_sqlite3GetVTable(tls, _db, _pTab)))
102246  		_sqlite3VtabMakeWritable(tls, _pParse, _pTab)
102247  		_sqlite3VdbeAddOp4(tls, _v, int32(12), int32(1), int32(_pTab.XnCol)+int32(2), _regIns, _71_pVTab, int32(-8))
102248  		_sqlite3VdbeChangeP5(tls, _v, uint16(func() int32 {
102249  			if _onError == int32(10) {
102250  				return int32(2)
102251  			}
102252  			return _onError
102253  		}()))
102254  		_sqlite3MayAbort(tls, _pParse)
102255  		goto _176
102256  	}
102257  	_sqlite3GenerateConstraintChecks(tls, _pParse, _pTab, _aRegIdx, _iDataCur, _iIdxCur, _regIns, int32(0), uint8(bool2int(_ipkColumn >= int32(0))), uint8(_onError), _endOfLoop, &_72_isReplace, nil)
102258  	_sqlite3FkCheck(tls, _pParse, _pTab, int32(0), _regIns, nil, int32(0))
102259  	_72_bUseSeek = bool2int((_72_isReplace == int32(0)) || ((_pTrigger == nil) && (((_db.Xflags & int32(524288)) == int32(0)) || (_sqlite3FkReferences(tls, _pTab) == nil))))
102260  	_sqlite3CompleteInsertion(tls, _pParse, _pTab, _iDataCur, _iIdxCur, _regIns, _aRegIdx, int32(0), int32(_appendFlag), _72_bUseSeek)
102261  _176:
102262  _130:
102263  	if (_db.Xflags & int32(128)) != int32(0) {
102264  		_sqlite3VdbeAddOp2(tls, _v, int32(73), _regRowCount, int32(1))
102265  	}
102266  	if _pTrigger != nil {
102267  		_sqlite3CodeRowTrigger(tls, _pParse, _pTrigger, int32(108), nil, int32(2), _pTab, (_regData-int32(2))-int32(_pTab.XnCol), _onError, _endOfLoop)
102268  	}
102269  	_sqlite3VdbeResolveLabel(tls, _v, _endOfLoop)
102270  	if _useTempTable != 0 {
102271  		_sqlite3VdbeAddOp2(tls, _v, int32(7), _srcTab, _addrCont)
102272  		_sqlite3VdbeJumpHere(tls, _v, _addrInsTop)
102273  		_sqlite3VdbeAddOp1(tls, _v, int32(114), _srcTab)
102274  		goto _insert_end
102275  	}
102276  	if _pSelect != nil {
102277  		_sqlite3VdbeGoto(tls, _v, _addrCont)
102278  		_sqlite3VdbeJumpHere(tls, _v, _addrInsTop)
102279  	}
102280  _insert_end:
102281  	if (int32(_pParse.Xnested) == int32(0)) && ((*XTable)(_pParse.XpTriggerTab) == nil) {
102282  		_sqlite3AutoincrementEnd(tls, _pParse)
102283  	}
102284  	if ((_db.Xflags&int32(128)) != 0 && (_pParse.Xnested == 0)) && (_pParse.XpTriggerTab == nil) {
102285  		_sqlite3VdbeAddOp2(tls, _v, int32(67), _regRowCount, int32(1))
102286  		_sqlite3VdbeSetNumCols(tls, _v, int32(1))
102287  		_sqlite3VdbeSetColName(tls, _v, int32(0), int32(0), str(118535), nil)
102288  	}
102289  _insert_cleanup:
102290  	_sqlite3SrcListDelete(tls, _db, _pTabList)
102291  	_sqlite3ExprListDelete(tls, _db, _pList)
102292  	_sqlite3SelectDelete(tls, _db, _pSelect)
102293  	_sqlite3IdListDelete(tls, _db, _pColumn)
102294  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_aRegIdx))
102295  }
102296  
102297  var _sqlite3InsertØ00__func__Ø000 [14]int8
102298  
102299  func init() {
102300  	crt.Xstrncpy(nil, &_sqlite3InsertØ00__func__Ø000[0], str(118549), 14)
102301  }
102302  
102303  // C comment
102304  //  /*
102305  //  ** Attempt the transfer optimization on INSERTs of the form
102306  //  **
102307  //  **     INSERT INTO tab1 SELECT * FROM tab2;
102308  //  **
102309  //  ** The xfer optimization transfers raw records from tab2 over to tab1.
102310  //  ** Columns are not decoded and reassembled, which greatly improves
102311  //  ** performance.  Raw index records are transferred in the same way.
102312  //  **
102313  //  ** The xfer optimization is only attempted if tab1 and tab2 are compatible.
102314  //  ** There are lots of rules for determining compatibility - see comments
102315  //  ** embedded in the code for details.
102316  //  **
102317  //  ** This routine returns TRUE if the optimization is guaranteed to be used.
102318  //  ** Sometimes the xfer optimization will only work if the destination table
102319  //  ** is empty - a factor that can only be determined at run-time.  In that
102320  //  ** case, this routine generates code for the xfer optimization but also
102321  //  ** does a test to see if the destination table is empty and jumps over the
102322  //  ** xfer optimization code if the test fails.  In that case, this routine
102323  //  ** returns FALSE so that the caller will know to go ahead and generate
102324  //  ** an unoptimized transfer.  This routine also returns FALSE if there
102325  //  ** is no chance that the xfer optimization can be applied.
102326  //  **
102327  //  ** This optimization is particularly useful at making VACUUM run faster.
102328  //  */
102329  func _xferOptimization(tls *crt.TLS, _pParse *XParse, _pDest *XTable, _pSelect *XSelect, _onError int32, _iDbDest int32) (r0 int32) {
102330  	var _i, _iDbSrc, _iSrc, _iDest, _addr1, _addr2, _emptyDestTest, _emptySrcTest, _regAutoinc, _destHasUniqueIdx, _regData, _regRowid int32
102331  	var _47_zColl *int8
102332  	var _37_insFlags, _44_idxInsFlags uint8
102333  	var _db *Xsqlite3
102334  	var _pSrc *XTable
102335  	var _v *TVdbe
102336  	var _pItem *TSrcList_item
102337  	var _pEList *XExprList
102338  	var _23_pDestCol, _23_pSrcCol *XColumn
102339  	var _pSrcIdx, _pDestIdx *XIndex
102340  	_db = (*Xsqlite3)(_pParse.Xdb)
102341  	_emptyDestTest = int32(0)
102342  	_emptySrcTest = int32(0)
102343  	_destHasUniqueIdx = int32(0)
102344  	if _pSelect == nil {
102345  		return int32(0)
102346  	}
102347  	if (_pParse.XpWith != nil) || (_pSelect.XpWith != nil) {
102348  		return int32(0)
102349  	}
102350  	if _sqlite3TriggerList(tls, _pParse, _pDest) != nil {
102351  		return int32(0)
102352  	}
102353  	if _pDest.XnModuleArg != 0 {
102354  		return int32(0)
102355  	}
102356  	if _onError != int32(10) {
102357  		goto _5
102358  	}
102359  	if int32(_pDest.XiPKey) >= int32(0) {
102360  		_onError = int32(_pDest.XkeyConf)
102361  	}
102362  	if _onError == int32(10) {
102363  		_onError = int32(2)
102364  	}
102365  _5:
102366  	func() {
102367  		if _pSelect.XpSrc == nil {
102368  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110825), unsafe.Pointer(&_xferOptimizationØ00__func__Ø000), unsafe.Pointer(str(118563)))
102369  			crt.X__builtin_abort(tls)
102370  		}
102371  	}()
102372  	if ((*XSrcList)(_pSelect.XpSrc).XnSrc) != int32(1) {
102373  		return int32(0)
102374  	}
102375  	if (elem6((*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pSelect.XpSrc).Xa))), 0).XpSelect) != nil {
102376  		return int32(0)
102377  	}
102378  	if _pSelect.XpWhere != nil {
102379  		return int32(0)
102380  	}
102381  	if _pSelect.XpOrderBy != nil {
102382  		return int32(0)
102383  	}
102384  	if _pSelect.XpGroupBy != nil {
102385  		return int32(0)
102386  	}
102387  	if _pSelect.XpLimit != nil {
102388  		return int32(0)
102389  	}
102390  	func() {
102391  		if (*XExpr)(_pSelect.XpOffset) != nil {
102392  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110846), unsafe.Pointer(&_xferOptimizationØ00__func__Ø000), unsafe.Pointer(str(118577)))
102393  			crt.X__builtin_abort(tls)
102394  		}
102395  	}()
102396  	if _pSelect.XpPrior != nil {
102397  		return int32(0)
102398  	}
102399  	if (_pSelect.XselFlags & uint32(1)) != 0 {
102400  		return int32(0)
102401  	}
102402  	_pEList = (*XExprList)(_pSelect.XpEList)
102403  	func() {
102404  		if _pEList == nil {
102405  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110854), unsafe.Pointer(&_xferOptimizationØ00__func__Ø000), unsafe.Pointer(str(45007)))
102406  			crt.X__builtin_abort(tls)
102407  		}
102408  	}()
102409  	if _pEList.XnExpr != int32(1) {
102410  		return int32(0)
102411  	}
102412  	func() {
102413  		if (elem57((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), 0).XpExpr) == nil {
102414  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110858), unsafe.Pointer(&_xferOptimizationØ00__func__Ø000), unsafe.Pointer(str(118597)))
102415  			crt.X__builtin_abort(tls)
102416  		}
102417  	}()
102418  	if int32((*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pEList.Xa)), 0).XpExpr).Xop) != int32(161) {
102419  		return int32(0)
102420  	}
102421  	_pItem = (*TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pSelect.XpSrc).Xa)))
102422  	_pSrc = _sqlite3LocateTableItem(tls, _pParse, 0, _pItem)
102423  	if _pSrc == nil {
102424  		return int32(0)
102425  	}
102426  	if _pSrc == _pDest {
102427  		return int32(0)
102428  	}
102429  	if ((_pDest.XtabFlags & uint32(32)) == (0)) != ((_pSrc.XtabFlags & uint32(32)) == (0)) {
102430  		return int32(0)
102431  	}
102432  	if _pSrc.XnModuleArg != 0 {
102433  		return int32(0)
102434  	}
102435  	if _pSrc.XpSelect != nil {
102436  		return int32(0)
102437  	}
102438  	if int32(_pDest.XnCol) != int32(_pSrc.XnCol) {
102439  		return int32(0)
102440  	}
102441  	if int32(_pDest.XiPKey) != int32(_pSrc.XiPKey) {
102442  		return int32(0)
102443  	}
102444  	_i = int32(0)
102445  _33:
102446  	if _i >= int32(_pDest.XnCol) {
102447  		goto _36
102448  	}
102449  	_23_pDestCol = elem41((*XColumn)(_pDest.XaCol), uintptr(_i))
102450  	_23_pSrcCol = elem41((*XColumn)(_pSrc.XaCol), uintptr(_i))
102451  	if int32(_23_pDestCol.Xaffinity) != int32(_23_pSrcCol.Xaffinity) {
102452  		return int32(0)
102453  	}
102454  	if Xsqlite3_stricmp(tls, _23_pDestCol.XzColl, _23_pSrcCol.XzColl) != int32(0) {
102455  		return int32(0)
102456  	}
102457  	if (_23_pDestCol.XnotNull != 0) && (_23_pSrcCol.XnotNull == 0) {
102458  		return int32(0)
102459  	}
102460  	if _i <= int32(0) {
102461  		goto _41
102462  	}
102463  	func() {
102464  		if (*XExpr)(_23_pDestCol.XpDflt) != nil && int32((*XExpr)(_23_pDestCol.XpDflt).Xop) != int32(162) {
102465  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110913), unsafe.Pointer(&_xferOptimizationØ00__func__Ø000), unsafe.Pointer(str(118616)))
102466  			crt.X__builtin_abort(tls)
102467  		}
102468  	}()
102469  	func() {
102470  		if (*XExpr)(_23_pSrcCol.XpDflt) != nil && int32((*XExpr)(_23_pSrcCol.XpDflt).Xop) != int32(162) {
102471  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110914), unsafe.Pointer(&_xferOptimizationØ00__func__Ø000), unsafe.Pointer(str(118667)))
102472  			crt.X__builtin_abort(tls)
102473  		}
102474  	}()
102475  	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))) {
102476  		return int32(0)
102477  	}
102478  _41:
102479  	_i += 1
102480  	goto _33
102481  _36:
102482  	_pDestIdx = (*XIndex)(_pDest.XpIndex)
102483  _51:
102484  	if _pDestIdx == nil {
102485  		goto _54
102486  	}
102487  	if int32(_pDestIdx.XonError) != int32(0) {
102488  		_destHasUniqueIdx = int32(1)
102489  	}
102490  	_pSrcIdx = (*XIndex)(_pSrc.XpIndex)
102491  _56:
102492  	if _pSrcIdx == nil {
102493  		goto _59
102494  	}
102495  	if _xferCompatibleIndex(tls, _pDestIdx, _pSrcIdx) != 0 {
102496  		goto _59
102497  	}
102498  	_pSrcIdx = (*XIndex)(_pSrcIdx.XpNext)
102499  	goto _56
102500  _59:
102501  	if _pSrcIdx == nil {
102502  		return int32(0)
102503  	}
102504  	_pDestIdx = (*XIndex)(_pDestIdx.XpNext)
102505  	goto _51
102506  _54:
102507  	if (_pDest.XpCheck != nil) && _sqlite3ExprListCompare(tls, (*XExprList)(_pSrc.XpCheck), (*XExprList)(_pDest.XpCheck), int32(-1)) != 0 {
102508  		return int32(0)
102509  	}
102510  	if ((_db.Xflags & int32(524288)) != int32(0)) && ((*XFKey)(_pDest.XpFKey) != nil) {
102511  		return int32(0)
102512  	}
102513  	if (_db.Xflags & int32(128)) != int32(0) {
102514  		return int32(0)
102515  	}
102516  	_iDbSrc = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pSrc.XpSchema))
102517  	_v = _sqlite3GetVdbe(tls, _pParse)
102518  	_sqlite3CodeVerifySchema(tls, _pParse, _iDbSrc)
102519  	_iSrc = postInc2(&_pParse.XnTab, 1)
102520  	_iDest = postInc2(&_pParse.XnTab, 1)
102521  	_regAutoinc = _autoIncBegin(tls, _pParse, _iDbDest, _pDest)
102522  	_regData = _sqlite3GetTempReg(tls, _pParse)
102523  	_regRowid = _sqlite3GetTempReg(tls, _pParse)
102524  	_sqlite3OpenTable(tls, _pParse, _iDest, _iDbDest, _pDest, int32(107))
102525  	func() {
102526  		if (_pDest.XtabFlags&uint32(32)) != (0) && _destHasUniqueIdx == 0 {
102527  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110971), unsafe.Pointer(&_xferOptimizationØ00__func__Ø000), unsafe.Pointer(str(118716)))
102528  			crt.X__builtin_abort(tls)
102529  		}
102530  	}()
102531  	if ((_db.Xflags & int32(268435456)) == int32(0)) && ((((int32(_pDest.XiPKey) < int32(0)) && ((*XIndex)(_pDest.XpIndex) != nil)) || _destHasUniqueIdx != 0) || ((_onError != int32(2)) && (_onError != int32(1)))) {
102532  		_addr1 = _sqlite3VdbeAddOp2(tls, _v, int32(37), _iDest, int32(0))
102533  		_emptyDestTest = _sqlite3VdbeAddOp0(tls, _v, int32(13))
102534  		_sqlite3VdbeJumpHere(tls, _v, _addr1)
102535  	}
102536  	if (_pSrc.XtabFlags & uint32(32)) != (0) {
102537  		goto _76
102538  	}
102539  	_sqlite3OpenTable(tls, _pParse, _iSrc, _iDbSrc, _pSrc, int32(106))
102540  	_emptySrcTest = _sqlite3VdbeAddOp2(tls, _v, int32(37), _iSrc, int32(0))
102541  	if int32(_pDest.XiPKey) >= int32(0) {
102542  		_addr1 = _sqlite3VdbeAddOp2(tls, _v, int32(125), _iSrc, _regRowid)
102543  		_addr2 = _sqlite3VdbeAddOp3(tls, _v, int32(32), _iDest, int32(0), _regRowid)
102544  		_sqlite3RowidConstraint(tls, _pParse, _onError, _pDest)
102545  		_sqlite3VdbeJumpHere(tls, _v, _addr2)
102546  		_autoIncStep(tls, _pParse, _regAutoinc, _regRowid)
102547  		goto _80
102548  	}
102549  	if (*XIndex)(_pDest.XpIndex) == nil {
102550  		_addr1 = _sqlite3VdbeAddOp2(tls, _v, int32(117), _iDest, _regRowid)
102551  		goto _80
102552  	}
102553  	_addr1 = _sqlite3VdbeAddOp2(tls, _v, int32(125), _iSrc, _regRowid)
102554  	func() {
102555  		if (_pDest.XtabFlags & uint32(8)) != (0) {
102556  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(111013), unsafe.Pointer(&_xferOptimizationØ00__func__Ø000), unsafe.Pointer(str(118752)))
102557  			crt.X__builtin_abort(tls)
102558  		}
102559  	}()
102560  _80:
102561  	_sqlite3VdbeAddOp3(tls, _v, int32(124), _iSrc, _regData, int32(1))
102562  	if (_db.Xflags & int32(268435456)) != 0 {
102563  		_sqlite3VdbeAddOp3(tls, _v, int32(33), _iDest, int32(0), int32(-1))
102564  		_37_insFlags = uint8(57)
102565  		goto _84
102566  	}
102567  	_37_insFlags = uint8(41)
102568  _84:
102569  	_sqlite3VdbeAddOp4(tls, _v, int32(118), _iDest, _regData, _regRowid, (*int8)(unsafe.Pointer(_pDest)), int32(-15))
102570  	_sqlite3VdbeChangeP5(tls, _v, uint16(_37_insFlags))
102571  	_sqlite3VdbeAddOp2(tls, _v, int32(7), _iSrc, _addr1)
102572  	_sqlite3VdbeAddOp2(tls, _v, int32(114), _iSrc, int32(0))
102573  	_sqlite3VdbeAddOp2(tls, _v, int32(114), _iDest, int32(0))
102574  	goto _85
102575  _76:
102576  	_sqlite3TableLock(tls, _pParse, _iDbDest, _pDest.Xtnum, uint8(1), _pDest.XzName)
102577  	_sqlite3TableLock(tls, _pParse, _iDbSrc, _pSrc.Xtnum, 0, _pSrc.XzName)
102578  _85:
102579  	_pDestIdx = (*XIndex)(_pDest.XpIndex)
102580  _86:
102581  	if _pDestIdx == nil {
102582  		goto _89
102583  	}
102584  	_44_idxInsFlags = 0
102585  	_pSrcIdx = (*XIndex)(_pSrc.XpIndex)
102586  _90:
102587  	if func() int32 {
102588  		if _pSrcIdx != nil {
102589  			return int32(1)
102590  		}
102591  		return func() int32 {
102592  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(111035), unsafe.Pointer(&_xferOptimizationØ00__func__Ø000), unsafe.Pointer(str(4809)))
102593  			crt.X__builtin_abort(tls)
102594  			return int32(0)
102595  		}()
102596  	}() == 0 {
102597  		goto _95
102598  	}
102599  	if _xferCompatibleIndex(tls, _pDestIdx, _pSrcIdx) != 0 {
102600  		goto _95
102601  	}
102602  	_pSrcIdx = (*XIndex)(_pSrcIdx.XpNext)
102603  	goto _90
102604  _95:
102605  	func() {
102606  		if _pSrcIdx == nil {
102607  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(111038), unsafe.Pointer(&_xferOptimizationØ00__func__Ø000), unsafe.Pointer(str(118792)))
102608  			crt.X__builtin_abort(tls)
102609  		}
102610  	}()
102611  	_sqlite3VdbeAddOp3(tls, _v, int32(106), _iSrc, _pSrcIdx.Xtnum, _iDbSrc)
102612  	_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pSrcIdx)
102613  	_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(_pSrcIdx.XzName))
102614  	_sqlite3VdbeAddOp3(tls, _v, int32(107), _iDest, _pDestIdx.Xtnum, _iDbDest)
102615  	_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pDestIdx)
102616  	_sqlite3VdbeChangeP5(tls, _v, uint16(1))
102617  	_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(_pDestIdx.XzName))
102618  	_addr1 = _sqlite3VdbeAddOp2(tls, _v, int32(37), _iSrc, int32(0))
102619  	_sqlite3VdbeAddOp3(tls, _v, int32(124), _iSrc, _regData, int32(1))
102620  	if (_db.Xflags & int32(268435456)) == 0 {
102621  		goto _99
102622  	}
102623  	_i = int32(0)
102624  _100:
102625  	if _i >= int32(_pSrcIdx.XnColumn) {
102626  		goto _103
102627  	}
102628  	_47_zColl = *elem0(_pSrcIdx.XazColl, uintptr(_i))
102629  	if Xsqlite3_stricmp(tls, (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)), _47_zColl) != 0 {
102630  		goto _103
102631  	}
102632  	_i += 1
102633  	goto _100
102634  _103:
102635  	if _i == int32(_pSrcIdx.XnColumn) {
102636  		_44_idxInsFlags = uint8(16)
102637  		_sqlite3VdbeAddOp3(tls, _v, int32(33), _iDest, int32(0), int32(-1))
102638  	}
102639  _99:
102640  	if ((_pSrc.XtabFlags & uint32(32)) != (0)) && (int32((uint32(_pDestIdx.XidxType)<<30)>>30) == int32(2)) {
102641  		{
102642  			p := &_44_idxInsFlags
102643  			*p = uint8(int32(*p) | int32(1))
102644  		}
102645  	}
102646  	_sqlite3VdbeAddOp2(tls, _v, int32(128), _iDest, _regData)
102647  	_sqlite3VdbeChangeP5(tls, _v, uint16(int32(_44_idxInsFlags)|int32(8)))
102648  	_sqlite3VdbeAddOp2(tls, _v, int32(7), _iSrc, _addr1+int32(1))
102649  	_sqlite3VdbeJumpHere(tls, _v, _addr1)
102650  	_sqlite3VdbeAddOp2(tls, _v, int32(114), _iSrc, int32(0))
102651  	_sqlite3VdbeAddOp2(tls, _v, int32(114), _iDest, int32(0))
102652  	_pDestIdx = (*XIndex)(_pDestIdx.XpNext)
102653  	goto _86
102654  _89:
102655  	if _emptySrcTest != 0 {
102656  		_sqlite3VdbeJumpHere(tls, _v, _emptySrcTest)
102657  	}
102658  	_sqlite3ReleaseTempReg(tls, _pParse, _regRowid)
102659  	_sqlite3ReleaseTempReg(tls, _pParse, _regData)
102660  	if _emptyDestTest != 0 {
102661  		_sqlite3AutoincrementEnd(tls, _pParse)
102662  		_sqlite3VdbeAddOp2(tls, _v, int32(55), int32(0), int32(0))
102663  		_sqlite3VdbeJumpHere(tls, _v, _emptyDestTest)
102664  		_sqlite3VdbeAddOp2(tls, _v, int32(114), _iDest, int32(0))
102665  		return int32(0)
102666  	}
102667  	return int32(1)
102668  }
102669  
102670  var _xferOptimizationØ00__func__Ø000 [17]int8
102671  
102672  func init() {
102673  	crt.Xstrncpy(nil, &_xferOptimizationØ00__func__Ø000[0], str(118800), 17)
102674  }
102675  
102676  // C comment
102677  //  /*
102678  //  ** Check to see if index pSrc is compatible as a source of data
102679  //  ** for index pDest in an insert transfer optimization.  The rules
102680  //  ** for a compatible index:
102681  //  **
102682  //  **    *   The index is over the same set of columns
102683  //  **    *   The same DESC and ASC markings occurs on all columns
102684  //  **    *   The same onError processing (OE_Abort, OE_Ignore, etc)
102685  //  **    *   The same collating sequence on each column
102686  //  **    *   The index has the exact same WHERE clause
102687  //  */
102688  func _xferCompatibleIndex(tls *crt.TLS, _pDest *XIndex, _pSrc *XIndex) (r0 int32) {
102689  	var _i int32
102690  	func() {
102691  		if _pDest == nil || _pSrc == nil {
102692  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110722), unsafe.Pointer(&_xferCompatibleIndexØ00__func__Ø000), unsafe.Pointer(str(118817)))
102693  			crt.X__builtin_abort(tls)
102694  		}
102695  	}()
102696  	func() {
102697  		if (*XTable)(_pDest.XpTable) == (*XTable)(_pSrc.XpTable) {
102698  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110723), unsafe.Pointer(&_xferCompatibleIndexØ00__func__Ø000), unsafe.Pointer(str(118831)))
102699  			crt.X__builtin_abort(tls)
102700  		}
102701  	}()
102702  	if int32(_pDest.XnKeyCol) != int32(_pSrc.XnKeyCol) {
102703  		return int32(0)
102704  	}
102705  	if int32(_pDest.XonError) != int32(_pSrc.XonError) {
102706  		return int32(0)
102707  	}
102708  	_i = int32(0)
102709  _7:
102710  	if _i >= int32(_pSrc.XnKeyCol) {
102711  		goto _10
102712  	}
102713  	if int32(*elem50(_pSrc.XaiColumn, uintptr(_i))) != int32(*elem50(_pDest.XaiColumn, uintptr(_i))) {
102714  		return int32(0)
102715  	}
102716  	if int32(*elem50(_pSrc.XaiColumn, uintptr(_i))) != int32(-2) {
102717  		goto _12
102718  	}
102719  	func() {
102720  		if (*XExprList)(_pSrc.XaColExpr) == nil || (*XExprList)(_pDest.XaColExpr) == nil {
102721  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(110735), unsafe.Pointer(&_xferCompatibleIndexØ00__func__Ø000), unsafe.Pointer(str(118859)))
102722  			crt.X__builtin_abort(tls)
102723  		}
102724  	}()
102725  	if _sqlite3ExprCompare(tls, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSrc.XaColExpr).Xa))), uintptr(_i)).XpExpr), (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&((*XExprList)(_pDest.XaColExpr).Xa))), uintptr(_i)).XpExpr), int32(-1)) != int32(0) {
102726  		return int32(0)
102727  	}
102728  _12:
102729  	if int32(*elem15(_pSrc.XaSortOrder, uintptr(_i))) != int32(*elem15(_pDest.XaSortOrder, uintptr(_i))) {
102730  		return int32(0)
102731  	}
102732  	if Xsqlite3_stricmp(tls, *elem0(_pSrc.XazColl, uintptr(_i)), *elem0(_pDest.XazColl, uintptr(_i))) != int32(0) {
102733  		return int32(0)
102734  	}
102735  	_i += 1
102736  	goto _7
102737  _10:
102738  	if _sqlite3ExprCompare(tls, (*XExpr)(_pSrc.XpPartIdxWhere), (*XExpr)(_pDest.XpPartIdxWhere), int32(-1)) != 0 {
102739  		return int32(0)
102740  	}
102741  	return int32(1)
102742  }
102743  
102744  var _xferCompatibleIndexØ00__func__Ø000 [20]int8
102745  
102746  func init() {
102747  	crt.Xstrncpy(nil, &_xferCompatibleIndexØ00__func__Ø000[0], str(118899), 20)
102748  }
102749  
102750  // C comment
102751  //  /*
102752  //  ** Locate or create an AutoincInfo structure associated with table pTab
102753  //  ** which is in database iDb.  Return the register number for the register
102754  //  ** that holds the maximum rowid.  Return zero if pTab is not an AUTOINCREMENT
102755  //  ** table.  (Also return zero when doing a VACUUM since we do not want to
102756  //  ** update the AUTOINCREMENT counters during a VACUUM.)
102757  //  **
102758  //  ** There is at most one AutoincInfo structure per table even if the
102759  //  ** same table is autoincremented multiple times due to inserts within
102760  //  ** triggers.  A new AutoincInfo structure is created if this is the
102761  //  ** first use of table pTab.  On 2nd and subsequent uses, the original
102762  //  ** AutoincInfo structure is used.
102763  //  **
102764  //  ** Three memory locations are allocated:
102765  //  **
102766  //  **   (1)  Register to hold the name of the pTab table.
102767  //  **   (2)  Register to hold the maximum ROWID of pTab.
102768  //  **   (3)  Register to hold the rowid in sqlite_sequence of pTab
102769  //  **
102770  //  ** The 2nd register is the one that is returned.  That is all the
102771  //  ** insert routine needs to know about.
102772  //  */
102773  func _autoIncBegin(tls *crt.TLS, _pParse *XParse, _iDb int32, _pTab *XTable) (r0 int32) {
102774  	var _memId int32
102775  	var _1_pToplevel *XParse
102776  	var _1_pInfo *XAutoincInfo
102777  	_memId = int32(0)
102778  	if (_pTab.XtabFlags&uint32(8)) == (0) || (((*Xsqlite3)(_pParse.Xdb).Xflags)&int32(268435456)) != int32(0) {
102779  		goto _1
102780  	}
102781  	_1_pToplevel = func() *XParse {
102782  		if _pParse.XpToplevel != nil {
102783  			return (*XParse)(_pParse.XpToplevel)
102784  		}
102785  		return _pParse
102786  	}()
102787  	_1_pInfo = (*XAutoincInfo)(_1_pToplevel.XpAinc)
102788  _4:
102789  	if (_1_pInfo != nil) && ((*XTable)(_1_pInfo.XpTab) != _pTab) {
102790  		_1_pInfo = (*XAutoincInfo)(_1_pInfo.XpNext)
102791  		goto _4
102792  	}
102793  	if _1_pInfo != nil {
102794  		goto _7
102795  	}
102796  	_1_pInfo = (*XAutoincInfo)(_sqlite3DbMallocRawNN(tls, (*Xsqlite3)(_pParse.Xdb), uint64(16)))
102797  	if _1_pInfo == nil {
102798  		return int32(0)
102799  	}
102800  	*(**XAutoincInfo)(unsafe.Pointer(&_1_pInfo.XpNext)) = (*XAutoincInfo)(_1_pToplevel.XpAinc)
102801  	*(**XAutoincInfo)(unsafe.Pointer(&_1_pToplevel.XpAinc)) = _1_pInfo
102802  	*(**XTable)(unsafe.Pointer(&_1_pInfo.XpTab)) = _pTab
102803  	_1_pInfo.XiDb = _iDb
102804  	_1_pToplevel.XnMem += 1
102805  	_1_pInfo.XregCtr = preInc2(&_1_pToplevel.XnMem, 1)
102806  	_1_pToplevel.XnMem += 1
102807  _7:
102808  	_memId = _1_pInfo.XregCtr
102809  _1:
102810  	return _memId
102811  }
102812  
102813  // C comment
102814  //  /*
102815  //  ** Update the maximum rowid for an autoincrement calculation.
102816  //  **
102817  //  ** This routine should be called when the regRowid register holds a
102818  //  ** new rowid that is about to be inserted.  If that new rowid is
102819  //  ** larger than the maximum rowid in the memId memory cell, then the
102820  //  ** memory cell is updated.
102821  //  */
102822  func _autoIncStep(tls *crt.TLS, _pParse *XParse, _memId int32, _regRowid int32) {
102823  	if _memId > int32(0) {
102824  		_sqlite3VdbeAddOp2(tls, (*TVdbe)(_pParse.XpVdbe), int32(148), _memId, _regRowid)
102825  	}
102826  }
102827  
102828  // C comment
102829  //  /*
102830  //  ** Return non-zero if the table pTab in database iDb or any of its indices
102831  //  ** have been opened at any point in the VDBE program. This is used to see if
102832  //  ** a statement of the form  "INSERT INTO <iDb, pTab> SELECT ..." can
102833  //  ** run without using a temporary table for the results of the SELECT.
102834  //  */
102835  func _readsTable(tls *crt.TLS, _p *XParse, _iDb int32, _pTab *XTable) (r0 int32) {
102836  	var _i, _iEnd, _2_tnum int32
102837  	var _v *TVdbe
102838  	var _2_pIndex *XIndex
102839  	var _1_pOp *XVdbeOp
102840  	var _pVTab *XVTable
102841  	_v = _sqlite3GetVdbe(tls, _p)
102842  	_iEnd = _sqlite3VdbeCurrentAddr(tls, _v)
102843  	_pVTab = func() *XVTable {
102844  		if _pTab.XnModuleArg != 0 {
102845  			return _sqlite3GetVTable(tls, (*Xsqlite3)(_p.Xdb), _pTab)
102846  		}
102847  		return nil
102848  	}()
102849  	_i = int32(1)
102850  _2:
102851  	if _i >= _iEnd {
102852  		goto _5
102853  	}
102854  	_1_pOp = _sqlite3VdbeGetOp(tls, _v, _i)
102855  	func() {
102856  		if _1_pOp == nil {
102857  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109010), unsafe.Pointer(&_readsTableØ00__func__Ø000), unsafe.Pointer(str(109376)))
102858  			crt.X__builtin_abort(tls)
102859  		}
102860  	}()
102861  	if int32(_1_pOp.Xopcode) != int32(106) || _1_pOp.Xp3 != _iDb {
102862  		goto _9
102863  	}
102864  	_2_tnum = _1_pOp.Xp2
102865  	if _2_tnum == _pTab.Xtnum {
102866  		return int32(1)
102867  	}
102868  	_2_pIndex = (*XIndex)(_pTab.XpIndex)
102869  _11:
102870  	if _2_pIndex == nil {
102871  		goto _14
102872  	}
102873  	if _2_tnum == _2_pIndex.Xtnum {
102874  		return int32(1)
102875  	}
102876  	_2_pIndex = (*XIndex)(_2_pIndex.XpNext)
102877  	goto _11
102878  _14:
102879  _9:
102880  	if (int32(_1_pOp.Xopcode) == int32(158)) && ((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_1_pOp.Xp4))) == _pVTab) {
102881  		func() {
102882  			if (*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer(&_1_pOp.Xp4))) == nil {
102883  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109025), unsafe.Pointer(&_readsTableØ00__func__Ø000), unsafe.Pointer(str(118919)))
102884  				crt.X__builtin_abort(tls)
102885  			}
102886  		}()
102887  		func() {
102888  			if int32(_1_pOp.Xp4type) != int32(-8) {
102889  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(109026), unsafe.Pointer(&_readsTableØ00__func__Ø000), unsafe.Pointer(str(70431)))
102890  				crt.X__builtin_abort(tls)
102891  			}
102892  		}()
102893  		return int32(1)
102894  	}
102895  	_i += 1
102896  	goto _2
102897  _5:
102898  	return int32(0)
102899  }
102900  
102901  var _readsTableØ00__func__Ø000 [11]int8
102902  
102903  func init() {
102904  	crt.Xstrncpy(nil, &_readsTableØ00__func__Ø000[0], str(118936), 11)
102905  }
102906  
102907  // C comment
102908  //  /*
102909  //  ** Generate code that evaluates the given expression and puts the result
102910  //  ** in register target.
102911  //  **
102912  //  ** Also make a copy of the expression results into another "cache" register
102913  //  ** and modify the expression so that the next time it is evaluated,
102914  //  ** the result is a copy of the cache register.
102915  //  **
102916  //  ** This routine is used for expressions that are used multiple
102917  //  ** times.  They are evaluated once and the results of the expression
102918  //  ** are reused.
102919  //  */
102920  func _sqlite3ExprCodeAndCache(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _target int32) {
102921  	var _iMem int32
102922  	var _v *TVdbe
102923  	_v = (*TVdbe)(_pParse.XpVdbe)
102924  	func() {
102925  		if _target <= int32(0) {
102926  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95114), unsafe.Pointer(&_sqlite3ExprCodeAndCacheØ00__func__Ø000), unsafe.Pointer(str(99622)))
102927  			crt.X__builtin_abort(tls)
102928  		}
102929  	}()
102930  	func() {
102931  		if int32(_pExpr.Xop) == int32(157) {
102932  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(95115), unsafe.Pointer(&_sqlite3ExprCodeAndCacheØ00__func__Ø000), unsafe.Pointer(str(118947)))
102933  			crt.X__builtin_abort(tls)
102934  		}
102935  	}()
102936  	_sqlite3ExprCode(tls, _pParse, _pExpr, _target)
102937  	_iMem = preInc2(&_pParse.XnMem, 1)
102938  	_sqlite3VdbeAddOp2(tls, _v, int32(64), _target, _iMem)
102939  	_exprToRegister(tls, _pExpr, _iMem)
102940  }
102941  
102942  var _sqlite3ExprCodeAndCacheØ00__func__Ø000 [24]int8
102943  
102944  func init() {
102945  	crt.Xstrncpy(nil, &_sqlite3ExprCodeAndCacheØ00__func__Ø000[0], str(118970), 24)
102946  }
102947  
102948  // C comment
102949  //  /*
102950  //  ** Parse context structure pFrom has just been used to create a sub-vdbe
102951  //  ** (trigger program). If an error has occurred, transfer error information
102952  //  ** from pFrom to pTo.
102953  //  */
102954  func _transferParseError(tls *crt.TLS, _pTo *XParse, _pFrom *XParse) {
102955  	func() {
102956  		if _pFrom.XzErrMsg != nil && _pFrom.XnErr == 0 {
102957  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123418), unsafe.Pointer(&_transferParseErrorØ00__func__Ø000), unsafe.Pointer(str(118994)))
102958  			crt.X__builtin_abort(tls)
102959  		}
102960  	}()
102961  	func() {
102962  		if _pTo.XzErrMsg != nil && _pTo.XnErr == 0 {
102963  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123419), unsafe.Pointer(&_transferParseErrorØ00__func__Ø000), unsafe.Pointer(str(119027)))
102964  			crt.X__builtin_abort(tls)
102965  		}
102966  	}()
102967  	if _pTo.XnErr == int32(0) {
102968  		_pTo.XzErrMsg = _pFrom.XzErrMsg
102969  		_pTo.XnErr = _pFrom.XnErr
102970  		_pTo.Xrc = _pFrom.Xrc
102971  		goto _7
102972  	}
102973  	_sqlite3DbFree(tls, (*Xsqlite3)(_pFrom.Xdb), unsafe.Pointer(_pFrom.XzErrMsg))
102974  _7:
102975  }
102976  
102977  var _transferParseErrorØ00__func__Ø000 [19]int8
102978  
102979  func init() {
102980  	crt.Xstrncpy(nil, &_transferParseErrorØ00__func__Ø000[0], str(119056), 19)
102981  }
102982  
102983  // C comment
102984  //  /*
102985  //  ** This function returns a pointer to the array of opcodes associated with
102986  //  ** the Vdbe passed as the first argument. It is the callers responsibility
102987  //  ** to arrange for the returned array to be eventually freed using the
102988  //  ** vdbeFreeOpArray() function.
102989  //  **
102990  //  ** Before returning, *pnOp is set to the number of entries in the returned
102991  //  ** array. Also, *pnMaxArg is set to the larger of its current value and
102992  //  ** the number of entries in the Vdbe.apArg[] array required to execute the
102993  //  ** returned program.
102994  //  */
102995  func _sqlite3VdbeTakeOpArray(tls *crt.TLS, _p *TVdbe, _pnOp *int32, _pnMaxArg *int32) (r0 *XVdbeOp) {
102996  	var _aOp *XVdbeOp
102997  	_aOp = (*XVdbeOp)(_p.XaOp)
102998  	func() {
102999  		if _aOp == nil || ((*Xsqlite3)(_p.Xdb).XmallocFailed) != 0 {
103000  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72108), unsafe.Pointer(&_sqlite3VdbeTakeOpArrayØ00__func__Ø000), unsafe.Pointer(str(119075)))
103001  			crt.X__builtin_abort(tls)
103002  		}
103003  	}()
103004  	func() {
103005  		if _p.XbtreeMask != (0) {
103006  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72111), unsafe.Pointer(&_sqlite3VdbeTakeOpArrayØ00__func__Ø000), unsafe.Pointer(str(119103)))
103007  			crt.X__builtin_abort(tls)
103008  		}
103009  	}()
103010  	_resolveP2Values(tls, _p, _pnMaxArg)
103011  	*_pnOp = _p.XnOp
103012  	*(**XVdbeOp)(unsafe.Pointer(&_p.XaOp)) = nil
103013  	return _aOp
103014  }
103015  
103016  var _sqlite3VdbeTakeOpArrayØ00__func__Ø000 [23]int8
103017  
103018  func init() {
103019  	crt.Xstrncpy(nil, &_sqlite3VdbeTakeOpArrayØ00__func__Ø000[0], str(119131), 23)
103020  }
103021  
103022  // C comment
103023  //  /*
103024  //  ** Generate code to drop a table.
103025  //  */
103026  func _sqlite3CodeDropTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _iDb int32, _isView int32) {
103027  	var _db *Xsqlite3
103028  	var _pDb *XDb
103029  	var _pTrigger *XTrigger
103030  	var _v *TVdbe
103031  	_db = (*Xsqlite3)(_pParse.Xdb)
103032  	_pDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb))
103033  	_v = _sqlite3GetVdbe(tls, _pParse)
103034  	func() {
103035  		if _v == nil {
103036  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102140), unsafe.Pointer(&_sqlite3CodeDropTableØ00__func__Ø000), unsafe.Pointer(str(42019)))
103037  			crt.X__builtin_abort(tls)
103038  		}
103039  	}()
103040  	_sqlite3BeginWriteOperation(tls, _pParse, int32(1), _iDb)
103041  	if _pTab.XnModuleArg != 0 {
103042  		_sqlite3VdbeAddOp0(tls, _v, int32(155))
103043  	}
103044  	_pTrigger = _sqlite3TriggerList(tls, _pParse, _pTab)
103045  _3:
103046  	if _pTrigger != nil {
103047  		func() {
103048  			if (*XSchema)(_pTrigger.XpSchema) != (*XSchema)(_pTab.XpSchema) && (*XSchema)(_pTrigger.XpSchema) != (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(1)).XpSchema) {
103049  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102155), unsafe.Pointer(&_sqlite3CodeDropTableØ00__func__Ø000), unsafe.Pointer(str(119154)))
103050  				crt.X__builtin_abort(tls)
103051  			}
103052  		}()
103053  		_sqlite3DropTriggerPtr(tls, _pParse, _pTrigger)
103054  		_pTrigger = (*XTrigger)(_pTrigger.XpNext)
103055  		goto _3
103056  	}
103057  	if (_pTab.XtabFlags & uint32(8)) != 0 {
103058  		_sqlite3NestedParse(tls, _pParse, str(119228), unsafe.Pointer(_pDb.XzDbSName), unsafe.Pointer(_pTab.XzName))
103059  	}
103060  	_sqlite3NestedParse(tls, _pParse, str(119273), unsafe.Pointer(_pDb.XzDbSName), unsafe.Pointer(str(49981)), unsafe.Pointer(_pTab.XzName))
103061  	if (_isView == 0) && (_pTab.XnModuleArg == 0) {
103062  		_destroyTable(tls, _pParse, _pTab)
103063  	}
103064  	if _pTab.XnModuleArg != 0 {
103065  		_sqlite3VdbeAddOp4(tls, _v, int32(157), _iDb, int32(0), int32(0), _pTab.XzName, int32(0))
103066  	}
103067  	_sqlite3VdbeAddOp4(tls, _v, int32(141), _iDb, int32(0), int32(0), _pTab.XzName, int32(0))
103068  	_sqlite3ChangeCookie(tls, _pParse, _iDb)
103069  	_sqliteViewResetAll(tls, _db, _iDb)
103070  }
103071  
103072  var _sqlite3CodeDropTableØ00__func__Ø000 [21]int8
103073  
103074  func init() {
103075  	crt.Xstrncpy(nil, &_sqlite3CodeDropTableØ00__func__Ø000[0], str(119329), 21)
103076  }
103077  
103078  // C comment
103079  //  /*
103080  //  ** Drop a trigger given a pointer to that trigger.
103081  //  */
103082  func _sqlite3DropTriggerPtr(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger) {
103083  	var _iDb, _1_code int32
103084  	var _1_zDb, _1_zTab *int8
103085  	var _db *Xsqlite3
103086  	var _pTable *XTable
103087  	var _v *TVdbe
103088  	_db = (*Xsqlite3)(_pParse.Xdb)
103089  	_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), (*XSchema)(_pTrigger.XpSchema))
103090  	func() {
103091  		if _iDb < int32(0) || _iDb >= _db.XnDb {
103092  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123183), unsafe.Pointer(&_sqlite3DropTriggerPtrØ00__func__Ø000), unsafe.Pointer(str(21693)))
103093  			crt.X__builtin_abort(tls)
103094  		}
103095  	}()
103096  	_pTable = _tableOfTrigger(tls, _pTrigger)
103097  	func() {
103098  		if _pTable == nil {
103099  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123185), unsafe.Pointer(&_sqlite3DropTriggerPtrØ00__func__Ø000), unsafe.Pointer(str(94111)))
103100  			crt.X__builtin_abort(tls)
103101  		}
103102  	}()
103103  	func() {
103104  		if (*XSchema)(_pTable.XpSchema) != (*XSchema)(_pTrigger.XpSchema) && _iDb != int32(1) {
103105  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123186), unsafe.Pointer(&_sqlite3DropTriggerPtrØ00__func__Ø000), unsafe.Pointer(str(119350)))
103106  			crt.X__builtin_abort(tls)
103107  		}
103108  	}()
103109  	_1_code = int32(16)
103110  	_1_zDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
103111  	_1_zTab = func() *int8 {
103112  		if int32(1) != 0 && (_iDb == int32(1)) {
103113  			return str(49962)
103114  		}
103115  		return str(49981)
103116  	}()
103117  	if _iDb == int32(1) {
103118  		_1_code = int32(14)
103119  	}
103120  	if _sqlite3AuthCheck(tls, _pParse, _1_code, _pTrigger.XzName, _pTable.XzName, _1_zDb) != 0 || _sqlite3AuthCheck(tls, _pParse, int32(9), _1_zTab, nil, _1_zDb) != 0 {
103121  		return
103122  	}
103123  	func() {
103124  		if _pTable == nil {
103125  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123202), unsafe.Pointer(&_sqlite3DropTriggerPtrØ00__func__Ø000), unsafe.Pointer(str(21911)))
103126  			crt.X__builtin_abort(tls)
103127  		}
103128  	}()
103129  	if store60(&_v, _sqlite3GetVdbe(tls, _pParse)) != nil {
103130  		_sqlite3NestedParse(tls, _pParse, str(119395), unsafe.Pointer(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName), unsafe.Pointer(str(49981)), unsafe.Pointer(_pTrigger.XzName))
103131  		_sqlite3ChangeCookie(tls, _pParse, _iDb)
103132  		_sqlite3VdbeAddOp4(tls, _v, int32(143), _iDb, int32(0), int32(0), _pTrigger.XzName, int32(0))
103133  	}
103134  }
103135  
103136  var _sqlite3DropTriggerPtrØ00__func__Ø000 [22]int8
103137  
103138  func init() {
103139  	crt.Xstrncpy(nil, &_sqlite3DropTriggerPtrØ00__func__Ø000[0], str(119446), 22)
103140  }
103141  
103142  // C comment
103143  //  /*
103144  //  ** Write VDBE code to erase table pTab and all associated indices on disk.
103145  //  ** Code to update the sqlite_master tables and internal schema definitions
103146  //  ** in case a root-page belonging to another table is moved by the btree layer
103147  //  ** is also added (this can happen with an auto-vacuum database).
103148  //  */
103149  func _destroyTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable) {
103150  	var _iTab, _iDestroyed, _1_iLargest, _3_iIdx, _6_iDb int32
103151  	var _1_pIdx *XIndex
103152  	_iTab = _pTab.Xtnum
103153  	_iDestroyed = int32(0)
103154  _0:
103155  	_1_iLargest = int32(0)
103156  	if (_iDestroyed == int32(0)) || (_iTab < _iDestroyed) {
103157  		_1_iLargest = _iTab
103158  	}
103159  	_1_pIdx = (*XIndex)(_pTab.XpIndex)
103160  _4:
103161  	if _1_pIdx == nil {
103162  		goto _7
103163  	}
103164  	_3_iIdx = _1_pIdx.Xtnum
103165  	func() {
103166  		if (*XSchema)(_1_pIdx.XpSchema) != (*XSchema)(_pTab.XpSchema) {
103167  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102089), unsafe.Pointer(&_destroyTableØ00__func__Ø000), unsafe.Pointer(str(115165)))
103168  			crt.X__builtin_abort(tls)
103169  		}
103170  	}()
103171  	if ((_iDestroyed == int32(0)) || (_3_iIdx < _iDestroyed)) && (_3_iIdx > _1_iLargest) {
103172  		_1_iLargest = _3_iIdx
103173  	}
103174  	_1_pIdx = (*XIndex)(_1_pIdx.XpNext)
103175  	goto _4
103176  _7:
103177  	if _1_iLargest == int32(0) {
103178  		return
103179  	}
103180  	_6_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), (*XSchema)(_pTab.XpSchema))
103181  	func() {
103182  		if _6_iDb < int32(0) || _6_iDb >= ((*Xsqlite3)(_pParse.Xdb).XnDb) {
103183  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102098), unsafe.Pointer(&_destroyTableØ00__func__Ø000), unsafe.Pointer(str(102366)))
103184  			crt.X__builtin_abort(tls)
103185  		}
103186  	}()
103187  	_destroyRootPage(tls, _pParse, _1_iLargest, _6_iDb)
103188  	_iDestroyed = _1_iLargest
103189  	goto _0
103190  }
103191  
103192  var _destroyTableØ00__func__Ø000 [13]int8
103193  
103194  func init() {
103195  	crt.Xstrncpy(nil, &_destroyTableØ00__func__Ø000[0], str(119468), 13)
103196  }
103197  
103198  func _destroyRootPage(tls *crt.TLS, _pParse *XParse, _iTable int32, _iDb int32) {
103199  	var _r1 int32
103200  	var _v *TVdbe
103201  	_v = _sqlite3GetVdbe(tls, _pParse)
103202  	_r1 = _sqlite3GetTempReg(tls, _pParse)
103203  	func() {
103204  		if _iTable <= int32(1) {
103205  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(102026), unsafe.Pointer(&_destroyRootPageØ00__func__Ø000), unsafe.Pointer(str(119481)))
103206  			crt.X__builtin_abort(tls)
103207  		}
103208  	}()
103209  	_sqlite3VdbeAddOp3(tls, _v, int32(133), _iTable, _r1, _iDb)
103210  	_sqlite3MayAbort(tls, _pParse)
103211  	_sqlite3NestedParse(tls, _pParse, str(119490), unsafe.Pointer(elem27((*XDb)((*Xsqlite3)(_pParse.Xdb).XaDb), uintptr(_iDb)).XzDbSName), unsafe.Pointer(str(49981)), _iTable, _r1, _r1)
103212  	_sqlite3ReleaseTempReg(tls, _pParse, _r1)
103213  }
103214  
103215  var _destroyRootPageØ00__func__Ø000 [16]int8
103216  
103217  func init() {
103218  	crt.Xstrncpy(nil, &_destroyRootPageØ00__func__Ø000[0], str(119546), 16)
103219  }
103220  
103221  // C comment
103222  //  /*
103223  //  ** Clear the column names from every VIEW in database idx.
103224  //  */
103225  func _sqliteViewResetAll(tls *crt.TLS, _db *Xsqlite3, _idx int32) {
103226  	var _i *XHashElem
103227  	var _1_pTab *XTable
103228  	func() {
103229  		if _sqlite3SchemaMutexHeld(tls, _db, _idx, nil) == 0 {
103230  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101959), unsafe.Pointer(&_sqliteViewResetAllØ00__func__Ø000), unsafe.Pointer(str(119562)))
103231  			crt.X__builtin_abort(tls)
103232  		}
103233  	}()
103234  	if (int32((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_idx)).XpSchema).XschemaFlags) & int32(2)) != int32(2) {
103235  		return
103236  	}
103237  	_i = (*XHashElem)(((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_idx)).XpSchema).XtblHash).Xfirst)
103238  _3:
103239  	if _i == nil {
103240  		goto _6
103241  	}
103242  	_1_pTab = (*XTable)(_i.Xdata)
103243  	if _1_pTab.XpSelect != nil {
103244  		_sqlite3DeleteColumnNames(tls, _db, _1_pTab)
103245  		*(**XColumn)(unsafe.Pointer(&_1_pTab.XaCol)) = nil
103246  		_1_pTab.XnCol = 0
103247  	}
103248  	_i = (*XHashElem)(_i.Xnext)
103249  	goto _3
103250  _6:
103251  	{
103252  		p := &((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_idx)).XpSchema).XschemaFlags)
103253  		*p = uint16(int32(*p) & int32(-3))
103254  	}
103255  }
103256  
103257  var _sqliteViewResetAllØ00__func__Ø000 [19]int8
103258  
103259  func init() {
103260  	crt.Xstrncpy(nil, &_sqliteViewResetAllØ00__func__Ø000[0], str(119597), 19)
103261  }
103262  
103263  // C comment
103264  //  /*
103265  //  ** The parser calls this routine in order to create a new VIEW
103266  //  */
103267  func _sqlite3CreateView(tls *crt.TLS, _pParse *XParse, _pBegin *XToken, _pName1 *XToken, _pName2 *XToken, _pCNames *XExprList, _pSelect *XSelect, _isTemp int32, _noErr int32) {
103268  	var _n, _iDb int32
103269  	var _z *int8
103270  	var _sEnd XToken
103271  	var _db *Xsqlite3
103272  	var _p *XTable
103273  	var _pName *XToken
103274  	var _sFix XDbFixer
103275  	_pName = nil
103276  	_db = (*Xsqlite3)(_pParse.Xdb)
103277  	if int32(_pParse.XnVar) > int32(0) {
103278  		_sqlite3ErrorMsg(tls, _pParse, str(119616))
103279  		goto _create_view_fail
103280  	}
103281  	_sqlite3StartTable(tls, _pParse, _pName1, _pName2, _isTemp, int32(1), int32(0), _noErr)
103282  	_p = (*XTable)(_pParse.XpNewTable)
103283  	if (_p == nil) || _pParse.XnErr != 0 {
103284  		goto _create_view_fail
103285  	}
103286  	_sqlite3TwoPartName(tls, _pParse, _pName1, _pName2, &_pName)
103287  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_p.XpSchema))
103288  	_sqlite3FixInit(tls, &_sFix, _pParse, _iDb, str(111849), _pName)
103289  	if _sqlite3FixSelect(tls, &_sFix, _pSelect) != 0 {
103290  		goto _create_view_fail
103291  	}
103292  	*(**XSelect)(unsafe.Pointer(&_p.XpSelect)) = _sqlite3SelectDup(tls, _db, _pSelect, int32(1))
103293  	*(**XExprList)(unsafe.Pointer(&_p.XpCheck)) = _sqlite3ExprListDup(tls, _db, _pCNames, int32(1))
103294  	if _db.XmallocFailed != 0 {
103295  		goto _create_view_fail
103296  	}
103297  	_sEnd = _pParse.XsLastToken
103298  	func() {
103299  		if int32(*elem1(_sEnd.Xz, 0)) == int32(0) {
103300  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101815), unsafe.Pointer(&_sqlite3CreateViewØ00__func__Ø000), unsafe.Pointer(str(119652)))
103301  			crt.X__builtin_abort(tls)
103302  		}
103303  	}()
103304  	if int32(*elem1(_sEnd.Xz, 0)) != int32(59) {
103305  		*(*uintptr)(unsafe.Pointer(&_sEnd.Xz)) += uintptr(_sEnd.Xn)
103306  	}
103307  	_sEnd.Xn = 0
103308  	_n = int32(uintptr(unsafe.Pointer(_sEnd.Xz)) - uintptr(unsafe.Pointer(_pBegin.Xz)))
103309  	func() {
103310  		if _n <= int32(0) {
103311  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(101821), unsafe.Pointer(&_sqlite3CreateViewØ00__func__Ø000), unsafe.Pointer(str(1376)))
103312  			crt.X__builtin_abort(tls)
103313  		}
103314  	}()
103315  	_z = _pBegin.Xz
103316  _10:
103317  	if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_z, uintptr(_n-int32(1))))))) & int32(1)) != 0 {
103318  		_n -= 1
103319  		goto _10
103320  	}
103321  	_sEnd.Xz = elem1(_z, uintptr(_n-int32(1)))
103322  	_sEnd.Xn = uint32(1)
103323  	_sqlite3EndTable(tls, _pParse, nil, &_sEnd, 0, nil)
103324  _create_view_fail:
103325  	_sqlite3SelectDelete(tls, _db, _pSelect)
103326  	_sqlite3ExprListDelete(tls, _db, _pCNames)
103327  }
103328  
103329  var _sqlite3CreateViewØ00__func__Ø000 [18]int8
103330  
103331  func init() {
103332  	crt.Xstrncpy(nil, &_sqlite3CreateViewØ00__func__Ø000[0], str(119665), 18)
103333  }
103334  
103335  func _parserDoubleLinkSelect(tls *crt.TLS, _pParse *XParse, _p *XSelect) {
103336  	var _1_mxSelect, _1_cnt int32
103337  	var _1_pNext, _1_pLoop *XSelect
103338  	if _p.XpPrior == nil {
103339  		goto _0
103340  	}
103341  	_1_pNext = nil
103342  	_1_cnt = int32(0)
103343  	_1_pLoop = _p
103344  _1:
103345  	if _1_pLoop == nil {
103346  		goto _4
103347  	}
103348  	*(**XSelect)(unsafe.Pointer(&_1_pLoop.XpNext)) = _1_pNext
103349  	_1_pLoop.XselFlags |= uint32(256)
103350  	*func() *int32 {
103351  		*func() **XSelect { _1_pNext = _1_pLoop; return &_1_pLoop }() = (*XSelect)(_1_pLoop.XpPrior)
103352  		return &_1_cnt
103353  	}() += 1
103354  	goto _1
103355  _4:
103356  	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) {
103357  		_sqlite3ErrorMsg(tls, _pParse, str(119683))
103358  	}
103359  _0:
103360  }
103361  
103362  var _yy_reduceØ00__func__Ø000 [10]int8
103363  
103364  func init() {
103365  	crt.Xstrncpy(nil, &_yy_reduceØ00__func__Ø000[0], str(119717), 10)
103366  }
103367  
103368  // C comment
103369  //  /*
103370  //  ** Set the ExprList.a[].zSpan element of the most recently added item
103371  //  ** on the expression list.
103372  //  **
103373  //  ** pList might be NULL following an OOM error.  But pSpan should never be
103374  //  ** NULL.  If a memory allocation fails, the pParse->db->mallocFailed flag
103375  //  ** is set.
103376  //  */
103377  func _sqlite3ExprListSetSpan(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _pSpan *XExprSpan) {
103378  	var _db *Xsqlite3
103379  	var _1_pItem *TExprList_item
103380  	_db = (*Xsqlite3)(_pParse.Xdb)
103381  	func() {
103382  		if _pList == nil && int32(_db.XmallocFailed) == int32(0) {
103383  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92521), unsafe.Pointer(&_sqlite3ExprListSetSpanØ00__func__Ø000), unsafe.Pointer(str(119727)))
103384  			crt.X__builtin_abort(tls)
103385  		}
103386  	}()
103387  	if _pList != nil {
103388  		_1_pItem = elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_pList.XnExpr-int32(1)))
103389  		func() {
103390  			if _pList.XnExpr <= int32(0) {
103391  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92524), unsafe.Pointer(&_sqlite3ExprListSetSpanØ00__func__Ø000), unsafe.Pointer(str(21290)))
103392  				crt.X__builtin_abort(tls)
103393  			}
103394  		}()
103395  		func() {
103396  			if _db.XmallocFailed == 0 && (*XExpr)(_1_pItem.XpExpr) != (*XExpr)(_pSpan.XpExpr) {
103397  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92525), unsafe.Pointer(&_sqlite3ExprListSetSpanØ00__func__Ø000), unsafe.Pointer(str(119759)))
103398  				crt.X__builtin_abort(tls)
103399  			}
103400  		}()
103401  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_1_pItem.XzSpan))
103402  		_1_pItem.XzSpan = _sqlite3DbStrNDup(tls, _db, _pSpan.XzStart, uint64(int32(uintptr(unsafe.Pointer(_pSpan.XzEnd))-uintptr(unsafe.Pointer(_pSpan.XzStart)))))
103403  	}
103404  }
103405  
103406  var _sqlite3ExprListSetSpanØ00__func__Ø000 [23]int8
103407  
103408  func init() {
103409  	crt.Xstrncpy(nil, &_sqlite3ExprListSetSpanØ00__func__Ø000[0], str(119806), 23)
103410  }
103411  
103412  // C comment
103413  //  /*
103414  //  ** When building up a FROM clause in the parser, the join operator
103415  //  ** is initially attached to the left operand.  But the code generator
103416  //  ** expects the join operator to be on the right operand.  This routine
103417  //  ** Shifts all join operators from left to right for an entire FROM
103418  //  ** clause.
103419  //  **
103420  //  ** Example: Suppose the join is like this:
103421  //  **
103422  //  **           A natural cross join B
103423  //  **
103424  //  ** The operator is "natural cross join".  The A and B operands are stored
103425  //  ** in p->a[0] and p->a[1], respectively.  The parser initially stores the
103426  //  ** operator with A.  This routine shifts that operator over to B.
103427  //  */
103428  func _sqlite3SrcListShiftJoinType(tls *crt.TLS, _p *XSrcList) {
103429  	var _1_i int32
103430  	if _p == nil {
103431  		goto _0
103432  	}
103433  	_1_i = _p.XnSrc - int32(1)
103434  _1:
103435  	if _1_i <= int32(0) {
103436  		goto _4
103437  	}
103438  	(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
103439  	_1_i -= 1
103440  	goto _1
103441  _4:
103442  	(elem6((*TSrcList_item)(unsafe.Pointer(&_p.Xa)), 0).Xfg).Xjointype = 0
103443  _0:
103444  }
103445  
103446  // C comment
103447  //  /*
103448  //  ** Add an INDEXED BY or NOT INDEXED clause to the most recently added
103449  //  ** element of the source-list passed as the second argument.
103450  //  */
103451  func _sqlite3SrcListIndexedBy(tls *crt.TLS, _pParse *XParse, _p *XSrcList, _pIndexedBy *XToken) {
103452  	var _1_pItem *TSrcList_item
103453  	func() {
103454  		if _pIndexedBy == nil {
103455  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103576), unsafe.Pointer(&_sqlite3SrcListIndexedByØ00__func__Ø000), unsafe.Pointer(str(119829)))
103456  			crt.X__builtin_abort(tls)
103457  		}
103458  	}()
103459  	if _p == nil || func() int32 {
103460  		if _p.XnSrc > int32(0) {
103461  			return int32(1)
103462  		}
103463  		return func() int32 {
103464  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103577), unsafe.Pointer(&_sqlite3SrcListIndexedByØ00__func__Ø000), unsafe.Pointer(str(4809)))
103465  			crt.X__builtin_abort(tls)
103466  			return int32(0)
103467  		}()
103468  	}() == 0 {
103469  		goto _5
103470  	}
103471  	_1_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&_p.Xa)), uintptr(_p.XnSrc-int32(1)))
103472  	func() {
103473  		if int32((uint32(_1_pItem.Xfg.XnotIndexed)<<31)>>31) != int32(0) {
103474  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103579), unsafe.Pointer(&_sqlite3SrcListIndexedByØ00__func__Ø000), unsafe.Pointer(str(119843)))
103475  			crt.X__builtin_abort(tls)
103476  		}
103477  	}()
103478  	func() {
103479  		if int32((uint32((_1_pItem.Xfg.XnotIndexed)>>1)<<31)>>31) != int32(0) {
103480  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103580), unsafe.Pointer(&_sqlite3SrcListIndexedByØ00__func__Ø000), unsafe.Pointer(str(119867)))
103481  			crt.X__builtin_abort(tls)
103482  		}
103483  	}()
103484  	func() {
103485  		if int32((uint32((_1_pItem.Xfg.XnotIndexed)>>2)<<31)>>31) != int32(0) {
103486  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103581), unsafe.Pointer(&_sqlite3SrcListIndexedByØ00__func__Ø000), unsafe.Pointer(str(119892)))
103487  			crt.X__builtin_abort(tls)
103488  		}
103489  	}()
103490  	if (_pIndexedBy.Xn == uint32(1)) && (_pIndexedBy.Xz == nil) {
103491  		storebits5(&(_1_pItem.Xfg.XnotIndexed), int8(1), 1, 0)
103492  		goto _14
103493  	}
103494  	*(**int8)(unsafe.Pointer(&_1_pItem.Xu1)) = _sqlite3NameFromToken(tls, (*Xsqlite3)(_pParse.Xdb), _pIndexedBy)
103495  	storebits5(&(_1_pItem.Xfg.XnotIndexed), int8(bool2int((*(**int8)(unsafe.Pointer(&_1_pItem.Xu1))) != nil)), 2, 1)
103496  _14:
103497  _5:
103498  }
103499  
103500  var _sqlite3SrcListIndexedByØ00__func__Ø000 [24]int8
103501  
103502  func init() {
103503  	crt.Xstrncpy(nil, &_sqlite3SrcListIndexedByØ00__func__Ø000[0], str(119915), 24)
103504  }
103505  
103506  // C comment
103507  //  /*
103508  //  ** Add the list of function arguments to the SrcList entry for a
103509  //  ** table-valued-function.
103510  //  */
103511  func _sqlite3SrcListFuncArgs(tls *crt.TLS, _pParse *XParse, _p *XSrcList, _pList *XExprList) {
103512  	var _1_pItem *TSrcList_item
103513  	if _p != nil {
103514  		_1_pItem = elem6((*TSrcList_item)(unsafe.Pointer(&_p.Xa)), uintptr(_p.XnSrc-int32(1)))
103515  		func() {
103516  			if int32((uint32(_1_pItem.Xfg.XnotIndexed)<<31)>>31) != int32(0) {
103517  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103600), unsafe.Pointer(&_sqlite3SrcListFuncArgsØ00__func__Ø000), unsafe.Pointer(str(119843)))
103518  				crt.X__builtin_abort(tls)
103519  			}
103520  		}()
103521  		func() {
103522  			if int32((uint32((_1_pItem.Xfg.XnotIndexed)>>1)<<31)>>31) != int32(0) {
103523  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103601), unsafe.Pointer(&_sqlite3SrcListFuncArgsØ00__func__Ø000), unsafe.Pointer(str(119867)))
103524  				crt.X__builtin_abort(tls)
103525  			}
103526  		}()
103527  		func() {
103528  			if int32((uint32((_1_pItem.Xfg.XnotIndexed)>>2)<<31)>>31) != int32(0) {
103529  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103602), unsafe.Pointer(&_sqlite3SrcListFuncArgsØ00__func__Ø000), unsafe.Pointer(str(119892)))
103530  				crt.X__builtin_abort(tls)
103531  			}
103532  		}()
103533  		*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pItem.Xu1)))) = _pList
103534  		storebits5(&(_1_pItem.Xfg.XnotIndexed), int8(1), 4, 2)
103535  		goto _7
103536  	}
103537  	_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.Xdb), _pList)
103538  _7:
103539  }
103540  
103541  var _sqlite3SrcListFuncArgsØ00__func__Ø000 [23]int8
103542  
103543  func init() {
103544  	crt.Xstrncpy(nil, &_sqlite3SrcListFuncArgsØ00__func__Ø000[0], str(119939), 23)
103545  }
103546  
103547  // C comment
103548  //  /*
103549  //  ** Given 1 to 3 identifiers preceding the JOIN keyword, determine the
103550  //  ** type of join.  Return an integer constant that expresses that type
103551  //  ** in terms of the following bit values:
103552  //  **
103553  //  **     JT_INNER
103554  //  **     JT_CROSS
103555  //  **     JT_OUTER
103556  //  **     JT_NATURAL
103557  //  **     JT_LEFT
103558  //  **     JT_RIGHT
103559  //  **
103560  //  ** A full outer join is the combination of JT_LEFT and JT_RIGHT.
103561  //  **
103562  //  ** If an illegal or unsupported join type is seen, then still return
103563  //  ** a join type, but put an error in the pParse structure.
103564  //  */
103565  func _sqlite3JoinType(tls *crt.TLS, _pParse *XParse, _pA *XToken, _pB *XToken, _pC *XToken) (r0 int32) {
103566  	var _jointype, _i, _j int32
103567  	var _5_zSp *int8
103568  	var _p *XToken
103569  	var _apAll [3]*XToken
103570  	_jointype = int32(0)
103571  	*elem122((**XToken)(unsafe.Pointer(&_apAll)), 0) = _pA
103572  	*elem122((**XToken)(unsafe.Pointer(&_apAll)), uintptr(1)) = _pB
103573  	*elem122((**XToken)(unsafe.Pointer(&_apAll)), uintptr(2)) = _pC
103574  	_i = int32(0)
103575  _0:
103576  	if _i >= int32(3) || (*elem122((**XToken)(unsafe.Pointer(&_apAll)), uintptr(_i))) == nil {
103577  		goto _4
103578  	}
103579  	_p = *elem122((**XToken)(unsafe.Pointer(&_apAll)), uintptr(_i))
103580  	_j = int32(0)
103581  _5:
103582  	if _j >= int32(7) {
103583  		goto _8
103584  	}
103585  	if (_p.Xn == uint32(elem123((*t124)(unsafe.Pointer(&_sqlite3JoinTypeØ00aKeywordØ002)), uintptr(_j)).XnChar)) && (Xsqlite3_strnicmp(tls, _p.Xz, elem1((*int8)(unsafe.Pointer(&_sqlite3JoinTypeØ00zKeyTextØ001)), uintptr(elem123((*t124)(unsafe.Pointer(&_sqlite3JoinTypeØ00aKeywordØ002)), uintptr(_j)).Xi)), int32(_p.Xn)) == int32(0)) {
103586  		_jointype |= int32(elem123((*t124)(unsafe.Pointer(&_sqlite3JoinTypeØ00aKeywordØ002)), uintptr(_j)).Xcode)
103587  		goto _8
103588  	}
103589  	_j += 1
103590  	goto _5
103591  _8:
103592  	if _j >= int32(7) {
103593  		_jointype |= int32(64)
103594  		goto _4
103595  	}
103596  	_i += 1
103597  	goto _0
103598  _4:
103599  	if (_jointype&int32(33)) != int32(33) && (_jointype&int32(64)) == int32(0) {
103600  		goto _13
103601  	}
103602  	_5_zSp = str(119962)
103603  	func() {
103604  		if _pB == nil {
103605  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(116764), unsafe.Pointer(&_sqlite3JoinTypeØ00__func__Ø000), unsafe.Pointer(str(119964)))
103606  			crt.X__builtin_abort(tls)
103607  		}
103608  	}()
103609  	if _pC == nil {
103610  		*(*uintptr)(unsafe.Pointer(&_5_zSp)) += uintptr(1)
103611  	}
103612  	_sqlite3ErrorMsg(tls, _pParse, str(119970), unsafe.Pointer(_pA), unsafe.Pointer(_pB), unsafe.Pointer(_5_zSp), unsafe.Pointer(_pC))
103613  	_jointype = int32(1)
103614  	goto _19
103615  _13:
103616  	if ((_jointype & int32(32)) != int32(0)) && ((_jointype & int32(24)) != int32(8)) {
103617  		_sqlite3ErrorMsg(tls, _pParse, str(120014))
103618  		_jointype = int32(1)
103619  	}
103620  _19:
103621  	return _jointype
103622  
103623  	_ = _apAll
103624  	panic(0)
103625  }
103626  
103627  var _sqlite3JoinTypeØ00aKeywordØ002 [7]t124
103628  
103629  func init() {
103630  	_sqlite3JoinTypeØ00aKeywordØ002 = [7]t124{t124{XnChar: uint8(7), Xcode: uint8(4)}, t124{Xi: uint8(6), XnChar: uint8(4), Xcode: uint8(40)}, t124{Xi: uint8(10), XnChar: uint8(5), Xcode: uint8(32)}, t124{Xi: uint8(14), XnChar: uint8(5), Xcode: uint8(48)}, t124{Xi: uint8(19), XnChar: uint8(4), Xcode: uint8(56)}, t124{Xi: uint8(23), XnChar: uint8(5), Xcode: uint8(1)}, t124{Xi: uint8(28), XnChar: uint8(5), Xcode: uint8(3)}}
103631  }
103632  
103633  var _sqlite3JoinTypeØ00zKeyTextØ001 [34]int8
103634  
103635  func init() {
103636  	crt.Xstrncpy(nil, &_sqlite3JoinTypeØ00zKeyTextØ001[0], str(120069), 34)
103637  }
103638  
103639  var _sqlite3JoinTypeØ00__func__Ø000 [16]int8
103640  
103641  func init() {
103642  	crt.Xstrncpy(nil, &_sqlite3JoinTypeØ00__func__Ø000[0], str(120103), 16)
103643  }
103644  
103645  // C comment
103646  //  /*
103647  //  ** pColumns and pExpr form a vector assignment which is part of the SET
103648  //  ** clause of an UPDATE statement.  Like this:
103649  //  **
103650  //  **        (a,b,c) = (expr1,expr2,expr3)
103651  //  ** Or:    (a,b,c) = (SELECT x,y,z FROM ....)
103652  //  **
103653  //  ** For each term of the vector assignment, append new entries to the
103654  //  ** expression list pList.  In the case of a subquery on the RHS, append
103655  //  ** TK_SELECT_COLUMN expressions.
103656  //  */
103657  func _sqlite3ExprListAppendVector(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _pColumns *XIdList, _pExpr *XExpr) (r0 *XExprList) {
103658  	var _n, _i, _iFirst int32
103659  	var _db *Xsqlite3
103660  	var _2_pSubExpr, _4_pFirst *XExpr
103661  	_db = (*Xsqlite3)(_pParse.Xdb)
103662  	_iFirst = func() int32 {
103663  		if _pList != nil {
103664  			return _pList.XnExpr
103665  		}
103666  		return int32(0)
103667  	}()
103668  	if func() int32 {
103669  		if _pColumns == nil {
103670  			return func() int32 {
103671  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92423), unsafe.Pointer(&_sqlite3ExprListAppendVectorØ00__func__Ø000), unsafe.Pointer(str(4809)))
103672  				crt.X__builtin_abort(tls)
103673  				return int32(1)
103674  			}()
103675  		}
103676  		return int32(0)
103677  	}() != 0 {
103678  		goto _vector_append_error
103679  	}
103680  	if _pExpr == nil {
103681  		goto _vector_append_error
103682  	}
103683  	if (int32(_pExpr.Xop) != int32(119)) && (_pColumns.XnId != store2(&_n, _sqlite3ExprVectorSize(tls, _pExpr))) {
103684  		_sqlite3ErrorMsg(tls, _pParse, str(42926), _pColumns.XnId, _n)
103685  		goto _vector_append_error
103686  	}
103687  	_i = int32(0)
103688  _8:
103689  	if _i >= _pColumns.XnId {
103690  		goto _11
103691  	}
103692  	_2_pSubExpr = _sqlite3ExprForVectorField(tls, _pParse, _pExpr, _i)
103693  	_pList = _sqlite3ExprListAppend(tls, _pParse, _pList, _2_pSubExpr)
103694  	if _pList != nil {
103695  		func() {
103696  			if _pList.XnExpr != ((_iFirst + _i) + int32(1)) {
103697  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92441), unsafe.Pointer(&_sqlite3ExprListAppendVectorØ00__func__Ø000), unsafe.Pointer(str(120119)))
103698  				crt.X__builtin_abort(tls)
103699  			}
103700  		}()
103701  		elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_pList.XnExpr-int32(1))).XzName = elem42((*TIdList_item)(_pColumns.Xa), uintptr(_i)).XzName
103702  		elem42((*TIdList_item)(_pColumns.Xa), uintptr(_i)).XzName = nil
103703  	}
103704  	_i += 1
103705  	goto _8
103706  _11:
103707  	if ((_db.XmallocFailed == 0) && (int32(_pExpr.Xop) == int32(119))) && func() int32 {
103708  		if _pList != nil {
103709  			return int32(1)
103710  		}
103711  		return func() int32 {
103712  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92447), unsafe.Pointer(&_sqlite3ExprListAppendVectorØ00__func__Ø000), unsafe.Pointer(str(4809)))
103713  			crt.X__builtin_abort(tls)
103714  			return int32(0)
103715  		}()
103716  	}() != 0 {
103717  		_4_pFirst = (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_pList.Xa)), uintptr(_iFirst)).XpExpr)
103718  		func() {
103719  			if _4_pFirst == nil {
103720  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92449), unsafe.Pointer(&_sqlite3ExprListAppendVectorØ00__func__Ø000), unsafe.Pointer(str(120144)))
103721  				crt.X__builtin_abort(tls)
103722  			}
103723  		}()
103724  		func() {
103725  			if int32(_4_pFirst.Xop) != int32(159) {
103726  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(92450), unsafe.Pointer(&_sqlite3ExprListAppendVectorØ00__func__Ø000), unsafe.Pointer(str(120154)))
103727  				crt.X__builtin_abort(tls)
103728  			}
103729  		}()
103730  		*(**XExpr)(unsafe.Pointer(&_4_pFirst.XpRight)) = _pExpr
103731  		_pExpr = nil
103732  		_4_pFirst.XiTable = _pColumns.XnId
103733  	}
103734  _vector_append_error:
103735  	_sqlite3ExprDelete(tls, _db, _pExpr)
103736  	_sqlite3IdListDelete(tls, _db, _pColumns)
103737  	return _pList
103738  }
103739  
103740  var _sqlite3ExprListAppendVectorØ00__func__Ø000 [28]int8
103741  
103742  func init() {
103743  	crt.Xstrncpy(nil, &_sqlite3ExprListAppendVectorØ00__func__Ø000[0], str(120183), 28)
103744  }
103745  
103746  // C comment
103747  //  /*
103748  //  ** Append a new element to the given IdList.  Create a new IdList if
103749  //  ** need be.
103750  //  **
103751  //  ** A new IdList is returned, or NULL if malloc() fails.
103752  //  */
103753  func _sqlite3IdListAppend(tls *crt.TLS, _db *Xsqlite3, _pList *XIdList, _pToken *XToken) (r0 *XIdList) {
103754  	var _i int32
103755  	if _pList != nil {
103756  		goto _0
103757  	}
103758  	_pList = (*XIdList)(_sqlite3DbMallocZero(tls, _db, uint64(8)))
103759  	if _pList == nil {
103760  		return nil
103761  	}
103762  _0:
103763  	*(**TIdList_item)(unsafe.Pointer(&_pList.Xa)) = (*TIdList_item)(_sqlite3ArrayAllocate(tls, _db, _pList.Xa, int32(8), &_pList.XnId, &_i))
103764  	if _i < int32(0) {
103765  		_sqlite3IdListDelete(tls, _db, _pList)
103766  		return nil
103767  	}
103768  	elem42((*TIdList_item)(_pList.Xa), uintptr(_i)).XzName = _sqlite3NameFromToken(tls, _db, _pToken)
103769  	return _pList
103770  }
103771  
103772  func _spanSet(tls *crt.TLS, _pOut *XExprSpan, _pStart *XToken, _pEnd *XToken) {
103773  	_pOut.XzStart = _pStart.Xz
103774  	_pOut.XzEnd = elem1(_pEnd.Xz, uintptr(_pEnd.Xn))
103775  }
103776  
103777  // C comment
103778  //  /*
103779  //  ** Assign a variable number to an expression that encodes a wildcard
103780  //  ** in the original SQL statement.
103781  //  **
103782  //  ** Wildcards consisting of a single "?" are assigned the next sequential
103783  //  ** variable number.
103784  //  **
103785  //  ** Wildcards of the form "?nnn" are assigned the number "nnn".  We make
103786  //  ** sure "nnn" is not too big to avoid a denial of service attack when
103787  //  ** the SQL statement comes from an external source.
103788  //  **
103789  //  ** Wildcards of the form ":aaa", "@aaa", or "$aaa" are assigned the same number
103790  //  ** as the previous instance of the same wildcard.  Or if this is the first
103791  //  ** instance of the wildcard, the next sequential variable number is
103792  //  ** assigned.
103793  //  */
103794  func _sqlite3ExprAssignVarNumber(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _n uint32) {
103795  	var _x int16
103796  	var _2_doAdd, _3_bOk int32
103797  	var _3_i int64
103798  	var _z *int8
103799  	var _db *Xsqlite3
103800  	_db = (*Xsqlite3)(_pParse.Xdb)
103801  	if _pExpr == nil {
103802  		return
103803  	}
103804  	func() {
103805  		if (_pExpr.Xflags & uint32(25600)) != (0) {
103806  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91849), unsafe.Pointer(&_sqlite3ExprAssignVarNumberØ00__func__Ø000), unsafe.Pointer(str(120211)))
103807  			crt.X__builtin_abort(tls)
103808  		}
103809  	}()
103810  	_z = *(**int8)(unsafe.Pointer(&_pExpr.Xu))
103811  	func() {
103812  		if _z == nil {
103813  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91851), unsafe.Pointer(&_sqlite3ExprAssignVarNumberØ00__func__Ø000), unsafe.Pointer(str(44406)))
103814  			crt.X__builtin_abort(tls)
103815  		}
103816  	}()
103817  	func() {
103818  		if int32(*elem1(_z, 0)) == int32(0) {
103819  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91852), unsafe.Pointer(&_sqlite3ExprAssignVarNumberØ00__func__Ø000), unsafe.Pointer(str(120272)))
103820  			crt.X__builtin_abort(tls)
103821  		}
103822  	}()
103823  	func() {
103824  		if _n != uint32(_sqlite3Strlen30(tls, _z)) {
103825  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91853), unsafe.Pointer(&_sqlite3ExprAssignVarNumberØ00__func__Ø000), unsafe.Pointer(str(120280)))
103826  			crt.X__builtin_abort(tls)
103827  		}
103828  	}()
103829  	if int32(*elem1(_z, uintptr(1))) == int32(0) {
103830  		func() {
103831  			if int32(*elem1(_z, 0)) != int32(63) {
103832  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91856), unsafe.Pointer(&_sqlite3ExprAssignVarNumberØ00__func__Ø000), unsafe.Pointer(str(120307)))
103833  				crt.X__builtin_abort(tls)
103834  			}
103835  		}()
103836  		_x = preInc26(&_pParse.XnVar, 1)
103837  		goto _12
103838  	}
103839  	_2_doAdd = int32(0)
103840  	if int32(*elem1(_z, 0)) != int32(63) {
103841  		goto _13
103842  	}
103843  	if _n == uint32(2) {
103844  		_3_i = int64(int32(*elem1(_z, uintptr(1))) - int32(48))
103845  		_3_bOk = int32(1)
103846  		goto _15
103847  	}
103848  	_3_bOk = bool2int(int32(0) == _sqlite3Atoi64(tls, elem1(_z, uintptr(1)), &_3_i, int32(_n-uint32(1)), uint8(1)))
103849  _15:
103850  	if ((_3_bOk == int32(0)) || (_3_i < int64(1))) || (_3_i > int64(*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(9)))) {
103851  		_sqlite3ErrorMsg(tls, _pParse, str(120317), *elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(9)))
103852  		return
103853  	}
103854  	_x = int16(_3_i)
103855  	if int32(_x) > int32(_pParse.XnVar) {
103856  		_pParse.XnVar = int16(int32(_x))
103857  		_2_doAdd = int32(1)
103858  		goto _21
103859  	}
103860  	if _sqlite3VListNumToName(tls, _pParse.XpVList, int32(_x)) == nil {
103861  		_2_doAdd = int32(1)
103862  	}
103863  _21:
103864  	goto _22
103865  _13:
103866  	_x = int16(_sqlite3VListNameToNum(tls, _pParse.XpVList, _z, int32(_n)))
103867  	if int32(_x) == int32(0) {
103868  		_x = preInc26(&_pParse.XnVar, 1)
103869  		_2_doAdd = int32(1)
103870  	}
103871  _22:
103872  	if _2_doAdd != 0 {
103873  		_pParse.XpVList = _sqlite3VListAdd(tls, _db, _pParse.XpVList, _z, int32(_n), int32(_x))
103874  	}
103875  _12:
103876  	_pExpr.XiColumn = _x
103877  	if int32(_x) > (*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(9))) {
103878  		_sqlite3ErrorMsg(tls, _pParse, str(120360))
103879  	}
103880  }
103881  
103882  var _sqlite3ExprAssignVarNumberØ00__func__Ø000 [27]int8
103883  
103884  func init() {
103885  	crt.Xstrncpy(nil, &_sqlite3ExprAssignVarNumberØ00__func__Ø000[0], str(120383), 27)
103886  }
103887  
103888  // C comment
103889  //  /*
103890  //  ** Add a new name/number pair to a VList.  This might require that the
103891  //  ** VList object be reallocated, so return the new VList.  If an OOM
103892  //  ** error occurs, the original VList returned and the
103893  //  ** db->mallocFailed flag is set.
103894  //  **
103895  //  ** A VList is really just an array of integers.  To destroy a VList,
103896  //  ** simply pass it to sqlite3DbFree().
103897  //  **
103898  //  ** The first integer is the number of integers allocated for the whole
103899  //  ** VList.  The second integer is the number of integers actually used.
103900  //  ** Each name/number pair is encoded by subsequent groups of 3 or more
103901  //  ** integers.
103902  //  **
103903  //  ** Each name/number pair starts with two integers which are the numeric
103904  //  ** value for the pair and the size of the name/number pair, respectively.
103905  //  ** The text name overlays one or more following integers.  The text name
103906  //  ** is always zero-terminated.
103907  //  **
103908  //  ** Conceptually:
103909  //  **
103910  //  **    struct VList {
103911  //  **      int nAlloc;   // Number of allocated slots
103912  //  **      int nUsed;    // Number of used slots
103913  //  **      struct VListEntry {
103914  //  **        int iValue;    // Value for this entry
103915  //  **        int nSlot;     // Slots used by this entry
103916  //  **        // ... variable name goes here
103917  //  **      } a[0];
103918  //  **    }
103919  //  **
103920  //  ** During code generation, pointers to the variable names within the
103921  //  ** VList are taken.  When that happens, nAlloc is set to zero as an
103922  //  ** indication that the VList may never again be enlarged, since the
103923  //  ** accompanying realloc() would invalidate the pointers.
103924  //  */
103925  func _sqlite3VListAdd(tls *crt.TLS, _db *Xsqlite3, _pIn *int32, _zName *int8, _nName int32, _iVal int32) (r0 *int32) {
103926  	var _nInt, _i, _1_nAlloc int32
103927  	var _1_pOut *int32
103928  	var _z *int8
103929  	_nInt = (_nName / int32(4)) + int32(3)
103930  	func() {
103931  		if _pIn != nil && (*elem8(_pIn, 0)) < int32(3) {
103932  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29170), unsafe.Pointer(&_sqlite3VListAddØ00__func__Ø000), unsafe.Pointer(str(120410)))
103933  			crt.X__builtin_abort(tls)
103934  		}
103935  	}()
103936  	if _pIn != nil && ((*elem8(_pIn, uintptr(1)))+_nInt) <= (*elem8(_pIn, 0)) {
103937  		goto _4
103938  	}
103939  	_1_nAlloc = func() int32 {
103940  		if _pIn != nil {
103941  			return ((*elem8(_pIn, 0)) * int32(2))
103942  		}
103943  		return int32(10)
103944  	}() + _nInt
103945  	_1_pOut = (*int32)(_sqlite3DbRealloc(tls, _db, unsafe.Pointer(_pIn), uint64(uint32(_1_nAlloc)*uint32(4))))
103946  	if _1_pOut == nil {
103947  		return _pIn
103948  	}
103949  	if _pIn == nil {
103950  		*elem8(_1_pOut, uintptr(1)) = int32(2)
103951  	}
103952  	_pIn = _1_pOut
103953  	*elem8(_pIn, 0) = _1_nAlloc
103954  _4:
103955  	_i = *elem8(_pIn, uintptr(1))
103956  	*elem8(_pIn, uintptr(_i)) = _iVal
103957  	*elem8(_pIn, uintptr(_i+int32(1))) = _nInt
103958  	_z = (*int8)(unsafe.Pointer(elem8(_pIn, uintptr(_i+int32(2)))))
103959  	*elem8(_pIn, uintptr(1)) = _i + _nInt
103960  	func() {
103961  		if (*elem8(_pIn, uintptr(1))) > (*elem8(_pIn, 0)) {
103962  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(29185), unsafe.Pointer(&_sqlite3VListAddØ00__func__Ø000), unsafe.Pointer(str(120430)))
103963  			crt.X__builtin_abort(tls)
103964  		}
103965  	}()
103966  	crt.Xmemcpy(tls, unsafe.Pointer(_z), unsafe.Pointer(_zName), uint32(_nName))
103967  	*elem1(_z, uintptr(_nName)) = 0
103968  	return _pIn
103969  }
103970  
103971  var _sqlite3VListAddØ00__func__Ø000 [16]int8
103972  
103973  func init() {
103974  	crt.Xstrncpy(nil, &_sqlite3VListAddØ00__func__Ø000[0], str(120445), 16)
103975  }
103976  
103977  // C comment
103978  //  /*
103979  //  ** Construct a new expression node for a function with multiple
103980  //  ** arguments.
103981  //  */
103982  func _sqlite3ExprFunction(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _pToken *XToken) (r0 *XExpr) {
103983  	var _db *Xsqlite3
103984  	var _pNew *XExpr
103985  	_db = (*Xsqlite3)(_pParse.Xdb)
103986  	func() {
103987  		if _pToken == nil {
103988  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91815), unsafe.Pointer(&_sqlite3ExprFunctionØ00__func__Ø000), unsafe.Pointer(str(120461)))
103989  			crt.X__builtin_abort(tls)
103990  		}
103991  	}()
103992  	_pNew = _sqlite3ExprAlloc(tls, _db, int32(151), _pToken, int32(1))
103993  	if _pNew == nil {
103994  		_sqlite3ExprListDelete(tls, _db, _pList)
103995  		return nil
103996  	}
103997  	*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.Xx)))) = _pList
103998  	func() {
103999  		if (_pNew.Xflags & uint32(2048)) != (0) {
104000  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91822), unsafe.Pointer(&_sqlite3ExprFunctionØ00__func__Ø000), unsafe.Pointer(str(103903)))
104001  			crt.X__builtin_abort(tls)
104002  		}
104003  	}()
104004  	_sqlite3ExprSetHeightAndFlags(tls, _pParse, _pNew)
104005  	return _pNew
104006  }
104007  
104008  var _sqlite3ExprFunctionØ00__func__Ø000 [20]int8
104009  
104010  func init() {
104011  	crt.Xstrncpy(nil, &_sqlite3ExprFunctionØ00__func__Ø000[0], str(120468), 20)
104012  }
104013  
104014  // C comment
104015  //  /*
104016  //  ** Set the Expr.nHeight variable using the exprSetHeight() function. If
104017  //  ** the height is greater than the maximum allowed expression depth,
104018  //  ** leave an error in pParse.
104019  //  **
104020  //  ** Also propagate all EP_Propagate flags from the Expr.x.pList into
104021  //  ** Expr.flags.
104022  //  */
104023  func _sqlite3ExprSetHeightAndFlags(tls *crt.TLS, _pParse *XParse, _p *XExpr) {
104024  	if _pParse.XnErr != 0 {
104025  		return
104026  	}
104027  	_exprSetHeight(tls, _p)
104028  	_sqlite3ExprCheckHeight(tls, _pParse, _p.XnHeight)
104029  }
104030  
104031  func _spanBinaryExpr(tls *crt.TLS, _pParse *XParse, _op int32, _pLeft *XExprSpan, _pRight *XExprSpan) {
104032  	*(**XExpr)(unsafe.Pointer(&_pLeft.XpExpr)) = _sqlite3PExpr(tls, _pParse, _op, (*XExpr)(_pLeft.XpExpr), (*XExpr)(_pRight.XpExpr))
104033  	_pLeft.XzEnd = _pRight.XzEnd
104034  }
104035  
104036  func _exprNot(tls *crt.TLS, _pParse *XParse, _doNot int32, _pSpan *XExprSpan) {
104037  	if _doNot != 0 {
104038  		*(**XExpr)(unsafe.Pointer(&_pSpan.XpExpr)) = _sqlite3PExpr(tls, _pParse, int32(19), (*XExpr)(_pSpan.XpExpr), nil)
104039  	}
104040  }
104041  
104042  func _spanUnaryPostfix(tls *crt.TLS, _pParse *XParse, _op int32, _pOperand *XExprSpan, _pPostOp *XToken) {
104043  	*(**XExpr)(unsafe.Pointer(&_pOperand.XpExpr)) = _sqlite3PExpr(tls, _pParse, _op, (*XExpr)(_pOperand.XpExpr), nil)
104044  	_pOperand.XzEnd = elem1(_pPostOp.Xz, uintptr(_pPostOp.Xn))
104045  }
104046  
104047  func _binaryToUnaryIfNull(tls *crt.TLS, _pParse *XParse, _pY *XExpr, _pA *XExpr, _op int32) {
104048  	var _db *Xsqlite3
104049  	_db = (*Xsqlite3)(_pParse.Xdb)
104050  	if ((_pA != nil) && (_pY != nil)) && (int32(_pY.Xop) == int32(101)) {
104051  		_pA.Xop = uint8(_op)
104052  		_sqlite3ExprDelete(tls, _db, (*XExpr)(_pA.XpRight))
104053  		*(**XExpr)(unsafe.Pointer(&_pA.XpRight)) = nil
104054  	}
104055  }
104056  
104057  func _spanUnaryPrefix(tls *crt.TLS, _pOut *XExprSpan, _pParse *XParse, _op int32, _pOperand *XExprSpan, _pPreOp *XToken) {
104058  	_pOut.XzStart = _pPreOp.Xz
104059  	*(**XExpr)(unsafe.Pointer(&_pOut.XpExpr)) = _sqlite3PExpr(tls, _pParse, _op, (*XExpr)(_pOperand.XpExpr), nil)
104060  	_pOut.XzEnd = _pOperand.XzEnd
104061  }
104062  
104063  // C comment
104064  //  /*
104065  //  ** Add pSelect to the Expr.x.pSelect field.  Or, if pExpr is NULL (due
104066  //  ** do a memory allocation failure) then delete the pSelect object.
104067  //  */
104068  func _sqlite3PExprAddSelect(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _pSelect *XSelect) {
104069  	if _pExpr != nil {
104070  		*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pExpr.Xx)))) = _pSelect
104071  		_pExpr.Xflags |= uint32(2099200)
104072  		_sqlite3ExprSetHeightAndFlags(tls, _pParse, _pExpr)
104073  		goto _1
104074  	}
104075  	func() {
104076  		if ((*Xsqlite3)(_pParse.Xdb).XmallocFailed) == 0 {
104077  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(91751), unsafe.Pointer(&_sqlite3PExprAddSelectØ00__func__Ø000), unsafe.Pointer(str(42441)))
104078  			crt.X__builtin_abort(tls)
104079  		}
104080  	}()
104081  	_sqlite3SelectDelete(tls, (*Xsqlite3)(_pParse.Xdb), _pSelect)
104082  _1:
104083  }
104084  
104085  var _sqlite3PExprAddSelectØ00__func__Ø000 [22]int8
104086  
104087  func init() {
104088  	crt.Xstrncpy(nil, &_sqlite3PExprAddSelectØ00__func__Ø000[0], str(120488), 22)
104089  }
104090  
104091  func _parserAddExprIdListTerm(tls *crt.TLS, _pParse *XParse, _pPrior *XExprList, _pIdToken *XToken, _hasCollate int32, _sortOrder int32) (r0 *XExprList) {
104092  	var _p *XExprList
104093  	_p = _sqlite3ExprListAppend(tls, _pParse, _pPrior, nil)
104094  	if (_hasCollate != 0 || (_sortOrder != int32(-1))) && (int32(((*Xsqlite3)(_pParse.Xdb).Xinit).Xbusy) == int32(0)) {
104095  		_sqlite3ErrorMsg(tls, _pParse, str(120510), _pIdToken.Xn, unsafe.Pointer(_pIdToken.Xz))
104096  	}
104097  	_sqlite3ExprListSetName(tls, _pParse, _p, _pIdToken, int32(1))
104098  	return _p
104099  }
104100  
104101  // C comment
104102  //  /*
104103  //  ** This routine will drop an existing named index.  This routine
104104  //  ** implements the DROP INDEX statement.
104105  //  */
104106  func _sqlite3DropIndex(tls *crt.TLS, _pParse *XParse, _pName *XSrcList, _ifExists int32) {
104107  	var _iDb, _7_code int32
104108  	var _7_zDb, _7_zTab *int8
104109  	var _db *Xsqlite3
104110  	var _7_pTab *XTable
104111  	var _v *TVdbe
104112  	var _pIndex *XIndex
104113  	_db = (*Xsqlite3)(_pParse.Xdb)
104114  	func() {
104115  		if _pParse.XnErr != int32(0) {
104116  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103185), unsafe.Pointer(&_sqlite3DropIndexØ00__func__Ø000), unsafe.Pointer(str(112394)))
104117  			crt.X__builtin_abort(tls)
104118  		}
104119  	}()
104120  	if _db.XmallocFailed != 0 {
104121  		goto _exit_drop_index
104122  	}
104123  	func() {
104124  		if _pName.XnSrc != int32(1) {
104125  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103189), unsafe.Pointer(&_sqlite3DropIndexØ00__func__Ø000), unsafe.Pointer(str(114819)))
104126  			crt.X__builtin_abort(tls)
104127  		}
104128  	}()
104129  	if int32(0) != _sqlite3ReadSchema(tls, _pParse) {
104130  		goto _exit_drop_index
104131  	}
104132  	_pIndex = _sqlite3FindIndex(tls, _db, elem6((*TSrcList_item)(unsafe.Pointer(&_pName.Xa)), 0).XzName, elem6((*TSrcList_item)(unsafe.Pointer(&_pName.Xa)), 0).XzDatabase)
104133  	if _pIndex != nil {
104134  		goto _6
104135  	}
104136  	if _ifExists == 0 {
104137  		_sqlite3ErrorMsg(tls, _pParse, str(120548), unsafe.Pointer(_pName), int32(0))
104138  		goto _8
104139  	}
104140  	_sqlite3CodeVerifyNamedSchema(tls, _pParse, elem6((*TSrcList_item)(unsafe.Pointer(&_pName.Xa)), 0).XzDatabase)
104141  _8:
104142  	_pParse.XcheckSchema = uint8(1)
104143  	goto _exit_drop_index
104144  _6:
104145  	if int32((uint32(_pIndex.XidxType)<<30)>>30) != int32(0) {
104146  		_sqlite3ErrorMsg(tls, _pParse, str(120566), int32(0))
104147  		goto _exit_drop_index
104148  	}
104149  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pIndex.XpSchema))
104150  	_7_code = int32(10)
104151  	_7_pTab = (*XTable)(_pIndex.XpTable)
104152  	_7_zDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
104153  	_7_zTab = func() *int8 {
104154  		if int32(1) != 0 && (_iDb == int32(1)) {
104155  			return str(49962)
104156  		}
104157  		return str(49981)
104158  	}()
104159  	if _sqlite3AuthCheck(tls, _pParse, int32(9), _7_zTab, nil, _7_zDb) != 0 {
104160  		goto _exit_drop_index
104161  	}
104162  	if int32(1) != 0 && _iDb != 0 {
104163  		_7_code = int32(12)
104164  	}
104165  	if _sqlite3AuthCheck(tls, _pParse, _7_code, _pIndex.XzName, _7_pTab.XzName, _7_zDb) != 0 {
104166  		goto _exit_drop_index
104167  	}
104168  	_v = _sqlite3GetVdbe(tls, _pParse)
104169  	if _v != nil {
104170  		_sqlite3BeginWriteOperation(tls, _pParse, int32(1), _iDb)
104171  		_sqlite3NestedParse(tls, _pParse, str(120639), unsafe.Pointer(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName), unsafe.Pointer(str(49981)), unsafe.Pointer(_pIndex.XzName))
104172  		_sqlite3ClearStatTables(tls, _pParse, _iDb, str(93743), _pIndex.XzName)
104173  		_sqlite3ChangeCookie(tls, _pParse, _iDb)
104174  		_destroyRootPage(tls, _pParse, _pIndex.Xtnum, _iDb)
104175  		_sqlite3VdbeAddOp4(tls, _v, int32(142), _iDb, int32(0), int32(0), _pIndex.XzName, int32(0))
104176  	}
104177  _exit_drop_index:
104178  	_sqlite3SrcListDelete(tls, _db, _pName)
104179  }
104180  
104181  var _sqlite3DropIndexØ00__func__Ø000 [17]int8
104182  
104183  func init() {
104184  	crt.Xstrncpy(nil, &_sqlite3DropIndexØ00__func__Ø000[0], str(120688), 17)
104185  }
104186  
104187  // C comment
104188  //  /*
104189  //  ** The VACUUM command is used to clean up the database,
104190  //  ** collapse free space, etc.  It is modelled after the VACUUM command
104191  //  ** in PostgreSQL.  The VACUUM command works as follows:
104192  //  **
104193  //  **   (1)  Create a new transient database file
104194  //  **   (2)  Copy all content from the database being vacuumed into
104195  //  **        the new transient database file
104196  //  **   (3)  Copy content from the transient database back into the
104197  //  **        original database.
104198  //  **
104199  //  ** The transient database requires temporary disk space approximately
104200  //  ** equal to the size of the original database.  The copy operation of
104201  //  ** step (3) requires additional temporary disk space approximately equal
104202  //  ** to the size of the original database for the rollback journal.
104203  //  ** Hence, temporary disk space that is approximately 2x the size of the
104204  //  ** original database is required.  Every page of the database is written
104205  //  ** approximately 3 times:  Once for step (2) and twice for step (3).
104206  //  ** Two writes per page are required in step (3) because the original
104207  //  ** database content must be written into the rollback journal prior to
104208  //  ** overwriting the database with the vacuumed content.
104209  //  **
104210  //  ** Only 1x temporary space and only 1x writes would be required if
104211  //  ** the copy of step (3) were replaced by deleting the original database
104212  //  ** and renaming the transient database as the original.  But that will
104213  //  ** not work if other processes are attached to the original database.
104214  //  ** And a power loss in between deleting the original and renaming the
104215  //  ** transient would cause the database file to appear to be deleted
104216  //  ** following reboot.
104217  //  */
104218  func _sqlite3Vacuum(tls *crt.TLS, _pParse *XParse, _pNm *XToken) {
104219  	var _iDb int32
104220  	var _v *TVdbe
104221  	_v = _sqlite3GetVdbe(tls, _pParse)
104222  	_iDb = int32(0)
104223  	if _v == nil {
104224  		return
104225  	}
104226  	if _pNm == nil {
104227  		goto _1
104228  	}
104229  	_iDb = _sqlite3TwoPartName(tls, _pParse, _pNm, _pNm, &_pNm)
104230  	if _iDb < int32(0) {
104231  		return
104232  	}
104233  _1:
104234  	if _iDb != int32(1) {
104235  		_sqlite3VdbeAddOp1(tls, _v, int32(10), _iDb)
104236  		_sqlite3VdbeUsesBtree(tls, _v, _iDb)
104237  	}
104238  }
104239  
104240  // C comment
104241  //  /*
104242  //  ** Process a pragma statement.
104243  //  **
104244  //  ** Pragmas are of this form:
104245  //  **
104246  //  **      PRAGMA [schema.]id [= value]
104247  //  **
104248  //  ** The identifier might also be a string.  The value is a string, and
104249  //  ** identifier, or a number.  If minusFlag is true, then the value is
104250  //  ** a number that was preceded by a minus sign.
104251  //  **
104252  //  ** If the left side is "database.id" then pId1 is the database name
104253  //  ** and pId2 is the id.  If the left side is just "id" then pId1 is the
104254  //  ** id and pId2 is any empty string.
104255  //  */
104256  func _sqlite3Pragma(tls *crt.TLS, _pParse *XParse, _pId1 *XToken, _pId2 *XToken, _pValue *XToken, _minusFlag int32) {
104257  	var _99_cnum, _177_szThreshold int16
104258  	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
104259  	var _39_iLimit, _56_sz, _189_N, _191_N int64
104260  	var _177_opMask uint32
104261  	var _113_aiCols, _138_aRoot *int32
104262  	var _zLeft, _zRight, _zDb, _25_zRet, _33_zMode, _146_zErr, _148_zErr, _167_zOpt, _177_zSubSql, _194_zState *int8
104263  	var _db *Xsqlite3
104264  	var _14_pBt, _18_pBt, _41_pBt, _194_pBt *XBtree
104265  	var _pDb *XDb
104266  	var _27_pPager, _39_pPager *XPager
104267  	var _177_pSchema *XSchema
104268  	var _92_i, _106_p, _113_k, _138_x, _177_k *XHashElem
104269  	var _138_pTbls *XHash
104270  	var _84_pTab, _93_pTab, _95_pTab, _101_pTab, _108_pTab, _113_pTab, _113_pParent, _139_pTab, _141_pTab, _143_pTab, _177_pTab *XTable
104271  	var _v *TVdbe
104272  	var _pId *XToken
104273  	var _147_pCheck *XExprList
104274  	var _85_pCol *XColumn
104275  	var _85_pPk, _92_pIdx, _95_pIdx, _101_pIdx, _113_pIdx, _139_pIdx, _141_pIdx, _143_pIdx, _143_pPk, _143_pPrior, _177_pIdx *XIndex
104276  	var _11_aOp, _44_aOp, _155_aOp, _165_aOp, _166_aOp *XVdbeOp
104277  	var _107_pColl *XCollSeq
104278  	var _aFcntl [4]*int8
104279  	var _108_pFK, _113_pFK *XFKey
104280  	var _103_azOrigin [3]*int8
104281  	var _pPragma *XPragmaName
104282  	var _157_pEnc *TEncName
104283  	_zLeft = nil
104284  	_zRight = nil
104285  	_zDb = nil
104286  	_db = (*Xsqlite3)(_pParse.Xdb)
104287  	_v = _sqlite3GetVdbe(tls, _pParse)
104288  	if _v == nil {
104289  		return
104290  	}
104291  	_sqlite3VdbeRunOnlyOnce(tls, _v)
104292  	_pParse.XnMem = int32(2)
104293  	_iDb = _sqlite3TwoPartName(tls, _pParse, _pId1, _pId2, &_pId)
104294  	if _iDb < int32(0) {
104295  		return
104296  	}
104297  	_pDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb))
104298  	if (_iDb == int32(1)) && _sqlite3OpenTempDatabase(tls, _pParse) != 0 {
104299  		return
104300  	}
104301  	_zLeft = _sqlite3NameFromToken(tls, _db, _pId)
104302  	if _zLeft == nil {
104303  		return
104304  	}
104305  	if _minusFlag != 0 {
104306  		_zRight = _sqlite3MPrintf(tls, _db, str(120705), unsafe.Pointer(_pValue))
104307  		goto _6
104308  	}
104309  	_zRight = _sqlite3NameFromToken(tls, _db, _pValue)
104310  _6:
104311  	func() {
104312  		if _pId2 == nil {
104313  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113600), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(120709)))
104314  			crt.X__builtin_abort(tls)
104315  		}
104316  	}()
104317  	_zDb = func() *int8 {
104318  		if _pId2.Xn > (0) {
104319  			return _pDb.XzDbSName
104320  		}
104321  		return nil
104322  	}()
104323  	if _sqlite3AuthCheck(tls, _pParse, int32(19), _zLeft, _zRight, _zDb) != 0 {
104324  		goto _pragma_out
104325  	}
104326  	*elem0((**int8)(unsafe.Pointer(&_aFcntl)), 0) = nil
104327  	*elem0((**int8)(unsafe.Pointer(&_aFcntl)), uintptr(1)) = _zLeft
104328  	*elem0((**int8)(unsafe.Pointer(&_aFcntl)), uintptr(2)) = _zRight
104329  	*elem0((**int8)(unsafe.Pointer(&_aFcntl)), uintptr(3)) = nil
104330  	_db.XbusyHandler.XnBusy = int32(0)
104331  	_rc = Xsqlite3_file_control(tls, _db, _zDb, int32(14), unsafe.Pointer(&_aFcntl))
104332  	if _rc == int32(0) {
104333  		_sqlite3VdbeSetNumCols(tls, _v, int32(1))
104334  		_sqlite3VdbeSetColName(tls, _v, int32(0), int32(0), *elem0((**int8)(unsafe.Pointer(&_aFcntl)), 0), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
104335  		_returnSingleText(tls, _v, *elem0((**int8)(unsafe.Pointer(&_aFcntl)), 0))
104336  		Xsqlite3_free(tls, unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_aFcntl)), 0)))
104337  		goto _pragma_out
104338  	}
104339  	if _rc == int32(12) {
104340  		goto _13
104341  	}
104342  	if (*elem0((**int8)(unsafe.Pointer(&_aFcntl)), 0)) != nil {
104343  		_sqlite3ErrorMsg(tls, _pParse, str(24531), unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_aFcntl)), 0)))
104344  		Xsqlite3_free(tls, unsafe.Pointer(*elem0((**int8)(unsafe.Pointer(&_aFcntl)), 0)))
104345  	}
104346  	_pParse.XnErr += 1
104347  	_pParse.Xrc = _rc
104348  	goto _pragma_out
104349  _13:
104350  	_pPragma = _pragmaLocate(tls, _zLeft)
104351  	if _pPragma == nil {
104352  		goto _pragma_out
104353  	}
104354  	if (int32(_pPragma.XmPragFlg) & int32(1)) == int32(0) {
104355  		goto _16
104356  	}
104357  	if _sqlite3ReadSchema(tls, _pParse) != 0 {
104358  		goto _pragma_out
104359  	}
104360  _16:
104361  	if ((int32(_pPragma.XmPragFlg) & int32(2)) == int32(0)) && (((int32(_pPragma.XmPragFlg) & int32(4)) == int32(0)) || (_zRight == nil)) {
104362  		_setPragmaResultColumnNames(tls, _v, _pPragma)
104363  	}
104364  	switch int32(_pPragma.XePragTyp) {
104365  	case int32(0):
104366  		goto _50
104367  	case int32(1):
104368  		goto _29
104369  	case int32(2):
104370  		goto _37
104371  	case int32(4):
104372  		goto _31
104373  	case int32(5):
104374  		goto _32
104375  	case int32(6):
104376  		goto _47
104377  	case int32(7):
104378  		goto _43
104379  	case int32(8):
104380  		goto _51
104381  	case int32(10):
104382  		goto _42
104383  	case int32(11):
104384  		goto _22
104385  	case int32(12):
104386  		goto _49
104387  	case int32(13):
104388  		goto _45
104389  	case int32(14):
104390  		goto _44
104391  	case int32(15):
104392  		goto _30
104393  	case int32(16):
104394  		goto _40
104395  	case int32(17):
104396  		goto _41
104397  	case int32(18):
104398  		goto _48
104399  	case int32(19):
104400  		goto _27
104401  	case int32(20):
104402  		goto _28
104403  	case int32(22):
104404  		goto _26
104405  	case int32(23):
104406  		goto _25
104407  	case int32(24):
104408  		goto _33
104409  	case int32(25):
104410  		goto _55
104411  	case int32(26):
104412  		goto _23
104413  	case int32(27):
104414  		goto _24
104415  	case int32(28):
104416  		goto _54
104417  	case int32(29):
104418  		goto _57
104419  	case int32(30):
104420  		goto _36
104421  	case int32(31):
104422  		goto _38
104423  	case int32(32):
104424  		goto _34
104425  	case int32(33):
104426  		goto _35
104427  	case int32(34):
104428  		goto _58
104429  	case int32(35):
104430  		goto _53
104431  	case int32(36):
104432  		goto _52
104433  	case int32(41):
104434  		goto _59
104435  	case int32(42):
104436  		goto _46
104437  	case int32(43):
104438  		goto _39
104439  	default:
104440  		goto _56
104441  	}
104442  
104443  _22:
104444  	_sqlite3VdbeUsesBtree(tls, _v, _iDb)
104445  	if _zRight != nil {
104446  		goto _60
104447  	}
104448  	_pParse.XnMem += int32(2)
104449  	_sqlite3VdbeVerifyNoMallocRequired(tls, _v, int32(9))
104450  	_11_aOp = _sqlite3VdbeAddOpList(tls, _v, int32(9), (*XVdbeOpList)(unsafe.Pointer(&_sqlite3PragmaØ00getCacheSizeØ002)), _sqlite3PragmaØ00iLnØ001)
104451  	if func() int32 {
104452  		if _11_aOp == nil {
104453  			return func() int32 {
104454  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113699), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(4809)))
104455  				crt.X__builtin_abort(tls)
104456  				return int32(1)
104457  			}()
104458  		}
104459  		return int32(0)
104460  	}() != 0 {
104461  		goto _64
104462  	}
104463  	elem61(_11_aOp, 0).Xp1 = _iDb
104464  	elem61(_11_aOp, uintptr(1)).Xp1 = _iDb
104465  	elem61(_11_aOp, uintptr(6)).Xp1 = int32(-2000)
104466  	goto _65
104467  _60:
104468  	_13_size = _sqlite3AbsInt32(tls, _sqlite3Atoi(tls, _zRight))
104469  	_sqlite3BeginWriteOperation(tls, _pParse, int32(0), _iDb)
104470  	_sqlite3VdbeAddOp3(tls, _v, int32(104), _iDb, int32(3), _13_size)
104471  	func() {
104472  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
104473  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113707), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(51126)))
104474  			crt.X__builtin_abort(tls)
104475  		}
104476  	}()
104477  	(*XSchema)(_pDb.XpSchema).Xcache_size = _13_size
104478  	_sqlite3BtreeSetCacheSize(tls, (*XBtree)(_pDb.XpBt), (*XSchema)(_pDb.XpSchema).Xcache_size)
104479  _65:
104480  	goto _64
104481  _23:
104482  	_14_pBt = (*XBtree)(_pDb.XpBt)
104483  	func() {
104484  		if _14_pBt == nil {
104485  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113727), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(120714)))
104486  			crt.X__builtin_abort(tls)
104487  		}
104488  	}()
104489  	if _zRight == nil {
104490  		_15_size = func() int32 {
104491  			if func() int32 {
104492  				if _14_pBt != nil {
104493  					return int32(1)
104494  				}
104495  				return func() int32 {
104496  					crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113729), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(4809)))
104497  					crt.X__builtin_abort(tls)
104498  					return int32(0)
104499  				}()
104500  			}() != 0 {
104501  				return _sqlite3BtreeGetPageSize(tls, _14_pBt)
104502  			}
104503  			return int32(0)
104504  		}()
104505  		_returnSingleInt(tls, _v, int64(_15_size))
104506  		goto _75
104507  	}
104508  	_db.XnextPagesize = _sqlite3Atoi(tls, _zRight)
104509  	if int32(7) == _sqlite3BtreeSetPageSize(tls, _14_pBt, _db.XnextPagesize, int32(-1), int32(0)) {
104510  		_sqlite3OomFault(tls, _db)
104511  	}
104512  _75:
104513  	goto _64
104514  _24:
104515  	_18_pBt = (*XBtree)(_pDb.XpBt)
104516  	_18_b = int32(-1)
104517  	func() {
104518  		if _18_pBt == nil {
104519  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113754), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(120714)))
104520  			crt.X__builtin_abort(tls)
104521  		}
104522  	}()
104523  	if _zRight != nil {
104524  		_18_b = int32(_sqlite3GetBoolean(tls, _zRight, 0))
104525  	}
104526  	if _pId2.Xn != (0) || _18_b < int32(0) {
104527  		goto _81
104528  	}
104529  	_20_ii = int32(0)
104530  _82:
104531  	if _20_ii >= _db.XnDb {
104532  		goto _85
104533  	}
104534  	_sqlite3BtreeSecureDelete(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_20_ii)).XpBt), _18_b)
104535  	_20_ii += 1
104536  	goto _82
104537  _85:
104538  _81:
104539  	_18_b = _sqlite3BtreeSecureDelete(tls, _18_pBt, _18_b)
104540  	_returnSingleInt(tls, _v, int64(_18_b))
104541  	goto _64
104542  _25:
104543  	_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
104544  	_22_iReg = preInc2(&_pParse.XnMem, 1)
104545  	if int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(uint8(*elem1(_zLeft, 0))))) == int32(112) {
104546  		_sqlite3VdbeAddOp2(tls, _v, int32(161), _iDb, _22_iReg)
104547  		goto _87
104548  	}
104549  	_sqlite3VdbeAddOp3(tls, _v, int32(162), _iDb, _22_iReg, _sqlite3AbsInt32(tls, _sqlite3Atoi(tls, _zRight)))
104550  _87:
104551  	_sqlite3VdbeAddOp2(tls, _v, int32(67), _22_iReg, int32(1))
104552  	goto _64
104553  _26:
104554  	_25_zRet = str(89670)
104555  	_25_eMode = _getLockingMode(tls, _zRight)
104556  	if (_pId2.Xn == (0)) && (_25_eMode == int32(-1)) {
104557  		_25_eMode = int32(_db.XdfltLockMode)
104558  		goto _90
104559  	}
104560  	if _pId2.Xn != (0) {
104561  		goto _91
104562  	}
104563  	func() {
104564  		if _pDb != elem27((*XDb)(_db.XaDb), 0) {
104565  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113826), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(120721)))
104566  			crt.X__builtin_abort(tls)
104567  		}
104568  	}()
104569  	_28_ii = int32(2)
104570  _94:
104571  	if _28_ii >= _db.XnDb {
104572  		goto _97
104573  	}
104574  	_27_pPager = _sqlite3BtreePager(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_28_ii)).XpBt))
104575  	_sqlite3PagerLockingMode(tls, _27_pPager, _25_eMode)
104576  	_28_ii += 1
104577  	goto _94
104578  _97:
104579  	_db.XdfltLockMode = uint8(_25_eMode)
104580  _91:
104581  	_27_pPager = _sqlite3BtreePager(tls, (*XBtree)(_pDb.XpBt))
104582  	_25_eMode = _sqlite3PagerLockingMode(tls, _27_pPager, _25_eMode)
104583  _90:
104584  	func() {
104585  		if _25_eMode != int32(0) && _25_eMode != int32(1) {
104586  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113837), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(120738)))
104587  			crt.X__builtin_abort(tls)
104588  		}
104589  	}()
104590  	if _25_eMode == int32(1) {
104591  		_25_zRet = str(89660)
104592  	}
104593  	_returnSingleText(tls, _v, _25_zRet)
104594  	goto _64
104595  _27:
104596  	if _zRight == nil {
104597  		_31_eMode = int32(-1)
104598  		goto _103
104599  	}
104600  	_33_n = _sqlite3Strlen30(tls, _zRight)
104601  	_31_eMode = int32(0)
104602  _104:
104603  	if store1(&_33_zMode, _sqlite3JournalModename(tls, _31_eMode)) == nil {
104604  		goto _107
104605  	}
104606  	if Xsqlite3_strnicmp(tls, _zRight, _33_zMode, _33_n) == int32(0) {
104607  		goto _107
104608  	}
104609  	_31_eMode += 1
104610  	goto _104
104611  _107:
104612  	if _33_zMode == nil {
104613  		_31_eMode = int32(-1)
104614  	}
104615  _103:
104616  	if (_31_eMode == int32(-1)) && (_pId2.Xn == (0)) {
104617  		_iDb = int32(0)
104618  		_pId2.Xn = uint32(1)
104619  	}
104620  	_31_ii = _db.XnDb - int32(1)
104621  _112:
104622  	if _31_ii < int32(0) {
104623  		goto _115
104624  	}
104625  	if ((elem27((*XDb)(_db.XaDb), uintptr(_31_ii)).XpBt) != nil) && ((_31_ii == _iDb) || (_pId2.Xn == (0))) {
104626  		_sqlite3VdbeUsesBtree(tls, _v, _31_ii)
104627  		_sqlite3VdbeAddOp3(tls, _v, int32(9), _31_ii, int32(1), _31_eMode)
104628  	}
104629  	_31_ii -= 1
104630  	goto _112
104631  _115:
104632  	_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(1))
104633  	goto _64
104634  _28:
104635  	_39_pPager = _sqlite3BtreePager(tls, (*XBtree)(_pDb.XpBt))
104636  	_39_iLimit = int64(-2)
104637  	if _zRight == nil {
104638  		goto _119
104639  	}
104640  	_sqlite3DecOrHexToI64(tls, _zRight, &_39_iLimit)
104641  	if _39_iLimit < int64(-1) {
104642  		_39_iLimit = int64(-1)
104643  	}
104644  _119:
104645  	_39_iLimit = _sqlite3PagerJournalSizeLimit(tls, _39_pPager, _39_iLimit)
104646  	_returnSingleInt(tls, _v, _39_iLimit)
104647  	goto _64
104648  _29:
104649  	_41_pBt = (*XBtree)(_pDb.XpBt)
104650  	func() {
104651  		if _41_pBt == nil {
104652  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113916), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(120714)))
104653  			crt.X__builtin_abort(tls)
104654  		}
104655  	}()
104656  	if _zRight == nil {
104657  		_returnSingleInt(tls, _v, int64(_sqlite3BtreeGetAutoVacuum(tls, _41_pBt)))
104658  		goto _124
104659  	}
104660  	_43_eAuto = _getAutoVacuum(tls, _zRight)
104661  	func() {
104662  		if _43_eAuto < int32(0) || _43_eAuto > int32(2) {
104663  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113921), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(120808)))
104664  			crt.X__builtin_abort(tls)
104665  		}
104666  	}()
104667  	_db.XnextAutovac = int8(uint8(_43_eAuto))
104668  	_rc = _sqlite3BtreeSetAutoVacuum(tls, _41_pBt, _43_eAuto)
104669  	if _rc != int32(0) || _43_eAuto != int32(1) && _43_eAuto != int32(2) {
104670  		goto _130
104671  	}
104672  	_44_iAddr = _sqlite3VdbeCurrentAddr(tls, _v)
104673  	_sqlite3VdbeVerifyNoMallocRequired(tls, _v, int32(5))
104674  	_44_aOp = _sqlite3VdbeAddOpList(tls, _v, int32(5), (*XVdbeOpList)(unsafe.Pointer(&_sqlite3PragmaØ00setMeta6Ø004)), _sqlite3PragmaØ00iLnØ003)
104675  	if func() int32 {
104676  		if _44_aOp == nil {
104677  			return func() int32 {
104678  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113947), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(4809)))
104679  				crt.X__builtin_abort(tls)
104680  				return int32(1)
104681  			}()
104682  		}
104683  		return int32(0)
104684  	}() != 0 {
104685  		goto _64
104686  	}
104687  	elem61(_44_aOp, 0).Xp1 = _iDb
104688  	elem61(_44_aOp, uintptr(1)).Xp1 = _iDb
104689  	elem61(_44_aOp, uintptr(2)).Xp2 = _44_iAddr + int32(4)
104690  	elem61(_44_aOp, uintptr(4)).Xp1 = _iDb
104691  	elem61(_44_aOp, uintptr(4)).Xp3 = _43_eAuto - int32(1)
104692  	_sqlite3VdbeUsesBtree(tls, _v, _iDb)
104693  _130:
104694  _124:
104695  	goto _64
104696  _30:
104697  	if ((_zRight == nil) || (_sqlite3GetInt32(tls, _zRight, &_45_iLimit) == 0)) || (_45_iLimit <= int32(0)) {
104698  		_45_iLimit = int32(2147483647)
104699  	}
104700  	_sqlite3BeginWriteOperation(tls, _pParse, int32(0), _iDb)
104701  	_sqlite3VdbeAddOp2(tls, _v, int32(56), _45_iLimit, int32(1))
104702  	_45_addr = _sqlite3VdbeAddOp1(tls, _v, int32(49), _iDb)
104703  	_sqlite3VdbeAddOp1(tls, _v, int32(67), int32(1))
104704  	_sqlite3VdbeAddOp2(tls, _v, int32(73), int32(1), int32(-1))
104705  	_sqlite3VdbeAddOp2(tls, _v, int32(46), int32(1), _45_addr)
104706  	_sqlite3VdbeJumpHere(tls, _v, _45_addr)
104707  	goto _64
104708  _31:
104709  	func() {
104710  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
104711  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113995), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(51126)))
104712  			crt.X__builtin_abort(tls)
104713  		}
104714  	}()
104715  	if _zRight == nil {
104716  		_returnSingleInt(tls, _v, int64((*XSchema)(_pDb.XpSchema).Xcache_size))
104717  		goto _140
104718  	}
104719  	_49_size = _sqlite3Atoi(tls, _zRight)
104720  	(*XSchema)(_pDb.XpSchema).Xcache_size = _49_size
104721  	_sqlite3BtreeSetCacheSize(tls, (*XBtree)(_pDb.XpBt), (*XSchema)(_pDb.XpSchema).Xcache_size)
104722  _140:
104723  	goto _64
104724  _32:
104725  	func() {
104726  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
104727  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114029), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(51126)))
104728  			crt.X__builtin_abort(tls)
104729  		}
104730  	}()
104731  	if _zRight == nil {
104732  		_returnSingleInt(tls, _v, int64(func() int32 {
104733  			if (_db.Xflags & int32(32)) == int32(0) {
104734  				return int32(0)
104735  			}
104736  			return _sqlite3BtreeSetSpillSize(tls, (*XBtree)(_pDb.XpBt), int32(0))
104737  		}()))
104738  		goto _146
104739  	}
104740  	_52_size = int32(1)
104741  	if _sqlite3GetInt32(tls, _zRight, &_52_size) != 0 {
104742  		_sqlite3BtreeSetSpillSize(tls, (*XBtree)(_pDb.XpBt), _52_size)
104743  	}
104744  	if _sqlite3GetBoolean(tls, _zRight, uint8(bool2int(_52_size != int32(0)))) != 0 {
104745  		_db.Xflags |= int32(32)
104746  		goto _149
104747  	}
104748  	_db.Xflags &= int32(-33)
104749  _149:
104750  	_setAllPagerFlags(tls, _db)
104751  _146:
104752  	goto _64
104753  _33:
104754  	func() {
104755  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
104756  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114066), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(51126)))
104757  			crt.X__builtin_abort(tls)
104758  		}
104759  	}()
104760  	if _zRight == nil {
104761  		goto _152
104762  	}
104763  	_sqlite3DecOrHexToI64(tls, _zRight, &_56_sz)
104764  	if _56_sz < (0) {
104765  		_56_sz = _sqlite3Config.XszMmap
104766  	}
104767  	if _pId2.Xn == (0) {
104768  		_db.XszMmap = _56_sz
104769  	}
104770  	_57_ii = _db.XnDb - int32(1)
104771  _155:
104772  	if _57_ii < int32(0) {
104773  		goto _158
104774  	}
104775  	if ((elem27((*XDb)(_db.XaDb), uintptr(_57_ii)).XpBt) != nil) && ((_57_ii == _iDb) || (_pId2.Xn == (0))) {
104776  		_sqlite3BtreeSetMmapLimit(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_57_ii)).XpBt), _56_sz)
104777  	}
104778  	_57_ii -= 1
104779  	goto _155
104780  _158:
104781  _152:
104782  	_56_sz = int64(-1)
104783  	_rc = Xsqlite3_file_control(tls, _db, _zDb, int32(18), unsafe.Pointer(&_56_sz))
104784  	if _rc == int32(0) {
104785  		_returnSingleInt(tls, _v, _56_sz)
104786  		goto _164
104787  	}
104788  	if _rc != int32(12) {
104789  		_pParse.XnErr += 1
104790  		_pParse.Xrc = _rc
104791  	}
104792  _164:
104793  	goto _64
104794  _34:
104795  	if _zRight == nil {
104796  		_returnSingleInt(tls, _v, int64(_db.Xtemp_store))
104797  		goto _166
104798  	}
104799  	_changeTempStorage(tls, _pParse, _zRight)
104800  _166:
104801  	goto _64
104802  _35:
104803  	if _zRight == nil {
104804  		_returnSingleText(tls, _v, Xsqlite3_temp_directory)
104805  		goto _168
104806  	}
104807  	if (*elem1(_zRight, 0)) == 0 {
104808  		goto _169
104809  	}
104810  	_rc = _sqlite3OsAccess(tls, (*Xsqlite3_vfs)(_db.XpVfs), _zRight, int32(1), &_68_res)
104811  	if (_rc != int32(0)) || (_68_res == int32(0)) {
104812  		_sqlite3ErrorMsg(tls, _pParse, str(120829))
104813  		goto _pragma_out
104814  	}
104815  _169:
104816  	if (int32(0) != 0 || (int32(1) != 0 && (int32(_db.Xtemp_store) <= int32(1)))) || int32(0) != 0 {
104817  		_invalidateTempStorage(tls, _pParse)
104818  	}
104819  	Xsqlite3_free(tls, unsafe.Pointer(Xsqlite3_temp_directory))
104820  	if (*elem1(_zRight, 0)) != 0 {
104821  		Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, str(24531), unsafe.Pointer(_zRight))
104822  		bug20530(Xsqlite3_temp_directory)
104823  		goto _177
104824  	}
104825  	Xsqlite3_temp_directory = nil
104826  	bug20530(Xsqlite3_temp_directory)
104827  _177:
104828  _168:
104829  	goto _64
104830  _36:
104831  	if _zRight == nil {
104832  		_returnSingleInt(tls, _v, int64(int32(_pDb.Xsafety_level)-int32(1)))
104833  		goto _179
104834  	}
104835  	if _db.XautoCommit == 0 {
104836  		_sqlite3ErrorMsg(tls, _pParse, str(120854))
104837  		goto _182
104838  	}
104839  	if _iDb == int32(1) {
104840  		goto _182
104841  	}
104842  	_77_iLevel = (int32(_getSafetyLevel(tls, _zRight, int32(0), uint8(1))) + int32(1)) & int32(7)
104843  	if _77_iLevel == int32(0) {
104844  		_77_iLevel = int32(1)
104845  	}
104846  	_pDb.Xsafety_level = uint8(_77_iLevel)
104847  	_pDb.XbSyncSet = uint8(1)
104848  	_setAllPagerFlags(tls, _db)
104849  _182:
104850  _179:
104851  	goto _64
104852  _37:
104853  	if _zRight == nil {
104854  		_setPragmaResultColumnNames(tls, _v, _pPragma)
104855  		_returnSingleInt(tls, _v, int64(bool2int((uint32(_db.Xflags)&_pPragma.XiArg) != (0))))
104856  		goto _185
104857  	}
104858  	_80_mask = int32(_pPragma.XiArg)
104859  	if int32(_db.XautoCommit) == int32(0) {
104860  		_80_mask &= int32(-524289)
104861  	}
104862  	if _sqlite3GetBoolean(tls, _zRight, 0) != 0 {
104863  		_db.Xflags |= _80_mask
104864  		goto _188
104865  	}
104866  	_db.Xflags &= ^_80_mask
104867  	if _80_mask == int32(33554432) {
104868  		_db.XnDeferredImmCons = 0
104869  	}
104870  _188:
104871  	_sqlite3VdbeAddOp0(tls, _v, int32(153))
104872  	_setAllPagerFlags(tls, _db)
104873  _185:
104874  	goto _64
104875  _38:
104876  	if _zRight == nil {
104877  		goto _190
104878  	}
104879  	_84_pTab = _sqlite3LocateTable(tls, _pParse, uint32(2), _zRight, _zDb)
104880  	if _84_pTab == nil {
104881  		goto _191
104882  	}
104883  	_85_nHidden = int32(0)
104884  	_85_pPk = _sqlite3PrimaryKeyIndex(tls, _84_pTab)
104885  	_pParse.XnMem = int32(6)
104886  	_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
104887  	_sqlite3ViewGetColumnNames(tls, _pParse, _84_pTab)
104888  	*func() **XColumn { _85_i = int32(0); return &_85_pCol }() = (*XColumn)(_84_pTab.XaCol)
104889  _192:
104890  	if _85_i >= int32(_84_pTab.XnCol) {
104891  		goto _195
104892  	}
104893  	if (int32(_85_pCol.XcolFlags) & int32(2)) != int32(0) {
104894  		_85_nHidden += 1
104895  		goto _193
104896  	}
104897  	if (int32(_85_pCol.XcolFlags) & int32(1)) == int32(0) {
104898  		_85_k = int32(0)
104899  		goto _200
104900  	}
104901  	if _85_pPk == nil {
104902  		_85_k = int32(1)
104903  		goto _200
104904  	}
104905  	_85_k = int32(1)
104906  _201:
104907  	if _85_k > int32(_84_pTab.XnCol) || int32(*elem50(_85_pPk.XaiColumn, uintptr(_85_k-int32(1)))) == _85_i {
104908  		goto _205
104909  	}
104910  	_85_k += 1
104911  	goto _201
104912  _205:
104913  _200:
104914  	func() {
104915  		if (*XExpr)(_85_pCol.XpDflt) != nil && int32((*XExpr)(_85_pCol.XpDflt).Xop) != int32(162) {
104916  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114330), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(120907)))
104917  			crt.X__builtin_abort(tls)
104918  		}
104919  	}()
104920  	_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 {
104921  		if _85_pCol.XnotNull != 0 {
104922  			return int32(1)
104923  		}
104924  		return int32(0)
104925  	}(), unsafe.Pointer(func() *int8 {
104926  		if _85_pCol.XpDflt != nil {
104927  			return (*(**int8)(unsafe.Pointer(&((*XExpr)(_85_pCol.XpDflt).Xu))))
104928  		}
104929  		return nil
104930  	}()), _85_k)
104931  	_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(6))
104932  _193:
104933  	*(*uintptr)(unsafe.Pointer(func() **XColumn { _85_i += 1; return &_85_pCol }())) += uintptr(16)
104934  	goto _192
104935  _195:
104936  _191:
104937  _190:
104938  	goto _64
104939  _39:
104940  	_pParse.XnMem = int32(5)
104941  	_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
104942  	_92_i = (*XHashElem)(((*XSchema)(_pDb.XpSchema).XtblHash).Xfirst)
104943  _213:
104944  	if _92_i == nil {
104945  		goto _216
104946  	}
104947  	_93_pTab = (*XTable)(_92_i.Xdata)
104948  	_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)
104949  	_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(5))
104950  	_92_pIdx = (*XIndex)(_93_pTab.XpIndex)
104951  _217:
104952  	if _92_pIdx == nil {
104953  		goto _220
104954  	}
104955  	_sqlite3VdbeMultiLoad(tls, _v, int32(2), str(120963), unsafe.Pointer(_92_pIdx.XzName), int32(_92_pIdx.XszIdxRow), int32(*elem50(_92_pIdx.XaiRowLogEst, 0)), (uint32(_92_pIdx.XidxType>>7)<<31)>>31)
104956  	_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(5))
104957  	_92_pIdx = (*XIndex)(_92_pIdx.XpNext)
104958  	goto _217
104959  _220:
104960  	_92_i = (*XHashElem)(_92_i.Xnext)
104961  	goto _213
104962  _216:
104963  	goto _64
104964  _40:
104965  	if _zRight == nil {
104966  		goto _221
104967  	}
104968  	_95_pIdx = _sqlite3FindIndex(tls, _db, _zRight, _zDb)
104969  	if _95_pIdx == nil {
104970  		goto _222
104971  	}
104972  	if _pPragma.XiArg != 0 {
104973  		_96_mx = int32(_95_pIdx.XnColumn)
104974  		_pParse.XnMem = int32(6)
104975  		goto _224
104976  	}
104977  	_96_mx = int32(_95_pIdx.XnKeyCol)
104978  	_pParse.XnMem = int32(3)
104979  _224:
104980  	_95_pTab = (*XTable)(_95_pIdx.XpTable)
104981  	_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
104982  	func() {
104983  		if _pParse.XnMem > int32(_pPragma.XnPragCName) {
104984  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114390), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(120968)))
104985  			crt.X__builtin_abort(tls)
104986  		}
104987  	}()
104988  	_96_i = int32(0)
104989  _227:
104990  	if _96_i >= _96_mx {
104991  		goto _230
104992  	}
104993  	_99_cnum = *elem50(_95_pIdx.XaiColumn, uintptr(_96_i))
104994  	_sqlite3VdbeMultiLoad(tls, _v, int32(1), str(121002), _96_i, int32(_99_cnum), unsafe.Pointer(func() *int8 {
104995  		if int32(_99_cnum) < int32(0) {
104996  			return nil
104997  		}
104998  		return (elem41((*XColumn)(_95_pTab.XaCol), uintptr(_99_cnum)).XzName)
104999  	}()))
105000  	if _pPragma.XiArg != 0 {
105001  		_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)))
105002  	}
105003  	_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), _pParse.XnMem)
105004  	_96_i += 1
105005  	goto _227
105006  _230:
105007  _222:
105008  _221:
105009  	goto _64
105010  _41:
105011  	if _zRight == nil {
105012  		goto _234
105013  	}
105014  	_101_pTab = _sqlite3FindTable(tls, _db, _zRight, _zDb)
105015  	if _101_pTab == nil {
105016  		goto _235
105017  	}
105018  	_pParse.XnMem = int32(5)
105019  	_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
105020  	*func() *int32 { _101_pIdx = (*XIndex)(_101_pTab.XpIndex); return &_101_i }() = int32(0)
105021  _236:
105022  	if _101_pIdx == nil {
105023  		goto _239
105024  	}
105025  	_103_azOrigin = [3]*int8{}
105026  	*elem0((**int8)(unsafe.Pointer(&_103_azOrigin)), 0) = str(121010)
105027  	*elem0((**int8)(unsafe.Pointer(&_103_azOrigin)), uintptr(1)) = str(121012)
105028  	*elem0((**int8)(unsafe.Pointer(&_103_azOrigin)), uintptr(2)) = str(93736)
105029  	_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))
105030  	_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(5))
105031  	*func() *int32 { _101_pIdx = (*XIndex)(_101_pIdx.XpNext); return &_101_i }() += 1
105032  	goto _236
105033  _239:
105034  _235:
105035  _234:
105036  	goto _64
105037  _42:
105038  	_pParse.XnMem = int32(3)
105039  	_104_i = int32(0)
105040  _240:
105041  	if _104_i >= _db.XnDb {
105042  		goto _243
105043  	}
105044  	if (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_104_i)).XpBt) == nil {
105045  		goto _241
105046  	}
105047  	func() {
105048  		if (elem27((*XDb)(_db.XaDb), uintptr(_104_i)).XzDbSName) == nil {
105049  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114434), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121020)))
105050  			crt.X__builtin_abort(tls)
105051  		}
105052  	}()
105053  	_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))))
105054  	_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(3))
105055  _241:
105056  	_104_i += 1
105057  	goto _240
105058  _243:
105059  	goto _64
105060  _43:
105061  	_106_i = int32(0)
105062  	_pParse.XnMem = int32(2)
105063  	_106_p = (*XHashElem)(_db.XaCollSeq.Xfirst)
105064  _247:
105065  	if _106_p == nil {
105066  		goto _250
105067  	}
105068  	_107_pColl = (*XCollSeq)(_106_p.Xdata)
105069  	_sqlite3VdbeMultiLoad(tls, _v, int32(1), str(121047), postInc2(&_106_i, 1), unsafe.Pointer(_107_pColl.XzName))
105070  	_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(2))
105071  	_106_p = (*XHashElem)(_106_p.Xnext)
105072  	goto _247
105073  _250:
105074  	goto _64
105075  _44:
105076  	if _zRight == nil {
105077  		goto _251
105078  	}
105079  	_108_pTab = _sqlite3FindTable(tls, _db, _zRight, _zDb)
105080  	if _108_pTab == nil {
105081  		goto _252
105082  	}
105083  	_108_pFK = (*XFKey)(_108_pTab.XpFKey)
105084  	if _108_pFK == nil {
105085  		goto _253
105086  	}
105087  	_110_i = int32(0)
105088  	_pParse.XnMem = int32(8)
105089  	_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
105090  _254:
105091  	if _108_pFK == nil {
105092  		goto _255
105093  	}
105094  	_111_j = int32(0)
105095  _256:
105096  	if _111_j >= _108_pFK.XnCol {
105097  		goto _259
105098  	}
105099  	_sqlite3VdbeMultiLoad(tls, _v, int32(1), str(121050), _110_i, _111_j, unsafe.Pointer(_108_pFK.XzTo), unsafe.Pointer(elem41((*XColumn)(_108_pTab.XaCol), uintptr(elem116((*t117)(unsafe.Pointer(&_108_pFK.XaCol)), uintptr(_111_j)).XiFrom)).XzName), unsafe.Pointer(elem116((*t117)(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)))
105100  	_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(8))
105101  	_111_j += 1
105102  	goto _256
105103  _259:
105104  	_110_i += 1
105105  	_108_pFK = (*XFKey)(_108_pFK.XpNextFrom)
105106  	goto _254
105107  _255:
105108  _253:
105109  _252:
105110  _251:
105111  	goto _64
105112  _45:
105113  	_113_regResult = _pParse.XnMem + int32(1)
105114  	_pParse.XnMem += int32(4)
105115  	_113_regKey = preInc2(&_pParse.XnMem, 1)
105116  	_113_regRow = preInc2(&_pParse.XnMem, 1)
105117  	_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
105118  	_113_k = (*XHashElem)(((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema).XtblHash).Xfirst)
105119  _260:
105120  	if _113_k == nil {
105121  		goto _261
105122  	}
105123  	if _zRight != nil {
105124  		_113_pTab = _sqlite3LocateTable(tls, _pParse, 0, _zRight, _zDb)
105125  		_113_k = nil
105126  		goto _263
105127  	}
105128  	_113_pTab = (*XTable)(_113_k.Xdata)
105129  	_113_k = (*XHashElem)(_113_k.Xnext)
105130  _263:
105131  	if (_113_pTab == nil) || ((*XFKey)(_113_pTab.XpFKey) == nil) {
105132  		goto _260
105133  	}
105134  	_sqlite3TableLock(tls, _pParse, _iDb, _113_pTab.Xtnum, 0, _113_pTab.XzName)
105135  	if (int32(_113_pTab.XnCol) + _113_regRow) > _pParse.XnMem {
105136  		_pParse.XnMem = int32(_113_pTab.XnCol) + _113_regRow
105137  	}
105138  	_sqlite3OpenTable(tls, _pParse, int32(0), _iDb, _113_pTab, int32(106))
105139  	_sqlite3VdbeLoadString(tls, _v, _113_regResult, _113_pTab.XzName)
105140  	*func() **XFKey { _113_i = int32(1); return &_113_pFK }() = (*XFKey)(_113_pTab.XpFKey)
105141  _267:
105142  	if _113_pFK == nil {
105143  		goto _270
105144  	}
105145  	_113_pParent = _sqlite3FindTable(tls, _db, _113_pFK.XzTo, _zDb)
105146  	if _113_pParent == nil {
105147  		goto _268
105148  	}
105149  	_113_pIdx = nil
105150  	_sqlite3TableLock(tls, _pParse, _iDb, _113_pParent.Xtnum, 0, _113_pParent.XzName)
105151  	_113_x = _sqlite3FkLocateIndex(tls, _pParse, _113_pParent, _113_pFK, &_113_pIdx, nil)
105152  	if _113_x != int32(0) {
105153  		goto _272
105154  	}
105155  	if _113_pIdx == nil {
105156  		_sqlite3OpenTable(tls, _pParse, _113_i, _iDb, _113_pParent, int32(106))
105157  		goto _274
105158  	}
105159  	_sqlite3VdbeAddOp3(tls, _v, int32(106), _113_i, _113_pIdx.Xtnum, _iDb)
105160  	_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _113_pIdx)
105161  _274:
105162  	goto _275
105163  _272:
105164  	_113_k = nil
105165  	goto _270
105166  _275:
105167  _268:
105168  	*func() **XFKey { _113_i += 1; return &_113_pFK }() = (*XFKey)(_113_pFK.XpNextFrom)
105169  	goto _267
105170  _270:
105171  	func() {
105172  		if _pParse.XnErr <= int32(0) && _113_pFK != nil {
105173  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114546), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121064)))
105174  			crt.X__builtin_abort(tls)
105175  		}
105176  	}()
105177  	if _113_pFK != nil {
105178  		goto _261
105179  	}
105180  	if _pParse.XnTab < _113_i {
105181  		_pParse.XnTab = _113_i
105182  	}
105183  	_113_addrTop = _sqlite3VdbeAddOp1(tls, _v, int32(37), int32(0))
105184  	*func() **XFKey { _113_i = int32(1); return &_113_pFK }() = (*XFKey)(_113_pTab.XpFKey)
105185  _281:
105186  	if _113_pFK == nil {
105187  		goto _284
105188  	}
105189  	_113_pParent = _sqlite3FindTable(tls, _db, _113_pFK.XzTo, _zDb)
105190  	_113_pIdx = nil
105191  	_113_aiCols = nil
105192  	if _113_pParent != nil {
105193  		_113_x = _sqlite3FkLocateIndex(tls, _pParse, _113_pParent, _113_pFK, &_113_pIdx, &_113_aiCols)
105194  		func() {
105195  			if _113_x != int32(0) {
105196  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114556), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121089)))
105197  				crt.X__builtin_abort(tls)
105198  			}
105199  		}()
105200  	}
105201  	_113_addrOk = _sqlite3VdbeMakeLabel(tls, _v)
105202  	_113_j = int32(0)
105203  _288:
105204  	if _113_j >= _113_pFK.XnCol {
105205  		goto _291
105206  	}
105207  	_124_iCol = func() int32 {
105208  		if _113_aiCols != nil {
105209  			return (*elem8(_113_aiCols, uintptr(_113_j)))
105210  		}
105211  		return (elem116((*t117)(unsafe.Pointer(&_113_pFK.XaCol)), uintptr(_113_j)).XiFrom)
105212  	}()
105213  	_sqlite3ExprCodeGetColumnOfTable(tls, _v, _113_pTab, int32(0), _124_iCol, _113_regRow+_113_j)
105214  	_sqlite3VdbeAddOp2(tls, _v, int32(75), _113_regRow+_113_j, _113_addrOk)
105215  	_113_j += 1
105216  	goto _288
105217  _291:
105218  	if _113_pIdx != nil {
105219  		_sqlite3VdbeAddOp4(tls, _v, int32(101), _113_regRow, _113_pFK.XnCol, _113_regKey, _sqlite3IndexAffinityStr(tls, _db, _113_pIdx), _113_pFK.XnCol)
105220  		_sqlite3VdbeAddOp4Int(tls, _v, int32(30), _113_i, _113_addrOk, _113_regKey, int32(0))
105221  		goto _296
105222  	}
105223  	if _113_pParent != nil {
105224  		_126_jmp = _sqlite3VdbeCurrentAddr(tls, _v) + int32(2)
105225  		_sqlite3VdbeAddOp3(tls, _v, int32(31), _113_i, _126_jmp, _113_regRow)
105226  		_sqlite3VdbeGoto(tls, _v, _113_addrOk)
105227  		func() {
105228  			if _113_pFK.XnCol != int32(1) {
105229  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114581), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121094)))
105230  				crt.X__builtin_abort(tls)
105231  			}
105232  		}()
105233  	}
105234  _296:
105235  	if (_113_pTab.XtabFlags & uint32(32)) == (0) {
105236  		_sqlite3VdbeAddOp2(tls, _v, int32(125), int32(0), _113_regResult+int32(1))
105237  		goto _300
105238  	}
105239  	_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _113_regResult+int32(1))
105240  _300:
105241  	_sqlite3VdbeMultiLoad(tls, _v, _113_regResult+int32(2), str(121107), unsafe.Pointer(_113_pFK.XzTo), _113_i-int32(1))
105242  	_sqlite3VdbeAddOp2(tls, _v, int32(67), _113_regResult, int32(4))
105243  	_sqlite3VdbeResolveLabel(tls, _v, _113_addrOk)
105244  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_113_aiCols))
105245  	*func() **XFKey { _113_i += 1; return &_113_pFK }() = (*XFKey)(_113_pFK.XpNextFrom)
105246  	goto _281
105247  _284:
105248  	_sqlite3VdbeAddOp2(tls, _v, int32(7), int32(0), _113_addrTop+int32(1))
105249  	_sqlite3VdbeJumpHere(tls, _v, _113_addrTop)
105250  	goto _260
105251  _261:
105252  	goto _64
105253  _46:
105254  	if _zRight == nil {
105255  		goto _301
105256  	}
105257  	if _sqlite3GetBoolean(tls, _zRight, 0) != 0 {
105258  		_sqlite3ParserTrace(tls, (*crt.XFILE)(Xstdout), str(121110))
105259  		goto _303
105260  	}
105261  	_sqlite3ParserTrace(tls, nil, nil)
105262  _303:
105263  _301:
105264  	goto _64
105265  _47:
105266  	if _zRight != nil {
105267  		_sqlite3RegisterLikeFunctions(tls, _db, int32(_sqlite3GetBoolean(tls, _zRight, 0)))
105268  	}
105269  	goto _64
105270  _48:
105271  	_135_isQuick = bool2int(int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(uint8(*elem1(_zLeft, 0))))) == int32(113))
105272  	func() {
105273  		if _iDb < int32(0) {
105274  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114657), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(41995)))
105275  			crt.X__builtin_abort(tls)
105276  		}
105277  	}()
105278  	func() {
105279  		if _iDb != int32(0) && _pId2.Xz == nil {
105280  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114658), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121119)))
105281  			crt.X__builtin_abort(tls)
105282  		}
105283  	}()
105284  	if _pId2.Xz == nil {
105285  		_iDb = int32(-1)
105286  	}
105287  	_pParse.XnMem = int32(6)
105288  	_135_mxErr = int32(100)
105289  	if _zRight == nil {
105290  		goto _311
105291  	}
105292  	_sqlite3GetInt32(tls, _zRight, &_135_mxErr)
105293  	if _135_mxErr <= int32(0) {
105294  		_135_mxErr = int32(100)
105295  	}
105296  _311:
105297  	_sqlite3VdbeAddOp2(tls, _v, int32(56), _135_mxErr-int32(1), int32(1))
105298  	_135_i = int32(0)
105299  _313:
105300  	if _135_i >= _db.XnDb {
105301  		goto _316
105302  	}
105303  	_138_cnt = int32(0)
105304  	_138_mxIdx = int32(0)
105305  	goto _317
105306  _317:
105307  	if (_iDb >= int32(0)) && (_135_i != _iDb) {
105308  		goto _314
105309  	}
105310  	_sqlite3CodeVerifySchema(tls, _pParse, _135_i)
105311  	func() {
105312  		if _sqlite3SchemaMutexHeld(tls, _db, _135_i, nil) == 0 {
105313  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114693), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121137)))
105314  			crt.X__builtin_abort(tls)
105315  		}
105316  	}()
105317  	_138_pTbls = &((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_135_i)).XpSchema).XtblHash)
105318  	*func() **XHashElem { _138_cnt = int32(0); return &_138_x }() = (*XHashElem)(_138_pTbls.Xfirst)
105319  _322:
105320  	if _138_x == nil {
105321  		goto _325
105322  	}
105323  	_139_pTab = (*XTable)(_138_x.Xdata)
105324  	if (_139_pTab.XtabFlags & uint32(32)) == (0) {
105325  		_138_cnt += 1
105326  	}
105327  	*func() **XIndex { _138_nIdx = int32(0); return &_139_pIdx }() = (*XIndex)(_139_pTab.XpIndex)
105328  _327:
105329  	if _139_pIdx == nil {
105330  		goto _330
105331  	}
105332  	_138_cnt += 1
105333  	*func() *int32 { _139_pIdx = (*XIndex)(_139_pIdx.XpNext); return &_138_nIdx }() += 1
105334  	goto _327
105335  _330:
105336  	if _138_nIdx > _138_mxIdx {
105337  		_138_mxIdx = _138_nIdx
105338  	}
105339  	_138_x = (*XHashElem)(_138_x.Xnext)
105340  	goto _322
105341  _325:
105342  	_138_aRoot = (*int32)(_sqlite3DbMallocRawNN(tls, _db, uint64(uint32(4)*uint32(_138_cnt+int32(1)))))
105343  	if _138_aRoot == nil {
105344  		goto _316
105345  	}
105346  	*func() **XHashElem { _138_cnt = int32(0); return &_138_x }() = (*XHashElem)(_138_pTbls.Xfirst)
105347  _333:
105348  	if _138_x == nil {
105349  		goto _336
105350  	}
105351  	_141_pTab = (*XTable)(_138_x.Xdata)
105352  	if (_141_pTab.XtabFlags & uint32(32)) == (0) {
105353  		*elem8(_138_aRoot, uintptr(postInc2(&_138_cnt, 1))) = _141_pTab.Xtnum
105354  	}
105355  	_141_pIdx = (*XIndex)(_141_pTab.XpIndex)
105356  _338:
105357  	if _141_pIdx == nil {
105358  		goto _341
105359  	}
105360  	*elem8(_138_aRoot, uintptr(postInc2(&_138_cnt, 1))) = _141_pIdx.Xtnum
105361  	_141_pIdx = (*XIndex)(_141_pIdx.XpNext)
105362  	goto _338
105363  _341:
105364  	_138_x = (*XHashElem)(_138_x.Xnext)
105365  	goto _333
105366  _336:
105367  	*elem8(_138_aRoot, uintptr(_138_cnt)) = int32(0)
105368  	_pParse.XnMem = func() int32 {
105369  		if _pParse.XnMem > (int32(8) + _138_mxIdx) {
105370  			return _pParse.XnMem
105371  		}
105372  		return (int32(8) + _138_mxIdx)
105373  	}()
105374  	_sqlite3VdbeAddOp4(tls, _v, int32(144), int32(2), _138_cnt, int32(1), (*int8)(unsafe.Pointer(_138_aRoot)), int32(-12))
105375  	_sqlite3VdbeChangeP5(tls, _v, uint16(uint8(_135_i)))
105376  	_135_addr = _sqlite3VdbeAddOp1(tls, _v, int32(75), int32(2))
105377  	_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))
105378  	_sqlite3VdbeAddOp3(tls, _v, int32(63), int32(2), int32(4), int32(1))
105379  	_sqlite3VdbeAddOp3(tls, _v, int32(93), int32(4), int32(3), int32(2))
105380  	_integrityCheckResultRow(tls, _v, int32(2))
105381  	_sqlite3VdbeJumpHere(tls, _v, _135_addr)
105382  	_138_x = (*XHashElem)(_138_pTbls.Xfirst)
105383  _344:
105384  	if _138_x == nil {
105385  		goto _347
105386  	}
105387  	_143_pTab = (*XTable)(_138_x.Xdata)
105388  	_143_pPrior = nil
105389  	_143_r1 = int32(-1)
105390  	if _143_pTab.Xtnum < int32(1) {
105391  		goto _345
105392  	}
105393  	if (((*XExprList)(_143_pTab.XpCheck) == nil) && ((_143_pTab.XtabFlags & uint32(512)) == (0))) && (((*XIndex)(_143_pTab.XpIndex) == nil) || _135_isQuick != 0) {
105394  		goto _345
105395  	}
105396  	_143_pPk = func() *XIndex {
105397  		if (_143_pTab.XtabFlags & uint32(32)) == (0) {
105398  			return nil
105399  		}
105400  		return _sqlite3PrimaryKeyIndex(tls, _143_pTab)
105401  	}()
105402  	_sqlite3ExprCacheClear(tls, _pParse)
105403  	_sqlite3OpenTableAndIndices(tls, _pParse, _143_pTab, int32(106), 0, int32(1), nil, &_143_iDataCur, &_143_iIdxCur)
105404  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), int32(7))
105405  	*func() **XIndex { _135_j = int32(0); return &_143_pIdx }() = (*XIndex)(_143_pTab.XpIndex)
105406  _355:
105407  	if _143_pIdx == nil {
105408  		goto _358
105409  	}
105410  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), int32(8)+_135_j)
105411  	*func() *int32 { _143_pIdx = (*XIndex)(_143_pIdx.XpNext); return &_135_j }() += 1
105412  	goto _355
105413  _358:
105414  	func() {
105415  		if _pParse.XnMem < (int32(8) + _135_j) {
105416  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114754), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121194)))
105417  			crt.X__builtin_abort(tls)
105418  		}
105419  	}()
105420  	func() {
105421  		if _sqlite3NoTempsInRange(tls, _pParse, int32(1), int32(7)+_135_j) == 0 {
105422  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114755), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121212)))
105423  			crt.X__builtin_abort(tls)
105424  		}
105425  	}()
105426  	_sqlite3VdbeAddOp2(tls, _v, int32(37), _143_iDataCur, int32(0))
105427  	_143_loopTop = _sqlite3VdbeAddOp2(tls, _v, int32(73), int32(7), int32(1))
105428  	_135_j = int32(0)
105429  _363:
105430  	if _135_j >= int32(_143_pTab.XnCol) {
105431  		goto _366
105432  	}
105433  	if _135_j == int32(_143_pTab.XiPKey) {
105434  		goto _364
105435  	}
105436  	if int32(elem41((*XColumn)(_143_pTab.XaCol), uintptr(_135_j)).XnotNull) == int32(0) {
105437  		goto _364
105438  	}
105439  	_sqlite3ExprCodeGetColumnOfTable(tls, _v, _143_pTab, _143_iDataCur, _135_j, int32(3))
105440  	_sqlite3VdbeChangeP5(tls, _v, uint16(128))
105441  	_146_jmp2 = _sqlite3VdbeAddOp1(tls, _v, int32(76), int32(3))
105442  	_146_zErr = _sqlite3MPrintf(tls, _db, str(121248), unsafe.Pointer(_143_pTab.XzName), unsafe.Pointer(elem41((*XColumn)(_143_pTab.XaCol), uintptr(_135_j)).XzName))
105443  	_sqlite3VdbeAddOp4(tls, _v, int32(97), int32(0), int32(3), int32(0), _146_zErr, int32(-1))
105444  	_integrityCheckResultRow(tls, _v, int32(3))
105445  	_sqlite3VdbeJumpHere(tls, _v, _146_jmp2)
105446  _364:
105447  	_135_j += 1
105448  	goto _363
105449  _366:
105450  	if _143_pTab.XpCheck == nil || (_db.Xflags&int32(8192)) != int32(0) {
105451  		goto _370
105452  	}
105453  	_147_pCheck = _sqlite3ExprListDup(tls, _db, (*XExprList)(_143_pTab.XpCheck), int32(0))
105454  	if int32(_db.XmallocFailed) != int32(0) {
105455  		goto _371
105456  	}
105457  	_148_addrCkFault = _sqlite3VdbeMakeLabel(tls, _v)
105458  	_148_addrCkOk = _sqlite3VdbeMakeLabel(tls, _v)
105459  	_pParse.XiSelfTab = _143_iDataCur
105460  	_sqlite3ExprCachePush(tls, _pParse)
105461  	_148_k = _147_pCheck.XnExpr - int32(1)
105462  _372:
105463  	if _148_k <= int32(0) {
105464  		goto _375
105465  	}
105466  	_sqlite3ExprIfFalse(tls, _pParse, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_147_pCheck.Xa)), uintptr(_148_k)).XpExpr), _148_addrCkFault, int32(0))
105467  	_148_k -= 1
105468  	goto _372
105469  _375:
105470  	_sqlite3ExprIfTrue(tls, _pParse, (*XExpr)(elem57((*TExprList_item)(unsafe.Pointer(&_147_pCheck.Xa)), 0).XpExpr), _148_addrCkOk, int32(16))
105471  	_sqlite3VdbeResolveLabel(tls, _v, _148_addrCkFault)
105472  	_148_zErr = _sqlite3MPrintf(tls, _db, str(121268), unsafe.Pointer(_143_pTab.XzName))
105473  	_sqlite3VdbeAddOp4(tls, _v, int32(97), int32(0), int32(3), int32(0), _148_zErr, int32(-1))
105474  	_integrityCheckResultRow(tls, _v, int32(3))
105475  	_sqlite3VdbeResolveLabel(tls, _v, _148_addrCkOk)
105476  	_sqlite3ExprCachePop(tls, _pParse)
105477  _371:
105478  	_sqlite3ExprListDelete(tls, _db, _147_pCheck)
105479  _370:
105480  	*func() **XIndex { _135_j = int32(0); return &_143_pIdx }() = (*XIndex)(_143_pTab.XpIndex)
105481  _376:
105482  	if _143_pIdx == nil || _135_isQuick != 0 {
105483  		goto _380
105484  	}
105485  	_150_ckUniq = _sqlite3VdbeMakeLabel(tls, _v)
105486  	if _143_pPk == _143_pIdx {
105487  		goto _377
105488  	}
105489  	_143_r1 = _sqlite3GenerateIndexKey(tls, _pParse, _143_pIdx, _143_iDataCur, int32(0), int32(0), &_150_jmp3, _143_pPrior, _143_r1)
105490  	_143_pPrior = _143_pIdx
105491  	_sqlite3VdbeAddOp2(tls, _v, int32(73), int32(8)+_135_j, int32(1))
105492  	_150_jmp2 = _sqlite3VdbeAddOp4Int(tls, _v, int32(30), _143_iIdxCur+_135_j, _150_ckUniq, _143_r1, int32(_143_pIdx.XnColumn))
105493  	_sqlite3VdbeLoadString(tls, _v, int32(3), str(121298))
105494  	_sqlite3VdbeAddOp3(tls, _v, int32(93), int32(7), int32(3), int32(3))
105495  	_sqlite3VdbeLoadString(tls, _v, int32(4), str(121303))
105496  	_sqlite3VdbeAddOp3(tls, _v, int32(93), int32(4), int32(3), int32(3))
105497  	_150_jmp5 = _sqlite3VdbeLoadString(tls, _v, int32(4), _143_pIdx.XzName)
105498  	_sqlite3VdbeAddOp3(tls, _v, int32(93), int32(4), int32(3), int32(3))
105499  	_150_jmp4 = _integrityCheckResultRow(tls, _v, int32(3))
105500  	_sqlite3VdbeJumpHere(tls, _v, _150_jmp2)
105501  	if int32(_143_pIdx.XonError) == int32(0) {
105502  		goto _382
105503  	}
105504  	_151_uniqOk = _sqlite3VdbeMakeLabel(tls, _v)
105505  	_151_kk = int32(0)
105506  _383:
105507  	if _151_kk >= int32(_143_pIdx.XnKeyCol) {
105508  		goto _386
105509  	}
105510  	_152_iCol = int32(*elem50(_143_pIdx.XaiColumn, uintptr(_151_kk)))
105511  	func() {
105512  		if _152_iCol == int32(-1) || _152_iCol >= int32(_143_pTab.XnCol) {
105513  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114827), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121324)))
105514  			crt.X__builtin_abort(tls)
105515  		}
105516  	}()
105517  	if (_152_iCol >= int32(0)) && ((elem41((*XColumn)(_143_pTab.XaCol), uintptr(_152_iCol)).XnotNull) != 0) {
105518  		goto _384
105519  	}
105520  	_sqlite3VdbeAddOp2(tls, _v, int32(75), _143_r1+_151_kk, _151_uniqOk)
105521  _384:
105522  	_151_kk += 1
105523  	goto _383
105524  _386:
105525  	_151_jmp6 = _sqlite3VdbeAddOp1(tls, _v, int32(7), _143_iIdxCur+_135_j)
105526  	_sqlite3VdbeGoto(tls, _v, _151_uniqOk)
105527  	_sqlite3VdbeJumpHere(tls, _v, _151_jmp6)
105528  	_sqlite3VdbeAddOp4Int(tls, _v, int32(39), _143_iIdxCur+_135_j, _151_uniqOk, _143_r1, int32(_143_pIdx.XnKeyCol))
105529  	_sqlite3VdbeLoadString(tls, _v, int32(3), str(121358))
105530  	_sqlite3VdbeGoto(tls, _v, _150_jmp5)
105531  	_sqlite3VdbeResolveLabel(tls, _v, _151_uniqOk)
105532  _382:
105533  	_sqlite3VdbeJumpHere(tls, _v, _150_jmp4)
105534  	_sqlite3ResolvePartIdxLabel(tls, _pParse, _150_jmp3)
105535  _377:
105536  	*func() *int32 { _143_pIdx = (*XIndex)(_143_pIdx.XpNext); return &_135_j }() += 1
105537  	goto _376
105538  _380:
105539  	_sqlite3VdbeAddOp2(tls, _v, int32(7), _143_iDataCur, _143_loopTop)
105540  	_sqlite3VdbeJumpHere(tls, _v, _143_loopTop-int32(1))
105541  	if _135_isQuick != 0 {
105542  		goto _392
105543  	}
105544  	_sqlite3VdbeLoadString(tls, _v, int32(2), str(121385))
105545  	*func() **XIndex { _135_j = int32(0); return &_143_pIdx }() = (*XIndex)(_143_pTab.XpIndex)
105546  _393:
105547  	if _143_pIdx == nil {
105548  		goto _396
105549  	}
105550  	if _143_pPk == _143_pIdx {
105551  		goto _394
105552  	}
105553  	_sqlite3VdbeAddOp2(tls, _v, int32(102), _143_iIdxCur+_135_j, int32(3))
105554  	_135_addr = _sqlite3VdbeAddOp3(tls, _v, int32(78), int32(8)+_135_j, int32(0), int32(3))
105555  	_sqlite3VdbeChangeP5(tls, _v, uint16(144))
105556  	_sqlite3VdbeLoadString(tls, _v, int32(3), _143_pIdx.XzName)
105557  	_sqlite3VdbeAddOp3(tls, _v, int32(93), int32(3), int32(2), int32(7))
105558  	_integrityCheckResultRow(tls, _v, int32(7))
105559  	_sqlite3VdbeJumpHere(tls, _v, _135_addr)
105560  _394:
105561  	*func() *int32 { _143_pIdx = (*XIndex)(_143_pIdx.XpNext); return &_135_j }() += 1
105562  	goto _393
105563  _396:
105564  _392:
105565  _345:
105566  	_138_x = (*XHashElem)(_138_x.Xnext)
105567  	goto _344
105568  _347:
105569  _314:
105570  	_135_i += 1
105571  	goto _313
105572  _316:
105573  	_155_aOp = _sqlite3VdbeAddOpList(tls, _v, int32(4), (*XVdbeOpList)(unsafe.Pointer(&_sqlite3PragmaØ00endCodeØ006)), _sqlite3PragmaØ00iLnØ005)
105574  	if _155_aOp != nil {
105575  		elem61(_155_aOp, 0).Xp2 = int32(1) - _135_mxErr
105576  		elem61(_155_aOp, uintptr(2)).Xp4type = int8(-2)
105577  		*(**int8)(unsafe.Pointer(&(elem61(_155_aOp, uintptr(2)).Xp4))) = str(121414)
105578  	}
105579  	goto _64
105580  _49:
105581  	if _zRight != nil {
105582  		goto _399
105583  	}
105584  	if _sqlite3ReadSchema(tls, _pParse) != 0 {
105585  		goto _pragma_out
105586  	}
105587  	func() {
105588  		if int32(elem125((*TEncName)(unsafe.Pointer(&_sqlite3PragmaØ00encnamesØ007)), uintptr(1)).Xenc) != int32(1) {
105589  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114925), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121417)))
105590  			crt.X__builtin_abort(tls)
105591  		}
105592  	}()
105593  	func() {
105594  		if int32(elem125((*TEncName)(unsafe.Pointer(&_sqlite3PragmaØ00encnamesØ007)), uintptr(2)).Xenc) != int32(2) {
105595  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114926), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121456)))
105596  			crt.X__builtin_abort(tls)
105597  		}
105598  	}()
105599  	func() {
105600  		if int32(elem125((*TEncName)(unsafe.Pointer(&_sqlite3PragmaØ00encnamesØ007)), uintptr(3)).Xenc) != int32(3) {
105601  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(114927), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121501)))
105602  			crt.X__builtin_abort(tls)
105603  		}
105604  	}()
105605  	_returnSingleText(tls, _v, elem125((*TEncName)(unsafe.Pointer(&_sqlite3PragmaØ00encnamesØ007)), uintptr((*Xsqlite3)(_pParse.Xdb).Xenc)).XzName)
105606  	goto _407
105607  _399:
105608  	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) {
105609  		goto _409
105610  	}
105611  	_157_pEnc = elem125((*TEncName)(unsafe.Pointer(&_sqlite3PragmaØ00encnamesØ007)), 0)
105612  _410:
105613  	if _157_pEnc.XzName == nil {
105614  		goto _413
105615  	}
105616  	if int32(0) == _sqlite3StrICmp(tls, _zRight, _157_pEnc.XzName) {
105617  		(*XSchema)(elem27((*XDb)(_db.XaDb), 0).XpSchema).Xenc = store3(&_db.Xenc, uint8(func() int32 {
105618  			if _157_pEnc.Xenc != 0 {
105619  				return int32(_157_pEnc.Xenc)
105620  			}
105621  			return int32(2)
105622  		}()))
105623  		goto _413
105624  	}
105625  	*(*uintptr)(unsafe.Pointer(&_157_pEnc)) += uintptr(8)
105626  	goto _410
105627  _413:
105628  	if _157_pEnc.XzName == nil {
105629  		_sqlite3ErrorMsg(tls, _pParse, str(121546), unsafe.Pointer(_zRight))
105630  	}
105631  _409:
105632  _407:
105633  	goto _64
105634  _50:
105635  	_164_iCookie = int32(_pPragma.XiArg)
105636  	_sqlite3VdbeUsesBtree(tls, _v, _iDb)
105637  	if _zRight == nil || (int32(_pPragma.XmPragFlg)&int32(8)) != int32(0) {
105638  		goto _419
105639  	}
105640  	_sqlite3VdbeVerifyNoMallocRequired(tls, _v, int32(2))
105641  	_165_aOp = _sqlite3VdbeAddOpList(tls, _v, int32(2), (*XVdbeOpList)(unsafe.Pointer(&_sqlite3PragmaØ00setCookieØ008)), int32(0))
105642  	if func() int32 {
105643  		if _165_aOp == nil {
105644  			return func() int32 {
105645  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115000), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(4809)))
105646  				crt.X__builtin_abort(tls)
105647  				return int32(1)
105648  			}()
105649  		}
105650  		return int32(0)
105651  	}() != 0 {
105652  		goto _64
105653  	}
105654  	elem61(_165_aOp, 0).Xp1 = _iDb
105655  	elem61(_165_aOp, uintptr(1)).Xp1 = _iDb
105656  	elem61(_165_aOp, uintptr(1)).Xp2 = _164_iCookie
105657  	elem61(_165_aOp, uintptr(1)).Xp3 = _sqlite3Atoi(tls, _zRight)
105658  	goto _423
105659  _419:
105660  	_sqlite3VdbeVerifyNoMallocRequired(tls, _v, int32(3))
105661  	_166_aOp = _sqlite3VdbeAddOpList(tls, _v, int32(3), (*XVdbeOpList)(unsafe.Pointer(&_sqlite3PragmaØ00readCookieØ009)), int32(0))
105662  	if func() int32 {
105663  		if _166_aOp == nil {
105664  			return func() int32 {
105665  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115015), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(4809)))
105666  				crt.X__builtin_abort(tls)
105667  				return int32(1)
105668  			}()
105669  		}
105670  		return int32(0)
105671  	}() != 0 {
105672  		goto _64
105673  	}
105674  	elem61(_166_aOp, 0).Xp1 = _iDb
105675  	elem61(_166_aOp, uintptr(1)).Xp1 = _iDb
105676  	elem61(_166_aOp, uintptr(1)).Xp3 = _164_iCookie
105677  	_sqlite3VdbeReusable(tls, _v)
105678  _423:
105679  	goto _64
105680  _51:
105681  	_167_i = int32(0)
105682  	_pParse.XnMem = int32(1)
105683  _427:
105684  	if store1(&_167_zOpt, Xsqlite3_compileoption_get(tls, postInc2(&_167_i, 1))) != nil {
105685  		_sqlite3VdbeLoadString(tls, _v, int32(1), _167_zOpt)
105686  		_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(1))
105687  		goto _427
105688  	}
105689  	_sqlite3VdbeReusable(tls, _v)
105690  	goto _64
105691  _52:
105692  	_169_iBt = func() int32 {
105693  		if _pId2.Xz != nil {
105694  			return _iDb
105695  		}
105696  		return int32(10)
105697  	}()
105698  	_169_eMode = int32(0)
105699  	if _zRight == nil {
105700  		goto _431
105701  	}
105702  	if _sqlite3StrICmp(tls, _zRight, str(121571)) == int32(0) {
105703  		_169_eMode = int32(1)
105704  		goto _436
105705  	}
105706  	if _sqlite3StrICmp(tls, _zRight, str(121576)) == int32(0) {
105707  		_169_eMode = int32(2)
105708  		goto _436
105709  	}
105710  	if _sqlite3StrICmp(tls, _zRight, str(89703)) == int32(0) {
105711  		_169_eMode = int32(3)
105712  	}
105713  _436:
105714  _431:
105715  	_pParse.XnMem = int32(3)
105716  	_sqlite3VdbeAddOp3(tls, _v, int32(8), _169_iBt, _169_eMode, int32(1))
105717  	_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(3))
105718  	goto _64
105719  _53:
105720  	if _zRight != nil {
105721  		Xsqlite3_wal_autocheckpoint(tls, _db, _sqlite3Atoi(tls, _zRight))
105722  	}
105723  	_returnSingleInt(tls, _v, int64(func() int32 {
105724  		if *(*uintptr)(unsafe.Pointer(&struct {
105725  			f func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32
105726  		}{func() func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32 {
105727  			v := _db.XxWalCallback
105728  			return *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32)(unsafe.Pointer(&v))
105729  		}()})) == *(*uintptr)(unsafe.Pointer(&struct {
105730  			f func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32
105731  		}{_sqlite3WalDefaultHook})) {
105732  			return int32(crt.P2U(_db.XpWalArg))
105733  		}
105734  		return int32(0)
105735  	}()))
105736  	goto _64
105737  _54:
105738  	Xsqlite3_db_release_memory(tls, _db)
105739  	goto _64
105740  _55:
105741  	if _zRight == nil {
105742  		goto _440
105743  	}
105744  	_177_opMask = uint32(_sqlite3Atoi(tls, _zRight))
105745  	if (_177_opMask & uint32(2)) == (0) {
105746  		goto _64
105747  	}
105748  	goto _442
105749  _440:
105750  	_177_opMask = uint32(65534)
105751  _442:
105752  	_177_iTabCur = postInc2(&_pParse.XnTab, 1)
105753  	_177_iDbLast = func() int32 {
105754  		if _zDb != nil {
105755  			return _iDb
105756  		}
105757  		return (_db.XnDb - int32(1))
105758  	}()
105759  _445:
105760  	if _iDb > _177_iDbLast {
105761  		goto _448
105762  	}
105763  	if _iDb == int32(1) {
105764  		goto _446
105765  	}
105766  	_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
105767  	_177_pSchema = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema)
105768  	_177_k = (*XHashElem)(_177_pSchema.XtblHash.Xfirst)
105769  _450:
105770  	if _177_k == nil {
105771  		goto _453
105772  	}
105773  	_177_pTab = (*XTable)(_177_k.Xdata)
105774  	if (_177_pTab.XtabFlags & uint32(256)) == (0) {
105775  		goto _451
105776  	}
105777  	_177_szThreshold = int16(int32(_177_pTab.XnRowLogEst) + int32(46))
105778  	func() {
105779  		if int32(_sqlite3LogEst(tls, uint64(25))) != int32(46) {
105780  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115184), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121584)))
105781  			crt.X__builtin_abort(tls)
105782  		}
105783  	}()
105784  	_177_pIdx = (*XIndex)(_177_pTab.XpIndex)
105785  _457:
105786  	if _177_pIdx == nil {
105787  		goto _460
105788  	}
105789  	if ((uint32(_177_pIdx.XidxType>>7) << 31) >> 31) == 0 {
105790  		_177_szThreshold = 0
105791  		goto _460
105792  	}
105793  	_177_pIdx = (*XIndex)(_177_pIdx.XpNext)
105794  	goto _457
105795  _460:
105796  	if _177_szThreshold != 0 {
105797  		_sqlite3OpenTable(tls, _pParse, _177_iTabCur, _iDb, _177_pTab, int32(106))
105798  		_sqlite3VdbeAddOp3(tls, _v, int32(34), _177_iTabCur, int32(uint32(_sqlite3VdbeCurrentAddr(tls, _v)+int32(2))+(_177_opMask&uint32(1))), int32(_177_szThreshold))
105799  	}
105800  	_177_zSubSql = _sqlite3MPrintf(tls, _db, str(121606), unsafe.Pointer(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName), unsafe.Pointer(_177_pTab.XzName))
105801  	if (_177_opMask & uint32(1)) != 0 {
105802  		_185_r1 = _sqlite3GetTempReg(tls, _pParse)
105803  		_sqlite3VdbeAddOp4(tls, _v, int32(97), int32(0), _185_r1, int32(0), _177_zSubSql, int32(-1))
105804  		_sqlite3VdbeAddOp2(tls, _v, int32(67), _185_r1, int32(1))
105805  		goto _464
105806  	}
105807  	_sqlite3VdbeAddOp4(tls, _v, int32(138), int32(0), int32(0), int32(0), _177_zSubSql, int32(-1))
105808  _464:
105809  _451:
105810  	_177_k = (*XHashElem)(_177_k.Xnext)
105811  	goto _450
105812  _453:
105813  _446:
105814  	_iDb += 1
105815  	goto _445
105816  _448:
105817  	_sqlite3VdbeAddOp0(tls, _v, int32(153))
105818  	goto _64
105819  _56:
105820  	func() {
105821  		if int32(_pPragma.XePragTyp) != int32(3) {
105822  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(115222), unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000), unsafe.Pointer(str(121624)))
105823  			crt.X__builtin_abort(tls)
105824  		}
105825  	}()
105826  	if _zRight != nil {
105827  		Xsqlite3_busy_timeout(tls, _db, _sqlite3Atoi(tls, _zRight))
105828  	}
105829  	_returnSingleInt(tls, _v, int64(_db.XbusyTimeout))
105830  	goto _64
105831  _57:
105832  	if (_zRight != nil) && (_sqlite3DecOrHexToI64(tls, _zRight, &_189_N) == int32(0)) {
105833  		Xsqlite3_soft_heap_limit64(tls, _189_N)
105834  	}
105835  	_returnSingleInt(tls, _v, Xsqlite3_soft_heap_limit64(tls, int64(-1)))
105836  	goto _64
105837  _58:
105838  	if ((_zRight != nil) && (_sqlite3DecOrHexToI64(tls, _zRight, &_191_N) == int32(0))) && (_191_N >= (0)) {
105839  		Xsqlite3_limit(tls, _db, int32(11), int32(_191_N&int64(2147483647)))
105840  	}
105841  	_returnSingleInt(tls, _v, int64(Xsqlite3_limit(tls, _db, int32(11), int32(-1))))
105842  	goto _64
105843  _59:
105844  	_pParse.XnMem = int32(2)
105845  	_193_i = int32(0)
105846  _473:
105847  	if _193_i >= _db.XnDb {
105848  		goto _476
105849  	}
105850  	_194_zState = str(121664)
105851  	if (elem27((*XDb)(_db.XaDb), uintptr(_193_i)).XzDbSName) == nil {
105852  		goto _474
105853  	}
105854  	_194_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_193_i)).XpBt)
105855  	if (_194_pBt == nil) || (_sqlite3BtreePager(tls, _194_pBt) == nil) {
105856  		_194_zState = str(121672)
105857  		goto _483
105858  	}
105859  	if Xsqlite3_file_control(tls, _db, func() *int8 {
105860  		if _193_i != 0 {
105861  			return (elem27((*XDb)(_db.XaDb), uintptr(_193_i)).XzDbSName)
105862  		}
105863  		return nil
105864  	}(), int32(1), unsafe.Pointer(&_194_j)) == int32(0) {
105865  		_194_zState = *elem0((**int8)(unsafe.Pointer(&_sqlite3PragmaØ00azLockNameØ0010)), uintptr(_194_j))
105866  	}
105867  _483:
105868  	_sqlite3VdbeMultiLoad(tls, _v, int32(1), str(121679), unsafe.Pointer(elem27((*XDb)(_db.XaDb), uintptr(_193_i)).XzDbSName), unsafe.Pointer(_194_zState))
105869  	_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(2))
105870  _474:
105871  	_193_i += 1
105872  	goto _473
105873  _476:
105874  	goto _64
105875  _64:
105876  	if (int32(_pPragma.XmPragFlg)&int32(4)) != 0 && (_zRight != nil) {
105877  		_sqlite3VdbeVerifyNoResultRow(tls, _v)
105878  	}
105879  _pragma_out:
105880  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zLeft))
105881  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zRight))
105882  	_ = _aFcntl
105883  	_ = _103_azOrigin
105884  	_ = _106_i
105885  	_ = _167_i
105886  }
105887  
105888  // C comment
105889  //  /*
105890  //  ** Mark the VDBE as one that can only be run one time.
105891  //  */
105892  func _sqlite3VdbeRunOnlyOnce(tls *crt.TLS, _p *TVdbe) {
105893  	storebits26(&_p.Xexpired, int16(1), 32, 5)
105894  }
105895  
105896  var _sqlite3PragmaØ00__func__Ø000 [14]int8
105897  
105898  func init() {
105899  	crt.Xstrncpy(nil, &_sqlite3PragmaØ00__func__Ø000[0], str(121682), 14)
105900  }
105901  
105902  // C comment
105903  //  /*
105904  //  ** Invoke the xFileControl method on a particular database.
105905  //  */
105906  func Xsqlite3_file_control(tls *crt.TLS, _db *Xsqlite3, _zDbName *int8, _op int32, _pArg unsafe.Pointer) (r0 int32) {
105907  	var _rc int32
105908  	var _pBtree *XBtree
105909  	var _1_pPager *XPager
105910  	var _1_fd *Xsqlite3_file
105911  	_rc = int32(1)
105912  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
105913  		return _sqlite3MisuseError(tls, int32(143986))
105914  	}
105915  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
105916  	_pBtree = _sqlite3DbNameToBtree(tls, _db, _zDbName)
105917  	if _pBtree == nil {
105918  		goto _1
105919  	}
105920  	_sqlite3BtreeEnter(tls, _pBtree)
105921  	_1_pPager = _sqlite3BtreePager(tls, _pBtree)
105922  	func() {
105923  		if _1_pPager == nil {
105924  			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)))
105925  			crt.X__builtin_abort(tls)
105926  		}
105927  	}()
105928  	_1_fd = _sqlite3PagerFile(tls, _1_pPager)
105929  	func() {
105930  		if _1_fd == nil {
105931  			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)))
105932  			crt.X__builtin_abort(tls)
105933  		}
105934  	}()
105935  	if _op == int32(7) {
105936  		*(**Xsqlite3_file)(_pArg) = _1_fd
105937  		_rc = int32(0)
105938  		goto _13
105939  	}
105940  	if _op == int32(27) {
105941  		*(**Xsqlite3_vfs)(_pArg) = _sqlite3PagerVfs(tls, _1_pPager)
105942  		_rc = int32(0)
105943  		goto _13
105944  	}
105945  	if _op == int32(28) {
105946  		*(**Xsqlite3_file)(_pArg) = _sqlite3PagerJrnlFile(tls, _1_pPager)
105947  		_rc = int32(0)
105948  		goto _13
105949  	}
105950  	if _1_fd.XpMethods != nil {
105951  		_rc = _sqlite3OsFileControl(tls, _1_fd, _op, _pArg)
105952  		goto _13
105953  	}
105954  	_rc = int32(12)
105955  _13:
105956  	_sqlite3BtreeLeave(tls, _pBtree)
105957  _1:
105958  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
105959  	return _rc
105960  }
105961  
105962  // C comment
105963  //  /*
105964  //  ** Return the Btree pointer identified by zDbName.  Return NULL if not found.
105965  //  */
105966  func _sqlite3DbNameToBtree(tls *crt.TLS, _db *Xsqlite3, _zDbName *int8) (r0 *XBtree) {
105967  	var _iDb int32
105968  	_iDb = func() int32 {
105969  		if _zDbName != nil {
105970  			return _sqlite3FindDbName(tls, _db, _zDbName)
105971  		}
105972  		return int32(0)
105973  	}()
105974  	return func() *XBtree {
105975  		if _iDb < int32(0) {
105976  			return nil
105977  		}
105978  		return (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpBt)
105979  	}()
105980  }
105981  
105982  var _sqlite3_file_controlØ00__func__Ø000 [21]int8
105983  
105984  func init() {
105985  	crt.Xstrncpy(nil, &_sqlite3_file_controlØ00__func__Ø000[0], str(121702), 21)
105986  }
105987  
105988  // C comment
105989  //  /*
105990  //  ** Return the file handle for the journal file (if it exists).
105991  //  ** This will be either the rollback journal or the WAL file.
105992  //  */
105993  func _sqlite3PagerJrnlFile(tls *crt.TLS, _pPager *XPager) (r0 *Xsqlite3_file) {
105994  	return func() *Xsqlite3_file {
105995  		if _pPager.XpWal != nil {
105996  			return _sqlite3WalFile(tls, (*XWal)(_pPager.XpWal))
105997  		}
105998  		return (*Xsqlite3_file)(_pPager.Xjfd)
105999  	}()
106000  }
106001  
106002  // C comment
106003  //  /* Return the sqlite3_file object for the WAL file
106004  //  */
106005  func _sqlite3WalFile(tls *crt.TLS, _pWal *XWal) (r0 *Xsqlite3_file) {
106006  	return (*Xsqlite3_file)(_pWal.XpWalFd)
106007  }
106008  
106009  // C comment
106010  //  /*
106011  //  ** Generate code to return a single text value.
106012  //  */
106013  func _returnSingleText(tls *crt.TLS, _v *TVdbe, _zValue *int8) {
106014  	if _zValue != nil {
106015  		_sqlite3VdbeLoadString(tls, _v, int32(1), _zValue)
106016  		_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(1))
106017  	}
106018  }
106019  
106020  // C comment
106021  //  /*
106022  //  ** Set result column names for a pragma.
106023  //  */
106024  func _setPragmaResultColumnNames(tls *crt.TLS, _v *TVdbe, _pPragma *XPragmaName) {
106025  	var _2_i, _2_j int32
106026  	var _n uint8
106027  	_n = _pPragma.XnPragCName
106028  	_sqlite3VdbeSetNumCols(tls, _v, func() int32 {
106029  		if int32(_n) == int32(0) {
106030  			return int32(1)
106031  		}
106032  		return int32(_n)
106033  	}())
106034  	if int32(_n) == int32(0) {
106035  		_sqlite3VdbeSetColName(tls, _v, int32(0), int32(0), _pPragma.XzName, nil)
106036  		goto _3
106037  	}
106038  	*func() *int32 { _2_i = int32(0); return &_2_j }() = int32(_pPragma.XiPragCName)
106039  _4:
106040  	if _2_i >= int32(_n) {
106041  		goto _7
106042  	}
106043  	_sqlite3VdbeSetColName(tls, _v, _2_i, int32(0), *elem0((**int8)(unsafe.Pointer(&_pragCName)), uintptr(_2_j)), nil)
106044  	*func() *int32 { _2_i += 1; return &_2_j }() += 1
106045  	goto _4
106046  _7:
106047  _3:
106048  }
106049  
106050  func _sqlite3VdbeVerifyNoMallocRequired(tls *crt.TLS, _p *TVdbe, _N int32) {
106051  	func() {
106052  		if (_p.XnOp + _N) > ((*XParse)(_p.XpParse).XnOpAlloc) {
106053  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72075), unsafe.Pointer(&_sqlite3VdbeVerifyNoMallocRequiredØ00__func__Ø000), unsafe.Pointer(str(121723)))
106054  			crt.X__builtin_abort(tls)
106055  		}
106056  	}()
106057  }
106058  
106059  var _sqlite3VdbeVerifyNoMallocRequiredØ00__func__Ø000 [34]int8
106060  
106061  func init() {
106062  	crt.Xstrncpy(nil, &_sqlite3VdbeVerifyNoMallocRequiredØ00__func__Ø000[0], str(121757), 34)
106063  }
106064  
106065  var _sqlite3PragmaØ00getCacheSizeØ002 [9]XVdbeOpList
106066  
106067  func init() {
106068  	_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)}}
106069  }
106070  
106071  var _sqlite3PragmaØ00iLnØ001 int32
106072  
106073  // C comment
106074  //  /*
106075  //  ** Generate code to return a single integer value.
106076  //  */
106077  func _returnSingleInt(tls *crt.TLS, _v *TVdbe, _value int64) {
106078  	_sqlite3VdbeAddOp4Dup8(tls, _v, int32(57), int32(0), int32(1), int32(0), (*uint8)(unsafe.Pointer(&_value)), int32(-10))
106079  	_sqlite3VdbeAddOp2(tls, _v, int32(67), int32(1), int32(1))
106080  }
106081  
106082  // C comment
106083  //  /*
106084  //  ** Set the BTS_SECURE_DELETE flag if newFlag is 0 or 1.  If newFlag is -1,
106085  //  ** then make no changes.  Always return the value of the BTS_SECURE_DELETE
106086  //  ** setting after the change.
106087  //  */
106088  func _sqlite3BtreeSecureDelete(tls *crt.TLS, _p *XBtree, _newFlag int32) (r0 int32) {
106089  	var _b int32
106090  	if _p == nil {
106091  		return int32(0)
106092  	}
106093  	_sqlite3BtreeEnter(tls, _p)
106094  	if _newFlag < int32(0) {
106095  		goto _1
106096  	}
106097  	{
106098  		p := &((*XBtShared)(_p.XpBt).XbtsFlags)
106099  		*p = uint16(int32(*p) & int32(-5))
106100  	}
106101  	if _newFlag != 0 {
106102  		{
106103  			p := &((*XBtShared)(_p.XpBt).XbtsFlags)
106104  			*p = uint16(int32(*p) | int32(4))
106105  		}
106106  	}
106107  _1:
106108  	_b = bool2int((int32((*XBtShared)(_p.XpBt).XbtsFlags) & int32(4)) != int32(0))
106109  	_sqlite3BtreeLeave(tls, _p)
106110  	return _b
106111  }
106112  
106113  // C comment
106114  //  /*
106115  //  ** Interpret the given string as a locking mode value.
106116  //  */
106117  func _getLockingMode(tls *crt.TLS, _z *int8) (r0 int32) {
106118  	if _z == nil {
106119  		goto _0
106120  	}
106121  	if int32(0) == _sqlite3StrICmp(tls, _z, str(89660)) {
106122  		return int32(1)
106123  	}
106124  	if int32(0) == _sqlite3StrICmp(tls, _z, str(89670)) {
106125  		return int32(0)
106126  	}
106127  _0:
106128  	return int32(-1)
106129  }
106130  
106131  // C comment
106132  //  /*
106133  //  ** Get/set the locking-mode for this pager. Parameter eMode must be one
106134  //  ** of PAGER_LOCKINGMODE_QUERY, PAGER_LOCKINGMODE_NORMAL or
106135  //  ** PAGER_LOCKINGMODE_EXCLUSIVE. If the parameter is not _QUERY, then
106136  //  ** the locking-mode is set to the value specified.
106137  //  **
106138  //  ** The returned value is either PAGER_LOCKINGMODE_NORMAL or
106139  //  ** PAGER_LOCKINGMODE_EXCLUSIVE, indicating the current (possibly updated)
106140  //  ** locking-mode.
106141  //  */
106142  func _sqlite3PagerLockingMode(tls *crt.TLS, _pPager *XPager, _eMode int32) (r0 int32) {
106143  	func() {
106144  		if _eMode != int32(-1) && _eMode != int32(0) && _eMode != int32(1) {
106145  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54047), unsafe.Pointer(&_sqlite3PagerLockingModeØ00__func__Ø000), unsafe.Pointer(str(121791)))
106146  			crt.X__builtin_abort(tls)
106147  		}
106148  	}()
106149  
106150  	func() {
106151  		if _pPager.XexclusiveMode == 0 && int32(0) != _sqlite3WalHeapMemory(tls, (*XWal)(_pPager.XpWal)) {
106152  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(54052), unsafe.Pointer(&_sqlite3PagerLockingModeØ00__func__Ø000), unsafe.Pointer(str(121895)))
106153  			crt.X__builtin_abort(tls)
106154  		}
106155  	}()
106156  	if ((_eMode >= int32(0)) && (_pPager.XtempFile == 0)) && (_sqlite3WalHeapMemory(tls, (*XWal)(_pPager.XpWal)) == 0) {
106157  		_pPager.XexclusiveMode = uint8(_eMode)
106158  	}
106159  	return int32(_pPager.XexclusiveMode)
106160  }
106161  
106162  var _sqlite3PagerLockingModeØ00__func__Ø000 [24]int8
106163  
106164  func init() {
106165  	crt.Xstrncpy(nil, &_sqlite3PagerLockingModeØ00__func__Ø000[0], str(121958), 24)
106166  }
106167  
106168  // C comment
106169  //  /*
106170  //  ** Return true if the argument is non-NULL and the WAL module is using
106171  //  ** heap-memory for the wal-index. Otherwise, if the argument is NULL or the
106172  //  ** WAL module is using shared-memory, return false.
106173  //  */
106174  func _sqlite3WalHeapMemory(tls *crt.TLS, _pWal *XWal) (r0 int32) {
106175  	return bool2int((_pWal != nil) && (int32(_pWal.XexclusiveMode) == int32(2)))
106176  }
106177  
106178  // C comment
106179  //  /*
106180  //  ** Get/set the size-limit used for persistent journal files.
106181  //  **
106182  //  ** Setting the size limit to -1 means no limit is enforced.
106183  //  ** An attempt to set a limit smaller than -1 is a no-op.
106184  //  */
106185  func _sqlite3PagerJournalSizeLimit(tls *crt.TLS, _pPager *XPager, _iLimit int64) (r0 int64) {
106186  	if _iLimit >= int64(-1) {
106187  		_pPager.XjournalSizeLimit = _iLimit
106188  		_sqlite3WalLimit(tls, (*XWal)(_pPager.XpWal), _iLimit)
106189  	}
106190  	return _pPager.XjournalSizeLimit
106191  }
106192  
106193  // C comment
106194  //  /*
106195  //  ** Change the size to which the WAL file is trucated on each reset.
106196  //  */
106197  func _sqlite3WalLimit(tls *crt.TLS, _pWal *XWal, _iLimit int64) {
106198  	if _pWal != nil {
106199  		_pWal.XmxWalSize = _iLimit
106200  	}
106201  }
106202  
106203  // C comment
106204  //  /*
106205  //  ** Interpret the given string as an auto-vacuum mode value.
106206  //  **
106207  //  ** The following strings, "none", "full" and "incremental" are
106208  //  ** acceptable, as are their numeric equivalents: 0, 1 and 2 respectively.
106209  //  */
106210  func _getAutoVacuum(tls *crt.TLS, _z *int8) (r0 int32) {
106211  	var _i int32
106212  	if int32(0) == _sqlite3StrICmp(tls, _z, str(42852)) {
106213  		return int32(0)
106214  	}
106215  	if int32(0) == _sqlite3StrICmp(tls, _z, str(121571)) {
106216  		return int32(1)
106217  	}
106218  	if int32(0) == _sqlite3StrICmp(tls, _z, str(121982)) {
106219  		return int32(2)
106220  	}
106221  	_i = _sqlite3Atoi(tls, _z)
106222  	return int32(uint8(func() int32 {
106223  		if (_i >= int32(0)) && (_i <= int32(2)) {
106224  			return _i
106225  		}
106226  		return int32(0)
106227  	}()))
106228  }
106229  
106230  var _sqlite3PragmaØ00setMeta6Ø004 [5]XVdbeOpList
106231  
106232  func init() {
106233  	_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)}}
106234  }
106235  
106236  var _sqlite3PragmaØ00iLnØ003 int32
106237  
106238  func _setAllPagerFlags(tls *crt.TLS, _db *Xsqlite3) {
106239  	var _1_n int32
106240  	var _1_pDb *XDb
106241  	if _db.XautoCommit == 0 {
106242  		goto _0
106243  	}
106244  	_1_pDb = (*XDb)(_db.XaDb)
106245  	_1_n = _db.XnDb
106246  
106247  	func() {
106248  		if (int32(_1_pDb.Xsafety_level) & int32(7)) != int32(_1_pDb.Xsafety_level) {
106249  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113447), unsafe.Pointer(&_setAllPagerFlagsØ00__func__Ø000), unsafe.Pointer(str(121994)))
106250  			crt.X__builtin_abort(tls)
106251  		}
106252  	}()
106253  _3:
106254  	if postInc2(&_1_n, -1) <= int32(0) {
106255  		goto _4
106256  	}
106257  	if _1_pDb.XpBt != nil {
106258  		_sqlite3BtreeSetPagerFlags(tls, (*XBtree)(_1_pDb.XpBt), uint32(int32(_1_pDb.Xsafety_level)|(_db.Xflags&int32(56))))
106259  	}
106260  	*(*uintptr)(unsafe.Pointer(&_1_pDb)) += uintptr(16)
106261  	goto _3
106262  _4:
106263  _0:
106264  	_ = _1_n
106265  }
106266  
106267  var _setAllPagerFlagsØ00__func__Ø000 [17]int8
106268  
106269  func init() {
106270  	crt.Xstrncpy(nil, &_setAllPagerFlagsØ00__func__Ø000[0], str(122058), 17)
106271  }
106272  
106273  // C comment
106274  //  /*
106275  //  ** Change the limit on the amount of the database file that may be
106276  //  ** memory mapped.
106277  //  */
106278  func _sqlite3BtreeSetMmapLimit(tls *crt.TLS, _p *XBtree, _szMmap int64) (r0 int32) {
106279  	var _pBt *XBtShared
106280  	_pBt = (*XBtShared)(_p.XpBt)
106281  	func() {
106282  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex)) == 0 {
106283  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(61696), unsafe.Pointer(&_sqlite3BtreeSetMmapLimitØ00__func__Ø000), unsafe.Pointer(str(8939)))
106284  			crt.X__builtin_abort(tls)
106285  		}
106286  	}()
106287  	_sqlite3BtreeEnter(tls, _p)
106288  	_sqlite3PagerSetMmapLimit(tls, (*XPager)(_pBt.XpPager), _szMmap)
106289  	_sqlite3BtreeLeave(tls, _p)
106290  	return int32(0)
106291  }
106292  
106293  var _sqlite3BtreeSetMmapLimitØ00__func__Ø000 [25]int8
106294  
106295  func init() {
106296  	crt.Xstrncpy(nil, &_sqlite3BtreeSetMmapLimitØ00__func__Ø000[0], str(122075), 25)
106297  }
106298  
106299  // C comment
106300  //  /*
106301  //  ** If the TEMP database is open, close it and mark the database schema
106302  //  ** as needing reloading.  This must be done when using the SQLITE_TEMP_STORE
106303  //  ** or DEFAULT_TEMP_STORE pragmas.
106304  //  */
106305  func _changeTempStorage(tls *crt.TLS, _pParse *XParse, _zStorageType *int8) (r0 int32) {
106306  	var _ts int32
106307  	var _db *Xsqlite3
106308  	_ts = _getTempStore(tls, _zStorageType)
106309  	_db = (*Xsqlite3)(_pParse.Xdb)
106310  	if int32(_db.Xtemp_store) == _ts {
106311  		return int32(0)
106312  	}
106313  	if _invalidateTempStorage(tls, _pParse) != int32(0) {
106314  		return int32(1)
106315  	}
106316  	_db.Xtemp_store = uint8(_ts)
106317  	return int32(0)
106318  }
106319  
106320  // C comment
106321  //  /*
106322  //  ** Interpret the given string as a temp db location. Return 1 for file
106323  //  ** backed temporary databases, 2 for the Red-Black tree in memory database
106324  //  ** and 0 to use the compile-time default.
106325  //  */
106326  func _getTempStore(tls *crt.TLS, _z *int8) (r0 int32) {
106327  	if (int32(*elem1(_z, 0)) >= int32(48)) && (int32(*elem1(_z, 0)) <= int32(50)) {
106328  		return int32(*elem1(_z, 0)) - int32(48)
106329  	}
106330  	if _sqlite3StrICmp(tls, _z, str(93808)) == int32(0) {
106331  		return int32(1)
106332  	}
106333  	if _sqlite3StrICmp(tls, _z, str(89677)) == int32(0) {
106334  		return int32(2)
106335  	}
106336  	return int32(0)
106337  }
106338  
106339  // C comment
106340  //  /*
106341  //  ** Invalidate temp storage, either when the temp storage is changed
106342  //  ** from default, or when 'file' and the temp_store_directory has changed
106343  //  */
106344  func _invalidateTempStorage(tls *crt.TLS, _pParse *XParse) (r0 int32) {
106345  	var _db *Xsqlite3
106346  	_db = (*Xsqlite3)(_pParse.Xdb)
106347  	if (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(1)).XpBt) == nil {
106348  		goto _0
106349  	}
106350  	if (_db.XautoCommit == 0) || _sqlite3BtreeIsInReadTrans(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(1)).XpBt)) != 0 {
106351  		_sqlite3ErrorMsg(tls, _pParse, str(122100))
106352  		return int32(1)
106353  	}
106354  	_sqlite3BtreeClose(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(1)).XpBt))
106355  	*(**XBtree)(unsafe.Pointer(&(elem27((*XDb)(_db.XaDb), uintptr(1)).XpBt))) = nil
106356  	_sqlite3ResetAllSchemasOfConnection(tls, _db)
106357  _0:
106358  	return int32(0)
106359  }
106360  
106361  // C comment
106362  //  /*
106363  //  ** CAPI3REF: Name Of The Folder Holding Temporary Files
106364  //  **
106365  //  ** ^(If this global variable is made to point to a string which is
106366  //  ** the name of a folder (a.k.a. directory), then all temporary files
106367  //  ** created by SQLite when using a built-in [sqlite3_vfs | VFS]
106368  //  ** will be placed in that directory.)^  ^If this variable
106369  //  ** is a NULL pointer, then SQLite performs a search for an appropriate
106370  //  ** temporary file directory.
106371  //  **
106372  //  ** Applications are strongly discouraged from using this global variable.
106373  //  ** It is required to set a temporary folder on Windows Runtime (WinRT).
106374  //  ** But for all other platforms, it is highly recommended that applications
106375  //  ** neither read nor write this variable.  This global variable is a relic
106376  //  ** that exists for backwards compatibility of legacy applications and should
106377  //  ** be avoided in new projects.
106378  //  **
106379  //  ** It is not safe to read or modify this variable in more than one
106380  //  ** thread at a time.  It is not safe to read or modify this variable
106381  //  ** if a [database connection] is being used at the same time in a separate
106382  //  ** thread.
106383  //  ** It is intended that this variable be set once
106384  //  ** as part of process initialization and before any SQLite interface
106385  //  ** routines have been called and that this variable remain unchanged
106386  //  ** thereafter.
106387  //  **
106388  //  ** ^The [temp_store_directory pragma] may modify this variable and cause
106389  //  ** it to point to memory obtained from [sqlite3_malloc].  ^Furthermore,
106390  //  ** the [temp_store_directory pragma] always assumes that any string
106391  //  ** that this variable points to is held in memory obtained from
106392  //  ** [sqlite3_malloc] and the pragma may attempt to free that memory
106393  //  ** using [sqlite3_free].
106394  //  ** Hence, if this variable is modified directly, either it should be
106395  //  ** made NULL or made to point to memory obtained from [sqlite3_malloc]
106396  //  ** or else the use of the [temp_store_directory pragma] should be avoided.
106397  //  ** Except when requested by the [temp_store_directory pragma], SQLite
106398  //  ** does not free the memory that sqlite3_temp_directory points to.  If
106399  //  ** the application wants that memory to be freed, it must do
106400  //  ** so itself, taking care to only do so after all [database connection]
106401  //  ** objects have been destroyed.
106402  //  **
106403  //  ** <b>Note to Windows Runtime users:</b>  The temporary directory must be set
106404  //  ** prior to calling [sqlite3_open] or [sqlite3_open_v2].  Otherwise, various
106405  //  ** features that require the use of temporary files may fail.  Here is an
106406  //  ** example of how to do this using C++ with the Windows Runtime:
106407  //  **
106408  //  ** <blockquote><pre>
106409  //  ** LPCWSTR zPath = Windows::Storage::ApplicationData::Current->
106410  //  ** &nbsp;     TemporaryFolder->Path->Data();
106411  //  ** char zPathBuf&#91;MAX_PATH + 1&#93;;
106412  //  ** memset(zPathBuf, 0, sizeof(zPathBuf));
106413  //  ** WideCharToMultiByte(CP_UTF8, 0, zPath, -1, zPathBuf, sizeof(zPathBuf),
106414  //  ** &nbsp;     NULL, NULL);
106415  //  ** sqlite3_temp_directory = sqlite3_mprintf("%s", zPathBuf);
106416  //  ** </pre></blockquote>
106417  //  */
106418  var Xsqlite3_temp_directory *int8
106419  
106420  // C comment
106421  //  /*
106422  //  ** Generate code that initializes multiple registers to string or integer
106423  //  ** constants.  The registers begin with iDest and increase consecutively.
106424  //  ** One register is initialized for each characgter in zTypes[].  For each
106425  //  ** "s" character in zTypes[], the register is a string if the argument is
106426  //  ** not NULL, or OP_Null if the value is a null pointer.  For each "i" character
106427  //  ** in zTypes[], the register is initialized to an integer.
106428  //  */
106429  func _sqlite3VdbeMultiLoad(tls *crt.TLS, _p *TVdbe, _iDest int32, _zTypes *int8, args ...interface{}) {
106430  	var _i int32
106431  	var _c int8
106432  	var _2_z *int8
106433  	var _ap []interface{}
106434  	_ap = args
106435  	_i = int32(0)
106436  _0:
106437  	if int32(store5(&_c, *elem1(_zTypes, uintptr(_i)))) == int32(0) {
106438  		goto _3
106439  	}
106440  	if int32(_c) == int32(115) {
106441  		_2_z = (*int8)(crt.VAPointer(&_ap))
106442  		_sqlite3VdbeAddOp4(tls, _p, func() int32 {
106443  			if _2_z == nil {
106444  				return int32(59)
106445  			}
106446  			return int32(97)
106447  		}(), int32(0), postInc2(&_iDest, 1), int32(0), _2_z, int32(0))
106448  		goto _7
106449  	}
106450  	func() {
106451  		if int32(_c) != int32(105) {
106452  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(71676), unsafe.Pointer(&_sqlite3VdbeMultiLoadØ00__func__Ø000), unsafe.Pointer(str(122162)))
106453  			crt.X__builtin_abort(tls)
106454  		}
106455  	}()
106456  	_sqlite3VdbeAddOp2(tls, _p, int32(56), crt.VAInt32(&_ap), postInc2(&_iDest, 1))
106457  _7:
106458  	_i += 1
106459  	goto _0
106460  _3:
106461  	_ap = nil
106462  }
106463  
106464  var _sqlite3VdbeMultiLoadØ00__func__Ø000 [21]int8
106465  
106466  func init() {
106467  	crt.Xstrncpy(nil, &_sqlite3VdbeMultiLoadØ00__func__Ø000[0], str(122169), 21)
106468  }
106469  
106470  func _actionName(tls *crt.TLS, _action uint8) (r0 *int8) {
106471  	var _zName *int8
106472  	switch int32(_action) {
106473  	case int32(6):
106474  		goto _4
106475  	case int32(7):
106476  		goto _1
106477  	case int32(8):
106478  		goto _2
106479  	case int32(9):
106480  		goto _3
106481  	default:
106482  		goto _5
106483  	}
106484  
106485  _1:
106486  	_zName = str(122190)
106487  	goto _6
106488  _2:
106489  	_zName = str(122199)
106490  	goto _6
106491  _3:
106492  	_zName = str(25132)
106493  	goto _6
106494  _4:
106495  	_zName = str(25285)
106496  	goto _6
106497  _5:
106498  	_zName = str(122211)
106499  	func() {
106500  		if int32(_action) != int32(0) {
106501  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(113474), unsafe.Pointer(&_actionNameØ00__func__Ø000), unsafe.Pointer(str(122221)))
106502  			crt.X__builtin_abort(tls)
106503  		}
106504  	}()
106505  	goto _6
106506  _6:
106507  	return _zName
106508  }
106509  
106510  var _actionNameØ00__func__Ø000 [11]int8
106511  
106512  func init() {
106513  	crt.Xstrncpy(nil, &_actionNameØ00__func__Ø000[0], str(122237), 11)
106514  }
106515  
106516  // C comment
106517  //  /*
106518  //  ** Turn parser tracing on by giving a stream to which to write the trace
106519  //  ** and a prompt to preface each trace message.  Tracing is turned off
106520  //  ** by making either argument NULL
106521  //  **
106522  //  ** Inputs:
106523  //  ** <ul>
106524  //  ** <li> A FILE* to which trace output should be written.
106525  //  **      If NULL, then tracing is turned off.
106526  //  ** <li> A prefix string written at the beginning of every
106527  //  **      line of trace output.  If NULL, then tracing is
106528  //  **      turned off.
106529  //  ** </ul>
106530  //  **
106531  //  ** Outputs:
106532  //  ** None.
106533  //  */
106534  func _sqlite3ParserTrace(tls *crt.TLS, _TraceFILE *crt.XFILE, _zTracePrompt *int8) {
106535  	_yyTraceFILE = _TraceFILE
106536  	bug20530(_yyTraceFILE)
106537  	_yyTracePrompt = _zTracePrompt
106538  	bug20530(_yyTracePrompt)
106539  	if _yyTraceFILE == nil {
106540  		_yyTracePrompt = nil
106541  		bug20530(_yyTracePrompt)
106542  		goto _2
106543  	}
106544  	if _yyTracePrompt == nil {
106545  		_yyTraceFILE = nil
106546  		bug20530(_yyTraceFILE)
106547  	}
106548  _2:
106549  }
106550  
106551  // C comment
106552  //  /*
106553  //  ** Register the built-in LIKE and GLOB functions.  The caseSensitive
106554  //  ** parameter determines whether or not the LIKE operator is case
106555  //  ** sensitive.  GLOB is always case sensitive.
106556  //  */
106557  func _sqlite3RegisterLikeFunctions(tls *crt.TLS, _db *Xsqlite3, _caseSensitive int32) {
106558  	var _pInfo *TcompareInfo
106559  	if _caseSensitive != 0 {
106560  		_pInfo = &_likeInfoAlt
106561  		goto _1
106562  	}
106563  	_pInfo = &_likeInfoNorm
106564  _1:
106565  	_sqlite3CreateFunc(tls, _db, str(7867), int32(2), int32(1), unsafe.Pointer(_pInfo), _likeFunc, nil, nil, nil)
106566  	_sqlite3CreateFunc(tls, _db, str(7867), int32(3), int32(1), unsafe.Pointer(_pInfo), _likeFunc, nil, nil, nil)
106567  	_sqlite3CreateFunc(tls, _db, str(7862), int32(2), int32(1), unsafe.Pointer(&_globInfo), _likeFunc, nil, nil, nil)
106568  	_setLikeOptFlag(tls, _db, str(7862), uint8(12))
106569  	_setLikeOptFlag(tls, _db, str(7867), uint8(func() int32 {
106570  		if _caseSensitive != 0 {
106571  			return int32(12)
106572  		}
106573  		return int32(4)
106574  	}()))
106575  }
106576  
106577  // C comment
106578  //  /*
106579  //  ** Implementation of the like() SQL function.  This function implements
106580  //  ** the build-in LIKE operator.  The first argument to the function is the
106581  //  ** pattern and the second argument is the string.  So, the SQL statements:
106582  //  **
106583  //  **       A LIKE B
106584  //  **
106585  //  ** is implemented as like(B,A).
106586  //  **
106587  //  ** This same function (with a different compareInfo structure) computes
106588  //  ** the GLOB operator.
106589  //  */
106590  func _likeFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
106591  	var _nPat int32
106592  	var _escape uint32
106593  	var _zA, _zB, _2_zEsc *uint8
106594  	var _db *Xsqlite3
106595  	var _pInfo *TcompareInfo
106596  	_db = Xsqlite3_context_db_handle(tls, _context)
106597  	_pInfo = (*TcompareInfo)(Xsqlite3_user_data(tls, _context))
106598  	_zB = Xsqlite3_value_text(tls, *elem19(_argv, 0))
106599  	_zA = Xsqlite3_value_text(tls, *elem19(_argv, uintptr(1)))
106600  	_nPat = Xsqlite3_value_bytes(tls, *elem19(_argv, 0))
106601  	if _nPat > (*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(8))) {
106602  		Xsqlite3_result_error(tls, _context, str(122248), int32(-1))
106603  		return
106604  	}
106605  	func() {
106606  		if _zB != Xsqlite3_value_text(tls, *elem19(_argv, 0)) {
106607  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106383), unsafe.Pointer(&_likeFuncØ00__func__Ø000), unsafe.Pointer(str(122281)))
106608  			crt.X__builtin_abort(tls)
106609  		}
106610  	}()
106611  	if _argc != int32(3) {
106612  		goto _3
106613  	}
106614  	_2_zEsc = Xsqlite3_value_text(tls, *elem19(_argv, uintptr(2)))
106615  	if _2_zEsc == nil {
106616  		return
106617  	}
106618  	if _sqlite3Utf8CharLen(tls, (*int8)(unsafe.Pointer(_2_zEsc)), int32(-1)) != int32(1) {
106619  		Xsqlite3_result_error(tls, _context, str(122313), int32(-1))
106620  		return
106621  	}
106622  	_escape = _sqlite3Utf8Read(tls, &_2_zEsc)
106623  	goto _6
106624  _3:
106625  	_escape = uint32(_pInfo.XmatchSet)
106626  _6:
106627  	if (_zA != nil) && (_zB != nil) {
106628  		Xsqlite3_result_int(tls, _context, bool2int(_patternCompare(tls, _zB, _zA, _pInfo, _escape) == int32(0)))
106629  	}
106630  }
106631  
106632  // C comment
106633  //  /*
106634  //  ** Extract the user data from a sqlite3_context structure and return a
106635  //  ** pointer to it.
106636  //  */
106637  func Xsqlite3_user_data(tls *crt.TLS, _p *Xsqlite3_context) (r0 unsafe.Pointer) {
106638  	func() {
106639  		if _p == nil || _p.XpFunc == nil {
106640  			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)))
106641  			crt.X__builtin_abort(tls)
106642  		}
106643  	}()
106644  	return (*XFuncDef)(_p.XpFunc).XpUserData
106645  }
106646  
106647  var _sqlite3_user_dataØ00__func__Ø000 [18]int8
106648  
106649  func init() {
106650  	crt.Xstrncpy(nil, &_sqlite3_user_dataØ00__func__Ø000[0], str(122372), 18)
106651  }
106652  
106653  var _likeFuncØ00__func__Ø000 [9]int8
106654  
106655  func init() {
106656  	crt.Xstrncpy(nil, &_likeFuncØ00__func__Ø000[0], str(122390), 9)
106657  }
106658  
106659  func Xsqlite3_result_int(tls *crt.TLS, _pCtx *Xsqlite3_context, _iVal int32) {
106660  	func() {
106661  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
106662  			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)))
106663  			crt.X__builtin_abort(tls)
106664  		}
106665  	}()
106666  	_sqlite3VdbeMemSetInt64(tls, (*XMem)(_pCtx.XpOut), int64(_iVal))
106667  }
106668  
106669  var _sqlite3_result_intØ00__func__Ø000 [19]int8
106670  
106671  func init() {
106672  	crt.Xstrncpy(nil, &_sqlite3_result_intØ00__func__Ø000[0], str(122399), 19)
106673  }
106674  
106675  // C comment
106676  //  /*
106677  //  ** Set the LIKEOPT flag on the 2-argument function with the given name.
106678  //  */
106679  func _setLikeOptFlag(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _flagVal uint8) {
106680  	var _pDef *XFuncDef
106681  	_pDef = _sqlite3FindFunction(tls, _db, _zName, int32(2), uint8(1), 0)
106682  	if func() int32 {
106683  		if _pDef != nil {
106684  			return int32(1)
106685  		}
106686  		return func() int32 {
106687  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107216), unsafe.Pointer(&_setLikeOptFlagØ00__func__Ø000), unsafe.Pointer(str(4809)))
106688  			crt.X__builtin_abort(tls)
106689  			return int32(0)
106690  		}()
106691  	}() != 0 {
106692  		{
106693  			p := &_pDef.XfuncFlags
106694  			*p = uint16(int32(*p) | int32(_flagVal))
106695  		}
106696  	}
106697  }
106698  
106699  var _setLikeOptFlagØ00__func__Ø000 [15]int8
106700  
106701  func init() {
106702  	crt.Xstrncpy(nil, &_setLikeOptFlagØ00__func__Ø000[0], str(122418), 15)
106703  }
106704  
106705  // C comment
106706  //  /*
106707  //  ** Helper subroutine for PRAGMA integrity_check:
106708  //  **
106709  //  ** Generate code to output a single-column result row with the result
106710  //  ** held in register regResult.  Decrement the result count and halt if
106711  //  ** the maximum number of result rows have been issued.
106712  //  */
106713  func _integrityCheckResultRow(tls *crt.TLS, _v *TVdbe, _regResult int32) (r0 int32) {
106714  	var _addr int32
106715  	_sqlite3VdbeAddOp2(tls, _v, int32(67), _regResult, int32(1))
106716  	_addr = _sqlite3VdbeAddOp3(tls, _v, int32(46), int32(1), _sqlite3VdbeCurrentAddr(tls, _v)+int32(2), int32(1))
106717  	_sqlite3VdbeAddOp2(tls, _v, int32(55), int32(0), int32(0))
106718  	return _addr
106719  }
106720  
106721  func _sqlite3NoTempsInRange(tls *crt.TLS, _pParse *XParse, _iFirst int32, _iLast int32) (r0 int32) {
106722  	var _i int32
106723  	if ((_pParse.XnRangeReg > int32(0)) && ((_pParse.XiRangeReg + _pParse.XnRangeReg) < _iLast)) && (_pParse.XiRangeReg >= _iFirst) {
106724  		return int32(0)
106725  	}
106726  	_i = int32(0)
106727  _3:
106728  	if _i >= int32(_pParse.XnTempReg) {
106729  		goto _6
106730  	}
106731  	if ((*elem8((*int32)(unsafe.Pointer(&_pParse.XaTempReg)), uintptr(_i))) >= _iFirst) && ((*elem8((*int32)(unsafe.Pointer(&_pParse.XaTempReg)), uintptr(_i))) <= _iLast) {
106732  		return int32(0)
106733  	}
106734  	_i += 1
106735  	goto _3
106736  _6:
106737  	return int32(1)
106738  }
106739  
106740  var _sqlite3PragmaØ00endCodeØ006 [4]XVdbeOpList
106741  
106742  func init() {
106743  	_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)}}
106744  }
106745  
106746  var _sqlite3PragmaØ00iLnØ005 int32
106747  
106748  var _sqlite3PragmaØ00encnamesØ007 [9]TEncName
106749  
106750  func init() {
106751  	_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{}}
106752  }
106753  
106754  var _sqlite3PragmaØ00setCookieØ008 [2]XVdbeOpList
106755  
106756  func init() {
106757  	_sqlite3PragmaØ00setCookieØ008 = [2]XVdbeOpList{XVdbeOpList{Xopcode: uint8(2), Xp2: int8(1)}, XVdbeOpList{Xopcode: uint8(104)}}
106758  }
106759  
106760  var _sqlite3PragmaØ00readCookieØ009 [3]XVdbeOpList
106761  
106762  func init() {
106763  	_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)}}
106764  }
106765  
106766  // C comment
106767  //  /*
106768  //  ** Mark the VDBE as one that can only be run multiple times.
106769  //  */
106770  func _sqlite3VdbeReusable(tls *crt.TLS, _p *TVdbe) {
106771  	storebits26(&_p.Xexpired, 0, 32, 5)
106772  }
106773  
106774  // C comment
106775  //  /*
106776  //  ** Return the N-th compile-time option string.  If N is out of range,
106777  //  ** return a NULL pointer.
106778  //  */
106779  func Xsqlite3_compileoption_get(tls *crt.TLS, _N int32) (r0 *int8) {
106780  	if (_N >= int32(0)) && (_N < int32(6)) {
106781  		return *elem0((**int8)(unsafe.Pointer(&_azCompileOpt)), uintptr(_N))
106782  	}
106783  	return nil
106784  }
106785  
106786  // C comment
106787  //  /*
106788  //  ** An array of names of all compile-time options.  This array should
106789  //  ** be sorted A-Z.
106790  //  **
106791  //  ** This array looks large, but in a typical installation actually uses
106792  //  ** only a handful of compile-time options, so most times this array is usually
106793  //  ** rather short and uses little memory space.
106794  //  */
106795  var _azCompileOpt [6]*int8
106796  
106797  func init() {
106798  	_azCompileOpt = [6]*int8{str(122491), str(122497), str(122519), str(122545), str(122562), str(122576)}
106799  }
106800  
106801  // C comment
106802  //  /*
106803  //  ** Configure an sqlite3_wal_hook() callback to automatically checkpoint
106804  //  ** a database after committing a transaction if there are nFrame or
106805  //  ** more frames in the log file. Passing zero or a negative value as the
106806  //  ** nFrame parameter disables automatic checkpoints entirely.
106807  //  **
106808  //  ** The callback registered by this function replaces any existing callback
106809  //  ** registered using sqlite3_wal_hook(). Likewise, registering a callback
106810  //  ** using sqlite3_wal_hook() disables the automatic checkpoint mechanism
106811  //  ** configured by this function.
106812  //  */
106813  func Xsqlite3_wal_autocheckpoint(tls *crt.TLS, _db *Xsqlite3, _nFrame int32) (r0 int32) {
106814  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
106815  		return _sqlite3MisuseError(tls, int32(142507))
106816  	}
106817  	if _nFrame > int32(0) {
106818  		Xsqlite3_wal_hook(tls, _db, _sqlite3WalDefaultHook, crt.U2P(uintptr(_nFrame)))
106819  		goto _2
106820  	}
106821  	Xsqlite3_wal_hook(tls, _db, nil, nil)
106822  _2:
106823  	return int32(0)
106824  }
106825  
106826  // C comment
106827  //  /*
106828  //  ** Register a callback to be invoked each time a transaction is written
106829  //  ** into the write-ahead-log by this database connection.
106830  //  */
106831  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) {
106832  	var _pRet unsafe.Pointer
106833  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
106834  		_sqlite3MisuseError(tls, int32(142531))
106835  		return nil
106836  	}
106837  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
106838  	_pRet = _db.XpWalArg
106839  	*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32)(unsafe.Pointer(&_db.XxWalCallback)) = _xCallback
106840  	_db.XpWalArg = _pArg
106841  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
106842  	return _pRet
106843  }
106844  
106845  func _sqlite3WalDefaultHook(tls *crt.TLS, _pClientData unsafe.Pointer, _db *Xsqlite3, _zDb *int8, _nFrame int32) (r0 int32) {
106846  	if _nFrame >= int32(crt.P2U(_pClientData)) {
106847  		_sqlite3BeginBenignMalloc(tls)
106848  		Xsqlite3_wal_checkpoint(tls, _db, _zDb)
106849  		_sqlite3EndBenignMalloc(tls)
106850  	}
106851  	return int32(0)
106852  }
106853  
106854  // C comment
106855  //  /*
106856  //  ** Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points
106857  //  ** to contains a zero-length string, all attached databases are
106858  //  ** checkpointed.
106859  //  */
106860  func Xsqlite3_wal_checkpoint(tls *crt.TLS, _db *Xsqlite3, _zDb *int8) (r0 int32) {
106861  	return Xsqlite3_wal_checkpoint_v2(tls, _db, _zDb, int32(0), nil, nil)
106862  }
106863  
106864  // C comment
106865  //  /*
106866  //  ** Checkpoint database zDb.
106867  //  */
106868  func Xsqlite3_wal_checkpoint_v2(tls *crt.TLS, _db *Xsqlite3, _zDb *int8, _eMode int32, _pnLog *int32, _pnCkpt *int32) (r0 int32) {
106869  	var _rc, _iDb int32
106870  	_iDb = int32(10)
106871  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
106872  		return _sqlite3MisuseError(tls, int32(142563))
106873  	}
106874  	if _pnLog != nil {
106875  		*_pnLog = int32(-1)
106876  	}
106877  	if _pnCkpt != nil {
106878  		*_pnCkpt = int32(-1)
106879  	}
106880  
106881  	if (_eMode < int32(0)) || (_eMode > int32(3)) {
106882  		return int32(21)
106883  	}
106884  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
106885  	if (_zDb != nil) && ((*elem1(_zDb, 0)) != 0) {
106886  		_iDb = _sqlite3FindDbName(tls, _db, _zDb)
106887  	}
106888  	if _iDb < int32(0) {
106889  		_rc = int32(1)
106890  		_sqlite3ErrorWithMsg(tls, _db, int32(1), str(122589), unsafe.Pointer(_zDb))
106891  		goto _8
106892  	}
106893  	_db.XbusyHandler.XnBusy = int32(0)
106894  	_rc = _sqlite3Checkpoint(tls, _db, _iDb, _eMode, _pnLog, _pnCkpt)
106895  	_sqlite3Error(tls, _db, _rc)
106896  _8:
106897  	_rc = _sqlite3ApiExit(tls, _db, _rc)
106898  	if _db.XnVdbeActive == int32(0) {
106899  		*(*int32)(unsafe.Pointer(&_db.Xu1)) = int32(0)
106900  	}
106901  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
106902  	return _rc
106903  }
106904  
106905  // C comment
106906  //  /*
106907  //  ** Free up as much memory as we can from the given database
106908  //  ** connection.
106909  //  */
106910  func Xsqlite3_db_release_memory(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
106911  	var _i int32
106912  	var _1_pBt *XBtree
106913  	var _2_pPager *XPager
106914  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
106915  		return _sqlite3MisuseError(tls, int32(141206))
106916  	}
106917  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
106918  	_sqlite3BtreeEnterAll(tls, _db)
106919  	_i = int32(0)
106920  _1:
106921  	if _i >= _db.XnDb {
106922  		goto _4
106923  	}
106924  	_1_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
106925  	if _1_pBt != nil {
106926  		_2_pPager = _sqlite3BtreePager(tls, _1_pBt)
106927  		_sqlite3PagerShrink(tls, _2_pPager)
106928  	}
106929  	_i += 1
106930  	goto _1
106931  _4:
106932  	_sqlite3BtreeLeaveAll(tls, _db)
106933  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
106934  	return int32(0)
106935  }
106936  
106937  // C comment
106938  //  /*
106939  //  ** Free as much memory as possible from the pager.
106940  //  */
106941  func _sqlite3PagerShrink(tls *crt.TLS, _pPager *XPager) {
106942  	_sqlite3PcacheShrink(tls, (*XPCache)(_pPager.XpPCache))
106943  }
106944  
106945  // C comment
106946  //  /*
106947  //  ** Free up as much memory as possible from the page cache.
106948  //  */
106949  func _sqlite3PcacheShrink(tls *crt.TLS, _pCache *XPCache) {
106950  	func() {
106951  		if _pCache.XpCache == nil {
106952  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(44968), unsafe.Pointer(&_sqlite3PcacheShrinkØ00__func__Ø000), unsafe.Pointer(str(15913)))
106953  			crt.X__builtin_abort(tls)
106954  		}
106955  	}()
106956  	(_sqlite3Config.Xpcache2.XxShrink)(tls, _pCache.XpCache)
106957  }
106958  
106959  var _sqlite3PcacheShrinkØ00__func__Ø000 [20]int8
106960  
106961  func init() {
106962  	crt.Xstrncpy(nil, &_sqlite3PcacheShrinkØ00__func__Ø000[0], str(122610), 20)
106963  }
106964  
106965  // C comment
106966  //  /*
106967  //  ** Set the soft heap-size limit for the library. Passing a zero or
106968  //  ** negative value indicates no limit.
106969  //  */
106970  func Xsqlite3_soft_heap_limit64(tls *crt.TLS, _n int64) (r0 int64) {
106971  	var _rc int32
106972  	var _priorLimit, _excess, _nUsed int64
106973  	_rc = Xsqlite3_initialize(tls)
106974  	if _rc != 0 {
106975  		return int64(-1)
106976  	}
106977  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
106978  	_priorLimit = _mem0.XalarmThreshold
106979  	if _n < (0) {
106980  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
106981  		return _priorLimit
106982  	}
106983  	_mem0.XalarmThreshold = _n
106984  	_nUsed = _sqlite3StatusValue(tls, int32(0))
106985  	_mem0.XnearlyFull = bool2int((_n > (0)) && (_n <= _nUsed))
106986  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.Xmutex))
106987  	_excess = Xsqlite3_memory_used(tls) - _n
106988  	if _excess > (0) {
106989  		Xsqlite3_release_memory(tls, int32(_excess&int64(2147483647)))
106990  	}
106991  	return _priorLimit
106992  }
106993  
106994  // C comment
106995  //  /*
106996  //  ** Return the amount of memory currently checked out.
106997  //  */
106998  func Xsqlite3_memory_used(tls *crt.TLS) (r0 int64) {
106999  	var _res, _mx int64
107000  	Xsqlite3_status64(tls, int32(0), &_res, &_mx, int32(0))
107001  	return _res
107002  }
107003  
107004  // C comment
107005  //  /*
107006  //  ** Query status information.
107007  //  */
107008  func Xsqlite3_status64(tls *crt.TLS, _op int32, _pCurrent *int64, _pHighwater *int64, _resetFlag int32) (r0 int32) {
107009  	var _pMutex *Xsqlite3_mutex
107010  	if (_op < int32(0)) || (_op >= int32(10)) {
107011  		return _sqlite3MisuseError(tls, int32(18616))
107012  	}
107013  	if (_pCurrent == nil) || (_pHighwater == nil) {
107014  		return _sqlite3MisuseError(tls, int32(18619))
107015  	}
107016  	_pMutex = func() *Xsqlite3_mutex {
107017  		if (*elem1((*int8)(unsafe.Pointer(&_statMutex)), uintptr(_op))) != 0 {
107018  			return _sqlite3Pcache1Mutex(tls)
107019  		}
107020  		return _sqlite3MallocMutex(tls)
107021  	}()
107022  	Xsqlite3_mutex_enter(tls, _pMutex)
107023  	*_pCurrent = int64(*elem7((*uint32)(unsafe.Pointer(&_sqlite3Stat.XnowValue)), uintptr(_op)))
107024  	*_pHighwater = int64(*elem7((*uint32)(unsafe.Pointer(&_sqlite3Stat.XmxValue)), uintptr(_op)))
107025  	if _resetFlag != 0 {
107026  		*elem7((*uint32)(unsafe.Pointer(&_sqlite3Stat.XmxValue)), uintptr(_op)) = *elem7((*uint32)(unsafe.Pointer(&_sqlite3Stat.XnowValue)), uintptr(_op))
107027  	}
107028  	Xsqlite3_mutex_leave(tls, _pMutex)
107029  	return int32(0)
107030  }
107031  
107032  // C comment
107033  //  /*
107034  //  ** Change the value of a limit.  Report the old value.
107035  //  ** If an invalid limit index is supplied, report -1.
107036  //  ** Make no changes but still report the old value if the
107037  //  ** new limit is negative.
107038  //  **
107039  //  ** A new lower limit does not shrink existing constructs.
107040  //  ** It merely prevents new constructs that exceed the limit
107041  //  ** from forming.
107042  //  */
107043  func Xsqlite3_limit(tls *crt.TLS, _db *Xsqlite3, _limitId int32, _newLimit int32) (r0 int32) {
107044  	var _oldLimit int32
107045  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
107046  		_sqlite3MisuseError(tls, int32(142955))
107047  		return int32(-1)
107048  	}
107049  	func() {
107050  		if (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), 0)) != int32(1000000000) {
107051  			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)))
107052  			crt.X__builtin_abort(tls)
107053  		}
107054  	}()
107055  	func() {
107056  		if (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(1))) != int32(1000000000) {
107057  			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)))
107058  			crt.X__builtin_abort(tls)
107059  		}
107060  	}()
107061  	func() {
107062  		if (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(2))) != int32(2000) {
107063  			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)))
107064  			crt.X__builtin_abort(tls)
107065  		}
107066  	}()
107067  	func() {
107068  		if (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(3))) != int32(1000) {
107069  			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)))
107070  			crt.X__builtin_abort(tls)
107071  		}
107072  	}()
107073  	func() {
107074  		if (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(4))) != int32(500) {
107075  			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)))
107076  			crt.X__builtin_abort(tls)
107077  		}
107078  	}()
107079  	func() {
107080  		if (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(5))) != int32(250000000) {
107081  			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)))
107082  			crt.X__builtin_abort(tls)
107083  		}
107084  	}()
107085  	func() {
107086  		if (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(6))) != int32(127) {
107087  			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)))
107088  			crt.X__builtin_abort(tls)
107089  		}
107090  	}()
107091  	func() {
107092  		if (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(7))) != int32(10) {
107093  			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)))
107094  			crt.X__builtin_abort(tls)
107095  		}
107096  	}()
107097  	func() {
107098  		if (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(8))) != int32(50000) {
107099  			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)))
107100  			crt.X__builtin_abort(tls)
107101  		}
107102  	}()
107103  	func() {
107104  		if (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(9))) != int32(999) {
107105  			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)))
107106  			crt.X__builtin_abort(tls)
107107  		}
107108  	}()
107109  	func() {
107110  		if (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(10))) != int32(1000) {
107111  			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)))
107112  			crt.X__builtin_abort(tls)
107113  		}
107114  	}()
107115  	func() {
107116  		if (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(11))) != int32(8) {
107117  			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)))
107118  			crt.X__builtin_abort(tls)
107119  		}
107120  	}()
107121  
107122  	if (_limitId < int32(0)) || (_limitId >= int32(12)) {
107123  		return int32(-1)
107124  	}
107125  	_oldLimit = *elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(_limitId))
107126  	if _newLimit < int32(0) {
107127  		goto _27
107128  	}
107129  	if _newLimit > (*elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(_limitId))) {
107130  		_newLimit = *elem8((*int32)(unsafe.Pointer(&_aHardLimit)), uintptr(_limitId))
107131  	}
107132  	*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(_limitId)) = _newLimit
107133  _27:
107134  	return _oldLimit
107135  }
107136  
107137  // C comment
107138  //  /*
107139  //  ** This array defines hard upper bounds on limit values.  The
107140  //  ** initializer must be kept in sync with the SQLITE_LIMIT_*
107141  //  ** #defines in sqlite3.h.
107142  //  */
107143  var _aHardLimit [12]int32
107144  
107145  func init() {
107146  	_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)}
107147  }
107148  
107149  var _sqlite3_limitØ00__func__Ø000 [14]int8
107150  
107151  func init() {
107152  	crt.Xstrncpy(nil, &_sqlite3_limitØ00__func__Ø000[0], str(123369), 14)
107153  }
107154  
107155  var _sqlite3PragmaØ00azLockNameØ0010 [5]*int8
107156  
107157  func init() {
107158  	_sqlite3PragmaØ00azLockNameØ0010 = [5]*int8{str(123383), str(123392), str(123399), str(123408), str(89660)}
107159  }
107160  
107161  func _sqlite3VdbeVerifyNoResultRow(tls *crt.TLS, _p *TVdbe) {
107162  	var _i int32
107163  	_i = int32(0)
107164  _0:
107165  	if _i >= _p.XnOp {
107166  		goto _3
107167  	}
107168  	func() {
107169  		if int32(elem61((*XVdbeOp)(_p.XaOp), uintptr(_i)).Xopcode) == int32(67) {
107170  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(72090), unsafe.Pointer(&_sqlite3VdbeVerifyNoResultRowØ00__func__Ø000), unsafe.Pointer(str(123416)))
107171  			crt.X__builtin_abort(tls)
107172  		}
107173  	}()
107174  	_i += 1
107175  	goto _0
107176  _3:
107177  }
107178  
107179  var _sqlite3VdbeVerifyNoResultRowØ00__func__Ø000 [29]int8
107180  
107181  func init() {
107182  	crt.Xstrncpy(nil, &_sqlite3VdbeVerifyNoResultRowØ00__func__Ø000[0], str(123447), 29)
107183  }
107184  
107185  // C comment
107186  //  /*
107187  //  ** This routine is called after all of the trigger actions have been parsed
107188  //  ** in order to complete the process of building the trigger.
107189  //  */
107190  func _sqlite3FinishTrigger(tls *crt.TLS, _pParse *XParse, _pStepList *XTriggerStep, _pAll *XToken) {
107191  	var _iDb int32
107192  	var _zName, _3_z *int8
107193  	var _nameToken XToken
107194  	var _db *Xsqlite3
107195  	var _4_pHash *XHash
107196  	var _pTrig, _4_pLink *XTrigger
107197  	var _6_pTab *XTable
107198  	var _3_v *TVdbe
107199  	var _sFix XDbFixer
107200  	_pTrig = (*XTrigger)(_pParse.XpNewTrigger)
107201  	_db = (*Xsqlite3)(_pParse.Xdb)
107202  	*(**XTrigger)(unsafe.Pointer(&_pParse.XpNewTrigger)) = nil
107203  	if func() int32 {
107204  		if _pParse.XnErr != 0 {
107205  			return func() int32 {
107206  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122925), unsafe.Pointer(&_sqlite3FinishTriggerØ00__func__Ø000), unsafe.Pointer(str(4809)))
107207  				crt.X__builtin_abort(tls)
107208  				return int32(1)
107209  			}()
107210  		}
107211  		return int32(0)
107212  	}() != 0 || (_pTrig == nil) {
107213  		goto _triggerfinish_cleanup
107214  	}
107215  	_zName = _pTrig.XzName
107216  	_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), (*XSchema)(_pTrig.XpSchema))
107217  	*(**XTriggerStep)(unsafe.Pointer(&_pTrig.Xstep_list)) = _pStepList
107218  _4:
107219  	if _pStepList != nil {
107220  		*(**XTrigger)(unsafe.Pointer(&_pStepList.XpTrig)) = _pTrig
107221  		_pStepList = (*XTriggerStep)(_pStepList.XpNext)
107222  		goto _4
107223  	}
107224  	_sqlite3TokenInit(tls, &_nameToken, _pTrig.XzName)
107225  	_sqlite3FixInit(tls, &_sFix, _pParse, _iDb, str(23789), &_nameToken)
107226  	if _sqlite3FixTriggerStep(tls, &_sFix, (*XTriggerStep)(_pTrig.Xstep_list)) != 0 || _sqlite3FixExpr(tls, &_sFix, (*XExpr)(_pTrig.XpWhen)) != 0 {
107227  		goto _triggerfinish_cleanup
107228  	}
107229  	if (_db.Xinit.Xbusy) != 0 {
107230  		goto _8
107231  	}
107232  	_3_v = _sqlite3GetVdbe(tls, _pParse)
107233  	if _3_v == nil {
107234  		goto _triggerfinish_cleanup
107235  	}
107236  	_sqlite3BeginWriteOperation(tls, _pParse, int32(0), _iDb)
107237  	_3_z = _sqlite3DbStrNDup(tls, _db, _pAll.Xz, uint64(_pAll.Xn))
107238  	_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))
107239  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_3_z))
107240  	_sqlite3ChangeCookie(tls, _pParse, _iDb)
107241  	_sqlite3VdbeAddParseSchemaOp(tls, _3_v, _iDb, _sqlite3MPrintf(tls, _db, str(123540), unsafe.Pointer(_zName)))
107242  _8:
107243  	if (_db.Xinit.Xbusy) == 0 {
107244  		goto _triggerfinish_cleanup
107245  	}
107246  	_4_pLink = _pTrig
107247  	_4_pHash = &((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema).XtrigHash)
107248  	func() {
107249  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
107250  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122966), unsafe.Pointer(&_sqlite3FinishTriggerØ00__func__Ø000), unsafe.Pointer(str(51126)))
107251  			crt.X__builtin_abort(tls)
107252  		}
107253  	}()
107254  	_pTrig = (*XTrigger)(_sqlite3HashInsert(tls, _4_pHash, _zName, unsafe.Pointer(_pTrig)))
107255  	if _pTrig != nil {
107256  		_sqlite3OomFault(tls, _db)
107257  		goto _15
107258  	}
107259  	if (*XSchema)(_4_pLink.XpSchema) == (*XSchema)(_4_pLink.XpTabSchema) {
107260  		_6_pTab = (*XTable)(_sqlite3HashFind(tls, &((*XSchema)(_4_pLink.XpTabSchema).XtblHash), _4_pLink.Xtable))
107261  		func() {
107262  			if _6_pTab == nil {
107263  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122973), unsafe.Pointer(&_sqlite3FinishTriggerØ00__func__Ø000), unsafe.Pointer(str(43549)))
107264  				crt.X__builtin_abort(tls)
107265  			}
107266  		}()
107267  		*(**XTrigger)(unsafe.Pointer(&_4_pLink.XpNext)) = (*XTrigger)(_6_pTab.XpTrigger)
107268  		*(**XTrigger)(unsafe.Pointer(&_6_pTab.XpTrigger)) = _4_pLink
107269  	}
107270  _15:
107271  _triggerfinish_cleanup:
107272  	_sqlite3DeleteTrigger(tls, _db, _pTrig)
107273  	func() {
107274  		if _pParse.XpNewTrigger != nil {
107275  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122981), unsafe.Pointer(&_sqlite3FinishTriggerØ00__func__Ø000), unsafe.Pointer(str(123569)))
107276  			crt.X__builtin_abort(tls)
107277  		}
107278  	}()
107279  	_sqlite3DeleteTriggerStep(tls, _db, _pStepList)
107280  }
107281  
107282  var _sqlite3FinishTriggerØ00__func__Ø000 [21]int8
107283  
107284  func init() {
107285  	crt.Xstrncpy(nil, &_sqlite3FinishTriggerØ00__func__Ø000[0], str(123590), 21)
107286  }
107287  
107288  func _sqlite3FixTriggerStep(tls *crt.TLS, _pFix *XDbFixer, _pStep *XTriggerStep) (r0 int32) {
107289  _0:
107290  	if _pStep == nil {
107291  		goto _1
107292  	}
107293  	if _sqlite3FixSelect(tls, _pFix, (*XSelect)(_pStep.XpSelect)) != 0 {
107294  		return int32(1)
107295  	}
107296  	if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pStep.XpWhere)) != 0 {
107297  		return int32(1)
107298  	}
107299  	if _sqlite3FixExprList(tls, _pFix, (*XExprList)(_pStep.XpExprList)) != 0 {
107300  		return int32(1)
107301  	}
107302  	_pStep = (*XTriggerStep)(_pStep.XpNext)
107303  	goto _0
107304  _1:
107305  	return int32(0)
107306  }
107307  
107308  // C comment
107309  //  /*
107310  //  ** This is called by the parser when it sees a CREATE TRIGGER statement
107311  //  ** up to the point of the BEGIN before the trigger actions.  A Trigger
107312  //  ** structure is generated based on the information available and stored
107313  //  ** in pParse->pNewTrigger.  After the trigger actions have been parsed, the
107314  //  ** sqlite3FinishTrigger() function is called to complete the trigger
107315  //  ** construction process.
107316  //  */
107317  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) {
107318  	var _iDb, _19_iTabDb, _19_code int32
107319  	var _zName, _19_zDb, _19_zDbTrig *int8
107320  	var _db *Xsqlite3
107321  	var _pTrigger *XTrigger
107322  	var _pTab *XTable
107323  	var _pName *XToken
107324  	var _sFix XDbFixer
107325  	_pTrigger = nil
107326  	_zName = nil
107327  	_db = (*Xsqlite3)(_pParse.Xdb)
107328  	func() {
107329  		if _pName1 == nil {
107330  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122744), unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000), unsafe.Pointer(str(123611)))
107331  			crt.X__builtin_abort(tls)
107332  		}
107333  	}()
107334  	func() {
107335  		if _pName2 == nil {
107336  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122745), unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000), unsafe.Pointer(str(111539)))
107337  			crt.X__builtin_abort(tls)
107338  		}
107339  	}()
107340  	func() {
107341  		if _op != int32(108) && _op != int32(110) && _op != int32(109) {
107342  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122746), unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000), unsafe.Pointer(str(123621)))
107343  			crt.X__builtin_abort(tls)
107344  		}
107345  	}()
107346  	func() {
107347  		if _op <= int32(0) || _op >= int32(255) {
107348  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122747), unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000), unsafe.Pointer(str(123669)))
107349  			crt.X__builtin_abort(tls)
107350  		}
107351  	}()
107352  	if _isTemp == 0 {
107353  		goto _11
107354  	}
107355  	if _pName2.Xn > (0) {
107356  		_sqlite3ErrorMsg(tls, _pParse, str(123685))
107357  		goto _trigger_cleanup
107358  	}
107359  	_iDb = int32(1)
107360  	_pName = _pName1
107361  	goto _13
107362  _11:
107363  	_iDb = _sqlite3TwoPartName(tls, _pParse, _pName1, _pName2, &_pName)
107364  	if _iDb < int32(0) {
107365  		goto _trigger_cleanup
107366  	}
107367  _13:
107368  	if (_pTableName == nil) || (_db.XmallocFailed != 0) {
107369  		goto _trigger_cleanup
107370  	}
107371  	if ((_db.Xinit.Xbusy) != 0) && (_iDb != int32(1)) {
107372  		_sqlite3DbFree(tls, _db, unsafe.Pointer(elem6((*TSrcList_item)(unsafe.Pointer(&_pTableName.Xa)), 0).XzDatabase))
107373  		elem6((*TSrcList_item)(unsafe.Pointer(&_pTableName.Xa)), 0).XzDatabase = nil
107374  	}
107375  	_pTab = _sqlite3SrcListLookup(tls, _pParse, _pTableName)
107376  	if (((int32(_db.Xinit.Xbusy) == int32(0)) && (_pName2.Xn == (0))) && (_pTab != nil)) && ((*XSchema)(_pTab.XpSchema) == (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(1)).XpSchema)) {
107377  		_iDb = int32(1)
107378  	}
107379  	if _db.XmallocFailed != 0 {
107380  		goto _trigger_cleanup
107381  	}
107382  	func() {
107383  		if _pTableName.XnSrc != int32(1) {
107384  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122793), unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000), unsafe.Pointer(str(123731)))
107385  			crt.X__builtin_abort(tls)
107386  		}
107387  	}()
107388  	_sqlite3FixInit(tls, &_sFix, _pParse, _iDb, str(23789), _pName)
107389  	if _sqlite3FixSrcList(tls, &_sFix, _pTableName) != 0 {
107390  		goto _trigger_cleanup
107391  	}
107392  	_pTab = _sqlite3SrcListLookup(tls, _pParse, _pTableName)
107393  	if _pTab != nil {
107394  		goto _27
107395  	}
107396  	if int32(_db.Xinit.XiDb) == int32(1) {
107397  		_db.Xinit.XorphanTrigger = uint8(1)
107398  	}
107399  	goto _trigger_cleanup
107400  _27:
107401  	if _pTab.XnModuleArg != 0 {
107402  		_sqlite3ErrorMsg(tls, _pParse, str(123751))
107403  		goto _trigger_cleanup
107404  	}
107405  	_zName = _sqlite3NameFromToken(tls, _db, _pName)
107406  	if (_zName == nil) || (int32(0) != _sqlite3CheckObjectName(tls, _pParse, _zName)) {
107407  		goto _trigger_cleanup
107408  	}
107409  	func() {
107410  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
107411  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122825), unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000), unsafe.Pointer(str(51126)))
107412  			crt.X__builtin_abort(tls)
107413  		}
107414  	}()
107415  	if _sqlite3HashFind(tls, &((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema).XtrigHash), _zName) == nil {
107416  		goto _34
107417  	}
107418  	if _noErr == 0 {
107419  		_sqlite3ErrorMsg(tls, _pParse, str(123792), unsafe.Pointer(_pName))
107420  		goto _36
107421  	}
107422  	func() {
107423  		if (_db.Xinit.Xbusy) != 0 {
107424  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122830), unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000), unsafe.Pointer(str(112577)))
107425  			crt.X__builtin_abort(tls)
107426  		}
107427  	}()
107428  	_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
107429  _36:
107430  	goto _trigger_cleanup
107431  _34:
107432  	if Xsqlite3_strnicmp(tls, _pTab.XzName, str(111672), int32(7)) == int32(0) {
107433  		_sqlite3ErrorMsg(tls, _pParse, str(123818))
107434  		goto _trigger_cleanup
107435  	}
107436  	if (_pTab.XpSelect != nil) && (_tr_tm != int32(48)) {
107437  		_sqlite3ErrorMsg(tls, _pParse, str(123856), unsafe.Pointer(func() *int8 {
107438  			if _tr_tm == int32(34) {
107439  				return str(25122)
107440  			}
107441  			return str(25097)
107442  		}()), unsafe.Pointer(_pTableName), int32(0))
107443  		goto _trigger_cleanup
107444  	}
107445  	if (_pTab.XpSelect == nil) && (_tr_tm == int32(48)) {
107446  		_sqlite3ErrorMsg(tls, _pParse, str(123893), unsafe.Pointer(_pTableName), int32(0))
107447  		goto _trigger_cleanup
107448  	}
107449  	_19_iTabDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.XpSchema))
107450  	_19_code = int32(7)
107451  	_19_zDb = elem27((*XDb)(_db.XaDb), uintptr(_19_iTabDb)).XzDbSName
107452  	_19_zDbTrig = func() *int8 {
107453  		if _isTemp != 0 {
107454  			return (elem27((*XDb)(_db.XaDb), uintptr(1)).XzDbSName)
107455  		}
107456  		return _19_zDb
107457  	}()
107458  	if (_19_iTabDb == int32(1)) || _isTemp != 0 {
107459  		_19_code = int32(5)
107460  	}
107461  	if _sqlite3AuthCheck(tls, _pParse, _19_code, _zName, _pTab.XzName, _19_zDbTrig) != 0 {
107462  		goto _trigger_cleanup
107463  	}
107464  	if _sqlite3AuthCheck(tls, _pParse, int32(18), func() *int8 {
107465  		if int32(1) != 0 && (_19_iTabDb == int32(1)) {
107466  			return str(49962)
107467  		}
107468  		return str(49981)
107469  	}(), nil, _19_zDb) != 0 {
107470  		goto _trigger_cleanup
107471  	}
107472  	if _tr_tm == int32(48) {
107473  		_tr_tm = int32(34)
107474  	}
107475  	_pTrigger = (*XTrigger)(_sqlite3DbMallocZero(tls, _db, uint64(36)))
107476  	if _pTrigger == nil {
107477  		goto _trigger_cleanup
107478  	}
107479  	_pTrigger.XzName = _zName
107480  	_zName = nil
107481  	_pTrigger.Xtable = _sqlite3DbStrDup(tls, _db, elem6((*TSrcList_item)(unsafe.Pointer(&_pTableName.Xa)), 0).XzName)
107482  	*(**XSchema)(unsafe.Pointer(&_pTrigger.XpSchema)) = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema)
107483  	*(**XSchema)(unsafe.Pointer(&_pTrigger.XpTabSchema)) = (*XSchema)(_pTab.XpSchema)
107484  	_pTrigger.Xop = uint8(_op)
107485  	_pTrigger.Xtr_tm = uint8(func() int32 {
107486  		if _tr_tm == int32(34) {
107487  			return int32(1)
107488  		}
107489  		return int32(2)
107490  	}())
107491  	*(**XExpr)(unsafe.Pointer(&_pTrigger.XpWhen)) = _sqlite3ExprDup(tls, _db, _pWhen, int32(1))
107492  	*(**XIdList)(unsafe.Pointer(&_pTrigger.XpColumns)) = _sqlite3IdListDup(tls, _db, _pColumns)
107493  	func() {
107494  		if (*XTrigger)(_pParse.XpNewTrigger) != nil {
107495  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122893), unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000), unsafe.Pointer(str(24610)))
107496  			crt.X__builtin_abort(tls)
107497  		}
107498  	}()
107499  	*(**XTrigger)(unsafe.Pointer(&_pParse.XpNewTrigger)) = _pTrigger
107500  _trigger_cleanup:
107501  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zName))
107502  	_sqlite3SrcListDelete(tls, _db, _pTableName)
107503  	_sqlite3IdListDelete(tls, _db, _pColumns)
107504  	_sqlite3ExprDelete(tls, _db, _pWhen)
107505  	if _pParse.XpNewTrigger == nil {
107506  		_sqlite3DeleteTrigger(tls, _db, _pTrigger)
107507  		goto _62
107508  	}
107509  	func() {
107510  		if (*XTrigger)(_pParse.XpNewTrigger) != _pTrigger {
107511  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(122904), unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000), unsafe.Pointer(str(123939)))
107512  			crt.X__builtin_abort(tls)
107513  		}
107514  	}()
107515  _62:
107516  }
107517  
107518  var _sqlite3BeginTriggerØ00__func__Ø000 [20]int8
107519  
107520  func init() {
107521  	crt.Xstrncpy(nil, &_sqlite3BeginTriggerØ00__func__Ø000[0], str(123969), 20)
107522  }
107523  
107524  // C comment
107525  //  /*
107526  //  ** Construct a trigger step that implements an UPDATE statement and return
107527  //  ** a pointer to that trigger step.  The parser calls this routine when it
107528  //  ** sees an UPDATE statement inside the body of a CREATE TRIGGER.
107529  //  */
107530  func _sqlite3TriggerUpdateStep(tls *crt.TLS, _db *Xsqlite3, _pTableName *XToken, _pEList *XExprList, _pWhere *XExpr, _orconf uint8) (r0 *XTriggerStep) {
107531  	var _pTriggerStep *XTriggerStep
107532  	_pTriggerStep = _triggerStepAllocate(tls, _db, uint8(110), _pTableName)
107533  	if _pTriggerStep != nil {
107534  		*(**XExprList)(unsafe.Pointer(&_pTriggerStep.XpExprList)) = _sqlite3ExprListDup(tls, _db, _pEList, int32(1))
107535  		*(**XExpr)(unsafe.Pointer(&_pTriggerStep.XpWhere)) = _sqlite3ExprDup(tls, _db, _pWhere, int32(1))
107536  		_pTriggerStep.Xorconf = _orconf
107537  	}
107538  	_sqlite3ExprListDelete(tls, _db, _pEList)
107539  	_sqlite3ExprDelete(tls, _db, _pWhere)
107540  	return _pTriggerStep
107541  }
107542  
107543  // C comment
107544  //  /*
107545  //  ** Allocate space to hold a new trigger step.  The allocated space
107546  //  ** holds both the TriggerStep object and the TriggerStep.target.z string.
107547  //  **
107548  //  ** If an OOM error occurs, NULL is returned and db->mallocFailed is set.
107549  //  */
107550  func _triggerStepAllocate(tls *crt.TLS, _db *Xsqlite3, _op uint8, _pName *XToken) (r0 *XTriggerStep) {
107551  	var _1_z *int8
107552  	var _pTriggerStep *XTriggerStep
107553  	_pTriggerStep = (*XTriggerStep)(_sqlite3DbMallocZero(tls, _db, uint64((uint32(36)+_pName.Xn)+uint32(1))))
107554  	if _pTriggerStep != nil {
107555  		_1_z = (*int8)(unsafe.Pointer(elem120(_pTriggerStep, uintptr(1))))
107556  		crt.Xmemcpy(tls, unsafe.Pointer(_1_z), unsafe.Pointer(_pName.Xz), _pName.Xn)
107557  		_sqlite3Dequote(tls, _1_z)
107558  		_pTriggerStep.XzTarget = _1_z
107559  		_pTriggerStep.Xop = _op
107560  	}
107561  	return _pTriggerStep
107562  }
107563  
107564  // C comment
107565  //  /*
107566  //  ** Build a trigger step out of an INSERT statement.  Return a pointer
107567  //  ** to the new trigger step.
107568  //  **
107569  //  ** The parser calls this routine when it sees an INSERT inside the
107570  //  ** body of a trigger.
107571  //  */
107572  func _sqlite3TriggerInsertStep(tls *crt.TLS, _db *Xsqlite3, _pTableName *XToken, _pColumn *XIdList, _pSelect *XSelect, _orconf uint8) (r0 *XTriggerStep) {
107573  	var _pTriggerStep *XTriggerStep
107574  	func() {
107575  		if _pSelect == nil && _db.XmallocFailed == 0 {
107576  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123044), unsafe.Pointer(&_sqlite3TriggerInsertStepØ00__func__Ø000), unsafe.Pointer(str(123989)))
107577  			crt.X__builtin_abort(tls)
107578  		}
107579  	}()
107580  	_pTriggerStep = _triggerStepAllocate(tls, _db, uint8(108), _pTableName)
107581  	if _pTriggerStep != nil {
107582  		*(**XSelect)(unsafe.Pointer(&_pTriggerStep.XpSelect)) = _sqlite3SelectDup(tls, _db, _pSelect, int32(1))
107583  		*(**XIdList)(unsafe.Pointer(&_pTriggerStep.XpIdList)) = _pColumn
107584  		_pTriggerStep.Xorconf = _orconf
107585  		goto _4
107586  	}
107587  	_sqlite3IdListDelete(tls, _db, _pColumn)
107588  _4:
107589  	_sqlite3SelectDelete(tls, _db, _pSelect)
107590  	return _pTriggerStep
107591  }
107592  
107593  var _sqlite3TriggerInsertStepØ00__func__Ø000 [25]int8
107594  
107595  func init() {
107596  	crt.Xstrncpy(nil, &_sqlite3TriggerInsertStepØ00__func__Ø000[0], str(124022), 25)
107597  }
107598  
107599  // C comment
107600  //  /*
107601  //  ** Construct a trigger step that implements a DELETE statement and return
107602  //  ** a pointer to that trigger step.  The parser calls this routine when it
107603  //  ** sees a DELETE statement inside the body of a CREATE TRIGGER.
107604  //  */
107605  func _sqlite3TriggerDeleteStep(tls *crt.TLS, _db *Xsqlite3, _pTableName *XToken, _pWhere *XExpr) (r0 *XTriggerStep) {
107606  	var _pTriggerStep *XTriggerStep
107607  	_pTriggerStep = _triggerStepAllocate(tls, _db, uint8(109), _pTableName)
107608  	if _pTriggerStep != nil {
107609  		*(**XExpr)(unsafe.Pointer(&_pTriggerStep.XpWhere)) = _sqlite3ExprDup(tls, _db, _pWhere, int32(1))
107610  		_pTriggerStep.Xorconf = uint8(10)
107611  	}
107612  	_sqlite3ExprDelete(tls, _db, _pWhere)
107613  	return _pTriggerStep
107614  }
107615  
107616  // C comment
107617  //  /*
107618  //  ** Turn a SELECT statement (that the pSelect parameter points to) into
107619  //  ** a trigger step.  Return a pointer to a TriggerStep structure.
107620  //  **
107621  //  ** The parser calls this routine when it finds a SELECT statement in
107622  //  ** body of a TRIGGER.
107623  //  */
107624  func _sqlite3TriggerSelectStep(tls *crt.TLS, _db *Xsqlite3, _pSelect *XSelect) (r0 *XTriggerStep) {
107625  	var _pTriggerStep *XTriggerStep
107626  	_pTriggerStep = (*XTriggerStep)(_sqlite3DbMallocZero(tls, _db, uint64(36)))
107627  	if _pTriggerStep == nil {
107628  		_sqlite3SelectDelete(tls, _db, _pSelect)
107629  		return nil
107630  	}
107631  	_pTriggerStep.Xop = uint8(119)
107632  	*(**XSelect)(unsafe.Pointer(&_pTriggerStep.XpSelect)) = _pSelect
107633  	_pTriggerStep.Xorconf = uint8(10)
107634  	return _pTriggerStep
107635  }
107636  
107637  // C comment
107638  //  /*
107639  //  ** This function is called to drop a trigger from the database schema.
107640  //  **
107641  //  ** This may be called directly from the parser and therefore identifies
107642  //  ** the trigger by name.  The sqlite3DropTriggerPtr() routine does the
107643  //  ** same job as this routine except it takes a pointer to the trigger
107644  //  ** instead of the trigger name.
107645  //  **/
107646  func _sqlite3DropTrigger(tls *crt.TLS, _pParse *XParse, _pName *XSrcList, _noErr int32) {
107647  	var _i, _2_j int32
107648  	var _zDb, _zName *int8
107649  	var _db *Xsqlite3
107650  	var _pTrigger *XTrigger
107651  	_pTrigger = nil
107652  	_db = (*Xsqlite3)(_pParse.Xdb)
107653  	if _db.XmallocFailed != 0 {
107654  		goto _drop_trigger_cleanup
107655  	}
107656  	if int32(0) != _sqlite3ReadSchema(tls, _pParse) {
107657  		goto _drop_trigger_cleanup
107658  	}
107659  	func() {
107660  		if _pName.XnSrc != int32(1) {
107661  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123138), unsafe.Pointer(&_sqlite3DropTriggerØ00__func__Ø000), unsafe.Pointer(str(114819)))
107662  			crt.X__builtin_abort(tls)
107663  		}
107664  	}()
107665  	_zDb = elem6((*TSrcList_item)(unsafe.Pointer(&_pName.Xa)), 0).XzDatabase
107666  	_zName = elem6((*TSrcList_item)(unsafe.Pointer(&_pName.Xa)), 0).XzName
107667  	func() {
107668  		if _zDb == nil && _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
107669  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123141), unsafe.Pointer(&_sqlite3DropTriggerØ00__func__Ø000), unsafe.Pointer(str(59893)))
107670  			crt.X__builtin_abort(tls)
107671  		}
107672  	}()
107673  	_i = int32(0)
107674  _7:
107675  	if _i >= _db.XnDb {
107676  		goto _10
107677  	}
107678  	_2_j = func() int32 {
107679  		if _i < int32(2) {
107680  			return (_i ^ int32(1))
107681  		}
107682  		return _i
107683  	}()
107684  	if (_zDb != nil) && _sqlite3StrICmp(tls, elem27((*XDb)(_db.XaDb), uintptr(_2_j)).XzDbSName, _zDb) != 0 {
107685  		goto _8
107686  	}
107687  	func() {
107688  		if _sqlite3SchemaMutexHeld(tls, _db, _2_j, nil) == 0 {
107689  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(123145), unsafe.Pointer(&_sqlite3DropTriggerØ00__func__Ø000), unsafe.Pointer(str(59943)))
107690  			crt.X__builtin_abort(tls)
107691  		}
107692  	}()
107693  	_pTrigger = (*XTrigger)(_sqlite3HashFind(tls, &((*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_2_j)).XpSchema).XtrigHash), _zName))
107694  	if _pTrigger != nil {
107695  		goto _10
107696  	}
107697  _8:
107698  	_i += 1
107699  	goto _7
107700  _10:
107701  	if _pTrigger != nil {
107702  		goto _18
107703  	}
107704  	if _noErr == 0 {
107705  		_sqlite3ErrorMsg(tls, _pParse, str(124047), unsafe.Pointer(_pName), int32(0))
107706  		goto _20
107707  	}
107708  	_sqlite3CodeVerifyNamedSchema(tls, _pParse, _zDb)
107709  _20:
107710  	_pParse.XcheckSchema = uint8(1)
107711  	goto _drop_trigger_cleanup
107712  _18:
107713  	_sqlite3DropTriggerPtr(tls, _pParse, _pTrigger)
107714  _drop_trigger_cleanup:
107715  	_sqlite3SrcListDelete(tls, _db, _pName)
107716  }
107717  
107718  var _sqlite3DropTriggerØ00__func__Ø000 [19]int8
107719  
107720  func init() {
107721  	crt.Xstrncpy(nil, &_sqlite3DropTriggerØ00__func__Ø000[0], str(124067), 19)
107722  }
107723  
107724  // C comment
107725  //  /*
107726  //  ** Called by the parser to compile an ATTACH statement.
107727  //  **
107728  //  **     ATTACH p AS pDbname KEY pKey
107729  //  */
107730  func _sqlite3Attach(tls *crt.TLS, _pParse *XParse, _p *XExpr, _pDbname *XExpr, _pKey *XExpr) {
107731  	_codeAttach(tls, _pParse, int32(24), &_sqlite3AttachØ00attach_funcØ001, _p, _p, _pDbname, _pKey)
107732  }
107733  
107734  // C comment
107735  //  /*
107736  //  ** This procedure generates VDBE code for a single invocation of either the
107737  //  ** sqlite_detach() or sqlite_attach() SQL user functions.
107738  //  */
107739  func _codeAttach(tls *crt.TLS, _pParse *XParse, _type int32, _pFunc *XFuncDef, _pAuthArg *XExpr, _pFilename *XExpr, _pDbname *XExpr, _pKey *XExpr) {
107740  	var _rc, _regArgs int32
107741  	var _2_zAuthArg *int8
107742  	var _db *Xsqlite3
107743  	var _v *TVdbe
107744  	var _sName XNameContext
107745  	_db = (*Xsqlite3)(_pParse.Xdb)
107746  	if _pParse.XnErr != 0 {
107747  		goto _attach_end
107748  	}
107749  	crt.Xmemset(tls, unsafe.Pointer(&_sName), int32(0), uint32(32))
107750  	*(**XParse)(unsafe.Pointer(&_sName.XpParse)) = _pParse
107751  	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))) {
107752  		goto _attach_end
107753  	}
107754  	if _pAuthArg == nil {
107755  		goto _4
107756  	}
107757  	if int32(_pAuthArg.Xop) == int32(97) {
107758  		_2_zAuthArg = *(**int8)(unsafe.Pointer(&_pAuthArg.Xu))
107759  		goto _6
107760  	}
107761  	_2_zAuthArg = nil
107762  _6:
107763  	_rc = _sqlite3AuthCheck(tls, _pParse, _type, _2_zAuthArg, nil, nil)
107764  	if _rc != int32(0) {
107765  		goto _attach_end
107766  	}
107767  _4:
107768  	_v = _sqlite3GetVdbe(tls, _pParse)
107769  	_regArgs = _sqlite3GetTempRange(tls, _pParse, int32(4))
107770  	_sqlite3ExprCode(tls, _pParse, _pFilename, _regArgs)
107771  	_sqlite3ExprCode(tls, _pParse, _pDbname, _regArgs+int32(1))
107772  	_sqlite3ExprCode(tls, _pParse, _pKey, _regArgs+int32(2))
107773  	func() {
107774  		if _v == nil && _db.XmallocFailed == 0 {
107775  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99197), unsafe.Pointer(&_codeAttachØ00__func__Ø000), unsafe.Pointer(str(124086)))
107776  			crt.X__builtin_abort(tls)
107777  		}
107778  	}()
107779  	if _v != nil {
107780  		_sqlite3VdbeAddOp4(tls, _v, int32(69), int32(0), (_regArgs+int32(3))-int32(_pFunc.XnArg), _regArgs+int32(3), (*int8)(unsafe.Pointer(_pFunc)), int32(-4))
107781  		func() {
107782  			if int32(_pFunc.XnArg) != int32(-1) && (int32(_pFunc.XnArg)&int32(255)) != int32(_pFunc.XnArg) {
107783  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99201), unsafe.Pointer(&_codeAttachØ00__func__Ø000), unsafe.Pointer(str(124108)))
107784  				crt.X__builtin_abort(tls)
107785  			}
107786  		}()
107787  		_sqlite3VdbeChangeP5(tls, _v, uint16(uint8(_pFunc.XnArg)))
107788  		_sqlite3VdbeAddOp1(tls, _v, int32(153), bool2int(_type == int32(24)))
107789  	}
107790  _attach_end:
107791  	_sqlite3ExprDelete(tls, _db, _pFilename)
107792  	_sqlite3ExprDelete(tls, _db, _pDbname)
107793  	_sqlite3ExprDelete(tls, _db, _pKey)
107794  }
107795  
107796  // C comment
107797  //  /*
107798  //  ** Resolve an expression that was part of an ATTACH or DETACH statement. This
107799  //  ** is slightly different from resolving a normal SQL expression, because simple
107800  //  ** identifiers are treated as strings, not possible column names or aliases.
107801  //  **
107802  //  ** i.e. if the parser sees:
107803  //  **
107804  //  **     ATTACH DATABASE abc AS def
107805  //  **
107806  //  ** it treats the two expressions as literal strings 'abc' and 'def' instead of
107807  //  ** looking for columns of the same name.
107808  //  **
107809  //  ** This only applies to the root node of pExpr, so the statement:
107810  //  **
107811  //  **     ATTACH DATABASE abc||def AS 'db2'
107812  //  **
107813  //  ** will fail because neither abc or def can be resolved.
107814  //  */
107815  func _resolveAttachExpr(tls *crt.TLS, _pName *XNameContext, _pExpr *XExpr) (r0 int32) {
107816  	var _rc int32
107817  	_rc = int32(0)
107818  	if _pExpr == nil {
107819  		goto _0
107820  	}
107821  	if int32(_pExpr.Xop) != int32(27) {
107822  		_rc = _sqlite3ResolveExprNames(tls, _pName, _pExpr)
107823  		goto _2
107824  	}
107825  	_pExpr.Xop = uint8(97)
107826  _2:
107827  _0:
107828  	return _rc
107829  }
107830  
107831  var _codeAttachØ00__func__Ø000 [11]int8
107832  
107833  func init() {
107834  	crt.Xstrncpy(nil, &_codeAttachØ00__func__Ø000[0], str(124159), 11)
107835  }
107836  
107837  var _sqlite3AttachØ00attach_funcØ001 XFuncDef
107838  
107839  func init() {
107840  	_sqlite3AttachØ00attach_funcØ001 = XFuncDef{XnArg: int8(3), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
107841  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
107842  	}{_attachFunc})), XzName: str(124170)}
107843  }
107844  
107845  // C comment
107846  //  /*
107847  //  ** An SQL user-function registered to do the work of an ATTACH statement. The
107848  //  ** three arguments to the function come directly from an attach statement:
107849  //  **
107850  //  **     ATTACH DATABASE x AS y KEY z
107851  //  **
107852  //  **     SELECT sqlite_attach(x, y, z)
107853  //  **
107854  //  ** If the optional "KEY z" syntax is omitted, an SQL NULL is passed as the
107855  //  ** third argument.
107856  //  */
107857  func _attachFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) {
107858  	var _i, _rc, _14_iDb int32
107859  	var _flags uint32
107860  	var _zName, _zFile, _zPath, _zErr, _zErrDyn, _3_z *int8
107861  	var _db *Xsqlite3
107862  	var _aNew *XDb
107863  	var _9_pPager *XPager
107864  	var _pVfs *Xsqlite3_vfs
107865  	_rc = int32(0)
107866  	_db = Xsqlite3_context_db_handle(tls, _context)
107867  	_zPath = nil
107868  	_zErr = nil
107869  	_zErrDyn = nil
107870  
107871  	_zFile = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, 0))))
107872  	_zName = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, uintptr(1)))))
107873  	if _zFile == nil {
107874  		_zFile = str(284)
107875  	}
107876  	if _zName == nil {
107877  		_zName = str(284)
107878  	}
107879  	if _db.XnDb >= ((*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(7))) + int32(2)) {
107880  		_zErrDyn = _sqlite3MPrintf(tls, _db, str(124184), *elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(7)))
107881  		goto _attach_error
107882  	}
107883  	if _db.XautoCommit == 0 {
107884  		_zErrDyn = _sqlite3MPrintf(tls, _db, str(124221))
107885  		goto _attach_error
107886  	}
107887  	_i = int32(0)
107888  _4:
107889  	if _i >= _db.XnDb {
107890  		goto _7
107891  	}
107892  	_3_z = elem27((*XDb)(_db.XaDb), uintptr(_i)).XzDbSName
107893  	func() {
107894  		if _3_z == nil || _zName == nil {
107895  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98935), unsafe.Pointer(&_attachFuncØ00__func__Ø000), unsafe.Pointer(str(124263)))
107896  			crt.X__builtin_abort(tls)
107897  		}
107898  	}()
107899  	if _sqlite3StrICmp(tls, _3_z, _zName) == int32(0) {
107900  		_zErrDyn = _sqlite3MPrintf(tls, _db, str(124274), unsafe.Pointer(_zName))
107901  		goto _attach_error
107902  	}
107903  	_i += 1
107904  	goto _4
107905  _7:
107906  	if (*XDb)(_db.XaDb) != (*XDb)(unsafe.Pointer(&_db.XaDbStatic)) {
107907  		goto _12
107908  	}
107909  	_aNew = (*XDb)(_sqlite3DbMallocRawNN(tls, _db, uint64(48)))
107910  	if _aNew == nil {
107911  		return
107912  	}
107913  	crt.Xmemcpy(tls, unsafe.Pointer(_aNew), _db.XaDb, uint32(32))
107914  	goto _14
107915  _12:
107916  	_aNew = (*XDb)(_sqlite3DbRealloc(tls, _db, _db.XaDb, uint64(uint32(16)*uint32(_db.XnDb+int32(1)))))
107917  	if _aNew == nil {
107918  		return
107919  	}
107920  _14:
107921  	*(**XDb)(unsafe.Pointer(&_db.XaDb)) = _aNew
107922  	_aNew = elem27((*XDb)(_db.XaDb), uintptr(_db.XnDb))
107923  	crt.Xmemset(tls, unsafe.Pointer(_aNew), int32(0), uint32(16))
107924  	_flags = _db.XopenFlags
107925  	_rc = _sqlite3ParseUri(tls, (*Xsqlite3_vfs)(_db.XpVfs).XzName, _zFile, &_flags, &_pVfs, &_zPath, &_zErr)
107926  	if _rc == int32(0) {
107927  		goto _16
107928  	}
107929  	if _rc == int32(7) {
107930  		_sqlite3OomFault(tls, _db)
107931  	}
107932  	Xsqlite3_result_error(tls, _context, _zErr, int32(-1))
107933  	Xsqlite3_free(tls, unsafe.Pointer(_zErr))
107934  	return
107935  _16:
107936  	func() {
107937  		if _pVfs == nil {
107938  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98969), unsafe.Pointer(&_attachFuncØ00__func__Ø000), unsafe.Pointer(str(124304)))
107939  			crt.X__builtin_abort(tls)
107940  		}
107941  	}()
107942  	_flags |= uint32(256)
107943  	_rc = _sqlite3BtreeOpen(tls, _pVfs, _zPath, _db, (**XBtree)(unsafe.Pointer(&_aNew.XpBt)), int32(0), int32(_flags))
107944  	Xsqlite3_free(tls, unsafe.Pointer(_zPath))
107945  	_db.XnDb += 1
107946  	_db.XskipBtreeMutex = 0
107947  	if _rc == int32(19) {
107948  		_rc = int32(1)
107949  		_zErrDyn = _sqlite3MPrintf(tls, _db, str(124309))
107950  		goto _22
107951  	}
107952  	if _rc != int32(0) {
107953  		goto _22
107954  	}
107955  	*(**XSchema)(unsafe.Pointer(&_aNew.XpSchema)) = _sqlite3SchemaGet(tls, _db, (*XBtree)(_aNew.XpBt))
107956  	if _aNew.XpSchema == nil {
107957  		_rc = _sqlite3NomemError(tls, int32(98982))
107958  		goto _26
107959  	}
107960  	if (((*XSchema)(_aNew.XpSchema).Xfile_format) != 0) && (int32((*XSchema)(_aNew.XpSchema).Xenc) != int32(_db.Xenc)) {
107961  		_zErrDyn = _sqlite3MPrintf(tls, _db, str(50073))
107962  		_rc = int32(1)
107963  	}
107964  _26:
107965  	_sqlite3BtreeEnter(tls, (*XBtree)(_aNew.XpBt))
107966  	_9_pPager = _sqlite3BtreePager(tls, (*XBtree)(_aNew.XpBt))
107967  	_sqlite3PagerLockingMode(tls, _9_pPager, int32(_db.XdfltLockMode))
107968  	_sqlite3BtreeSecureDelete(tls, (*XBtree)(_aNew.XpBt), _sqlite3BtreeSecureDelete(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), 0).XpBt), int32(-1)))
107969  	_sqlite3BtreeSetPagerFlags(tls, (*XBtree)(_aNew.XpBt), uint32(int32(3)|(_db.Xflags&int32(56))))
107970  	_sqlite3BtreeLeave(tls, (*XBtree)(_aNew.XpBt))
107971  _22:
107972  	_aNew.Xsafety_level = uint8(3)
107973  	_aNew.XzDbSName = _sqlite3DbStrDup(tls, _db, _zName)
107974  	if (_rc == int32(0)) && (_aNew.XzDbSName == nil) {
107975  		_rc = _sqlite3NomemError(tls, int32(99002))
107976  	}
107977  	if _rc == int32(0) {
107978  		_sqlite3BtreeEnterAll(tls, _db)
107979  		_rc = _sqlite3Init(tls, _db, &_zErrDyn)
107980  		_sqlite3BtreeLeaveAll(tls, _db)
107981  	}
107982  	if _rc == 0 {
107983  		goto _30
107984  	}
107985  	_14_iDb = _db.XnDb - int32(1)
107986  	func() {
107987  		if _14_iDb < int32(2) {
107988  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(99059), unsafe.Pointer(&_attachFuncØ00__func__Ø000), unsafe.Pointer(str(124338)))
107989  			crt.X__builtin_abort(tls)
107990  		}
107991  	}()
107992  	if (elem27((*XDb)(_db.XaDb), uintptr(_14_iDb)).XpBt) != nil {
107993  		_sqlite3BtreeClose(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_14_iDb)).XpBt))
107994  		*(**XBtree)(unsafe.Pointer(&(elem27((*XDb)(_db.XaDb), uintptr(_14_iDb)).XpBt))) = nil
107995  		*(**XSchema)(unsafe.Pointer(&(elem27((*XDb)(_db.XaDb), uintptr(_14_iDb)).XpSchema))) = nil
107996  	}
107997  	_sqlite3ResetAllSchemasOfConnection(tls, _db)
107998  	_db.XnDb = _14_iDb
107999  	if (_rc == int32(7)) || (_rc == int32(3082)) {
108000  		_sqlite3OomFault(tls, _db)
108001  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErrDyn))
108002  		_zErrDyn = _sqlite3MPrintf(tls, _db, str(59395))
108003  		goto _37
108004  	}
108005  	if _zErrDyn == nil {
108006  		_zErrDyn = _sqlite3MPrintf(tls, _db, str(124345), unsafe.Pointer(_zFile))
108007  	}
108008  _37:
108009  	goto _attach_error
108010  _30:
108011  	return
108012  _attach_error:
108013  	if _zErrDyn != nil {
108014  		Xsqlite3_result_error(tls, _context, _zErrDyn, int32(-1))
108015  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErrDyn))
108016  	}
108017  	if _rc != 0 {
108018  		Xsqlite3_result_error_code(tls, _context, _rc)
108019  	}
108020  }
108021  
108022  var _attachFuncØ00__func__Ø000 [11]int8
108023  
108024  func init() {
108025  	crt.Xstrncpy(nil, &_attachFuncØ00__func__Ø000[0], str(124373), 11)
108026  }
108027  
108028  // C comment
108029  //  /*
108030  //  ** This function is used to parse both URIs and non-URI filenames passed by the
108031  //  ** user to API functions sqlite3_open() or sqlite3_open_v2(), and for database
108032  //  ** URIs specified as part of ATTACH statements.
108033  //  **
108034  //  ** The first argument to this function is the name of the VFS to use (or
108035  //  ** a NULL to signify the default VFS) if the URI does not contain a "vfs=xxx"
108036  //  ** query parameter. The second argument contains the URI (or non-URI filename)
108037  //  ** itself. When this function is called the *pFlags variable should contain
108038  //  ** the default flags to open the database handle with. The value stored in
108039  //  ** *pFlags may be updated before returning if the URI filename contains
108040  //  ** "cache=xxx" or "mode=xxx" query parameters.
108041  //  **
108042  //  ** If successful, SQLITE_OK is returned. In this case *ppVfs is set to point to
108043  //  ** the VFS that should be used to open the database file. *pzFile is set to
108044  //  ** point to a buffer containing the name of the file to open. It is the
108045  //  ** responsibility of the caller to eventually call sqlite3_free() to release
108046  //  ** this buffer.
108047  //  **
108048  //  ** If an error occurs, then an SQLite error code is returned and *pzErrMsg
108049  //  ** may be set to point to a buffer containing an English language error
108050  //  ** message. It is the responsibility of the caller to eventually release
108051  //  ** this buffer by calling sqlite3_free().
108052  //  */
108053  func _sqlite3ParseUri(tls *crt.TLS, _zDefaultVfs *int8, _zUri *int8, _pFlags *uint32, _ppVfs **Xsqlite3_vfs, _pzFile **int8, _pzErrMsg **int8) (r0 int32) {
108054  	var _rc, _nUri, _1_eState, _1_iIn, _1_iOut, _5_octet, _13_nOpt, _13_nVal, _15_mask, _15_limit, _18_i, _18_mode int32
108055  	var _c int8
108056  	var _flags uint32
108057  	var _1_nByte uint64
108058  	var _zVfs, _zFile, _1_zOpt, _13_zVal, _15_zModeType, _19_z *int8
108059  	var _15_aMode *TOpenMode
108060  	_rc = int32(0)
108061  	_flags = *_pFlags
108062  	_zVfs = _zDefaultVfs
108063  	_nUri = _sqlite3Strlen30(tls, _zUri)
108064  	func() {
108065  		if (*_pzErrMsg) != nil {
108066  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(143033), unsafe.Pointer(&_sqlite3ParseUriØ00__func__Ø000), unsafe.Pointer(str(124384)))
108067  			crt.X__builtin_abort(tls)
108068  		}
108069  	}()
108070  	if (_flags&uint32(64)) == 0 && _sqlite3Config.XbOpenUri == 0 || _nUri < int32(5) || crt.Xmemcmp(tls, unsafe.Pointer(_zUri), unsafe.Pointer(str(124397)), uint32(5)) != int32(0) {
108071  		goto _5
108072  	}
108073  	_1_iOut = int32(0)
108074  	_1_nByte = uint64(_nUri + int32(2))
108075  	_flags |= uint32(64)
108076  	_1_iIn = int32(0)
108077  _6:
108078  	if _1_iIn >= _nUri {
108079  		goto _9
108080  	}
108081  	_1_nByte += uint64(bool2int(int32(*elem1(_zUri, uintptr(_1_iIn))) == int32(38)))
108082  	_1_iIn += 1
108083  	goto _6
108084  _9:
108085  	_zFile = (*int8)(Xsqlite3_malloc64(tls, _1_nByte))
108086  	if _zFile == nil {
108087  		return _sqlite3NomemError(tls, int32(143051))
108088  	}
108089  	_1_iIn = int32(5)
108090  	if int32(*elem1(_zUri, uintptr(5))) != int32(47) || int32(*elem1(_zUri, uintptr(6))) != int32(47) {
108091  		goto _12
108092  	}
108093  	_1_iIn = int32(7)
108094  _13:
108095  	if ((*elem1(_zUri, uintptr(_1_iIn))) != 0) && (int32(*elem1(_zUri, uintptr(_1_iIn))) != int32(47)) {
108096  		_1_iIn += 1
108097  		goto _13
108098  	}
108099  	if (_1_iIn != int32(7)) && ((_1_iIn != int32(16)) || crt.Xmemcmp(tls, unsafe.Pointer(str(124403)), unsafe.Pointer(elem1(_zUri, uintptr(7))), uint32(9)) != 0) {
108100  		*_pzErrMsg = Xsqlite3_mprintf(tls, str(124413), _1_iIn-int32(7), unsafe.Pointer(elem1(_zUri, uintptr(7))))
108101  		_rc = int32(1)
108102  		goto _parse_uri_out
108103  	}
108104  _12:
108105  	_1_eState = int32(0)
108106  _19:
108107  	if int32(store5(&_c, *elem1(_zUri, uintptr(_1_iIn)))) == int32(0) || int32(_c) == int32(35) {
108108  		goto _20
108109  	}
108110  	_1_iIn += 1
108111  	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 {
108112  		goto _24
108113  	}
108114  	_5_octet = int32(_sqlite3HexToInt(tls, int32(*elem1(_zUri, uintptr(postInc2(&_1_iIn, 1)))))) << 4
108115  	_5_octet += int32(_sqlite3HexToInt(tls, int32(*elem1(_zUri, uintptr(postInc2(&_1_iIn, 1))))))
108116  	func() {
108117  		if _5_octet < int32(0) || _5_octet >= int32(256) {
108118  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(143100), unsafe.Pointer(&_sqlite3ParseUriØ00__func__Ø000), unsafe.Pointer(str(124441)))
108119  			crt.X__builtin_abort(tls)
108120  		}
108121  	}()
108122  	if _5_octet != int32(0) {
108123  		goto _28
108124  	}
108125  _29:
108126  	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))) {
108127  		_1_iIn += 1
108128  		goto _29
108129  	}
108130  	goto _19
108131  _28:
108132  	_c = int8(_5_octet)
108133  	goto _54
108134  _24:
108135  	if _1_eState != int32(1) || int32(_c) != int32(38) && int32(_c) != int32(61) {
108136  		goto _42
108137  	}
108138  	if int32(*elem1(_zFile, uintptr(_1_iOut-int32(1)))) != int32(0) {
108139  		goto _43
108140  	}
108141  _44:
108142  	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)) {
108143  		_1_iIn += 1
108144  		goto _44
108145  	}
108146  	goto _19
108147  _43:
108148  	if int32(_c) == int32(38) {
108149  		*elem1(_zFile, uintptr(postInc2(&_1_iOut, 1))) = 0
108150  		goto _49
108151  	}
108152  	_1_eState = int32(2)
108153  _49:
108154  	_c = 0
108155  	goto _54
108156  _42:
108157  	if ((_1_eState == int32(0)) && (int32(_c) == int32(63))) || ((_1_eState == int32(2)) && (int32(_c) == int32(38))) {
108158  		_c = 0
108159  		_1_eState = int32(1)
108160  	}
108161  _54:
108162  	*elem1(_zFile, uintptr(postInc2(&_1_iOut, 1))) = _c
108163  	goto _19
108164  _20:
108165  	if _1_eState == int32(1) {
108166  		*elem1(_zFile, uintptr(postInc2(&_1_iOut, 1))) = 0
108167  	}
108168  	*elem1(_zFile, uintptr(postInc2(&_1_iOut, 1))) = 0
108169  	*elem1(_zFile, uintptr(postInc2(&_1_iOut, 1))) = 0
108170  	_1_zOpt = elem1(_zFile, uintptr(_sqlite3Strlen30(tls, _zFile)+int32(1)))
108171  _56:
108172  	if (*elem1(_1_zOpt, 0)) == 0 {
108173  		goto _57
108174  	}
108175  	_13_nOpt = _sqlite3Strlen30(tls, _1_zOpt)
108176  	_13_zVal = elem1(_1_zOpt, uintptr(_13_nOpt+int32(1)))
108177  	_13_nVal = _sqlite3Strlen30(tls, _13_zVal)
108178  	if (_13_nOpt == int32(3)) && (crt.Xmemcmp(tls, unsafe.Pointer(str(124463)), unsafe.Pointer(_1_zOpt), uint32(3)) == int32(0)) {
108179  		_zVfs = _13_zVal
108180  		goto _60
108181  	}
108182  	_15_aMode = nil
108183  	_15_zModeType = nil
108184  	_15_mask = int32(0)
108185  	_15_limit = int32(0)
108186  	if (_13_nOpt == int32(5)) && (crt.Xmemcmp(tls, unsafe.Pointer(str(124467)), unsafe.Pointer(_1_zOpt), uint32(5)) == int32(0)) {
108187  		_15_mask = int32(393216)
108188  		_15_aMode = (*TOpenMode)(unsafe.Pointer(&_sqlite3ParseUriØ00aCacheModeØ001))
108189  		_15_limit = _15_mask
108190  		_15_zModeType = str(124467)
108191  	}
108192  	if (_13_nOpt == int32(4)) && (crt.Xmemcmp(tls, unsafe.Pointer(str(124473)), unsafe.Pointer(_1_zOpt), uint32(4)) == int32(0)) {
108193  		_15_mask = int32(135)
108194  		_15_aMode = (*TOpenMode)(unsafe.Pointer(&_sqlite3ParseUriØ00aOpenModeØ002))
108195  		_15_limit = int32(uint32(_15_mask) & _flags)
108196  		_15_zModeType = str(124478)
108197  	}
108198  	if _15_aMode == nil {
108199  		goto _65
108200  	}
108201  	_18_mode = int32(0)
108202  	_18_i = int32(0)
108203  _66:
108204  	if (elem126(_15_aMode, uintptr(_18_i)).Xz) == nil {
108205  		goto _69
108206  	}
108207  	_19_z = elem126(_15_aMode, uintptr(_18_i)).Xz
108208  	if (_13_nVal == _sqlite3Strlen30(tls, _19_z)) && (int32(0) == crt.Xmemcmp(tls, unsafe.Pointer(_13_zVal), unsafe.Pointer(_19_z), uint32(_13_nVal))) {
108209  		_18_mode = elem126(_15_aMode, uintptr(_18_i)).Xmode
108210  		goto _69
108211  	}
108212  	_18_i += 1
108213  	goto _66
108214  _69:
108215  	if _18_mode == int32(0) {
108216  		*_pzErrMsg = Xsqlite3_mprintf(tls, str(124485), unsafe.Pointer(_15_zModeType), unsafe.Pointer(_13_zVal))
108217  		_rc = int32(1)
108218  		goto _parse_uri_out
108219  	}
108220  	if (_18_mode & int32(-129)) > _15_limit {
108221  		*_pzErrMsg = Xsqlite3_mprintf(tls, str(124505), unsafe.Pointer(_15_zModeType), unsafe.Pointer(_13_zVal))
108222  		_rc = int32(3)
108223  		goto _parse_uri_out
108224  	}
108225  	_flags = (_flags & uint32(^_15_mask)) | uint32(_18_mode)
108226  _65:
108227  _60:
108228  	_1_zOpt = elem1(_13_zVal, uintptr(_13_nVal+int32(1)))
108229  	goto _56
108230  _57:
108231  	goto _74
108232  _5:
108233  	_zFile = (*int8)(Xsqlite3_malloc64(tls, uint64(_nUri+int32(2))))
108234  	if _zFile == nil {
108235  		return _sqlite3NomemError(tls, int32(143224))
108236  	}
108237  	if _nUri != 0 {
108238  		crt.Xmemcpy(tls, unsafe.Pointer(_zFile), unsafe.Pointer(_zUri), uint32(_nUri))
108239  	}
108240  	*elem1(_zFile, uintptr(_nUri)) = 0
108241  	*elem1(_zFile, uintptr(_nUri+int32(1))) = 0
108242  	_flags &= uint32(4294967231)
108243  _74:
108244  	*_ppVfs = Xsqlite3_vfs_find(tls, _zVfs)
108245  	if (*_ppVfs) == nil {
108246  		*_pzErrMsg = Xsqlite3_mprintf(tls, str(124529), unsafe.Pointer(_zVfs))
108247  		_rc = int32(1)
108248  	}
108249  _parse_uri_out:
108250  	if _rc != int32(0) {
108251  		Xsqlite3_free(tls, unsafe.Pointer(_zFile))
108252  		_zFile = nil
108253  	}
108254  	*_pFlags = _flags
108255  	*_pzFile = _zFile
108256  	return _rc
108257  }
108258  
108259  var _sqlite3ParseUriØ00__func__Ø000 [16]int8
108260  
108261  func init() {
108262  	crt.Xstrncpy(nil, &_sqlite3ParseUriØ00__func__Ø000[0], str(124545), 16)
108263  }
108264  
108265  var _sqlite3ParseUriØ00aCacheModeØ001 [3]TOpenMode
108266  
108267  func init() {
108268  	_sqlite3ParseUriØ00aCacheModeØ001 = [3]TOpenMode{TOpenMode{Xz: str(123392), Xmode: int32(131072)}, TOpenMode{Xz: str(124561), Xmode: int32(262144)}, TOpenMode{}}
108269  }
108270  
108271  var _sqlite3ParseUriØ00aOpenModeØ002 [5]TOpenMode
108272  
108273  func init() {
108274  	_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{}}
108275  }
108276  
108277  // C comment
108278  //  /*
108279  //  ** Find and return the schema associated with a BTree.  Create
108280  //  ** a new one if necessary.
108281  //  */
108282  func _sqlite3SchemaGet(tls *crt.TLS, _db *Xsqlite3, _pBt *XBtree) (r0 *XSchema) {
108283  	var _p *XSchema
108284  	if _pBt != nil {
108285  		_p = (*XSchema)(_sqlite3BtreeSchema(tls, _pBt, int32(84), _sqlite3SchemaClear))
108286  		goto _1
108287  	}
108288  	_p = (*XSchema)(_sqlite3DbMallocZero(tls, nil, uint64(84)))
108289  _1:
108290  	if _p == nil {
108291  		_sqlite3OomFault(tls, _db)
108292  		goto _4
108293  	}
108294  	if int32(0) == int32(_p.Xfile_format) {
108295  		_sqlite3HashInit(tls, &_p.XtblHash)
108296  		_sqlite3HashInit(tls, &_p.XidxHash)
108297  		_sqlite3HashInit(tls, &_p.XtrigHash)
108298  		_sqlite3HashInit(tls, &_p.XfkeyHash)
108299  		_p.Xenc = uint8(1)
108300  	}
108301  _4:
108302  	return _p
108303  }
108304  
108305  func Xsqlite3_result_error_code(tls *crt.TLS, _pCtx *Xsqlite3_context, _errCode int32) {
108306  	_pCtx.XisError = _errCode
108307  	_pCtx.XfErrorOrAux = uint8(1)
108308  	if _pCtx.XpVdbe != nil {
108309  		(*TVdbe)(_pCtx.XpVdbe).XrcApp = _errCode
108310  	}
108311  	if (int32((*XMem)(_pCtx.XpOut).Xflags) & int32(1)) != 0 {
108312  		_sqlite3VdbeMemSetStr(tls, (*XMem)(_pCtx.XpOut), _sqlite3ErrStr(tls, _errCode), int32(-1), uint8(1), nil)
108313  	}
108314  }
108315  
108316  // C comment
108317  //  /*
108318  //  ** Called by the parser to compile a DETACH statement.
108319  //  **
108320  //  **     DETACH pDbname
108321  //  */
108322  func _sqlite3Detach(tls *crt.TLS, _pParse *XParse, _pDbname *XExpr) {
108323  	_codeAttach(tls, _pParse, int32(25), &_sqlite3DetachØ00detach_funcØ001, _pDbname, nil, nil, _pDbname)
108324  }
108325  
108326  var _sqlite3DetachØ00detach_funcØ001 XFuncDef
108327  
108328  func init() {
108329  	_sqlite3DetachØ00detach_funcØ001 = XFuncDef{XnArg: int8(1), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
108330  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
108331  	}{_detachFunc})), XzName: str(124579)}
108332  }
108333  
108334  // C comment
108335  //  /*
108336  //  ** An SQL user-function registered to do the work of an DETACH statement. The
108337  //  ** three arguments to the function come directly from a detach statement:
108338  //  **
108339  //  **     DETACH DATABASE x
108340  //  **
108341  //  **     SELECT sqlite_detach(x)
108342  //  */
108343  func _detachFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) {
108344  	var _i int32
108345  	var _zName *int8
108346  	var _db *Xsqlite3
108347  	var _pDb *XDb
108348  	var _zErr [128]int8
108349  	_zName = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, 0))))
108350  	_db = Xsqlite3_context_db_handle(tls, _context)
108351  	_pDb = nil
108352  
108353  	if _zName == nil {
108354  		_zName = str(284)
108355  	}
108356  	_i = int32(0)
108357  _1:
108358  	if _i >= _db.XnDb {
108359  		goto _4
108360  	}
108361  	_pDb = elem27((*XDb)(_db.XaDb), uintptr(_i))
108362  	if (*XBtree)(_pDb.XpBt) == nil {
108363  		goto _2
108364  	}
108365  	if _sqlite3StrICmp(tls, _pDb.XzDbSName, _zName) == int32(0) {
108366  		goto _4
108367  	}
108368  _2:
108369  	_i += 1
108370  	goto _1
108371  _4:
108372  	if _i >= _db.XnDb {
108373  		Xsqlite3_snprintf(tls, int32(128), (*int8)(unsafe.Pointer(&_zErr)), str(124593), unsafe.Pointer(_zName))
108374  		goto _detach_error
108375  	}
108376  	if _i < int32(2) {
108377  		Xsqlite3_snprintf(tls, int32(128), (*int8)(unsafe.Pointer(&_zErr)), str(124614), unsafe.Pointer(_zName))
108378  		goto _detach_error
108379  	}
108380  	if _db.XautoCommit == 0 {
108381  		Xsqlite3_snprintf(tls, int32(128), (*int8)(unsafe.Pointer(&_zErr)), str(124640))
108382  		goto _detach_error
108383  	}
108384  	if _sqlite3BtreeIsInReadTrans(tls, (*XBtree)(_pDb.XpBt)) != 0 || _sqlite3BtreeIsInBackup(tls, (*XBtree)(_pDb.XpBt)) != 0 {
108385  		Xsqlite3_snprintf(tls, int32(128), (*int8)(unsafe.Pointer(&_zErr)), str(124682), unsafe.Pointer(_zName))
108386  		goto _detach_error
108387  	}
108388  	_sqlite3BtreeClose(tls, (*XBtree)(_pDb.XpBt))
108389  	*(**XBtree)(unsafe.Pointer(&_pDb.XpBt)) = nil
108390  	*(**XSchema)(unsafe.Pointer(&_pDb.XpSchema)) = nil
108391  	_sqlite3CollapseDatabaseArray(tls, _db)
108392  	return
108393  _detach_error:
108394  	Xsqlite3_result_error(tls, _context, (*int8)(unsafe.Pointer(&_zErr)), int32(-1))
108395  	_ = _zErr
108396  }
108397  
108398  func _sqlite3Reindex(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken) {
108399  	var _iDb int32
108400  	var _z, _zDb, _3_zColl *int8
108401  	var _db *Xsqlite3
108402  	var _pTab *XTable
108403  	var _pObjName *XToken
108404  	var _pIndex *XIndex
108405  	var _pColl *XCollSeq
108406  	_db = (*Xsqlite3)(_pParse.Xdb)
108407  	if int32(0) != _sqlite3ReadSchema(tls, _pParse) {
108408  		return
108409  	}
108410  	if _pName1 == nil {
108411  		_reindexDatabases(tls, _pParse, nil)
108412  		return
108413  	}
108414  	if func() int32 {
108415  		if _pName2 == nil {
108416  			return func() int32 {
108417  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104007), unsafe.Pointer(&_sqlite3ReindexØ00__func__Ø000), unsafe.Pointer(str(4809)))
108418  				crt.X__builtin_abort(tls)
108419  				return int32(1)
108420  			}()
108421  		}
108422  		return int32(0)
108423  	}() == 0 && _pName2.Xz != nil {
108424  		goto _6
108425  	}
108426  	func() {
108427  		if _pName1.Xz == nil {
108428  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104009), unsafe.Pointer(&_sqlite3ReindexØ00__func__Ø000), unsafe.Pointer(str(124704)))
108429  			crt.X__builtin_abort(tls)
108430  		}
108431  	}()
108432  	_3_zColl = _sqlite3NameFromToken(tls, (*Xsqlite3)(_pParse.Xdb), _pName1)
108433  	if _3_zColl == nil {
108434  		return
108435  	}
108436  	_pColl = _sqlite3FindCollSeq(tls, _db, _db.Xenc, _3_zColl, int32(0))
108437  	if _pColl != nil {
108438  		_reindexDatabases(tls, _pParse, _3_zColl)
108439  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_3_zColl))
108440  		return
108441  	}
108442  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_3_zColl))
108443  _6:
108444  	_iDb = _sqlite3TwoPartName(tls, _pParse, _pName1, _pName2, &_pObjName)
108445  	if _iDb < int32(0) {
108446  		return
108447  	}
108448  	_z = _sqlite3NameFromToken(tls, _db, _pObjName)
108449  	if _z == nil {
108450  		return
108451  	}
108452  	_zDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
108453  	_pTab = _sqlite3FindTable(tls, _db, _z, _zDb)
108454  	if _pTab != nil {
108455  		_reindexTable(tls, _pParse, _pTab, nil)
108456  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_z))
108457  		return
108458  	}
108459  	_pIndex = _sqlite3FindIndex(tls, _db, _z, _zDb)
108460  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_z))
108461  	if _pIndex != nil {
108462  		_sqlite3BeginWriteOperation(tls, _pParse, int32(0), _iDb)
108463  		_sqlite3RefillIndex(tls, _pParse, _pIndex, int32(-1))
108464  		return
108465  	}
108466  	_sqlite3ErrorMsg(tls, _pParse, str(124714))
108467  }
108468  
108469  func _reindexDatabases(tls *crt.TLS, _pParse *XParse, _zColl *int8) {
108470  	var _iDb int32
108471  	var _db *Xsqlite3
108472  	var _pDb *XDb
108473  	var _k *XHashElem
108474  	var _pTab *XTable
108475  	_db = (*Xsqlite3)(_pParse.Xdb)
108476  	func() {
108477  		if _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
108478  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103963), unsafe.Pointer(&_reindexDatabasesØ00__func__Ø000), unsafe.Pointer(str(9376)))
108479  			crt.X__builtin_abort(tls)
108480  		}
108481  	}()
108482  	*func() **XDb { _iDb = int32(0); return &_pDb }() = (*XDb)(_db.XaDb)
108483  _2:
108484  	if _iDb >= _db.XnDb {
108485  		goto _5
108486  	}
108487  	func() {
108488  		if _pDb == nil {
108489  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103965), unsafe.Pointer(&_reindexDatabasesØ00__func__Ø000), unsafe.Pointer(str(124760)))
108490  			crt.X__builtin_abort(tls)
108491  		}
108492  	}()
108493  	_k = (*XHashElem)(((*XSchema)(_pDb.XpSchema).XtblHash).Xfirst)
108494  _8:
108495  	if _k == nil {
108496  		goto _11
108497  	}
108498  	_pTab = (*XTable)(_k.Xdata)
108499  	_reindexTable(tls, _pParse, _pTab, _zColl)
108500  	_k = (*XHashElem)(_k.Xnext)
108501  	goto _8
108502  _11:
108503  	*(*uintptr)(unsafe.Pointer(func() **XDb { _iDb += 1; return &_pDb }())) += uintptr(16)
108504  	goto _2
108505  _5:
108506  }
108507  
108508  var _reindexDatabasesØ00__func__Ø000 [17]int8
108509  
108510  func init() {
108511  	crt.Xstrncpy(nil, &_reindexDatabasesØ00__func__Ø000[0], str(124767), 17)
108512  }
108513  
108514  func _reindexTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _zColl *int8) {
108515  	var _2_iDb int32
108516  	var _pIndex *XIndex
108517  	_pIndex = (*XIndex)(_pTab.XpIndex)
108518  _0:
108519  	if _pIndex == nil {
108520  		goto _3
108521  	}
108522  	if (_zColl == nil) || _collationMatch(tls, _zColl, _pIndex) != 0 {
108523  		_2_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), (*XSchema)(_pTab.XpSchema))
108524  		_sqlite3BeginWriteOperation(tls, _pParse, int32(0), _2_iDb)
108525  		_sqlite3RefillIndex(tls, _pParse, _pIndex, int32(-1))
108526  	}
108527  	_pIndex = (*XIndex)(_pIndex.XpNext)
108528  	goto _0
108529  _3:
108530  }
108531  
108532  func _collationMatch(tls *crt.TLS, _zColl *int8, _pIndex *XIndex) (r0 int32) {
108533  	var _i int32
108534  	var _1_z *int8
108535  	func() {
108536  		if _zColl == nil {
108537  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103920), unsafe.Pointer(&_collationMatchØ00__func__Ø000), unsafe.Pointer(str(124784)))
108538  			crt.X__builtin_abort(tls)
108539  		}
108540  	}()
108541  	_i = int32(0)
108542  _2:
108543  	if _i >= int32(_pIndex.XnColumn) {
108544  		goto _5
108545  	}
108546  	_1_z = *elem0(_pIndex.XazColl, uintptr(_i))
108547  	func() {
108548  		if _1_z == nil && int32(*elem50(_pIndex.XaiColumn, uintptr(_i))) >= int32(0) {
108549  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(103923), unsafe.Pointer(&_collationMatchØ00__func__Ø000), unsafe.Pointer(str(124793)))
108550  			crt.X__builtin_abort(tls)
108551  		}
108552  	}()
108553  	if (int32(*elem50(_pIndex.XaiColumn, uintptr(_i))) >= int32(0)) && (int32(0) == _sqlite3StrICmp(tls, _1_z, _zColl)) {
108554  		return int32(1)
108555  	}
108556  	_i += 1
108557  	goto _2
108558  _5:
108559  	return int32(0)
108560  }
108561  
108562  var _collationMatchØ00__func__Ø000 [15]int8
108563  
108564  func init() {
108565  	crt.Xstrncpy(nil, &_collationMatchØ00__func__Ø000[0], str(124823), 15)
108566  }
108567  
108568  var _sqlite3ReindexØ00__func__Ø000 [15]int8
108569  
108570  func init() {
108571  	crt.Xstrncpy(nil, &_sqlite3ReindexØ00__func__Ø000[0], str(124838), 15)
108572  }
108573  
108574  // C comment
108575  //  /*
108576  //  ** Generate code for the ANALYZE command.  The parser calls this routine
108577  //  ** when it recognizes an ANALYZE command.
108578  //  **
108579  //  **        ANALYZE                            -- 1
108580  //  **        ANALYZE  <database>                -- 2
108581  //  **        ANALYZE  ?<database>.?<tablename>  -- 3
108582  //  **
108583  //  ** Form 1 causes all indices in all attached databases to be analyzed.
108584  //  ** Form 2 analyzes all indices the single database named.
108585  //  ** Form 3 analyzes all indices associated with the named table.
108586  //  */
108587  func _sqlite3Analyze(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken) {
108588  	var _iDb, _i int32
108589  	var _z, _zDb *int8
108590  	var _db *Xsqlite3
108591  	var _pTab *XTable
108592  	var _v *TVdbe
108593  	var _pTableName *XToken
108594  	var _pIdx *XIndex
108595  	_db = (*Xsqlite3)(_pParse.Xdb)
108596  	func() {
108597  		if _sqlite3BtreeHoldsAllMutexes(tls, (*Xsqlite3)(_pParse.Xdb)) == 0 {
108598  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98299), unsafe.Pointer(&_sqlite3AnalyzeØ00__func__Ø000), unsafe.Pointer(str(124853)))
108599  			crt.X__builtin_abort(tls)
108600  		}
108601  	}()
108602  	if int32(0) != _sqlite3ReadSchema(tls, _pParse) {
108603  		return
108604  	}
108605  	func() {
108606  		if _pName2 == nil && _pName1 != nil {
108607  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98304), unsafe.Pointer(&_sqlite3AnalyzeØ00__func__Ø000), unsafe.Pointer(str(124893)))
108608  			crt.X__builtin_abort(tls)
108609  		}
108610  	}()
108611  	if _pName1 != nil {
108612  		goto _6
108613  	}
108614  	_i = int32(0)
108615  _7:
108616  	if _i >= _db.XnDb {
108617  		goto _10
108618  	}
108619  	if _i == int32(1) {
108620  		goto _8
108621  	}
108622  	_analyzeDatabase(tls, _pParse, _i)
108623  _8:
108624  	_i += 1
108625  	goto _7
108626  _10:
108627  	goto _15
108628  _6:
108629  	if (_pName2.Xn == (0)) && (store2(&_iDb, _sqlite3FindDb(tls, _db, _pName1)) >= int32(0)) {
108630  		_analyzeDatabase(tls, _pParse, _iDb)
108631  		goto _15
108632  	}
108633  	_iDb = _sqlite3TwoPartName(tls, _pParse, _pName1, _pName2, &_pTableName)
108634  	if _iDb < int32(0) {
108635  		goto _16
108636  	}
108637  	_zDb = func() *int8 {
108638  		if _pName2.Xn != 0 {
108639  			return (elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName)
108640  		}
108641  		return nil
108642  	}()
108643  	_z = _sqlite3NameFromToken(tls, _db, _pTableName)
108644  	if _z == nil {
108645  		goto _19
108646  	}
108647  	if store113(&_pIdx, _sqlite3FindIndex(tls, _db, _z, _zDb)) != nil {
108648  		_analyzeTable(tls, _pParse, (*XTable)(_pIdx.XpTable), _pIdx)
108649  		goto _22
108650  	}
108651  	if store72(&_pTab, _sqlite3LocateTable(tls, _pParse, 0, _z, _zDb)) != nil {
108652  		_analyzeTable(tls, _pParse, _pTab, nil)
108653  	}
108654  _22:
108655  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_z))
108656  _19:
108657  _16:
108658  _15:
108659  	if (int32(_db.XnSqlExec) == int32(0)) && (store60(&_v, _sqlite3GetVdbe(tls, _pParse)) != nil) {
108660  		_sqlite3VdbeAddOp0(tls, _v, int32(153))
108661  	}
108662  }
108663  
108664  var _sqlite3AnalyzeØ00__func__Ø000 [15]int8
108665  
108666  func init() {
108667  	crt.Xstrncpy(nil, &_sqlite3AnalyzeØ00__func__Ø000[0], str(124916), 15)
108668  }
108669  
108670  // C comment
108671  //  /*
108672  //  ** Generate code that will do an analysis of an entire database
108673  //  */
108674  func _analyzeDatabase(tls *crt.TLS, _pParse *XParse, _iDb int32) {
108675  	var _iStatCur, _iMem, _iTab int32
108676  	var _db *Xsqlite3
108677  	var _pSchema *XSchema
108678  	var _k *XHashElem
108679  	var _1_pTab *XTable
108680  	_db = (*Xsqlite3)(_pParse.Xdb)
108681  	_pSchema = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema)
108682  	_sqlite3BeginWriteOperation(tls, _pParse, int32(0), _iDb)
108683  	_iStatCur = _pParse.XnTab
108684  	_pParse.XnTab += int32(3)
108685  	_openStatTable(tls, _pParse, _iDb, _iStatCur, nil, nil)
108686  	_iMem = _pParse.XnMem + int32(1)
108687  	_iTab = _pParse.XnTab
108688  	func() {
108689  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
108690  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98243), unsafe.Pointer(&_analyzeDatabaseØ00__func__Ø000), unsafe.Pointer(str(51126)))
108691  			crt.X__builtin_abort(tls)
108692  		}
108693  	}()
108694  	_k = (*XHashElem)(_pSchema.XtblHash.Xfirst)
108695  _2:
108696  	if _k == nil {
108697  		goto _5
108698  	}
108699  	_1_pTab = (*XTable)(_k.Xdata)
108700  	_analyzeOneTable(tls, _pParse, _1_pTab, nil, _iStatCur, _iMem, _iTab)
108701  	_k = (*XHashElem)(_k.Xnext)
108702  	goto _2
108703  _5:
108704  	_loadAnalysis(tls, _pParse, _iDb)
108705  }
108706  
108707  // C comment
108708  //  /*
108709  //  ** This routine generates code that opens the sqlite_statN tables.
108710  //  ** The sqlite_stat1 table is always relevant.  sqlite_stat2 is now
108711  //  ** obsolete.  sqlite_stat3 and sqlite_stat4 are only opened when
108712  //  ** appropriate compile-time options are provided.
108713  //  **
108714  //  ** If the sqlite_statN tables do not previously exist, it is created.
108715  //  **
108716  //  ** Argument zWhere may be a pointer to a buffer containing a table name,
108717  //  ** or it may be a NULL pointer. If it is not NULL, then all entries in
108718  //  ** the sqlite_statN tables associated with the named table are deleted.
108719  //  ** If zWhere==0, then code is generated to delete all stat table entries.
108720  //  */
108721  func _openStatTable(tls *crt.TLS, _pParse *XParse, _iDb int32, _iStatCur int32, _zWhere *int8, _zWhereType *int8) {
108722  	var _i int32
108723  	var _1_zTab *int8
108724  	var _aRoot [3]int32
108725  	var _db *Xsqlite3
108726  	var _pDb *XDb
108727  	var _1_pStat *XTable
108728  	var _v *TVdbe
108729  	var _aCreateTbl [3]uint8
108730  	_db = (*Xsqlite3)(_pParse.Xdb)
108731  	_v = _sqlite3GetVdbe(tls, _pParse)
108732  	if _v == nil {
108733  		return
108734  	}
108735  	func() {
108736  		if _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
108737  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97123), unsafe.Pointer(&_openStatTableØ00__func__Ø000), unsafe.Pointer(str(9376)))
108738  			crt.X__builtin_abort(tls)
108739  		}
108740  	}()
108741  	func() {
108742  		if _sqlite3VdbeDb(tls, _v) != _db {
108743  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97124), unsafe.Pointer(&_openStatTableØ00__func__Ø000), unsafe.Pointer(str(124931)))
108744  			crt.X__builtin_abort(tls)
108745  		}
108746  	}()
108747  	_pDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb))
108748  	_i = int32(0)
108749  _5:
108750  	if _i >= int32(3) {
108751  		goto _8
108752  	}
108753  	_1_zTab = elem127((*t128)(unsafe.Pointer(&_openStatTableØ00aTableØ001)), uintptr(_i)).XzName
108754  	if store72(&_1_pStat, _sqlite3FindTable(tls, _db, _1_zTab, _pDb.XzDbSName)) != nil {
108755  		goto _9
108756  	}
108757  	if (elem127((*t128)(unsafe.Pointer(&_openStatTableØ00aTableØ001)), uintptr(_i)).XzCols) != nil {
108758  		_sqlite3NestedParse(tls, _pParse, str(124952), unsafe.Pointer(_pDb.XzDbSName), unsafe.Pointer(_1_zTab), unsafe.Pointer(elem127((*t128)(unsafe.Pointer(&_openStatTableØ00aTableØ001)), uintptr(_i)).XzCols))
108759  		*elem8((*int32)(unsafe.Pointer(&_aRoot)), uintptr(_i)) = _pParse.XregRoot
108760  		*elem15((*uint8)(unsafe.Pointer(&_aCreateTbl)), uintptr(_i)) = uint8(16)
108761  	}
108762  	goto _11
108763  _9:
108764  	*elem8((*int32)(unsafe.Pointer(&_aRoot)), uintptr(_i)) = _1_pStat.Xtnum
108765  	*elem15((*uint8)(unsafe.Pointer(&_aCreateTbl)), uintptr(_i)) = 0
108766  	_sqlite3TableLock(tls, _pParse, _iDb, *elem8((*int32)(unsafe.Pointer(&_aRoot)), uintptr(_i)), uint8(1), _1_zTab)
108767  	if _zWhere != nil {
108768  		_sqlite3NestedParse(tls, _pParse, str(115004), unsafe.Pointer(_pDb.XzDbSName), unsafe.Pointer(_1_zTab), unsafe.Pointer(_zWhereType), unsafe.Pointer(_zWhere))
108769  		goto _13
108770  	}
108771  	_sqlite3VdbeAddOp2(tls, _v, int32(134), *elem8((*int32)(unsafe.Pointer(&_aRoot)), uintptr(_i)), _iDb)
108772  _13:
108773  _11:
108774  	_i += 1
108775  	goto _5
108776  _8:
108777  	_i = int32(0)
108778  _14:
108779  	if (elem127((*t128)(unsafe.Pointer(&_openStatTableØ00aTableØ001)), uintptr(_i)).XzCols) == nil {
108780  		goto _17
108781  	}
108782  	func() {
108783  		if _i >= int32(3) {
108784  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97166), unsafe.Pointer(&_openStatTableØ00__func__Ø000), unsafe.Pointer(str(124975)))
108785  			crt.X__builtin_abort(tls)
108786  		}
108787  	}()
108788  	_sqlite3VdbeAddOp4Int(tls, _v, int32(107), _iStatCur+_i, *elem8((*int32)(unsafe.Pointer(&_aRoot)), uintptr(_i)), _iDb, int32(3))
108789  	_sqlite3VdbeChangeP5(tls, _v, uint16(*elem15((*uint8)(unsafe.Pointer(&_aCreateTbl)), uintptr(_i))))
108790  	_sqlite3VdbeComment(tls, _v, elem127((*t128)(unsafe.Pointer(&_openStatTableØ00aTableØ001)), uintptr(_i)).XzName)
108791  	_i += 1
108792  	goto _14
108793  _17:
108794  	_ = _aRoot
108795  	_ = _aCreateTbl
108796  }
108797  
108798  var _openStatTableØ00__func__Ø000 [14]int8
108799  
108800  func init() {
108801  	crt.Xstrncpy(nil, &_openStatTableØ00__func__Ø000[0], str(124995), 14)
108802  }
108803  
108804  var _openStatTableØ00aTableØ001 [3]t128
108805  
108806  func init() {
108807  	_openStatTableØ00aTableØ001 = [3]t128{t128{XzName: str(86613), XzCols: str(125009)}, t128{XzName: str(125022)}, t128{XzName: str(125035)}}
108808  }
108809  
108810  var _analyzeDatabaseØ00__func__Ø000 [16]int8
108811  
108812  func init() {
108813  	crt.Xstrncpy(nil, &_analyzeDatabaseØ00__func__Ø000[0], str(125048), 16)
108814  }
108815  
108816  // C comment
108817  //  /*
108818  //  ** Generate code to do an analysis of all indices associated with
108819  //  ** a single table.
108820  //  */
108821  func _analyzeOneTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pOnlyIdx *XIndex, _iStatCur int32, _iMem int32, _iTab int32) {
108822  	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
108823  	var _8_aGotoChng *int32
108824  	var _5_zIdxName, _10_pColl *int8
108825  	var _needTableCnt uint8
108826  	var _db *Xsqlite3
108827  	var _v *TVdbe
108828  	var _pIdx *XIndex
108829  	_db = (*Xsqlite3)(_pParse.Xdb)
108830  	_jZeroRows = int32(-1)
108831  	_needTableCnt = uint8(1)
108832  	_regNewRowid = postInc2(&_iMem, 1)
108833  	_regStat4 = postInc2(&_iMem, 1)
108834  	_regChng = postInc2(&_iMem, 1)
108835  	_regTemp = postInc2(&_iMem, 1)
108836  	_regTabname = postInc2(&_iMem, 1)
108837  	_regIdxname = postInc2(&_iMem, 1)
108838  	_regStat1 = postInc2(&_iMem, 1)
108839  	_regPrev = _iMem
108840  	_pParse.XnMem = func() int32 {
108841  		if _pParse.XnMem > _iMem {
108842  			return _pParse.XnMem
108843  		}
108844  		return _iMem
108845  	}()
108846  	_v = _sqlite3GetVdbe(tls, _pParse)
108847  	if (_v == nil) || func() int32 {
108848  		if _pTab == nil {
108849  			return func() int32 {
108850  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97924), unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000), unsafe.Pointer(str(4809)))
108851  				crt.X__builtin_abort(tls)
108852  				return int32(1)
108853  			}()
108854  		}
108855  		return int32(0)
108856  	}() != 0 {
108857  		return
108858  	}
108859  	if _pTab.Xtnum == int32(0) {
108860  		return
108861  	}
108862  	if Xsqlite3_strlike(tls, str(125064), _pTab.XzName, 0) == int32(0) {
108863  		return
108864  	}
108865  	func() {
108866  		if _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
108867  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97935), unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000), unsafe.Pointer(str(9376)))
108868  			crt.X__builtin_abort(tls)
108869  		}
108870  	}()
108871  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.XpSchema))
108872  	func() {
108873  		if _iDb < int32(0) {
108874  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97937), unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000), unsafe.Pointer(str(41995)))
108875  			crt.X__builtin_abort(tls)
108876  		}
108877  	}()
108878  	func() {
108879  		if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
108880  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97938), unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000), unsafe.Pointer(str(51126)))
108881  			crt.X__builtin_abort(tls)
108882  		}
108883  	}()
108884  	if _sqlite3AuthCheck(tls, _pParse, int32(28), _pTab.XzName, nil, elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName) != 0 {
108885  		return
108886  	}
108887  	_sqlite3TableLock(tls, _pParse, _iDb, _pTab.Xtnum, 0, _pTab.XzName)
108888  	_iTabCur = postInc2(&_iTab, 1)
108889  	_iIdxCur = postInc2(&_iTab, 1)
108890  	_pParse.XnTab = func() int32 {
108891  		if _pParse.XnTab > _iTab {
108892  			return _pParse.XnTab
108893  		}
108894  		return _iTab
108895  	}()
108896  	_sqlite3OpenTable(tls, _pParse, _iTabCur, _iDb, _pTab, int32(106))
108897  	_sqlite3VdbeLoadString(tls, _v, _regTabname, _pTab.XzName)
108898  	_pIdx = (*XIndex)(_pTab.XpIndex)
108899  _17:
108900  	if _pIdx == nil {
108901  		goto _20
108902  	}
108903  	if (_pOnlyIdx != nil) && (_pOnlyIdx != _pIdx) {
108904  		goto _18
108905  	}
108906  	if (*XExpr)(_pIdx.XpPartIdxWhere) == nil {
108907  		_needTableCnt = 0
108908  	}
108909  	if ((_pTab.XtabFlags & uint32(32)) != (0)) && (int32((uint32(_pIdx.XidxType)<<30)>>30) == int32(2)) {
108910  		_5_nCol = int32(_pIdx.XnKeyCol)
108911  		_5_zIdxName = _pTab.XzName
108912  		_5_nColTest = _5_nCol - int32(1)
108913  		goto _26
108914  	}
108915  	_5_nCol = int32(_pIdx.XnColumn)
108916  	_5_zIdxName = _pIdx.XzName
108917  	_5_nColTest = func() int32 {
108918  		if ((uint32(_pIdx.XidxType>>3) << 31) >> 31) != 0 {
108919  			return (int32(_pIdx.XnKeyCol) - int32(1))
108920  		}
108921  		return (_5_nCol - int32(1))
108922  	}()
108923  _26:
108924  	_sqlite3VdbeLoadString(tls, _v, _regIdxname, _5_zIdxName)
108925  	_sqlite3VdbeComment(tls, _v, str(125073), unsafe.Pointer(_pTab.XzName), unsafe.Pointer(_5_zIdxName))
108926  	_pParse.XnMem = func() int32 {
108927  		if _pParse.XnMem > (_regPrev + _5_nColTest) {
108928  			return _pParse.XnMem
108929  		}
108930  		return (_regPrev + _5_nColTest)
108931  	}()
108932  	func() {
108933  		if _iDb != _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pIdx.XpSchema)) {
108934  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98019), unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000), unsafe.Pointer(str(125092)))
108935  			crt.X__builtin_abort(tls)
108936  		}
108937  	}()
108938  	_sqlite3VdbeAddOp3(tls, _v, int32(106), _iIdxCur, _pIdx.Xtnum, _iDb)
108939  	_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pIdx)
108940  	_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(_pIdx.XzName))
108941  	_sqlite3VdbeAddOp2(tls, _v, int32(56), _5_nCol, _regStat4+int32(1))
108942  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(_pIdx.XnKeyCol), _regStat4+int32(2))
108943  	_sqlite3VdbeAddOp4(tls, _v, int32(69), int32(0), _regStat4+int32(1), _regStat4, (*int8)(unsafe.Pointer(&_statInitFuncdef)), int32(-4))
108944  	_sqlite3VdbeChangeP5(tls, _v, uint16(2))
108945  	_5_addrRewind = _sqlite3VdbeAddOp1(tls, _v, int32(37), _iIdxCur)
108946  	_sqlite3VdbeAddOp2(tls, _v, int32(56), int32(0), _regChng)
108947  	_5_addrNextRow = _sqlite3VdbeCurrentAddr(tls, _v)
108948  	if _5_nColTest <= int32(0) {
108949  		goto _33
108950  	}
108951  	_8_endDistinctTest = _sqlite3VdbeMakeLabel(tls, _v)
108952  	_8_aGotoChng = (*int32)(_sqlite3DbMallocRawNN(tls, _db, uint64(uint32(4)*uint32(_5_nColTest))))
108953  	if _8_aGotoChng == nil {
108954  		goto _18
108955  	}
108956  	_sqlite3VdbeAddOp0(tls, _v, int32(13))
108957  	_5_addrNextRow = _sqlite3VdbeCurrentAddr(tls, _v)
108958  	if ((_5_nColTest == int32(1)) && (int32(_pIdx.XnKeyCol) == int32(1))) && (int32(_pIdx.XonError) != int32(0)) {
108959  		_sqlite3VdbeAddOp2(tls, _v, int32(76), _regPrev, _8_endDistinctTest)
108960  	}
108961  	_i = int32(0)
108962  _38:
108963  	if _i >= _5_nColTest {
108964  		goto _41
108965  	}
108966  	_10_pColl = (*int8)(unsafe.Pointer(_sqlite3LocateCollSeq(tls, _pParse, *elem0(_pIdx.XazColl, uintptr(_i)))))
108967  	_sqlite3VdbeAddOp2(tls, _v, int32(56), _i, _regChng)
108968  	_sqlite3VdbeAddOp3(tls, _v, int32(99), _iIdxCur, _i, _regTemp)
108969  	*elem8(_8_aGotoChng, uintptr(_i)) = _sqlite3VdbeAddOp4(tls, _v, int32(77), _regTemp, int32(0), _regPrev+_i, _10_pColl, int32(-3))
108970  	_sqlite3VdbeChangeP5(tls, _v, uint16(128))
108971  	_i += 1
108972  	goto _38
108973  _41:
108974  	_sqlite3VdbeAddOp2(tls, _v, int32(56), _5_nColTest, _regChng)
108975  	_sqlite3VdbeGoto(tls, _v, _8_endDistinctTest)
108976  	_sqlite3VdbeJumpHere(tls, _v, _5_addrNextRow-int32(1))
108977  	_i = int32(0)
108978  _42:
108979  	if _i >= _5_nColTest {
108980  		goto _45
108981  	}
108982  	_sqlite3VdbeJumpHere(tls, _v, *elem8(_8_aGotoChng, uintptr(_i)))
108983  	_sqlite3VdbeAddOp3(tls, _v, int32(99), _iIdxCur, _i, _regPrev+_i)
108984  	_i += 1
108985  	goto _42
108986  _45:
108987  	_sqlite3VdbeResolveLabel(tls, _v, _8_endDistinctTest)
108988  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_8_aGotoChng))
108989  _33:
108990  	func() {
108991  		if _regChng != (_regStat4 + int32(1)) {
108992  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98135), unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000), unsafe.Pointer(str(125137)))
108993  			crt.X__builtin_abort(tls)
108994  		}
108995  	}()
108996  	_sqlite3VdbeAddOp4(tls, _v, int32(69), int32(1), _regStat4, _regTemp, (*int8)(unsafe.Pointer(&_statPushFuncdef)), int32(-4))
108997  	_sqlite3VdbeChangeP5(tls, _v, uint16(2))
108998  	_sqlite3VdbeAddOp2(tls, _v, int32(7), _iIdxCur, _5_addrNextRow)
108999  	_callStatGet(tls, _v, _regStat4, int32(0), _regStat1)
109000  	func() {
109001  		if int32(*elem1(str(125159), 0)) != int32(66) {
109002  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98143), unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000), unsafe.Pointer(str(125163)))
109003  			crt.X__builtin_abort(tls)
109004  		}
109005  	}()
109006  	_sqlite3VdbeAddOp4(tls, _v, int32(101), _regTabname, int32(3), _regTemp, str(125159), int32(0))
109007  	_sqlite3VdbeAddOp2(tls, _v, int32(117), _iStatCur, _regNewRowid)
109008  	_sqlite3VdbeAddOp3(tls, _v, int32(118), _iStatCur, _regTemp, _regNewRowid)
109009  	_sqlite3VdbeChangeP5(tls, _v, uint16(8))
109010  	_sqlite3VdbeJumpHere(tls, _v, _5_addrRewind)
109011  _18:
109012  	_pIdx = (*XIndex)(_pIdx.XpNext)
109013  	goto _17
109014  _20:
109015  	if (_pOnlyIdx == nil) && (_needTableCnt != 0) {
109016  		_sqlite3VdbeComment(tls, _v, str(24531), unsafe.Pointer(_pTab.XzName))
109017  		_sqlite3VdbeAddOp2(tls, _v, int32(102), _iTabCur, _regStat1)
109018  		_jZeroRows = _sqlite3VdbeAddOp1(tls, _v, int32(22), _regStat1)
109019  		_sqlite3VdbeAddOp2(tls, _v, int32(59), int32(0), _regIdxname)
109020  		func() {
109021  			if int32(*elem1(str(125159), 0)) != int32(66) {
109022  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98205), unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000), unsafe.Pointer(str(125163)))
109023  				crt.X__builtin_abort(tls)
109024  			}
109025  		}()
109026  		_sqlite3VdbeAddOp4(tls, _v, int32(101), _regTabname, int32(3), _regTemp, str(125159), int32(0))
109027  		_sqlite3VdbeAddOp2(tls, _v, int32(117), _iStatCur, _regNewRowid)
109028  		_sqlite3VdbeAddOp3(tls, _v, int32(118), _iStatCur, _regTemp, _regNewRowid)
109029  		_sqlite3VdbeChangeP5(tls, _v, uint16(8))
109030  		_sqlite3VdbeJumpHere(tls, _v, _jZeroRows)
109031  	}
109032  }
109033  
109034  var _analyzeOneTableØ00__func__Ø000 [16]int8
109035  
109036  func init() {
109037  	crt.Xstrncpy(nil, &_analyzeOneTableØ00__func__Ø000[0], str(125189), 16)
109038  }
109039  
109040  var _statInitFuncdef XFuncDef
109041  
109042  func init() {
109043  	_statInitFuncdef = XFuncDef{XnArg: int8(2), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
109044  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
109045  	}{_statInit})), XzName: str(125205)}
109046  }
109047  
109048  // C comment
109049  //  /*
109050  //  ** Implementation of the stat_init(N,K,C) SQL function. The three parameters
109051  //  ** are:
109052  //  **     N:    The number of columns in the index including the rowid/pk (note 1)
109053  //  **     K:    The number of columns in the index excluding the rowid/pk.
109054  //  **     C:    The number of rows in the index (note 2)
109055  //  **
109056  //  ** Note 1:  In the special case of the covering index that implements a
109057  //  ** WITHOUT ROWID table, N is the number of PRIMARY KEY columns, not the
109058  //  ** total number of columns in the table.
109059  //  **
109060  //  ** Note 2:  C is only used for STAT3 and STAT4.
109061  //  **
109062  //  ** For indexes on ordinary rowid tables, N==K+1.  But for indexes on
109063  //  ** WITHOUT ROWID tables, N=K+P where P is the number of columns in the
109064  //  ** PRIMARY KEY of the table.  The covering index that implements the
109065  //  ** original WITHOUT ROWID table as N==K as a special case.
109066  //  **
109067  //  ** This routine allocates the Stat4Accum object in heap memory. The return
109068  //  ** value is a pointer to the Stat4Accum object.  The datatype of the
109069  //  ** return value is BLOB, but it is really just a pointer to the Stat4Accum
109070  //  ** object.
109071  //  */
109072  func _statInit(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
109073  	var _nCol, _nKeyCol, _nColUp, _n int32
109074  	var _db *Xsqlite3
109075  	var _p *XStat4Accum
109076  
109077  	_nCol = Xsqlite3_value_int(tls, *elem19(_argv, 0))
109078  	func() {
109079  		if _nCol <= int32(0) {
109080  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97333), unsafe.Pointer(&_statInitØ00__func__Ø000), unsafe.Pointer(str(125215)))
109081  			crt.X__builtin_abort(tls)
109082  		}
109083  	}()
109084  	_nColUp = (_nCol + int32(1)) & int32(-2)
109085  	_nKeyCol = Xsqlite3_value_int(tls, *elem19(_argv, uintptr(1)))
109086  	func() {
109087  		if _nKeyCol > _nCol {
109088  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97336), unsafe.Pointer(&_statInitØ00__func__Ø000), unsafe.Pointer(str(125222)))
109089  			crt.X__builtin_abort(tls)
109090  		}
109091  	}()
109092  	func() {
109093  		if _nKeyCol <= int32(0) {
109094  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97337), unsafe.Pointer(&_statInitØ00__func__Ø000), unsafe.Pointer(str(107138)))
109095  			crt.X__builtin_abort(tls)
109096  		}
109097  	}()
109098  	_n = int32((uint32(60) + (uint32(4) * uint32(_nColUp))) + (uint32(4) * uint32(_nColUp)))
109099  	_db = Xsqlite3_context_db_handle(tls, _context)
109100  	_p = (*XStat4Accum)(_sqlite3DbMallocZero(tls, _db, uint64(_n)))
109101  	if _p == nil {
109102  		Xsqlite3_result_error_nomem(tls, _context)
109103  		return
109104  	}
109105  	*(**Xsqlite3)(unsafe.Pointer(&_p.Xdb)) = _db
109106  	_p.XnRow = 0
109107  	_p.XnCol = _nCol
109108  	_p.XnKeyCol = _nKeyCol
109109  	_p.Xcurrent.XanDLt = (*uint32)(unsafe.Pointer(elem129(_p, uintptr(1))))
109110  	_p.Xcurrent.XanEq = elem7(_p.Xcurrent.XanDLt, uintptr(_nColUp))
109111  	Xsqlite3_result_blob(tls, _context, unsafe.Pointer(_p), int32(60), _stat4Destructor)
109112  }
109113  
109114  var _statInitØ00__func__Ø000 [9]int8
109115  
109116  func init() {
109117  	crt.Xstrncpy(nil, &_statInitØ00__func__Ø000[0], str(125236), 9)
109118  }
109119  
109120  // C comment
109121  //  /*
109122  //  ** CAPI3REF: Setting The Result Of An SQL Function
109123  //  ** METHOD: sqlite3_context
109124  //  **
109125  //  ** These routines are used by the xFunc or xFinal callbacks that
109126  //  ** implement SQL functions and aggregates.  See
109127  //  ** [sqlite3_create_function()] and [sqlite3_create_function16()]
109128  //  ** for additional information.
109129  //  **
109130  //  ** These functions work very much like the [parameter binding] family of
109131  //  ** functions used to bind values to host parameters in prepared statements.
109132  //  ** Refer to the [SQL parameter] documentation for additional information.
109133  //  **
109134  //  ** ^The sqlite3_result_blob() interface sets the result from
109135  //  ** an application-defined function to be the BLOB whose content is pointed
109136  //  ** to by the second parameter and which is N bytes long where N is the
109137  //  ** third parameter.
109138  //  **
109139  //  ** ^The sqlite3_result_zeroblob(C,N) and sqlite3_result_zeroblob64(C,N)
109140  //  ** interfaces set the result of the application-defined function to be
109141  //  ** a BLOB containing all zero bytes and N bytes in size.
109142  //  **
109143  //  ** ^The sqlite3_result_double() interface sets the result from
109144  //  ** an application-defined function to be a floating point value specified
109145  //  ** by its 2nd argument.
109146  //  **
109147  //  ** ^The sqlite3_result_error() and sqlite3_result_error16() functions
109148  //  ** cause the implemented SQL function to throw an exception.
109149  //  ** ^SQLite uses the string pointed to by the
109150  //  ** 2nd parameter of sqlite3_result_error() or sqlite3_result_error16()
109151  //  ** as the text of an error message.  ^SQLite interprets the error
109152  //  ** message string from sqlite3_result_error() as UTF-8. ^SQLite
109153  //  ** interprets the string from sqlite3_result_error16() as UTF-16 in native
109154  //  ** byte order.  ^If the third parameter to sqlite3_result_error()
109155  //  ** or sqlite3_result_error16() is negative then SQLite takes as the error
109156  //  ** message all text up through the first zero character.
109157  //  ** ^If the third parameter to sqlite3_result_error() or
109158  //  ** sqlite3_result_error16() is non-negative then SQLite takes that many
109159  //  ** bytes (not characters) from the 2nd parameter as the error message.
109160  //  ** ^The sqlite3_result_error() and sqlite3_result_error16()
109161  //  ** routines make a private copy of the error message text before
109162  //  ** they return.  Hence, the calling function can deallocate or
109163  //  ** modify the text after they return without harm.
109164  //  ** ^The sqlite3_result_error_code() function changes the error code
109165  //  ** returned by SQLite as a result of an error in a function.  ^By default,
109166  //  ** the error code is SQLITE_ERROR.  ^A subsequent call to sqlite3_result_error()
109167  //  ** or sqlite3_result_error16() resets the error code to SQLITE_ERROR.
109168  //  **
109169  //  ** ^The sqlite3_result_error_toobig() interface causes SQLite to throw an
109170  //  ** error indicating that a string or BLOB is too long to represent.
109171  //  **
109172  //  ** ^The sqlite3_result_error_nomem() interface causes SQLite to throw an
109173  //  ** error indicating that a memory allocation failed.
109174  //  **
109175  //  ** ^The sqlite3_result_int() interface sets the return value
109176  //  ** of the application-defined function to be the 32-bit signed integer
109177  //  ** value given in the 2nd argument.
109178  //  ** ^The sqlite3_result_int64() interface sets the return value
109179  //  ** of the application-defined function to be the 64-bit signed integer
109180  //  ** value given in the 2nd argument.
109181  //  **
109182  //  ** ^The sqlite3_result_null() interface sets the return value
109183  //  ** of the application-defined function to be NULL.
109184  //  **
109185  //  ** ^The sqlite3_result_text(), sqlite3_result_text16(),
109186  //  ** sqlite3_result_text16le(), and sqlite3_result_text16be() interfaces
109187  //  ** set the return value of the application-defined function to be
109188  //  ** a text string which is represented as UTF-8, UTF-16 native byte order,
109189  //  ** UTF-16 little endian, or UTF-16 big endian, respectively.
109190  //  ** ^The sqlite3_result_text64() interface sets the return value of an
109191  //  ** application-defined function to be a text string in an encoding
109192  //  ** specified by the fifth (and last) parameter, which must be one
109193  //  ** of [SQLITE_UTF8], [SQLITE_UTF16], [SQLITE_UTF16BE], or [SQLITE_UTF16LE].
109194  //  ** ^SQLite takes the text result from the application from
109195  //  ** the 2nd parameter of the sqlite3_result_text* interfaces.
109196  //  ** ^If the 3rd parameter to the sqlite3_result_text* interfaces
109197  //  ** is negative, then SQLite takes result text from the 2nd parameter
109198  //  ** through the first zero character.
109199  //  ** ^If the 3rd parameter to the sqlite3_result_text* interfaces
109200  //  ** is non-negative, then as many bytes (not characters) of the text
109201  //  ** pointed to by the 2nd parameter are taken as the application-defined
109202  //  ** function result.  If the 3rd parameter is non-negative, then it
109203  //  ** must be the byte offset into the string where the NUL terminator would
109204  //  ** appear if the string where NUL terminated.  If any NUL characters occur
109205  //  ** in the string at a byte offset that is less than the value of the 3rd
109206  //  ** parameter, then the resulting string will contain embedded NULs and the
109207  //  ** result of expressions operating on strings with embedded NULs is undefined.
109208  //  ** ^If the 4th parameter to the sqlite3_result_text* interfaces
109209  //  ** or sqlite3_result_blob is a non-NULL pointer, then SQLite calls that
109210  //  ** function as the destructor on the text or BLOB result when it has
109211  //  ** finished using that result.
109212  //  ** ^If the 4th parameter to the sqlite3_result_text* interfaces or to
109213  //  ** sqlite3_result_blob is the special constant SQLITE_STATIC, then SQLite
109214  //  ** assumes that the text or BLOB result is in constant space and does not
109215  //  ** copy the content of the parameter nor call a destructor on the content
109216  //  ** when it has finished using that result.
109217  //  ** ^If the 4th parameter to the sqlite3_result_text* interfaces
109218  //  ** or sqlite3_result_blob is the special constant SQLITE_TRANSIENT
109219  //  ** then SQLite makes a copy of the result into space obtained from
109220  //  ** from [sqlite3_malloc()] before it returns.
109221  //  **
109222  //  ** ^The sqlite3_result_value() interface sets the result of
109223  //  ** the application-defined function to be a copy of the
109224  //  ** [unprotected sqlite3_value] object specified by the 2nd parameter.  ^The
109225  //  ** sqlite3_result_value() interface makes a copy of the [sqlite3_value]
109226  //  ** so that the [sqlite3_value] specified in the parameter may change or
109227  //  ** be deallocated after sqlite3_result_value() returns without harm.
109228  //  ** ^A [protected sqlite3_value] object may always be used where an
109229  //  ** [unprotected sqlite3_value] object is required, so either
109230  //  ** kind of [sqlite3_value] object can be used with this interface.
109231  //  **
109232  //  ** If these routines are called from within the different thread
109233  //  ** than the one containing the application-defined function that received
109234  //  ** the [sqlite3_context] pointer, the results are undefined.
109235  //  */
109236  func Xsqlite3_result_blob(tls *crt.TLS, _pCtx *Xsqlite3_context, _z unsafe.Pointer, _n int32, _xDel func(*crt.TLS, unsafe.Pointer)) {
109237  	func() {
109238  		if _n < int32(0) {
109239  			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)))
109240  			crt.X__builtin_abort(tls)
109241  		}
109242  	}()
109243  	func() {
109244  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
109245  			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)))
109246  			crt.X__builtin_abort(tls)
109247  		}
109248  	}()
109249  	_setResultStrOrError(tls, _pCtx, (*int8)(_z), _n, 0, _xDel)
109250  }
109251  
109252  var _sqlite3_result_blobØ00__func__Ø000 [20]int8
109253  
109254  func init() {
109255  	crt.Xstrncpy(nil, &_sqlite3_result_blobØ00__func__Ø000[0], str(125250), 20)
109256  }
109257  
109258  // C comment
109259  //  /*
109260  //  ** Reclaim all memory of a Stat4Accum structure.
109261  //  */
109262  func _stat4Destructor(tls *crt.TLS, _pOld unsafe.Pointer) {
109263  	var _p *XStat4Accum
109264  	_p = (*XStat4Accum)(_pOld)
109265  	_sqlite3DbFree(tls, (*Xsqlite3)(_p.Xdb), unsafe.Pointer(_p))
109266  }
109267  
109268  var _statPushFuncdef XFuncDef
109269  
109270  func init() {
109271  	_statPushFuncdef = XFuncDef{XnArg: int8(2), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
109272  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
109273  	}{_statPush})), XzName: str(125270)}
109274  }
109275  
109276  // C comment
109277  //  /*
109278  //  ** Implementation of the stat_push SQL function:  stat_push(P,C,R)
109279  //  ** Arguments:
109280  //  **
109281  //  **    P     Pointer to the Stat4Accum object created by stat_init()
109282  //  **    C     Index of left-most column to differ from previous row
109283  //  **    R     Rowid for the current row.  Might be a key record for
109284  //  **          WITHOUT ROWID tables.
109285  //  **
109286  //  ** This SQL function always returns NULL.  It's purpose it to accumulate
109287  //  ** statistical data and/or samples in the Stat4Accum object about the
109288  //  ** index being analyzed.  The stat_get() SQL function will later be used to
109289  //  ** extract relevant information for constructing the sqlite_statN tables.
109290  //  **
109291  //  ** The R parameter is only used for STAT3 and STAT4
109292  //  */
109293  func _statPush(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
109294  	var _i, _iChng int32
109295  	var _p *XStat4Accum
109296  	_p = (*XStat4Accum)(Xsqlite3_value_blob(tls, *elem19(_argv, 0)))
109297  	_iChng = Xsqlite3_value_int(tls, *elem19(_argv, uintptr(1)))
109298  
109299  	func() {
109300  		if _p.XnCol <= int32(0) {
109301  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97657), unsafe.Pointer(&_statPushØ00__func__Ø000), unsafe.Pointer(str(125280)))
109302  			crt.X__builtin_abort(tls)
109303  		}
109304  	}()
109305  	func() {
109306  		if _iChng >= _p.XnCol {
109307  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97658), unsafe.Pointer(&_statPushØ00__func__Ø000), unsafe.Pointer(str(125290)))
109308  			crt.X__builtin_abort(tls)
109309  		}
109310  	}()
109311  	if _p.XnRow != (0) {
109312  		goto _4
109313  	}
109314  	_i = int32(0)
109315  _5:
109316  	if _i >= _p.XnCol {
109317  		goto _8
109318  	}
109319  	*elem7(_p.Xcurrent.XanEq, uintptr(_i)) = uint32(1)
109320  	_i += 1
109321  	goto _5
109322  _8:
109323  	goto _9
109324  _4:
109325  	_samplePushPrevious(tls, _p, _iChng)
109326  	_i = int32(0)
109327  _10:
109328  	if _i >= _iChng {
109329  		goto _13
109330  	}
109331  	*elem7(_p.Xcurrent.XanEq, uintptr(_i)) += 1
109332  	_i += 1
109333  	goto _10
109334  _13:
109335  	_i = _iChng
109336  _14:
109337  	if _i >= _p.XnCol {
109338  		goto _17
109339  	}
109340  	*elem7(_p.Xcurrent.XanDLt, uintptr(_i)) += 1
109341  	*elem7(_p.Xcurrent.XanEq, uintptr(_i)) = uint32(1)
109342  	_i += 1
109343  	goto _14
109344  _17:
109345  _9:
109346  	_p.XnRow += 1
109347  }
109348  
109349  var _statPushØ00__func__Ø000 [9]int8
109350  
109351  func init() {
109352  	crt.Xstrncpy(nil, &_statPushØ00__func__Ø000[0], str(125304), 9)
109353  }
109354  
109355  // C comment
109356  //  /*
109357  //  ** Field iChng of the index being scanned has changed. So at this point
109358  //  ** p->current contains a sample that reflects the previous row of the
109359  //  ** index. The value of anEq[iChng] and subsequent anEq[] elements are
109360  //  ** correct at this point.
109361  //  */
109362  func _samplePushPrevious(tls *crt.TLS, _p *XStat4Accum, _iChng int32) {
109363  }
109364  
109365  func _callStatGet(tls *crt.TLS, _v *TVdbe, _regStat4 int32, _iParam int32, _regOut int32) {
109366  	func() {
109367  		if _regOut == _regStat4 || _regOut == (_regStat4+int32(1)) {
109368  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97876), unsafe.Pointer(&_callStatGetØ00__func__Ø000), unsafe.Pointer(str(125313)))
109369  			crt.X__builtin_abort(tls)
109370  		}
109371  	}()
109372  	func() {
109373  		if _iParam != int32(0) {
109374  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97880), unsafe.Pointer(&_callStatGetØ00__func__Ø000), unsafe.Pointer(str(125352)))
109375  			crt.X__builtin_abort(tls)
109376  		}
109377  	}()
109378  	_sqlite3VdbeAddOp4(tls, _v, int32(69), int32(0), _regStat4, _regOut, (*int8)(unsafe.Pointer(&_statGetFuncdef)), int32(-4))
109379  	_sqlite3VdbeChangeP5(tls, _v, uint16(1))
109380  }
109381  
109382  var _callStatGetØ00__func__Ø000 [12]int8
109383  
109384  func init() {
109385  	crt.Xstrncpy(nil, &_callStatGetØ00__func__Ø000[0], str(125375), 12)
109386  }
109387  
109388  var _statGetFuncdef XFuncDef
109389  
109390  func init() {
109391  	_statGetFuncdef = XFuncDef{XnArg: int8(1), XfuncFlags: uint16(1), XxSFunc: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
109392  		f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
109393  	}{_statGet})), XzName: str(125387)}
109394  }
109395  
109396  // C comment
109397  //  /*
109398  //  ** Implementation of the stat_get(P,J) SQL function.  This routine is
109399  //  ** used to query statistical information that has been gathered into
109400  //  ** the Stat4Accum object by prior calls to stat_push().  The P parameter
109401  //  ** has type BLOB but it is really just a pointer to the Stat4Accum object.
109402  //  ** The content to returned is determined by the parameter J
109403  //  ** which is one of the STAT_GET_xxxx values defined above.
109404  //  **
109405  //  ** The stat_get(P,J) function is not available to generic SQL.  It is
109406  //  ** inserted as part of a manually constructed bytecode program.  (See
109407  //  ** the callStatGet() routine below.)  It is guaranteed that the P
109408  //  ** parameter will always be a poiner to a Stat4Accum object, never a
109409  //  ** NULL.
109410  //  **
109411  //  ** If neither STAT3 nor STAT4 are enabled, then J is always
109412  //  ** STAT_GET_STAT1 and is hence omitted and this routine becomes
109413  //  ** a one-parameter function, stat_get(P), that always returns the
109414  //  ** stat1 table entry information.
109415  //  */
109416  func _statGet(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
109417  	var _1_i int32
109418  	var _3_nDistinct, _3_iVal uint64
109419  	var _1_z, _1_zRet *int8
109420  	var _p *XStat4Accum
109421  	_p = (*XStat4Accum)(Xsqlite3_value_blob(tls, *elem19(_argv, 0)))
109422  	func() {
109423  		if _argc != int32(1) {
109424  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97765), unsafe.Pointer(&_statGetØ00__func__Ø000), unsafe.Pointer(str(125396)))
109425  			crt.X__builtin_abort(tls)
109426  		}
109427  	}()
109428  	_1_zRet = (*int8)(_sqlite3MallocZero(tls, uint64((_p.XnKeyCol+int32(1))*int32(25))))
109429  	if _1_zRet == nil {
109430  		Xsqlite3_result_error_nomem(tls, _context)
109431  		return
109432  	}
109433  	Xsqlite3_snprintf(tls, int32(24), _1_zRet, str(125404), uint64(_p.XnRow))
109434  	_1_z = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_zRet)) + uintptr(_sqlite3Strlen30(tls, _1_zRet))))
109435  	_1_i = int32(0)
109436  _3:
109437  	if _1_i >= _p.XnKeyCol {
109438  		goto _6
109439  	}
109440  	_3_nDistinct = uint64((*elem7(_p.Xcurrent.XanDLt, uintptr(_1_i))) + uint32(1))
109441  	_3_iVal = ((uint64(_p.XnRow) + _3_nDistinct) - uint64(1)) / _3_nDistinct
109442  	Xsqlite3_snprintf(tls, int32(24), _1_z, str(125409), _3_iVal)
109443  	*(*uintptr)(unsafe.Pointer(&_1_z)) += uintptr(_sqlite3Strlen30(tls, _1_z))
109444  	func() {
109445  		if (*elem7(_p.Xcurrent.XanEq, uintptr(_1_i))) == 0 {
109446  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97805), unsafe.Pointer(&_statGetØ00__func__Ø000), unsafe.Pointer(str(125415)))
109447  			crt.X__builtin_abort(tls)
109448  		}
109449  	}()
109450  	_1_i += 1
109451  	goto _3
109452  _6:
109453  	func() {
109454  		if int32(*elem1(_1_z, 0)) != int32(0) || crt.P2U(unsafe.Pointer(_1_z)) <= crt.P2U(unsafe.Pointer(_1_zRet)) {
109455  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(97807), unsafe.Pointer(&_statGetØ00__func__Ø000), unsafe.Pointer(str(125434)))
109456  			crt.X__builtin_abort(tls)
109457  		}
109458  	}()
109459  	Xsqlite3_result_text(tls, _context, _1_zRet, int32(-1), Xsqlite3_free)
109460  }
109461  
109462  var _statGetØ00__func__Ø000 [8]int8
109463  
109464  func init() {
109465  	crt.Xstrncpy(nil, &_statGetØ00__func__Ø000[0], str(125455), 8)
109466  }
109467  
109468  // C comment
109469  //  /*
109470  //  ** Generate code that will cause the most recent index analysis to
109471  //  ** be loaded into internal hash tables where is can be used.
109472  //  */
109473  func _loadAnalysis(tls *crt.TLS, _pParse *XParse, _iDb int32) {
109474  	var _v *TVdbe
109475  	_v = _sqlite3GetVdbe(tls, _pParse)
109476  	if _v != nil {
109477  		_sqlite3VdbeAddOp1(tls, _v, int32(140), _iDb)
109478  	}
109479  }
109480  
109481  // C comment
109482  //  /*
109483  //  ** Generate code that will do an analysis of a single table in
109484  //  ** a database.  If pOnlyIdx is not NULL then it is a single index
109485  //  ** in pTab that should be analyzed.
109486  //  */
109487  func _analyzeTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pOnlyIdx *XIndex) {
109488  	var _iDb, _iStatCur int32
109489  	func() {
109490  		if _pTab == nil {
109491  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98260), unsafe.Pointer(&_analyzeTableØ00__func__Ø000), unsafe.Pointer(str(43549)))
109492  			crt.X__builtin_abort(tls)
109493  		}
109494  	}()
109495  	func() {
109496  		if _sqlite3BtreeHoldsAllMutexes(tls, (*Xsqlite3)(_pParse.Xdb)) == 0 {
109497  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(98261), unsafe.Pointer(&_analyzeTableØ00__func__Ø000), unsafe.Pointer(str(124853)))
109498  			crt.X__builtin_abort(tls)
109499  		}
109500  	}()
109501  	_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), (*XSchema)(_pTab.XpSchema))
109502  	_sqlite3BeginWriteOperation(tls, _pParse, int32(0), _iDb)
109503  	_iStatCur = _pParse.XnTab
109504  	_pParse.XnTab += int32(3)
109505  	if _pOnlyIdx != nil {
109506  		_openStatTable(tls, _pParse, _iDb, _iStatCur, _pOnlyIdx.XzName, str(93743))
109507  		goto _5
109508  	}
109509  	_openStatTable(tls, _pParse, _iDb, _iStatCur, _pTab.XzName, str(93739))
109510  _5:
109511  	_analyzeOneTable(tls, _pParse, _pTab, _pOnlyIdx, _iStatCur, _pParse.XnMem+int32(1), _pParse.XnTab)
109512  	_loadAnalysis(tls, _pParse, _iDb)
109513  }
109514  
109515  var _analyzeTableØ00__func__Ø000 [13]int8
109516  
109517  func init() {
109518  	crt.Xstrncpy(nil, &_analyzeTableØ00__func__Ø000[0], str(125463), 13)
109519  }
109520  
109521  // C comment
109522  //  /*
109523  //  ** Generate code to implement the "ALTER TABLE xxx RENAME TO yyy"
109524  //  ** command.
109525  //  */
109526  func _sqlite3AlterRenameTable(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _pName *XToken) {
109527  	var _iDb, _nTabName, _savedDbFlags, _10_i int32
109528  	var _zDb, _zName, _zTabName, _zWhere *int8
109529  	var _db *Xsqlite3
109530  	var _pTab, _16_pFrom *XTable
109531  	var _v *TVdbe
109532  	var _pVTab *XVTable
109533  	var _15_p *XFKey
109534  	_zName = nil
109535  	_db = (*Xsqlite3)(_pParse.Xdb)
109536  	_zWhere = nil
109537  	_pVTab = nil
109538  	_savedDbFlags = _db.Xflags
109539  	if func() int32 {
109540  		if _db.XmallocFailed != 0 {
109541  			return func() int32 {
109542  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96518), unsafe.Pointer(&_sqlite3AlterRenameTableØ00__func__Ø000), unsafe.Pointer(str(4809)))
109543  				crt.X__builtin_abort(tls)
109544  				return int32(1)
109545  			}()
109546  		}
109547  		return int32(0)
109548  	}() != 0 {
109549  		goto _exit_rename_table
109550  	}
109551  	func() {
109552  		if _pSrc.XnSrc != int32(1) {
109553  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96519), unsafe.Pointer(&_sqlite3AlterRenameTableØ00__func__Ø000), unsafe.Pointer(str(125476)))
109554  			crt.X__builtin_abort(tls)
109555  		}
109556  	}()
109557  	func() {
109558  		if _sqlite3BtreeHoldsAllMutexes(tls, (*Xsqlite3)(_pParse.Xdb)) == 0 {
109559  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96520), unsafe.Pointer(&_sqlite3AlterRenameTableØ00__func__Ø000), unsafe.Pointer(str(124853)))
109560  			crt.X__builtin_abort(tls)
109561  		}
109562  	}()
109563  	_pTab = _sqlite3LocateTableItem(tls, _pParse, 0, elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), 0))
109564  	if _pTab == nil {
109565  		goto _exit_rename_table
109566  	}
109567  	_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), (*XSchema)(_pTab.XpSchema))
109568  	_zDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
109569  	_db.Xflags |= int32(2097152)
109570  	_zName = _sqlite3NameFromToken(tls, _db, _pName)
109571  	if _zName == nil {
109572  		goto _exit_rename_table
109573  	}
109574  	if (_sqlite3FindTable(tls, _db, _zName, _zDb) != nil) || (_sqlite3FindIndex(tls, _db, _zName, _zDb) != nil) {
109575  		_sqlite3ErrorMsg(tls, _pParse, str(125490), unsafe.Pointer(_zName))
109576  		goto _exit_rename_table
109577  	}
109578  	if int32(0) != _isSystemTable(tls, _pParse, _pTab.XzName) {
109579  		goto _exit_rename_table
109580  	}
109581  	if int32(0) != _sqlite3CheckObjectName(tls, _pParse, _zName) {
109582  		goto _exit_rename_table
109583  	}
109584  	if _pTab.XpSelect != nil {
109585  		_sqlite3ErrorMsg(tls, _pParse, str(125549), unsafe.Pointer(_pTab.XzName))
109586  		goto _exit_rename_table
109587  	}
109588  	if _sqlite3AuthCheck(tls, _pParse, int32(26), _zDb, _pTab.XzName, nil) != 0 {
109589  		goto _exit_rename_table
109590  	}
109591  	if _sqlite3ViewGetColumnNames(tls, _pParse, _pTab) != 0 {
109592  		goto _exit_rename_table
109593  	}
109594  	if _pTab.XnModuleArg == 0 {
109595  		goto _16
109596  	}
109597  	_pVTab = _sqlite3GetVTable(tls, _db, _pTab)
109598  	if func() func(*crt.TLS, *Xsqlite3_vtab, *int8) int32 {
109599  		v := (*Xsqlite3_module)((*Xsqlite3_vtab)(_pVTab.XpVtab).XpModule).XxRename
109600  		return *(*func(*crt.TLS, *Xsqlite3_vtab, *int8) int32)(unsafe.Pointer(&v))
109601  	}() == nil {
109602  		_pVTab = nil
109603  	}
109604  _16:
109605  	_v = _sqlite3GetVdbe(tls, _pParse)
109606  	if _v == nil {
109607  		goto _exit_rename_table
109608  	}
109609  	_sqlite3BeginWriteOperation(tls, _pParse, bool2int(_pVTab != nil), _iDb)
109610  	_sqlite3ChangeCookie(tls, _pParse, _iDb)
109611  	if _pVTab != nil {
109612  		_10_i = preInc2(&_pParse.XnMem, 1)
109613  		_sqlite3VdbeLoadString(tls, _v, _10_i, _zName)
109614  		_sqlite3VdbeAddOp4(tls, _v, int32(160), _10_i, int32(0), int32(0), (*int8)(unsafe.Pointer(_pVTab)), int32(-8))
109615  		_sqlite3MayAbort(tls, _pParse)
109616  	}
109617  	_zTabName = _pTab.XzName
109618  	_nTabName = _sqlite3Utf8CharLen(tls, _zTabName, int32(-1))
109619  	if (_db.Xflags & int32(524288)) == 0 {
109620  		goto _20
109621  	}
109622  	if store1(&_zWhere, _whereForeignKeys(tls, _pParse, _pTab)) != nil {
109623  		_sqlite3NestedParse(tls, _pParse, str(125576), unsafe.Pointer(_zDb), unsafe.Pointer(str(49981)), unsafe.Pointer(_zTabName), unsafe.Pointer(_zName), unsafe.Pointer(_zWhere))
109624  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zWhere))
109625  	}
109626  _20:
109627  	_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))
109628  	if _sqlite3FindTable(tls, _db, str(111523), _zDb) != nil {
109629  		_sqlite3NestedParse(tls, _pParse, str(126029), unsafe.Pointer(_zDb), unsafe.Pointer(_zName), unsafe.Pointer(_pTab.XzName))
109630  	}
109631  	if store1(&_zWhere, _whereTempTriggers(tls, _pParse, _pTab)) != nil {
109632  		_sqlite3NestedParse(tls, _pParse, str(126087), unsafe.Pointer(_zName), unsafe.Pointer(_zName), unsafe.Pointer(_zWhere))
109633  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zWhere))
109634  	}
109635  	if (_db.Xflags & int32(524288)) == 0 {
109636  		goto _24
109637  	}
109638  	_15_p = _sqlite3FkReferences(tls, _pTab)
109639  _25:
109640  	if _15_p == nil {
109641  		goto _28
109642  	}
109643  	_16_pFrom = (*XTable)(_15_p.XpFrom)
109644  	if _16_pFrom != _pTab {
109645  		_reloadTableSchema(tls, _pParse, (*XTable)(_15_p.XpFrom), _16_pFrom.XzName)
109646  	}
109647  	_15_p = (*XFKey)(_15_p.XpNextTo)
109648  	goto _25
109649  _28:
109650  _24:
109651  	_reloadTableSchema(tls, _pParse, _pTab, _zName)
109652  _exit_rename_table:
109653  	_sqlite3SrcListDelete(tls, _db, _pSrc)
109654  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zName))
109655  	_db.Xflags = _savedDbFlags
109656  }
109657  
109658  var _sqlite3AlterRenameTableØ00__func__Ø000 [24]int8
109659  
109660  func init() {
109661  	crt.Xstrncpy(nil, &_sqlite3AlterRenameTableØ00__func__Ø000[0], str(126179), 24)
109662  }
109663  
109664  // C comment
109665  //  /*
109666  //  ** Parameter zName is the name of a table that is about to be altered
109667  //  ** (either with ALTER TABLE ... RENAME TO or ALTER TABLE ... ADD COLUMN).
109668  //  ** If the table is a system table, this function leaves an error message
109669  //  ** in pParse->zErr (system tables may not be altered) and returns non-zero.
109670  //  **
109671  //  ** Or, if zName is not a system table, zero is returned.
109672  //  */
109673  func _isSystemTable(tls *crt.TLS, _pParse *XParse, _zName *int8) (r0 int32) {
109674  	if (_sqlite3Strlen30(tls, _zName) > int32(6)) && (int32(0) == Xsqlite3_strnicmp(tls, _zName, str(111672), int32(7))) {
109675  		_sqlite3ErrorMsg(tls, _pParse, str(126203), unsafe.Pointer(_zName))
109676  		return int32(1)
109677  	}
109678  	return int32(0)
109679  }
109680  
109681  // C comment
109682  //  /*
109683  //  ** Generate the text of a WHERE expression which can be used to select all
109684  //  ** tables that have foreign key constraints that refer to table pTab (i.e.
109685  //  ** constraints for which pTab is the parent table) from the sqlite_master
109686  //  ** table.
109687  //  */
109688  func _whereForeignKeys(tls *crt.TLS, _pParse *XParse, _pTab *XTable) (r0 *int8) {
109689  	var _zWhere *int8
109690  	var _p *XFKey
109691  	_zWhere = nil
109692  	_p = _sqlite3FkReferences(tls, _pTab)
109693  _0:
109694  	if _p == nil {
109695  		goto _3
109696  	}
109697  	_zWhere = _whereOrName(tls, (*Xsqlite3)(_pParse.Xdb), _zWhere, (*XTable)(_p.XpFrom).XzName)
109698  	_p = (*XFKey)(_p.XpNextTo)
109699  	goto _0
109700  _3:
109701  	return _zWhere
109702  }
109703  
109704  // C comment
109705  //  /*
109706  //  ** This function is used to create the text of expressions of the form:
109707  //  **
109708  //  **   name=<constant1> OR name=<constant2> OR ...
109709  //  **
109710  //  ** If argument zWhere is NULL, then a pointer string containing the text
109711  //  ** "name=<constant>" is returned, where <constant> is the quoted version
109712  //  ** of the string passed as argument zConstant. The returned buffer is
109713  //  ** allocated using sqlite3DbMalloc(). It is the responsibility of the
109714  //  ** caller to ensure that it is eventually freed.
109715  //  **
109716  //  ** If argument zWhere is not NULL, then the string returned is
109717  //  ** "<where> OR name=<constant>", where <where> is the contents of zWhere.
109718  //  ** In this case zWhere is passed to sqlite3DbFree() before returning.
109719  //  **
109720  //  */
109721  func _whereOrName(tls *crt.TLS, _db *Xsqlite3, _zWhere *int8, _zConstant *int8) (r0 *int8) {
109722  	var _zNew *int8
109723  	if _zWhere == nil {
109724  		_zNew = _sqlite3MPrintf(tls, _db, str(126231), unsafe.Pointer(_zConstant))
109725  		goto _1
109726  	}
109727  	_zNew = _sqlite3MPrintf(tls, _db, str(126239), unsafe.Pointer(_zWhere), unsafe.Pointer(_zConstant))
109728  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zWhere))
109729  _1:
109730  	return _zNew
109731  }
109732  
109733  // C comment
109734  //  /*
109735  //  ** Generate the text of a WHERE expression which can be used to select all
109736  //  ** temporary triggers on table pTab from the sqlite_temp_master table. If
109737  //  ** table pTab has no temporary triggers, or is itself stored in the
109738  //  ** temporary database, NULL is returned.
109739  //  */
109740  func _whereTempTriggers(tls *crt.TLS, _pParse *XParse, _pTab *XTable) (r0 *int8) {
109741  	var _zWhere, _4_zNew *int8
109742  	var _1_db *Xsqlite3
109743  	var _pTempSchema *XSchema
109744  	var _pTrig *XTrigger
109745  	_zWhere = nil
109746  	_pTempSchema = (*XSchema)(elem27((*XDb)((*Xsqlite3)(_pParse.Xdb).XaDb), uintptr(1)).XpSchema)
109747  	if (*XSchema)(_pTab.XpSchema) == _pTempSchema {
109748  		goto _0
109749  	}
109750  	_1_db = (*Xsqlite3)(_pParse.Xdb)
109751  	_pTrig = _sqlite3TriggerList(tls, _pParse, _pTab)
109752  _1:
109753  	if _pTrig == nil {
109754  		goto _4
109755  	}
109756  	if (*XSchema)(_pTrig.XpSchema) == _pTempSchema {
109757  		_zWhere = _whereOrName(tls, _1_db, _zWhere, _pTrig.XzName)
109758  	}
109759  	_pTrig = (*XTrigger)(_pTrig.XpNext)
109760  	goto _1
109761  _4:
109762  _0:
109763  	if _zWhere != nil {
109764  		_4_zNew = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.Xdb), str(126253), unsafe.Pointer(_zWhere))
109765  		_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.Xdb), unsafe.Pointer(_zWhere))
109766  		_zWhere = _4_zNew
109767  	}
109768  	return _zWhere
109769  }
109770  
109771  // C comment
109772  //  /*
109773  //  ** Generate code to drop and reload the internal representation of table
109774  //  ** pTab from the database, including triggers and temporary triggers.
109775  //  ** Argument zName is the name of the table in the database schema at
109776  //  ** the time the generated code is executed. This can be different from
109777  //  ** pTab->zName if this function is being called to code part of an
109778  //  ** "ALTER TABLE RENAME TO" statement.
109779  //  */
109780  func _reloadTableSchema(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _zName *int8) {
109781  	var _iDb, _1_iTrigDb int32
109782  	var _zWhere *int8
109783  	var _pTrig *XTrigger
109784  	var _v *TVdbe
109785  	_v = _sqlite3GetVdbe(tls, _pParse)
109786  	if func() int32 {
109787  		if _v == nil {
109788  			return func() int32 {
109789  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96446), unsafe.Pointer(&_reloadTableSchemaØ00__func__Ø000), unsafe.Pointer(str(4809)))
109790  				crt.X__builtin_abort(tls)
109791  				return int32(1)
109792  			}()
109793  		}
109794  		return int32(0)
109795  	}() != 0 {
109796  		return
109797  	}
109798  	func() {
109799  		if _sqlite3BtreeHoldsAllMutexes(tls, (*Xsqlite3)(_pParse.Xdb)) == 0 {
109800  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96447), unsafe.Pointer(&_reloadTableSchemaØ00__func__Ø000), unsafe.Pointer(str(124853)))
109801  			crt.X__builtin_abort(tls)
109802  		}
109803  	}()
109804  	_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), (*XSchema)(_pTab.XpSchema))
109805  	func() {
109806  		if _iDb < int32(0) {
109807  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96449), unsafe.Pointer(&_reloadTableSchemaØ00__func__Ø000), unsafe.Pointer(str(41995)))
109808  			crt.X__builtin_abort(tls)
109809  		}
109810  	}()
109811  	_pTrig = _sqlite3TriggerList(tls, _pParse, _pTab)
109812  _7:
109813  	if _pTrig == nil {
109814  		goto _10
109815  	}
109816  	_1_iTrigDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.Xdb), (*XSchema)(_pTrig.XpSchema))
109817  	func() {
109818  		if _1_iTrigDb != _iDb && _1_iTrigDb != int32(1) {
109819  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96455), unsafe.Pointer(&_reloadTableSchemaØ00__func__Ø000), unsafe.Pointer(str(126277)))
109820  			crt.X__builtin_abort(tls)
109821  		}
109822  	}()
109823  	_sqlite3VdbeAddOp4(tls, _v, int32(143), _1_iTrigDb, int32(0), int32(0), _pTrig.XzName, int32(0))
109824  	_pTrig = (*XTrigger)(_pTrig.XpNext)
109825  	goto _7
109826  _10:
109827  	_sqlite3VdbeAddOp4(tls, _v, int32(141), _iDb, int32(0), int32(0), _pTab.XzName, int32(0))
109828  	_zWhere = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.Xdb), str(126304), unsafe.Pointer(_zName))
109829  	if _zWhere == nil {
109830  		return
109831  	}
109832  	_sqlite3VdbeAddParseSchemaOp(tls, _v, _iDb, _zWhere)
109833  	if store1(&_zWhere, _whereTempTriggers(tls, _pParse, _pTab)) != nil {
109834  		_sqlite3VdbeAddParseSchemaOp(tls, _v, int32(1), _zWhere)
109835  	}
109836  }
109837  
109838  var _reloadTableSchemaØ00__func__Ø000 [18]int8
109839  
109840  func init() {
109841  	crt.Xstrncpy(nil, &_reloadTableSchemaØ00__func__Ø000[0], str(126316), 18)
109842  }
109843  
109844  // C comment
109845  //  /*
109846  //  ** This function is called after an "ALTER TABLE ... ADD" statement
109847  //  ** has been parsed. Argument pColDef contains the text of the new
109848  //  ** column definition.
109849  //  **
109850  //  ** The Table structure pParse->pNewTable was extended to include
109851  //  ** the new column during parsing.
109852  //  */
109853  func _sqlite3AlterFinishAddColumn(tls *crt.TLS, _pParse *XParse, _pColDef *XToken) {
109854  	var _iDb, _r1, _7_rc, _10_savedDbFlags int32
109855  	var _zDb, _zTab, _zCol, _10_zEnd *int8
109856  	var _db *Xsqlite3
109857  	var _pNew, _pTab *XTable
109858  	var _v *TVdbe
109859  	var _7_pVal *XMem
109860  	var _pDflt *XExpr
109861  	var _pCol *XColumn
109862  	_v = (*TVdbe)(_pParse.XpVdbe)
109863  	_db = (*Xsqlite3)(_pParse.Xdb)
109864  	if _pParse.XnErr != 0 || (_db.XmallocFailed != 0) {
109865  		return
109866  	}
109867  	func() {
109868  		if _v == nil {
109869  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96717), unsafe.Pointer(&_sqlite3AlterFinishAddColumnØ00__func__Ø000), unsafe.Pointer(str(42019)))
109870  			crt.X__builtin_abort(tls)
109871  		}
109872  	}()
109873  	_pNew = (*XTable)(_pParse.XpNewTable)
109874  	func() {
109875  		if _pNew == nil {
109876  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96719), unsafe.Pointer(&_sqlite3AlterFinishAddColumnØ00__func__Ø000), unsafe.Pointer(str(126334)))
109877  			crt.X__builtin_abort(tls)
109878  		}
109879  	}()
109880  	func() {
109881  		if _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
109882  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96721), unsafe.Pointer(&_sqlite3AlterFinishAddColumnØ00__func__Ø000), unsafe.Pointer(str(9376)))
109883  			crt.X__builtin_abort(tls)
109884  		}
109885  	}()
109886  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pNew.XpSchema))
109887  	_zDb = elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XzDbSName
109888  	_zTab = elem1(_pNew.XzName, uintptr(16))
109889  	_pCol = elem41((*XColumn)(_pNew.XaCol), uintptr(int32(_pNew.XnCol)-int32(1)))
109890  	_pDflt = (*XExpr)(_pCol.XpDflt)
109891  	_pTab = _sqlite3FindTable(tls, _db, _zTab, _zDb)
109892  	func() {
109893  		if _pTab == nil {
109894  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96728), unsafe.Pointer(&_sqlite3AlterFinishAddColumnØ00__func__Ø000), unsafe.Pointer(str(94269)))
109895  			crt.X__builtin_abort(tls)
109896  		}
109897  	}()
109898  	if _sqlite3AuthCheck(tls, _pParse, int32(26), _zDb, _pTab.XzName, nil) != 0 {
109899  		return
109900  	}
109901  	func() {
109902  		if _pDflt != nil && int32(_pDflt.Xop) != int32(162) {
109903  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96741), unsafe.Pointer(&_sqlite3AlterFinishAddColumnØ00__func__Ø000), unsafe.Pointer(str(126339)))
109904  			crt.X__builtin_abort(tls)
109905  		}
109906  	}()
109907  	if (_pDflt != nil) && (int32((*XExpr)(_pDflt.XpLeft).Xop) == int32(101)) {
109908  		_pDflt = nil
109909  	}
109910  	if (int32(_pCol.XcolFlags) & int32(1)) != 0 {
109911  		_sqlite3ErrorMsg(tls, _pParse, str(126370))
109912  		return
109913  	}
109914  	if _pNew.XpIndex != nil {
109915  		_sqlite3ErrorMsg(tls, _pParse, str(126402))
109916  		return
109917  	}
109918  	if ((_db.Xflags&int32(524288)) != 0 && (_pNew.XpFKey != nil)) && (_pDflt != nil) {
109919  		_sqlite3ErrorMsg(tls, _pParse, str(126429))
109920  		return
109921  	}
109922  	if (_pCol.XnotNull != 0) && (_pDflt == nil) {
109923  		_sqlite3ErrorMsg(tls, _pParse, str(126488))
109924  		return
109925  	}
109926  	if _pDflt == nil {
109927  		goto _23
109928  	}
109929  	_7_pVal = nil
109930  	_7_rc = _sqlite3ValueFromExpr(tls, _db, _pDflt, uint8(1), uint8(65), &_7_pVal)
109931  	func() {
109932  		if _7_rc != int32(0) && _7_rc != int32(7) {
109933  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96776), unsafe.Pointer(&_sqlite3AlterFinishAddColumnØ00__func__Ø000), unsafe.Pointer(str(5706)))
109934  			crt.X__builtin_abort(tls)
109935  		}
109936  	}()
109937  	if _7_rc != int32(0) {
109938  		func() {
109939  			if int32(_db.XmallocFailed) != int32(1) {
109940  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96778), unsafe.Pointer(&_sqlite3AlterFinishAddColumnØ00__func__Ø000), unsafe.Pointer(str(126541)))
109941  				crt.X__builtin_abort(tls)
109942  			}
109943  		}()
109944  		return
109945  	}
109946  	if _7_pVal == nil {
109947  		_sqlite3ErrorMsg(tls, _pParse, str(126563))
109948  		return
109949  	}
109950  	_sqlite3ValueFree(tls, _7_pVal)
109951  _23:
109952  	_zCol = _sqlite3DbStrNDup(tls, _db, _pColDef.Xz, uint64(_pColDef.Xn))
109953  	if _zCol == nil {
109954  		goto _31
109955  	}
109956  	_10_zEnd = elem1(_zCol, uintptr(_pColDef.Xn-uint32(1)))
109957  	_10_savedDbFlags = _db.Xflags
109958  _32:
109959  	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) {
109960  		*postInc1(&_10_zEnd, -1) = 0
109961  		goto _32
109962  	}
109963  	_db.Xflags |= int32(2097152)
109964  	_sqlite3NestedParse(tls, _pParse, str(126609), unsafe.Pointer(_zDb), unsafe.Pointer(str(49981)), _pNew.XaddColOffset, unsafe.Pointer(_zCol), _pNew.XaddColOffset+int32(1), unsafe.Pointer(_zTab))
109965  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zCol))
109966  	_db.Xflags = _10_savedDbFlags
109967  _31:
109968  	_r1 = _sqlite3GetTempReg(tls, _pParse)
109969  	_sqlite3VdbeAddOp3(tls, _v, int32(103), _iDb, _r1, int32(2))
109970  	_sqlite3VdbeUsesBtree(tls, _v, _iDb)
109971  	_sqlite3VdbeAddOp2(tls, _v, int32(73), _r1, int32(-2))
109972  	_sqlite3VdbeAddOp2(tls, _v, int32(46), _r1, _sqlite3VdbeCurrentAddr(tls, _v)+int32(2))
109973  	_sqlite3VdbeAddOp3(tls, _v, int32(104), _iDb, int32(2), int32(3))
109974  	_sqlite3ReleaseTempReg(tls, _pParse, _r1)
109975  	_reloadTableSchema(tls, _pParse, _pTab, _pTab.XzName)
109976  }
109977  
109978  var _sqlite3AlterFinishAddColumnØ00__func__Ø000 [28]int8
109979  
109980  func init() {
109981  	crt.Xstrncpy(nil, &_sqlite3AlterFinishAddColumnØ00__func__Ø000[0], str(126718), 28)
109982  }
109983  
109984  // C comment
109985  //  /*
109986  //  ** This function is called by the parser after the table-name in
109987  //  ** an "ALTER TABLE <table-name> ADD" statement is parsed. Argument
109988  //  ** pSrc is the full-name of the table being altered.
109989  //  **
109990  //  ** This routine makes a (partial) copy of the Table structure
109991  //  ** for the table being altered and sets Parse.pNewTable to point
109992  //  ** to it. Routines called by the parser as the column definition
109993  //  ** is parsed (i.e. sqlite3AddColumn()) add the new Column data to
109994  //  ** the copy. The copy of the Table structure is deleted by tokenize.c
109995  //  ** after parsing is finished.
109996  //  **
109997  //  ** Routine sqlite3AlterFinishAddColumn() will be called to complete
109998  //  ** coding the "ALTER TABLE ... ADD" statement.
109999  //  */
110000  func _sqlite3AlterBeginAddColumn(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList) {
110001  	var _iDb, _i, _nAlloc int32
110002  	var _db *Xsqlite3
110003  	var _pNew, _pTab *XTable
110004  	var _v *TVdbe
110005  	var _5_pCol *XColumn
110006  	_db = (*Xsqlite3)(_pParse.Xdb)
110007  	func() {
110008  		if (*XTable)(_pParse.XpNewTable) != nil {
110009  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96850), unsafe.Pointer(&_sqlite3AlterBeginAddColumnØ00__func__Ø000), unsafe.Pointer(str(24589)))
110010  			crt.X__builtin_abort(tls)
110011  		}
110012  	}()
110013  	func() {
110014  		if _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
110015  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96851), unsafe.Pointer(&_sqlite3AlterBeginAddColumnØ00__func__Ø000), unsafe.Pointer(str(9376)))
110016  			crt.X__builtin_abort(tls)
110017  		}
110018  	}()
110019  	if _db.XmallocFailed != 0 {
110020  		goto _exit_begin_add_column
110021  	}
110022  	_pTab = _sqlite3LocateTableItem(tls, _pParse, 0, elem6((*TSrcList_item)(unsafe.Pointer(&_pSrc.Xa)), 0))
110023  	if _pTab == nil {
110024  		goto _exit_begin_add_column
110025  	}
110026  	if _pTab.XnModuleArg != 0 {
110027  		_sqlite3ErrorMsg(tls, _pParse, str(126746))
110028  		goto _exit_begin_add_column
110029  	}
110030  	if _pTab.XpSelect != nil {
110031  		_sqlite3ErrorMsg(tls, _pParse, str(126780))
110032  		goto _exit_begin_add_column
110033  	}
110034  	if int32(0) != _isSystemTable(tls, _pParse, _pTab.XzName) {
110035  		goto _exit_begin_add_column
110036  	}
110037  	func() {
110038  		if _pTab.XaddColOffset <= int32(0) {
110039  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96872), unsafe.Pointer(&_sqlite3AlterBeginAddColumnØ00__func__Ø000), unsafe.Pointer(str(126810)))
110040  			crt.X__builtin_abort(tls)
110041  		}
110042  	}()
110043  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.XpSchema))
110044  	_pNew = (*XTable)(_sqlite3DbMallocZero(tls, _db, uint64(80)))
110045  	if _pNew == nil {
110046  		goto _exit_begin_add_column
110047  	}
110048  	*(**XTable)(unsafe.Pointer(&_pParse.XpNewTable)) = _pNew
110049  	_pNew.XnTabRef = uint32(1)
110050  	_pNew.XnCol = _pTab.XnCol
110051  	func() {
110052  		if int32(_pNew.XnCol) <= int32(0) {
110053  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96887), unsafe.Pointer(&_sqlite3AlterBeginAddColumnØ00__func__Ø000), unsafe.Pointer(str(126831)))
110054  			crt.X__builtin_abort(tls)
110055  		}
110056  	}()
110057  	_nAlloc = (((int32(_pNew.XnCol) - int32(1)) / int32(8)) * int32(8)) + int32(8)
110058  	func() {
110059  		if _nAlloc < int32(_pNew.XnCol) || (_nAlloc%int32(8)) != int32(0) || (_nAlloc-int32(_pNew.XnCol)) >= int32(8) {
110060  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96889), unsafe.Pointer(&_sqlite3AlterBeginAddColumnØ00__func__Ø000), unsafe.Pointer(str(126844)))
110061  			crt.X__builtin_abort(tls)
110062  		}
110063  	}()
110064  	*(**XColumn)(unsafe.Pointer(&_pNew.XaCol)) = (*XColumn)(_sqlite3DbMallocZero(tls, _db, uint64(uint32(16)*uint32(_nAlloc))))
110065  	_pNew.XzName = _sqlite3MPrintf(tls, _db, str(126901), unsafe.Pointer(_pTab.XzName))
110066  	if (_pNew.XaCol == nil) || (_pNew.XzName == nil) {
110067  		func() {
110068  			if _db.XmallocFailed == 0 {
110069  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(96893), unsafe.Pointer(&_sqlite3AlterBeginAddColumnØ00__func__Ø000), unsafe.Pointer(str(47803)))
110070  				crt.X__builtin_abort(tls)
110071  			}
110072  		}()
110073  		goto _exit_begin_add_column
110074  	}
110075  	crt.Xmemcpy(tls, _pNew.XaCol, _pTab.XaCol, uint32(16)*uint32(_pNew.XnCol))
110076  	_i = int32(0)
110077  _22:
110078  	if _i >= int32(_pNew.XnCol) {
110079  		goto _25
110080  	}
110081  	_5_pCol = elem41((*XColumn)(_pNew.XaCol), uintptr(_i))
110082  	_5_pCol.XzName = _sqlite3DbStrDup(tls, _db, _5_pCol.XzName)
110083  	_5_pCol.XzColl = nil
110084  	*(**XExpr)(unsafe.Pointer(&_5_pCol.XpDflt)) = nil
110085  	_i += 1
110086  	goto _22
110087  _25:
110088  	*(**XSchema)(unsafe.Pointer(&_pNew.XpSchema)) = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_iDb)).XpSchema)
110089  	_pNew.XaddColOffset = _pTab.XaddColOffset
110090  	_pNew.XnTabRef = uint32(1)
110091  	_sqlite3BeginWriteOperation(tls, _pParse, int32(0), _iDb)
110092  	_v = _sqlite3GetVdbe(tls, _pParse)
110093  	if _v == nil {
110094  		goto _exit_begin_add_column
110095  	}
110096  	_sqlite3ChangeCookie(tls, _pParse, _iDb)
110097  _exit_begin_add_column:
110098  	_sqlite3SrcListDelete(tls, _db, _pSrc)
110099  }
110100  
110101  var _sqlite3AlterBeginAddColumnØ00__func__Ø000 [27]int8
110102  
110103  func init() {
110104  	crt.Xstrncpy(nil, &_sqlite3AlterBeginAddColumnØ00__func__Ø000[0], str(126920), 27)
110105  }
110106  
110107  // C comment
110108  //  /*
110109  //  ** The parser calls this routine after the CREATE VIRTUAL TABLE statement
110110  //  ** has been completely parsed.
110111  //  */
110112  func _sqlite3VtabFinishParse(tls *crt.TLS, _pParse *XParse, _pEnd *XToken) {
110113  	var _1_iDb, _1_iReg int32
110114  	var _1_zStmt, _1_zWhere, _3_zName *int8
110115  	var _db *Xsqlite3
110116  	var _3_pSchema *XSchema
110117  	var _pTab, _3_pOld *XTable
110118  	var _1_v *TVdbe
110119  	_pTab = (*XTable)(_pParse.XpNewTable)
110120  	_db = (*Xsqlite3)(_pParse.Xdb)
110121  	if _pTab == nil {
110122  		return
110123  	}
110124  	_addArgumentToVtab(tls, _pParse)
110125  	_pParse.XsArg.Xz = nil
110126  	if _pTab.XnModuleArg < int32(1) {
110127  		return
110128  	}
110129  	if (_db.Xinit.Xbusy) != 0 {
110130  		goto _2
110131  	}
110132  	if _pEnd != nil {
110133  		_pParse.XsNameToken.Xn = uint32(int32(uintptr(unsafe.Pointer(_pEnd.Xz))-uintptr(unsafe.Pointer(_pParse.XsNameToken.Xz)))) + _pEnd.Xn
110134  	}
110135  	_1_zStmt = _sqlite3MPrintf(tls, _db, str(126947), unsafe.Pointer(&_pParse.XsNameToken))
110136  	_1_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.XpSchema))
110137  	_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)
110138  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_1_zStmt))
110139  	_1_v = _sqlite3GetVdbe(tls, _pParse)
110140  	_sqlite3ChangeCookie(tls, _pParse, _1_iDb)
110141  	_sqlite3VdbeAddOp0(tls, _1_v, int32(153))
110142  	_1_zWhere = _sqlite3MPrintf(tls, _db, str(127059), unsafe.Pointer(_pTab.XzName))
110143  	_sqlite3VdbeAddParseSchemaOp(tls, _1_v, _1_iDb, _1_zWhere)
110144  	_1_iReg = preInc2(&_pParse.XnMem, 1)
110145  	_sqlite3VdbeLoadString(tls, _1_v, _1_iReg, _pTab.XzName)
110146  	_sqlite3VdbeAddOp2(tls, _1_v, int32(156), _1_iDb, _1_iReg)
110147  	goto _4
110148  _2:
110149  	_3_pSchema = (*XSchema)(_pTab.XpSchema)
110150  	_3_zName = _pTab.XzName
110151  	func() {
110152  		if _sqlite3SchemaMutexHeld(tls, _db, int32(0), _3_pSchema) == 0 {
110153  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125440), unsafe.Pointer(&_sqlite3VtabFinishParseØ00__func__Ø000), unsafe.Pointer(str(127086)))
110154  			crt.X__builtin_abort(tls)
110155  		}
110156  	}()
110157  	_3_pOld = (*XTable)(_sqlite3HashInsert(tls, &_3_pSchema.XtblHash, _3_zName, unsafe.Pointer(_pTab)))
110158  	if _3_pOld != nil {
110159  		_sqlite3OomFault(tls, _db)
110160  		func() {
110161  			if _pTab != _3_pOld {
110162  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125444), unsafe.Pointer(&_sqlite3VtabFinishParseØ00__func__Ø000), unsafe.Pointer(str(127125)))
110163  				crt.X__builtin_abort(tls)
110164  			}
110165  		}()
110166  		return
110167  	}
110168  	*(**XTable)(unsafe.Pointer(&_pParse.XpNewTable)) = nil
110169  _4:
110170  }
110171  
110172  // C comment
110173  //  /*
110174  //  ** This routine takes the module argument that has been accumulating
110175  //  ** in pParse->zArg[] and appends it to the list of arguments on the
110176  //  ** virtual table currently under construction in pParse->pTable.
110177  //  */
110178  func _addArgumentToVtab(tls *crt.TLS, _pParse *XParse) {
110179  	var _1_n int32
110180  	var _1_z *int8
110181  	var _1_db *Xsqlite3
110182  	if ((_pParse.XsArg.Xz) != nil) && (_pParse.XpNewTable != nil) {
110183  		_1_z = _pParse.XsArg.Xz
110184  		_1_n = int32(_pParse.XsArg.Xn)
110185  		_1_db = (*Xsqlite3)(_pParse.Xdb)
110186  		_addModuleArgument(tls, _1_db, (*XTable)(_pParse.XpNewTable), _sqlite3DbStrNDup(tls, _1_db, _1_z, uint64(_1_n)))
110187  	}
110188  }
110189  
110190  var _sqlite3VtabFinishParseØ00__func__Ø000 [23]int8
110191  
110192  func init() {
110193  	crt.Xstrncpy(nil, &_sqlite3VtabFinishParseØ00__func__Ø000[0], str(127136), 23)
110194  }
110195  
110196  // C comment
110197  //  /*
110198  //  ** The parser calls this routine when it first sees a CREATE VIRTUAL TABLE
110199  //  ** statement.  The module name has been parsed, but the optional list
110200  //  ** of parameters that follow the module name are still pending.
110201  //  */
110202  func _sqlite3VtabBeginParse(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken, _pModuleName *XToken, _ifNotExists int32) {
110203  	var _iDb int32
110204  	var _db *Xsqlite3
110205  	var _pTable *XTable
110206  	_sqlite3StartTable(tls, _pParse, _pName1, _pName2, int32(0), int32(0), int32(1), _ifNotExists)
110207  	_pTable = (*XTable)(_pParse.XpNewTable)
110208  	if _pTable == nil {
110209  		return
110210  	}
110211  	func() {
110212  		if nil != (*XIndex)(_pTable.XpIndex) {
110213  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125323), unsafe.Pointer(&_sqlite3VtabBeginParseØ00__func__Ø000), unsafe.Pointer(str(127159)))
110214  			crt.X__builtin_abort(tls)
110215  		}
110216  	}()
110217  	_db = (*Xsqlite3)(_pParse.Xdb)
110218  	_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTable.XpSchema))
110219  	func() {
110220  		if _iDb < int32(0) {
110221  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125327), unsafe.Pointer(&_sqlite3VtabBeginParseØ00__func__Ø000), unsafe.Pointer(str(41995)))
110222  			crt.X__builtin_abort(tls)
110223  		}
110224  	}()
110225  	func() {
110226  		if _pTable.XnModuleArg != int32(0) {
110227  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125329), unsafe.Pointer(&_sqlite3VtabBeginParseØ00__func__Ø000), unsafe.Pointer(str(127177)))
110228  			crt.X__builtin_abort(tls)
110229  		}
110230  	}()
110231  	_addModuleArgument(tls, _db, _pTable, _sqlite3NameFromToken(tls, _db, _pModuleName))
110232  	_addModuleArgument(tls, _db, _pTable, nil)
110233  	_addModuleArgument(tls, _db, _pTable, _sqlite3DbStrDup(tls, _db, _pTable.XzName))
110234  	func() {
110235  		if ((_pParse.XsNameToken.Xz) != _pName2.Xz || _pName2.Xz == nil) && ((_pParse.XsNameToken.Xz) != _pName1.Xz || _pName2.Xz != nil) {
110236  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125333), unsafe.Pointer(&_sqlite3VtabBeginParseØ00__func__Ø000), unsafe.Pointer(str(127199)))
110237  			crt.X__builtin_abort(tls)
110238  		}
110239  	}()
110240  	_pParse.XsNameToken.Xn = uint32(int32(uintptr(unsafe.Pointer(elem1(_pModuleName.Xz, uintptr(_pModuleName.Xn)))) - uintptr(unsafe.Pointer(_pParse.XsNameToken.Xz))))
110241  	if _pTable.XazModuleArg != nil {
110242  		_sqlite3AuthCheck(tls, _pParse, int32(29), _pTable.XzName, *elem0(_pTable.XazModuleArg, 0), elem27((*XDb)((*Xsqlite3)(_pParse.Xdb).XaDb), uintptr(_iDb)).XzDbSName)
110243  	}
110244  }
110245  
110246  var _sqlite3VtabBeginParseØ00__func__Ø000 [22]int8
110247  
110248  func init() {
110249  	crt.Xstrncpy(nil, &_sqlite3VtabBeginParseØ00__func__Ø000[0], str(127302), 22)
110250  }
110251  
110252  // C comment
110253  //  /*
110254  //  ** The parser calls this routine when it sees the first token
110255  //  ** of an argument to the module name in a CREATE VIRTUAL TABLE statement.
110256  //  */
110257  func _sqlite3VtabArgInit(tls *crt.TLS, _pParse *XParse) {
110258  	_addArgumentToVtab(tls, _pParse)
110259  	_pParse.XsArg.Xz = nil
110260  	_pParse.XsArg.Xn = 0
110261  }
110262  
110263  // C comment
110264  //  /*
110265  //  ** The parser calls this routine for each token after the first token
110266  //  ** in an argument to the module name in a CREATE VIRTUAL TABLE statement.
110267  //  */
110268  func _sqlite3VtabArgExtend(tls *crt.TLS, _pParse *XParse, _p *XToken) {
110269  	var _pArg *XToken
110270  	_pArg = &_pParse.XsArg
110271  	if _pArg.Xz == nil {
110272  		_pArg.Xz = _p.Xz
110273  		_pArg.Xn = _p.Xn
110274  		goto _1
110275  	}
110276  	func() {
110277  		if crt.P2U(unsafe.Pointer(_pArg.Xz)) > crt.P2U(unsafe.Pointer(_p.Xz)) {
110278  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(125471), unsafe.Pointer(&_sqlite3VtabArgExtendØ00__func__Ø000), unsafe.Pointer(str(127324)))
110279  			crt.X__builtin_abort(tls)
110280  		}
110281  	}()
110282  	_pArg.Xn = uint32(int32(uintptr(unsafe.Pointer(elem1(_p.Xz, uintptr(_p.Xn)))) - uintptr(unsafe.Pointer(_pArg.Xz))))
110283  _1:
110284  }
110285  
110286  var _sqlite3VtabArgExtendØ00__func__Ø000 [21]int8
110287  
110288  func init() {
110289  	crt.Xstrncpy(nil, &_sqlite3VtabArgExtendØ00__func__Ø000[0], str(127340), 21)
110290  }
110291  
110292  // C comment
110293  //  /*
110294  //  ** This routine is invoked once per CTE by the parser while parsing a
110295  //  ** WITH clause.
110296  //  */
110297  func _sqlite3WithAdd(tls *crt.TLS, _pParse *XParse, _pWith *XWith, _pName *XToken, _pArglist *XExprList, _pQuery *XSelect) (r0 *XWith) {
110298  	var _1_i, _4_nByte int32
110299  	var _zName *int8
110300  	var _db *Xsqlite3
110301  	var _pNew *XWith
110302  	_db = (*Xsqlite3)(_pParse.Xdb)
110303  	_zName = _sqlite3NameFromToken(tls, (*Xsqlite3)(_pParse.Xdb), _pName)
110304  	if _zName == nil || _pWith == nil {
110305  		goto _1
110306  	}
110307  	_1_i = int32(0)
110308  _2:
110309  	if _1_i >= _pWith.XnCte {
110310  		goto _5
110311  	}
110312  	if _sqlite3StrICmp(tls, _zName, elem43((*TCte)(unsafe.Pointer(&_pWith.Xa)), uintptr(_1_i)).XzName) == int32(0) {
110313  		_sqlite3ErrorMsg(tls, _pParse, str(127361), unsafe.Pointer(_zName))
110314  	}
110315  	_1_i += 1
110316  	goto _2
110317  _5:
110318  _1:
110319  	if _pWith != nil {
110320  		_4_nByte = int32(uint32(24) + (uint32(16) * uint32(_pWith.XnCte)))
110321  		_pNew = (*XWith)(_sqlite3DbRealloc(tls, _db, unsafe.Pointer(_pWith), uint64(_4_nByte)))
110322  		goto _8
110323  	}
110324  	_pNew = (*XWith)(_sqlite3DbMallocZero(tls, _db, uint64(24)))
110325  _8:
110326  	func() {
110327  		if (_pNew == nil || _zName == nil) && _db.XmallocFailed == 0 {
110328  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(104109), unsafe.Pointer(&_sqlite3WithAddØ00__func__Ø000), unsafe.Pointer(str(127391)))
110329  			crt.X__builtin_abort(tls)
110330  		}
110331  	}()
110332  	if _db.XmallocFailed != 0 {
110333  		_sqlite3ExprListDelete(tls, _db, _pArglist)
110334  		_sqlite3SelectDelete(tls, _db, _pQuery)
110335  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zName))
110336  		_pNew = _pWith
110337  		goto _14
110338  	}
110339  	*(**XSelect)(unsafe.Pointer(&(elem43((*TCte)(unsafe.Pointer(&_pNew.Xa)), uintptr(_pNew.XnCte)).XpSelect))) = _pQuery
110340  	*(**XExprList)(unsafe.Pointer(&(elem43((*TCte)(unsafe.Pointer(&_pNew.Xa)), uintptr(_pNew.XnCte)).XpCols))) = _pArglist
110341  	elem43((*TCte)(unsafe.Pointer(&_pNew.Xa)), uintptr(_pNew.XnCte)).XzName = _zName
110342  	elem43((*TCte)(unsafe.Pointer(&_pNew.Xa)), uintptr(_pNew.XnCte)).XzCteErr = nil
110343  	_pNew.XnCte += 1
110344  _14:
110345  	return _pNew
110346  }
110347  
110348  var _sqlite3WithAddØ00__func__Ø000 [15]int8
110349  
110350  func init() {
110351  	crt.Xstrncpy(nil, &_sqlite3WithAddØ00__func__Ø000[0], str(127433), 15)
110352  }
110353  
110354  // C comment
110355  //  /*
110356  //  ** Find the appropriate action for a parser given the non-terminal
110357  //  ** look-ahead token iLookAhead.
110358  //  */
110359  func _yy_find_reduce_action(tls *crt.TLS, _stateno int32, _iLookAhead uint8) (r0 int32) {
110360  	var _i int32
110361  	func() {
110362  		if _stateno > int32(324) {
110363  			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)))
110364  			crt.X__builtin_abort(tls)
110365  		}
110366  	}()
110367  	_i = int32(*elem50((*int16)(unsafe.Pointer(&_yy_reduce_ofst)), uintptr(_stateno)))
110368  	func() {
110369  		if _i == int32(-174) {
110370  			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)))
110371  			crt.X__builtin_abort(tls)
110372  		}
110373  	}()
110374  	func() {
110375  		if int32(_iLookAhead) == int32(252) {
110376  			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)))
110377  			crt.X__builtin_abort(tls)
110378  		}
110379  	}()
110380  	_i += int32(_iLookAhead)
110381  	func() {
110382  		if _i < int32(0) || _i >= int32(1566) {
110383  			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)))
110384  			crt.X__builtin_abort(tls)
110385  		}
110386  	}()
110387  	func() {
110388  		if int32(*elem15((*uint8)(unsafe.Pointer(&_yy_lookahead)), uintptr(_i))) != int32(_iLookAhead) {
110389  			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)))
110390  			crt.X__builtin_abort(tls)
110391  		}
110392  	}()
110393  	return int32(*elem20((*uint16)(unsafe.Pointer(&_yy_action)), uintptr(_i)))
110394  }
110395  
110396  var _yy_find_reduce_actionØ00__func__Ø000 [22]int8
110397  
110398  func init() {
110399  	crt.Xstrncpy(nil, &_yy_find_reduce_actionØ00__func__Ø000[0], str(127549), 22)
110400  }
110401  
110402  var _yy_reduce_ofst [325]int16
110403  
110404  func init() {
110405  	_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)}
110406  }
110407  
110408  // C comment
110409  //  /*
110410  //  ** The following is executed when the parser accepts
110411  //  */
110412  func _yy_accept(tls *crt.TLS, _yypParser *XyyParser) {
110413  	var _pParse *XParse
110414  	_pParse = (*XParse)(_yypParser.XpParse)
110415  	if _yyTraceFILE != nil {
110416  		crt.Xfprintf(tls, _yyTraceFILE, str(127571), unsafe.Pointer(_yyTracePrompt))
110417  	}
110418  	func() {
110419  		if (*XyyStackEntry)(_yypParser.Xyytos) != (*XyyStackEntry)(unsafe.Pointer(&_yypParser.Xyystack)) {
110420  			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)))
110421  			crt.X__builtin_abort(tls)
110422  		}
110423  	}()
110424  	*(**XParse)(unsafe.Pointer(&_yypParser.XpParse)) = _pParse
110425  }
110426  
110427  var _yy_acceptØ00__func__Ø000 [10]int8
110428  
110429  func init() {
110430  	crt.Xstrncpy(nil, &_yy_acceptØ00__func__Ø000[0], str(127619), 10)
110431  }
110432  
110433  // C comment
110434  //  /*
110435  //  ** The following code executes when a syntax error first occurs.
110436  //  */
110437  func _yy_syntax_error(tls *crt.TLS, _yypParser *XyyParser, _yymajor int32, _yyminor XToken) {
110438  	var _pParse *XParse
110439  	_pParse = (*XParse)(_yypParser.XpParse)
110440  
110441  	func() {
110442  		if (*elem1(_yyminor.Xz, 0)) == 0 {
110443  			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)))
110444  			crt.X__builtin_abort(tls)
110445  		}
110446  	}()
110447  	_sqlite3ErrorMsg(tls, _pParse, str(27240), unsafe.Pointer(&_yyminor))
110448  	*(**XParse)(unsafe.Pointer(&_yypParser.XpParse)) = _pParse
110449  }
110450  
110451  var _yy_syntax_errorØ00__func__Ø000 [16]int8
110452  
110453  func init() {
110454  	crt.Xstrncpy(nil, &_yy_syntax_errorØ00__func__Ø000[0], str(127640), 16)
110455  }
110456  
110457  // C comment
110458  //  /*
110459  //  ** Clear all secondary memory allocations from the parser
110460  //  */
110461  func _sqlite3ParserFinalize(tls *crt.TLS, _p unsafe.Pointer) {
110462  	var _pParser *XyyParser
110463  	_pParser = (*XyyParser)(_p)
110464  _0:
110465  	if crt.P2U(_pParser.Xyytos) > crt.P2U(unsafe.Pointer(&_pParser.Xyystack)) {
110466  		_yy_pop_parser_stack(tls, _pParser)
110467  		goto _0
110468  	}
110469  }
110470  
110471  // C comment
110472  //  /*
110473  //  ** Enable or disable the shared pager and schema features.
110474  //  **
110475  //  ** This routine has no effect on existing database connections.
110476  //  ** The shared cache setting effects only future calls to
110477  //  ** sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2().
110478  //  */
110479  func Xsqlite3_enable_shared_cache(tls *crt.TLS, _enable int32) (r0 int32) {
110480  	_sqlite3Config.XsharedCacheEnabled = _enable
110481  	return int32(0)
110482  }
110483  
110484  // C comment
110485  //  /*
110486  //  ** Return the most recent error code generated by an SQLite routine. If NULL is
110487  //  ** passed to this function, we assume a malloc() failed during sqlite3_open().
110488  //  */
110489  func Xsqlite3_errcode(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
110490  	if (_db != nil) && (_sqlite3SafetyCheckSickOrOk(tls, _db) == 0) {
110491  		return _sqlite3MisuseError(tls, int32(142777))
110492  	}
110493  	if (_db == nil) || (_db.XmallocFailed != 0) {
110494  		return _sqlite3NomemError(tls, int32(142780))
110495  	}
110496  	return _db.XerrCode & _db.XerrMask
110497  }
110498  
110499  // C comment
110500  //  /*
110501  //  ** Return UTF-16 encoded English language explanation of the most recent
110502  //  ** error.
110503  //  */
110504  func Xsqlite3_errmsg16(tls *crt.TLS, _db *Xsqlite3) (r0 unsafe.Pointer) {
110505  	var _z unsafe.Pointer
110506  	if _db == nil {
110507  		return unsafe.Pointer(&_sqlite3_errmsg16Ø00outOfMemØ001)
110508  	}
110509  	if _sqlite3SafetyCheckSickOrOk(tls, _db) == 0 {
110510  		return unsafe.Pointer(&_sqlite3_errmsg16Ø00misuseØ002)
110511  	}
110512  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
110513  	if _db.XmallocFailed != 0 {
110514  		_z = unsafe.Pointer(&_sqlite3_errmsg16Ø00outOfMemØ001)
110515  		goto _3
110516  	}
110517  	_z = Xsqlite3_value_text16(tls, (*XMem)(_db.XpErr))
110518  	if _z == nil {
110519  		_sqlite3ErrorWithMsg(tls, _db, _db.XerrCode, _sqlite3ErrStr(tls, _db.XerrCode))
110520  		_z = Xsqlite3_value_text16(tls, (*XMem)(_db.XpErr))
110521  	}
110522  	_sqlite3OomClear(tls, _db)
110523  _3:
110524  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
110525  	return _z
110526  }
110527  
110528  var _sqlite3_errmsg16Ø00outOfMemØ001 [14]uint16
110529  
110530  func init() {
110531  	_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)}
110532  }
110533  
110534  var _sqlite3_errmsg16Ø00misuseØ002 [39]uint16
110535  
110536  func init() {
110537  	_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)}
110538  }
110539  
110540  // C comment
110541  //  /*
110542  //  ** Return TRUE (non-zero) of the statement supplied as an argument needs
110543  //  ** to be recompiled.  A statement needs to be recompiled whenever the
110544  //  ** execution environment changes in a way that would alter the program
110545  //  ** that sqlite3_prepare() generates.  For example, if new functions or
110546  //  ** collating sequences are registered or if an authorizer function is
110547  //  ** added or changed.
110548  //  */
110549  func Xsqlite3_expired(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
110550  	var _p *TVdbe
110551  	_p = (*TVdbe)(_pStmt)
110552  	return bool2int((_p == nil) || (((uint32(_p.Xexpired) << 31) >> 31) != 0))
110553  }
110554  
110555  // C comment
110556  //  /*
110557  //  ** This routine frees the space the sqlite3_get_table() malloced.
110558  //  */
110559  func Xsqlite3_free_table(tls *crt.TLS, _azResult **int8) {
110560  	var _1_i, _1_n int32
110561  	if _azResult == nil {
110562  		goto _0
110563  	}
110564  	*(*uintptr)(unsafe.Pointer(&_azResult)) += uintptr(4294967292)
110565  	func() {
110566  		if _azResult == nil {
110567  			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)))
110568  			crt.X__builtin_abort(tls)
110569  		}
110570  	}()
110571  	_1_n = int32(crt.P2U(unsafe.Pointer(*elem0(_azResult, 0))))
110572  	_1_i = int32(1)
110573  _3:
110574  	if _1_i >= _1_n {
110575  		goto _6
110576  	}
110577  	if (*elem0(_azResult, uintptr(_1_i))) != nil {
110578  		Xsqlite3_free(tls, unsafe.Pointer(*elem0(_azResult, uintptr(_1_i))))
110579  	}
110580  	_1_i += 1
110581  	goto _3
110582  _6:
110583  	Xsqlite3_free(tls, unsafe.Pointer(_azResult))
110584  _0:
110585  }
110586  
110587  var _sqlite3_free_tableØ00__func__Ø000 [19]int8
110588  
110589  func init() {
110590  	crt.Xstrncpy(nil, &_sqlite3_free_tableØ00__func__Ø000[0], str(127668), 19)
110591  }
110592  
110593  // C comment
110594  //  /*
110595  //  ** Test to see whether or not the database connection is in autocommit
110596  //  ** mode.  Return TRUE if it is and FALSE if not.  Autocommit mode is on
110597  //  ** by default.  Autocommit is disabled by a BEGIN statement and reenabled
110598  //  ** by the next COMMIT or ROLLBACK.
110599  //  */
110600  func Xsqlite3_get_autocommit(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
110601  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
110602  		_sqlite3MisuseError(tls, int32(143772))
110603  		return int32(0)
110604  	}
110605  	return int32(_db.XautoCommit)
110606  }
110607  
110608  // C comment
110609  //  /*
110610  //  ** Return the auxiliary data pointer, if any, for the iArg'th argument to
110611  //  ** the user-function defined by pCtx.
110612  //  **
110613  //  ** The left-most argument is 0.
110614  //  **
110615  //  ** Undocumented behavior:  If iArg is negative then access a cache of
110616  //  ** auxiliary data pointers that is available to all functions within a
110617  //  ** single prepared statement.  The iArg values must match.
110618  //  */
110619  func Xsqlite3_get_auxdata(tls *crt.TLS, _pCtx *Xsqlite3_context, _iArg int32) (r0 unsafe.Pointer) {
110620  	var _pAuxData *XAuxData
110621  	func() {
110622  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
110623  			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)))
110624  			crt.X__builtin_abort(tls)
110625  		}
110626  	}()
110627  	func() {
110628  		if (*TVdbe)(_pCtx.XpVdbe) == nil {
110629  			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)))
110630  			crt.X__builtin_abort(tls)
110631  		}
110632  	}()
110633  	_pAuxData = (*XAuxData)((*TVdbe)(_pCtx.XpVdbe).XpAuxData)
110634  _4:
110635  	if _pAuxData == nil {
110636  		goto _7
110637  	}
110638  	if (_pAuxData.XiAuxArg == _iArg) && ((_pAuxData.XiAuxOp == _pCtx.XiOp) || (_iArg < int32(0))) {
110639  		return _pAuxData.XpAux
110640  	}
110641  	_pAuxData = (*XAuxData)(_pAuxData.XpNextAux)
110642  	goto _4
110643  _7:
110644  	return nil
110645  }
110646  
110647  var _sqlite3_get_auxdataØ00__func__Ø000 [20]int8
110648  
110649  func init() {
110650  	crt.Xstrncpy(nil, &_sqlite3_get_auxdataØ00__func__Ø000[0], str(127702), 20)
110651  }
110652  
110653  // C comment
110654  //  /*
110655  //  ** Query the database.  But instead of invoking a callback for each row,
110656  //  ** malloc() for space to hold the result and return the entire results
110657  //  ** at the conclusion of the call.
110658  //  **
110659  //  ** The result that is written to ***pazResult is held in memory obtained
110660  //  ** from malloc().  But the caller cannot free this memory directly.
110661  //  ** Instead, the entire table should be passed to sqlite3_free_table() when
110662  //  ** the calling procedure is finished using it.
110663  //  */
110664  func Xsqlite3_get_table(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _pazResult ***int8, _pnRow *int32, _pnColumn *int32, _pzErrMsg **int8) (r0 int32) {
110665  	var _rc int32
110666  	var _6_azNew **int8
110667  	var _res XTabResult
110668  	if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_pazResult == nil) {
110669  		return _sqlite3MisuseError(tls, int32(122571))
110670  	}
110671  	*_pazResult = nil
110672  	if _pnColumn != nil {
110673  		*_pnColumn = int32(0)
110674  	}
110675  	if _pnRow != nil {
110676  		*_pnRow = int32(0)
110677  	}
110678  	if _pzErrMsg != nil {
110679  		*_pzErrMsg = nil
110680  	}
110681  	_res.XzErrMsg = nil
110682  	_res.XnRow = 0
110683  	_res.XnColumn = 0
110684  	_res.XnData = uint32(1)
110685  	_res.XnAlloc = uint32(20)
110686  	_res.Xrc = int32(0)
110687  	_res.XazResult = (**int8)(Xsqlite3_malloc64(tls, uint64(uint32(4)*_res.XnAlloc)))
110688  	if _res.XazResult == nil {
110689  		_db.XerrCode = int32(7)
110690  		return _sqlite3NomemError(tls, int32(122586))
110691  	}
110692  	*elem0(_res.XazResult, 0) = nil
110693  	_rc = Xsqlite3_exec(tls, _db, _zSql, _sqlite3_get_table_cb, unsafe.Pointer(&_res), _pzErrMsg)
110694  
110695  	*elem0(_res.XazResult, 0) = (*int8)(crt.U2P(uintptr(int32(_res.XnData))))
110696  	if (_rc & int32(255)) != int32(4) {
110697  		goto _6
110698  	}
110699  	Xsqlite3_free_table(tls, elem0(_res.XazResult, uintptr(1)))
110700  	if _res.XzErrMsg == nil {
110701  		goto _7
110702  	}
110703  	if _pzErrMsg != nil {
110704  		Xsqlite3_free(tls, unsafe.Pointer(*_pzErrMsg))
110705  		*_pzErrMsg = Xsqlite3_mprintf(tls, str(24531), unsafe.Pointer(_res.XzErrMsg))
110706  	}
110707  	Xsqlite3_free(tls, unsafe.Pointer(_res.XzErrMsg))
110708  _7:
110709  	_db.XerrCode = _res.Xrc
110710  	return _res.Xrc
110711  
110712  _6:
110713  	Xsqlite3_free(tls, unsafe.Pointer(_res.XzErrMsg))
110714  	if _rc != int32(0) {
110715  		Xsqlite3_free_table(tls, elem0(_res.XazResult, uintptr(1)))
110716  		return _rc
110717  	}
110718  	if _res.XnAlloc <= _res.XnData {
110719  		goto _10
110720  	}
110721  	_6_azNew = (**int8)(Xsqlite3_realloc64(tls, unsafe.Pointer(_res.XazResult), uint64(uint32(4)*_res.XnData)))
110722  	if _6_azNew == nil {
110723  		Xsqlite3_free_table(tls, elem0(_res.XazResult, uintptr(1)))
110724  		_db.XerrCode = int32(7)
110725  		return _sqlite3NomemError(tls, int32(122615))
110726  	}
110727  	_res.XazResult = _6_azNew
110728  _10:
110729  	*_pazResult = elem0(_res.XazResult, uintptr(1))
110730  	if _pnColumn != nil {
110731  		*_pnColumn = int32(_res.XnColumn)
110732  	}
110733  	if _pnRow != nil {
110734  		*_pnRow = int32(_res.XnRow)
110735  	}
110736  	return _rc
110737  }
110738  
110739  // C comment
110740  //  /*
110741  //  ** This routine is called once for each row in the result table.  Its job
110742  //  ** is to fill in the TabResult structure appropriately, allocating new
110743  //  ** memory as necessary.
110744  //  */
110745  func _sqlite3_get_table_cb(tls *crt.TLS, _pArg unsafe.Pointer, _nCol int32, _argv **int8, _colv **int8) (r0 int32) {
110746  	var _need, _i, _10_n int32
110747  	var _z *int8
110748  	var _3_azNew **int8
110749  	var _p *XTabResult
110750  	_p = (*XTabResult)(_pArg)
110751  	if (_p.XnRow == (0)) && (_argv != nil) {
110752  		_need = _nCol * int32(2)
110753  		goto _2
110754  	}
110755  	_need = _nCol
110756  _2:
110757  	if (_p.XnData + uint32(_need)) <= _p.XnAlloc {
110758  		goto _3
110759  	}
110760  	_p.XnAlloc = (_p.XnAlloc * uint32(2)) + uint32(_need)
110761  	_3_azNew = (**int8)(Xsqlite3_realloc64(tls, unsafe.Pointer(_p.XazResult), uint64(uint32(4)*_p.XnAlloc)))
110762  	if _3_azNew == nil {
110763  		goto _malloc_failed
110764  	}
110765  	_p.XazResult = _3_azNew
110766  _3:
110767  	if _p.XnRow != (0) {
110768  		goto _5
110769  	}
110770  	_p.XnColumn = uint32(_nCol)
110771  	_i = int32(0)
110772  _6:
110773  	if _i >= _nCol {
110774  		goto _9
110775  	}
110776  	_z = Xsqlite3_mprintf(tls, str(24531), unsafe.Pointer(*elem0(_colv, uintptr(_i))))
110777  	if _z == nil {
110778  		goto _malloc_failed
110779  	}
110780  	*elem0(_p.XazResult, uintptr(postInc23(&_p.XnData, uint32(1)))) = _z
110781  	_i += 1
110782  	goto _6
110783  _9:
110784  	goto _12
110785  _5:
110786  	if int32(_p.XnColumn) != _nCol {
110787  		Xsqlite3_free(tls, unsafe.Pointer(_p.XzErrMsg))
110788  		_p.XzErrMsg = Xsqlite3_mprintf(tls, str(127722))
110789  		_p.Xrc = int32(1)
110790  		return int32(1)
110791  	}
110792  _12:
110793  	if _argv == nil {
110794  		goto _13
110795  	}
110796  	_i = int32(0)
110797  _14:
110798  	if _i >= _nCol {
110799  		goto _17
110800  	}
110801  	if (*elem0(_argv, uintptr(_i))) == nil {
110802  		_z = nil
110803  		goto _19
110804  	}
110805  	_10_n = _sqlite3Strlen30(tls, *elem0(_argv, uintptr(_i))) + int32(1)
110806  	_z = (*int8)(Xsqlite3_malloc64(tls, uint64(_10_n)))
110807  	if _z == nil {
110808  		goto _malloc_failed
110809  	}
110810  	crt.Xmemcpy(tls, unsafe.Pointer(_z), unsafe.Pointer(*elem0(_argv, uintptr(_i))), uint32(_10_n))
110811  _19:
110812  	*elem0(_p.XazResult, uintptr(postInc23(&_p.XnData, uint32(1)))) = _z
110813  	_i += 1
110814  	goto _14
110815  _17:
110816  	_p.XnRow += 1
110817  _13:
110818  	return int32(0)
110819  
110820  _malloc_failed:
110821  	_p.Xrc = _sqlite3NomemError(tls, int32(122545))
110822  	return int32(1)
110823  }
110824  
110825  // C comment
110826  //  /*
110827  //  ** Cause any pending operation to stop at its earliest opportunity.
110828  //  */
110829  func Xsqlite3_interrupt(tls *crt.TLS, _db *Xsqlite3) {
110830  	if (_sqlite3SafetyCheckOk(tls, _db) == 0) && ((_db == nil) || (_db.Xmagic != uint32(1691352191))) {
110831  		_sqlite3MisuseError(tls, int32(142055))
110832  		return
110833  	}
110834  	*(*int32)(unsafe.Pointer(&_db.Xu1)) = int32(1)
110835  }
110836  
110837  // C comment
110838  //  /*
110839  //  ** Return the ROWID of the most recent insert
110840  //  */
110841  func Xsqlite3_last_insert_rowid(tls *crt.TLS, _db *Xsqlite3) (r0 int64) {
110842  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
110843  		_sqlite3MisuseError(tls, int32(141385))
110844  		return 0
110845  	}
110846  	return _db.XlastRowid
110847  }
110848  
110849  // C comment
110850  //  /*
110851  //  ** Open a new database handle.
110852  //  */
110853  func Xsqlite3_open(tls *crt.TLS, _zFilename *int8, _ppDb **Xsqlite3) (r0 int32) {
110854  	return _openDatabase(tls, _zFilename, _ppDb, uint32(6), nil)
110855  }
110856  
110857  // C comment
110858  //  /*
110859  //  ** This routine does the work of opening a database on behalf of
110860  //  ** sqlite3_open() and sqlite3_open16(). The database filename "zFilename"
110861  //  ** is UTF-8 encoded.
110862  //  */
110863  func _openDatabase(tls *crt.TLS, _zFilename *int8, _ppDb **Xsqlite3, _flags uint32, _zVfs *int8) (r0 int32) {
110864  	var _rc, _isThreadsafe int32
110865  	var _zOpen, _zErrMsg *int8
110866  	var _db *Xsqlite3
110867  	_zOpen = nil
110868  	_zErrMsg = nil
110869  	if _ppDb == nil {
110870  		return _sqlite3MisuseError(tls, int32(143267))
110871  	}
110872  	*_ppDb = nil
110873  	_rc = Xsqlite3_initialize(tls)
110874  	if _rc != 0 {
110875  		return _rc
110876  	}
110877  
110878  	if ((int32(1) << uint(int32(_flags&uint32(7)))) & int32(70)) == int32(0) {
110879  		return _sqlite3MisuseError(tls, int32(143292))
110880  	}
110881  	if _sqlite3Config.XbCoreMutex == int32(0) {
110882  		_isThreadsafe = int32(0)
110883  		goto _8
110884  	}
110885  	if (_flags & uint32(32768)) != 0 {
110886  		_isThreadsafe = int32(0)
110887  		goto _8
110888  	}
110889  	if (_flags & uint32(65536)) != 0 {
110890  		_isThreadsafe = int32(1)
110891  		goto _8
110892  	}
110893  	_isThreadsafe = _sqlite3Config.XbFullMutex
110894  _8:
110895  	if (_flags & uint32(262144)) != 0 {
110896  		_flags &= uint32(4294836223)
110897  		goto _11
110898  	}
110899  	if _sqlite3Config.XsharedCacheEnabled != 0 {
110900  		_flags |= uint32(131072)
110901  	}
110902  _11:
110903  	_flags &= uint32(4294312167)
110904  	_db = (*Xsqlite3)(_sqlite3MallocZero(tls, uint64(456)))
110905  	if _db == nil {
110906  		goto _opendb_out
110907  	}
110908  	if _isThreadsafe == 0 {
110909  		goto _13
110910  	}
110911  	*(**Xsqlite3_mutex)(unsafe.Pointer(&_db.Xmutex)) = _sqlite3MutexAlloc(tls, int32(1))
110912  	if (*Xsqlite3_mutex)(_db.Xmutex) == nil {
110913  		Xsqlite3_free(tls, unsafe.Pointer(_db))
110914  		_db = nil
110915  		goto _opendb_out
110916  	}
110917  _13:
110918  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
110919  	_db.XerrMask = int32(255)
110920  	_db.XnDb = int32(2)
110921  	_db.Xmagic = uint32(4030429446)
110922  	*(**XDb)(unsafe.Pointer(&_db.XaDb)) = (*XDb)(unsafe.Pointer(&_db.XaDbStatic))
110923  
110924  	crt.Xmemcpy(tls, unsafe.Pointer(&_db.XaLimit), unsafe.Pointer(&_aHardLimit), uint32(48))
110925  	*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), uintptr(11)) = int32(0)
110926  	_db.XautoCommit = uint8(1)
110927  	_db.XnextAutovac = int8(-1)
110928  	_db.XszMmap = _sqlite3Config.XszMmap
110929  	_db.XnextPagesize = int32(0)
110930  	_db.XnMaxSorterMmap = int32(2147483647)
110931  	_db.Xflags |= int32(17825888)
110932  	_sqlite3HashInit(tls, &_db.XaCollSeq)
110933  	_sqlite3HashInit(tls, &_db.XaModule)
110934  	_createCollation(tls, _db, (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(1), nil, _binCollFunc, nil)
110935  	_createCollation(tls, _db, (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(3), nil, _binCollFunc, nil)
110936  	_createCollation(tls, _db, (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(2), nil, _binCollFunc, nil)
110937  	_createCollation(tls, _db, str(103063), uint8(1), nil, _nocaseCollatingFunc, nil)
110938  	_createCollation(tls, _db, str(127787), uint8(1), crt.U2P(uintptr(uint32(1))), _binCollFunc, nil)
110939  	if _db.XmallocFailed != 0 {
110940  		goto _opendb_out
110941  	}
110942  	*(**XCollSeq)(unsafe.Pointer(&_db.XpDfltColl)) = _sqlite3FindCollSeq(tls, _db, uint8(1), (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)), int32(0))
110943  	func() {
110944  		if (*XCollSeq)(_db.XpDfltColl) == nil {
110945  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(143411), unsafe.Pointer(&_openDatabaseØ00__func__Ø000), unsafe.Pointer(str(127793)))
110946  			crt.X__builtin_abort(tls)
110947  		}
110948  	}()
110949  	_db.XopenFlags = _flags
110950  	_rc = _sqlite3ParseUri(tls, _zVfs, _zFilename, &_flags, (**Xsqlite3_vfs)(unsafe.Pointer(&_db.XpVfs)), &_zOpen, &_zErrMsg)
110951  	if _rc == int32(0) {
110952  		goto _18
110953  	}
110954  	if _rc == int32(7) {
110955  		_sqlite3OomFault(tls, _db)
110956  	}
110957  	_sqlite3ErrorWithMsg(tls, _db, _rc, func() *int8 {
110958  		if _zErrMsg != nil {
110959  			return str(24531)
110960  		}
110961  		return nil
110962  	}(), unsafe.Pointer(_zErrMsg))
110963  	Xsqlite3_free(tls, unsafe.Pointer(_zErrMsg))
110964  	goto _opendb_out
110965  _18:
110966  	_rc = _sqlite3BtreeOpen(tls, (*Xsqlite3_vfs)(_db.XpVfs), _zOpen, _db, (**XBtree)(unsafe.Pointer(&(elem27((*XDb)(_db.XaDb), 0).XpBt))), int32(0), int32(_flags|uint32(256)))
110967  	if _rc == int32(0) {
110968  		goto _22
110969  	}
110970  	if _rc == int32(3082) {
110971  		_rc = _sqlite3NomemError(tls, int32(143428))
110972  	}
110973  	_sqlite3Error(tls, _db, _rc)
110974  	goto _opendb_out
110975  _22:
110976  	_sqlite3BtreeEnter(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), 0).XpBt))
110977  	*(**XSchema)(unsafe.Pointer(&(elem27((*XDb)(_db.XaDb), 0).XpSchema))) = _sqlite3SchemaGet(tls, _db, (*XBtree)(elem27((*XDb)(_db.XaDb), 0).XpBt))
110978  	if _db.XmallocFailed == 0 {
110979  		_db.Xenc = (*XSchema)(elem27((*XDb)(_db.XaDb), 0).XpSchema).Xenc
110980  	}
110981  	_sqlite3BtreeLeave(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), 0).XpBt))
110982  	*(**XSchema)(unsafe.Pointer(&(elem27((*XDb)(_db.XaDb), uintptr(1)).XpSchema))) = _sqlite3SchemaGet(tls, _db, nil)
110983  	elem27((*XDb)(_db.XaDb), 0).XzDbSName = str(92534)
110984  	elem27((*XDb)(_db.XaDb), 0).Xsafety_level = uint8(3)
110985  	elem27((*XDb)(_db.XaDb), uintptr(1)).XzDbSName = str(23797)
110986  	elem27((*XDb)(_db.XaDb), uintptr(1)).Xsafety_level = uint8(1)
110987  	_db.Xmagic = uint32(2687084183)
110988  	if _db.XmallocFailed != 0 {
110989  		goto _opendb_out
110990  	}
110991  	_sqlite3Error(tls, _db, int32(0))
110992  	_sqlite3RegisterPerConnectionBuiltinFunctions(tls, _db)
110993  	_rc = Xsqlite3_errcode(tls, _db)
110994  	if _rc != int32(0) {
110995  		goto _26
110996  	}
110997  	_sqlite3AutoLoadExtensions(tls, _db)
110998  	_rc = Xsqlite3_errcode(tls, _db)
110999  	if _rc != int32(0) {
111000  		goto _opendb_out
111001  	}
111002  _26:
111003  	if _rc != 0 {
111004  		_sqlite3Error(tls, _db, _rc)
111005  	}
111006  	_setupLookaside(tls, _db, nil, _sqlite3Config.XszLookaside, _sqlite3Config.XnLookaside)
111007  	Xsqlite3_wal_autocheckpoint(tls, _db, int32(1000))
111008  _opendb_out:
111009  	if _db != nil {
111010  		func() {
111011  			if (*Xsqlite3_mutex)(_db.Xmutex) == nil && _isThreadsafe != int32(0) && _sqlite3Config.XbFullMutex != int32(0) {
111012  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(143544), unsafe.Pointer(&_openDatabaseØ00__func__Ø000), unsafe.Pointer(str(127810)))
111013  				crt.X__builtin_abort(tls)
111014  			}
111015  		}()
111016  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111017  	}
111018  	_rc = Xsqlite3_errcode(tls, _db)
111019  	func() {
111020  		if _db == nil && _rc != int32(7) {
111021  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(143549), unsafe.Pointer(&_openDatabaseØ00__func__Ø000), unsafe.Pointer(str(127879)))
111022  			crt.X__builtin_abort(tls)
111023  		}
111024  	}()
111025  	if _rc == int32(7) {
111026  		Xsqlite3_close(tls, _db)
111027  		_db = nil
111028  		goto _39
111029  	}
111030  	if _rc != int32(0) {
111031  		_db.Xmagic = uint32(1266094736)
111032  	}
111033  _39:
111034  	*_ppDb = _db
111035  	Xsqlite3_free(tls, unsafe.Pointer(_zOpen))
111036  	return _rc & int32(255)
111037  }
111038  
111039  // C comment
111040  //  /*
111041  //  ** This is the default collating function named "BINARY" which is always
111042  //  ** available.
111043  //  **
111044  //  ** If the padFlag argument is not NULL then space padding at the end
111045  //  ** of strings is ignored.  This implements the RTRIM collation.
111046  //  */
111047  func _binCollFunc(tls *crt.TLS, _padFlag unsafe.Pointer, _nKey1 int32, _pKey1 unsafe.Pointer, _nKey2 int32, _pKey2 unsafe.Pointer) (r0 int32) {
111048  	var _rc, _n int32
111049  	_n = func() int32 {
111050  		if _nKey1 < _nKey2 {
111051  			return _nKey1
111052  		}
111053  		return _nKey2
111054  	}()
111055  	_rc = crt.Xmemcmp(tls, _pKey1, _pKey2, uint32(_n))
111056  	if _rc != int32(0) {
111057  		goto _2
111058  	}
111059  	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 {
111060  		goto _6
111061  	}
111062  	_rc = _nKey1 - _nKey2
111063  _6:
111064  _2:
111065  	return _rc
111066  }
111067  
111068  // C comment
111069  //  /*
111070  //  ** Return true if the buffer z[0..n-1] contains all spaces.
111071  //  */
111072  func _allSpaces(tls *crt.TLS, _z *int8, _n int32) (r0 int32) {
111073  _0:
111074  	if (_n > int32(0)) && (int32(*elem1(_z, uintptr(_n-int32(1)))) == int32(32)) {
111075  		_n -= 1
111076  		goto _0
111077  	}
111078  	return bool2int(_n == int32(0))
111079  }
111080  
111081  // C comment
111082  //  /*
111083  //  ** Another built-in collating sequence: NOCASE.
111084  //  **
111085  //  ** This collating sequence is intended to be used for "case independent
111086  //  ** comparison". SQLite's knowledge of upper and lower case equivalents
111087  //  ** extends only to the 26 characters used in the English language.
111088  //  **
111089  //  ** At the moment there is only a UTF-8 implementation.
111090  //  */
111091  func _nocaseCollatingFunc(tls *crt.TLS, _NotUsed unsafe.Pointer, _nKey1 int32, _pKey1 unsafe.Pointer, _nKey2 int32, _pKey2 unsafe.Pointer) (r0 int32) {
111092  	var _r int32
111093  	_r = Xsqlite3_strnicmp(tls, (*int8)(_pKey1), (*int8)(_pKey2), func() int32 {
111094  		if _nKey1 < _nKey2 {
111095  			return _nKey1
111096  		}
111097  		return _nKey2
111098  	}())
111099  
111100  	if int32(0) == _r {
111101  		_r = _nKey1 - _nKey2
111102  	}
111103  	return _r
111104  }
111105  
111106  var _openDatabaseØ00__func__Ø000 [13]int8
111107  
111108  func init() {
111109  	crt.Xstrncpy(nil, &_openDatabaseØ00__func__Ø000[0], str(127905), 13)
111110  }
111111  
111112  // C comment
111113  //  /*
111114  //  ** This routine does per-connection function registration.  Most
111115  //  ** of the built-in functions above are part of the global function set.
111116  //  ** This routine only deals with those that are not global.
111117  //  */
111118  func _sqlite3RegisterPerConnectionBuiltinFunctions(tls *crt.TLS, _db *Xsqlite3) {
111119  	var _rc int32
111120  	_rc = Xsqlite3_overload_function(tls, _db, str(25231), int32(2))
111121  	func() {
111122  		if _rc != int32(7) && _rc != int32(0) {
111123  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107204), unsafe.Pointer(&_sqlite3RegisterPerConnectionBuiltinFunctionsØ00__func__Ø000), unsafe.Pointer(str(127918)))
111124  			crt.X__builtin_abort(tls)
111125  		}
111126  	}()
111127  	if _rc == int32(7) {
111128  		_sqlite3OomFault(tls, _db)
111129  	}
111130  }
111131  
111132  // C comment
111133  //  /*
111134  //  ** Declare that a function has been overloaded by a virtual table.
111135  //  **
111136  //  ** If the function already exists as a regular global function, then
111137  //  ** this routine is a no-op.  If the function does not exist, then create
111138  //  ** a new one that always throws a run-time error.
111139  //  **
111140  //  ** When virtual tables intend to provide an overloaded function, they
111141  //  ** should call this routine to make sure the global function exists.
111142  //  ** A global function must exist in order for name resolution to work
111143  //  ** properly.
111144  //  */
111145  func Xsqlite3_overload_function(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _nArg int32) (r0 int32) {
111146  	var _rc int32
111147  	_rc = int32(0)
111148  	if ((_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zName == nil)) || (_nArg < int32(-2)) {
111149  		return _sqlite3MisuseError(tls, int32(142274))
111150  	}
111151  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111152  	if _sqlite3FindFunction(tls, _db, _zName, _nArg, uint8(1), 0) == nil {
111153  		_rc = _sqlite3CreateFunc(tls, _db, _zName, _nArg, int32(1), nil, _sqlite3InvalidFunction, nil, nil, nil)
111154  	}
111155  	_rc = _sqlite3ApiExit(tls, _db, _rc)
111156  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111157  	return _rc
111158  }
111159  
111160  // C comment
111161  //  /*
111162  //  ** The following is the implementation of an SQL function that always
111163  //  ** fails with an error message stating that the function is used in the
111164  //  ** wrong context.  The sqlite3_overload_function() API might construct
111165  //  ** SQL function that use this routine so that the functions will exist
111166  //  ** for name resolution but are actually overloaded by the xFindFunction
111167  //  ** method of virtual tables.
111168  //  */
111169  func _sqlite3InvalidFunction(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
111170  	var _zName, _zErr *int8
111171  	_zName = (*XFuncDef)(_context.XpFunc).XzName
111172  	_ = _NotUsed2
111173  
111174  	_zErr = Xsqlite3_mprintf(tls, str(127952), unsafe.Pointer(_zName))
111175  	Xsqlite3_result_error(tls, _context, _zErr, int32(-1))
111176  	Xsqlite3_free(tls, unsafe.Pointer(_zErr))
111177  }
111178  
111179  var _sqlite3RegisterPerConnectionBuiltinFunctionsØ00__func__Ø000 [45]int8
111180  
111181  func init() {
111182  	crt.Xstrncpy(nil, &_sqlite3RegisterPerConnectionBuiltinFunctionsØ00__func__Ø000[0], str(128003), 45)
111183  }
111184  
111185  // C comment
111186  //  /*
111187  //  ** Load all automatic extensions.
111188  //  **
111189  //  ** If anything goes wrong, set an error in the database connection.
111190  //  */
111191  func _sqlite3AutoLoadExtensions(tls *crt.TLS, _db *Xsqlite3) {
111192  	var _go, _rc int32
111193  	var _i uint32
111194  	var _2_zErrmsg *int8
111195  	var _2_mutex *Xsqlite3_mutex
111196  	var _xInit func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32
111197  	var _2_pThunk *Xsqlite3_api_routines
111198  	_go = int32(1)
111199  	if _sqlite3Autoext.XnExt == (0) {
111200  		return
111201  	}
111202  	_i = 0
111203  _1:
111204  	if _go == 0 {
111205  		goto _4
111206  	}
111207  	_2_mutex = _sqlite3MutexAlloc(tls, int32(2))
111208  	_2_pThunk = &_sqlite3Apis
111209  	Xsqlite3_mutex_enter(tls, _2_mutex)
111210  	if _i >= _sqlite3Autoext.XnExt {
111211  		_xInit = nil
111212  		_go = int32(0)
111213  		goto _6
111214  	}
111215  	_xInit = func() func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32 {
111216  		v := *elem130(_sqlite3Autoext.XaExt, uintptr(_i))
111217  		return *(*func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32)(unsafe.Pointer(&v))
111218  	}()
111219  _6:
111220  	Xsqlite3_mutex_leave(tls, _2_mutex)
111221  	_2_zErrmsg = nil
111222  	if (_xInit != nil) && (store2(&_rc, _xInit(tls, _db, &_2_zErrmsg, _2_pThunk)) != int32(0)) {
111223  		_sqlite3ErrorWithMsg(tls, _db, _rc, str(128048), unsafe.Pointer(_2_zErrmsg))
111224  		_go = int32(0)
111225  	}
111226  	Xsqlite3_free(tls, unsafe.Pointer(_2_zErrmsg))
111227  	_i += 1
111228  	goto _1
111229  _4:
111230  }
111231  
111232  var _sqlite3Autoext Tsqlite3AutoExtList
111233  
111234  // C comment
111235  //  /*
111236  //  ** Set up the lookaside buffers for a database connection.
111237  //  ** Return SQLITE_OK on success.
111238  //  ** If lookaside is already active, return SQLITE_BUSY.
111239  //  **
111240  //  ** The sz parameter is the number of bytes in each lookaside slot.
111241  //  ** The cnt parameter is the number of slots.  If pStart is NULL the
111242  //  ** space for the lookaside memory is obtained from sqlite3_malloc().
111243  //  ** If pStart is not NULL then it is sz*cnt bytes of memory to use for
111244  //  ** the lookaside memory.
111245  //  */
111246  func _setupLookaside(tls *crt.TLS, _db *Xsqlite3, _pBuf unsafe.Pointer, _sz int32, _cnt int32) (r0 int32) {
111247  	var _6_i int32
111248  	var _pStart unsafe.Pointer
111249  	var _6_p *XScratchFreeslot
111250  	if (_db.Xlookaside.XnOut) != 0 {
111251  		return int32(5)
111252  	}
111253  	if (_db.Xlookaside.XbMalloced) != 0 {
111254  		Xsqlite3_free(tls, _db.Xlookaside.XpStart)
111255  	}
111256  	_sz = _sz & int32(-8)
111257  	if _sz <= int32(4) {
111258  		_sz = int32(0)
111259  	}
111260  	if _cnt < int32(0) {
111261  		_cnt = int32(0)
111262  	}
111263  	if (_sz == int32(0)) || (_cnt == int32(0)) {
111264  		_sz = int32(0)
111265  		_pStart = nil
111266  		goto _9
111267  	}
111268  	if _pBuf != nil {
111269  		goto _7
111270  	}
111271  	_sqlite3BeginBenignMalloc(tls)
111272  	_pStart = _sqlite3Malloc(tls, uint64(_sz*_cnt))
111273  	_sqlite3EndBenignMalloc(tls)
111274  	if _pStart != nil {
111275  		_cnt = _sqlite3MallocSize(tls, _pStart) / _sz
111276  	}
111277  	goto _9
111278  _7:
111279  	_pStart = _pBuf
111280  _9:
111281  	_db.Xlookaside.XpStart = _pStart
111282  	*(**XScratchFreeslot)(unsafe.Pointer(&(_db.Xlookaside.XpFree))) = nil
111283  	_db.Xlookaside.Xsz = uint16(_sz)
111284  	if _pStart == nil {
111285  		goto _10
111286  	}
111287  	func() {
111288  		if _sz <= int32(4) {
111289  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(141165), unsafe.Pointer(&_setupLookasideØ00__func__Ø000), unsafe.Pointer(str(128087)))
111290  			crt.X__builtin_abort(tls)
111291  		}
111292  	}()
111293  	_6_p = (*XScratchFreeslot)(_pStart)
111294  	_6_i = _cnt - int32(1)
111295  _13:
111296  	if _6_i < int32(0) {
111297  		goto _16
111298  	}
111299  	*(**XScratchFreeslot)(unsafe.Pointer(&_6_p.XpNext)) = (*XScratchFreeslot)(_db.Xlookaside.XpFree)
111300  	*(**XScratchFreeslot)(unsafe.Pointer(&(_db.Xlookaside.XpFree))) = _6_p
111301  	_6_p = (*XScratchFreeslot)(unsafe.Pointer(elem15((*uint8)(unsafe.Pointer(_6_p)), uintptr(_sz))))
111302  	_6_i -= 1
111303  	goto _13
111304  _16:
111305  	_db.Xlookaside.XpEnd = unsafe.Pointer(_6_p)
111306  	_db.Xlookaside.XbDisable = 0
111307  	_db.Xlookaside.XbMalloced = uint8(func() int32 {
111308  		if _pBuf == nil {
111309  			return int32(1)
111310  		}
111311  		return int32(0)
111312  	}())
111313  	goto _19
111314  _10:
111315  	_db.Xlookaside.XpStart = unsafe.Pointer(_db)
111316  	_db.Xlookaside.XpEnd = unsafe.Pointer(_db)
111317  	_db.Xlookaside.XbDisable = uint32(1)
111318  	_db.Xlookaside.XbMalloced = 0
111319  _19:
111320  	return int32(0)
111321  }
111322  
111323  var _setupLookasideØ00__func__Ø000 [15]int8
111324  
111325  func init() {
111326  	crt.Xstrncpy(nil, &_setupLookasideØ00__func__Ø000[0], str(128120), 15)
111327  }
111328  
111329  // C comment
111330  //  /*
111331  //  ** Open a new database handle.
111332  //  */
111333  func Xsqlite3_open16(tls *crt.TLS, _zFilename unsafe.Pointer, _ppDb **Xsqlite3) (r0 int32) {
111334  	var _rc int32
111335  	var _zFilename8 *int8
111336  	var _pVal *XMem
111337  	if _ppDb == nil {
111338  		return _sqlite3MisuseError(tls, int32(143617))
111339  	}
111340  	*_ppDb = nil
111341  	_rc = Xsqlite3_initialize(tls)
111342  	if _rc != 0 {
111343  		return _rc
111344  	}
111345  	if _zFilename == nil {
111346  		_zFilename = unsafe.Pointer(str(128135))
111347  	}
111348  	_pVal = _sqlite3ValueNew(tls, nil)
111349  	_sqlite3ValueSetStr(tls, _pVal, int32(-1), _zFilename, uint8(2), nil)
111350  	_zFilename8 = (*int8)(_sqlite3ValueText(tls, _pVal, uint8(1)))
111351  	if _zFilename8 == nil {
111352  		goto _3
111353  	}
111354  	_rc = _openDatabase(tls, _zFilename8, _ppDb, uint32(6), nil)
111355  	func() {
111356  		if (*_ppDb) == nil && _rc != int32(7) {
111357  			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)))
111358  			crt.X__builtin_abort(tls)
111359  		}
111360  	}()
111361  	if (_rc == int32(0)) && ((int32((*XSchema)(elem27((*XDb)((*_ppDb).XaDb), 0).XpSchema).XschemaFlags) & int32(1)) != int32(1)) {
111362  		(*XSchema)(elem27((*XDb)((*_ppDb).XaDb), 0).XpSchema).Xenc = store3(&((*_ppDb).Xenc), uint8(2))
111363  	}
111364  	goto _9
111365  _3:
111366  	_rc = _sqlite3NomemError(tls, int32(143636))
111367  _9:
111368  	_sqlite3ValueFree(tls, _pVal)
111369  	return _rc & int32(255)
111370  }
111371  
111372  var _sqlite3_open16Ø00__func__Ø000 [15]int8
111373  
111374  func init() {
111375  	crt.Xstrncpy(nil, &_sqlite3_open16Ø00__func__Ø000[0], str(128164), 15)
111376  }
111377  
111378  // C comment
111379  //  /*
111380  //  ** Two versions of the official API.  Legacy and new use.  In the legacy
111381  //  ** version, the original SQL text is not saved in the prepared statement
111382  //  ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
111383  //  ** sqlite3_step().  In the new version, the original SQL text is retained
111384  //  ** and the statement is automatically recompiled if an schema change
111385  //  ** occurs.
111386  //  */
111387  func Xsqlite3_prepare16(tls *crt.TLS, _db *Xsqlite3, _zSql unsafe.Pointer, _nBytes int32, _ppStmt *unsafe.Pointer, _pzTail *unsafe.Pointer) (r0 int32) {
111388  	var _rc int32
111389  	_rc = _sqlite3Prepare16(tls, _db, _zSql, _nBytes, int32(0), _ppStmt, _pzTail)
111390  	func() {
111391  		if _rc != int32(0) && _ppStmt != nil && (*_ppStmt) != nil {
111392  			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)))
111393  			crt.X__builtin_abort(tls)
111394  		}
111395  	}()
111396  	return _rc
111397  }
111398  
111399  // C comment
111400  //  /*
111401  //  ** Compile the UTF-16 encoded SQL statement zSql into a statement handle.
111402  //  */
111403  func _sqlite3Prepare16(tls *crt.TLS, _db *Xsqlite3, _zSql unsafe.Pointer, _nBytes int32, _saveSqlFlag int32, _ppStmt *unsafe.Pointer, _pzTail *unsafe.Pointer) (r0 int32) {
111404  	var _rc, _2_sz, _5_chars_parsed int32
111405  	var _zSql8, _zTail8, _2_z *int8
111406  	_zTail8 = nil
111407  	_rc = int32(0)
111408  	if _ppStmt == nil {
111409  		return _sqlite3MisuseError(tls, int32(116452))
111410  	}
111411  	*_ppStmt = nil
111412  	if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zSql == nil) {
111413  		return _sqlite3MisuseError(tls, int32(116456))
111414  	}
111415  	if _nBytes < int32(0) {
111416  		goto _3
111417  	}
111418  	_2_z = (*int8)(_zSql)
111419  	_2_sz = int32(0)
111420  _4:
111421  	if _2_sz >= _nBytes || int32(*elem1(_2_z, uintptr(_2_sz))) == int32(0) && int32(*elem1(_2_z, uintptr(_2_sz+int32(1)))) == int32(0) {
111422  		goto _9
111423  	}
111424  	_2_sz += int32(2)
111425  	goto _4
111426  _9:
111427  	_nBytes = _2_sz
111428  _3:
111429  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111430  	_zSql8 = _sqlite3Utf16to8(tls, _db, _zSql, _nBytes, uint8(2))
111431  	if _zSql8 != nil {
111432  		_rc = _sqlite3LockAndPrepare(tls, _db, _zSql8, int32(-1), _saveSqlFlag, nil, _ppStmt, &_zTail8)
111433  	}
111434  	if (_zTail8 != nil) && (_pzTail != nil) {
111435  		_5_chars_parsed = _sqlite3Utf8CharLen(tls, _zSql8, int32(uintptr(unsafe.Pointer(_zTail8))-uintptr(unsafe.Pointer(_zSql8))))
111436  		*_pzTail = unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_zSql) + uintptr(_sqlite3Utf16ByteLen(tls, _zSql, _5_chars_parsed)))))
111437  	}
111438  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zSql8))
111439  	_rc = _sqlite3ApiExit(tls, _db, _rc)
111440  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111441  	return _rc
111442  }
111443  
111444  // C comment
111445  //  /*
111446  //  ** zIn is a UTF-16 encoded unicode string at least nChar characters long.
111447  //  ** Return the number of bytes in the first nChar unicode characters
111448  //  ** in pZ.  nChar must be non-negative.
111449  //  */
111450  func _sqlite3Utf16ByteLen(tls *crt.TLS, _zIn unsafe.Pointer, _nChar int32) (r0 int32) {
111451  	var _c, _n, _4_c2, _8_c2 int32
111452  	var _z *uint8
111453  	_z = (*uint8)(_zIn)
111454  	_n = int32(0)
111455  	goto _0
111456  _0:
111457  _7:
111458  	if _n >= _nChar {
111459  		goto _8
111460  	}
111461  	_c = int32(*postInc15(&_z, 1))
111462  	_c += int32(*postInc15(&_z, 1)) << 8
111463  	if ((_c >= int32(55296)) && (_c < int32(57344))) && int32(1) != 0 {
111464  		_8_c2 = int32(*postInc15(&_z, 1))
111465  		_8_c2 += int32(*postInc15(&_z, 1)) << 8
111466  		_c = ((_8_c2 & int32(1023)) + ((_c & int32(63)) << 10)) + (((_c & int32(960)) + int32(64)) << 10)
111467  	}
111468  	_n += 1
111469  	goto _7
111470  _8:
111471  	return int32(uintptr(unsafe.Pointer(_z)) - uintptr(_zIn))
111472  
111473  	_ = _4_c2
111474  	panic(0)
111475  }
111476  
111477  var _sqlite3_prepare16Ø00__func__Ø000 [18]int8
111478  
111479  func init() {
111480  	crt.Xstrncpy(nil, &_sqlite3_prepare16Ø00__func__Ø000[0], str(128179), 18)
111481  }
111482  
111483  // C comment
111484  //  /*
111485  //  ** Register a profile function.  The pArg from the previously registered
111486  //  ** profile function is returned.
111487  //  **
111488  //  ** A NULL profile function means that no profiling is executes.  A non-NULL
111489  //  ** profile is a pointer to a function that is invoked at the conclusion of
111490  //  ** each SQL statement that is run.
111491  //  */
111492  func Xsqlite3_profile(tls *crt.TLS, _db *Xsqlite3, _xProfile func(*crt.TLS, unsafe.Pointer, *int8, uint64), _pArg unsafe.Pointer) (r0 unsafe.Pointer) {
111493  	var _pOld unsafe.Pointer
111494  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
111495  		_sqlite3MisuseError(tls, int32(142357))
111496  		return nil
111497  	}
111498  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111499  	_pOld = _db.XpProfileArg
111500  	_db.XxProfile = _xProfile
111501  	_db.XpProfileArg = _pArg
111502  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111503  	return _pOld
111504  }
111505  
111506  // C comment
111507  //  /*
111508  //  ** This routine sets the progress callback for an Sqlite database to the
111509  //  ** given callback function with the given argument. The progress callback will
111510  //  ** be invoked every nOps opcodes.
111511  //  */
111512  func Xsqlite3_progress_handler(tls *crt.TLS, _db *Xsqlite3, _nOps int32, _xProgress func(*crt.TLS, unsafe.Pointer) int32, _pArg unsafe.Pointer) {
111513  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
111514  		_sqlite3MisuseError(tls, int32(142013))
111515  		return
111516  	}
111517  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111518  	if _nOps > int32(0) {
111519  		_db.XxProgress = _xProgress
111520  		_db.XnProgressOps = uint32(_nOps)
111521  		_db.XpProgressArg = _pArg
111522  		goto _2
111523  	}
111524  	_db.XxProgress = nil
111525  	_db.XnProgressOps = 0
111526  	_db.XpProgressArg = nil
111527  _2:
111528  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111529  }
111530  
111531  // C comment
111532  //  /*
111533  //  ** The public interface to sqlite3Realloc.  Make sure that the memory
111534  //  ** subsystem is initialized prior to invoking sqliteRealloc.
111535  //  */
111536  func Xsqlite3_realloc(tls *crt.TLS, _pOld unsafe.Pointer, _n int32) (r0 unsafe.Pointer) {
111537  	if Xsqlite3_initialize(tls) != 0 {
111538  		return nil
111539  	}
111540  	if _n < int32(0) {
111541  		_n = int32(0)
111542  	}
111543  	return _sqlite3Realloc(tls, _pOld, uint64(_n))
111544  }
111545  
111546  func Xsqlite3_result_error16(tls *crt.TLS, _pCtx *Xsqlite3_context, _z unsafe.Pointer, _n int32) {
111547  	func() {
111548  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
111549  			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)))
111550  			crt.X__builtin_abort(tls)
111551  		}
111552  	}()
111553  	_pCtx.XisError = int32(1)
111554  	_pCtx.XfErrorOrAux = uint8(1)
111555  	_sqlite3VdbeMemSetStr(tls, (*XMem)(_pCtx.XpOut), (*int8)(_z), _n, uint8(2), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
111556  }
111557  
111558  var _sqlite3_result_error16Ø00__func__Ø000 [23]int8
111559  
111560  func init() {
111561  	crt.Xstrncpy(nil, &_sqlite3_result_error16Ø00__func__Ø000[0], str(128197), 23)
111562  }
111563  
111564  func Xsqlite3_result_int64(tls *crt.TLS, _pCtx *Xsqlite3_context, _iVal int64) {
111565  	func() {
111566  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
111567  			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)))
111568  			crt.X__builtin_abort(tls)
111569  		}
111570  	}()
111571  	_sqlite3VdbeMemSetInt64(tls, (*XMem)(_pCtx.XpOut), _iVal)
111572  }
111573  
111574  var _sqlite3_result_int64Ø00__func__Ø000 [21]int8
111575  
111576  func init() {
111577  	crt.Xstrncpy(nil, &_sqlite3_result_int64Ø00__func__Ø000[0], str(128220), 21)
111578  }
111579  
111580  func Xsqlite3_result_null(tls *crt.TLS, _pCtx *Xsqlite3_context) {
111581  	func() {
111582  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
111583  			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)))
111584  			crt.X__builtin_abort(tls)
111585  		}
111586  	}()
111587  	_sqlite3VdbeMemSetNull(tls, (*XMem)(_pCtx.XpOut))
111588  }
111589  
111590  var _sqlite3_result_nullØ00__func__Ø000 [20]int8
111591  
111592  func init() {
111593  	crt.Xstrncpy(nil, &_sqlite3_result_nullØ00__func__Ø000[0], str(128241), 20)
111594  }
111595  
111596  func Xsqlite3_result_text16(tls *crt.TLS, _pCtx *Xsqlite3_context, _z unsafe.Pointer, _n int32, _xDel func(*crt.TLS, unsafe.Pointer)) {
111597  	func() {
111598  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
111599  			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)))
111600  			crt.X__builtin_abort(tls)
111601  		}
111602  	}()
111603  	_setResultStrOrError(tls, _pCtx, (*int8)(_z), _n, uint8(2), _xDel)
111604  }
111605  
111606  var _sqlite3_result_text16Ø00__func__Ø000 [22]int8
111607  
111608  func init() {
111609  	crt.Xstrncpy(nil, &_sqlite3_result_text16Ø00__func__Ø000[0], str(128261), 22)
111610  }
111611  
111612  func Xsqlite3_result_text16be(tls *crt.TLS, _pCtx *Xsqlite3_context, _z unsafe.Pointer, _n int32, _xDel func(*crt.TLS, unsafe.Pointer)) {
111613  	func() {
111614  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
111615  			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)))
111616  			crt.X__builtin_abort(tls)
111617  		}
111618  	}()
111619  	_setResultStrOrError(tls, _pCtx, (*int8)(_z), _n, uint8(3), _xDel)
111620  }
111621  
111622  var _sqlite3_result_text16beØ00__func__Ø000 [24]int8
111623  
111624  func init() {
111625  	crt.Xstrncpy(nil, &_sqlite3_result_text16beØ00__func__Ø000[0], str(128283), 24)
111626  }
111627  
111628  func Xsqlite3_result_text16le(tls *crt.TLS, _pCtx *Xsqlite3_context, _z unsafe.Pointer, _n int32, _xDel func(*crt.TLS, unsafe.Pointer)) {
111629  	func() {
111630  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
111631  			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)))
111632  			crt.X__builtin_abort(tls)
111633  		}
111634  	}()
111635  	_setResultStrOrError(tls, _pCtx, (*int8)(_z), _n, uint8(2), _xDel)
111636  }
111637  
111638  var _sqlite3_result_text16leØ00__func__Ø000 [24]int8
111639  
111640  func init() {
111641  	crt.Xstrncpy(nil, &_sqlite3_result_text16leØ00__func__Ø000[0], str(128307), 24)
111642  }
111643  
111644  // C comment
111645  //  /*
111646  //  ** Register a callback to be invoked each time a transaction is rolled
111647  //  ** back by this database connection.
111648  //  */
111649  func Xsqlite3_rollback_hook(tls *crt.TLS, _db *Xsqlite3, _xCallback func(*crt.TLS, unsafe.Pointer), _pArg unsafe.Pointer) (r0 unsafe.Pointer) {
111650  	var _pRet unsafe.Pointer
111651  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
111652  		_sqlite3MisuseError(tls, int32(142435))
111653  		return nil
111654  	}
111655  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111656  	_pRet = _db.XpRollbackArg
111657  	_db.XxRollbackCallback = _xCallback
111658  	_db.XpRollbackArg = _pArg
111659  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111660  	return _pRet
111661  }
111662  
111663  // C comment
111664  //  /*
111665  //  ** Set or clear the access authorization function.
111666  //  **
111667  //  ** The access authorization function is be called during the compilation
111668  //  ** phase to verify that the user has read and/or write access permission on
111669  //  ** various fields of the database.  The first argument to the auth function
111670  //  ** is a copy of the 3rd argument to this routine.  The second argument
111671  //  ** to the auth function is one of these constants:
111672  //  **
111673  //  **       SQLITE_CREATE_INDEX
111674  //  **       SQLITE_CREATE_TABLE
111675  //  **       SQLITE_CREATE_TEMP_INDEX
111676  //  **       SQLITE_CREATE_TEMP_TABLE
111677  //  **       SQLITE_CREATE_TEMP_TRIGGER
111678  //  **       SQLITE_CREATE_TEMP_VIEW
111679  //  **       SQLITE_CREATE_TRIGGER
111680  //  **       SQLITE_CREATE_VIEW
111681  //  **       SQLITE_DELETE
111682  //  **       SQLITE_DROP_INDEX
111683  //  **       SQLITE_DROP_TABLE
111684  //  **       SQLITE_DROP_TEMP_INDEX
111685  //  **       SQLITE_DROP_TEMP_TABLE
111686  //  **       SQLITE_DROP_TEMP_TRIGGER
111687  //  **       SQLITE_DROP_TEMP_VIEW
111688  //  **       SQLITE_DROP_TRIGGER
111689  //  **       SQLITE_DROP_VIEW
111690  //  **       SQLITE_INSERT
111691  //  **       SQLITE_PRAGMA
111692  //  **       SQLITE_READ
111693  //  **       SQLITE_SELECT
111694  //  **       SQLITE_TRANSACTION
111695  //  **       SQLITE_UPDATE
111696  //  **
111697  //  ** The third and fourth arguments to the auth function are the name of
111698  //  ** the table and the column that are being accessed.  The auth function
111699  //  ** should return either SQLITE_OK, SQLITE_DENY, or SQLITE_IGNORE.  If
111700  //  ** SQLITE_OK is returned, it means that access is allowed.  SQLITE_DENY
111701  //  ** means that the SQL statement will never-run - the sqlite3_exec() call
111702  //  ** will return with an error.  SQLITE_IGNORE means that the SQL statement
111703  //  ** should run but attempts to read the specified column will return NULL
111704  //  ** and attempts to write the column will be ignored.
111705  //  **
111706  //  ** Setting the auth function to NULL disables this hook.  The default
111707  //  ** setting of the auth function is NULL.
111708  //  */
111709  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) {
111710  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
111711  		return _sqlite3MisuseError(tls, int32(99496))
111712  	}
111713  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111714  	_db.XxAuth = _xAuth
111715  	_db.XpAuthArg = _pArg
111716  	_sqlite3ExpirePreparedStatements(tls, _db)
111717  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111718  	return int32(0)
111719  }
111720  
111721  // C comment
111722  //  /*
111723  //  ** Set the auxiliary data pointer and delete function, for the iArg'th
111724  //  ** argument to the user-function defined by pCtx. Any previous value is
111725  //  ** deleted by calling the delete function specified when it was set.
111726  //  **
111727  //  ** The left-most argument is 0.
111728  //  **
111729  //  ** Undocumented behavior:  If iArg is negative then make the data available
111730  //  ** to all functions within the current prepared statement using iArg as an
111731  //  ** access code.
111732  //  */
111733  func Xsqlite3_set_auxdata(tls *crt.TLS, _pCtx *Xsqlite3_context, _iArg int32, _pAux unsafe.Pointer, _xDelete func(*crt.TLS, unsafe.Pointer)) {
111734  	var _pVdbe *TVdbe
111735  	var _pAuxData *XAuxData
111736  	_pVdbe = (*TVdbe)(_pCtx.XpVdbe)
111737  	func() {
111738  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
111739  			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)))
111740  			crt.X__builtin_abort(tls)
111741  		}
111742  	}()
111743  	func() {
111744  		if _pVdbe == nil {
111745  			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)))
111746  			crt.X__builtin_abort(tls)
111747  		}
111748  	}()
111749  	_pAuxData = (*XAuxData)(_pVdbe.XpAuxData)
111750  _4:
111751  	if _pAuxData == nil {
111752  		goto _7
111753  	}
111754  	if (_pAuxData.XiAuxArg == _iArg) && ((_pAuxData.XiAuxOp == _pCtx.XiOp) || (_iArg < int32(0))) {
111755  		goto _7
111756  	}
111757  	_pAuxData = (*XAuxData)(_pAuxData.XpNextAux)
111758  	goto _4
111759  _7:
111760  	if _pAuxData != nil {
111761  		goto _11
111762  	}
111763  	_pAuxData = (*XAuxData)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pVdbe.Xdb), uint64(20)))
111764  	if _pAuxData == nil {
111765  		goto _failed
111766  	}
111767  	_pAuxData.XiAuxOp = _pCtx.XiOp
111768  	_pAuxData.XiAuxArg = _iArg
111769  	*(**XAuxData)(unsafe.Pointer(&_pAuxData.XpNextAux)) = (*XAuxData)(_pVdbe.XpAuxData)
111770  	*(**XAuxData)(unsafe.Pointer(&_pVdbe.XpAuxData)) = _pAuxData
111771  	if int32(_pCtx.XfErrorOrAux) == int32(0) {
111772  		_pCtx.XisError = int32(0)
111773  		_pCtx.XfErrorOrAux = uint8(1)
111774  	}
111775  	goto _15
111776  _11:
111777  	if _pAuxData.XxDeleteAux != nil {
111778  		_pAuxData.XxDeleteAux(tls, _pAuxData.XpAux)
111779  	}
111780  _15:
111781  	_pAuxData.XpAux = _pAux
111782  	_pAuxData.XxDeleteAux = _xDelete
111783  	return
111784  _failed:
111785  	if _xDelete != nil {
111786  		_xDelete(tls, _pAux)
111787  	}
111788  }
111789  
111790  var _sqlite3_set_auxdataØ00__func__Ø000 [20]int8
111791  
111792  func init() {
111793  	crt.Xstrncpy(nil, &_sqlite3_set_auxdataØ00__func__Ø000[0], str(128331), 20)
111794  }
111795  
111796  // C comment
111797  //  /*
111798  //  ** Return meta information about a specific column of a database table.
111799  //  ** See comment in sqlite3.h (sqlite.h.in) for details.
111800  //  */
111801  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) {
111802  	var _rc, _iCol, _notnull, _primarykey, _autoinc int32
111803  	var _zErrMsg, _zDataType, _zCollSeq *int8
111804  	var _pTab *XTable
111805  	var _pCol *XColumn
111806  	_zErrMsg = nil
111807  	_pTab = nil
111808  	_pCol = nil
111809  	_iCol = int32(0)
111810  	_zDataType = nil
111811  	_zCollSeq = nil
111812  	_notnull = int32(0)
111813  	_primarykey = int32(0)
111814  	_autoinc = int32(0)
111815  	if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zTableName == nil) {
111816  		return _sqlite3MisuseError(tls, int32(143859))
111817  	}
111818  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111819  	_sqlite3BtreeEnterAll(tls, _db)
111820  	_rc = _sqlite3Init(tls, _db, &_zErrMsg)
111821  	if int32(0) != _rc {
111822  		goto _error_out
111823  	}
111824  	_pTab = _sqlite3FindTable(tls, _db, _zTableName, _zDbName)
111825  	if (_pTab == nil) || (_pTab.XpSelect != nil) {
111826  		_pTab = nil
111827  		goto _error_out
111828  	}
111829  	if _zColumnName == nil {
111830  		goto _6
111831  	}
111832  	_iCol = int32(0)
111833  _7:
111834  	if _iCol >= int32(_pTab.XnCol) {
111835  		goto _10
111836  	}
111837  	_pCol = elem41((*XColumn)(_pTab.XaCol), uintptr(_iCol))
111838  	if int32(0) == _sqlite3StrICmp(tls, _pCol.XzName, _zColumnName) {
111839  		goto _10
111840  	}
111841  	_iCol += 1
111842  	goto _7
111843  _10:
111844  	if _iCol != int32(_pTab.XnCol) {
111845  		goto _12
111846  	}
111847  	if ((_pTab.XtabFlags & uint32(32)) == (0)) && _sqlite3IsRowid(tls, _zColumnName) != 0 {
111848  		_iCol = int32(_pTab.XiPKey)
111849  		_pCol = func() *XColumn {
111850  			if _iCol >= int32(0) {
111851  				return elem41((*XColumn)(_pTab.XaCol), uintptr(_iCol))
111852  			}
111853  			return nil
111854  		}()
111855  		goto _17
111856  	}
111857  	_pTab = nil
111858  	goto _error_out
111859  _17:
111860  _12:
111861  _6:
111862  	if _pCol != nil {
111863  		_zDataType = _sqlite3ColumnType(tls, _pCol, nil)
111864  		_zCollSeq = _pCol.XzColl
111865  		_notnull = bool2int(int32(_pCol.XnotNull) != int32(0))
111866  		_primarykey = bool2int((int32(_pCol.XcolFlags) & int32(1)) != int32(0))
111867  		_autoinc = bool2int((int32(_pTab.XiPKey) == _iCol) && ((_pTab.XtabFlags & uint32(8)) != (0)))
111868  		goto _20
111869  	}
111870  	_zDataType = str(25747)
111871  	_primarykey = int32(1)
111872  _20:
111873  	if _zCollSeq == nil {
111874  		_zCollSeq = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
111875  	}
111876  _error_out:
111877  	_sqlite3BtreeLeaveAll(tls, _db)
111878  	if _pzDataType != nil {
111879  		*_pzDataType = _zDataType
111880  	}
111881  	if _pzCollSeq != nil {
111882  		*_pzCollSeq = _zCollSeq
111883  	}
111884  	if _pNotNull != nil {
111885  		*_pNotNull = _notnull
111886  	}
111887  	if _pPrimaryKey != nil {
111888  		*_pPrimaryKey = _primarykey
111889  	}
111890  	if _pAutoinc != nil {
111891  		*_pAutoinc = _autoinc
111892  	}
111893  	if (int32(0) == _rc) && (_pTab == nil) {
111894  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErrMsg))
111895  		_zErrMsg = _sqlite3MPrintf(tls, _db, str(128351), unsafe.Pointer(_zTableName), unsafe.Pointer(_zColumnName))
111896  		_rc = int32(1)
111897  	}
111898  	_sqlite3ErrorWithMsg(tls, _db, _rc, func() *int8 {
111899  		if _zErrMsg != nil {
111900  			return str(24531)
111901  		}
111902  		return nil
111903  	}(), unsafe.Pointer(_zErrMsg))
111904  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErrMsg))
111905  	_rc = _sqlite3ApiExit(tls, _db, _rc)
111906  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111907  	return _rc
111908  }
111909  
111910  // C comment
111911  //  /*
111912  //  ** This is a convenience routine that makes sure that all thread-specific
111913  //  ** data for this thread has been deallocated.
111914  //  **
111915  //  ** SQLite no longer uses thread-specific data so this routine is now a
111916  //  ** no-op.  It is retained for historical compatibility.
111917  //  */
111918  func Xsqlite3_thread_cleanup(tls *crt.TLS) {
111919  }
111920  
111921  // C comment
111922  //  /*
111923  //  ** Return the number of changes since the database handle was opened.
111924  //  */
111925  func Xsqlite3_total_changes(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
111926  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
111927  		_sqlite3MisuseError(tls, int32(141426))
111928  		return int32(0)
111929  	}
111930  	return _db.XnTotalChange
111931  }
111932  
111933  func Xsqlite3_trace(tls *crt.TLS, _db *Xsqlite3, _xTrace func(*crt.TLS, unsafe.Pointer, *int8), _pArg unsafe.Pointer) (r0 unsafe.Pointer) {
111934  	var _pOld unsafe.Pointer
111935  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
111936  		_sqlite3MisuseError(tls, int32(142302))
111937  		return nil
111938  	}
111939  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111940  	_pOld = _db.XpTraceArg
111941  	_db.XmTrace = uint8(func() int32 {
111942  		if _xTrace != nil {
111943  			return int32(128)
111944  		}
111945  		return int32(0)
111946  	}())
111947  	_db.XxTrace = func() func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32 {
111948  		v := _xTrace
111949  		return *(*func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&v))
111950  	}()
111951  	_db.XpTraceArg = _pArg
111952  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
111953  	return _pOld
111954  }
111955  
111956  // C comment
111957  //  /*
111958  //  ** Deprecated external interface.  Internal/core SQLite code
111959  //  ** should call sqlite3TransferBindings.
111960  //  **
111961  //  ** It is misuse to call this routine with statements from different
111962  //  ** database connections.  But as this is a deprecated interface, we
111963  //  ** will not bother to check for that condition.
111964  //  **
111965  //  ** If the two statements contain a different number of bindings, then
111966  //  ** an SQLITE_ERROR is returned.  Nothing else can go wrong, so otherwise
111967  //  ** SQLITE_OK is returned.
111968  //  */
111969  func Xsqlite3_transfer_bindings(tls *crt.TLS, _pFromStmt unsafe.Pointer, _pToStmt unsafe.Pointer) (r0 int32) {
111970  	var _pFrom, _pTo *TVdbe
111971  	_pFrom = (*TVdbe)(_pFromStmt)
111972  	_pTo = (*TVdbe)(_pToStmt)
111973  	if int32(_pFrom.XnVar) != int32(_pTo.XnVar) {
111974  		return int32(1)
111975  	}
111976  	func() {
111977  		if ((uint32(_pTo.Xexpired>>9)<<31)>>31) == 0 && _pTo.Xexpmask != (0) {
111978  			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)))
111979  			crt.X__builtin_abort(tls)
111980  		}
111981  	}()
111982  	if _pTo.Xexpmask != 0 {
111983  		storebits26(&_pTo.Xexpired, int16(1), 1, 0)
111984  	}
111985  	func() {
111986  		if ((uint32(_pFrom.Xexpired>>9)<<31)>>31) == 0 && _pFrom.Xexpmask != (0) {
111987  			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)))
111988  			crt.X__builtin_abort(tls)
111989  		}
111990  	}()
111991  	if _pFrom.Xexpmask != 0 {
111992  		storebits26(&_pFrom.Xexpired, int16(1), 1, 0)
111993  	}
111994  	return _sqlite3TransferBindings(tls, _pFromStmt, _pToStmt)
111995  }
111996  
111997  var _sqlite3_transfer_bindingsØ00__func__Ø000 [26]int8
111998  
111999  func init() {
112000  	crt.Xstrncpy(nil, &_sqlite3_transfer_bindingsØ00__func__Ø000[0], str(128455), 26)
112001  }
112002  
112003  // C comment
112004  //  /*
112005  //  ** Register a callback to be invoked each time a row is updated,
112006  //  ** inserted or deleted using this database connection.
112007  //  */
112008  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) {
112009  	var _pRet unsafe.Pointer
112010  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
112011  		_sqlite3MisuseError(tls, int32(142410))
112012  		return nil
112013  	}
112014  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
112015  	_pRet = _db.XpUpdateArg
112016  	_db.XxUpdateCallback = _xCallback
112017  	_db.XpUpdateArg = _pArg
112018  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
112019  	return _pRet
112020  }
112021  
112022  // C comment
112023  //  /*
112024  //  ** Try to convert the type of a function argument or a result column
112025  //  ** into a numeric representation.  Use either INTEGER or REAL whichever
112026  //  ** is appropriate.  But only do the conversion if it is possible without
112027  //  ** loss of information and return the revised type of the argument.
112028  //  */
112029  func Xsqlite3_value_numeric_type(tls *crt.TLS, _pVal *XMem) (r0 int32) {
112030  	var _eType int32
112031  	var _1_pMem *XMem
112032  	_eType = Xsqlite3_value_type(tls, _pVal)
112033  	if _eType == int32(3) {
112034  		_1_pMem = _pVal
112035  		_applyNumericAffinity(tls, _1_pMem, int32(0))
112036  		_eType = Xsqlite3_value_type(tls, _pVal)
112037  	}
112038  	return _eType
112039  }
112040  
112041  func Xsqlite3_value_text16be(tls *crt.TLS, _pVal *XMem) (r0 unsafe.Pointer) {
112042  	return _sqlite3ValueText(tls, _pVal, uint8(3))
112043  }
112044  
112045  func Xsqlite3_value_text16le(tls *crt.TLS, _pVal *XMem) (r0 unsafe.Pointer) {
112046  	return _sqlite3ValueText(tls, _pVal, uint8(2))
112047  }
112048  
112049  func Xsqlite3_prepare16_v2(tls *crt.TLS, _db *Xsqlite3, _zSql unsafe.Pointer, _nBytes int32, _ppStmt *unsafe.Pointer, _pzTail *unsafe.Pointer) (r0 int32) {
112050  	var _rc int32
112051  	_rc = _sqlite3Prepare16(tls, _db, _zSql, _nBytes, int32(1), _ppStmt, _pzTail)
112052  	func() {
112053  		if _rc != int32(0) && _ppStmt != nil && (*_ppStmt) != nil {
112054  			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)))
112055  			crt.X__builtin_abort(tls)
112056  		}
112057  	}()
112058  	return _rc
112059  }
112060  
112061  var _sqlite3_prepare16_v2Ø00__func__Ø000 [21]int8
112062  
112063  func init() {
112064  	crt.Xstrncpy(nil, &_sqlite3_prepare16_v2Ø00__func__Ø000[0], str(128481), 21)
112065  }
112066  
112067  // C comment
112068  //  /*
112069  //  ** Set all the parameters in the compiled SQL statement to NULL.
112070  //  */
112071  func Xsqlite3_clear_bindings(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
112072  	var _i, _rc int32
112073  	var _mutex *Xsqlite3_mutex
112074  	var _p *TVdbe
112075  	_rc = int32(0)
112076  	_p = (*TVdbe)(_pStmt)
112077  	_mutex = (*Xsqlite3_mutex)((*Xsqlite3)((*TVdbe)(_pStmt).Xdb).Xmutex)
112078  	Xsqlite3_mutex_enter(tls, _mutex)
112079  	_i = int32(0)
112080  _0:
112081  	if _i >= int32(_p.XnVar) {
112082  		goto _3
112083  	}
112084  	_sqlite3VdbeMemRelease(tls, elem25((*XMem)(_p.XaVar), uintptr(_i)))
112085  	elem25((*XMem)(_p.XaVar), uintptr(_i)).Xflags = uint16(1)
112086  	_i += 1
112087  	goto _0
112088  _3:
112089  	func() {
112090  		if ((uint32(_p.Xexpired>>9)<<31)>>31) == 0 && _p.Xexpmask != (0) {
112091  			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)))
112092  			crt.X__builtin_abort(tls)
112093  		}
112094  	}()
112095  	if _p.Xexpmask != 0 {
112096  		storebits26(&_p.Xexpired, int16(1), 1, 0)
112097  	}
112098  	Xsqlite3_mutex_leave(tls, _mutex)
112099  	return _rc
112100  }
112101  
112102  var _sqlite3_clear_bindingsØ00__func__Ø000 [23]int8
112103  
112104  func init() {
112105  	crt.Xstrncpy(nil, &_sqlite3_clear_bindingsØ00__func__Ø000[0], str(128502), 23)
112106  }
112107  
112108  // C comment
112109  //  /*
112110  //  ** External API function used to create a new virtual-table module.
112111  //  */
112112  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) {
112113  	if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zName == nil) {
112114  		return _sqlite3MisuseError(tls, int32(125106))
112115  	}
112116  	return _createModule(tls, _db, _zName, _pModule, _pAux, _xDestroy)
112117  }
112118  
112119  // C comment
112120  //  /*
112121  //  ** Query a blob handle for the size of the data.
112122  //  **
112123  //  ** The Incrblob.nByte field is fixed for the lifetime of the Incrblob
112124  //  ** so no mutex is required for access.
112125  //  */
112126  func Xsqlite3_blob_bytes(tls *crt.TLS, _pBlob unsafe.Pointer) (r0 int32) {
112127  	var _p *XIncrblob
112128  	_p = (*XIncrblob)(_pBlob)
112129  	return func() int32 {
112130  		if (_p != nil) && (_p.XpStmt != nil) {
112131  			return _p.XnByte
112132  		}
112133  		return int32(0)
112134  	}()
112135  }
112136  
112137  // C comment
112138  //  /*
112139  //  ** Close a blob handle that was previously created using
112140  //  ** sqlite3_blob_open().
112141  //  */
112142  func Xsqlite3_blob_close(tls *crt.TLS, _pBlob unsafe.Pointer) (r0 int32) {
112143  	var _rc int32
112144  	var _db *Xsqlite3
112145  	var _p *XIncrblob
112146  	_p = (*XIncrblob)(_pBlob)
112147  	if _p != nil {
112148  		_db = (*Xsqlite3)(_p.Xdb)
112149  		Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
112150  		_rc = Xsqlite3_finalize(tls, _p.XpStmt)
112151  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_p))
112152  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
112153  		goto _1
112154  	}
112155  	_rc = int32(0)
112156  _1:
112157  	return _rc
112158  }
112159  
112160  // C comment
112161  //  /*
112162  //  ** Open a blob handle.
112163  //  */
112164  func Xsqlite3_blob_open(tls *crt.TLS, _db *Xsqlite3, _zDb *int8, _zTable *int8, _zColumn *int8, _iRow int64, _wrFlag int32, _ppBlob *unsafe.Pointer) (r0 int32) {
112165  	var _nAttempt, _iCol, _rc, _14_j, _17_j, _21_iDb int32
112166  	var _zErr, _12_zFault *int8
112167  	var _pTab *XTable
112168  	var _21_v *TVdbe
112169  	var _pParse *XParse
112170  	var _12_pIdx *XIndex
112171  	var _21_aOp *XVdbeOp
112172  	var _pBlob *XIncrblob
112173  	var _13_pFKey *XFKey
112174  	_nAttempt = int32(0)
112175  	_rc = int32(0)
112176  	_zErr = nil
112177  	_pParse = nil
112178  	_pBlob = nil
112179  	if _ppBlob == nil {
112180  		return _sqlite3MisuseError(tls, int32(85639))
112181  	}
112182  	*_ppBlob = nil
112183  	if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zTable == nil) {
112184  		return _sqlite3MisuseError(tls, int32(85645))
112185  	}
112186  	_wrFlag = bool2int(_wrFlag != 0)
112187  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
112188  	_pBlob = (*XIncrblob)(_sqlite3DbMallocZero(tls, _db, uint64(32)))
112189  	if _pBlob == nil {
112190  		goto _blob_open_out
112191  	}
112192  	_pParse = (*XParse)(_sqlite3DbMallocRaw(tls, _db, uint64(484)))
112193  	if _pParse == nil {
112194  		goto _blob_open_out
112195  	}
112196  _4:
112197  	crt.Xmemset(tls, unsafe.Pointer(_pParse), int32(0), uint32(484))
112198  	*(**Xsqlite3)(unsafe.Pointer(&_pParse.Xdb)) = _db
112199  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErr))
112200  	_zErr = nil
112201  	_sqlite3BtreeEnterAll(tls, _db)
112202  	_pTab = _sqlite3LocateTable(tls, _pParse, 0, _zTable, _zDb)
112203  	if (_pTab != nil) && _pTab.XnModuleArg != 0 {
112204  		_pTab = nil
112205  		_sqlite3ErrorMsg(tls, _pParse, str(128525), unsafe.Pointer(_zTable))
112206  	}
112207  	if (_pTab != nil) && ((_pTab.XtabFlags & uint32(32)) != (0)) {
112208  		_pTab = nil
112209  		_sqlite3ErrorMsg(tls, _pParse, str(128555), unsafe.Pointer(_zTable))
112210  	}
112211  	if (_pTab != nil) && (_pTab.XpSelect != nil) {
112212  		_pTab = nil
112213  		_sqlite3ErrorMsg(tls, _pParse, str(128591), unsafe.Pointer(_zTable))
112214  	}
112215  	if _pTab != nil {
112216  		goto _12
112217  	}
112218  	if _pParse.XzErrMsg != nil {
112219  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErr))
112220  		_zErr = _pParse.XzErrMsg
112221  		_pParse.XzErrMsg = nil
112222  	}
112223  	_rc = int32(1)
112224  	_sqlite3BtreeLeaveAll(tls, _db)
112225  	goto _blob_open_out
112226  _12:
112227  	*(**XTable)(unsafe.Pointer(&_pBlob.XpTab)) = _pTab
112228  	_pBlob.XzDb = elem27((*XDb)(_db.XaDb), uintptr(_sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.XpSchema)))).XzDbSName
112229  	_iCol = int32(0)
112230  _14:
112231  	if _iCol >= int32(_pTab.XnCol) {
112232  		goto _17
112233  	}
112234  	if _sqlite3StrICmp(tls, elem41((*XColumn)(_pTab.XaCol), uintptr(_iCol)).XzName, _zColumn) == int32(0) {
112235  		goto _17
112236  	}
112237  	_iCol += 1
112238  	goto _14
112239  _17:
112240  	if _iCol == int32(_pTab.XnCol) {
112241  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErr))
112242  		_zErr = _sqlite3MPrintf(tls, _db, str(128612), unsafe.Pointer(_zColumn))
112243  		_rc = int32(1)
112244  		_sqlite3BtreeLeaveAll(tls, _db)
112245  		goto _blob_open_out
112246  	}
112247  	if _wrFlag == 0 {
112248  		goto _20
112249  	}
112250  	_12_zFault = nil
112251  	if (_db.Xflags & int32(524288)) == 0 {
112252  		goto _21
112253  	}
112254  	_13_pFKey = (*XFKey)(_pTab.XpFKey)
112255  _22:
112256  	if _13_pFKey == nil {
112257  		goto _25
112258  	}
112259  	_14_j = int32(0)
112260  _26:
112261  	if _14_j >= _13_pFKey.XnCol {
112262  		goto _29
112263  	}
112264  	if (elem116((*t117)(unsafe.Pointer(&_13_pFKey.XaCol)), uintptr(_14_j)).XiFrom) == _iCol {
112265  		_12_zFault = str(128633)
112266  	}
112267  	_14_j += 1
112268  	goto _26
112269  _29:
112270  	_13_pFKey = (*XFKey)(_13_pFKey.XpNextFrom)
112271  	goto _22
112272  _25:
112273  _21:
112274  	_12_pIdx = (*XIndex)(_pTab.XpIndex)
112275  _31:
112276  	if _12_pIdx == nil {
112277  		goto _34
112278  	}
112279  	_17_j = int32(0)
112280  _35:
112281  	if _17_j >= int32(_12_pIdx.XnKeyCol) {
112282  		goto _38
112283  	}
112284  	if (int32(*elem50(_12_pIdx.XaiColumn, uintptr(_17_j))) == _iCol) || (int32(*elem50(_12_pIdx.XaiColumn, uintptr(_17_j))) == int32(-2)) {
112285  		_12_zFault = str(128645)
112286  	}
112287  	_17_j += 1
112288  	goto _35
112289  _38:
112290  	_12_pIdx = (*XIndex)(_12_pIdx.XpNext)
112291  	goto _31
112292  _34:
112293  	if _12_zFault != nil {
112294  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErr))
112295  		_zErr = _sqlite3MPrintf(tls, _db, str(128653), unsafe.Pointer(_12_zFault))
112296  		_rc = int32(1)
112297  		_sqlite3BtreeLeaveAll(tls, _db)
112298  		goto _blob_open_out
112299  	}
112300  _20:
112301  	_pBlob.XpStmt = unsafe.Pointer(_sqlite3VdbeCreate(tls, _pParse))
112302  	func() {
112303  		if _pBlob.XpStmt == nil && _db.XmallocFailed == 0 {
112304  			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)))
112305  			crt.X__builtin_abort(tls)
112306  		}
112307  	}()
112308  	if _pBlob.XpStmt == nil {
112309  		goto _45
112310  	}
112311  	_21_v = (*TVdbe)(_pBlob.XpStmt)
112312  	_21_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.XpSchema))
112313  	_sqlite3VdbeAddOp4Int(tls, _21_v, int32(2), _21_iDb, _wrFlag, (*XSchema)(_pTab.XpSchema).Xschema_cookie, (*XSchema)(_pTab.XpSchema).XiGeneration)
112314  	_sqlite3VdbeChangeP5(tls, _21_v, uint16(1))
112315  	_21_aOp = _sqlite3VdbeAddOpList(tls, _21_v, int32(6), (*XVdbeOpList)(unsafe.Pointer(&_sqlite3_blob_openØ00openBlobØ002)), _sqlite3_blob_openØ00iLnØ001)
112316  	_sqlite3VdbeUsesBtree(tls, _21_v, _21_iDb)
112317  	if int32(_db.XmallocFailed) == int32(0) {
112318  		func() {
112319  			if _21_aOp == nil {
112320  				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)))
112321  				crt.X__builtin_abort(tls)
112322  			}
112323  		}()
112324  		elem61(_21_aOp, 0).Xp1 = _21_iDb
112325  		elem61(_21_aOp, 0).Xp2 = _pTab.Xtnum
112326  		elem61(_21_aOp, 0).Xp3 = _wrFlag
112327  		_sqlite3VdbeChangeP4(tls, _21_v, int32(1), _pTab.XzName, int32(0))
112328  	}
112329  	if int32(_db.XmallocFailed) != int32(0) {
112330  		goto _49
112331  	}
112332  	if _wrFlag != 0 {
112333  		elem61(_21_aOp, uintptr(1)).Xopcode = uint8(107)
112334  	}
112335  	elem61(_21_aOp, uintptr(1)).Xp2 = _pTab.Xtnum
112336  	elem61(_21_aOp, uintptr(1)).Xp3 = _21_iDb
112337  	elem61(_21_aOp, uintptr(1)).Xp4type = int8(-11)
112338  	*(*int32)(unsafe.Pointer(&(elem61(_21_aOp, uintptr(1)).Xp4))) = int32(_pTab.XnCol) + int32(1)
112339  	elem61(_21_aOp, uintptr(3)).Xp2 = int32(_pTab.XnCol)
112340  	_pParse.XnVar = 0
112341  	_pParse.XnMem = int32(1)
112342  	_pParse.XnTab = int32(1)
112343  	_sqlite3VdbeMakeReady(tls, _21_v, _pParse)
112344  _49:
112345  _45:
112346  	_pBlob.XiCol = uint16(_iCol)
112347  	*(**Xsqlite3)(unsafe.Pointer(&_pBlob.Xdb)) = _db
112348  	_sqlite3BtreeLeaveAll(tls, _db)
112349  	if _db.XmallocFailed != 0 {
112350  		goto _blob_open_out
112351  	}
112352  	_rc = _blobSeekToRow(tls, _pBlob, _iRow, &_zErr)
112353  	if (preInc2(&_nAttempt, 1) < int32(50)) && (_rc == int32(17)) {
112354  		goto _4
112355  	}
112356  _blob_open_out:
112357  	if (_rc == int32(0)) && (int32(_db.XmallocFailed) == int32(0)) {
112358  		*_ppBlob = unsafe.Pointer(_pBlob)
112359  		goto _55
112360  	}
112361  	if (_pBlob != nil) && (_pBlob.XpStmt != nil) {
112362  		_sqlite3VdbeFinalize(tls, (*TVdbe)(_pBlob.XpStmt))
112363  	}
112364  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pBlob))
112365  _55:
112366  	_sqlite3ErrorWithMsg(tls, _db, _rc, func() *int8 {
112367  		if _zErr != nil {
112368  			return str(24531)
112369  		}
112370  		return nil
112371  	}(), unsafe.Pointer(_zErr))
112372  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_zErr))
112373  	_sqlite3ParserReset(tls, _pParse)
112374  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_pParse))
112375  	_rc = _sqlite3ApiExit(tls, _db, _rc)
112376  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
112377  	return _rc
112378  
112379  	_ = _nAttempt
112380  	panic(0)
112381  }
112382  
112383  var _sqlite3_blob_openØ00__func__Ø000 [18]int8
112384  
112385  func init() {
112386  	crt.Xstrncpy(nil, &_sqlite3_blob_openØ00__func__Ø000[0], str(128727), 18)
112387  }
112388  
112389  var _sqlite3_blob_openØ00openBlobØ002 [6]XVdbeOpList
112390  
112391  func init() {
112392  	_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)}}
112393  }
112394  
112395  var _sqlite3_blob_openØ00iLnØ001 int32
112396  
112397  // C comment
112398  //  /*
112399  //  ** This function is used by both blob_open() and blob_reopen(). It seeks
112400  //  ** the b-tree cursor associated with blob handle p to point to row iRow.
112401  //  ** If successful, SQLITE_OK is returned and subsequent calls to
112402  //  ** sqlite3_blob_read() or sqlite3_blob_write() access the specified row.
112403  //  **
112404  //  ** If an error occurs, or if the specified row does not exist or does not
112405  //  ** contain a value of type TEXT or BLOB in the column nominated when the
112406  //  ** blob handle was opened, then an error code is returned and *pzErr may
112407  //  ** be set to point to a buffer containing an error message. It is the
112408  //  ** responsibility of the caller to free the error message buffer using
112409  //  ** sqlite3DbFree().
112410  //  **
112411  //  ** If an error does occur, then the b-tree cursor is closed. All subsequent
112412  //  ** calls to sqlite3_blob_read(), blob_write() or blob_reopen() will
112413  //  ** immediately return SQLITE_ABORT.
112414  //  */
112415  func _blobSeekToRow(tls *crt.TLS, _p *XIncrblob, _iRow int64, _pzErr **int8) (r0 int32) {
112416  	var _rc int32
112417  	var _3_type uint32
112418  	var _zErr *int8
112419  	var _v *TVdbe
112420  	var _3_pC *XVdbeCursor
112421  	_zErr = nil
112422  	_v = (*TVdbe)(_p.XpStmt)
112423  	elem25((*XMem)(_v.XaMem), uintptr(1)).Xflags = uint16(4)
112424  	*(*int64)(unsafe.Pointer(&(elem25((*XMem)(_v.XaMem), uintptr(1)).Xu))) = _iRow
112425  	if _v.Xpc > int32(3) {
112426  		_v.Xpc = int32(3)
112427  		_rc = _sqlite3VdbeExec(tls, _v)
112428  		goto _1
112429  	}
112430  	_rc = Xsqlite3_step(tls, _p.XpStmt)
112431  _1:
112432  	if _rc != int32(100) {
112433  		goto _2
112434  	}
112435  	_3_pC = *elem77((**XVdbeCursor)(unsafe.Pointer(_v.XapCsr)), 0)
112436  	_3_type = func() uint32 {
112437  		if int32(_3_pC.XnHdrParsed) > int32(_p.XiCol) {
112438  			return (*elem7((*uint32)(unsafe.Pointer(&_3_pC.XaType)), uintptr(_p.XiCol)))
112439  		}
112440  		return (0)
112441  	}()
112442  	if _3_type < uint32(12) {
112443  		_zErr = _sqlite3MPrintf(tls, (*Xsqlite3)(_p.Xdb), str(128745), unsafe.Pointer(func() *int8 {
112444  			if _3_type == (0) {
112445  				return str(128774)
112446  			}
112447  			return func() *int8 {
112448  				if _3_type == uint32(7) {
112449  					return str(42838)
112450  				}
112451  				return str(42830)
112452  			}()
112453  		}()))
112454  		_rc = int32(1)
112455  		Xsqlite3_finalize(tls, _p.XpStmt)
112456  		_p.XpStmt = nil
112457  		goto _10
112458  	}
112459  	_p.XiOffset = int32(*elem7((*uint32)(unsafe.Pointer(&_3_pC.XaType)), uintptr(int32(_p.XiCol)+int32(_3_pC.XnField))))
112460  	_p.XnByte = int32(_sqlite3VdbeSerialTypeLen(tls, _3_type))
112461  	*(**XBtCursor)(unsafe.Pointer(&_p.XpCsr)) = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_3_pC.Xuc)))
112462  	_sqlite3BtreeIncrblobCursor(tls, (*XBtCursor)(_p.XpCsr))
112463  _10:
112464  _2:
112465  	if _rc == int32(100) {
112466  		_rc = int32(0)
112467  		goto _13
112468  	}
112469  	if _p.XpStmt == nil {
112470  		goto _13
112471  	}
112472  	_rc = Xsqlite3_finalize(tls, _p.XpStmt)
112473  	_p.XpStmt = nil
112474  	if _rc == int32(0) {
112475  		_zErr = _sqlite3MPrintf(tls, (*Xsqlite3)(_p.Xdb), str(128779), _iRow)
112476  		_rc = int32(1)
112477  		goto _15
112478  	}
112479  	_zErr = _sqlite3MPrintf(tls, (*Xsqlite3)(_p.Xdb), str(24531), unsafe.Pointer(Xsqlite3_errmsg(tls, (*Xsqlite3)(_p.Xdb))))
112480  _15:
112481  _13:
112482  	func() {
112483  		if _rc == int32(0) && _zErr != nil {
112484  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85610), unsafe.Pointer(&_blobSeekToRowØ00__func__Ø000), unsafe.Pointer(str(128799)))
112485  			crt.X__builtin_abort(tls)
112486  		}
112487  	}()
112488  	func() {
112489  		if _rc == int32(100) || _rc == int32(101) {
112490  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85611), unsafe.Pointer(&_blobSeekToRowØ00__func__Ø000), unsafe.Pointer(str(128824)))
112491  			crt.X__builtin_abort(tls)
112492  		}
112493  	}()
112494  	*_pzErr = _zErr
112495  	return _rc
112496  }
112497  
112498  // C comment
112499  //  /*
112500  //  ** Mark this cursor as an incremental blob cursor.
112501  //  */
112502  func _sqlite3BtreeIncrblobCursor(tls *crt.TLS, _pCur *XBtCursor) {
112503  	{
112504  		p := &_pCur.XcurFlags
112505  		*p = uint8(int32(*p) | int32(16))
112506  	}
112507  	(*XBtree)(_pCur.XpBtree).XhasIncrblobCur = uint8(1)
112508  }
112509  
112510  var _blobSeekToRowØ00__func__Ø000 [14]int8
112511  
112512  func init() {
112513  	crt.Xstrncpy(nil, &_blobSeekToRowØ00__func__Ø000[0], str(128858), 14)
112514  }
112515  
112516  // C comment
112517  //  /*
112518  //  ** Read data from a blob handle.
112519  //  */
112520  func Xsqlite3_blob_read(tls *crt.TLS, _pBlob unsafe.Pointer, _z unsafe.Pointer, _n int32, _iOffset int32) (r0 int32) {
112521  	return _blobReadWrite(tls, _pBlob, _z, _n, _iOffset, _sqlite3BtreePayloadChecked)
112522  }
112523  
112524  // C comment
112525  //  /*
112526  //  ** Perform a read or write operation on a blob
112527  //  */
112528  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) {
112529  	var _rc int32
112530  	var _db *Xsqlite3
112531  	var _v *TVdbe
112532  	var _p *XIncrblob
112533  	_p = (*XIncrblob)(_pBlob)
112534  	if _p == nil {
112535  		return _sqlite3MisuseError(tls, int32(85888))
112536  	}
112537  	_db = (*Xsqlite3)(_p.Xdb)
112538  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
112539  	_v = (*TVdbe)(_p.XpStmt)
112540  	if ((_n < int32(0)) || (_iOffset < int32(0))) || ((int64(_iOffset) + int64(_n)) > int64(_p.XnByte)) {
112541  		_rc = int32(1)
112542  		goto _6
112543  	}
112544  	if _v == nil {
112545  		_rc = int32(4)
112546  		goto _6
112547  	}
112548  	func() {
112549  		if _db != (*Xsqlite3)(_v.Xdb) {
112550  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(85905), unsafe.Pointer(&_blobReadWriteØ00__func__Ø000), unsafe.Pointer(str(128872)))
112551  			crt.X__builtin_abort(tls)
112552  		}
112553  	}()
112554  	_sqlite3BtreeEnterCursor(tls, (*XBtCursor)(_p.XpCsr))
112555  	_rc = _xCall(tls, (*XBtCursor)(_p.XpCsr), uint32(_iOffset+_p.XiOffset), uint32(_n), _z)
112556  	_sqlite3BtreeLeaveCursor(tls, (*XBtCursor)(_p.XpCsr))
112557  	if _rc == int32(4) {
112558  		_sqlite3VdbeFinalize(tls, _v)
112559  		_p.XpStmt = nil
112560  		goto _10
112561  	}
112562  	_v.Xrc = _rc
112563  _10:
112564  _6:
112565  	_sqlite3Error(tls, _db, _rc)
112566  	_rc = _sqlite3ApiExit(tls, _db, _rc)
112567  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
112568  	return _rc
112569  }
112570  
112571  var _blobReadWriteØ00__func__Ø000 [14]int8
112572  
112573  func init() {
112574  	crt.Xstrncpy(nil, &_blobReadWriteØ00__func__Ø000[0], str(128884), 14)
112575  }
112576  
112577  // C comment
112578  //  /*
112579  //  ** Enter a mutex on a Btree given a cursor owned by that Btree.
112580  //  **
112581  //  ** These entry points are used by incremental I/O only. Enter() is required
112582  //  ** any time OMIT_SHARED_CACHE is not defined, regardless of whether or not
112583  //  ** the build is threadsafe. Leave() is only required by threadsafe builds.
112584  //  */
112585  func _sqlite3BtreeEnterCursor(tls *crt.TLS, _pCur *XBtCursor) {
112586  	_sqlite3BtreeEnter(tls, (*XBtree)(_pCur.XpBtree))
112587  }
112588  
112589  func _sqlite3BtreeLeaveCursor(tls *crt.TLS, _pCur *XBtCursor) {
112590  	_sqlite3BtreeLeave(tls, (*XBtree)(_pCur.XpBtree))
112591  }
112592  
112593  func _sqlite3BtreePayloadChecked(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt uint32, _pBuf unsafe.Pointer) (r0 int32) {
112594  	if int32(_pCur.XeState) == int32(1) {
112595  		func() {
112596  			if _cursorOwnsBtShared(tls, _pCur) == 0 {
112597  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63784), unsafe.Pointer(&_sqlite3BtreePayloadCheckedØ00__func__Ø000), unsafe.Pointer(str(71986)))
112598  				crt.X__builtin_abort(tls)
112599  			}
112600  		}()
112601  		return _accessPayload(tls, _pCur, _offset, _amt, (*uint8)(_pBuf), int32(0))
112602  	}
112603  	return _accessPayloadChecked(tls, _pCur, _offset, _amt, _pBuf)
112604  }
112605  
112606  var _sqlite3BtreePayloadCheckedØ00__func__Ø000 [27]int8
112607  
112608  func init() {
112609  	crt.Xstrncpy(nil, &_sqlite3BtreePayloadCheckedØ00__func__Ø000[0], str(128898), 27)
112610  }
112611  
112612  func _accessPayloadChecked(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt uint32, _pBuf unsafe.Pointer) (r0 int32) {
112613  	var _rc int32
112614  	if int32(_pCur.XeState) == int32(0) {
112615  		return int32(4)
112616  	}
112617  	func() {
112618  		if _cursorOwnsBtShared(tls, _pCur) == 0 {
112619  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(63778), unsafe.Pointer(&_accessPayloadCheckedØ00__func__Ø000), unsafe.Pointer(str(71986)))
112620  			crt.X__builtin_abort(tls)
112621  		}
112622  	}()
112623  	_rc = _btreeRestoreCursorPosition(tls, _pCur)
112624  	return func() int32 {
112625  		if _rc != 0 {
112626  			return _rc
112627  		}
112628  		return _accessPayload(tls, _pCur, _offset, _amt, (*uint8)(_pBuf), int32(0))
112629  	}()
112630  }
112631  
112632  var _accessPayloadCheckedØ00__func__Ø000 [21]int8
112633  
112634  func init() {
112635  	crt.Xstrncpy(nil, &_accessPayloadCheckedØ00__func__Ø000[0], str(128925), 21)
112636  }
112637  
112638  // C comment
112639  //  /*
112640  //  ** Write data to a blob handle.
112641  //  */
112642  func Xsqlite3_blob_write(tls *crt.TLS, _pBlob unsafe.Pointer, _z unsafe.Pointer, _n int32, _iOffset int32) (r0 int32) {
112643  	return _blobReadWrite(tls, _pBlob, _z, _n, _iOffset, _sqlite3BtreePutData)
112644  }
112645  
112646  // C comment
112647  //  /*
112648  //  ** Argument pCsr must be a cursor opened for writing on an
112649  //  ** INTKEY table currently pointing at a valid table entry.
112650  //  ** This function modifies the data stored as part of that entry.
112651  //  **
112652  //  ** Only the data content may only be modified, it is not possible to
112653  //  ** change the length of the data stored. If this function is called with
112654  //  ** parameters that attempt to write past the end of the existing data,
112655  //  ** no modifications are made and SQLITE_CORRUPT is returned.
112656  //  */
112657  func _sqlite3BtreePutData(tls *crt.TLS, _pCsr *XBtCursor, _offset uint32, _amt uint32, _z unsafe.Pointer) (r0 int32) {
112658  	var _rc int32
112659  	func() {
112660  		if _cursorOwnsBtShared(tls, _pCsr) == 0 {
112661  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68770), unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000), unsafe.Pointer(str(128946)))
112662  			crt.X__builtin_abort(tls)
112663  		}
112664  	}()
112665  	func() {
112666  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XBtree)(_pCsr.XpBtree).Xdb).Xmutex)) == 0 {
112667  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68771), unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000), unsafe.Pointer(str(128971)))
112668  			crt.X__builtin_abort(tls)
112669  		}
112670  	}()
112671  	func() {
112672  		if (int32(_pCsr.XcurFlags) & int32(16)) == 0 {
112673  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68772), unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000), unsafe.Pointer(str(129015)))
112674  			crt.X__builtin_abort(tls)
112675  		}
112676  	}()
112677  	_rc = func() int32 {
112678  		if int32(_pCsr.XeState) >= int32(3) {
112679  			return _btreeRestoreCursorPosition(tls, _pCsr)
112680  		}
112681  		return int32(0)
112682  	}()
112683  	if _rc != int32(0) {
112684  		return _rc
112685  	}
112686  	func() {
112687  		if int32(_pCsr.XeState) == int32(3) {
112688  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68778), unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000), unsafe.Pointer(str(129046)))
112689  			crt.X__builtin_abort(tls)
112690  		}
112691  	}()
112692  	if int32(_pCsr.XeState) != int32(1) {
112693  		return int32(4)
112694  	}
112695  	_rc = _saveAllCursors(tls, (*XBtShared)(_pCsr.XpBt), _pCsr.XpgnoRoot, _pCsr)
112696  	func() {
112697  		if _rc != int32(0) {
112698  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68792), unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000), unsafe.Pointer(str(14967)))
112699  			crt.X__builtin_abort(tls)
112700  		}
112701  	}()
112702  	if (int32(_pCsr.XcurFlags) & int32(1)) == int32(0) {
112703  		return int32(8)
112704  	}
112705  	func() {
112706  		if (int32((*XBtShared)(_pCsr.XpBt).XbtsFlags)&int32(1)) != int32(0) || int32((*XBtShared)(_pCsr.XpBt).XinTransaction) != int32(2) {
112707  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68804), unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000), unsafe.Pointer(str(129079)))
112708  			crt.X__builtin_abort(tls)
112709  		}
112710  	}()
112711  	func() {
112712  		if _hasSharedCacheTableLock(tls, (*XBtree)(_pCsr.XpBtree), _pCsr.XpgnoRoot, int32(0), int32(2)) == 0 {
112713  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68806), unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000), unsafe.Pointer(str(129161)))
112714  			crt.X__builtin_abort(tls)
112715  		}
112716  	}()
112717  	func() {
112718  		if _hasReadConflicts(tls, (*XBtree)(_pCsr.XpBtree), _pCsr.XpgnoRoot) != 0 {
112719  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68807), unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000), unsafe.Pointer(str(129221)))
112720  			crt.X__builtin_abort(tls)
112721  		}
112722  	}()
112723  	func() {
112724  		if ((*elem30((**XMemPage)(unsafe.Pointer(&_pCsr.XapPage)), uintptr(_pCsr.XiPage))).XintKey) == 0 {
112725  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(68808), unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000), unsafe.Pointer(str(129269)))
112726  			crt.X__builtin_abort(tls)
112727  		}
112728  	}()
112729  	return _accessPayload(tls, _pCsr, _offset, _amt, (*uint8)(_z), int32(1))
112730  }
112731  
112732  var _sqlite3BtreePutDataØ00__func__Ø000 [20]int8
112733  
112734  func init() {
112735  	crt.Xstrncpy(nil, &_sqlite3BtreePutDataØ00__func__Ø000[0], str(129303), 20)
112736  }
112737  
112738  // C comment
112739  //  /*
112740  //  ** Return the maximum amount of memory that has ever been
112741  //  ** checked out since either the beginning of this process
112742  //  ** or since the most recent reset.
112743  //  */
112744  func Xsqlite3_memory_highwater(tls *crt.TLS, _resetFlag int32) (r0 int64) {
112745  	var _res, _mx int64
112746  	Xsqlite3_status64(tls, int32(0), &_res, &_mx, _resetFlag)
112747  	return _mx
112748  }
112749  
112750  // C comment
112751  //  /*
112752  //  ** Retrieve a pointer to a static mutex or allocate a new dynamic one.
112753  //  */
112754  func Xsqlite3_mutex_alloc(tls *crt.TLS, _id int32) (r0 *Xsqlite3_mutex) {
112755  	if (_id <= int32(1)) && Xsqlite3_initialize(tls) != 0 {
112756  		return nil
112757  	}
112758  	if (_id > int32(1)) && _sqlite3MutexInit(tls) != 0 {
112759  		return nil
112760  	}
112761  	func() {
112762  		if (_sqlite3Config.Xmutex.XxMutexAlloc) == nil {
112763  			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)))
112764  			crt.X__builtin_abort(tls)
112765  		}
112766  	}()
112767  	return func() func(*crt.TLS, int32) *Xsqlite3_mutex {
112768  		v := _sqlite3Config.Xmutex.XxMutexAlloc
112769  		return *(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer(&v))
112770  	}()(tls, _id)
112771  }
112772  
112773  var _sqlite3_mutex_allocØ00__func__Ø000 [20]int8
112774  
112775  func init() {
112776  	crt.Xstrncpy(nil, &_sqlite3_mutex_allocØ00__func__Ø000[0], str(129323), 20)
112777  }
112778  
112779  func Xsqlite3_open_v2(tls *crt.TLS, _filename *int8, _ppDb **Xsqlite3, _flags int32, _zVfs *int8) (r0 int32) {
112780  	return _openDatabase(tls, _filename, _ppDb, uint32(_flags), _zVfs)
112781  }
112782  
112783  // C comment
112784  //  /*
112785  //  ** Sleep for a little while.  Return the amount of time slept.
112786  //  */
112787  func Xsqlite3_sleep(tls *crt.TLS, _ms int32) (r0 int32) {
112788  	var _rc int32
112789  	var _pVfs *Xsqlite3_vfs
112790  	_pVfs = Xsqlite3_vfs_find(tls, nil)
112791  	if _pVfs == nil {
112792  		return int32(0)
112793  	}
112794  	_rc = _sqlite3OsSleep(tls, _pVfs, int32(1000)*_ms) / int32(1000)
112795  	return _rc
112796  }
112797  
112798  // C comment
112799  //  /*
112800  //  ** CAPI3REF: Deprecated Soft Heap Limit Interface
112801  //  ** DEPRECATED
112802  //  **
112803  //  ** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
112804  //  ** interface.  This routine is provided for historical compatibility
112805  //  ** only.  All new applications should use the
112806  //  ** [sqlite3_soft_heap_limit64()] interface rather than this one.
112807  //  */
112808  func Xsqlite3_soft_heap_limit(tls *crt.TLS, _n int32) {
112809  	if _n < int32(0) {
112810  		_n = int32(0)
112811  	}
112812  	Xsqlite3_soft_heap_limit64(tls, int64(_n))
112813  }
112814  
112815  // C comment
112816  //  /*
112817  //  ** Register a VFS with the system.  It is harmless to register the same
112818  //  ** VFS multiple times.  The new VFS becomes the default if makeDflt is
112819  //  ** true.
112820  //  */
112821  func Xsqlite3_vfs_register(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _makeDflt int32) (r0 int32) {
112822  	var _rc int32
112823  	var _mutex *Xsqlite3_mutex
112824  	_rc = Xsqlite3_initialize(tls)
112825  	if _rc != 0 {
112826  		return _rc
112827  	}
112828  	if _pVfs == nil {
112829  		return _sqlite3MisuseError(tls, int32(20464))
112830  	}
112831  	_mutex = _sqlite3MutexAlloc(tls, int32(2))
112832  	Xsqlite3_mutex_enter(tls, _mutex)
112833  	_vfsUnlink(tls, _pVfs)
112834  	if _makeDflt != 0 || (_vfsList == nil) {
112835  		*(**Xsqlite3_vfs)(unsafe.Pointer(&_pVfs.XpNext)) = _vfsList
112836  		_vfsList = _pVfs
112837  		bug20530(_vfsList)
112838  		goto _4
112839  	}
112840  	*(**Xsqlite3_vfs)(unsafe.Pointer(&_pVfs.XpNext)) = (*Xsqlite3_vfs)(_vfsList.XpNext)
112841  	*(**Xsqlite3_vfs)(unsafe.Pointer(&_vfsList.XpNext)) = _pVfs
112842  _4:
112843  	func() {
112844  		if _vfsList == nil {
112845  			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)))
112846  			crt.X__builtin_abort(tls)
112847  		}
112848  	}()
112849  	Xsqlite3_mutex_leave(tls, _mutex)
112850  	return int32(0)
112851  }
112852  
112853  // C comment
112854  //  /*
112855  //  ** Unlink a VFS from the linked list
112856  //  */
112857  func _vfsUnlink(tls *crt.TLS, _pVfs *Xsqlite3_vfs) {
112858  	var _3_p *Xsqlite3_vfs
112859  	func() {
112860  		if Xsqlite3_mutex_held(tls, _sqlite3MutexAlloc(tls, int32(2))) == 0 {
112861  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(20436), unsafe.Pointer(&_vfsUnlinkØ00__func__Ø000), unsafe.Pointer(str(129351)))
112862  			crt.X__builtin_abort(tls)
112863  		}
112864  	}()
112865  	if _pVfs == nil {
112866  		goto _6
112867  	}
112868  	if _vfsList == _pVfs {
112869  		_vfsList = (*Xsqlite3_vfs)(_pVfs.XpNext)
112870  		bug20530(_vfsList)
112871  		goto _6
112872  	}
112873  	if _vfsList == nil {
112874  		goto _6
112875  	}
112876  	_3_p = _vfsList
112877  _7:
112878  	if (_3_p.XpNext != nil) && ((*Xsqlite3_vfs)(_3_p.XpNext) != _pVfs) {
112879  		_3_p = (*Xsqlite3_vfs)(_3_p.XpNext)
112880  		goto _7
112881  	}
112882  	if (*Xsqlite3_vfs)(_3_p.XpNext) == _pVfs {
112883  		*(**Xsqlite3_vfs)(unsafe.Pointer(&_3_p.XpNext)) = (*Xsqlite3_vfs)(_pVfs.XpNext)
112884  	}
112885  _6:
112886  }
112887  
112888  var _vfsUnlinkØ00__func__Ø000 [10]int8
112889  
112890  func init() {
112891  	crt.Xstrncpy(nil, &_vfsUnlinkØ00__func__Ø000[0], str(129417), 10)
112892  }
112893  
112894  var _sqlite3_vfs_registerØ00__func__Ø000 [21]int8
112895  
112896  func init() {
112897  	crt.Xstrncpy(nil, &_sqlite3_vfs_registerØ00__func__Ø000[0], str(129427), 21)
112898  }
112899  
112900  // C comment
112901  //  /*
112902  //  ** Unregister a VFS so that it is no longer accessible.
112903  //  */
112904  func Xsqlite3_vfs_unregister(tls *crt.TLS, _pVfs *Xsqlite3_vfs) (r0 int32) {
112905  	var _mutex *Xsqlite3_mutex
112906  	_mutex = _sqlite3MutexAlloc(tls, int32(2))
112907  	Xsqlite3_mutex_enter(tls, _mutex)
112908  	_vfsUnlink(tls, _pVfs)
112909  	Xsqlite3_mutex_leave(tls, _mutex)
112910  	return int32(0)
112911  }
112912  
112913  // C comment
112914  //  /* IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns
112915  //  ** zero if and only if SQLite was compiled with mutexing code omitted due to
112916  //  ** the SQLITE_THREADSAFE compile-time option being set to 0.
112917  //  */
112918  func Xsqlite3_threadsafe(tls *crt.TLS) (r0 int32) {
112919  	return int32(1)
112920  }
112921  
112922  func Xsqlite3_result_zeroblob(tls *crt.TLS, _pCtx *Xsqlite3_context, _n int32) {
112923  	func() {
112924  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
112925  			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)))
112926  			crt.X__builtin_abort(tls)
112927  		}
112928  	}()
112929  	_sqlite3VdbeMemSetZeroBlob(tls, (*XMem)(_pCtx.XpOut), _n)
112930  }
112931  
112932  var _sqlite3_result_zeroblobØ00__func__Ø000 [24]int8
112933  
112934  func init() {
112935  	crt.Xstrncpy(nil, &_sqlite3_result_zeroblobØ00__func__Ø000[0], str(129448), 24)
112936  }
112937  
112938  // C comment
112939  //  /*
112940  //  ** Interface to the testing logic.
112941  //  */
112942  func Xsqlite3_test_control(tls *crt.TLS, _op int32, args ...interface{}) (r0 int32) {
112943  	var _rc, _5_sz, _10_x, _11_x, _13_x, _15_n, _16_sz int32
112944  	var _9_newVal uint32
112945  	var _5_aProg *int32
112946  	var _15_zWord *int8
112947  	var _16_pFree unsafe.Pointer
112948  	var _16_ppNew *unsafe.Pointer
112949  	var _ap []interface{}
112950  	var _7_xBenignBegin, _7_xBenignEnd func(*crt.TLS)
112951  	var _13_db, _14_db, _21_db, _23_db *Xsqlite3
112952  	_rc = int32(0)
112953  	_ap = args
112954  	switch _op {
112955  	case int32(5):
112956  		goto _1
112957  	case int32(6):
112958  		goto _2
112959  	case int32(7):
112960  		goto _3
112961  	case int32(8):
112962  		goto _4
112963  	case int32(9):
112964  		goto _5
112965  	case int32(10):
112966  		goto _6
112967  	case int32(11):
112968  		goto _7
112969  	case int32(12):
112970  		goto _8
112971  	case int32(13):
112972  		goto _9
112973  	case int32(14):
112974  		goto _11
112975  	case int32(15):
112976  		goto _12
112977  	case int32(16):
112978  		goto _13
112979  	case int32(17):
112980  		goto _14
112981  	case int32(18):
112982  		goto _15
112983  	case int32(19):
112984  		goto _17
112985  	case int32(20):
112986  		goto _16
112987  	case int32(21):
112988  		goto _18
112989  	case int32(22):
112990  		goto _10
112991  	case int32(23):
112992  		goto _20
112993  	case int32(24):
112994  		goto _19
112995  	case int32(25):
112996  		goto _21
112997  	default:
112998  		goto _22
112999  	}
113000  
113001  _1:
113002  	_sqlite3PrngSaveState(tls)
113003  	goto _22
113004  _2:
113005  	_sqlite3PrngRestoreState(tls)
113006  	goto _22
113007  _3:
113008  	Xsqlite3_randomness(tls, int32(0), nil)
113009  	goto _22
113010  _4:
113011  	_5_sz = crt.VAInt32(&_ap)
113012  	_5_aProg = (*int32)(crt.VAPointer(&_ap))
113013  	_rc = _sqlite3BitvecBuiltinTest(tls, _5_sz, _5_aProg)
113014  	goto _22
113015  _5:
113016  	_sqlite3Config.XxTestCallback = crt.VAOther(&_ap).(func(*crt.TLS, int32) int32)
113017  	_rc = _sqlite3FaultSim(tls, int32(0))
113018  	goto _22
113019  _6:
113020  	_7_xBenignBegin = crt.VAOther(&_ap).(func(*crt.TLS))
113021  	_7_xBenignEnd = crt.VAOther(&_ap).(func(*crt.TLS))
113022  	_sqlite3BenignMallocHooks(tls, _7_xBenignBegin, _7_xBenignEnd)
113023  	goto _22
113024  _7:
113025  	_rc = _sqlite3PendingByte
113026  	_9_newVal = crt.VAUint32(&_ap)
113027  	if _9_newVal != 0 {
113028  		_sqlite3PendingByte = int32(_9_newVal)
113029  		bug20530(_sqlite3PendingByte)
113030  	}
113031  	goto _22
113032  _8:
113033  	_10_x = int32(0)
113034  	func() {
113035  		if store2(&_10_x, crt.VAInt32(&_ap)) == int32(0) {
113036  			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)))
113037  			crt.X__builtin_abort(tls)
113038  		}
113039  	}()
113040  	_rc = _10_x
113041  	goto _22
113042  _9:
113043  	_11_x = crt.VAInt32(&_ap)
113044  	_rc = func() int32 {
113045  		if _11_x != 0 {
113046  			return int32(1)
113047  		}
113048  		return func() int32 {
113049  			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)))
113050  			crt.X__builtin_abort(tls)
113051  			return int32(0)
113052  		}()
113053  	}()
113054  	goto _22
113055  _10:
113056  	_rc = int32(123410)
113057  	goto _22
113058  _11:
113059  	_13_db = (*Xsqlite3)(crt.VAPointer(&_ap))
113060  	_13_x = crt.VAInt32(&_ap)
113061  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_13_db.Xmutex))
113062  	_sqlite3BtreeSetPageSize(tls, (*XBtree)(elem27((*XDb)(_13_db.XaDb), 0).XpBt), int32(0), _13_x, int32(0))
113063  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_13_db.Xmutex))
113064  	goto _22
113065  _12:
113066  	_14_db = (*Xsqlite3)(crt.VAPointer(&_ap))
113067  	_14_db.XdbOptFlags = uint16(crt.VAInt32(&_ap) & int32(65535))
113068  	goto _22
113069  _13:
113070  	_15_zWord = (*int8)(crt.VAPointer(&_ap))
113071  	_15_n = _sqlite3Strlen30(tls, _15_zWord)
113072  	_rc = func() int32 {
113073  		if _sqlite3KeywordCode(tls, (*uint8)(unsafe.Pointer(_15_zWord)), _15_n) != int32(27) {
113074  			return int32(124)
113075  		}
113076  		return int32(0)
113077  	}()
113078  	goto _22
113079  _14:
113080  	_16_sz = crt.VAInt32(&_ap)
113081  	_16_ppNew = (*unsafe.Pointer)(crt.VAPointer(&_ap))
113082  	_16_pFree = crt.VAPointer(&_ap)
113083  	if _16_sz != 0 {
113084  		*_16_ppNew = _sqlite3ScratchMalloc(tls, _16_sz)
113085  	}
113086  	_sqlite3ScratchFree(tls, _16_pFree)
113087  	goto _22
113088  _15:
113089  	_sqlite3Config.XbLocaltimeFault = crt.VAInt32(&_ap)
113090  	goto _22
113091  _16:
113092  	_sqlite3Config.XneverCorrupt = crt.VAInt32(&_ap)
113093  	goto _22
113094  _17:
113095  	_sqlite3Config.XiOnceResetThreshold = crt.VAInt32(&_ap)
113096  	goto _22
113097  _18:
113098  	goto _22
113099  _19:
113100  	_21_db = (*Xsqlite3)(crt.VAPointer(&_ap))
113101  	_21_db.XnMaxSorterMmap = crt.VAInt32(&_ap)
113102  	goto _22
113103  _20:
113104  	if _sqlite3Config.XisInit == int32(0) {
113105  		_rc = int32(1)
113106  	}
113107  	goto _22
113108  _21:
113109  	_23_db = (*Xsqlite3)(crt.VAPointer(&_ap))
113110  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_23_db.Xmutex))
113111  	_23_db.Xinit.XiDb = uint8(_sqlite3FindDbName(tls, _23_db, (*int8)(crt.VAPointer(&_ap))))
113112  	_23_db.Xinit.Xbusy = store3(&(_23_db.Xinit.XimposterTable), uint8(crt.VAInt32(&_ap)))
113113  	_23_db.Xinit.XnewTnum = crt.VAInt32(&_ap)
113114  	if (int32(_23_db.Xinit.Xbusy) == int32(0)) && ((_23_db.Xinit.XnewTnum) > int32(0)) {
113115  		_sqlite3ResetAllSchemasOfConnection(tls, _23_db)
113116  	}
113117  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_23_db.Xmutex))
113118  	goto _22
113119  _22:
113120  	_ap = nil
113121  	return _rc
113122  }
113123  
113124  func _sqlite3PrngSaveState(tls *crt.TLS) {
113125  	crt.Xmemcpy(tls, unsafe.Pointer(&_sqlite3SavedPrng), unsafe.Pointer(&_sqlite3Prng), uint32(259))
113126  }
113127  
113128  // C comment
113129  //  /*
113130  //  ** For testing purposes, we sometimes want to preserve the state of
113131  //  ** PRNG and restore the PRNG to its saved state at a later time, or
113132  //  ** to reset the PRNG to its initial state.  These routines accomplish
113133  //  ** those tasks.
113134  //  **
113135  //  ** The sqlite3_test_control() interface calls these routines to
113136  //  ** control the PRNG.
113137  //  */
113138  var _sqlite3SavedPrng Tsqlite3PrngType
113139  
113140  func _sqlite3PrngRestoreState(tls *crt.TLS) {
113141  	crt.Xmemcpy(tls, unsafe.Pointer(&_sqlite3Prng), unsafe.Pointer(&_sqlite3SavedPrng), uint32(259))
113142  }
113143  
113144  // C comment
113145  //  /*
113146  //  ** This routine runs an extensive test of the Bitvec code.
113147  //  **
113148  //  ** The input is an array of integers that acts as a program
113149  //  ** to test the Bitvec.  The integers are opcodes followed
113150  //  ** by 0, 1, or 3 operands, depending on the opcode.  Another
113151  //  ** opcode follows immediately after the last operand.
113152  //  **
113153  //  ** There are 6 opcodes numbered from 0 through 5.  0 is the
113154  //  ** "halt" opcode and causes the test to end.
113155  //  **
113156  //  **    0          Halt and return the number of errors
113157  //  **    1 N S X    Set N bits beginning with S and incrementing by X
113158  //  **    2 N S X    Clear N bits beginning with S and incrementing by X
113159  //  **    3 N        Set N randomly chosen bits
113160  //  **    4 N        Clear N randomly chosen bits
113161  //  **    5 N S X    Set N bits from S increment X in array only, not in bitvec
113162  //  **
113163  //  ** The opcodes 1 through 4 perform set and clear operations are performed
113164  //  ** on both a Bitvec object and on a linear array of bits obtained from malloc.
113165  //  ** Opcode 5 works on the linear array only, not on the Bitvec.
113166  //  ** Opcode 5 is used to deliberately induce a fault in order to
113167  //  ** confirm that error detection works.
113168  //  **
113169  //  ** At the conclusion of the test the linear array is compared
113170  //  ** against the Bitvec object.  If there are any differences,
113171  //  ** an error is returned.  If they are the same, zero is returned.
113172  //  **
113173  //  ** If a memory allocation error occurs, return -1.
113174  //  */
113175  func _sqlite3BitvecBuiltinTest(tls *crt.TLS, _sz int32, _aOp *int32) (r0 int32) {
113176  	var _rc, _i, _nx, _pc, _op int32
113177  	var _pTmpSpace unsafe.Pointer
113178  	var _pV *uint8
113179  	var _pBitvec *XBitvec
113180  	_pBitvec = nil
113181  	_pV = nil
113182  	_rc = int32(-1)
113183  	_pBitvec = _sqlite3BitvecCreate(tls, uint32(_sz))
113184  	_pV = (*uint8)(_sqlite3MallocZero(tls, uint64(((_sz+int32(7))/int32(8))+int32(1))))
113185  	_pTmpSpace = Xsqlite3_malloc64(tls, uint64(512))
113186  	if ((_pBitvec == nil) || (_pV == nil)) || (_pTmpSpace == nil) {
113187  		goto _bitvec_end
113188  	}
113189  	_sqlite3BitvecSet(tls, nil, uint32(1))
113190  	_sqlite3BitvecClear(tls, nil, uint32(1), _pTmpSpace)
113191  	_pc = int32(0)
113192  _3:
113193  	if store2(&_op, *elem8(_aOp, uintptr(_pc))) == int32(0) {
113194  		goto _4
113195  	}
113196  	switch _op {
113197  	case int32(1):
113198  		goto _6
113199  	case int32(2):
113200  		goto _6
113201  	case int32(3):
113202  		goto _9
113203  	case int32(4):
113204  		goto _9
113205  	case int32(5):
113206  		goto _6
113207  	default:
113208  		goto _9
113209  	}
113210  
113211  _6:
113212  	_nx = int32(4)
113213  	_i = (*elem8(_aOp, uintptr(_pc+int32(2)))) - int32(1)
113214  	*elem8(_aOp, uintptr(_pc+int32(2))) += *elem8(_aOp, uintptr(_pc+int32(3)))
113215  	goto _12
113216  _9:
113217  	_nx = int32(2)
113218  	Xsqlite3_randomness(tls, int32(4), unsafe.Pointer(&_i))
113219  	goto _12
113220  _12:
113221  	if preInc2(elem8(_aOp, uintptr(_pc+int32(1))), -1) > int32(0) {
113222  		_nx = int32(0)
113223  	}
113224  	_pc += _nx
113225  	_i = (_i & int32(2147483647)) % _sz
113226  	if (_op & int32(1)) == int32(0) {
113227  		goto _14
113228  	}
113229  	{
113230  		p := elem15(_pV, uintptr((_i+int32(1))>>3))
113231  		*p = uint8(int32(*p) | (int32(1) << uint((_i+int32(1))&int32(7))))
113232  	}
113233  	if _op == int32(5) {
113234  		goto _15
113235  	}
113236  	if _sqlite3BitvecSet(tls, _pBitvec, uint32(_i+int32(1))) != 0 {
113237  		goto _bitvec_end
113238  	}
113239  _15:
113240  	goto _17
113241  _14:
113242  	{
113243  		p := elem15(_pV, uintptr((_i+int32(1))>>3))
113244  		*p = uint8(int32(*p) & (^(int32(1) << uint((_i+int32(1))&int32(7)))))
113245  	}
113246  	_sqlite3BitvecClear(tls, _pBitvec, uint32(_i+int32(1)), _pTmpSpace)
113247  _17:
113248  	goto _3
113249  _4:
113250  	_rc = int32(uint32((_sqlite3BitvecTest(tls, nil, 0)+_sqlite3BitvecTest(tls, _pBitvec, uint32(_sz+int32(1))))+_sqlite3BitvecTest(tls, _pBitvec, 0)) + (_sqlite3BitvecSize(tls, _pBitvec) - uint32(_sz)))
113251  	_i = int32(1)
113252  _18:
113253  	if _i > _sz {
113254  		goto _bitvec_end
113255  	}
113256  	if bool2int((int32(*elem15(_pV, uintptr(_i>>3)))&(int32(1)<<uint(_i&int32(7)))) != int32(0)) != _sqlite3BitvecTest(tls, _pBitvec, uint32(_i)) {
113257  		_rc = _i
113258  		goto _bitvec_end
113259  	}
113260  	_i += 1
113261  	goto _18
113262  _bitvec_end:
113263  	Xsqlite3_free(tls, _pTmpSpace)
113264  	Xsqlite3_free(tls, unsafe.Pointer(_pV))
113265  	_sqlite3BitvecDestroy(tls, _pBitvec)
113266  	return _rc
113267  }
113268  
113269  // C comment
113270  //  /*
113271  //  ** Register hooks to call when sqlite3BeginBenignMalloc() and
113272  //  ** sqlite3EndBenignMalloc() are called, respectively.
113273  //  */
113274  func _sqlite3BenignMallocHooks(tls *crt.TLS, _xBenignBegin func(*crt.TLS), _xBenignEnd func(*crt.TLS)) {
113275  	_sqlite3Hooks.XxBenignBegin = _xBenignBegin
113276  	_sqlite3Hooks.XxBenignEnd = _xBenignEnd
113277  }
113278  
113279  var _sqlite3_test_controlØ00__func__Ø000 [21]int8
113280  
113281  func init() {
113282  	crt.Xstrncpy(nil, &_sqlite3_test_controlØ00__func__Ø000[0], str(129496), 21)
113283  }
113284  
113285  // C comment
113286  //  /*
113287  //  ** Enable or disable the extended result codes.
113288  //  */
113289  func Xsqlite3_extended_result_codes(tls *crt.TLS, _db *Xsqlite3, _onoff int32) (r0 int32) {
113290  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
113291  		return _sqlite3MisuseError(tls, int32(143970))
113292  	}
113293  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
113294  	_db.XerrMask = int32(func() uint32 {
113295  		if _onoff != 0 {
113296  			return uint32(4294967295)
113297  		}
113298  		return uint32(255)
113299  	}())
113300  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
113301  	return int32(0)
113302  }
113303  
113304  // C comment
113305  //  /*
113306  //  ** Return a pointer to the next prepared statement after pStmt associated
113307  //  ** with database connection pDb.  If pStmt is NULL, return the first
113308  //  ** prepared statement for the database connection.  Return NULL if there
113309  //  ** are no more.
113310  //  */
113311  func Xsqlite3_next_stmt(tls *crt.TLS, _pDb *Xsqlite3, _pStmt unsafe.Pointer) (r0 unsafe.Pointer) {
113312  	var _pNext unsafe.Pointer
113313  	if _sqlite3SafetyCheckOk(tls, _pDb) == 0 {
113314  		_sqlite3MisuseError(tls, int32(77684))
113315  		return nil
113316  	}
113317  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pDb.Xmutex))
113318  	if _pStmt == nil {
113319  		_pNext = _pDb.XpVdbe
113320  		goto _2
113321  	}
113322  	_pNext = (*TVdbe)(_pStmt).XpNext
113323  _2:
113324  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pDb.Xmutex))
113325  	return _pNext
113326  }
113327  
113328  // C comment
113329  //  /*
113330  //  ** CAPI3REF: SQLite Runtime Status
113331  //  **
113332  //  ** ^These interfaces are used to retrieve runtime status information
113333  //  ** about the performance of SQLite, and optionally to reset various
113334  //  ** highwater marks.  ^The first argument is an integer code for
113335  //  ** the specific parameter to measure.  ^(Recognized integer codes
113336  //  ** are of the form [status parameters | SQLITE_STATUS_...].)^
113337  //  ** ^The current value of the parameter is returned into *pCurrent.
113338  //  ** ^The highest recorded value is returned in *pHighwater.  ^If the
113339  //  ** resetFlag is true, then the highest record value is reset after
113340  //  ** *pHighwater is written.  ^(Some parameters do not record the highest
113341  //  ** value.  For those parameters
113342  //  ** nothing is written into *pHighwater and the resetFlag is ignored.)^
113343  //  ** ^(Other parameters record only the highwater mark and not the current
113344  //  ** value.  For these latter parameters nothing is written into *pCurrent.)^
113345  //  **
113346  //  ** ^The sqlite3_status() and sqlite3_status64() routines return
113347  //  ** SQLITE_OK on success and a non-zero [error code] on failure.
113348  //  **
113349  //  ** If either the current value or the highwater mark is too large to
113350  //  ** be represented by a 32-bit integer, then the values returned by
113351  //  ** sqlite3_status() are undefined.
113352  //  **
113353  //  ** See also: [sqlite3_db_status()]
113354  //  */
113355  func Xsqlite3_status(tls *crt.TLS, _op int32, _pCurrent *int32, _pHighwater *int32, _resetFlag int32) (r0 int32) {
113356  	var _rc int32
113357  	var _iCur, _iHwtr int64
113358  	_iCur = int64(0)
113359  	_iHwtr = int64(0)
113360  	if (_pCurrent == nil) || (_pHighwater == nil) {
113361  		return _sqlite3MisuseError(tls, int32(18636))
113362  	}
113363  	_rc = Xsqlite3_status64(tls, _op, &_iCur, &_iHwtr, _resetFlag)
113364  	if _rc == int32(0) {
113365  		*_pCurrent = int32(_iCur)
113366  		*_pHighwater = int32(_iHwtr)
113367  	}
113368  	return _rc
113369  }
113370  
113371  // C comment
113372  //  /*
113373  //  ** Create an sqlite3_backup process to copy the contents of zSrcDb from
113374  //  ** connection handle pSrcDb to zDestDb in pDestDb. If successful, return
113375  //  ** a pointer to the new sqlite3_backup object.
113376  //  **
113377  //  ** If an error occurs, NULL is returned and an error code and error message
113378  //  ** stored in database handle pDestDb.
113379  //  */
113380  func Xsqlite3_backup_init(tls *crt.TLS, _pDestDb *Xsqlite3, _zDestDb *int8, _pSrcDb *Xsqlite3, _zSrcDb *int8) (r0 *Xsqlite3_backup) {
113381  	var _p *Xsqlite3_backup
113382  	if (_sqlite3SafetyCheckOk(tls, _pSrcDb) == 0) || (_sqlite3SafetyCheckOk(tls, _pDestDb) == 0) {
113383  		_sqlite3MisuseError(tls, int32(69049))
113384  		return nil
113385  	}
113386  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pSrcDb.Xmutex))
113387  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pDestDb.Xmutex))
113388  	if _pSrcDb == _pDestDb {
113389  		_sqlite3ErrorWithMsg(tls, _pDestDb, int32(1), str(129517))
113390  		_p = nil
113391  		goto _3
113392  	}
113393  	_p = (*Xsqlite3_backup)(_sqlite3MallocZero(tls, uint64(48)))
113394  	if _p == nil {
113395  		_sqlite3Error(tls, _pDestDb, _sqlite3NomemError(tls, int32(69077)))
113396  	}
113397  _3:
113398  	if _p == nil {
113399  		goto _5
113400  	}
113401  	*(**XBtree)(unsafe.Pointer(&_p.XpSrc)) = _findBtree(tls, _pDestDb, _pSrcDb, _zSrcDb)
113402  	*(**XBtree)(unsafe.Pointer(&_p.XpDest)) = _findBtree(tls, _pDestDb, _pDestDb, _zDestDb)
113403  	*(**Xsqlite3)(unsafe.Pointer(&_p.XpDestDb)) = _pDestDb
113404  	*(**Xsqlite3)(unsafe.Pointer(&_p.XpSrcDb)) = _pSrcDb
113405  	_p.XiNext = uint32(1)
113406  	_p.XisAttached = int32(0)
113407  	if ((nil == (*XBtree)(_p.XpSrc)) || (nil == (*XBtree)(_p.XpDest))) || (_checkReadTransaction(tls, _pDestDb, (*XBtree)(_p.XpDest)) != int32(0)) {
113408  		Xsqlite3_free(tls, unsafe.Pointer(_p))
113409  		_p = nil
113410  	}
113411  _5:
113412  	if _p != nil {
113413  		(*XBtree)(_p.XpSrc).XnBackup += 1
113414  	}
113415  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pDestDb.Xmutex))
113416  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pSrcDb.Xmutex))
113417  	return _p
113418  }
113419  
113420  // C comment
113421  //  /*
113422  //  ** Return a pointer corresponding to database zDb (i.e. "main", "temp")
113423  //  ** in connection handle pDb. If such a database cannot be found, return
113424  //  ** a NULL pointer and write an error message to pErrorDb.
113425  //  **
113426  //  ** If the "temp" database is requested, it may need to be opened by this
113427  //  ** function. If an error occurs while doing so, return 0 and write an
113428  //  ** error message to pErrorDb.
113429  //  */
113430  func _findBtree(tls *crt.TLS, _pErrorDb *Xsqlite3, _pDb *Xsqlite3, _zDb *int8) (r0 *XBtree) {
113431  	var _i, _1_rc int32
113432  	var _1_sParse XParse
113433  	_i = _sqlite3FindDbName(tls, _pDb, _zDb)
113434  	if _i != int32(1) {
113435  		goto _0
113436  	}
113437  	_1_rc = int32(0)
113438  	crt.Xmemset(tls, unsafe.Pointer(&_1_sParse), int32(0), uint32(484))
113439  	*(**Xsqlite3)(unsafe.Pointer(&_1_sParse.Xdb)) = _pDb
113440  	if _sqlite3OpenTempDatabase(tls, &_1_sParse) != 0 {
113441  		_sqlite3ErrorWithMsg(tls, _pErrorDb, _1_sParse.Xrc, str(24531), unsafe.Pointer(_1_sParse.XzErrMsg))
113442  		_1_rc = int32(1)
113443  	}
113444  	_sqlite3DbFree(tls, _pErrorDb, unsafe.Pointer(_1_sParse.XzErrMsg))
113445  	_sqlite3ParserReset(tls, &_1_sParse)
113446  	if _1_rc != 0 {
113447  		return nil
113448  	}
113449  _0:
113450  	if _i < int32(0) {
113451  		_sqlite3ErrorWithMsg(tls, _pErrorDb, int32(1), str(129557), unsafe.Pointer(_zDb))
113452  		return nil
113453  	}
113454  	return (*XBtree)(elem27((*XDb)(_pDb.XaDb), uintptr(_i)).XpBt)
113455  }
113456  
113457  // C comment
113458  //  /*
113459  //  ** Check that there is no open read-transaction on the b-tree passed as the
113460  //  ** second argument. If there is not, return SQLITE_OK. Otherwise, if there
113461  //  ** is an open read-transaction, return SQLITE_ERROR and leave an error
113462  //  ** message in database handle db.
113463  //  */
113464  func _checkReadTransaction(tls *crt.TLS, _db *Xsqlite3, _p *XBtree) (r0 int32) {
113465  	if _sqlite3BtreeIsInReadTrans(tls, _p) != 0 {
113466  		_sqlite3ErrorWithMsg(tls, _db, int32(1), str(129577))
113467  		return int32(1)
113468  	}
113469  	return int32(0)
113470  }
113471  
113472  // C comment
113473  //  /*
113474  //  ** Return the total number of pages in the source database as of the most
113475  //  ** recent call to sqlite3_backup_step().
113476  //  */
113477  func Xsqlite3_backup_pagecount(tls *crt.TLS, _p *Xsqlite3_backup) (r0 int32) {
113478  	if _p == nil {
113479  		_sqlite3MisuseError(tls, int32(69569))
113480  		return int32(0)
113481  	}
113482  	return int32(_p.XnPagecount)
113483  }
113484  
113485  // C comment
113486  //  /*
113487  //  ** Return the number of pages still to be backed up as of the most recent
113488  //  ** call to sqlite3_backup_step().
113489  //  */
113490  func Xsqlite3_backup_remaining(tls *crt.TLS, _p *Xsqlite3_backup) (r0 int32) {
113491  	if _p == nil {
113492  		_sqlite3MisuseError(tls, int32(69555))
113493  		return int32(0)
113494  	}
113495  	return int32(_p.XnRemaining)
113496  }
113497  
113498  // C comment
113499  //  /*
113500  //  ** Configuration settings for an individual database connection
113501  //  */
113502  func Xsqlite3_db_config(tls *crt.TLS, _db *Xsqlite3, _op int32, args ...interface{}) (r0 int32) {
113503  	var _rc, _3_sz, _3_cnt, _6_onoff, _6_oldFlags int32
113504  	var _4_i uint32
113505  	var _6_pRes *int32
113506  	var _3_pBuf unsafe.Pointer
113507  	var _ap []interface{}
113508  	_ap = args
113509  	switch _op {
113510  	case int32(1000):
113511  		goto _1
113512  	case int32(1001):
113513  		goto _2
113514  	default:
113515  		goto _3
113516  	}
113517  
113518  _1:
113519  	elem27((*XDb)(_db.XaDb), 0).XzDbSName = (*int8)(crt.VAPointer(&_ap))
113520  	_rc = int32(0)
113521  	goto _4
113522  _2:
113523  	_3_pBuf = crt.VAPointer(&_ap)
113524  	_3_sz = crt.VAInt32(&_ap)
113525  	_3_cnt = crt.VAInt32(&_ap)
113526  	_rc = _setupLookaside(tls, _db, _3_pBuf, _3_sz, _3_cnt)
113527  	goto _4
113528  _3:
113529  	_rc = int32(1)
113530  	_4_i = 0
113531  _5:
113532  	if _4_i >= uint32(5) {
113533  		goto _8
113534  	}
113535  	if (elem131((*t132)(unsafe.Pointer(&_sqlite3_db_configØ00aFlagOpØ001)), uintptr(_4_i)).Xop) != _op {
113536  		goto _9
113537  	}
113538  	_6_onoff = crt.VAInt32(&_ap)
113539  	_6_pRes = (*int32)(crt.VAPointer(&_ap))
113540  	_6_oldFlags = _db.Xflags
113541  	if _6_onoff > int32(0) {
113542  		{
113543  			p := &_db.Xflags
113544  			*p = int32(uint32(*p) | (elem131((*t132)(unsafe.Pointer(&_sqlite3_db_configØ00aFlagOpØ001)), uintptr(_4_i)).Xmask))
113545  		}
113546  		goto _12
113547  	}
113548  	if _6_onoff == int32(0) {
113549  		{
113550  			p := &_db.Xflags
113551  			*p = int32(uint32(*p) & (^(elem131((*t132)(unsafe.Pointer(&_sqlite3_db_configØ00aFlagOpØ001)), uintptr(_4_i)).Xmask)))
113552  		}
113553  	}
113554  _12:
113555  	if _6_oldFlags != _db.Xflags {
113556  		_sqlite3ExpirePreparedStatements(tls, _db)
113557  	}
113558  	if _6_pRes != nil {
113559  		*_6_pRes = bool2int((uint32(_db.Xflags) & (elem131((*t132)(unsafe.Pointer(&_sqlite3_db_configØ00aFlagOpØ001)), uintptr(_4_i)).Xmask)) != (0))
113560  	}
113561  	_rc = int32(0)
113562  	goto _8
113563  _9:
113564  	_4_i += 1
113565  	goto _5
113566  _8:
113567  	goto _4
113568  _4:
113569  	_ap = nil
113570  	return _rc
113571  }
113572  
113573  var _sqlite3_db_configØ00aFlagOpØ001 [5]t132
113574  
113575  func init() {
113576  	_sqlite3_db_configØ00aFlagOpØ001 = [5]t132{t132{Xop: int32(1002), Xmask: uint32(524288)}, t132{Xop: int32(1003), Xmask: uint32(16777216)}, t132{Xop: int32(1004), Xmask: uint32(1073741824)}, t132{Xop: int32(1005), Xmask: uint32(4194304)}, t132{Xop: int32(1006), Xmask: uint32(2147483648)}}
113577  }
113578  
113579  // C comment
113580  //  /*
113581  //  ** Return the mutex associated with a database connection.
113582  //  */
113583  func Xsqlite3_db_mutex(tls *crt.TLS, _db *Xsqlite3) (r0 *Xsqlite3_mutex) {
113584  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
113585  		_sqlite3MisuseError(tls, int32(141191))
113586  		return nil
113587  	}
113588  	return (*Xsqlite3_mutex)(_db.Xmutex)
113589  }
113590  
113591  // C comment
113592  //  /*
113593  //  ** Query status information for a single database connection
113594  //  */
113595  func Xsqlite3_db_status(tls *crt.TLS, _db *Xsqlite3, _op int32, _pCurrent *int32, _pHighwater *int32, _resetFlag int32) (r0 int32) {
113596  	var _rc, _7_totalUsed, _7_i, _9_nByte, _11_i, _11_nByte, _16_nByte, _18_i, _18_nRet int32
113597  	var _8_pBt *XBtree
113598  	var _9_pPager, _20_pPager *XPager
113599  	var _12_pSchema *XSchema
113600  	var _13_p *XHashElem
113601  	var _16_pVdbe *TVdbe
113602  	_rc = int32(0)
113603  	if ((_sqlite3SafetyCheckOk(tls, _db) == 0) || (_pCurrent == nil)) || (_pHighwater == nil) {
113604  		return _sqlite3MisuseError(tls, int32(18659))
113605  	}
113606  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
113607  	switch _op {
113608  	case int32(0):
113609  		goto _4
113610  	case int32(1):
113611  		goto _8
113612  	case int32(2):
113613  		goto _10
113614  	case int32(3):
113615  		goto _11
113616  	case int32(4):
113617  		goto _5
113618  	case int32(5):
113619  		goto _5
113620  	case int32(6):
113621  		goto _5
113622  	case int32(7):
113623  		goto _12
113624  	case int32(8):
113625  		goto _12
113626  	case int32(9):
113627  		goto _12
113628  	case int32(10):
113629  		goto _15
113630  	case int32(11):
113631  		goto _8
113632  	default:
113633  		goto _16
113634  	}
113635  
113636  _4:
113637  	*_pCurrent = _db.Xlookaside.XnOut
113638  	*_pHighwater = _db.Xlookaside.XmxOut
113639  	if _resetFlag != 0 {
113640  		_db.Xlookaside.XmxOut = _db.Xlookaside.XnOut
113641  	}
113642  	goto _18
113643  _5:
113644  	func() {
113645  		if (_op - int32(4)) < int32(0) {
113646  			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)))
113647  			crt.X__builtin_abort(tls)
113648  		}
113649  	}()
113650  	func() {
113651  		if (_op - int32(4)) >= int32(3) {
113652  			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)))
113653  			crt.X__builtin_abort(tls)
113654  		}
113655  	}()
113656  	*_pCurrent = int32(0)
113657  	*_pHighwater = *elem8((*int32)(unsafe.Pointer(&(_db.Xlookaside.XanStat))), uintptr(_op-int32(4)))
113658  	if _resetFlag != 0 {
113659  		*elem8((*int32)(unsafe.Pointer(&(_db.Xlookaside.XanStat))), uintptr(_op-int32(4))) = int32(0)
113660  	}
113661  	goto _18
113662  _8:
113663  	_7_totalUsed = int32(0)
113664  	_sqlite3BtreeEnterAll(tls, _db)
113665  	_7_i = int32(0)
113666  _24:
113667  	if _7_i >= _db.XnDb {
113668  		goto _27
113669  	}
113670  	_8_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_7_i)).XpBt)
113671  	if _8_pBt == nil {
113672  		goto _28
113673  	}
113674  	_9_pPager = _sqlite3BtreePager(tls, _8_pBt)
113675  	_9_nByte = _sqlite3PagerMemUsed(tls, _9_pPager)
113676  	if _op == int32(11) {
113677  		_9_nByte = _9_nByte / _sqlite3BtreeConnectionCount(tls, _8_pBt)
113678  	}
113679  	_7_totalUsed += _9_nByte
113680  _28:
113681  	_7_i += 1
113682  	goto _24
113683  _27:
113684  	_sqlite3BtreeLeaveAll(tls, _db)
113685  	*_pCurrent = _7_totalUsed
113686  	*_pHighwater = int32(0)
113687  	goto _18
113688  _10:
113689  	_11_nByte = int32(0)
113690  	_sqlite3BtreeEnterAll(tls, _db)
113691  	_db.XpnBytesFreed = &_11_nByte
113692  	_11_i = int32(0)
113693  _30:
113694  	if _11_i >= _db.XnDb {
113695  		goto _33
113696  	}
113697  	_12_pSchema = (*XSchema)(elem27((*XDb)(_db.XaDb), uintptr(_11_i)).XpSchema)
113698  	if func() int32 {
113699  		if _12_pSchema != nil {
113700  			return int32(1)
113701  		}
113702  		return func() int32 {
113703  			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)))
113704  			crt.X__builtin_abort(tls)
113705  			return int32(0)
113706  		}()
113707  	}() == 0 {
113708  		goto _36
113709  	}
113710  	{
113711  		p := &_11_nByte
113712  		*p = int32(uint32(*p) + (uint32((_sqlite3Config.Xm.XxRoundup)(tls, int32(16))) * ((((_12_pSchema.XtblHash.Xcount) + (_12_pSchema.XtrigHash.Xcount)) + (_12_pSchema.XidxHash.Xcount)) + (_12_pSchema.XfkeyHash.Xcount))))
113713  	}
113714  	{
113715  		p := &_11_nByte
113716  		*p = int32(uint64(*p) + Xsqlite3_msize(tls, _12_pSchema.XtblHash.Xht))
113717  	}
113718  	{
113719  		p := &_11_nByte
113720  		*p = int32(uint64(*p) + Xsqlite3_msize(tls, _12_pSchema.XtrigHash.Xht))
113721  	}
113722  	{
113723  		p := &_11_nByte
113724  		*p = int32(uint64(*p) + Xsqlite3_msize(tls, _12_pSchema.XidxHash.Xht))
113725  	}
113726  	{
113727  		p := &_11_nByte
113728  		*p = int32(uint64(*p) + Xsqlite3_msize(tls, _12_pSchema.XfkeyHash.Xht))
113729  	}
113730  	_13_p = (*XHashElem)(_12_pSchema.XtrigHash.Xfirst)
113731  _37:
113732  	if _13_p == nil {
113733  		goto _40
113734  	}
113735  	_sqlite3DeleteTrigger(tls, _db, (*XTrigger)(_13_p.Xdata))
113736  	_13_p = (*XHashElem)(_13_p.Xnext)
113737  	goto _37
113738  _40:
113739  	_13_p = (*XHashElem)(_12_pSchema.XtblHash.Xfirst)
113740  _41:
113741  	if _13_p == nil {
113742  		goto _44
113743  	}
113744  	_sqlite3DeleteTable(tls, _db, (*XTable)(_13_p.Xdata))
113745  	_13_p = (*XHashElem)(_13_p.Xnext)
113746  	goto _41
113747  _44:
113748  _36:
113749  	_11_i += 1
113750  	goto _30
113751  _33:
113752  	_db.XpnBytesFreed = nil
113753  	_sqlite3BtreeLeaveAll(tls, _db)
113754  	*_pHighwater = int32(0)
113755  	*_pCurrent = _11_nByte
113756  	goto _18
113757  _11:
113758  	_16_nByte = int32(0)
113759  	_db.XpnBytesFreed = &_16_nByte
113760  	_16_pVdbe = (*TVdbe)(_db.XpVdbe)
113761  _45:
113762  	if _16_pVdbe == nil {
113763  		goto _48
113764  	}
113765  	_sqlite3VdbeClearObject(tls, _db, _16_pVdbe)
113766  	_sqlite3DbFree(tls, _db, unsafe.Pointer(_16_pVdbe))
113767  	_16_pVdbe = (*TVdbe)(_16_pVdbe.XpNext)
113768  	goto _45
113769  _48:
113770  	_db.XpnBytesFreed = nil
113771  	*_pHighwater = int32(0)
113772  	*_pCurrent = _16_nByte
113773  	goto _18
113774  _12:
113775  	_18_nRet = int32(0)
113776  
113777  	_18_i = int32(0)
113778  _49:
113779  	if _18_i >= _db.XnDb {
113780  		goto _52
113781  	}
113782  	if (elem27((*XDb)(_db.XaDb), uintptr(_18_i)).XpBt) != nil {
113783  		_20_pPager = _sqlite3BtreePager(tls, (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_18_i)).XpBt))
113784  		_sqlite3PagerCacheStat(tls, _20_pPager, _op, _resetFlag, &_18_nRet)
113785  	}
113786  	_18_i += 1
113787  	goto _49
113788  _52:
113789  	*_pHighwater = int32(0)
113790  	*_pCurrent = _18_nRet
113791  	goto _18
113792  _15:
113793  	*_pHighwater = int32(0)
113794  	*_pCurrent = bool2int((_db.XnDeferredImmCons > (0)) || (_db.XnDeferredCons > (0)))
113795  	goto _18
113796  _16:
113797  	_rc = int32(1)
113798  _18:
113799  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
113800  	return _rc
113801  }
113802  
113803  var _sqlite3_db_statusØ00__func__Ø000 [18]int8
113804  
113805  func init() {
113806  	crt.Xstrncpy(nil, &_sqlite3_db_statusØ00__func__Ø000[0], str(129683), 18)
113807  }
113808  
113809  // C comment
113810  //  /*
113811  //  ** Return the approximate number of bytes of memory currently
113812  //  ** used by the pager and its associated cache.
113813  //  */
113814  func _sqlite3PagerMemUsed(tls *crt.TLS, _pPager *XPager) (r0 int32) {
113815  	var _perPageSize int32
113816  	_perPageSize = int32((uint32(_pPager.XpageSize+int32(_pPager.XnExtra)) + uint32(40)) + uint32(20))
113817  	return ((_perPageSize * _sqlite3PcachePagecount(tls, (*XPCache)(_pPager.XpPCache))) + _sqlite3MallocSize(tls, unsafe.Pointer(_pPager))) + _pPager.XpageSize
113818  }
113819  
113820  func Xsqlite3_msize(tls *crt.TLS, _p unsafe.Pointer) (r0 uint64) {
113821  	return uint64(func() int32 {
113822  		if _p != nil {
113823  			return (_sqlite3Config.Xm.XxSize)(tls, _p)
113824  		}
113825  		return int32(0)
113826  	}())
113827  }
113828  
113829  // C comment
113830  //  /*
113831  //  ** Parameter eStat must be either SQLITE_DBSTATUS_CACHE_HIT or
113832  //  ** SQLITE_DBSTATUS_CACHE_MISS. Before returning, *pnVal is incremented by the
113833  //  ** current cache hit or miss count, according to the value of eStat. If the
113834  //  ** reset parameter is non-zero, the cache hit or miss count is zeroed before
113835  //  ** returning.
113836  //  */
113837  func _sqlite3PagerCacheStat(tls *crt.TLS, _pPager *XPager, _eStat int32, _reset int32, _pnVal *int32) {
113838  	func() {
113839  		if _eStat != int32(7) && _eStat != int32(8) && _eStat != int32(9) {
113840  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(53576), unsafe.Pointer(&_sqlite3PagerCacheStatØ00__func__Ø000), unsafe.Pointer(str(129701)))
113841  			crt.X__builtin_abort(tls)
113842  		}
113843  	}()
113844  
113845  	*_pnVal += *elem8((*int32)(unsafe.Pointer(&_pPager.XaStat)), uintptr(_eStat-int32(7)))
113846  	if _reset != 0 {
113847  		*elem8((*int32)(unsafe.Pointer(&_pPager.XaStat)), uintptr(_eStat-int32(7))) = int32(0)
113848  	}
113849  }
113850  
113851  var _sqlite3PagerCacheStatØ00__func__Ø000 [22]int8
113852  
113853  func init() {
113854  	crt.Xstrncpy(nil, &_sqlite3PagerCacheStatØ00__func__Ø000[0], str(129809), 22)
113855  }
113856  
113857  func Xsqlite3_extended_errcode(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
113858  	if (_db != nil) && (_sqlite3SafetyCheckSickOrOk(tls, _db) == 0) {
113859  		return _sqlite3MisuseError(tls, int32(142786))
113860  	}
113861  	if (_db == nil) || (_db.XmallocFailed != 0) {
113862  		return _sqlite3NomemError(tls, int32(142789))
113863  	}
113864  	return _db.XerrCode
113865  }
113866  
113867  // C comment
113868  //  /*
113869  //  ** Return the value of a status counter for a prepared statement
113870  //  */
113871  func Xsqlite3_stmt_status(tls *crt.TLS, _pStmt unsafe.Pointer, _op int32, _resetFlag int32) (r0 int32) {
113872  	var _v uint32
113873  	var _pVdbe *TVdbe
113874  	_pVdbe = (*TVdbe)(_pStmt)
113875  	if _pStmt == nil {
113876  		_sqlite3MisuseError(tls, int32(77706))
113877  		return int32(0)
113878  	}
113879  	_v = *elem7((*uint32)(unsafe.Pointer(&_pVdbe.XaCounter)), uintptr(_op))
113880  	if _resetFlag != 0 {
113881  		*elem7((*uint32)(unsafe.Pointer(&_pVdbe.XaCounter)), uintptr(_op)) = 0
113882  	}
113883  	return int32(_v)
113884  }
113885  
113886  // C comment
113887  //  /*
113888  //  ** Move an existing blob handle to point to a different row of the same
113889  //  ** database table.
113890  //  **
113891  //  ** If an error occurs, or if the specified row does not exist or does not
113892  //  ** contain a blob or text value, then an error code is returned and the
113893  //  ** database handle error code and message set. If this happens, then all
113894  //  ** subsequent calls to sqlite3_blob_xxx() functions (except blob_close())
113895  //  ** immediately return SQLITE_ABORT.
113896  //  */
113897  func Xsqlite3_blob_reopen(tls *crt.TLS, _pBlob unsafe.Pointer, _iRow int64) (r0 int32) {
113898  	var _rc int32
113899  	var _2_zErr *int8
113900  	var _db *Xsqlite3
113901  	var _p *XIncrblob
113902  	_p = (*XIncrblob)(_pBlob)
113903  	if _p == nil {
113904  		return _sqlite3MisuseError(tls, int32(85986))
113905  	}
113906  	_db = (*Xsqlite3)(_p.Xdb)
113907  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
113908  	if _p.XpStmt == nil {
113909  		_rc = int32(4)
113910  		goto _2
113911  	}
113912  	_rc = _blobSeekToRow(tls, _p, _iRow, &_2_zErr)
113913  	if _rc != int32(0) {
113914  		_sqlite3ErrorWithMsg(tls, _db, _rc, func() *int8 {
113915  			if _2_zErr != nil {
113916  				return str(24531)
113917  			}
113918  			return nil
113919  		}(), unsafe.Pointer(_2_zErr))
113920  		_sqlite3DbFree(tls, _db, unsafe.Pointer(_2_zErr))
113921  	}
113922  	func() {
113923  		if _rc == int32(17) {
113924  			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)))
113925  			crt.X__builtin_abort(tls)
113926  		}
113927  	}()
113928  _2:
113929  	_rc = _sqlite3ApiExit(tls, _db, _rc)
113930  	func() {
113931  		if _rc != int32(0) && _p.XpStmt != nil {
113932  			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)))
113933  			crt.X__builtin_abort(tls)
113934  		}
113935  	}()
113936  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
113937  	return _rc
113938  }
113939  
113940  var _sqlite3_blob_reopenØ00__func__Ø000 [20]int8
113941  
113942  func init() {
113943  	crt.Xstrncpy(nil, &_sqlite3_blob_reopenØ00__func__Ø000[0], str(129878), 20)
113944  }
113945  
113946  // C comment
113947  //  /*
113948  //  ** Call from within the xCreate() or xConnect() methods to provide
113949  //  ** the SQLite core with additional information about the behavior
113950  //  ** of the virtual table being implemented.
113951  //  */
113952  func Xsqlite3_vtab_config(tls *crt.TLS, _db *Xsqlite3, _op int32, args ...interface{}) (r0 int32) {
113953  	var _rc int32
113954  	var _ap []interface{}
113955  	var _2_p *XVtabCtx
113956  	_rc = int32(0)
113957  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
113958  		return _sqlite3MisuseError(tls, int32(126200))
113959  	}
113960  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
113961  	_ap = args
113962  	switch _op {
113963  	case int32(1):
113964  		goto _2
113965  	default:
113966  		goto _3
113967  	}
113968  
113969  _2:
113970  	_2_p = (*XVtabCtx)(_db.XpVtabCtx)
113971  	if _2_p == nil {
113972  		_rc = _sqlite3MisuseError(tls, int32(126208))
113973  		goto _5
113974  	}
113975  	func() {
113976  		if (*XTable)(_2_p.XpTab) != nil && ((*XTable)(_2_p.XpTab).XnModuleArg) == 0 {
113977  			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)))
113978  			crt.X__builtin_abort(tls)
113979  		}
113980  	}()
113981  	(*XVTable)(_2_p.XpVTable).XbConstraint = uint8(crt.VAInt32(&_ap))
113982  _5:
113983  	goto _9
113984  _3:
113985  	_rc = _sqlite3MisuseError(tls, int32(126216))
113986  	goto _9
113987  _9:
113988  	_ap = nil
113989  	if _rc != int32(0) {
113990  		_sqlite3Error(tls, _db, _rc)
113991  	}
113992  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
113993  	return _rc
113994  }
113995  
113996  var _sqlite3_vtab_configØ00__func__Ø000 [20]int8
113997  
113998  func init() {
113999  	crt.Xstrncpy(nil, &_sqlite3_vtab_configØ00__func__Ø000[0], str(129931), 20)
114000  }
114001  
114002  // C comment
114003  //  /*
114004  //  ** Return the ON CONFLICT resolution mode in effect for the virtual
114005  //  ** table update operation currently in progress.
114006  //  **
114007  //  ** The results of this routine are undefined unless it is called from
114008  //  ** within an xUpdate method.
114009  //  */
114010  func Xsqlite3_vtab_on_conflict(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
114011  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
114012  		return _sqlite3MisuseError(tls, int32(126182))
114013  	}
114014  
114015  	func() {
114016  		if int32(_db.XvtabOnConflict) < int32(1) || int32(_db.XvtabOnConflict) > int32(5) {
114017  			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)))
114018  			crt.X__builtin_abort(tls)
114019  		}
114020  	}()
114021  	return int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3_vtab_on_conflictØ00aMapØ001)), uintptr(int32(_db.XvtabOnConflict)-int32(1))))
114022  }
114023  
114024  var _sqlite3_vtab_on_conflictØ00__func__Ø000 [25]int8
114025  
114026  func init() {
114027  	crt.Xstrncpy(nil, &_sqlite3_vtab_on_conflictØ00__func__Ø000[0], str(129998), 25)
114028  }
114029  
114030  var _sqlite3_vtab_on_conflictØ00aMapØ001 [5]uint8
114031  
114032  func init() {
114033  	_sqlite3_vtab_on_conflictØ00aMapØ001 = [5]uint8{1, 4, 3, 2, 5}
114034  }
114035  
114036  func Xsqlite3_close_v2(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
114037  	return _sqlite3Close(tls, _db, int32(1))
114038  }
114039  
114040  // C comment
114041  //  /*
114042  //  ** Return the filename of the database associated with a database
114043  //  ** connection.
114044  //  */
114045  func Xsqlite3_db_filename(tls *crt.TLS, _db *Xsqlite3, _zDbName *int8) (r0 *int8) {
114046  	var _pBt *XBtree
114047  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
114048  		_sqlite3MisuseError(tls, int32(144428))
114049  		return nil
114050  	}
114051  	_pBt = _sqlite3DbNameToBtree(tls, _db, _zDbName)
114052  	return func() *int8 {
114053  		if _pBt != nil {
114054  			return _sqlite3BtreeGetFilename(tls, _pBt)
114055  		}
114056  		return nil
114057  	}()
114058  }
114059  
114060  // C comment
114061  //  /*
114062  //  ** Return 1 if database is read-only or 0 if read/write.  Return -1 if
114063  //  ** no such database exists.
114064  //  */
114065  func Xsqlite3_db_readonly(tls *crt.TLS, _db *Xsqlite3, _zDbName *int8) (r0 int32) {
114066  	var _pBt *XBtree
114067  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
114068  		_sqlite3MisuseError(tls, int32(144444))
114069  		return int32(-1)
114070  	}
114071  	_pBt = _sqlite3DbNameToBtree(tls, _db, _zDbName)
114072  	return func() int32 {
114073  		if _pBt != nil {
114074  			return _sqlite3BtreeIsReadonly(tls, _pBt)
114075  		}
114076  		return int32(-1)
114077  	}()
114078  }
114079  
114080  // C comment
114081  //  /*
114082  //  ** Return a string that describes the kind of error specified in the
114083  //  ** argument.  For now, this simply calls the internal sqlite3ErrStr()
114084  //  ** function.
114085  //  */
114086  func Xsqlite3_errstr(tls *crt.TLS, _rc int32) (r0 *int8) {
114087  	return _sqlite3ErrStr(tls, _rc)
114088  }
114089  
114090  // C comment
114091  //  /*
114092  //  ** Return true if the prepared statement is guaranteed to not modify the
114093  //  ** database.
114094  //  */
114095  func Xsqlite3_stmt_readonly(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
114096  	return int32(func() uint32 {
114097  		if _pStmt != nil {
114098  			return ((uint32(((*TVdbe)(_pStmt).Xexpired)>>7) << 31) >> 31)
114099  		}
114100  		return uint32(1)
114101  	}())
114102  }
114103  
114104  // C comment
114105  //  /*
114106  //  ** Return a 64-bit integer value for a query parameter.
114107  //  */
114108  func Xsqlite3_uri_int64(tls *crt.TLS, _zFilename *int8, _zParam *int8, _bDflt int64) (r0 int64) {
114109  	var _v int64
114110  	var _z *int8
114111  	_z = Xsqlite3_uri_parameter(tls, _zFilename, _zParam)
114112  	if (_z != nil) && (_sqlite3DecOrHexToI64(tls, _z, &_v) == int32(0)) {
114113  		_bDflt = _v
114114  	}
114115  	return _bDflt
114116  }
114117  
114118  // C comment
114119  //  /*
114120  //  ** Register a statically linked extension that is automatically
114121  //  ** loaded by every new database connection.
114122  //  */
114123  func Xsqlite3_auto_extension(tls *crt.TLS, _xInit func(*crt.TLS)) (r0 int32) {
114124  	var _rc int32
114125  	var _2_i uint32
114126  	var _4_nByte uint64
114127  	var _2_mutex *Xsqlite3_mutex
114128  	var _4_aNew *func(*crt.TLS)
114129  	_rc = int32(0)
114130  	_rc = Xsqlite3_initialize(tls)
114131  	if _rc != 0 {
114132  		return _rc
114133  	}
114134  	_2_mutex = _sqlite3MutexAlloc(tls, int32(2))
114135  	Xsqlite3_mutex_enter(tls, _2_mutex)
114136  	_2_i = 0
114137  _2:
114138  	if _2_i >= _sqlite3Autoext.XnExt {
114139  		goto _5
114140  	}
114141  	if *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{(*elem130(_sqlite3Autoext.XaExt, uintptr(_2_i)))})) == *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{_xInit})) {
114142  		goto _5
114143  	}
114144  	_2_i += 1
114145  	goto _2
114146  _5:
114147  	if _2_i != _sqlite3Autoext.XnExt {
114148  		goto _7
114149  	}
114150  	_4_nByte = uint64((_sqlite3Autoext.XnExt + uint32(1)) * uint32(4))
114151  	_4_aNew = (*func(*crt.TLS))(Xsqlite3_realloc64(tls, unsafe.Pointer(_sqlite3Autoext.XaExt), _4_nByte))
114152  	if _4_aNew == nil {
114153  		_rc = _sqlite3NomemError(tls, int32(112498))
114154  		goto _9
114155  	}
114156  	_sqlite3Autoext.XaExt = _4_aNew
114157  	*elem130(_sqlite3Autoext.XaExt, uintptr(_sqlite3Autoext.XnExt)) = _xInit
114158  	_sqlite3Autoext.XnExt += 1
114159  _9:
114160  _7:
114161  	Xsqlite3_mutex_leave(tls, _2_mutex)
114162  	func() {
114163  		if (_rc & int32(255)) != _rc {
114164  			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)))
114165  			crt.X__builtin_abort(tls)
114166  		}
114167  	}()
114168  	return _rc
114169  }
114170  
114171  var _sqlite3_auto_extensionØ00__func__Ø000 [23]int8
114172  
114173  func init() {
114174  	crt.Xstrncpy(nil, &_sqlite3_auto_extensionØ00__func__Ø000[0], str(130023), 23)
114175  }
114176  
114177  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) {
114178  	func() {
114179  		if *(*uintptr)(unsafe.Pointer(&struct {
114180  			f func(*crt.TLS, unsafe.Pointer)
114181  		}{_xDel})) == *(*uintptr)(unsafe.Pointer(&struct {
114182  			f func(*crt.TLS, unsafe.Pointer)
114183  		}{func() func(*crt.TLS, unsafe.Pointer) {
114184  			v := _sqlite3MallocSize
114185  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
114186  		}()})) {
114187  			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)))
114188  			crt.X__builtin_abort(tls)
114189  		}
114190  	}()
114191  	if _nData > uint64(2147483647) {
114192  		return _invokeValueDestructor(tls, _zData, _xDel, nil)
114193  	}
114194  	return _bindText(tls, _pStmt, _i, _zData, int32(_nData), _xDel, 0)
114195  }
114196  
114197  var _sqlite3_bind_blob64Ø00__func__Ø000 [20]int8
114198  
114199  func init() {
114200  	crt.Xstrncpy(nil, &_sqlite3_bind_blob64Ø00__func__Ø000[0], str(130067), 20)
114201  }
114202  
114203  func _invokeValueDestructor(tls *crt.TLS, _p unsafe.Pointer, _xDel func(*crt.TLS, unsafe.Pointer), _pCtx *Xsqlite3_context) (r0 int32) {
114204  	func() {
114205  		if *(*uintptr)(unsafe.Pointer(&struct {
114206  			f func(*crt.TLS, unsafe.Pointer)
114207  		}{_xDel})) == *(*uintptr)(unsafe.Pointer(&struct {
114208  			f func(*crt.TLS, unsafe.Pointer)
114209  		}{func() func(*crt.TLS, unsafe.Pointer) {
114210  			v := _sqlite3MallocSize
114211  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
114212  		}()})) {
114213  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(76411), unsafe.Pointer(&_invokeValueDestructorØ00__func__Ø000), unsafe.Pointer(str(130046)))
114214  			crt.X__builtin_abort(tls)
114215  		}
114216  	}()
114217  	if _xDel == nil {
114218  		goto _5
114219  	}
114220  	if *(*uintptr)(unsafe.Pointer(&struct {
114221  		f func(*crt.TLS, unsafe.Pointer)
114222  	}{_xDel})) == *(*uintptr)(unsafe.Pointer(&struct {
114223  		f func(*crt.TLS, unsafe.Pointer)
114224  	}{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))})) {
114225  		goto _5
114226  	}
114227  	_xDel(tls, _p)
114228  _5:
114229  	if _pCtx != nil {
114230  		Xsqlite3_result_error_toobig(tls, _pCtx)
114231  	}
114232  	return int32(18)
114233  }
114234  
114235  var _invokeValueDestructorØ00__func__Ø000 [22]int8
114236  
114237  func init() {
114238  	crt.Xstrncpy(nil, &_invokeValueDestructorØ00__func__Ø000[0], str(130087), 22)
114239  }
114240  
114241  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) {
114242  	func() {
114243  		if *(*uintptr)(unsafe.Pointer(&struct {
114244  			f func(*crt.TLS, unsafe.Pointer)
114245  		}{_xDel})) == *(*uintptr)(unsafe.Pointer(&struct {
114246  			f func(*crt.TLS, unsafe.Pointer)
114247  		}{func() func(*crt.TLS, unsafe.Pointer) {
114248  			v := _sqlite3MallocSize
114249  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
114250  		}()})) {
114251  			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)))
114252  			crt.X__builtin_abort(tls)
114253  		}
114254  	}()
114255  	if _nData > uint64(2147483647) {
114256  		return _invokeValueDestructor(tls, unsafe.Pointer(_zData), _xDel, nil)
114257  	}
114258  	if int32(_enc) == int32(4) {
114259  		_enc = uint8(2)
114260  	}
114261  	return _bindText(tls, _pStmt, _i, unsafe.Pointer(_zData), int32(_nData), _xDel, _enc)
114262  }
114263  
114264  var _sqlite3_bind_text64Ø00__func__Ø000 [20]int8
114265  
114266  func init() {
114267  	crt.Xstrncpy(nil, &_sqlite3_bind_text64Ø00__func__Ø000[0], str(130109), 20)
114268  }
114269  
114270  // C comment
114271  //  /*
114272  //  ** Cancel a prior call to sqlite3_auto_extension.  Remove xInit from the
114273  //  ** set of routines that is invoked for each new database connection, if it
114274  //  ** is currently on the list.  If xInit is not on the list, then this
114275  //  ** routine is a no-op.
114276  //  **
114277  //  ** Return 1 if xInit was found on the list and removed.  Return 0 if xInit
114278  //  ** was not on the list.
114279  //  */
114280  func Xsqlite3_cancel_auto_extension(tls *crt.TLS, _xInit func(*crt.TLS)) (r0 int32) {
114281  	var _i, _n int32
114282  	var _mutex *Xsqlite3_mutex
114283  	_mutex = _sqlite3MutexAlloc(tls, int32(2))
114284  	_n = int32(0)
114285  	Xsqlite3_mutex_enter(tls, _mutex)
114286  	_i = int32(_sqlite3Autoext.XnExt) - int32(1)
114287  _0:
114288  	if _i < int32(0) {
114289  		goto _3
114290  	}
114291  	if *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{(*elem130(_sqlite3Autoext.XaExt, uintptr(_i)))})) == *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{_xInit})) {
114292  		_sqlite3Autoext.XnExt -= 1
114293  		*elem130(_sqlite3Autoext.XaExt, uintptr(_i)) = *elem130(_sqlite3Autoext.XaExt, uintptr(_sqlite3Autoext.XnExt))
114294  		_n += 1
114295  		goto _3
114296  	}
114297  	_i -= 1
114298  	goto _0
114299  _3:
114300  	Xsqlite3_mutex_leave(tls, _mutex)
114301  	return _n
114302  }
114303  
114304  // C comment
114305  //  /*
114306  //  ** Reset the automatic extension loading mechanism.
114307  //  */
114308  func Xsqlite3_reset_auto_extension(tls *crt.TLS) {
114309  	var _1_mutex *Xsqlite3_mutex
114310  	if Xsqlite3_initialize(tls) == int32(0) {
114311  		_1_mutex = _sqlite3MutexAlloc(tls, int32(2))
114312  		Xsqlite3_mutex_enter(tls, _1_mutex)
114313  		Xsqlite3_free(tls, unsafe.Pointer(_sqlite3Autoext.XaExt))
114314  		_sqlite3Autoext.XaExt = nil
114315  		_sqlite3Autoext.XnExt = 0
114316  		Xsqlite3_mutex_leave(tls, _1_mutex)
114317  	}
114318  }
114319  
114320  func Xsqlite3_result_blob64(tls *crt.TLS, _pCtx *Xsqlite3_context, _z unsafe.Pointer, _n uint64, _xDel func(*crt.TLS, unsafe.Pointer)) {
114321  	func() {
114322  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
114323  			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)))
114324  			crt.X__builtin_abort(tls)
114325  		}
114326  	}()
114327  	func() {
114328  		if *(*uintptr)(unsafe.Pointer(&struct {
114329  			f func(*crt.TLS, unsafe.Pointer)
114330  		}{_xDel})) == *(*uintptr)(unsafe.Pointer(&struct {
114331  			f func(*crt.TLS, unsafe.Pointer)
114332  		}{func() func(*crt.TLS, unsafe.Pointer) {
114333  			v := _sqlite3MallocSize
114334  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
114335  		}()})) {
114336  			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)))
114337  			crt.X__builtin_abort(tls)
114338  		}
114339  	}()
114340  	if _n > uint64(2147483647) {
114341  		_invokeValueDestructor(tls, _z, _xDel, _pCtx)
114342  		goto _5
114343  	}
114344  	_setResultStrOrError(tls, _pCtx, (*int8)(_z), int32(_n), 0, _xDel)
114345  _5:
114346  }
114347  
114348  var _sqlite3_result_blob64Ø00__func__Ø000 [22]int8
114349  
114350  func init() {
114351  	crt.Xstrncpy(nil, &_sqlite3_result_blob64Ø00__func__Ø000[0], str(130129), 22)
114352  }
114353  
114354  func Xsqlite3_result_text64(tls *crt.TLS, _pCtx *Xsqlite3_context, _z *int8, _n uint64, _xDel func(*crt.TLS, unsafe.Pointer), _enc uint8) {
114355  	func() {
114356  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.XpOut).Xdb).Xmutex)) == 0 {
114357  			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)))
114358  			crt.X__builtin_abort(tls)
114359  		}
114360  	}()
114361  	func() {
114362  		if *(*uintptr)(unsafe.Pointer(&struct {
114363  			f func(*crt.TLS, unsafe.Pointer)
114364  		}{_xDel})) == *(*uintptr)(unsafe.Pointer(&struct {
114365  			f func(*crt.TLS, unsafe.Pointer)
114366  		}{func() func(*crt.TLS, unsafe.Pointer) {
114367  			v := _sqlite3MallocSize
114368  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
114369  		}()})) {
114370  			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)))
114371  			crt.X__builtin_abort(tls)
114372  		}
114373  	}()
114374  	if int32(_enc) == int32(4) {
114375  		_enc = uint8(2)
114376  	}
114377  	if _n > uint64(2147483647) {
114378  		_invokeValueDestructor(tls, unsafe.Pointer(_z), _xDel, _pCtx)
114379  		goto _6
114380  	}
114381  	_setResultStrOrError(tls, _pCtx, _z, int32(_n), _enc, _xDel)
114382  _6:
114383  }
114384  
114385  var _sqlite3_result_text64Ø00__func__Ø000 [22]int8
114386  
114387  func init() {
114388  	crt.Xstrncpy(nil, &_sqlite3_result_text64Ø00__func__Ø000[0], str(130151), 22)
114389  }
114390  
114391  // C comment
114392  //  /* Make a copy of an sqlite3_value object
114393  //  */
114394  func Xsqlite3_value_dup(tls *crt.TLS, _pOrig *XMem) (r0 *XMem) {
114395  	var _pNew *XMem
114396  	if _pOrig == nil {
114397  		return nil
114398  	}
114399  	_pNew = (*XMem)(Xsqlite3_malloc(tls, int32(48)))
114400  	if _pNew == nil {
114401  		return nil
114402  	}
114403  	crt.Xmemset(tls, unsafe.Pointer(_pNew), int32(0), uint32(48))
114404  	crt.Xmemcpy(tls, unsafe.Pointer(_pNew), unsafe.Pointer(_pOrig), uint32(20))
114405  	{
114406  		p := &_pNew.Xflags
114407  		*p = uint16(int32(*p) & int32(-1025))
114408  	}
114409  	*(**Xsqlite3)(unsafe.Pointer(&_pNew.Xdb)) = nil
114410  	if (int32(_pNew.Xflags) & int32(18)) == 0 {
114411  		goto _2
114412  	}
114413  	{
114414  		p := &_pNew.Xflags
114415  		*p = uint16(int32(*p) & int32(-3073))
114416  	}
114417  	{
114418  		p := &_pNew.Xflags
114419  		*p = uint16(int32(*p) | int32(4096))
114420  	}
114421  	if _sqlite3VdbeMemMakeWriteable(tls, _pNew) != int32(0) {
114422  		_sqlite3ValueFree(tls, _pNew)
114423  		_pNew = nil
114424  	}
114425  _2:
114426  	return _pNew
114427  }
114428  
114429  // C comment
114430  //  /* Destroy an sqlite3_value object previously obtained from
114431  //  ** sqlite3_value_dup().
114432  //  */
114433  func Xsqlite3_value_free(tls *crt.TLS, _pOld *XMem) {
114434  	_sqlite3ValueFree(tls, _pOld)
114435  }
114436  
114437  func Xsqlite3_result_zeroblob64(tls *crt.TLS, _pCtx *Xsqlite3_context, _n uint64) (r0 int32) {
114438  	var _pOut *XMem
114439  	_pOut = (*XMem)(_pCtx.XpOut)
114440  	func() {
114441  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pOut.Xdb).Xmutex)) == 0 {
114442  			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)))
114443  			crt.X__builtin_abort(tls)
114444  		}
114445  	}()
114446  	if _n > uint64(*elem8((*int32)(unsafe.Pointer(&((*Xsqlite3)(_pOut.Xdb).XaLimit))), 0)) {
114447  		return int32(18)
114448  	}
114449  	_sqlite3VdbeMemSetZeroBlob(tls, (*XMem)(_pCtx.XpOut), int32(_n))
114450  	return int32(0)
114451  }
114452  
114453  var _sqlite3_result_zeroblob64Ø00__func__Ø000 [26]int8
114454  
114455  func init() {
114456  	crt.Xstrncpy(nil, &_sqlite3_result_zeroblob64Ø00__func__Ø000[0], str(130209), 26)
114457  }
114458  
114459  func Xsqlite3_bind_zeroblob64(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _n uint64) (r0 int32) {
114460  	var _rc int32
114461  	var _p *TVdbe
114462  	_p = (*TVdbe)(_pStmt)
114463  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex))
114464  	if _n > uint64(*elem8((*int32)(unsafe.Pointer(&((*Xsqlite3)(_p.Xdb).XaLimit))), 0)) {
114465  		_rc = int32(18)
114466  		goto _1
114467  	}
114468  	func() {
114469  		if (_n & uint64(2147483647)) != _n {
114470  			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)))
114471  			crt.X__builtin_abort(tls)
114472  		}
114473  	}()
114474  	_rc = Xsqlite3_bind_zeroblob(tls, _pStmt, _i, int32(_n))
114475  _1:
114476  	_rc = _sqlite3ApiExit(tls, (*Xsqlite3)(_p.Xdb), _rc)
114477  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.Xdb).Xmutex))
114478  	return _rc
114479  }
114480  
114481  var _sqlite3_bind_zeroblob64Ø00__func__Ø000 [24]int8
114482  
114483  func init() {
114484  	crt.Xstrncpy(nil, &_sqlite3_bind_zeroblob64Ø00__func__Ø000[0], str(130255), 24)
114485  }
114486  
114487  // C comment
114488  //  /*
114489  //  ** CAPI3REF: Finding The Subtype Of SQL Values
114490  //  ** METHOD: sqlite3_value
114491  //  **
114492  //  ** The sqlite3_value_subtype(V) function returns the subtype for
114493  //  ** an [application-defined SQL function] argument V.  The subtype
114494  //  ** information can be used to pass a limited amount of context from
114495  //  ** one SQL function to another.  Use the [sqlite3_result_subtype()]
114496  //  ** routine to set the subtype for the return value of an SQL function.
114497  //  **
114498  //  ** SQLite makes no use of subtype itself.  It merely passes the subtype
114499  //  ** from the result of one [application-defined SQL function] into the
114500  //  ** input of another.
114501  //  */
114502  func Xsqlite3_value_subtype(tls *crt.TLS, _pVal *XMem) (r0 uint32) {
114503  	var _pMem *XMem
114504  	_pMem = _pVal
114505  	return uint32(func() int32 {
114506  		if (int32(_pMem.Xflags) & int32(32768)) != 0 {
114507  			return int32(_pMem.XeSubtype)
114508  		}
114509  		return int32(0)
114510  	}())
114511  }
114512  
114513  // C comment
114514  //  /*
114515  //  ** CAPI3REF: Setting The Subtype Of An SQL Function
114516  //  ** METHOD: sqlite3_context
114517  //  **
114518  //  ** The sqlite3_result_subtype(C,T) function causes the subtype of
114519  //  ** the result from the [application-defined SQL function] with
114520  //  ** [sqlite3_context] C to be the value T.  Only the lower 8 bits
114521  //  ** of the subtype T are preserved in current versions of SQLite;
114522  //  ** higher order bits are discarded.
114523  //  ** The number of subtype bytes preserved by SQLite might increase
114524  //  ** in future releases of SQLite.
114525  //  */
114526  func Xsqlite3_result_subtype(tls *crt.TLS, _pCtx *Xsqlite3_context, _eSubtype uint32) {
114527  	var _pOut *XMem
114528  	_pOut = (*XMem)(_pCtx.XpOut)
114529  	func() {
114530  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pOut.Xdb).Xmutex)) == 0 {
114531  			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)))
114532  			crt.X__builtin_abort(tls)
114533  		}
114534  	}()
114535  	_pOut.XeSubtype = uint8(_eSubtype & uint32(255))
114536  	{
114537  		p := &_pOut.Xflags
114538  		*p = uint16(int32(*p) | int32(32768))
114539  	}
114540  }
114541  
114542  var _sqlite3_result_subtypeØ00__func__Ø000 [23]int8
114543  
114544  func init() {
114545  	crt.Xstrncpy(nil, &_sqlite3_result_subtypeØ00__func__Ø000[0], str(130279), 23)
114546  }
114547  
114548  // C comment
114549  //  /*
114550  //  ** Flush any dirty pages in the pager-cache for any attached database
114551  //  ** to disk.
114552  //  */
114553  func Xsqlite3_db_cacheflush(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
114554  	var _i, _rc, _bSeenBusy int32
114555  	var _1_pBt *XBtree
114556  	var _2_pPager *XPager
114557  	_rc = int32(0)
114558  	_bSeenBusy = int32(0)
114559  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
114560  		return _sqlite3MisuseError(tls, int32(141232))
114561  	}
114562  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
114563  	_sqlite3BtreeEnterAll(tls, _db)
114564  	_i = int32(0)
114565  _1:
114566  	if _rc != int32(0) || _i >= _db.XnDb {
114567  		goto _5
114568  	}
114569  	_1_pBt = (*XBtree)(elem27((*XDb)(_db.XaDb), uintptr(_i)).XpBt)
114570  	if _1_pBt == nil || _sqlite3BtreeIsInTrans(tls, _1_pBt) == 0 {
114571  		goto _7
114572  	}
114573  	_2_pPager = _sqlite3BtreePager(tls, _1_pBt)
114574  	_rc = _sqlite3PagerFlush(tls, _2_pPager)
114575  	if _rc == int32(5) {
114576  		_bSeenBusy = int32(1)
114577  		_rc = int32(0)
114578  	}
114579  _7:
114580  	_i += 1
114581  	goto _1
114582  _5:
114583  	_sqlite3BtreeLeaveAll(tls, _db)
114584  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
114585  	return func() int32 {
114586  		if (_rc == int32(0)) && _bSeenBusy != 0 {
114587  			return int32(5)
114588  		}
114589  		return _rc
114590  	}()
114591  }
114592  
114593  // C comment
114594  //  /*
114595  //  ** Flush all unreferenced dirty pages to disk.
114596  //  */
114597  func _sqlite3PagerFlush(tls *crt.TLS, _pPager *XPager) (r0 int32) {
114598  	var _rc int32
114599  	var _1_pList, _2_pNext *XPgHdr
114600  	_rc = _pPager.XerrCode
114601  	if _pPager.XmemDb != 0 {
114602  		goto _0
114603  	}
114604  	_1_pList = _sqlite3PcacheDirtyList(tls, (*XPCache)(_pPager.XpPCache))
114605  	func() {
114606  		if _assert_pager_state(tls, _pPager) == 0 {
114607  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(51520), unsafe.Pointer(&_sqlite3PagerFlushØ00__func__Ø000), unsafe.Pointer(str(10971)))
114608  			crt.X__builtin_abort(tls)
114609  		}
114610  	}()
114611  _3:
114612  	if _rc != int32(0) || _1_pList == nil {
114613  		goto _4
114614  	}
114615  	_2_pNext = (*XPgHdr)(_1_pList.XpDirty)
114616  	if int32(_1_pList.XnRef) == int32(0) {
114617  		_rc = _pagerStress(tls, unsafe.Pointer(_pPager), _1_pList)
114618  	}
114619  	_1_pList = _2_pNext
114620  	goto _3
114621  _4:
114622  _0:
114623  	return _rc
114624  }
114625  
114626  var _sqlite3PagerFlushØ00__func__Ø000 [18]int8
114627  
114628  func init() {
114629  	crt.Xstrncpy(nil, &_sqlite3PagerFlushØ00__func__Ø000[0], str(130302), 18)
114630  }
114631  
114632  // C comment
114633  //  /*
114634  //  ** CAPI3REF: Low-level system error code
114635  //  **
114636  //  ** ^Attempt to return the underlying operating system error code or error
114637  //  ** number that caused the most recent I/O error or failure to open a file.
114638  //  ** The return value is OS-dependent.  For example, on unix systems, after
114639  //  ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be
114640  //  ** called to get back the underlying "errno" that caused the problem, such
114641  //  ** as ENOSPC, EAUTH, EISDIR, and so forth.
114642  //  */
114643  func Xsqlite3_system_errno(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
114644  	return func() int32 {
114645  		if _db != nil {
114646  			return _db.XiSysErrno
114647  		}
114648  		return int32(0)
114649  	}()
114650  }
114651  
114652  // C comment
114653  //  /* Register a trace callback using the version-2 interface.
114654  //  */
114655  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) {
114656  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
114657  		return _sqlite3MisuseError(tls, int32(142326))
114658  	}
114659  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
114660  	if _mTrace == (0) {
114661  		_xTrace = nil
114662  	}
114663  	if _xTrace == nil {
114664  		_mTrace = 0
114665  	}
114666  	_db.XmTrace = uint8(_mTrace)
114667  	_db.XxTrace = _xTrace
114668  	_db.XpTraceArg = _pArg
114669  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
114670  	return int32(0)
114671  }
114672  
114673  // C comment
114674  //  /*
114675  //  ** Return the SQL associated with a prepared statement with
114676  //  ** bound parameters expanded.  Space to hold the returned string is
114677  //  ** obtained from sqlite3_malloc().  The caller is responsible for
114678  //  ** freeing the returned string by passing it to sqlite3_free().
114679  //  **
114680  //  ** The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of
114681  //  ** expanded bound parameters.
114682  //  */
114683  func Xsqlite3_expanded_sql(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 *int8) {
114684  	var _z, _zSql *int8
114685  	var _1_p *TVdbe
114686  	_z = nil
114687  	_zSql = Xsqlite3_sql(tls, _pStmt)
114688  	if _zSql != nil {
114689  		_1_p = (*TVdbe)(_pStmt)
114690  		Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_1_p.Xdb).Xmutex))
114691  		_z = _sqlite3VdbeExpandSql(tls, _1_p, _zSql)
114692  		Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_1_p.Xdb).Xmutex))
114693  	}
114694  	return _z
114695  }
114696  
114697  // C comment
114698  //  /*
114699  //  ** Set the value returned by the sqlite3_last_insert_rowid() API function.
114700  //  */
114701  func Xsqlite3_set_last_insert_rowid(tls *crt.TLS, _db *Xsqlite3, _iRowid int64) {
114702  	if _sqlite3SafetyCheckOk(tls, _db) == 0 {
114703  		_sqlite3MisuseError(tls, int32(141398))
114704  		return
114705  	}
114706  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
114707  	_db.XlastRowid = _iRowid
114708  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
114709  }
114710  
114711  func _compileoptionusedFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
114712  	var _zOptName *int8
114713  	func() {
114714  		if _argc != int32(1) {
114715  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106483), unsafe.Pointer(&_compileoptionusedFuncØ00__func__Ø000), unsafe.Pointer(str(125396)))
114716  			crt.X__builtin_abort(tls)
114717  		}
114718  	}()
114719  
114720  	if store1(&_zOptName, (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, 0))))) != nil {
114721  		Xsqlite3_result_int(tls, _context, Xsqlite3_compileoption_used(tls, _zOptName))
114722  	}
114723  }
114724  
114725  var _compileoptionusedFuncØ00__func__Ø000 [22]int8
114726  
114727  func init() {
114728  	crt.Xstrncpy(nil, &_compileoptionusedFuncØ00__func__Ø000[0], str(130320), 22)
114729  }
114730  
114731  func _compileoptiongetFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
114732  	var _n int32
114733  	func() {
114734  		if _argc != int32(1) {
114735  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106507), unsafe.Pointer(&_compileoptiongetFuncØ00__func__Ø000), unsafe.Pointer(str(125396)))
114736  			crt.X__builtin_abort(tls)
114737  		}
114738  	}()
114739  
114740  	_n = Xsqlite3_value_int(tls, *elem19(_argv, 0))
114741  	Xsqlite3_result_text(tls, _context, Xsqlite3_compileoption_get(tls, _n), int32(-1), nil)
114742  }
114743  
114744  var _compileoptiongetFuncØ00__func__Ø000 [21]int8
114745  
114746  func init() {
114747  	crt.Xstrncpy(nil, &_compileoptiongetFuncØ00__func__Ø000[0], str(130342), 21)
114748  }
114749  
114750  // C comment
114751  //  /*
114752  //  ** Implementation of the sqlite_version() function.  The result is the version
114753  //  ** of the SQLite library that is running.
114754  //  */
114755  func _versionFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
114756  	_ = _NotUsed2
114757  
114758  	Xsqlite3_result_text(tls, _context, Xsqlite3_libversion(tls), int32(-1), nil)
114759  }
114760  
114761  // C comment
114762  //  /*
114763  //  ** Implementation of the TRIM(), LTRIM(), and RTRIM() functions.
114764  //  ** The userdata is 0x1 for left trim, 0x2 for right trim, 0x3 for both.
114765  //  */
114766  func _trimFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
114767  	var _nIn, _flags, _i, _nChar, _17_len, _20_len int32
114768  	var _zIn, _zCharSet, _aLen, _4_z *uint8
114769  	var _azChar **uint8
114770  	_aLen = nil
114771  	_azChar = nil
114772  	if Xsqlite3_value_type(tls, *elem19(_argv, 0)) == int32(5) {
114773  		return
114774  	}
114775  	_zIn = Xsqlite3_value_text(tls, *elem19(_argv, 0))
114776  	if _zIn == nil {
114777  		return
114778  	}
114779  	_nIn = Xsqlite3_value_bytes(tls, *elem19(_argv, 0))
114780  	func() {
114781  		if _zIn != Xsqlite3_value_text(tls, *elem19(_argv, 0)) {
114782  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106818), unsafe.Pointer(&_trimFuncØ00__func__Ø000), unsafe.Pointer(str(130363)))
114783  			crt.X__builtin_abort(tls)
114784  		}
114785  	}()
114786  	if _argc == int32(1) {
114787  		_nChar = int32(1)
114788  		_aLen = (*uint8)(unsafe.Pointer(&_trimFuncØ00lenOneØ001))
114789  		_azChar = (**uint8)(unsafe.Pointer(&_trimFuncØ00azOneØ002))
114790  		_zCharSet = nil
114791  		goto _7
114792  	}
114793  	if store15(&_zCharSet, Xsqlite3_value_text(tls, *elem19(_argv, uintptr(1)))) == nil {
114794  		return
114795  	}
114796  	*func() *int32 { _4_z = _zCharSet; return &_nChar }() = int32(0)
114797  _8:
114798  	if (*_4_z) == 0 {
114799  		goto _11
114800  	}
114801  	if int32(*postInc15(&_4_z, 1)) < int32(192) {
114802  		goto _12
114803  	}
114804  _13:
114805  	if (int32(*_4_z) & int32(192)) == int32(128) {
114806  		*(*uintptr)(unsafe.Pointer(&_4_z)) += uintptr(1)
114807  		goto _13
114808  	}
114809  _12:
114810  	_nChar += 1
114811  	goto _8
114812  _11:
114813  	if _nChar <= int32(0) {
114814  		goto _15
114815  	}
114816  	_azChar = (**uint8)(_contextMalloc(tls, _context, int64(_nChar)*int64(5)))
114817  	if _azChar == nil {
114818  		return
114819  	}
114820  	_aLen = (*uint8)(unsafe.Pointer(elem88(_azChar, uintptr(_nChar))))
114821  	*func() *int32 { _4_z = _zCharSet; return &_nChar }() = int32(0)
114822  _17:
114823  	if (*_4_z) == 0 {
114824  		goto _20
114825  	}
114826  	*elem88(_azChar, uintptr(_nChar)) = _4_z
114827  	if int32(*postInc15(&_4_z, 1)) < int32(192) {
114828  		goto _21
114829  	}
114830  _22:
114831  	if (int32(*_4_z) & int32(192)) == int32(128) {
114832  		*(*uintptr)(unsafe.Pointer(&_4_z)) += uintptr(1)
114833  		goto _22
114834  	}
114835  _21:
114836  	*elem15(_aLen, uintptr(_nChar)) = uint8(int32(uintptr(unsafe.Pointer(_4_z)) - uintptr(unsafe.Pointer(*elem88(_azChar, uintptr(_nChar))))))
114837  	_nChar += 1
114838  	goto _17
114839  _20:
114840  _15:
114841  _7:
114842  	if _nChar <= int32(0) {
114843  		goto _24
114844  	}
114845  	_flags = int32(crt.P2U(Xsqlite3_user_data(tls, _context)))
114846  	if (_flags & int32(1)) == 0 {
114847  		goto _25
114848  	}
114849  _26:
114850  	if _nIn <= int32(0) {
114851  		goto _27
114852  	}
114853  	_17_len = int32(0)
114854  	_i = int32(0)
114855  _28:
114856  	if _i >= _nChar {
114857  		goto _31
114858  	}
114859  	_17_len = int32(*elem15(_aLen, uintptr(_i)))
114860  	if (_17_len <= _nIn) && (crt.Xmemcmp(tls, unsafe.Pointer(_zIn), unsafe.Pointer(*elem88(_azChar, uintptr(_i))), uint32(_17_len)) == int32(0)) {
114861  		goto _31
114862  	}
114863  	_i += 1
114864  	goto _28
114865  _31:
114866  	if _i >= _nChar {
114867  		goto _27
114868  	}
114869  	*(*uintptr)(unsafe.Pointer(&_zIn)) += uintptr(_17_len)
114870  	_nIn -= _17_len
114871  	goto _26
114872  _27:
114873  _25:
114874  	if (_flags & int32(2)) == 0 {
114875  		goto _35
114876  	}
114877  _36:
114878  	if _nIn <= int32(0) {
114879  		goto _37
114880  	}
114881  	_20_len = int32(0)
114882  	_i = int32(0)
114883  _38:
114884  	if _i >= _nChar {
114885  		goto _41
114886  	}
114887  	_20_len = int32(*elem15(_aLen, uintptr(_i)))
114888  	if (_20_len <= _nIn) && (crt.Xmemcmp(tls, unsafe.Pointer(elem15(_zIn, uintptr(_nIn-_20_len))), unsafe.Pointer(*elem88(_azChar, uintptr(_i))), uint32(_20_len)) == int32(0)) {
114889  		goto _41
114890  	}
114891  	_i += 1
114892  	goto _38
114893  _41:
114894  	if _i >= _nChar {
114895  		goto _37
114896  	}
114897  	_nIn -= _20_len
114898  	goto _36
114899  _37:
114900  _35:
114901  	if _zCharSet != nil {
114902  		Xsqlite3_free(tls, unsafe.Pointer(_azChar))
114903  	}
114904  _24:
114905  	Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(_zIn)), _nIn, *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
114906  }
114907  
114908  var _trimFuncØ00__func__Ø000 [9]int8
114909  
114910  func init() {
114911  	crt.Xstrncpy(nil, &_trimFuncØ00__func__Ø000[0], str(130396), 9)
114912  }
114913  
114914  var _trimFuncØ00lenOneØ001 [1]uint8
114915  
114916  func init() {
114917  	_trimFuncØ00lenOneØ001 = [1]uint8{1}
114918  }
114919  
114920  var _trimFuncØ00azOneØ002 [1]*uint8
114921  
114922  func init() {
114923  	_trimFuncØ00azOneØ002 = [1]*uint8{(*byte)(unsafe.Pointer(str(119962)))}
114924  }
114925  
114926  // C comment
114927  //  /*
114928  //  ** Allocate nByte bytes of space using sqlite3Malloc(). If the
114929  //  ** allocation fails, call sqlite3_result_error_nomem() to notify
114930  //  ** the database handle that malloc() has failed and return NULL.
114931  //  ** If nByte is larger than the maximum string or blob length, then
114932  //  ** raise an SQLITE_TOOBIG exception and return NULL.
114933  //  */
114934  func _contextMalloc(tls *crt.TLS, _context *Xsqlite3_context, _nByte int64) (r0 unsafe.Pointer) {
114935  	var _z *int8
114936  	var _db *Xsqlite3
114937  	_db = Xsqlite3_context_db_handle(tls, _context)
114938  	func() {
114939  		if _nByte <= (0) {
114940  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105944), unsafe.Pointer(&_contextMallocØ00__func__Ø000), unsafe.Pointer(str(130405)))
114941  			crt.X__builtin_abort(tls)
114942  		}
114943  	}()
114944  	if _nByte > int64(*elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), 0)) {
114945  		Xsqlite3_result_error_toobig(tls, _context)
114946  		_z = nil
114947  		goto _3
114948  	}
114949  	_z = (*int8)(_sqlite3Malloc(tls, uint64(_nByte)))
114950  	if _z == nil {
114951  		Xsqlite3_result_error_nomem(tls, _context)
114952  	}
114953  _3:
114954  	return unsafe.Pointer(_z)
114955  }
114956  
114957  var _contextMallocØ00__func__Ø000 [14]int8
114958  
114959  func init() {
114960  	crt.Xstrncpy(nil, &_contextMallocØ00__func__Ø000[0], str(130413), 14)
114961  }
114962  
114963  // C comment
114964  //  /*
114965  //  ** Implementation of the non-aggregate min() and max() functions
114966  //  */
114967  func _minmaxFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
114968  	var _i, _mask, _iBest int32
114969  	var _pColl *XCollSeq
114970  	func() {
114971  		if _argc <= int32(1) {
114972  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105594), unsafe.Pointer(&_minmaxFuncØ00__func__Ø000), unsafe.Pointer(str(130427)))
114973  			crt.X__builtin_abort(tls)
114974  		}
114975  	}()
114976  	_mask = func() int32 {
114977  		if Xsqlite3_user_data(tls, _context) == nil {
114978  			return int32(0)
114979  		}
114980  		return int32(-1)
114981  	}()
114982  	_pColl = _sqlite3GetFuncCollSeq(tls, _context)
114983  	func() {
114984  		if _pColl == nil {
114985  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105597), unsafe.Pointer(&_minmaxFuncØ00__func__Ø000), unsafe.Pointer(str(130434)))
114986  			crt.X__builtin_abort(tls)
114987  		}
114988  	}()
114989  	func() {
114990  		if _mask != int32(-1) && _mask != int32(0) {
114991  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105598), unsafe.Pointer(&_minmaxFuncØ00__func__Ø000), unsafe.Pointer(str(130440)))
114992  			crt.X__builtin_abort(tls)
114993  		}
114994  	}()
114995  	_iBest = int32(0)
114996  	if Xsqlite3_value_type(tls, *elem19(_argv, 0)) == int32(5) {
114997  		return
114998  	}
114999  	_i = int32(1)
115000  _10:
115001  	if _i >= _argc {
115002  		goto _13
115003  	}
115004  	if Xsqlite3_value_type(tls, *elem19(_argv, uintptr(_i))) == int32(5) {
115005  		return
115006  	}
115007  	if (_sqlite3MemCompare(tls, *elem19(_argv, uintptr(_iBest)), *elem19(_argv, uintptr(_i)), _pColl) ^ _mask) >= int32(0) {
115008  		_iBest = _i
115009  	}
115010  	_i += 1
115011  	goto _10
115012  _13:
115013  	Xsqlite3_result_value(tls, _context, *elem19(_argv, uintptr(_iBest)))
115014  }
115015  
115016  var _minmaxFuncØ00__func__Ø000 [11]int8
115017  
115018  func init() {
115019  	crt.Xstrncpy(nil, &_minmaxFuncØ00__func__Ø000[0], str(130460), 11)
115020  }
115021  
115022  // C comment
115023  //  /*
115024  //  ** Return the collating function associated with a function.
115025  //  */
115026  func _sqlite3GetFuncCollSeq(tls *crt.TLS, _context *Xsqlite3_context) (r0 *XCollSeq) {
115027  	var _pOp *XVdbeOp
115028  	func() {
115029  		if (*TVdbe)(_context.XpVdbe) == nil {
115030  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105566), unsafe.Pointer(&_sqlite3GetFuncCollSeqØ00__func__Ø000), unsafe.Pointer(str(130471)))
115031  			crt.X__builtin_abort(tls)
115032  		}
115033  	}()
115034  	_pOp = elem61((*XVdbeOp)((*TVdbe)(_context.XpVdbe).XaOp), uintptr(_context.XiOp-int32(1)))
115035  	func() {
115036  		if int32(_pOp.Xopcode) != int32(68) {
115037  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105568), unsafe.Pointer(&_sqlite3GetFuncCollSeqØ00__func__Ø000), unsafe.Pointer(str(130489)))
115038  			crt.X__builtin_abort(tls)
115039  		}
115040  	}()
115041  	func() {
115042  		if int32(_pOp.Xp4type) != int32(-3) {
115043  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105569), unsafe.Pointer(&_sqlite3GetFuncCollSeqØ00__func__Ø000), unsafe.Pointer(str(62535)))
115044  			crt.X__builtin_abort(tls)
115045  		}
115046  	}()
115047  	return (*XCollSeq)(*(*unsafe.Pointer)(unsafe.Pointer(&_pOp.Xp4)))
115048  }
115049  
115050  var _sqlite3GetFuncCollSeqØ00__func__Ø000 [22]int8
115051  
115052  func init() {
115053  	crt.Xstrncpy(nil, &_sqlite3GetFuncCollSeqØ00__func__Ø000[0], str(130513), 22)
115054  }
115055  
115056  // C comment
115057  //  /*
115058  //  ** Routines to implement min() and max() aggregate functions.
115059  //  */
115060  func _minmaxStep(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) {
115061  	var _2_max, _2_cmp int32
115062  	var _pArg, _pBest *XMem
115063  	var _2_pColl *XCollSeq
115064  	_pArg = *elem19(_argv, 0)
115065  
115066  	_pBest = (*XMem)(Xsqlite3_aggregate_context(tls, _context, int32(48)))
115067  	if _pBest == nil {
115068  		return
115069  	}
115070  	if Xsqlite3_value_type(tls, *elem19(_argv, 0)) != int32(5) {
115071  		goto _1
115072  	}
115073  	if _pBest.Xflags != 0 {
115074  		_sqlite3SkipAccumulatorLoad(tls, _context)
115075  	}
115076  	goto _10
115077  _1:
115078  	if _pBest.Xflags == 0 {
115079  		goto _4
115080  	}
115081  	_2_pColl = _sqlite3GetFuncCollSeq(tls, _context)
115082  	_2_max = bool2int(Xsqlite3_user_data(tls, _context) != nil)
115083  	_2_cmp = _sqlite3MemCompare(tls, _pBest, _pArg, _2_pColl)
115084  	if (_2_max != 0 && (_2_cmp < int32(0))) || ((_2_max == 0) && (_2_cmp > int32(0))) {
115085  		_sqlite3VdbeMemCopy(tls, _pBest, _pArg)
115086  		goto _9
115087  	}
115088  	_sqlite3SkipAccumulatorLoad(tls, _context)
115089  _9:
115090  	goto _10
115091  _4:
115092  	*(**Xsqlite3)(unsafe.Pointer(&_pBest.Xdb)) = Xsqlite3_context_db_handle(tls, _context)
115093  	_sqlite3VdbeMemCopy(tls, _pBest, _pArg)
115094  _10:
115095  }
115096  
115097  // C comment
115098  //  /*
115099  //  ** Indicate that the accumulator load should be skipped on this
115100  //  ** iteration of the aggregate loop.
115101  //  */
115102  func _sqlite3SkipAccumulatorLoad(tls *crt.TLS, _context *Xsqlite3_context) {
115103  	_context.XskipFlag = uint8(1)
115104  }
115105  
115106  func _minMaxFinalize(tls *crt.TLS, _context *Xsqlite3_context) {
115107  	var _pRes *XMem
115108  	_pRes = (*XMem)(Xsqlite3_aggregate_context(tls, _context, int32(0)))
115109  	if _pRes == nil {
115110  		goto _0
115111  	}
115112  	if _pRes.Xflags != 0 {
115113  		Xsqlite3_result_value(tls, _context, _pRes)
115114  	}
115115  	_sqlite3VdbeMemRelease(tls, _pRes)
115116  _0:
115117  }
115118  
115119  // C comment
115120  //  /*
115121  //  ** Return the type of the argument.
115122  //  */
115123  func _typeofFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) {
115124  	var _z *int8
115125  	_z = nil
115126  
115127  	switch Xsqlite3_value_type(tls, *elem19(_argv, 0)) {
115128  	case int32(1):
115129  		goto _1
115130  	case int32(2):
115131  		goto _3
115132  	case int32(3):
115133  		goto _2
115134  	case int32(4):
115135  		goto _4
115136  	default:
115137  		goto _5
115138  	}
115139  
115140  _1:
115141  	_z = str(42830)
115142  	goto _6
115143  _2:
115144  	_z = str(42817)
115145  	goto _6
115146  _3:
115147  	_z = str(42838)
115148  	goto _6
115149  _4:
115150  	_z = str(42812)
115151  	goto _6
115152  _5:
115153  	_z = str(128774)
115154  	goto _6
115155  _6:
115156  	Xsqlite3_result_text(tls, _context, _z, int32(-1), nil)
115157  }
115158  
115159  // C comment
115160  //  /*
115161  //  ** Implementation of the length() function
115162  //  */
115163  func _lengthFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115164  	var _len int32
115165  	var _3_z *uint8
115166  	func() {
115167  		if _argc != int32(1) {
115168  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105642), unsafe.Pointer(&_lengthFuncØ00__func__Ø000), unsafe.Pointer(str(125396)))
115169  			crt.X__builtin_abort(tls)
115170  		}
115171  	}()
115172  
115173  	switch Xsqlite3_value_type(tls, *elem19(_argv, 0)) {
115174  	case int32(1):
115175  		goto _3
115176  	case int32(2):
115177  		goto _3
115178  	case int32(3):
115179  		goto _6
115180  	case int32(4):
115181  		goto _3
115182  	default:
115183  		goto _7
115184  	}
115185  
115186  _3:
115187  	Xsqlite3_result_int(tls, _context, Xsqlite3_value_bytes(tls, *elem19(_argv, 0)))
115188  	goto _8
115189  _6:
115190  	_3_z = Xsqlite3_value_text(tls, *elem19(_argv, 0))
115191  	if _3_z == nil {
115192  		return
115193  	}
115194  	_len = int32(0)
115195  _10:
115196  	if (*_3_z) == 0 {
115197  		goto _11
115198  	}
115199  	_len += 1
115200  	if int32(*postInc15(&_3_z, 1)) < int32(192) {
115201  		goto _12
115202  	}
115203  _13:
115204  	if (int32(*_3_z) & int32(192)) == int32(128) {
115205  		*(*uintptr)(unsafe.Pointer(&_3_z)) += uintptr(1)
115206  		goto _13
115207  	}
115208  _12:
115209  	goto _10
115210  _11:
115211  	Xsqlite3_result_int(tls, _context, _len)
115212  	goto _8
115213  _7:
115214  	Xsqlite3_result_null(tls, _context)
115215  	goto _8
115216  _8:
115217  }
115218  
115219  var _lengthFuncØ00__func__Ø000 [11]int8
115220  
115221  func init() {
115222  	crt.Xstrncpy(nil, &_lengthFuncØ00__func__Ø000[0], str(130535), 11)
115223  }
115224  
115225  // C comment
115226  //  /*
115227  //  ** Implementation of the instr() function.
115228  //  **
115229  //  ** instr(haystack,needle) finds the first occurrence of needle
115230  //  ** in haystack and returns the number of previous characters plus 1,
115231  //  ** or 0 if needle does not occur within haystack.
115232  //  **
115233  //  ** If both haystack and needle are BLOBs, then the result is one more than
115234  //  ** the number of bytes in haystack prior to the first occurrence of needle,
115235  //  ** or 0 if needle never occurs in haystack.
115236  //  */
115237  func _instrFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115238  	var _nHaystack, _nNeedle, _typeHaystack, _typeNeedle, _N, _isText int32
115239  	var _zHaystack, _zNeedle *uint8
115240  	_N = int32(1)
115241  
115242  	_typeHaystack = Xsqlite3_value_type(tls, *elem19(_argv, 0))
115243  	_typeNeedle = Xsqlite3_value_type(tls, *elem19(_argv, uintptr(1)))
115244  	if (_typeHaystack == int32(5)) || (_typeNeedle == int32(5)) {
115245  		return
115246  	}
115247  	_nHaystack = Xsqlite3_value_bytes(tls, *elem19(_argv, 0))
115248  	_nNeedle = Xsqlite3_value_bytes(tls, *elem19(_argv, uintptr(1)))
115249  	if _nNeedle <= int32(0) {
115250  		goto _2
115251  	}
115252  	if (_typeHaystack == int32(4)) && (_typeNeedle == int32(4)) {
115253  		_zHaystack = (*uint8)(Xsqlite3_value_blob(tls, *elem19(_argv, 0)))
115254  		_zNeedle = (*uint8)(Xsqlite3_value_blob(tls, *elem19(_argv, uintptr(1))))
115255  		_isText = int32(0)
115256  		goto _5
115257  	}
115258  	_zHaystack = Xsqlite3_value_text(tls, *elem19(_argv, 0))
115259  	_zNeedle = Xsqlite3_value_text(tls, *elem19(_argv, uintptr(1)))
115260  	_isText = int32(1)
115261  _5:
115262  	if (_zNeedle == nil) || (_nHaystack != 0 && (_zHaystack == nil)) {
115263  		return
115264  	}
115265  _8:
115266  	if _nNeedle > _nHaystack || crt.Xmemcmp(tls, unsafe.Pointer(_zHaystack), unsafe.Pointer(_zNeedle), uint32(_nNeedle)) == int32(0) {
115267  		goto _10
115268  	}
115269  	_N += 1
115270  _12:
115271  	_nHaystack -= 1
115272  	*(*uintptr)(unsafe.Pointer(&_zHaystack)) += uintptr(1)
115273  	if _isText != 0 && ((int32(*elem15(_zHaystack, 0)) & int32(192)) == int32(128)) {
115274  		goto _12
115275  	}
115276  	goto _8
115277  _10:
115278  	if _nNeedle > _nHaystack {
115279  		_N = int32(0)
115280  	}
115281  _2:
115282  	Xsqlite3_result_int(tls, _context, _N)
115283  }
115284  
115285  // C comment
115286  //  /*
115287  //  ** Implementation of the printf() function.
115288  //  */
115289  func _printfFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115290  	var _n int32
115291  	var _zFormat *int8
115292  	var _db *Xsqlite3
115293  	var _str XStrAccum
115294  	var _x XPrintfArguments
115295  	_db = Xsqlite3_context_db_handle(tls, _context)
115296  	if (_argc >= int32(1)) && (store1(&_zFormat, (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, 0))))) != nil) {
115297  		_x.XnArg = _argc - int32(1)
115298  		_x.XnUsed = int32(0)
115299  		*(***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(4)))))))))))
115300  		_sqlite3StrAccumInit(tls, &_str, _db, nil, int32(0), *elem8((*int32)(unsafe.Pointer(&_db.XaLimit)), 0))
115301  		_str.XprintfFlags = uint8(2)
115302  		_sqlite3XPrintf(tls, &_str, _zFormat, unsafe.Pointer(&_x))
115303  		_n = int32(_str.XnChar)
115304  		Xsqlite3_result_text(tls, _context, _sqlite3StrAccumFinish(tls, &_str), _n, func() func(*crt.TLS, unsafe.Pointer) {
115305  			v := _sqlite3MallocSize
115306  			return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v))
115307  		}())
115308  	}
115309  }
115310  
115311  // C comment
115312  //  /*
115313  //  ** The unicode() function.  Return the integer unicode code-point value
115314  //  ** for the first character of the input string.
115315  //  */
115316  func _unicodeFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115317  	var _z *uint8
115318  	_z = Xsqlite3_value_text(tls, *elem19(_argv, 0))
115319  
115320  	if (_z != nil) && ((*elem15(_z, 0)) != 0) {
115321  		Xsqlite3_result_int(tls, _context, int32(_sqlite3Utf8Read(tls, &_z)))
115322  	}
115323  }
115324  
115325  // C comment
115326  //  /*
115327  //  ** The char() function takes zero or more arguments, each of which is
115328  //  ** an integer.  It constructs a string where each character of the string
115329  //  ** is the unicode character for the corresponding integer argument.
115330  //  */
115331  func _charFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115332  	var _i int32
115333  	var _2_x int64
115334  	var _2_c uint32
115335  	var _z, _zOut *uint8
115336  	_zOut = store15(&_z, (*uint8)(Xsqlite3_malloc64(tls, uint64((_argc*int32(4))+int32(1)))))
115337  	if _z == nil {
115338  		Xsqlite3_result_error_nomem(tls, _context)
115339  		return
115340  	}
115341  	_i = int32(0)
115342  _1:
115343  	if _i >= _argc {
115344  		goto _4
115345  	}
115346  	_2_x = Xsqlite3_value_int64(tls, *elem19(_argv, uintptr(_i)))
115347  	if (_2_x < (0)) || (_2_x > int64(1114111)) {
115348  		_2_x = int64(65533)
115349  	}
115350  	_2_c = uint32(_2_x & int64(2097151))
115351  	if _2_c < uint32(128) {
115352  		*postInc15(&_zOut, 1) = uint8(_2_c & uint32(255))
115353  		goto _12
115354  	}
115355  	if _2_c < uint32(2048) {
115356  		*postInc15(&_zOut, 1) = uint8(int32(192) + int32(uint8((_2_c>>6)&uint32(31))))
115357  		*postInc15(&_zOut, 1) = uint8(int32(128) + int32(uint8(_2_c&uint32(63))))
115358  		goto _12
115359  	}
115360  	if _2_c < uint32(65536) {
115361  		*postInc15(&_zOut, 1) = uint8(int32(224) + int32(uint8((_2_c>>12)&uint32(15))))
115362  		*postInc15(&_zOut, 1) = uint8(int32(128) + int32(uint8((_2_c>>6)&uint32(63))))
115363  		*postInc15(&_zOut, 1) = uint8(int32(128) + int32(uint8(_2_c&uint32(63))))
115364  		goto _12
115365  	}
115366  	*postInc15(&_zOut, 1) = uint8(int32(240) + int32(uint8((_2_c>>18)&uint32(7))))
115367  	*postInc15(&_zOut, 1) = uint8(int32(128) + int32(uint8((_2_c>>12)&uint32(63))))
115368  	*postInc15(&_zOut, 1) = uint8(int32(128) + int32(uint8((_2_c>>6)&uint32(63))))
115369  	*postInc15(&_zOut, 1) = uint8(int32(128) + int32(uint8(_2_c&uint32(63))))
115370  _12:
115371  	_i += 1
115372  	goto _1
115373  _4:
115374  	Xsqlite3_result_text64(tls, _context, (*int8)(unsafe.Pointer(_z)), uint64(int32(uintptr(unsafe.Pointer(_zOut))-uintptr(unsafe.Pointer(_z)))), Xsqlite3_free, uint8(1))
115375  }
115376  
115377  // C comment
115378  //  /*
115379  //  ** Implementation of the abs() function.
115380  //  **
115381  //  ** IMP: R-23979-26855 The abs(X) function returns the absolute value of
115382  //  ** the numeric argument X.
115383  //  */
115384  func _absFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115385  	var _2_iVal int64
115386  	var _6_rVal float64
115387  	func() {
115388  		if _argc != int32(1) {
115389  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105676), unsafe.Pointer(&_absFuncØ00__func__Ø000), unsafe.Pointer(str(125396)))
115390  			crt.X__builtin_abort(tls)
115391  		}
115392  	}()
115393  
115394  	switch Xsqlite3_value_type(tls, *elem19(_argv, 0)) {
115395  	case int32(1):
115396  		goto _3
115397  	case int32(5):
115398  		goto _4
115399  	default:
115400  		goto _5
115401  	}
115402  
115403  _3:
115404  	_2_iVal = Xsqlite3_value_int64(tls, *elem19(_argv, 0))
115405  	if _2_iVal >= (0) {
115406  		goto _6
115407  	}
115408  	if _2_iVal == int64(-9223372036854775808) {
115409  		Xsqlite3_result_error(tls, _context, str(130546), int32(-1))
115410  		return
115411  	}
115412  	_2_iVal = -_2_iVal
115413  _6:
115414  	Xsqlite3_result_int64(tls, _context, _2_iVal)
115415  	goto _8
115416  _4:
115417  	Xsqlite3_result_null(tls, _context)
115418  	goto _8
115419  _5:
115420  	_6_rVal = Xsqlite3_value_double(tls, *elem19(_argv, 0))
115421  	if _6_rVal < (0) {
115422  		_6_rVal = -_6_rVal
115423  	}
115424  	Xsqlite3_result_double(tls, _context, _6_rVal)
115425  	goto _8
115426  _8:
115427  }
115428  
115429  var _absFuncØ00__func__Ø000 [8]int8
115430  
115431  func init() {
115432  	crt.Xstrncpy(nil, &_absFuncØ00__func__Ø000[0], str(130563), 8)
115433  }
115434  
115435  func _roundFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115436  	var _n int32
115437  	var _zBuf *int8
115438  	var _r float64
115439  	_n = int32(0)
115440  	func() {
115441  		if _argc != int32(1) && _argc != int32(2) {
115442  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105904), unsafe.Pointer(&_roundFuncØ00__func__Ø000), unsafe.Pointer(str(130571)))
115443  			crt.X__builtin_abort(tls)
115444  		}
115445  	}()
115446  	if _argc != int32(2) {
115447  		goto _3
115448  	}
115449  	if int32(5) == Xsqlite3_value_type(tls, *elem19(_argv, uintptr(1))) {
115450  		return
115451  	}
115452  	_n = Xsqlite3_value_int(tls, *elem19(_argv, uintptr(1)))
115453  	if _n > int32(30) {
115454  		_n = int32(30)
115455  	}
115456  	if _n < int32(0) {
115457  		_n = int32(0)
115458  	}
115459  _3:
115460  	if Xsqlite3_value_type(tls, *elem19(_argv, 0)) == int32(5) {
115461  		return
115462  	}
115463  	_r = Xsqlite3_value_double(tls, *elem19(_argv, 0))
115464  	if ((_n == int32(0)) && (_r >= (0))) && (_r < (9.223372036854776e+18)) {
115465  		_r = float64(int64(_r + (0.5)))
115466  		goto _15
115467  	}
115468  	if ((_n == int32(0)) && (_r < (0))) && ((-_r) < (9.223372036854776e+18)) {
115469  		_r = -float64(int64((-_r) + (0.5)))
115470  		goto _15
115471  	}
115472  	_zBuf = Xsqlite3_mprintf(tls, str(130590), _n, _r)
115473  	if _zBuf == nil {
115474  		Xsqlite3_result_error_nomem(tls, _context)
115475  		return
115476  	}
115477  	_sqlite3AtoF(tls, _zBuf, &_r, _sqlite3Strlen30(tls, _zBuf), uint8(1))
115478  	Xsqlite3_free(tls, unsafe.Pointer(_zBuf))
115479  _15:
115480  	Xsqlite3_result_double(tls, _context, _r)
115481  }
115482  
115483  var _roundFuncØ00__func__Ø000 [10]int8
115484  
115485  func init() {
115486  	crt.Xstrncpy(nil, &_roundFuncØ00__func__Ø000[0], str(130595), 10)
115487  }
115488  
115489  // C comment
115490  //  /*
115491  //  ** Implementation of the upper() and lower() SQL functions.
115492  //  */
115493  func _upperFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115494  	var _i, _n int32
115495  	var _z1, _z2 *int8
115496  
115497  	_z2 = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, 0))))
115498  	_n = Xsqlite3_value_bytes(tls, *elem19(_argv, 0))
115499  	func() {
115500  		if _z2 != (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, 0)))) {
115501  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105970), unsafe.Pointer(&_upperFuncØ00__func__Ø000), unsafe.Pointer(str(130605)))
115502  			crt.X__builtin_abort(tls)
115503  		}
115504  	}()
115505  	if _z2 == nil {
115506  		goto _2
115507  	}
115508  	_z1 = (*int8)(_contextMalloc(tls, _context, int64(_n)+int64(1)))
115509  	if _z1 == nil {
115510  		goto _3
115511  	}
115512  	_i = int32(0)
115513  _4:
115514  	if _i >= _n {
115515  		goto _7
115516  	}
115517  	*elem1(_z1, uintptr(_i)) = int8(int32(*elem1(_z2, uintptr(_i))) & (^(int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_z2, uintptr(_i)))))) & int32(32))))
115518  	_i += 1
115519  	goto _4
115520  _7:
115521  	Xsqlite3_result_text(tls, _context, _z1, _n, Xsqlite3_free)
115522  _3:
115523  _2:
115524  }
115525  
115526  var _upperFuncØ00__func__Ø000 [10]int8
115527  
115528  func init() {
115529  	crt.Xstrncpy(nil, &_upperFuncØ00__func__Ø000[0], str(130644), 10)
115530  }
115531  
115532  func _lowerFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115533  	var _i, _n int32
115534  	var _z1, _z2 *int8
115535  
115536  	_z2 = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, 0))))
115537  	_n = Xsqlite3_value_bytes(tls, *elem19(_argv, 0))
115538  	func() {
115539  		if _z2 != (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, 0)))) {
115540  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105989), unsafe.Pointer(&_lowerFuncØ00__func__Ø000), unsafe.Pointer(str(130605)))
115541  			crt.X__builtin_abort(tls)
115542  		}
115543  	}()
115544  	if _z2 == nil {
115545  		goto _2
115546  	}
115547  	_z1 = (*int8)(_contextMalloc(tls, _context, int64(_n)+int64(1)))
115548  	if _z1 == nil {
115549  		goto _3
115550  	}
115551  	_i = int32(0)
115552  _4:
115553  	if _i >= _n {
115554  		goto _7
115555  	}
115556  	*elem1(_z1, uintptr(_i)) = int8(*elem15((*uint8)(unsafe.Pointer(&_sqlite3UpperToLower)), uintptr(uint8(*elem1(_z2, uintptr(_i))))))
115557  	_i += 1
115558  	goto _4
115559  _7:
115560  	Xsqlite3_result_text(tls, _context, _z1, _n, Xsqlite3_free)
115561  _3:
115562  _2:
115563  }
115564  
115565  var _lowerFuncØ00__func__Ø000 [10]int8
115566  
115567  func init() {
115568  	crt.Xstrncpy(nil, &_lowerFuncØ00__func__Ø000[0], str(130654), 10)
115569  }
115570  
115571  // C comment
115572  //  /*
115573  //  ** The hex() function.  Interpret the argument as a blob.  Return
115574  //  ** a hexadecimal rendering as text.
115575  //  */
115576  func _hexFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115577  	var _i, _n int32
115578  	var _zHex, _z *int8
115579  	var _2_c uint8
115580  	var _pBlob *uint8
115581  	func() {
115582  		if _argc != int32(1) {
115583  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106671), unsafe.Pointer(&_hexFuncØ00__func__Ø000), unsafe.Pointer(str(125396)))
115584  			crt.X__builtin_abort(tls)
115585  		}
115586  	}()
115587  
115588  	_pBlob = (*uint8)(Xsqlite3_value_blob(tls, *elem19(_argv, 0)))
115589  	_n = Xsqlite3_value_bytes(tls, *elem19(_argv, 0))
115590  	func() {
115591  		if _pBlob != (*uint8)(Xsqlite3_value_blob(tls, *elem19(_argv, 0))) {
115592  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106675), unsafe.Pointer(&_hexFuncØ00__func__Ø000), unsafe.Pointer(str(130664)))
115593  			crt.X__builtin_abort(tls)
115594  		}
115595  	}()
115596  	_z = store1(&_zHex, (*int8)(_contextMalloc(tls, _context, (int64(_n)*int64(2))+int64(1))))
115597  	if _zHex == nil {
115598  		goto _4
115599  	}
115600  	_i = int32(0)
115601  _5:
115602  	if _i >= _n {
115603  		goto _8
115604  	}
115605  	_2_c = *_pBlob
115606  	*postInc1(&_z, 1) = *elem1((*int8)(unsafe.Pointer(&_hexdigits)), uintptr((int32(_2_c)>>4)&int32(15)))
115607  	*postInc1(&_z, 1) = *elem1((*int8)(unsafe.Pointer(&_hexdigits)), uintptr(int32(_2_c)&int32(15)))
115608  	*(*uintptr)(unsafe.Pointer(func() **uint8 { _i += 1; return &_pBlob }())) += uintptr(1)
115609  	goto _5
115610  _8:
115611  	*_z = 0
115612  	Xsqlite3_result_text(tls, _context, _zHex, _n*int32(2), Xsqlite3_free)
115613  _4:
115614  }
115615  
115616  var _hexFuncØ00__func__Ø000 [8]int8
115617  
115618  func init() {
115619  	crt.Xstrncpy(nil, &_hexFuncØ00__func__Ø000[0], str(130699), 8)
115620  }
115621  
115622  // C comment
115623  //  /* Array for converting from half-bytes (nybbles) into ASCII hex
115624  //  ** digits. */
115625  var _hexdigits [16]int8
115626  
115627  func init() {
115628  	_hexdigits = [16]int8{48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 65, 66, 67, 68, 69, 70}
115629  }
115630  
115631  // C comment
115632  //  /*
115633  //  ** Implementation of random().  Return a random integer.
115634  //  */
115635  func _randomFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
115636  	var _r int64
115637  	_ = _NotUsed2
115638  
115639  	Xsqlite3_randomness(tls, int32(8), unsafe.Pointer(&_r))
115640  	if _r < (0) {
115641  		_r = -(_r & int64(9223372036854775807))
115642  	}
115643  	Xsqlite3_result_int64(tls, _context, _r)
115644  }
115645  
115646  // C comment
115647  //  /*
115648  //  ** Implementation of randomblob(N).  Return a random blob
115649  //  ** that is N bytes long.
115650  //  */
115651  func _randomBlob(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115652  	var _n int32
115653  	var _p *uint8
115654  	func() {
115655  		if _argc != int32(1) {
115656  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106047), unsafe.Pointer(&_randomBlobØ00__func__Ø000), unsafe.Pointer(str(125396)))
115657  			crt.X__builtin_abort(tls)
115658  		}
115659  	}()
115660  
115661  	_n = Xsqlite3_value_int(tls, *elem19(_argv, 0))
115662  	if _n < int32(1) {
115663  		_n = int32(1)
115664  	}
115665  	_p = (*uint8)(_contextMalloc(tls, _context, int64(_n)))
115666  	if _p != nil {
115667  		Xsqlite3_randomness(tls, _n, unsafe.Pointer(_p))
115668  		Xsqlite3_result_blob(tls, _context, unsafe.Pointer(_p), _n, Xsqlite3_free)
115669  	}
115670  }
115671  
115672  var _randomBlobØ00__func__Ø000 [11]int8
115673  
115674  func init() {
115675  	crt.Xstrncpy(nil, &_randomBlobØ00__func__Ø000[0], str(130707), 11)
115676  }
115677  
115678  // C comment
115679  //  /*
115680  //  ** Implementation of the NULLIF(x,y) function.  The result is the first
115681  //  ** argument if the arguments are different.  The result is NULL if the
115682  //  ** arguments are equal to each other.
115683  //  */
115684  func _nullifFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) {
115685  	var _pColl *XCollSeq
115686  	_pColl = _sqlite3GetFuncCollSeq(tls, _context)
115687  
115688  	if _sqlite3MemCompare(tls, *elem19(_argv, 0), *elem19(_argv, uintptr(1)), _pColl) != int32(0) {
115689  		Xsqlite3_result_value(tls, _context, *elem19(_argv, 0))
115690  	}
115691  }
115692  
115693  // C comment
115694  //  /*
115695  //  ** Implementation of the sqlite_source_id() function. The result is a string
115696  //  ** that identifies the particular version of the source code used to build
115697  //  ** SQLite.
115698  //  */
115699  func _sourceidFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
115700  	_ = _NotUsed2
115701  
115702  	Xsqlite3_result_text(tls, _context, Xsqlite3_sourceid(tls), int32(-1), nil)
115703  }
115704  
115705  // C comment
115706  //  /*
115707  //  ** Implementation of the sqlite_log() function.  This is a wrapper around
115708  //  ** sqlite3_log().  The return value is NULL.  The function exists purely for
115709  //  ** its side-effects.
115710  //  */
115711  func _errlogFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115712  	Xsqlite3_log(tls, Xsqlite3_value_int(tls, *elem19(_argv, 0)), str(24531), unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, uintptr(1)))))
115713  }
115714  
115715  // C comment
115716  //  /*
115717  //  ** Implementation of the QUOTE() function.  This function takes a single
115718  //  ** argument.  If the argument is numeric, the return value is the same as
115719  //  ** the argument.  If the argument is NULL, the return value is the string
115720  //  ** "NULL".  Otherwise, the argument is enclosed in single quotes with
115721  //  ** single-quote escapes.
115722  //  */
115723  func _quoteFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115724  	var _5_nBlob, _6_i, _8_i, _8_j int32
115725  	var _8_n uint64
115726  	var _5_zText, _5_zBlob, _8_z *int8
115727  	var _2_r1, _2_r2 float64
115728  	var _8_zArg *uint8
115729  	var _2_zBuf [50]int8
115730  	func() {
115731  		if _argc != int32(1) {
115732  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106532), unsafe.Pointer(&_quoteFuncØ00__func__Ø000), unsafe.Pointer(str(125396)))
115733  			crt.X__builtin_abort(tls)
115734  		}
115735  	}()
115736  
115737  	switch Xsqlite3_value_type(tls, *elem19(_argv, 0)) {
115738  	case int32(1):
115739  		goto _4
115740  	case int32(2):
115741  		goto _3
115742  	case int32(3):
115743  		goto _6
115744  	case int32(4):
115745  		goto _5
115746  	default:
115747  		goto _7
115748  	}
115749  
115750  _3:
115751  	_2_r1 = Xsqlite3_value_double(tls, *elem19(_argv, 0))
115752  	Xsqlite3_snprintf(tls, int32(50), (*int8)(unsafe.Pointer(&_2_zBuf)), str(6268), _2_r1)
115753  	_sqlite3AtoF(tls, (*int8)(unsafe.Pointer(&_2_zBuf)), &_2_r2, int32(20), uint8(1))
115754  	if _2_r1 != _2_r2 {
115755  		Xsqlite3_snprintf(tls, int32(50), (*int8)(unsafe.Pointer(&_2_zBuf)), str(130718), _2_r1)
115756  	}
115757  	Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(&_2_zBuf)), int32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
115758  	goto _9
115759  _4:
115760  	Xsqlite3_result_value(tls, _context, *elem19(_argv, 0))
115761  	goto _9
115762  _5:
115763  	_5_zText = nil
115764  	_5_zBlob = (*int8)(Xsqlite3_value_blob(tls, *elem19(_argv, 0)))
115765  	_5_nBlob = Xsqlite3_value_bytes(tls, *elem19(_argv, 0))
115766  	func() {
115767  		if _5_zBlob != (*int8)(Xsqlite3_value_blob(tls, *elem19(_argv, 0))) {
115768  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106555), unsafe.Pointer(&_quoteFuncØ00__func__Ø000), unsafe.Pointer(str(130725)))
115769  			crt.X__builtin_abort(tls)
115770  		}
115771  	}()
115772  	_5_zText = (*int8)(_contextMalloc(tls, _context, (int64(2)*int64(_5_nBlob))+int64(4)))
115773  	if _5_zText == nil {
115774  		goto _12
115775  	}
115776  	_6_i = int32(0)
115777  _13:
115778  	if _6_i >= _5_nBlob {
115779  		goto _16
115780  	}
115781  	*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)))
115782  	*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)))
115783  	_6_i += 1
115784  	goto _13
115785  _16:
115786  	*elem1(_5_zText, uintptr((_5_nBlob*int32(2))+int32(2))) = int8(39)
115787  	*elem1(_5_zText, uintptr((_5_nBlob*int32(2))+int32(3))) = 0
115788  	*elem1(_5_zText, 0) = int8(88)
115789  	*elem1(_5_zText, uintptr(1)) = int8(39)
115790  	Xsqlite3_result_text(tls, _context, _5_zText, int32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
115791  	Xsqlite3_free(tls, unsafe.Pointer(_5_zText))
115792  _12:
115793  	goto _9
115794  _6:
115795  	_8_zArg = Xsqlite3_value_text(tls, *elem19(_argv, 0))
115796  	if _8_zArg == nil {
115797  		return
115798  	}
115799  	*func() *uint64 { _8_i = int32(0); return &_8_n }() = 0
115800  _18:
115801  	if (*elem15(_8_zArg, uintptr(_8_i))) == 0 {
115802  		goto _21
115803  	}
115804  	if int32(*elem15(_8_zArg, uintptr(_8_i))) == int32(39) {
115805  		_8_n += 1
115806  	}
115807  	_8_i += 1
115808  	goto _18
115809  _21:
115810  	_8_z = (*int8)(_contextMalloc(tls, _context, (int64(_8_i)+int64(_8_n))+int64(3)))
115811  	if _8_z == nil {
115812  		goto _23
115813  	}
115814  	*elem1(_8_z, 0) = int8(39)
115815  	*func() *int32 { _8_i = int32(0); return &_8_j }() = int32(1)
115816  _24:
115817  	if (*elem15(_8_zArg, uintptr(_8_i))) == 0 {
115818  		goto _27
115819  	}
115820  	*elem1(_8_z, uintptr(postInc2(&_8_j, 1))) = int8(*elem15(_8_zArg, uintptr(_8_i)))
115821  	if int32(*elem15(_8_zArg, uintptr(_8_i))) == int32(39) {
115822  		*elem1(_8_z, uintptr(postInc2(&_8_j, 1))) = int8(39)
115823  	}
115824  	_8_i += 1
115825  	goto _24
115826  _27:
115827  	*elem1(_8_z, uintptr(postInc2(&_8_j, 1))) = int8(39)
115828  	*elem1(_8_z, uintptr(_8_j)) = 0
115829  	Xsqlite3_result_text(tls, _context, _8_z, _8_j, Xsqlite3_free)
115830  _23:
115831  	goto _9
115832  _7:
115833  	func() {
115834  		if Xsqlite3_value_type(tls, *elem19(_argv, 0)) != int32(5) {
115835  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106596), unsafe.Pointer(&_quoteFuncØ00__func__Ø000), unsafe.Pointer(str(130760)))
115836  			crt.X__builtin_abort(tls)
115837  		}
115838  	}()
115839  	Xsqlite3_result_text(tls, _context, str(285), int32(4), nil)
115840  	goto _9
115841  _9:
115842  	_ = _2_zBuf
115843  }
115844  
115845  var _quoteFuncØ00__func__Ø000 [10]int8
115846  
115847  func init() {
115848  	crt.Xstrncpy(nil, &_quoteFuncØ00__func__Ø000[0], str(130801), 10)
115849  }
115850  
115851  // C comment
115852  //  /*
115853  //  ** Implementation of the last_insert_rowid() SQL function.  The return
115854  //  ** value is the same as the sqlite3_last_insert_rowid() API function.
115855  //  */
115856  func _last_insert_rowid(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
115857  	var _db *Xsqlite3
115858  	_db = Xsqlite3_context_db_handle(tls, _context)
115859  	_ = _NotUsed2
115860  
115861  	Xsqlite3_result_int64(tls, _context, Xsqlite3_last_insert_rowid(tls, _db))
115862  }
115863  
115864  // C comment
115865  //  /*
115866  //  ** Implementation of the changes() SQL function.
115867  //  **
115868  //  ** IMP: R-62073-11209 The changes() SQL function is a wrapper
115869  //  ** around the sqlite3_changes() C/C++ function and hence follows the same
115870  //  ** rules for counting changes.
115871  //  */
115872  func _changes(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
115873  	var _db *Xsqlite3
115874  	_db = Xsqlite3_context_db_handle(tls, _context)
115875  	_ = _NotUsed2
115876  
115877  	Xsqlite3_result_int(tls, _context, Xsqlite3_changes(tls, _db))
115878  }
115879  
115880  // C comment
115881  //  /*
115882  //  ** Implementation of the total_changes() SQL function.  The return value is
115883  //  ** the same as the sqlite3_total_changes() API function.
115884  //  */
115885  func _total_changes(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
115886  	var _db *Xsqlite3
115887  	_db = Xsqlite3_context_db_handle(tls, _context)
115888  	_ = _NotUsed2
115889  
115890  	Xsqlite3_result_int(tls, _context, Xsqlite3_total_changes(tls, _db))
115891  }
115892  
115893  // C comment
115894  //  /*
115895  //  ** The replace() function.  Three arguments are all strings: call
115896  //  ** them A, B, and C. The result is also a string which is derived
115897  //  ** from A by replacing every occurrence of B with C.  The match
115898  //  ** must be exact.  Collating sequences are not used.
115899  //  */
115900  func _replaceFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
115901  	var _nStr, _nPattern, _nRep, _loopLimit, _i, _j int32
115902  	var _nOut int64
115903  	var _zStr, _zPattern, _zRep, _zOut, _6_zOld *uint8
115904  	var _6_db *Xsqlite3
115905  	func() {
115906  		if _argc != int32(3) {
115907  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106730), unsafe.Pointer(&_replaceFuncØ00__func__Ø000), unsafe.Pointer(str(50249)))
115908  			crt.X__builtin_abort(tls)
115909  		}
115910  	}()
115911  
115912  	_zStr = Xsqlite3_value_text(tls, *elem19(_argv, 0))
115913  	if _zStr == nil {
115914  		return
115915  	}
115916  	_nStr = Xsqlite3_value_bytes(tls, *elem19(_argv, 0))
115917  	func() {
115918  		if _zStr != Xsqlite3_value_text(tls, *elem19(_argv, 0)) {
115919  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106735), unsafe.Pointer(&_replaceFuncØ00__func__Ø000), unsafe.Pointer(str(130811)))
115920  			crt.X__builtin_abort(tls)
115921  		}
115922  	}()
115923  	_zPattern = Xsqlite3_value_text(tls, *elem19(_argv, uintptr(1)))
115924  	if _zPattern == nil {
115925  		func() {
115926  			if Xsqlite3_value_type(tls, *elem19(_argv, uintptr(1))) != int32(5) && (Xsqlite3_context_db_handle(tls, _context).XmallocFailed) == 0 {
115927  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106738), unsafe.Pointer(&_replaceFuncØ00__func__Ø000), unsafe.Pointer(str(130845)))
115928  				crt.X__builtin_abort(tls)
115929  			}
115930  		}()
115931  		return
115932  	}
115933  	if int32(*elem15(_zPattern, 0)) == int32(0) {
115934  		func() {
115935  			if Xsqlite3_value_type(tls, *elem19(_argv, uintptr(1))) == int32(5) {
115936  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106743), unsafe.Pointer(&_replaceFuncØ00__func__Ø000), unsafe.Pointer(str(130938)))
115937  				crt.X__builtin_abort(tls)
115938  			}
115939  		}()
115940  		Xsqlite3_result_value(tls, _context, *elem19(_argv, 0))
115941  		return
115942  	}
115943  	_nPattern = Xsqlite3_value_bytes(tls, *elem19(_argv, uintptr(1)))
115944  	func() {
115945  		if _zPattern != Xsqlite3_value_text(tls, *elem19(_argv, uintptr(1))) {
115946  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106748), unsafe.Pointer(&_replaceFuncØ00__func__Ø000), unsafe.Pointer(str(130979)))
115947  			crt.X__builtin_abort(tls)
115948  		}
115949  	}()
115950  	_zRep = Xsqlite3_value_text(tls, *elem19(_argv, uintptr(2)))
115951  	if _zRep == nil {
115952  		return
115953  	}
115954  	_nRep = Xsqlite3_value_bytes(tls, *elem19(_argv, uintptr(2)))
115955  	func() {
115956  		if _zRep != Xsqlite3_value_text(tls, *elem19(_argv, uintptr(2))) {
115957  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106752), unsafe.Pointer(&_replaceFuncØ00__func__Ø000), unsafe.Pointer(str(131017)))
115958  			crt.X__builtin_abort(tls)
115959  		}
115960  	}()
115961  	_nOut = int64(_nStr + int32(1))
115962  	func() {
115963  		if _nOut >= int64(1000000000) {
115964  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106754), unsafe.Pointer(&_replaceFuncØ00__func__Ø000), unsafe.Pointer(str(131051)))
115965  			crt.X__builtin_abort(tls)
115966  		}
115967  	}()
115968  	_zOut = (*uint8)(_contextMalloc(tls, _context, _nOut))
115969  	if _zOut == nil {
115970  		return
115971  	}
115972  	_loopLimit = _nStr - _nPattern
115973  	_i = store2(&_j, int32(0))
115974  _20:
115975  	if _i > _loopLimit {
115976  		goto _23
115977  	}
115978  	if (int32(*elem15(_zStr, uintptr(_i))) != int32(*elem15(_zPattern, 0))) || crt.Xmemcmp(tls, unsafe.Pointer(elem15(_zStr, uintptr(_i))), unsafe.Pointer(_zPattern), uint32(_nPattern)) != 0 {
115979  		*elem15(_zOut, uintptr(postInc2(&_j, 1))) = *elem15(_zStr, uintptr(_i))
115980  		goto _26
115981  	}
115982  	_6_db = Xsqlite3_context_db_handle(tls, _context)
115983  	_nOut += int64(_nRep - _nPattern)
115984  	if (_nOut - int64(1)) > int64(*elem8((*int32)(unsafe.Pointer(&_6_db.XaLimit)), 0)) {
115985  		Xsqlite3_result_error_toobig(tls, _context)
115986  		Xsqlite3_free(tls, unsafe.Pointer(_zOut))
115987  		return
115988  	}
115989  	_6_zOld = _zOut
115990  	_zOut = (*uint8)(Xsqlite3_realloc64(tls, unsafe.Pointer(_zOut), uint64(int32(_nOut))))
115991  	if _zOut == nil {
115992  		Xsqlite3_result_error_nomem(tls, _context)
115993  		Xsqlite3_free(tls, unsafe.Pointer(_6_zOld))
115994  		return
115995  	}
115996  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_zOut, uintptr(_j))), unsafe.Pointer(_zRep), uint32(_nRep))
115997  	_j += _nRep
115998  	_i += _nPattern - int32(1)
115999  _26:
116000  	_i += 1
116001  	goto _20
116002  _23:
116003  	func() {
116004  		if int64(((_j+_nStr)-_i)+int32(1)) != _nOut {
116005  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106786), unsafe.Pointer(&_replaceFuncØ00__func__Ø000), unsafe.Pointer(str(131074)))
116006  			crt.X__builtin_abort(tls)
116007  		}
116008  	}()
116009  	crt.Xmemcpy(tls, unsafe.Pointer(elem15(_zOut, uintptr(_j))), unsafe.Pointer(elem15(_zStr, uintptr(_i))), uint32(_nStr-_i))
116010  	_j += _nStr - _i
116011  	func() {
116012  		if int64(_j) > _nOut {
116013  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106789), unsafe.Pointer(&_replaceFuncØ00__func__Ø000), unsafe.Pointer(str(131091)))
116014  			crt.X__builtin_abort(tls)
116015  		}
116016  	}()
116017  	*elem15(_zOut, uintptr(_j)) = 0
116018  	Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(_zOut)), _j, Xsqlite3_free)
116019  }
116020  
116021  var _replaceFuncØ00__func__Ø000 [12]int8
116022  
116023  func init() {
116024  	crt.Xstrncpy(nil, &_replaceFuncØ00__func__Ø000[0], str(131099), 12)
116025  }
116026  
116027  // C comment
116028  //  /*
116029  //  ** The zeroblob(N) function returns a zero-filled blob of size N bytes.
116030  //  */
116031  func _zeroblobFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
116032  	var _rc int32
116033  	var _n int64
116034  	func() {
116035  		if _argc != int32(1) {
116036  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(106698), unsafe.Pointer(&_zeroblobFuncØ00__func__Ø000), unsafe.Pointer(str(125396)))
116037  			crt.X__builtin_abort(tls)
116038  		}
116039  	}()
116040  
116041  	_n = Xsqlite3_value_int64(tls, *elem19(_argv, 0))
116042  	if _n < (0) {
116043  		_n = 0
116044  	}
116045  	_rc = Xsqlite3_result_zeroblob64(tls, _context, uint64(_n))
116046  	if _rc != 0 {
116047  		Xsqlite3_result_error_code(tls, _context, _rc)
116048  	}
116049  }
116050  
116051  var _zeroblobFuncØ00__func__Ø000 [13]int8
116052  
116053  func init() {
116054  	crt.Xstrncpy(nil, &_zeroblobFuncØ00__func__Ø000[0], str(131111), 13)
116055  }
116056  
116057  // C comment
116058  //  /*
116059  //  ** Implementation of the substr() function.
116060  //  **
116061  //  ** substr(x,p1,p2)  returns p2 characters of x[] beginning with p1.
116062  //  ** p1 is 1-indexed.  So substr(x,1,1) returns the first character
116063  //  ** of x.  If x is text, then we actually count UTF-8 characters.
116064  //  ** If x is a blob, then we count bytes.
116065  //  **
116066  //  ** If p1 is negative, then we begin abs(p1) from the end of x[].
116067  //  **
116068  //  ** If p2 is negative, return the p2 characters preceding p1.
116069  //  */
116070  func _substrFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
116071  	var _len, _p0type, _negP2 int32
116072  	var _p1, _p2 int64
116073  	var _z, _z2 *uint8
116074  	_negP2 = int32(0)
116075  	func() {
116076  		if _argc != int32(3) && _argc != int32(2) {
116077  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105817), unsafe.Pointer(&_substrFuncØ00__func__Ø000), unsafe.Pointer(str(131124)))
116078  			crt.X__builtin_abort(tls)
116079  		}
116080  	}()
116081  	if (Xsqlite3_value_type(tls, *elem19(_argv, uintptr(1))) == int32(5)) || ((_argc == int32(3)) && (Xsqlite3_value_type(tls, *elem19(_argv, uintptr(2))) == int32(5))) {
116082  		return
116083  	}
116084  	_p0type = Xsqlite3_value_type(tls, *elem19(_argv, 0))
116085  	_p1 = int64(Xsqlite3_value_int(tls, *elem19(_argv, uintptr(1))))
116086  	if _p0type != int32(4) {
116087  		goto _6
116088  	}
116089  	_len = Xsqlite3_value_bytes(tls, *elem19(_argv, 0))
116090  	_z = (*uint8)(Xsqlite3_value_blob(tls, *elem19(_argv, 0)))
116091  	if _z == nil {
116092  		return
116093  	}
116094  	func() {
116095  		if _len != Xsqlite3_value_bytes(tls, *elem19(_argv, 0)) {
116096  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105829), unsafe.Pointer(&_substrFuncØ00__func__Ø000), unsafe.Pointer(str(131143)))
116097  			crt.X__builtin_abort(tls)
116098  		}
116099  	}()
116100  	goto _10
116101  _6:
116102  	_z = Xsqlite3_value_text(tls, *elem19(_argv, 0))
116103  	if _z == nil {
116104  		return
116105  	}
116106  	_len = int32(0)
116107  	if _p1 >= (0) {
116108  		goto _12
116109  	}
116110  	_z2 = _z
116111  _13:
116112  	if (*_z2) == 0 {
116113  		goto _16
116114  	}
116115  	if int32(*postInc15(&_z2, 1)) < int32(192) {
116116  		goto _17
116117  	}
116118  _18:
116119  	if (int32(*_z2) & int32(192)) == int32(128) {
116120  		*(*uintptr)(unsafe.Pointer(&_z2)) += uintptr(1)
116121  		goto _18
116122  	}
116123  _17:
116124  	_len += 1
116125  	goto _13
116126  _16:
116127  _12:
116128  _10:
116129  	if _argc != int32(3) {
116130  		goto _20
116131  	}
116132  	_p2 = int64(Xsqlite3_value_int(tls, *elem19(_argv, uintptr(2))))
116133  	if _p2 < (0) {
116134  		_p2 = -_p2
116135  		_negP2 = int32(1)
116136  	}
116137  	goto _22
116138  _20:
116139  	_p2 = int64(*elem8((*int32)(unsafe.Pointer(&(Xsqlite3_context_db_handle(tls, _context).XaLimit))), 0))
116140  _22:
116141  	if _p1 >= (0) {
116142  		goto _23
116143  	}
116144  	_p1 += int64(_len)
116145  	if _p1 >= (0) {
116146  		goto _24
116147  	}
116148  	_p2 += _p1
116149  	if _p2 < (0) {
116150  		_p2 = 0
116151  	}
116152  	_p1 = 0
116153  _24:
116154  	goto _29
116155  _23:
116156  	if _p1 > (0) {
116157  		_p1 -= 1
116158  		goto _29
116159  	}
116160  	if _p2 > (0) {
116161  		_p2 -= 1
116162  	}
116163  _29:
116164  	if _negP2 == 0 {
116165  		goto _30
116166  	}
116167  	_p1 -= _p2
116168  	if _p1 < (0) {
116169  		_p2 += _p1
116170  		_p1 = 0
116171  	}
116172  _30:
116173  	func() {
116174  		if _p1 < (0) || _p2 < (0) {
116175  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(105876), unsafe.Pointer(&_substrFuncØ00__func__Ø000), unsafe.Pointer(str(131177)))
116176  			crt.X__builtin_abort(tls)
116177  		}
116178  	}()
116179  	if _p0type == int32(4) {
116180  		goto _35
116181  	}
116182  _36:
116183  	if (*_z) == 0 || _p1 == 0 {
116184  		goto _37
116185  	}
116186  	if int32(*postInc15(&_z, 1)) < int32(192) {
116187  		goto _39
116188  	}
116189  _40:
116190  	if (int32(*_z) & int32(192)) == int32(128) {
116191  		*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
116192  		goto _40
116193  	}
116194  _39:
116195  	_p1 -= 1
116196  	goto _36
116197  _37:
116198  	_z2 = _z
116199  _42:
116200  	if (*_z2) == 0 || _p2 == 0 {
116201  		goto _46
116202  	}
116203  	if int32(*postInc15(&_z2, 1)) < int32(192) {
116204  		goto _47
116205  	}
116206  _48:
116207  	if (int32(*_z2) & int32(192)) == int32(128) {
116208  		*(*uintptr)(unsafe.Pointer(&_z2)) += uintptr(1)
116209  		goto _48
116210  	}
116211  _47:
116212  	_p2 -= 1
116213  	goto _42
116214  _46:
116215  	Xsqlite3_result_text64(tls, _context, (*int8)(unsafe.Pointer(_z)), uint64(int32(uintptr(unsafe.Pointer(_z2))-uintptr(unsafe.Pointer(_z)))), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})), uint8(1))
116216  	goto _50
116217  _35:
116218  	if (_p1 + _p2) <= int64(_len) {
116219  		goto _51
116220  	}
116221  	_p2 = int64(_len) - _p1
116222  	if _p2 < (0) {
116223  		_p2 = 0
116224  	}
116225  _51:
116226  	Xsqlite3_result_blob64(tls, _context, unsafe.Pointer(elem15(_z, uintptr(_p1))), uint64(_p2), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
116227  _50:
116228  }
116229  
116230  var _substrFuncØ00__func__Ø000 [11]int8
116231  
116232  func init() {
116233  	crt.Xstrncpy(nil, &_substrFuncØ00__func__Ø000[0], str(131192), 11)
116234  }
116235  
116236  // C comment
116237  //  /*
116238  //  ** Routines used to compute the sum, average, and total.
116239  //  **
116240  //  ** The SUM() function follows the (broken) SQL standard which means
116241  //  ** that it returns NULL if it sums over no inputs.  TOTAL returns
116242  //  ** 0.0 in that case.  In addition, TOTAL always returns a float where
116243  //  ** SUM might return an integer if it never encounters a floating point
116244  //  ** value.  TOTAL never fails, but SUM might through an exception if
116245  //  ** it overflows an integer.
116246  //  */
116247  func _sumStep(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
116248  	var _type int32
116249  	var _2_v int64
116250  	var _p *XSumCtx
116251  	func() {
116252  		if _argc != int32(1) {
116253  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107016), unsafe.Pointer(&_sumStepØ00__func__Ø000), unsafe.Pointer(str(125396)))
116254  			crt.X__builtin_abort(tls)
116255  		}
116256  	}()
116257  
116258  	_p = (*XSumCtx)(Xsqlite3_aggregate_context(tls, _context, int32(28)))
116259  	_type = Xsqlite3_value_numeric_type(tls, *elem19(_argv, 0))
116260  	if _p == nil || _type == int32(5) {
116261  		goto _3
116262  	}
116263  	_p.Xcnt += 1
116264  	if _type != int32(1) {
116265  		goto _4
116266  	}
116267  	_2_v = Xsqlite3_value_int64(tls, *elem19(_argv, 0))
116268  	_p.XrSum += float64(_2_v)
116269  	if ((int32(_p.Xapprox) | int32(_p.Xoverflow)) == int32(0)) && _sqlite3AddInt64(tls, &_p.XiSum, _2_v) != 0 {
116270  		_p.Xoverflow = uint8(1)
116271  	}
116272  	goto _7
116273  _4:
116274  	_p.XrSum += Xsqlite3_value_double(tls, *elem19(_argv, 0))
116275  	_p.Xapprox = uint8(1)
116276  _7:
116277  _3:
116278  }
116279  
116280  var _sumStepØ00__func__Ø000 [8]int8
116281  
116282  func init() {
116283  	crt.Xstrncpy(nil, &_sumStepØ00__func__Ø000[0], str(131203), 8)
116284  }
116285  
116286  func _sumFinalize(tls *crt.TLS, _context *Xsqlite3_context) {
116287  	var _p *XSumCtx
116288  	_p = (*XSumCtx)(Xsqlite3_aggregate_context(tls, _context, int32(0)))
116289  	if _p == nil || _p.Xcnt <= (0) {
116290  		goto _1
116291  	}
116292  	if _p.Xoverflow != 0 {
116293  		Xsqlite3_result_error(tls, _context, str(130546), int32(-1))
116294  		goto _5
116295  	}
116296  	if _p.Xapprox != 0 {
116297  		Xsqlite3_result_double(tls, _context, _p.XrSum)
116298  		goto _5
116299  	}
116300  	Xsqlite3_result_int64(tls, _context, _p.XiSum)
116301  _5:
116302  _1:
116303  }
116304  
116305  func _totalFinalize(tls *crt.TLS, _context *Xsqlite3_context) {
116306  	var _p *XSumCtx
116307  	_p = (*XSumCtx)(Xsqlite3_aggregate_context(tls, _context, int32(0)))
116308  	Xsqlite3_result_double(tls, _context, func() float64 {
116309  		if _p != nil {
116310  			return _p.XrSum
116311  		}
116312  		return float64(0)
116313  	}())
116314  }
116315  
116316  func _avgFinalize(tls *crt.TLS, _context *Xsqlite3_context) {
116317  	var _p *XSumCtx
116318  	_p = (*XSumCtx)(Xsqlite3_aggregate_context(tls, _context, int32(0)))
116319  	if (_p != nil) && (_p.Xcnt > (0)) {
116320  		Xsqlite3_result_double(tls, _context, _p.XrSum/float64(_p.Xcnt))
116321  	}
116322  }
116323  
116324  // C comment
116325  //  /*
116326  //  ** Routines to implement the count() aggregate function.
116327  //  */
116328  func _countStep(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
116329  	var _p *XCountCtx
116330  	_p = (*XCountCtx)(Xsqlite3_aggregate_context(tls, _context, int32(8)))
116331  	if ((_argc == int32(0)) || (int32(5) != Xsqlite3_value_type(tls, *elem19(_argv, 0)))) && (_p != nil) {
116332  		_p.Xn += 1
116333  	}
116334  	func() {
116335  		if _argc != int32(1) && _p != nil && _p.Xn <= int64(2147483647) && _p.Xn != int64(Xsqlite3_aggregate_count(tls, _context)) {
116336  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107085), unsafe.Pointer(&_countStepØ00__func__Ø000), unsafe.Pointer(str(131211)))
116337  			crt.X__builtin_abort(tls)
116338  		}
116339  	}()
116340  }
116341  
116342  var _countStepØ00__func__Ø000 [10]int8
116343  
116344  func init() {
116345  	crt.Xstrncpy(nil, &_countStepØ00__func__Ø000[0], str(131288), 10)
116346  }
116347  
116348  func _countFinalize(tls *crt.TLS, _context *Xsqlite3_context) {
116349  	var _p *XCountCtx
116350  	_p = (*XCountCtx)(Xsqlite3_aggregate_context(tls, _context, int32(0)))
116351  	Xsqlite3_result_int64(tls, _context, func() int64 {
116352  		if _p != nil {
116353  			return _p.Xn
116354  		}
116355  		return (0)
116356  	}())
116357  }
116358  
116359  // C comment
116360  //  /*
116361  //  ** group_concat(EXPR, ?SEPARATOR?)
116362  //  */
116363  func _groupConcatStep(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
116364  	var _nVal, _nSep, _1_firstTerm int32
116365  	var _zVal, _zSep *int8
116366  	var _1_db *Xsqlite3
116367  	var _pAccum *XStrAccum
116368  	func() {
116369  		if _argc != int32(1) && _argc != int32(2) {
116370  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(107159), unsafe.Pointer(&_groupConcatStepØ00__func__Ø000), unsafe.Pointer(str(130571)))
116371  			crt.X__builtin_abort(tls)
116372  		}
116373  	}()
116374  	if Xsqlite3_value_type(tls, *elem19(_argv, 0)) == int32(5) {
116375  		return
116376  	}
116377  	_pAccum = (*XStrAccum)(Xsqlite3_aggregate_context(tls, _context, int32(28)))
116378  	if _pAccum == nil {
116379  		goto _4
116380  	}
116381  	_1_db = Xsqlite3_context_db_handle(tls, _context)
116382  	_1_firstTerm = bool2int(_pAccum.XmxAlloc == (0))
116383  	_pAccum.XmxAlloc = uint32(*elem8((*int32)(unsafe.Pointer(&_1_db.XaLimit)), 0))
116384  	if _1_firstTerm != 0 {
116385  		goto _5
116386  	}
116387  	if _argc == int32(2) {
116388  		_zSep = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, uintptr(1)))))
116389  		_nSep = Xsqlite3_value_bytes(tls, *elem19(_argv, uintptr(1)))
116390  		goto _7
116391  	}
116392  	_zSep = str(107791)
116393  	_nSep = int32(1)
116394  _7:
116395  	if _zSep != nil {
116396  		_sqlite3StrAccumAppend(tls, _pAccum, _zSep, _nSep)
116397  	}
116398  _5:
116399  	_zVal = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19(_argv, 0))))
116400  	_nVal = Xsqlite3_value_bytes(tls, *elem19(_argv, 0))
116401  	if _zVal != nil {
116402  		_sqlite3StrAccumAppend(tls, _pAccum, _zVal, _nVal)
116403  	}
116404  _4:
116405  }
116406  
116407  var _groupConcatStepØ00__func__Ø000 [16]int8
116408  
116409  func init() {
116410  	crt.Xstrncpy(nil, &_groupConcatStepØ00__func__Ø000[0], str(131298), 16)
116411  }
116412  
116413  func _groupConcatFinalize(tls *crt.TLS, _context *Xsqlite3_context) {
116414  	var _pAccum *XStrAccum
116415  	_pAccum = (*XStrAccum)(Xsqlite3_aggregate_context(tls, _context, int32(0)))
116416  	if _pAccum == nil {
116417  		goto _0
116418  	}
116419  	if int32(_pAccum.XaccError) == int32(2) {
116420  		Xsqlite3_result_error_toobig(tls, _context)
116421  		goto _4
116422  	}
116423  	if int32(_pAccum.XaccError) == int32(1) {
116424  		Xsqlite3_result_error_nomem(tls, _context)
116425  		goto _4
116426  	}
116427  	Xsqlite3_result_text(tls, _context, _sqlite3StrAccumFinish(tls, _pAccum), int32(-1), Xsqlite3_free)
116428  _4:
116429  _0:
116430  }
116431  
116432  // C comment
116433  //  /*************************************************** General Interfaces ******
116434  //  **
116435  //  ** Initialize and shutdown the page cache subsystem. Neither of these
116436  //  ** functions are threadsafe.
116437  //  */
116438  func _sqlite3PcacheInitialize(tls *crt.TLS) (r0 int32) {
116439  	if (_sqlite3Config.Xpcache2.XxInit) == nil {
116440  		_sqlite3PCacheSetDefault(tls)
116441  	}
116442  	return (_sqlite3Config.Xpcache2.XxInit)(tls, _sqlite3Config.Xpcache2.XpArg)
116443  }
116444  
116445  // C comment
116446  //  /*
116447  //  ** This function is a wrapper around the OS specific implementation of
116448  //  ** sqlite3_os_init(). The purpose of the wrapper is to provide the
116449  //  ** ability to simulate a malloc failure, so that the handling of an
116450  //  ** error in sqlite3_os_init() by the upper layers can be tested.
116451  //  */
116452  func _sqlite3OsInit(tls *crt.TLS) (r0 int32) {
116453  	var _p unsafe.Pointer
116454  	_p = Xsqlite3_malloc(tls, int32(10))
116455  	if _p == nil {
116456  		return _sqlite3NomemError(tls, int32(20396))
116457  	}
116458  	Xsqlite3_free(tls, _p)
116459  	return Xsqlite3_os_init(tls)
116460  }
116461  
116462  // C comment
116463  //  /*
116464  //  ** Initialize the operating system interface.
116465  //  **
116466  //  ** This routine registers all VFS implementations for unix-like operating
116467  //  ** systems.  This routine, and the sqlite3_os_end() routine that follows,
116468  //  ** should be the only routines in this file that are visible from other
116469  //  ** files.
116470  //  **
116471  //  ** This routine is called once during SQLite initialization and by a
116472  //  ** single thread.  The memory allocation and mutex subsystems have not
116473  //  ** necessarily been initialized when this routine is called, and so they
116474  //  ** should not be used.
116475  //  */
116476  func Xsqlite3_os_init(tls *crt.TLS) (r0 int32) {
116477  	var _i uint32
116478  
116479  	_i = 0
116480  _0:
116481  	if _i >= uint32(4) {
116482  		goto _3
116483  	}
116484  	Xsqlite3_vfs_register(tls, elem133((*Xsqlite3_vfs)(unsafe.Pointer(&_sqlite3_os_initØ00aVfsØ001)), uintptr(_i)), bool2int(_i == (0)))
116485  	_i += 1
116486  	goto _0
116487  _3:
116488  	return int32(0)
116489  }
116490  
116491  var _sqlite3_os_initØ00aVfsØ001 [4]Xsqlite3_vfs
116492  
116493  func init() {
116494  	_sqlite3_os_initØ00aVfsØ001 = [4]Xsqlite3_vfs{Xsqlite3_vfs{XiVersion: int32(3), XszOsFile: int32(80), 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 {
116495  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, *Xsqlite3_file, int32, *int32) int32
116496  	}{_unixOpen})), XxDelete: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32) int32)(unsafe.Pointer(&struct {
116497  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32) int32
116498  	}{_unixDelete})), XxAccess: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32)(unsafe.Pointer(&struct {
116499  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int32) int32
116500  	}{_unixAccess})), XxFullPathname: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int8) int32)(unsafe.Pointer(&struct {
116501  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int8) int32
116502  	}{_unixFullPathname})), XxDlOpen: *(*func(*crt.TLS, unsafe.Pointer, *int8) unsafe.Pointer)(unsafe.Pointer(&struct {
116503  		f func(*crt.TLS, *Xsqlite3_vfs, *int8) unsafe.Pointer
116504  	}{_unixDlOpen})), XxDlError: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8))(unsafe.Pointer(&struct {
116505  		f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8)
116506  	}{_unixDlError})), XxDlSym: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
116507  		f func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS)
116508  	}{_unixDlSym})), XxDlClose: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&struct {
116509  		f func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer)
116510  	}{_unixDlClose})), XxRandomness: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
116511  		f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32
116512  	}{_unixRandomness})), XxSleep: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
116513  		f func(*crt.TLS, *Xsqlite3_vfs, int32) int32
116514  	}{_unixSleep})), XxCurrentTime: *(*func(*crt.TLS, unsafe.Pointer, *float64) int32)(unsafe.Pointer(&struct {
116515  		f func(*crt.TLS, *Xsqlite3_vfs, *float64) int32
116516  	}{_unixCurrentTime})), XxGetLastError: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
116517  		f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32
116518  	}{_unixGetLastError})), XxCurrentTimeInt64: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
116519  		f func(*crt.TLS, *Xsqlite3_vfs, *int64) int32
116520  	}{_unixCurrentTimeInt64})), XxSetSystemCall: *(*func(*crt.TLS, unsafe.Pointer, *int8, func(*crt.TLS)) int32)(unsafe.Pointer(&struct {
116521  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, func(*crt.TLS)) int32
116522  	}{_unixSetSystemCall})), XxGetSystemCall: *(*func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
116523  		f func(*crt.TLS, *Xsqlite3_vfs, *int8) func(*crt.TLS)
116524  	}{_unixGetSystemCall})), XxNextSystemCall: *(*func(*crt.TLS, unsafe.Pointer, *int8) *int8)(unsafe.Pointer(&struct {
116525  		f func(*crt.TLS, *Xsqlite3_vfs, *int8) *int8
116526  	}{_unixNextSystemCall}))}, Xsqlite3_vfs{XiVersion: int32(3), XszOsFile: int32(80), 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 {
116527  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, *Xsqlite3_file, int32, *int32) int32
116528  	}{_unixOpen})), XxDelete: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32) int32)(unsafe.Pointer(&struct {
116529  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32) int32
116530  	}{_unixDelete})), XxAccess: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32)(unsafe.Pointer(&struct {
116531  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int32) int32
116532  	}{_unixAccess})), XxFullPathname: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int8) int32)(unsafe.Pointer(&struct {
116533  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int8) int32
116534  	}{_unixFullPathname})), XxDlOpen: *(*func(*crt.TLS, unsafe.Pointer, *int8) unsafe.Pointer)(unsafe.Pointer(&struct {
116535  		f func(*crt.TLS, *Xsqlite3_vfs, *int8) unsafe.Pointer
116536  	}{_unixDlOpen})), XxDlError: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8))(unsafe.Pointer(&struct {
116537  		f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8)
116538  	}{_unixDlError})), XxDlSym: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
116539  		f func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS)
116540  	}{_unixDlSym})), XxDlClose: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&struct {
116541  		f func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer)
116542  	}{_unixDlClose})), XxRandomness: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
116543  		f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32
116544  	}{_unixRandomness})), XxSleep: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
116545  		f func(*crt.TLS, *Xsqlite3_vfs, int32) int32
116546  	}{_unixSleep})), XxCurrentTime: *(*func(*crt.TLS, unsafe.Pointer, *float64) int32)(unsafe.Pointer(&struct {
116547  		f func(*crt.TLS, *Xsqlite3_vfs, *float64) int32
116548  	}{_unixCurrentTime})), XxGetLastError: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
116549  		f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32
116550  	}{_unixGetLastError})), XxCurrentTimeInt64: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
116551  		f func(*crt.TLS, *Xsqlite3_vfs, *int64) int32
116552  	}{_unixCurrentTimeInt64})), XxSetSystemCall: *(*func(*crt.TLS, unsafe.Pointer, *int8, func(*crt.TLS)) int32)(unsafe.Pointer(&struct {
116553  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, func(*crt.TLS)) int32
116554  	}{_unixSetSystemCall})), XxGetSystemCall: *(*func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
116555  		f func(*crt.TLS, *Xsqlite3_vfs, *int8) func(*crt.TLS)
116556  	}{_unixGetSystemCall})), XxNextSystemCall: *(*func(*crt.TLS, unsafe.Pointer, *int8) *int8)(unsafe.Pointer(&struct {
116557  		f func(*crt.TLS, *Xsqlite3_vfs, *int8) *int8
116558  	}{_unixNextSystemCall}))}, Xsqlite3_vfs{XiVersion: int32(3), XszOsFile: int32(80), 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 {
116559  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, *Xsqlite3_file, int32, *int32) int32
116560  	}{_unixOpen})), XxDelete: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32) int32)(unsafe.Pointer(&struct {
116561  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32) int32
116562  	}{_unixDelete})), XxAccess: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32)(unsafe.Pointer(&struct {
116563  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int32) int32
116564  	}{_unixAccess})), XxFullPathname: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int8) int32)(unsafe.Pointer(&struct {
116565  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int8) int32
116566  	}{_unixFullPathname})), XxDlOpen: *(*func(*crt.TLS, unsafe.Pointer, *int8) unsafe.Pointer)(unsafe.Pointer(&struct {
116567  		f func(*crt.TLS, *Xsqlite3_vfs, *int8) unsafe.Pointer
116568  	}{_unixDlOpen})), XxDlError: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8))(unsafe.Pointer(&struct {
116569  		f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8)
116570  	}{_unixDlError})), XxDlSym: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
116571  		f func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS)
116572  	}{_unixDlSym})), XxDlClose: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&struct {
116573  		f func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer)
116574  	}{_unixDlClose})), XxRandomness: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
116575  		f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32
116576  	}{_unixRandomness})), XxSleep: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
116577  		f func(*crt.TLS, *Xsqlite3_vfs, int32) int32
116578  	}{_unixSleep})), XxCurrentTime: *(*func(*crt.TLS, unsafe.Pointer, *float64) int32)(unsafe.Pointer(&struct {
116579  		f func(*crt.TLS, *Xsqlite3_vfs, *float64) int32
116580  	}{_unixCurrentTime})), XxGetLastError: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
116581  		f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32
116582  	}{_unixGetLastError})), XxCurrentTimeInt64: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
116583  		f func(*crt.TLS, *Xsqlite3_vfs, *int64) int32
116584  	}{_unixCurrentTimeInt64})), XxSetSystemCall: *(*func(*crt.TLS, unsafe.Pointer, *int8, func(*crt.TLS)) int32)(unsafe.Pointer(&struct {
116585  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, func(*crt.TLS)) int32
116586  	}{_unixSetSystemCall})), XxGetSystemCall: *(*func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
116587  		f func(*crt.TLS, *Xsqlite3_vfs, *int8) func(*crt.TLS)
116588  	}{_unixGetSystemCall})), XxNextSystemCall: *(*func(*crt.TLS, unsafe.Pointer, *int8) *int8)(unsafe.Pointer(&struct {
116589  		f func(*crt.TLS, *Xsqlite3_vfs, *int8) *int8
116590  	}{_unixNextSystemCall}))}, Xsqlite3_vfs{XiVersion: int32(3), XszOsFile: int32(80), 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 {
116591  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, *Xsqlite3_file, int32, *int32) int32
116592  	}{_unixOpen})), XxDelete: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32) int32)(unsafe.Pointer(&struct {
116593  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32) int32
116594  	}{_unixDelete})), XxAccess: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32)(unsafe.Pointer(&struct {
116595  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int32) int32
116596  	}{_unixAccess})), XxFullPathname: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int8) int32)(unsafe.Pointer(&struct {
116597  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int8) int32
116598  	}{_unixFullPathname})), XxDlOpen: *(*func(*crt.TLS, unsafe.Pointer, *int8) unsafe.Pointer)(unsafe.Pointer(&struct {
116599  		f func(*crt.TLS, *Xsqlite3_vfs, *int8) unsafe.Pointer
116600  	}{_unixDlOpen})), XxDlError: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8))(unsafe.Pointer(&struct {
116601  		f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8)
116602  	}{_unixDlError})), XxDlSym: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
116603  		f func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS)
116604  	}{_unixDlSym})), XxDlClose: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&struct {
116605  		f func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer)
116606  	}{_unixDlClose})), XxRandomness: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
116607  		f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32
116608  	}{_unixRandomness})), XxSleep: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
116609  		f func(*crt.TLS, *Xsqlite3_vfs, int32) int32
116610  	}{_unixSleep})), XxCurrentTime: *(*func(*crt.TLS, unsafe.Pointer, *float64) int32)(unsafe.Pointer(&struct {
116611  		f func(*crt.TLS, *Xsqlite3_vfs, *float64) int32
116612  	}{_unixCurrentTime})), XxGetLastError: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
116613  		f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32
116614  	}{_unixGetLastError})), XxCurrentTimeInt64: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
116615  		f func(*crt.TLS, *Xsqlite3_vfs, *int64) int32
116616  	}{_unixCurrentTimeInt64})), XxSetSystemCall: *(*func(*crt.TLS, unsafe.Pointer, *int8, func(*crt.TLS)) int32)(unsafe.Pointer(&struct {
116617  		f func(*crt.TLS, *Xsqlite3_vfs, *int8, func(*crt.TLS)) int32
116618  	}{_unixSetSystemCall})), XxGetSystemCall: *(*func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
116619  		f func(*crt.TLS, *Xsqlite3_vfs, *int8) func(*crt.TLS)
116620  	}{_unixGetSystemCall})), XxNextSystemCall: *(*func(*crt.TLS, unsafe.Pointer, *int8) *int8)(unsafe.Pointer(&struct {
116621  		f func(*crt.TLS, *Xsqlite3_vfs, *int8) *int8
116622  	}{_unixNextSystemCall}))}}
116623  }
116624  
116625  // C comment
116626  //  /*
116627  //  ** Here are all of the sqlite3_io_methods objects for each of the
116628  //  ** locking strategies.  Functions that return pointers to these methods
116629  //  ** are also created.
116630  //  */
116631  var _posixIoFinder func(*crt.TLS, *int8, *XunixFile) *Xsqlite3_io_methods
116632  
116633  func init() {
116634  	_posixIoFinder = _posixIoFinderImpl
116635  }
116636  
116637  // C comment
116638  //  /*
116639  //  ** Here are all of the sqlite3_io_methods objects for each of the
116640  //  ** locking strategies.  Functions that return pointers to these methods
116641  //  ** are also created.
116642  //  */
116643  func _posixIoFinderImpl(tls *crt.TLS, _z *int8, _p *XunixFile) (r0 *Xsqlite3_io_methods) {
116644  	return &_posixIoMethods
116645  }
116646  
116647  // C comment
116648  //  /*
116649  //  ** Here are all of the sqlite3_io_methods objects for each of the
116650  //  ** locking strategies.  Functions that return pointers to these methods
116651  //  ** are also created.
116652  //  */
116653  var _posixIoMethods Xsqlite3_io_methods
116654  
116655  func init() {
116656  	_posixIoMethods = Xsqlite3_io_methods{XiVersion: int32(3), XxClose: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
116657  		f func(*crt.TLS, *Xsqlite3_file) int32
116658  	}{_unixClose})), XxRead: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
116659  		f func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32
116660  	}{_unixRead})), XxWrite: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
116661  		f func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32
116662  	}{_unixWrite})), XxTruncate: *(*func(*crt.TLS, unsafe.Pointer, int64) int32)(unsafe.Pointer(&struct {
116663  		f func(*crt.TLS, *Xsqlite3_file, int64) int32
116664  	}{_unixTruncate})), XxSync: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
116665  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
116666  	}{_unixSync})), XxFileSize: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
116667  		f func(*crt.TLS, *Xsqlite3_file, *int64) int32
116668  	}{_unixFileSize})), XxLock: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
116669  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
116670  	}{_unixLock})), XxUnlock: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
116671  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
116672  	}{_unixUnlock})), XxCheckReservedLock: *(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer(&struct {
116673  		f func(*crt.TLS, *Xsqlite3_file, *int32) int32
116674  	}{_unixCheckReservedLock})), XxFileControl: *(*func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
116675  		f func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32
116676  	}{_unixFileControl})), XxSectorSize: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
116677  		f func(*crt.TLS, *Xsqlite3_file) int32
116678  	}{_unixSectorSize})), XxDeviceCharacteristics: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
116679  		f func(*crt.TLS, *Xsqlite3_file) int32
116680  	}{_unixDeviceCharacteristics})), XxShmMap: *(*func(*crt.TLS, unsafe.Pointer, int32, int32, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
116681  		f func(*crt.TLS, *Xsqlite3_file, int32, int32, int32, *unsafe.Pointer) int32
116682  	}{_unixShmMap})), XxShmLock: *(*func(*crt.TLS, unsafe.Pointer, int32, int32, int32) int32)(unsafe.Pointer(&struct {
116683  		f func(*crt.TLS, *Xsqlite3_file, int32, int32, int32) int32
116684  	}{_unixShmLock})), XxShmBarrier: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
116685  		f func(*crt.TLS, *Xsqlite3_file)
116686  	}{_unixShmBarrier})), XxShmUnmap: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
116687  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
116688  	}{_unixShmUnmap})), XxFetch: *(*func(*crt.TLS, unsafe.Pointer, int64, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
116689  		f func(*crt.TLS, *Xsqlite3_file, int64, int32, *unsafe.Pointer) int32
116690  	}{_unixFetch})), XxUnfetch: *(*func(*crt.TLS, unsafe.Pointer, int64, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
116691  		f func(*crt.TLS, *Xsqlite3_file, int64, unsafe.Pointer) int32
116692  	}{_unixUnfetch}))}
116693  }
116694  
116695  // C comment
116696  //  /*
116697  //  ** Close a file.
116698  //  */
116699  func _unixClose(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) {
116700  	var _rc int32
116701  	var _pFile *XunixFile
116702  	_rc = int32(0)
116703  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
116704  	_verifyDbFile(tls, _pFile)
116705  	_unixUnlock(tls, _id, int32(0))
116706  	_unixEnterMutex(tls)
116707  	func() {
116708  		if ((*XunixInodeInfo)(_pFile.XpInode).XnLock) <= int32(0) && int32((*XunixInodeInfo)(_pFile.XpInode).XbProcessLock) != int32(0) {
116709  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31867), unsafe.Pointer(&_unixCloseØ00__func__Ø000), unsafe.Pointer(str(131352)))
116710  			crt.X__builtin_abort(tls)
116711  		}
116712  	}()
116713  	if func() int32 {
116714  		if _pFile.XpInode != nil {
116715  			return int32(1)
116716  		}
116717  		return func() int32 {
116718  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31868), unsafe.Pointer(&_unixCloseØ00__func__Ø000), unsafe.Pointer(str(4809)))
116719  			crt.X__builtin_abort(tls)
116720  			return int32(0)
116721  		}()
116722  	}() != 0 && ((*XunixInodeInfo)(_pFile.XpInode).XnLock) != 0 {
116723  		_setPendingFd(tls, _pFile)
116724  	}
116725  	_releaseInodeInfo(tls, _pFile)
116726  	_rc = _closeUnixFile(tls, _id)
116727  	_unixLeaveMutex(tls)
116728  	return _rc
116729  }
116730  
116731  // C comment
116732  //  /*
116733  //  ** Check a unixFile that is a database.  Verify the following:
116734  //  **
116735  //  ** (1) There is exactly one hard link on the file
116736  //  ** (2) The file is not a symbolic link
116737  //  ** (3) The file has not been renamed or unlinked
116738  //  **
116739  //  ** Issue sqlite3_log(SQLITE_WARNING,...) messages if anything is not right.
116740  //  */
116741  func _verifyDbFile(tls *crt.TLS, _pFile *XunixFile) {
116742  	var _rc int32
116743  	var _buf crt.Xstruct_stat64
116744  	if (int32(_pFile.XctrlFlags) & int32(128)) != 0 {
116745  		return
116746  	}
116747  	_rc = func() func(*crt.TLS, int32, *crt.Xstruct_stat64) int32 {
116748  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(5)).XpCurrent
116749  		return *(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
116750  	}()(tls, _pFile.Xh, &_buf)
116751  	if _rc != int32(0) {
116752  		Xsqlite3_log(tls, int32(28), str(131409), unsafe.Pointer(_pFile.XzPath))
116753  		return
116754  	}
116755  	if _buf.Xst_nlink == (0) {
116756  		Xsqlite3_log(tls, int32(28), str(131433), unsafe.Pointer(_pFile.XzPath))
116757  		return
116758  	}
116759  	if _buf.Xst_nlink > uint32(1) {
116760  		Xsqlite3_log(tls, int32(28), str(131462), unsafe.Pointer(_pFile.XzPath))
116761  		return
116762  	}
116763  	if _fileHasMoved(tls, _pFile) != 0 {
116764  		Xsqlite3_log(tls, int32(28), str(131489), unsafe.Pointer(_pFile.XzPath))
116765  		return
116766  	}
116767  }
116768  
116769  // C comment
116770  //  /*
116771  //  ** Many system calls are accessed through pointer-to-functions so that
116772  //  ** they may be overridden at runtime to facilitate fault injection during
116773  //  ** testing and sandboxing.  The following array holds the names and pointers
116774  //  ** to all overrideable system calls.
116775  //  */
116776  var _aSyscall [28]Tunix_syscall
116777  
116778  func init() {
116779  	_aSyscall = [28]Tunix_syscall{Tunix_syscall{XzName: str(131517), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116780  		f func(*crt.TLS, *int8, int32, int32) int32
116781  	}{_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 {
116782  		f func(*crt.TLS, *int8, int32) int32
116783  	}{crt.Xaccess}))}, Tunix_syscall{XzName: str(131528), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116784  		f func(*crt.TLS, *int8, uint32) *int8
116785  	}{crt.Xgetcwd}))}, Tunix_syscall{XzName: str(131535), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116786  		f func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32
116787  	}{crt.Xstat64}))}, Tunix_syscall{XzName: str(131540), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116788  		f func(*crt.TLS, int32, *crt.Xstruct_stat64) int32
116789  	}{crt.Xfstat64}))}, Tunix_syscall{XzName: str(131546), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116790  		f func(*crt.TLS, int32, int64) int32
116791  	}{crt.Xftruncate64}))}, Tunix_syscall{XzName: str(131556), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116792  		f func(*crt.TLS, int32, int32, ...interface{}) int32
116793  	}{crt.Xfcntl}))}, Tunix_syscall{XzName: str(131562), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116794  		f func(*crt.TLS, int32, unsafe.Pointer, uint32) int32
116795  	}{crt.Xread}))}, Tunix_syscall{XzName: str(131567)}, Tunix_syscall{XzName: str(131573)}, Tunix_syscall{XzName: str(131581), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116796  		f func(*crt.TLS, int32, unsafe.Pointer, uint32) int32
116797  	}{crt.Xwrite}))}, Tunix_syscall{XzName: str(131587)}, Tunix_syscall{XzName: str(131594)}, Tunix_syscall{XzName: str(131603), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116798  		f func(*crt.TLS, int32, uint32) int32
116799  	}{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 {
116800  		f func(*crt.TLS, *int8, *int32) int32
116801  	}{_openDirectory}))}, Tunix_syscall{XzName: str(131641), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116802  		f func(*crt.TLS, *int8, uint32) int32
116803  	}{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 {
116804  		f func(*crt.TLS, int32, uint32, uint32) int32
116805  	}{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 {
116806  		f func(*crt.TLS, unsafe.Pointer, uint32, int32, int32, int32, int64) unsafe.Pointer
116807  	}{crt.Xmmap64}))}, Tunix_syscall{XzName: str(131673), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116808  		f func(*crt.TLS, unsafe.Pointer, uint32) int32
116809  	}{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 {
116810  		f func(*crt.TLS, *int8, *int8, uint32) int32
116811  	}{crt.Xreadlink}))}, Tunix_syscall{XzName: str(131708), XpCurrent: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
116812  		f func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32
116813  	}{crt.Xlstat64}))}}
116814  }
116815  
116816  // C comment
116817  //  /*
116818  //  ** Different Unix systems declare open() in different ways.  Same use
116819  //  ** open(const char*,int,mode_t).  Others use open(const char*,int,...).
116820  //  ** The difference is important when using a pointer to the function.
116821  //  **
116822  //  ** The safest way to deal with the problem is to always use this wrapper
116823  //  ** which always has the same well-defined interface.
116824  //  */
116825  func _posixOpen(tls *crt.TLS, _zFile *int8, _flags int32, _mode int32) (r0 int32) {
116826  	return crt.Xopen64(tls, _zFile, _flags, _mode)
116827  }
116828  
116829  // C comment
116830  //  /*
116831  //  ** Open a file descriptor to the directory containing file zFilename.
116832  //  ** If successful, *pFd is set to the opened file descriptor and
116833  //  ** SQLITE_OK is returned. If an error occurs, either SQLITE_NOMEM
116834  //  ** or SQLITE_CANTOPEN is returned and *pFd is set to an undefined
116835  //  ** value.
116836  //  **
116837  //  ** The directory file descriptor is used for only one thing - to
116838  //  ** fsync() a directory to make sure file creation and deletion events
116839  //  ** are flushed to disk.  Such fsyncs are not needed on newer
116840  //  ** journaling filesystems, but are required on older filesystems.
116841  //  **
116842  //  ** This routine can be overridden using the xSetSysCall interface.
116843  //  ** The ability to override this routine was added in support of the
116844  //  ** chromium sandbox.  Opening a directory is a security risk (we are
116845  //  ** told) so making it overrideable allows the chromium sandbox to
116846  //  ** replace this routine with a harmless no-op.  To make this routine
116847  //  ** a no-op, replace it with a stub that returns SQLITE_OK but leaves
116848  //  ** *pFd set to a negative number.
116849  //  **
116850  //  ** If SQLITE_OK is returned, the caller is responsible for closing
116851  //  ** the file descriptor *pFd using close().
116852  //  */
116853  func _openDirectory(tls *crt.TLS, _zFilename *int8, _pFd *int32) (r0 int32) {
116854  	var _ii, _fd int32
116855  	var _zDirname [513]int8
116856  	_fd = int32(-1)
116857  	Xsqlite3_snprintf(tls, int32(512), (*int8)(unsafe.Pointer(&_zDirname)), str(24531), unsafe.Pointer(_zFilename))
116858  	_ii = int32(crt.Xstrlen(tls, (*int8)(unsafe.Pointer(&_zDirname))))
116859  _0:
116860  	if _ii <= int32(0) || int32(*elem1((*int8)(unsafe.Pointer(&_zDirname)), uintptr(_ii))) == int32(47) {
116861  		goto _4
116862  	}
116863  	_ii -= 1
116864  	goto _0
116865  _4:
116866  	if _ii > int32(0) {
116867  		*elem1((*int8)(unsafe.Pointer(&_zDirname)), uintptr(_ii)) = 0
116868  		goto _6
116869  	}
116870  	if int32(*elem1((*int8)(unsafe.Pointer(&_zDirname)), 0)) != int32(47) {
116871  		*elem1((*int8)(unsafe.Pointer(&_zDirname)), 0) = int8(46)
116872  	}
116873  	*elem1((*int8)(unsafe.Pointer(&_zDirname)), uintptr(1)) = 0
116874  _6:
116875  	_fd = _robust_open(tls, (*int8)(unsafe.Pointer(&_zDirname)), int32(0), 0)
116876  	if _fd >= int32(0) {
116877  	}
116878  	*_pFd = _fd
116879  	if _fd >= int32(0) {
116880  		return int32(0)
116881  	}
116882  	return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(33419)), str(131627), (*int8)(unsafe.Pointer(&_zDirname)), int32(33419))
116883  
116884  	_ = _zDirname
116885  	panic(0)
116886  }
116887  
116888  // C comment
116889  //  /*
116890  //  ** Invoke open().  Do so multiple times, until it either succeeds or
116891  //  ** fails for some reason other than EINTR.
116892  //  **
116893  //  ** If the file creation mode "m" is 0 then set it to the default for
116894  //  ** SQLite.  The default is SQLITE_DEFAULT_FILE_PERMISSIONS (normally
116895  //  ** 0644) as modified by the system umask.  If m is not 0, then
116896  //  ** make the file creation mode be exactly m ignoring the umask.
116897  //  **
116898  //  ** The m parameter will be non-zero only when creating -wal, -journal,
116899  //  ** and -shm files.  We want those files to have *exactly* the same
116900  //  ** permissions as their original database, unadulterated by the umask.
116901  //  ** In that way, if a database file is -rw-rw-rw or -rw-rw-r-, and a
116902  //  ** transaction crashes and leaves behind hot journals, then any
116903  //  ** process that is able to write to the database will also be able to
116904  //  ** recover the hot journals.
116905  //  */
116906  func _robust_open(tls *crt.TLS, _z *int8, _f int32, _m uint32) (r0 int32) {
116907  	var _fd int32
116908  	var _m2 uint32
116909  	var _4_statbuf crt.Xstruct_stat64
116910  	_m2 = func() uint32 {
116911  		if _m != 0 {
116912  			return _m
116913  		}
116914  		return uint32(420)
116915  	}()
116916  _2:
116917  	_fd = func() func(*crt.TLS, *int8, int32, int32) int32 {
116918  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), 0).XpCurrent
116919  		return *(*func(*crt.TLS, *int8, int32, int32) int32)(unsafe.Pointer(&v))
116920  	}()(tls, _z, _f, int32(_m2))
116921  	if _fd >= int32(0) {
116922  		goto _4
116923  	}
116924  	if (*crt.X__errno_location(tls)) == int32(4) {
116925  		goto _2
116926  	}
116927  	goto _3
116928  _4:
116929  	if _fd >= int32(3) {
116930  		goto _3
116931  	}
116932  	func() func(*crt.TLS, int32) int32 {
116933  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(1)).XpCurrent
116934  		return *(*func(*crt.TLS, int32) int32)(unsafe.Pointer(&v))
116935  	}()(tls, _fd)
116936  	Xsqlite3_log(tls, int32(28), str(131714), unsafe.Pointer(_z), _fd)
116937  	_fd = int32(-1)
116938  	if func() func(*crt.TLS, *int8, int32, int32) int32 {
116939  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), 0).XpCurrent
116940  		return *(*func(*crt.TLS, *int8, int32, int32) int32)(unsafe.Pointer(&v))
116941  	}()(tls, str(131757), _f, int32(_m)) < int32(0) {
116942  		goto _3
116943  	}
116944  	goto _2
116945  _3:
116946  	if _fd < int32(0) {
116947  		goto _8
116948  	}
116949  	if _m == (0) {
116950  		goto _9
116951  	}
116952  	if ((func() func(*crt.TLS, int32, *crt.Xstruct_stat64) int32 {
116953  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(5)).XpCurrent
116954  		return *(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
116955  	}()(tls, _fd, &_4_statbuf) == int32(0)) && (_4_statbuf.Xst_size == (0))) && ((_4_statbuf.Xst_mode & uint32(511)) != _m) {
116956  		func() func(*crt.TLS, int32, uint32) int32 {
116957  			v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(14)).XpCurrent
116958  			return *(*func(*crt.TLS, int32, uint32) int32)(unsafe.Pointer(&v))
116959  		}()(tls, _fd, _m)
116960  	}
116961  _9:
116962  	func() func(*crt.TLS, int32, int32, ...interface{}) int32 {
116963  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(7)).XpCurrent
116964  		return *(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&v))
116965  	}()(tls, _fd, int32(2), func() func(*crt.TLS, int32, int32, ...interface{}) int32 {
116966  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(7)).XpCurrent
116967  		return *(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&v))
116968  	}()(tls, _fd, int32(1), int32(0))|int32(1))
116969  _8:
116970  	return _fd
116971  }
116972  
116973  func _unixLogErrorAtLine(tls *crt.TLS, _errcode int32, _zFunc *int8, _zPath *int8, _iLine int32) (r0 int32) {
116974  	var _iErrno int32
116975  	var _zErr *int8
116976  	_iErrno = *crt.X__errno_location(tls)
116977  	_zErr = str(284)
116978  	if _zPath == nil {
116979  		_zPath = str(284)
116980  	}
116981  	Xsqlite3_log(tls, _errcode, str(131767), _iLine, _iErrno, unsafe.Pointer(_zFunc), unsafe.Pointer(_zPath), unsafe.Pointer(_zErr))
116982  	return _errcode
116983  }
116984  
116985  // C comment
116986  //  /*
116987  //  ** Return the system page size.
116988  //  **
116989  //  ** This function should not be called directly by other code in this file.
116990  //  ** Instead, it should be called via macro osGetpagesize().
116991  //  */
116992  func _unixGetpagesize(tls *crt.TLS) (r0 int32) {
116993  	return crt.Xsysconf(tls, int32(30))
116994  }
116995  
116996  // C comment
116997  //  /*
116998  //  ** Return TRUE if pFile has been renamed or unlinked since it was first opened.
116999  //  */
117000  func _fileHasMoved(tls *crt.TLS, _pFile *XunixFile) (r0 int32) {
117001  	var _buf crt.Xstruct_stat64
117002  	return bool2int(((*XunixInodeInfo)(_pFile.XpInode) != nil) && ((func() func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32 {
117003  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(4)).XpCurrent
117004  		return *(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
117005  	}()(tls, _pFile.XzPath, &_buf) != int32(0)) || (_buf.Xst_ino != (((*XunixInodeInfo)(_pFile.XpInode).XfileId).Xino))))
117006  }
117007  
117008  // C comment
117009  //  /*
117010  //  ** Lower the locking level on file descriptor pFile to eFileLock.  eFileLock
117011  //  ** must be either NO_LOCK or SHARED_LOCK.
117012  //  **
117013  //  ** If the locking level of the file descriptor is already at or below
117014  //  ** the requested locking level, this routine is a no-op.
117015  //  */
117016  func _unixUnlock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32) (r0 int32) {
117017  	func() {
117018  		if _eFileLock != int32(1) && ((*XunixFile)(unsafe.Pointer(_id)).XnFetchOut) != int32(0) {
117019  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31802), unsafe.Pointer(&_unixUnlockØ00__func__Ø000), unsafe.Pointer(str(131798)))
117020  			crt.X__builtin_abort(tls)
117021  		}
117022  	}()
117023  	return _posixUnlock(tls, _id, _eFileLock, int32(0))
117024  }
117025  
117026  var _unixUnlockØ00__func__Ø000 [11]int8
117027  
117028  func init() {
117029  	crt.Xstrncpy(nil, &_unixUnlockØ00__func__Ø000[0], str(131855), 11)
117030  }
117031  
117032  // C comment
117033  //  /*
117034  //  ** Lower the locking level on file descriptor pFile to eFileLock.  eFileLock
117035  //  ** must be either NO_LOCK or SHARED_LOCK.
117036  //  **
117037  //  ** If the locking level of the file descriptor is already at or below
117038  //  ** the requested locking level, this routine is a no-op.
117039  //  **
117040  //  ** If handleNFSUnlock is true, then on downgrading an EXCLUSIVE_LOCK to SHARED
117041  //  ** the byte range is divided into 2 parts and the first part is unlocked then
117042  //  ** set to a read lock, then the other part is simply unlocked.  This works
117043  //  ** around a bug in BSD NFS lockd (also seen on MacOSX 10.3+) that fails to
117044  //  ** remove the write lock on a region when a read lock is set.
117045  //  */
117046  func _posixUnlock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32, _handleNFSUnlock int32) (r0 int32) {
117047  	var _rc int32
117048  	var _pInode *XunixInodeInfo
117049  	var _pFile *XunixFile
117050  	var _lock Tflock
117051  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
117052  	_rc = int32(0)
117053  	func() {
117054  		if _pFile == nil {
117055  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31646), unsafe.Pointer(&_posixUnlockØ00__func__Ø000), unsafe.Pointer(str(58022)))
117056  			crt.X__builtin_abort(tls)
117057  		}
117058  	}()
117059  	func() {
117060  		if _eFileLock > int32(1) {
117061  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31651), unsafe.Pointer(&_posixUnlockØ00__func__Ø000), unsafe.Pointer(str(131866)))
117062  			crt.X__builtin_abort(tls)
117063  		}
117064  	}()
117065  	if int32(_pFile.XeFileLock) <= _eFileLock {
117066  		return int32(0)
117067  	}
117068  	_unixEnterMutex(tls)
117069  	_pInode = (*XunixInodeInfo)(_pFile.XpInode)
117070  	func() {
117071  		if _pInode.XnShared == int32(0) {
117072  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31657), unsafe.Pointer(&_posixUnlockØ00__func__Ø000), unsafe.Pointer(str(131889)))
117073  			crt.X__builtin_abort(tls)
117074  		}
117075  	}()
117076  	if int32(_pFile.XeFileLock) <= int32(1) {
117077  		goto _7
117078  	}
117079  	func() {
117080  		if int32(_pInode.XeFileLock) != int32(_pFile.XeFileLock) {
117081  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31659), unsafe.Pointer(&_posixUnlockØ00__func__Ø000), unsafe.Pointer(str(131908)))
117082  			crt.X__builtin_abort(tls)
117083  		}
117084  	}()
117085  	_pFile.XinNormalWrite = 0
117086  	if _eFileLock != int32(1) {
117087  		goto _10
117088  	}
117089  
117090  	func() {
117091  		if _handleNFSUnlock != int32(0) {
117092  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31685), unsafe.Pointer(&_posixUnlockØ00__func__Ø000), unsafe.Pointer(str(131944)))
117093  			crt.X__builtin_abort(tls)
117094  		}
117095  	}()
117096  	_lock.Xl_type = 0
117097  	_lock.Xl_whence = 0
117098  	_lock.Xl_start = int64(_sqlite3PendingByte + int32(2))
117099  	_lock.Xl_len = int64(510)
117100  	if _unixFileLock(tls, _pFile, &_lock) != 0 {
117101  		_rc = int32(2314)
117102  		_storeLastErrno(tls, _pFile, *crt.X__errno_location(tls))
117103  		goto _end_unlock
117104  	}
117105  _10:
117106  	_lock.Xl_type = int16(2)
117107  	_lock.Xl_whence = 0
117108  	_lock.Xl_start = int64(_sqlite3PendingByte)
117109  	_lock.Xl_len = int64(2)
117110  	func() {
117111  		if (_sqlite3PendingByte + int32(1)) != (_sqlite3PendingByte + int32(1)) {
117112  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31747), unsafe.Pointer(&_posixUnlockØ00__func__Ø000), unsafe.Pointer(str(131963)))
117113  			crt.X__builtin_abort(tls)
117114  		}
117115  	}()
117116  	if _unixFileLock(tls, _pFile, &_lock) == int32(0) {
117117  		_pInode.XeFileLock = uint8(1)
117118  		goto _17
117119  	}
117120  	_rc = int32(2058)
117121  	_storeLastErrno(tls, _pFile, *crt.X__errno_location(tls))
117122  	goto _end_unlock
117123  _17:
117124  _7:
117125  	if _eFileLock != int32(0) {
117126  		goto _end_unlock
117127  	}
117128  	_pInode.XnShared -= 1
117129  	if _pInode.XnShared != int32(0) {
117130  		goto _19
117131  	}
117132  	_lock.Xl_type = int16(2)
117133  	_lock.Xl_whence = 0
117134  	_lock.Xl_start = store35(&_lock.Xl_len, 0)
117135  	if _unixFileLock(tls, _pFile, &_lock) == int32(0) {
117136  		_pInode.XeFileLock = 0
117137  		goto _21
117138  	}
117139  	_rc = int32(2058)
117140  	_storeLastErrno(tls, _pFile, *crt.X__errno_location(tls))
117141  	_pInode.XeFileLock = 0
117142  	_pFile.XeFileLock = 0
117143  _21:
117144  _19:
117145  	_pInode.XnLock -= 1
117146  	func() {
117147  		if _pInode.XnLock < int32(0) {
117148  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31781), unsafe.Pointer(&_posixUnlockØ00__func__Ø000), unsafe.Pointer(str(131993)))
117149  			crt.X__builtin_abort(tls)
117150  		}
117151  	}()
117152  	if _pInode.XnLock == int32(0) {
117153  		_closePendingFds(tls, _pFile)
117154  	}
117155  _end_unlock:
117156  	_unixLeaveMutex(tls)
117157  	if _rc == int32(0) {
117158  		_pFile.XeFileLock = uint8(_eFileLock)
117159  	}
117160  	return _rc
117161  }
117162  
117163  var _posixUnlockØ00__func__Ø000 [12]int8
117164  
117165  func init() {
117166  	crt.Xstrncpy(nil, &_posixUnlockØ00__func__Ø000[0], str(132010), 12)
117167  }
117168  
117169  // C comment
117170  //  /*
117171  //  ** Helper functions to obtain and relinquish the global mutex. The
117172  //  ** global mutex is used to protect the unixInodeInfo and
117173  //  ** vxworksFileId objects used by this file, all of which may be
117174  //  ** shared by multiple threads.
117175  //  **
117176  //  ** Function unixMutexHeld() is used to assert() that the global mutex
117177  //  ** is held when required. This function is only used as part of assert()
117178  //  ** statements. e.g.
117179  //  **
117180  //  **   unixEnterMutex()
117181  //  **     assert( unixMutexHeld() );
117182  //  **   unixEnterLeave()
117183  //  */
117184  func _unixEnterMutex(tls *crt.TLS) {
117185  	Xsqlite3_mutex_enter(tls, _sqlite3MutexAlloc(tls, int32(11)))
117186  }
117187  
117188  // C comment
117189  //  /*
117190  //  ** Attempt to set a system-lock on the file pFile.  The lock is
117191  //  ** described by pLock.
117192  //  **
117193  //  ** If the pFile was opened read/write from unix-excl, then the only lock
117194  //  ** ever obtained is an exclusive lock, and it is obtained exactly once
117195  //  ** the first time any lock is attempted.  All subsequent system locking
117196  //  ** operations become no-ops.  Locking operations still happen internally,
117197  //  ** in order to coordinate access between separate database connections
117198  //  ** within this process, but all of that is handled in memory and the
117199  //  ** operating system does not participate.
117200  //  **
117201  //  ** This function is a pass-through to fcntl(F_SETLK) if pFile is using
117202  //  ** any VFS other than "unix-excl" or if pFile is opened on "unix-excl"
117203  //  ** and is read-only.
117204  //  **
117205  //  ** Zero is returned if the call completes successfully, or -1 if a call
117206  //  ** to fcntl() fails. In this case, errno is set appropriately (by fcntl()).
117207  //  */
117208  func _unixFileLock(tls *crt.TLS, _pFile *XunixFile, _pLock *Tflock) (r0 int32) {
117209  	var _rc int32
117210  	var _pInode *XunixInodeInfo
117211  	var _2_lock Tflock
117212  	_pInode = (*XunixInodeInfo)(_pFile.XpInode)
117213  	func() {
117214  		if _unixMutexHeld(tls) == 0 {
117215  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31344), unsafe.Pointer(&_unixFileLockØ00__func__Ø000), unsafe.Pointer(str(132022)))
117216  			crt.X__builtin_abort(tls)
117217  		}
117218  	}()
117219  	func() {
117220  		if _pInode == nil {
117221  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31345), unsafe.Pointer(&_unixFileLockØ00__func__Ø000), unsafe.Pointer(str(132038)))
117222  			crt.X__builtin_abort(tls)
117223  		}
117224  	}()
117225  	if (int32(_pFile.XctrlFlags) & int32(3)) != int32(1) {
117226  		goto _4
117227  	}
117228  	if int32(_pInode.XbProcessLock) != int32(0) {
117229  		goto _5
117230  	}
117231  	func() {
117232  		if _pInode.XnLock != int32(0) {
117233  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31349), unsafe.Pointer(&_unixFileLockØ00__func__Ø000), unsafe.Pointer(str(132048)))
117234  			crt.X__builtin_abort(tls)
117235  		}
117236  	}()
117237  	_2_lock.Xl_whence = 0
117238  	_2_lock.Xl_start = int64(_sqlite3PendingByte + int32(2))
117239  	_2_lock.Xl_len = int64(510)
117240  	_2_lock.Xl_type = int16(1)
117241  	_rc = func() func(*crt.TLS, int32, int32, ...interface{}) int32 {
117242  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(7)).XpCurrent
117243  		return *(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&v))
117244  	}()(tls, _pFile.Xh, int32(13), unsafe.Pointer(&_2_lock))
117245  	if _rc < int32(0) {
117246  		return _rc
117247  	}
117248  	_pInode.XbProcessLock = uint8(1)
117249  	_pInode.XnLock += 1
117250  	goto _9
117251  _5:
117252  	_rc = int32(0)
117253  _9:
117254  	goto _10
117255  _4:
117256  	_rc = func() func(*crt.TLS, int32, int32, ...interface{}) int32 {
117257  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(7)).XpCurrent
117258  		return *(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&v))
117259  	}()(tls, _pFile.Xh, int32(13), unsafe.Pointer(_pLock))
117260  _10:
117261  	return _rc
117262  }
117263  
117264  func _unixMutexHeld(tls *crt.TLS) (r0 int32) {
117265  	return Xsqlite3_mutex_held(tls, _sqlite3MutexAlloc(tls, int32(11)))
117266  }
117267  
117268  var _unixFileLockØ00__func__Ø000 [13]int8
117269  
117270  func init() {
117271  	crt.Xstrncpy(nil, &_unixFileLockØ00__func__Ø000[0], str(132065), 13)
117272  }
117273  
117274  // C comment
117275  //  /*
117276  //  ** Set the pFile->lastErrno.  Do this in a subroutine as that provides
117277  //  ** a convenient place to set a breakpoint.
117278  //  */
117279  func _storeLastErrno(tls *crt.TLS, _pFile *XunixFile, _error int32) {
117280  	_pFile.XlastErrno = _error
117281  }
117282  
117283  func _closePendingFds(tls *crt.TLS, _pFile *XunixFile) {
117284  	var _pInode *XunixInodeInfo
117285  	var _p, _pNext *XUnixUnusedFd
117286  	_pInode = (*XunixInodeInfo)(_pFile.XpInode)
117287  	_p = (*XUnixUnusedFd)(_pInode.XpUnused)
117288  _0:
117289  	if _p == nil {
117290  		goto _3
117291  	}
117292  	_pNext = (*XUnixUnusedFd)(_p.XpNext)
117293  	_robust_close(tls, _pFile, _p.Xfd, int32(31098))
117294  	Xsqlite3_free(tls, unsafe.Pointer(_p))
117295  	_p = _pNext
117296  	goto _0
117297  _3:
117298  	*(**XUnixUnusedFd)(unsafe.Pointer(&_pInode.XpUnused)) = nil
117299  }
117300  
117301  // C comment
117302  //  /*
117303  //  ** Close a file descriptor.
117304  //  **
117305  //  ** We assume that close() almost always works, since it is only in a
117306  //  ** very sick application or on a very sick platform that it might fail.
117307  //  ** If it does fail, simply leak the file descriptor, but do log the
117308  //  ** error.
117309  //  **
117310  //  ** Note that it is not safe to retry close() after EINTR since the
117311  //  ** file descriptor might have already been reused by another thread.
117312  //  ** So we don't even try to recover from an EINTR.  Just log the error
117313  //  ** and move on.
117314  //  */
117315  func _robust_close(tls *crt.TLS, _pFile *XunixFile, _h int32, _lineno int32) {
117316  	if func() func(*crt.TLS, int32) int32 {
117317  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(1)).XpCurrent
117318  		return *(*func(*crt.TLS, int32) int32)(unsafe.Pointer(&v))
117319  	}()(tls, _h) != 0 {
117320  		_unixLogErrorAtLine(tls, int32(4106), str(131522), func() *int8 {
117321  			if _pFile != nil {
117322  				return _pFile.XzPath
117323  			}
117324  			return nil
117325  		}(), _lineno)
117326  	}
117327  }
117328  
117329  func _unixLeaveMutex(tls *crt.TLS) {
117330  	Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(11)))
117331  }
117332  
117333  var _unixCloseØ00__func__Ø000 [10]int8
117334  
117335  func init() {
117336  	crt.Xstrncpy(nil, &_unixCloseØ00__func__Ø000[0], str(132078), 10)
117337  }
117338  
117339  // C comment
117340  //  /*
117341  //  ** Add the file descriptor used by file handle pFile to the corresponding
117342  //  ** pUnused list.
117343  //  */
117344  func _setPendingFd(tls *crt.TLS, _pFile *XunixFile) {
117345  	var _pInode *XunixInodeInfo
117346  	var _p *XUnixUnusedFd
117347  	_pInode = (*XunixInodeInfo)(_pFile.XpInode)
117348  	_p = (*XUnixUnusedFd)(_pFile.XpUnused)
117349  	*(**XUnixUnusedFd)(unsafe.Pointer(&_p.XpNext)) = (*XUnixUnusedFd)(_pInode.XpUnused)
117350  	*(**XUnixUnusedFd)(unsafe.Pointer(&_pInode.XpUnused)) = _p
117351  	_pFile.Xh = int32(-1)
117352  	*(**XUnixUnusedFd)(unsafe.Pointer(&_pFile.XpUnused)) = nil
117353  }
117354  
117355  // C comment
117356  //  /*
117357  //  ** Release a unixInodeInfo structure previously allocated by findInodeInfo().
117358  //  **
117359  //  ** The mutex entered using the unixEnterMutex() function must be held
117360  //  ** when this function is called.
117361  //  */
117362  func _releaseInodeInfo(tls *crt.TLS, _pFile *XunixFile) {
117363  	var _pInode *XunixInodeInfo
117364  	_pInode = (*XunixInodeInfo)(_pFile.XpInode)
117365  	func() {
117366  		if _unixMutexHeld(tls) == 0 {
117367  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31112), unsafe.Pointer(&_releaseInodeInfoØ00__func__Ø000), unsafe.Pointer(str(132022)))
117368  			crt.X__builtin_abort(tls)
117369  		}
117370  	}()
117371  	if func() int32 {
117372  		if _pInode != nil {
117373  			return int32(1)
117374  		}
117375  		return func() int32 {
117376  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31113), unsafe.Pointer(&_releaseInodeInfoØ00__func__Ø000), unsafe.Pointer(str(4809)))
117377  			crt.X__builtin_abort(tls)
117378  			return int32(0)
117379  		}()
117380  	}() == 0 {
117381  		goto _4
117382  	}
117383  	_pInode.XnRef -= 1
117384  	if _pInode.XnRef != int32(0) {
117385  		goto _5
117386  	}
117387  	func() {
117388  		if (*XunixShmNode)(_pInode.XpShmNode) != nil {
117389  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31116), unsafe.Pointer(&_releaseInodeInfoØ00__func__Ø000), unsafe.Pointer(str(132088)))
117390  			crt.X__builtin_abort(tls)
117391  		}
117392  	}()
117393  	_closePendingFds(tls, _pFile)
117394  	if _pInode.XpPrev != nil {
117395  		func() {
117396  			if (*XunixInodeInfo)((*XunixInodeInfo)(_pInode.XpPrev).XpNext) != _pInode {
117397  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31119), unsafe.Pointer(&_releaseInodeInfoØ00__func__Ø000), unsafe.Pointer(str(132108)))
117398  				crt.X__builtin_abort(tls)
117399  			}
117400  		}()
117401  		*(**XunixInodeInfo)(unsafe.Pointer(&((*XunixInodeInfo)(_pInode.XpPrev).XpNext))) = (*XunixInodeInfo)(_pInode.XpNext)
117402  		goto _11
117403  	}
117404  	func() {
117405  		if _inodeList != _pInode {
117406  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31122), unsafe.Pointer(&_releaseInodeInfoØ00__func__Ø000), unsafe.Pointer(str(132137)))
117407  			crt.X__builtin_abort(tls)
117408  		}
117409  	}()
117410  	_inodeList = (*XunixInodeInfo)(_pInode.XpNext)
117411  	bug20530(_inodeList)
117412  _11:
117413  	if _pInode.XpNext != nil {
117414  		func() {
117415  			if (*XunixInodeInfo)((*XunixInodeInfo)(_pInode.XpNext).XpPrev) != _pInode {
117416  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31126), unsafe.Pointer(&_releaseInodeInfoØ00__func__Ø000), unsafe.Pointer(str(132155)))
117417  				crt.X__builtin_abort(tls)
117418  			}
117419  		}()
117420  		*(**XunixInodeInfo)(unsafe.Pointer(&((*XunixInodeInfo)(_pInode.XpNext).XpPrev))) = (*XunixInodeInfo)(_pInode.XpPrev)
117421  	}
117422  	Xsqlite3_free(tls, unsafe.Pointer(_pInode))
117423  _5:
117424  _4:
117425  }
117426  
117427  var _releaseInodeInfoØ00__func__Ø000 [17]int8
117428  
117429  func init() {
117430  	crt.Xstrncpy(nil, &_releaseInodeInfoØ00__func__Ø000[0], str(132184), 17)
117431  }
117432  
117433  // C comment
117434  //  /*
117435  //  ** A lists of all unixInodeInfo objects.
117436  //  */
117437  var _inodeList *XunixInodeInfo
117438  
117439  // C comment
117440  //  /*
117441  //  ** This function performs the parts of the "close file" operation
117442  //  ** common to all locking schemes. It closes the directory and file
117443  //  ** handles, if they are valid, and sets all fields of the unixFile
117444  //  ** structure to 0.
117445  //  **
117446  //  ** It is *not* necessary to hold the mutex when this routine is called,
117447  //  ** even on VxWorks.  A mutex will be acquired on VxWorks by the
117448  //  ** vxworksReleaseFileId() routine.
117449  //  */
117450  func _closeUnixFile(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) {
117451  	var _pFile *XunixFile
117452  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
117453  	_unixUnmapfile(tls, _pFile)
117454  	if _pFile.Xh >= int32(0) {
117455  		_robust_close(tls, _pFile, _pFile.Xh, int32(31828))
117456  		_pFile.Xh = int32(-1)
117457  	}
117458  	Xsqlite3_free(tls, _pFile.XpUnused)
117459  	crt.Xmemset(tls, unsafe.Pointer(_pFile), int32(0), uint32(80))
117460  	return int32(0)
117461  }
117462  
117463  // C comment
117464  //  /*
117465  //  ** If it is currently memory mapped, unmap file pFd.
117466  //  */
117467  func _unixUnmapfile(tls *crt.TLS, _pFd *XunixFile) {
117468  	func() {
117469  		if _pFd.XnFetchOut != int32(0) {
117470  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34596), unsafe.Pointer(&_unixUnmapfileØ00__func__Ø000), unsafe.Pointer(str(132201)))
117471  			crt.X__builtin_abort(tls)
117472  		}
117473  	}()
117474  	if _pFd.XpMapRegion != nil {
117475  		func() func(*crt.TLS, unsafe.Pointer, uint32) unsafe.Pointer {
117476  			v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(23)).XpCurrent
117477  			return *(*func(*crt.TLS, unsafe.Pointer, uint32) unsafe.Pointer)(unsafe.Pointer(&v))
117478  		}()(tls, _pFd.XpMapRegion, uint32(_pFd.XmmapSizeActual))
117479  		_pFd.XpMapRegion = nil
117480  		_pFd.XmmapSize = 0
117481  		_pFd.XmmapSizeActual = 0
117482  	}
117483  }
117484  
117485  var _unixUnmapfileØ00__func__Ø000 [14]int8
117486  
117487  func init() {
117488  	crt.Xstrncpy(nil, &_unixUnmapfileØ00__func__Ø000[0], str(132219), 14)
117489  }
117490  
117491  // C comment
117492  //  /*
117493  //  ** Read data from a file into a buffer.  Return SQLITE_OK if all
117494  //  ** bytes were read successfully and SQLITE_IOERR if anything goes
117495  //  ** wrong.
117496  //  */
117497  func _unixRead(tls *crt.TLS, _id *Xsqlite3_file, _pBuf unsafe.Pointer, _amt int32, _offset int64) (r0 int32) {
117498  	var _got, _3_nCopy int32
117499  	var _pFile *XunixFile
117500  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
117501  	func() {
117502  		if _id == nil {
117503  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33063), unsafe.Pointer(&_unixReadØ00__func__Ø000), unsafe.Pointer(str(93813)))
117504  			crt.X__builtin_abort(tls)
117505  		}
117506  	}()
117507  	func() {
117508  		if _offset < (0) {
117509  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33064), unsafe.Pointer(&_unixReadØ00__func__Ø000), unsafe.Pointer(str(132233)))
117510  			crt.X__builtin_abort(tls)
117511  		}
117512  	}()
117513  	func() {
117514  		if _amt <= int32(0) {
117515  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33065), unsafe.Pointer(&_unixReadØ00__func__Ø000), unsafe.Pointer(str(132243)))
117516  			crt.X__builtin_abort(tls)
117517  		}
117518  	}()
117519  	if _offset >= _pFile.XmmapSize {
117520  		goto _6
117521  	}
117522  	if (_offset + int64(_amt)) <= _pFile.XmmapSize {
117523  		crt.Xmemcpy(tls, _pBuf, unsafe.Pointer(elem15((*uint8)(_pFile.XpMapRegion), uintptr(_offset))), uint32(_amt))
117524  		return int32(0)
117525  	}
117526  	_3_nCopy = int32(_pFile.XmmapSize - _offset)
117527  	crt.Xmemcpy(tls, _pBuf, unsafe.Pointer(elem15((*uint8)(_pFile.XpMapRegion), uintptr(_offset))), uint32(_3_nCopy))
117528  	_pBuf = unsafe.Pointer(elem15((*uint8)(_pBuf), uintptr(_3_nCopy)))
117529  	_amt -= _3_nCopy
117530  	_offset += int64(_3_nCopy)
117531  _6:
117532  	_got = _seekAndRead(tls, _pFile, _offset, _pBuf, _amt)
117533  	if _got == _amt {
117534  		return int32(0)
117535  	}
117536  	if _got < int32(0) {
117537  		return int32(266)
117538  	}
117539  	_storeLastErrno(tls, _pFile, int32(0))
117540  	crt.Xmemset(tls, unsafe.Pointer(elem1((*int8)(_pBuf), uintptr(_got))), int32(0), uint32(_amt-_got))
117541  	return int32(522)
117542  }
117543  
117544  var _unixReadØ00__func__Ø000 [9]int8
117545  
117546  func init() {
117547  	crt.Xstrncpy(nil, &_unixReadØ00__func__Ø000[0], str(132249), 9)
117548  }
117549  
117550  // C comment
117551  //  /*
117552  //  ** Seek to the offset passed as the second argument, then read cnt
117553  //  ** bytes into pBuf. Return the number of bytes actually read.
117554  //  **
117555  //  ** NB:  If you define USE_PREAD or USE_PREAD64, then it might also
117556  //  ** be necessary to define _XOPEN_SOURCE to be 500.  This varies from
117557  //  ** one system to another.  Since SQLite does not define USE_PREAD
117558  //  ** in any form by default, we will not attempt to define _XOPEN_SOURCE.
117559  //  ** See tickets #2741 and #2681.
117560  //  **
117561  //  ** To avoid stomping the errno value on a failed read the lastErrno value
117562  //  ** is set before returning.
117563  //  */
117564  func _seekAndRead(tls *crt.TLS, _id *XunixFile, _offset int64, _pBuf unsafe.Pointer, _cnt int32) (r0 int32) {
117565  	var _got, _prior int32
117566  	var _newOffset int64
117567  	_prior = int32(0)
117568  	func() {
117569  		if _cnt != (_cnt & int32(131071)) {
117570  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33013), unsafe.Pointer(&_seekAndReadØ00__func__Ø000), unsafe.Pointer(str(132258)))
117571  			crt.X__builtin_abort(tls)
117572  		}
117573  	}()
117574  	func() {
117575  		if _id.Xh <= int32(2) {
117576  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33014), unsafe.Pointer(&_seekAndReadØ00__func__Ø000), unsafe.Pointer(str(132277)))
117577  			crt.X__builtin_abort(tls)
117578  		}
117579  	}()
117580  _4:
117581  	_newOffset = crt.Xlseek64(tls, _id.Xh, _offset, int32(0))
117582  	if _newOffset < (0) {
117583  		_storeLastErrno(tls, _id, *crt.X__errno_location(tls))
117584  		return int32(-1)
117585  	}
117586  	_got = func() func(*crt.TLS, int32, unsafe.Pointer, uint32) int32 {
117587  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(8)).XpCurrent
117588  		return *(*func(*crt.TLS, int32, unsafe.Pointer, uint32) int32)(unsafe.Pointer(&v))
117589  	}()(tls, _id.Xh, _pBuf, uint32(_cnt))
117590  	if _got == _cnt {
117591  		goto _7
117592  	}
117593  	if _got >= int32(0) {
117594  		goto _8
117595  	}
117596  	if (*crt.X__errno_location(tls)) == int32(4) {
117597  		_got = int32(1)
117598  		goto _4
117599  	}
117600  	_prior = int32(0)
117601  	_storeLastErrno(tls, _id, *crt.X__errno_location(tls))
117602  	goto _7
117603  _8:
117604  	if _got > int32(0) {
117605  		_cnt -= _got
117606  		_offset += int64(_got)
117607  		_prior += _got
117608  		_pBuf = unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_got) + uintptr(_pBuf))))
117609  	}
117610  	if _got > int32(0) {
117611  		goto _4
117612  	}
117613  _7:
117614  	return _got + _prior
117615  }
117616  
117617  var _seekAndReadØ00__func__Ø000 [12]int8
117618  
117619  func init() {
117620  	crt.Xstrncpy(nil, &_seekAndReadØ00__func__Ø000[0], str(132285), 12)
117621  }
117622  
117623  // C comment
117624  //  /*
117625  //  ** Write data from a buffer into a file.  Return SQLITE_OK on success
117626  //  ** or some other error code on failure.
117627  //  */
117628  func _unixWrite(tls *crt.TLS, _id *Xsqlite3_file, _pBuf unsafe.Pointer, _amt int32, _offset int64) (r0 int32) {
117629  	var _wrote, _2_rc int32
117630  	var _2_oldCntr [4]int8
117631  	var _pFile *XunixFile
117632  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
117633  	_wrote = int32(0)
117634  	func() {
117635  		if _id == nil {
117636  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33177), unsafe.Pointer(&_unixWriteØ00__func__Ø000), unsafe.Pointer(str(93813)))
117637  			crt.X__builtin_abort(tls)
117638  		}
117639  	}()
117640  	func() {
117641  		if _amt <= int32(0) {
117642  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33178), unsafe.Pointer(&_unixWriteØ00__func__Ø000), unsafe.Pointer(str(132243)))
117643  			crt.X__builtin_abort(tls)
117644  		}
117645  	}()
117646  	if _pFile.XinNormalWrite == 0 {
117647  		goto _4
117648  	}
117649  	_pFile.XdbUpdate = uint8(1)
117650  	if _offset > int64(24) || (_offset+int64(_amt)) < int64(27) {
117651  		goto _6
117652  	}
117653  	_2_rc = _seekAndRead(tls, _pFile, int64(24), unsafe.Pointer(&_2_oldCntr), int32(4))
117654  	if (_2_rc != int32(4)) || (crt.Xmemcmp(tls, unsafe.Pointer(&_2_oldCntr), unsafe.Pointer(elem1((*int8)(_pBuf), uintptr(int64(24)-_offset))), uint32(4)) != int32(0)) {
117655  		_pFile.XtransCntrChng = uint8(1)
117656  	}
117657  _6:
117658  _4:
117659  	if (store2(&_wrote, _seekAndWrite(tls, _pFile, _offset, _pBuf, _amt)) < _amt) && (_wrote > int32(0)) {
117660  		_amt -= _wrote
117661  		_offset += int64(_wrote)
117662  		_pBuf = unsafe.Pointer(elem1((*int8)(_pBuf), uintptr(_wrote)))
117663  		goto _4
117664  	}
117665  	if _amt <= _wrote {
117666  		goto _12
117667  	}
117668  	if (_wrote < int32(0)) && (_pFile.XlastErrno != int32(28)) {
117669  		return int32(778)
117670  	}
117671  	_storeLastErrno(tls, _pFile, int32(0))
117672  	return int32(13)
117673  
117674  _12:
117675  	return int32(0)
117676  
117677  	_ = _2_oldCntr
117678  	panic(0)
117679  }
117680  
117681  var _unixWriteØ00__func__Ø000 [10]int8
117682  
117683  func init() {
117684  	crt.Xstrncpy(nil, &_unixWriteØ00__func__Ø000[0], str(132297), 10)
117685  }
117686  
117687  // C comment
117688  //  /*
117689  //  ** Seek to the offset in id->offset then read cnt bytes into pBuf.
117690  //  ** Return the number of bytes actually read.  Update the offset.
117691  //  **
117692  //  ** To avoid stomping the errno value on a failed write the lastErrno value
117693  //  ** is set before returning.
117694  //  */
117695  func _seekAndWrite(tls *crt.TLS, _id *XunixFile, _offset int64, _pBuf unsafe.Pointer, _cnt int32) (r0 int32) {
117696  	return _seekAndWriteFd(tls, _id.Xh, _offset, _pBuf, _cnt, &_id.XlastErrno)
117697  }
117698  
117699  // C comment
117700  //  /*
117701  //  ** Attempt to seek the file-descriptor passed as the first argument to
117702  //  ** absolute offset iOff, then attempt to write nBuf bytes of data from
117703  //  ** pBuf to it. If an error occurs, return -1 and set *piErrno. Otherwise,
117704  //  ** return the actual number of bytes written (which may be less than
117705  //  ** nBuf).
117706  //  */
117707  func _seekAndWriteFd(tls *crt.TLS, _fd int32, _iOff int64, _pBuf unsafe.Pointer, _nBuf int32, _piErrno *int32) (r0 int32) {
117708  	var _rc int32
117709  	var _1_iSeek int64
117710  	_rc = int32(0)
117711  	func() {
117712  		if _nBuf != (_nBuf & int32(131071)) {
117713  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33123), unsafe.Pointer(&_seekAndWriteFdØ00__func__Ø000), unsafe.Pointer(str(132307)))
117714  			crt.X__builtin_abort(tls)
117715  		}
117716  	}()
117717  	func() {
117718  		if _fd <= int32(2) {
117719  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33124), unsafe.Pointer(&_seekAndWriteFdØ00__func__Ø000), unsafe.Pointer(str(132328)))
117720  			crt.X__builtin_abort(tls)
117721  		}
117722  	}()
117723  	func() {
117724  		if _piErrno == nil {
117725  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33125), unsafe.Pointer(&_seekAndWriteFdØ00__func__Ø000), unsafe.Pointer(str(132333)))
117726  			crt.X__builtin_abort(tls)
117727  		}
117728  	}()
117729  	_nBuf &= int32(131071)
117730  _6:
117731  	_1_iSeek = crt.Xlseek64(tls, _fd, _iOff, int32(0))
117732  	if _1_iSeek < (0) {
117733  		_rc = int32(-1)
117734  		goto _8
117735  	}
117736  	_rc = func() func(*crt.TLS, int32, unsafe.Pointer, uint32) int32 {
117737  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(11)).XpCurrent
117738  		return *(*func(*crt.TLS, int32, unsafe.Pointer, uint32) int32)(unsafe.Pointer(&v))
117739  	}()(tls, _fd, _pBuf, uint32(_nBuf))
117740  	if (_rc < int32(0)) && ((*crt.X__errno_location(tls)) == int32(4)) {
117741  		goto _6
117742  	}
117743  _8:
117744  	if _rc < int32(0) {
117745  		*_piErrno = *crt.X__errno_location(tls)
117746  	}
117747  	return _rc
117748  }
117749  
117750  var _seekAndWriteFdØ00__func__Ø000 [15]int8
117751  
117752  func init() {
117753  	crt.Xstrncpy(nil, &_seekAndWriteFdØ00__func__Ø000[0], str(132344), 15)
117754  }
117755  
117756  // C comment
117757  //  /*
117758  //  ** Truncate an open file to a specified size
117759  //  */
117760  func _unixTruncate(tls *crt.TLS, _id *Xsqlite3_file, _nByte int64) (r0 int32) {
117761  	var _rc int32
117762  	var _pFile *XunixFile
117763  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
117764  	func() {
117765  		if _pFile == nil {
117766  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33490), unsafe.Pointer(&_unixTruncateØ00__func__Ø000), unsafe.Pointer(str(58022)))
117767  			crt.X__builtin_abort(tls)
117768  		}
117769  	}()
117770  	if _pFile.XszChunk > int32(0) {
117771  		_nByte = (((_nByte + int64(_pFile.XszChunk)) - int64(1)) / int64(_pFile.XszChunk)) * int64(_pFile.XszChunk)
117772  	}
117773  	_rc = _robust_ftruncate(tls, _pFile.Xh, _nByte)
117774  	if _rc != 0 {
117775  		_storeLastErrno(tls, _pFile, *crt.X__errno_location(tls))
117776  		return _unixLogErrorAtLine(tls, int32(1546), str(131546), _pFile.XzPath, int32(33505))
117777  	}
117778  	if (_pFile.XinNormalWrite != 0) && (_nByte == (0)) {
117779  		_pFile.XtransCntrChng = uint8(1)
117780  	}
117781  	if _nByte < _pFile.XmmapSize {
117782  		_pFile.XmmapSize = _nByte
117783  	}
117784  	return int32(0)
117785  }
117786  
117787  var _unixTruncateØ00__func__Ø000 [13]int8
117788  
117789  func init() {
117790  	crt.Xstrncpy(nil, &_unixTruncateØ00__func__Ø000[0], str(132359), 13)
117791  }
117792  
117793  // C comment
117794  //  /*
117795  //  ** Retry ftruncate() calls that fail due to EINTR
117796  //  **
117797  //  ** All calls to ftruncate() within this file should be made through
117798  //  ** this wrapper.  On the Android platform, bypassing the logic below
117799  //  ** could lead to a corrupt database.
117800  //  */
117801  func _robust_ftruncate(tls *crt.TLS, _h int32, _sz int64) (r0 int32) {
117802  	var _rc int32
117803  _0:
117804  	_rc = func() func(*crt.TLS, int32, int64) int32 {
117805  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(6)).XpCurrent
117806  		return *(*func(*crt.TLS, int32, int64) int32)(unsafe.Pointer(&v))
117807  	}()(tls, _h, _sz)
117808  	if (_rc < int32(0)) && ((*crt.X__errno_location(tls)) == int32(4)) {
117809  		goto _0
117810  	}
117811  	return _rc
117812  }
117813  
117814  // C comment
117815  //  /*
117816  //  ** Make sure all writes to a particular file are committed to disk.
117817  //  **
117818  //  ** If dataOnly==0 then both the file itself and its metadata (file
117819  //  ** size, access time, etc) are synced.  If dataOnly!=0 then only the
117820  //  ** file data is synced.
117821  //  **
117822  //  ** Under Unix, also make sure that the directory entry for the file
117823  //  ** has been created by fsync-ing the directory that contains the file.
117824  //  ** If we do not do this and we encounter a power failure, the directory
117825  //  ** entry for the journal might not exist after we reboot.  The next
117826  //  ** SQLite to access the file will not know that the journal exists (because
117827  //  ** the directory entry for the journal was never created) and the transaction
117828  //  ** will not roll back - possibly leading to database corruption.
117829  //  */
117830  func _unixSync(tls *crt.TLS, _id *Xsqlite3_file, _flags int32) (r0 int32) {
117831  	var _rc, _isDataOnly, _isFullsync, _2_dirfd int32
117832  	var _pFile *XunixFile
117833  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
117834  	_isDataOnly = _flags & int32(16)
117835  	_isFullsync = bool2int((_flags & int32(15)) == int32(3))
117836  	func() {
117837  		if (_flags&int32(15)) != int32(2) && (_flags&int32(15)) != int32(3) {
117838  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33445), unsafe.Pointer(&_unixSyncØ00__func__Ø000), unsafe.Pointer(str(132372)))
117839  			crt.X__builtin_abort(tls)
117840  		}
117841  	}()
117842  	func() {
117843  		if _pFile == nil {
117844  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33454), unsafe.Pointer(&_unixSyncØ00__func__Ø000), unsafe.Pointer(str(58022)))
117845  			crt.X__builtin_abort(tls)
117846  		}
117847  	}()
117848  	_rc = _full_fsync(tls, _pFile.Xh, _isFullsync, _isDataOnly)
117849  	if _rc != 0 {
117850  		_storeLastErrno(tls, _pFile, *crt.X__errno_location(tls))
117851  		return _unixLogErrorAtLine(tls, int32(1034), str(132439), _pFile.XzPath, int32(33460))
117852  	}
117853  	if (int32(_pFile.XctrlFlags) & int32(8)) == 0 {
117854  		goto _6
117855  	}
117856  	_rc = func() func(*crt.TLS, *int8, *int32) int32 {
117857  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(17)).XpCurrent
117858  		return *(*func(*crt.TLS, *int8, *int32) int32)(unsafe.Pointer(&v))
117859  	}()(tls, _pFile.XzPath, &_2_dirfd)
117860  	if _rc == int32(0) {
117861  		_full_fsync(tls, _2_dirfd, int32(0), int32(0))
117862  		_robust_close(tls, _pFile, _2_dirfd, int32(33474))
117863  		goto _8
117864  	}
117865  	func() {
117866  		if _rc != int32(14) {
117867  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33476), unsafe.Pointer(&_unixSyncØ00__func__Ø000), unsafe.Pointer(str(132450)))
117868  			crt.X__builtin_abort(tls)
117869  		}
117870  	}()
117871  	_rc = int32(0)
117872  _8:
117873  	{
117874  		p := &_pFile.XctrlFlags
117875  		*p = uint16(int32(*p) & int32(-9))
117876  	}
117877  _6:
117878  	return _rc
117879  }
117880  
117881  var _unixSyncØ00__func__Ø000 [9]int8
117882  
117883  func init() {
117884  	crt.Xstrncpy(nil, &_unixSyncØ00__func__Ø000[0], str(132470), 9)
117885  }
117886  
117887  // C comment
117888  //  /*
117889  //  ** The fsync() system call does not work as advertised on many
117890  //  ** unix systems.  The following procedure is an attempt to make
117891  //  ** it work better.
117892  //  **
117893  //  ** The SQLITE_NO_SYNC macro disables all fsync()s.  This is useful
117894  //  ** for testing when we want to run through the test suite quickly.
117895  //  ** You are strongly advised *not* to deploy with SQLITE_NO_SYNC
117896  //  ** enabled, however, since with SQLITE_NO_SYNC enabled, an OS crash
117897  //  ** or power failure will likely corrupt the database file.
117898  //  **
117899  //  ** SQLite sets the dataOnly flag if the size of the file is unchanged.
117900  //  ** The idea behind dataOnly is that it should only write the file content
117901  //  ** to disk, not the inode.  We only set dataOnly if the file size is
117902  //  ** unchanged since the file size is part of the inode.  However,
117903  //  ** Ted Ts'o tells us that fdatasync() will also write the inode if the
117904  //  ** file size has changed.  The only real difference between fdatasync()
117905  //  ** and fsync(), Ted tells us, is that fdatasync() will not flush the
117906  //  ** inode if the mtime or owner or other inode attributes have changed.
117907  //  ** We only care about the file size, not the other file attributes, so
117908  //  ** as far as SQLite is concerned, an fdatasync() is always adequate.
117909  //  ** So, we always use fdatasync() if it is available, regardless of
117910  //  ** the value of the dataOnly flag.
117911  //  */
117912  func _full_fsync(tls *crt.TLS, _fd int32, _fullSync int32, _dataOnly int32) (r0 int32) {
117913  	var _rc int32
117914  
117915  	_rc = crt.Xfsync(tls, _fd)
117916  	goto _0
117917  _0:
117918  	return _rc
117919  }
117920  
117921  // C comment
117922  //  /*
117923  //  ** Determine the current size of a file in bytes
117924  //  */
117925  func _unixFileSize(tls *crt.TLS, _id *Xsqlite3_file, _pSize *int64) (r0 int32) {
117926  	var _rc int32
117927  	var _buf crt.Xstruct_stat64
117928  	func() {
117929  		if _id == nil {
117930  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33540), unsafe.Pointer(&_unixFileSizeØ00__func__Ø000), unsafe.Pointer(str(93813)))
117931  			crt.X__builtin_abort(tls)
117932  		}
117933  	}()
117934  	_rc = func() func(*crt.TLS, int32, *crt.Xstruct_stat64) int32 {
117935  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(5)).XpCurrent
117936  		return *(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
117937  	}()(tls, (*XunixFile)(unsafe.Pointer(_id)).Xh, &_buf)
117938  	if _rc != int32(0) {
117939  		_storeLastErrno(tls, (*XunixFile)(unsafe.Pointer(_id)), *crt.X__errno_location(tls))
117940  		return int32(1802)
117941  	}
117942  	*_pSize = _buf.Xst_size
117943  	if (*_pSize) == int64(1) {
117944  		*_pSize = 0
117945  	}
117946  	return int32(0)
117947  }
117948  
117949  var _unixFileSizeØ00__func__Ø000 [13]int8
117950  
117951  func init() {
117952  	crt.Xstrncpy(nil, &_unixFileSizeØ00__func__Ø000[0], str(132479), 13)
117953  }
117954  
117955  // C comment
117956  //  /*
117957  //  ** Lock the file with the lock specified by parameter eFileLock - one
117958  //  ** of the following:
117959  //  **
117960  //  **     (1) SHARED_LOCK
117961  //  **     (2) RESERVED_LOCK
117962  //  **     (3) PENDING_LOCK
117963  //  **     (4) EXCLUSIVE_LOCK
117964  //  **
117965  //  ** Sometimes when requesting one lock state, additional lock states
117966  //  ** are inserted in between.  The locking might fail on one of the later
117967  //  ** transitions leaving the lock state different from what it started but
117968  //  ** still short of its goal.  The following chart shows the allowed
117969  //  ** transitions and the inserted intermediate states:
117970  //  **
117971  //  **    UNLOCKED -> SHARED
117972  //  **    SHARED -> RESERVED
117973  //  **    SHARED -> (PENDING) -> EXCLUSIVE
117974  //  **    RESERVED -> (PENDING) -> EXCLUSIVE
117975  //  **    PENDING -> EXCLUSIVE
117976  //  **
117977  //  ** This routine will only increase a lock.  Use the sqlite3OsUnlock()
117978  //  ** routine to lower a locking level.
117979  //  */
117980  func _unixLock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32) (r0 int32) {
117981  	var _rc, _tErrno int32
117982  	var _pInode *XunixInodeInfo
117983  	var _pFile *XunixFile
117984  	var _lock Tflock
117985  	_rc = int32(0)
117986  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
117987  	_tErrno = int32(0)
117988  	func() {
117989  		if _pFile == nil {
117990  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31437), unsafe.Pointer(&_unixLockØ00__func__Ø000), unsafe.Pointer(str(58022)))
117991  			crt.X__builtin_abort(tls)
117992  		}
117993  	}()
117994  	if int32(_pFile.XeFileLock) >= _eFileLock {
117995  		return int32(0)
117996  	}
117997  	func() {
117998  		if int32(_pFile.XeFileLock) == int32(0) && _eFileLock != int32(1) {
117999  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31458), unsafe.Pointer(&_unixLockØ00__func__Ø000), unsafe.Pointer(str(132492)))
118000  			crt.X__builtin_abort(tls)
118001  		}
118002  	}()
118003  	func() {
118004  		if _eFileLock == int32(3) {
118005  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31459), unsafe.Pointer(&_unixLockØ00__func__Ø000), unsafe.Pointer(str(132544)))
118006  			crt.X__builtin_abort(tls)
118007  		}
118008  	}()
118009  	func() {
118010  		if _eFileLock == int32(2) && int32(_pFile.XeFileLock) != int32(1) {
118011  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31460), unsafe.Pointer(&_unixLockØ00__func__Ø000), unsafe.Pointer(str(132568)))
118012  			crt.X__builtin_abort(tls)
118013  		}
118014  	}()
118015  	_unixEnterMutex(tls)
118016  	_pInode = (*XunixInodeInfo)(_pFile.XpInode)
118017  	if (int32(_pFile.XeFileLock) != int32(_pInode.XeFileLock)) && ((int32(_pInode.XeFileLock) >= int32(3)) || (_eFileLock > int32(1))) {
118018  		_rc = int32(5)
118019  		goto _end_lock
118020  	}
118021  	if (_eFileLock == int32(1)) && ((int32(_pInode.XeFileLock) == int32(1)) || (int32(_pInode.XeFileLock) == int32(2))) {
118022  		func() {
118023  			if _eFileLock != int32(1) {
118024  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31483), unsafe.Pointer(&_unixLockØ00__func__Ø000), unsafe.Pointer(str(132626)))
118025  				crt.X__builtin_abort(tls)
118026  			}
118027  		}()
118028  		func() {
118029  			if int32(_pFile.XeFileLock) != int32(0) {
118030  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31484), unsafe.Pointer(&_unixLockØ00__func__Ø000), unsafe.Pointer(str(132649)))
118031  				crt.X__builtin_abort(tls)
118032  			}
118033  		}()
118034  		func() {
118035  			if _pInode.XnShared <= int32(0) {
118036  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31485), unsafe.Pointer(&_unixLockØ00__func__Ø000), unsafe.Pointer(str(132669)))
118037  				crt.X__builtin_abort(tls)
118038  			}
118039  		}()
118040  		_pFile.XeFileLock = uint8(1)
118041  		_pInode.XnShared += 1
118042  		_pInode.XnLock += 1
118043  		goto _end_lock
118044  	}
118045  	_lock.Xl_len = int64(1)
118046  	_lock.Xl_whence = 0
118047  	if _eFileLock != int32(1) && (_eFileLock != int32(4) || int32(_pFile.XeFileLock) >= int32(3)) {
118048  		goto _25
118049  	}
118050  	_lock.Xl_type = int16(func() int32 {
118051  		if _eFileLock == int32(1) {
118052  			return int32(0)
118053  		}
118054  		return int32(1)
118055  	}())
118056  	_lock.Xl_start = int64(_sqlite3PendingByte)
118057  	if _unixFileLock(tls, _pFile, &_lock) == 0 {
118058  		goto _28
118059  	}
118060  	_tErrno = *crt.X__errno_location(tls)
118061  	_rc = _sqliteErrorFromPosixError(tls, _tErrno, int32(3850))
118062  	if _rc != int32(5) {
118063  		_storeLastErrno(tls, _pFile, _tErrno)
118064  	}
118065  	goto _end_lock
118066  _28:
118067  _25:
118068  	if _eFileLock != int32(1) {
118069  		goto _30
118070  	}
118071  	func() {
118072  		if _pInode.XnShared != int32(0) {
118073  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31519), unsafe.Pointer(&_unixLockØ00__func__Ø000), unsafe.Pointer(str(132687)))
118074  			crt.X__builtin_abort(tls)
118075  		}
118076  	}()
118077  	func() {
118078  		if int32(_pInode.XeFileLock) != int32(0) {
118079  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31520), unsafe.Pointer(&_unixLockØ00__func__Ø000), unsafe.Pointer(str(132706)))
118080  			crt.X__builtin_abort(tls)
118081  		}
118082  	}()
118083  	func() {
118084  		if _rc != int32(0) {
118085  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31521), unsafe.Pointer(&_unixLockØ00__func__Ø000), unsafe.Pointer(str(14967)))
118086  			crt.X__builtin_abort(tls)
118087  		}
118088  	}()
118089  	_lock.Xl_start = int64(_sqlite3PendingByte + int32(2))
118090  	_lock.Xl_len = int64(510)
118091  	if _unixFileLock(tls, _pFile, &_lock) != 0 {
118092  		_tErrno = *crt.X__errno_location(tls)
118093  		_rc = _sqliteErrorFromPosixError(tls, _tErrno, int32(3850))
118094  	}
118095  	_lock.Xl_start = int64(_sqlite3PendingByte)
118096  	_lock.Xl_len = int64(1)
118097  	_lock.Xl_type = int16(2)
118098  	if _unixFileLock(tls, _pFile, &_lock) != 0 && (_rc == int32(0)) {
118099  		_tErrno = *crt.X__errno_location(tls)
118100  		_rc = int32(2058)
118101  	}
118102  	if _rc == 0 {
118103  		goto _40
118104  	}
118105  	if _rc != int32(5) {
118106  		_storeLastErrno(tls, _pFile, _tErrno)
118107  	}
118108  	goto _end_lock
118109  _40:
118110  	_pFile.XeFileLock = uint8(1)
118111  	_pInode.XnLock += 1
118112  	_pInode.XnShared = int32(1)
118113  	goto _46
118114  _30:
118115  	if (_eFileLock == int32(4)) && (_pInode.XnShared > int32(1)) {
118116  		_rc = int32(5)
118117  		goto _46
118118  	}
118119  	func() {
118120  		if int32(0) == int32(_pFile.XeFileLock) {
118121  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31560), unsafe.Pointer(&_unixLockØ00__func__Ø000), unsafe.Pointer(str(132727)))
118122  			crt.X__builtin_abort(tls)
118123  		}
118124  	}()
118125  	_lock.Xl_type = int16(1)
118126  	func() {
118127  		if _eFileLock != int32(2) && _eFileLock != int32(4) {
118128  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31563), unsafe.Pointer(&_unixLockØ00__func__Ø000), unsafe.Pointer(str(132747)))
118129  			crt.X__builtin_abort(tls)
118130  		}
118131  	}()
118132  	if _eFileLock == int32(2) {
118133  		_lock.Xl_start = int64(_sqlite3PendingByte + int32(1))
118134  		_lock.Xl_len = int64(1)
118135  		goto _53
118136  	}
118137  	_lock.Xl_start = int64(_sqlite3PendingByte + int32(2))
118138  	_lock.Xl_len = int64(510)
118139  _53:
118140  	if _unixFileLock(tls, _pFile, &_lock) == 0 {
118141  		goto _54
118142  	}
118143  	_tErrno = *crt.X__errno_location(tls)
118144  	_rc = _sqliteErrorFromPosixError(tls, _tErrno, int32(3850))
118145  	if _rc != int32(5) {
118146  		_storeLastErrno(tls, _pFile, _tErrno)
118147  	}
118148  _54:
118149  _46:
118150  	if ((_rc == int32(0)) && (int32(_pFile.XeFileLock) <= int32(1))) && (_eFileLock == int32(2)) {
118151  		_pFile.XtransCntrChng = 0
118152  		_pFile.XdbUpdate = 0
118153  		_pFile.XinNormalWrite = uint8(1)
118154  	}
118155  	if _rc == int32(0) {
118156  		_pFile.XeFileLock = uint8(_eFileLock)
118157  		_pInode.XeFileLock = uint8(_eFileLock)
118158  		goto _end_lock
118159  	}
118160  	if _eFileLock == int32(4) {
118161  		_pFile.XeFileLock = uint8(3)
118162  		_pInode.XeFileLock = uint8(3)
118163  	}
118164  _end_lock:
118165  	_unixLeaveMutex(tls)
118166  	return _rc
118167  }
118168  
118169  var _unixLockØ00__func__Ø000 [9]int8
118170  
118171  func init() {
118172  	crt.Xstrncpy(nil, &_unixLockØ00__func__Ø000[0], str(132801), 9)
118173  }
118174  
118175  // C comment
118176  //  /*
118177  //  ** This routine translates a standard POSIX errno code into something
118178  //  ** useful to the clients of the sqlite3 functions.  Specifically, it is
118179  //  ** intended to translate a variety of "try again" errors into SQLITE_BUSY
118180  //  ** and a variety of "please close the file descriptor NOW" errors into
118181  //  ** SQLITE_IOERR
118182  //  **
118183  //  ** Errors during initialization of locks, or file system support for locks,
118184  //  ** should handle ENOLCK, ENOTSUP, EOPNOTSUPP separately.
118185  //  */
118186  func _sqliteErrorFromPosixError(tls *crt.TLS, _posixError int32, _sqliteIOErr int32) (r0 int32) {
118187  	func() {
118188  		if _sqliteIOErr != int32(3850) && _sqliteIOErr != int32(2058) && _sqliteIOErr != int32(2314) && _sqliteIOErr != int32(3594) {
118189  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(30686), unsafe.Pointer(&_sqliteErrorFromPosixErrorØ00__func__Ø000), unsafe.Pointer(str(132810)))
118190  			crt.X__builtin_abort(tls)
118191  		}
118192  	}()
118193  	switch _posixError {
118194  	case int32(1):
118195  		goto _12
118196  	case int32(4):
118197  		goto _6
118198  	case int32(11):
118199  		goto _6
118200  	case int32(13):
118201  		goto _6
118202  	case int32(16):
118203  		goto _6
118204  	case int32(37):
118205  		goto _6
118206  	case int32(110):
118207  		goto _6
118208  	default:
118209  		goto _13
118210  	}
118211  
118212  _6:
118213  	return int32(5)
118214  
118215  _12:
118216  	return int32(3)
118217  
118218  _13:
118219  	return _sqliteIOErr
118220  }
118221  
118222  var _sqliteErrorFromPosixErrorØ00__func__Ø000 [26]int8
118223  
118224  func init() {
118225  	crt.Xstrncpy(nil, &_sqliteErrorFromPosixErrorØ00__func__Ø000[0], str(132976), 26)
118226  }
118227  
118228  // C comment
118229  //  /*
118230  //  ** This routine checks if there is a RESERVED lock held on the specified
118231  //  ** file by this or any other process. If such a lock is held, set *pResOut
118232  //  ** to a non-zero value otherwise *pResOut is set to zero.  The return value
118233  //  ** is set to SQLITE_OK unless an I/O error occurs during lock checking.
118234  //  */
118235  func _unixCheckReservedLock(tls *crt.TLS, _id *Xsqlite3_file, _pResOut *int32) (r0 int32) {
118236  	var _rc, _reserved int32
118237  	var _pFile *XunixFile
118238  	var _2_lock Tflock
118239  	_rc = int32(0)
118240  	_reserved = int32(0)
118241  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
118242  	func() {
118243  		if _pFile == nil {
118244  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31288), unsafe.Pointer(&_unixCheckReservedLockØ00__func__Ø000), unsafe.Pointer(str(58022)))
118245  			crt.X__builtin_abort(tls)
118246  		}
118247  	}()
118248  	func() {
118249  		if int32(_pFile.XeFileLock) > int32(1) {
118250  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31289), unsafe.Pointer(&_unixCheckReservedLockØ00__func__Ø000), unsafe.Pointer(str(133002)))
118251  			crt.X__builtin_abort(tls)
118252  		}
118253  	}()
118254  	_unixEnterMutex(tls)
118255  	if int32((*XunixInodeInfo)(_pFile.XpInode).XeFileLock) > int32(1) {
118256  		_reserved = int32(1)
118257  	}
118258  	if _reserved != 0 || ((*XunixInodeInfo)(_pFile.XpInode).XbProcessLock) != 0 {
118259  		goto _6
118260  	}
118261  	_2_lock.Xl_whence = 0
118262  	_2_lock.Xl_start = int64(_sqlite3PendingByte + int32(1))
118263  	_2_lock.Xl_len = int64(1)
118264  	_2_lock.Xl_type = int16(1)
118265  	if func() func(*crt.TLS, int32, int32, ...interface{}) int32 {
118266  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(7)).XpCurrent
118267  		return *(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&v))
118268  	}()(tls, _pFile.Xh, int32(12), unsafe.Pointer(&_2_lock)) != 0 {
118269  		_rc = int32(3594)
118270  		_storeLastErrno(tls, _pFile, *crt.X__errno_location(tls))
118271  		goto _9
118272  	}
118273  	if int32(_2_lock.Xl_type) != int32(2) {
118274  		_reserved = int32(1)
118275  	}
118276  _9:
118277  _6:
118278  	_unixLeaveMutex(tls)
118279  	*_pResOut = _reserved
118280  	return _rc
118281  }
118282  
118283  var _unixCheckReservedLockØ00__func__Ø000 [22]int8
118284  
118285  func init() {
118286  	crt.Xstrncpy(nil, &_unixCheckReservedLockØ00__func__Ø000[0], str(133032), 22)
118287  }
118288  
118289  // C comment
118290  //  /*
118291  //  ** Information and control of an open file handle.
118292  //  */
118293  func _unixFileControl(tls *crt.TLS, _id *Xsqlite3_file, _op int32, _pArg unsafe.Pointer) (r0 int32) {
118294  	var _5_rc, _12_rc int32
118295  	var _12_newLimit int64
118296  	var _9_zTFile *int8
118297  	var _pFile *XunixFile
118298  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
118299  	switch _op {
118300  	case int32(-905363552):
118301  		goto _11
118302  	case int32(1):
118303  		goto _1
118304  	case int32(4):
118305  		goto _2
118306  	case int32(5):
118307  		goto _4
118308  	case int32(6):
118309  		goto _3
118310  	case int32(10):
118311  		goto _5
118312  	case int32(12):
118313  		goto _7
118314  	case int32(13):
118315  		goto _6
118316  	case int32(16):
118317  		goto _8
118318  	case int32(18):
118319  		goto _10
118320  	case int32(20):
118321  		goto _9
118322  	default:
118323  		goto _12
118324  	}
118325  
118326  _1:
118327  	*(*int32)(_pArg) = int32(_pFile.XeFileLock)
118328  	return int32(0)
118329  
118330  _2:
118331  	*(*int32)(_pArg) = _pFile.XlastErrno
118332  	return int32(0)
118333  
118334  _3:
118335  	_pFile.XszChunk = *(*int32)(_pArg)
118336  	return int32(0)
118337  
118338  _4:
118339  	_5_rc = _fcntlSizeHint(tls, _pFile, *(*int64)(_pArg))
118340  	return _5_rc
118341  
118342  _5:
118343  	_unixModeBit(tls, _pFile, uint8(4), (*int32)(_pArg))
118344  	return int32(0)
118345  
118346  _6:
118347  	_unixModeBit(tls, _pFile, uint8(16), (*int32)(_pArg))
118348  	return int32(0)
118349  
118350  _7:
118351  	*(**int8)(_pArg) = Xsqlite3_mprintf(tls, str(24531), unsafe.Pointer((*Xsqlite3_vfs)(_pFile.XpVfs).XzName))
118352  	return int32(0)
118353  
118354  _8:
118355  	_9_zTFile = (*int8)(Xsqlite3_malloc64(tls, uint64((*Xsqlite3_vfs)(_pFile.XpVfs).XmxPathname)))
118356  	if _9_zTFile != nil {
118357  		_unixGetTempname(tls, (*Xsqlite3_vfs)(_pFile.XpVfs).XmxPathname, _9_zTFile)
118358  		*(**int8)(_pArg) = _9_zTFile
118359  	}
118360  	return int32(0)
118361  
118362  _9:
118363  	*(*int32)(_pArg) = _fileHasMoved(tls, _pFile)
118364  	return int32(0)
118365  
118366  _10:
118367  	_12_newLimit = *(*int64)(_pArg)
118368  	_12_rc = int32(0)
118369  	if _12_newLimit > _sqlite3Config.XmxMmap {
118370  		_12_newLimit = _sqlite3Config.XmxMmap
118371  	}
118372  	*(*int64)(_pArg) = _pFile.XmmapSizeMax
118373  	if _12_newLimit < (0) || _12_newLimit == _pFile.XmmapSizeMax || _pFile.XnFetchOut != int32(0) {
118374  		goto _17
118375  	}
118376  	_pFile.XmmapSizeMax = _12_newLimit
118377  	if _pFile.XmmapSize > (0) {
118378  		_unixUnmapfile(tls, _pFile)
118379  		_12_rc = _unixMapfile(tls, _pFile, int64(-1))
118380  	}
118381  _17:
118382  	return _12_rc
118383  
118384  _11:
118385  	(*XunixFile)(unsafe.Pointer(_id)).XdbUpdate = 0
118386  	return int32(0)
118387  
118388  _12:
118389  	return int32(12)
118390  }
118391  
118392  // C comment
118393  //  /*
118394  //  ** This function is called to handle the SQLITE_FCNTL_SIZE_HINT
118395  //  ** file-control operation.  Enlarge the database to nBytes in size
118396  //  ** (rounded up to the next chunk-size).  If the database is already
118397  //  ** nBytes or larger, this routine is a no-op.
118398  //  */
118399  func _fcntlSizeHint(tls *crt.TLS, _pFile *XunixFile, _nByte int64) (r0 int32) {
118400  	var _3_nBlk, _3_nWrite, _5_rc int32
118401  	var _1_nSize, _3_iWrite int64
118402  	var _1_buf crt.Xstruct_stat64
118403  	if _pFile.XszChunk <= int32(0) {
118404  		goto _0
118405  	}
118406  	if func() func(*crt.TLS, int32, *crt.Xstruct_stat64) int32 {
118407  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(5)).XpCurrent
118408  		return *(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
118409  	}()(tls, _pFile.Xh, &_1_buf) != 0 {
118410  		return int32(1802)
118411  	}
118412  	_1_nSize = (((_nByte + int64(_pFile.XszChunk)) - int64(1)) / int64(_pFile.XszChunk)) * int64(_pFile.XszChunk)
118413  	if _1_nSize <= _1_buf.Xst_size {
118414  		goto _2
118415  	}
118416  	_3_nBlk = _1_buf.Xst_blksize
118417  	_3_nWrite = int32(0)
118418  	_3_iWrite = (((_1_buf.Xst_size / int64(_3_nBlk)) * int64(_3_nBlk)) + int64(_3_nBlk)) - int64(1)
118419  	func() {
118420  		if _3_iWrite < _1_buf.Xst_size {
118421  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33609), unsafe.Pointer(&_fcntlSizeHintØ00__func__Ø000), unsafe.Pointer(str(133054)))
118422  			crt.X__builtin_abort(tls)
118423  		}
118424  	}()
118425  	func() {
118426  		if ((_3_iWrite + int64(1)) % int64(_3_nBlk)) != (0) {
118427  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33610), unsafe.Pointer(&_fcntlSizeHintØ00__func__Ø000), unsafe.Pointer(str(133074)))
118428  			crt.X__builtin_abort(tls)
118429  		}
118430  	}()
118431  _7:
118432  	if _3_iWrite >= ((_1_nSize + int64(_3_nBlk)) - int64(1)) {
118433  		goto _10
118434  	}
118435  	if _3_iWrite >= _1_nSize {
118436  		_3_iWrite = _1_nSize - int64(1)
118437  	}
118438  	_3_nWrite = _seekAndWrite(tls, _pFile, _3_iWrite, unsafe.Pointer(str(284)), int32(1))
118439  	if _3_nWrite != int32(1) {
118440  		return int32(778)
118441  	}
118442  	_3_iWrite += int64(_3_nBlk)
118443  	goto _7
118444  _10:
118445  _2:
118446  _0:
118447  	if _pFile.XmmapSizeMax <= (0) || _nByte <= _pFile.XmmapSize {
118448  		goto _14
118449  	}
118450  	if _pFile.XszChunk > int32(0) {
118451  		goto _15
118452  	}
118453  	if _robust_ftruncate(tls, _pFile.Xh, _nByte) != 0 {
118454  		_storeLastErrno(tls, _pFile, *crt.X__errno_location(tls))
118455  		return _unixLogErrorAtLine(tls, int32(1546), str(131546), _pFile.XzPath, int32(33626))
118456  	}
118457  _15:
118458  	_5_rc = _unixMapfile(tls, _pFile, _nByte)
118459  	return _5_rc
118460  
118461  _14:
118462  	return int32(0)
118463  }
118464  
118465  var _fcntlSizeHintØ00__func__Ø000 [14]int8
118466  
118467  func init() {
118468  	crt.Xstrncpy(nil, &_fcntlSizeHintØ00__func__Ø000[0], str(133095), 14)
118469  }
118470  
118471  // C comment
118472  //  /*
118473  //  ** Memory map or remap the file opened by file-descriptor pFd (if the file
118474  //  ** is already mapped, the existing mapping is replaced by the new). Or, if
118475  //  ** there already exists a mapping for this file, and there are still
118476  //  ** outstanding xFetch() references to it, this function is a no-op.
118477  //  **
118478  //  ** If parameter nByte is non-negative, then it is the requested size of
118479  //  ** the mapping to create. Otherwise, if nByte is less than zero, then the
118480  //  ** requested size is the size of the file on disk. The actual size of the
118481  //  ** created mapping is either the requested size or the value configured
118482  //  ** using SQLITE_FCNTL_MMAP_LIMIT, whichever is smaller.
118483  //  **
118484  //  ** SQLITE_OK is returned if no error occurs (even if the mapping is not
118485  //  ** recreated as a result of outstanding references) or an SQLite error
118486  //  ** code otherwise.
118487  //  */
118488  func _unixMapfile(tls *crt.TLS, _pFd *XunixFile, _nMap int64) (r0 int32) {
118489  	var _1_statbuf crt.Xstruct_stat64
118490  	func() {
118491  		if _nMap < (0) && _pFd.XnFetchOut != int32(0) {
118492  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34713), unsafe.Pointer(&_unixMapfileØ00__func__Ø000), unsafe.Pointer(str(133109)))
118493  			crt.X__builtin_abort(tls)
118494  		}
118495  	}()
118496  	func() {
118497  		if _nMap <= (0) && (_pFd.XmmapSize != (0) || _pFd.XpMapRegion != nil) {
118498  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34714), unsafe.Pointer(&_unixMapfileØ00__func__Ø000), unsafe.Pointer(str(133138)))
118499  			crt.X__builtin_abort(tls)
118500  		}
118501  	}()
118502  	if _pFd.XnFetchOut > int32(0) {
118503  		return int32(0)
118504  	}
118505  	if _nMap >= (0) {
118506  		goto _8
118507  	}
118508  	if func() func(*crt.TLS, int32, *crt.Xstruct_stat64) int32 {
118509  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(5)).XpCurrent
118510  		return *(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
118511  	}()(tls, _pFd.Xh, &_1_statbuf) != 0 {
118512  		return int32(1802)
118513  	}
118514  	_nMap = _1_statbuf.Xst_size
118515  _8:
118516  	if _nMap > _pFd.XmmapSizeMax {
118517  		_nMap = _pFd.XmmapSizeMax
118518  	}
118519  	func() {
118520  		if _nMap <= (0) && (_pFd.XmmapSize != (0) || _pFd.XpMapRegion != nil) {
118521  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34728), unsafe.Pointer(&_unixMapfileØ00__func__Ø000), unsafe.Pointer(str(133138)))
118522  			crt.X__builtin_abort(tls)
118523  		}
118524  	}()
118525  	if _nMap != _pFd.XmmapSize {
118526  		_unixRemapfile(tls, _pFd, _nMap)
118527  	}
118528  	return int32(0)
118529  }
118530  
118531  var _unixMapfileØ00__func__Ø000 [12]int8
118532  
118533  func init() {
118534  	crt.Xstrncpy(nil, &_unixMapfileØ00__func__Ø000[0], str(133189), 12)
118535  }
118536  
118537  // C comment
118538  //  /*
118539  //  ** Attempt to set the size of the memory mapping maintained by file
118540  //  ** descriptor pFd to nNew bytes. Any existing mapping is discarded.
118541  //  **
118542  //  ** If successful, this function sets the following variables:
118543  //  **
118544  //  **       unixFile.pMapRegion
118545  //  **       unixFile.mmapSize
118546  //  **       unixFile.mmapSizeActual
118547  //  **
118548  //  ** If unsuccessful, an error message is logged via sqlite3_log() and
118549  //  ** the three variables above are zeroed. In this case SQLite should
118550  //  ** continue accessing the database using the xRead() and xWrite()
118551  //  ** methods.
118552  //  */
118553  func _unixRemapfile(tls *crt.TLS, _pFd *XunixFile, _nNew int64) {
118554  	var _h, _flags, _1_szSyspage int32
118555  	var _nOrig, _1_nReuse int64
118556  	var _zErr *int8
118557  	var _pOrig, _pNew, _1_pReq *uint8
118558  	_zErr = str(131668)
118559  	_h = _pFd.Xh
118560  	_pOrig = (*uint8)(_pFd.XpMapRegion)
118561  	_nOrig = _pFd.XmmapSizeActual
118562  	_pNew = nil
118563  	_flags = int32(1)
118564  	func() {
118565  		if _pFd.XnFetchOut != int32(0) {
118566  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34631), unsafe.Pointer(&_unixRemapfileØ00__func__Ø000), unsafe.Pointer(str(132201)))
118567  			crt.X__builtin_abort(tls)
118568  		}
118569  	}()
118570  	func() {
118571  		if _nNew <= _pFd.XmmapSize {
118572  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34632), unsafe.Pointer(&_unixRemapfileØ00__func__Ø000), unsafe.Pointer(str(133201)))
118573  			crt.X__builtin_abort(tls)
118574  		}
118575  	}()
118576  	func() {
118577  		if _nNew > _pFd.XmmapSizeMax {
118578  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34633), unsafe.Pointer(&_unixRemapfileØ00__func__Ø000), unsafe.Pointer(str(133220)))
118579  			crt.X__builtin_abort(tls)
118580  		}
118581  	}()
118582  	func() {
118583  		if _nNew <= (0) {
118584  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34634), unsafe.Pointer(&_unixRemapfileØ00__func__Ø000), unsafe.Pointer(str(82808)))
118585  			crt.X__builtin_abort(tls)
118586  		}
118587  	}()
118588  	func() {
118589  		if _pFd.XmmapSizeActual < _pFd.XmmapSize {
118590  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34635), unsafe.Pointer(&_unixRemapfileØ00__func__Ø000), unsafe.Pointer(str(133243)))
118591  			crt.X__builtin_abort(tls)
118592  		}
118593  	}()
118594  	func() {
118595  		if crt.U2P(uintptr(uint32(4294967295))) == nil {
118596  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34636), unsafe.Pointer(&_unixRemapfileØ00__func__Ø000), unsafe.Pointer(str(133278)))
118597  			crt.X__builtin_abort(tls)
118598  		}
118599  	}()
118600  	if _pOrig == nil {
118601  		goto _12
118602  	}
118603  	_1_szSyspage = func() func(*crt.TLS) int32 {
118604  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(25)).XpCurrent
118605  		return *(*func(*crt.TLS) int32)(unsafe.Pointer(&v))
118606  	}()(tls)
118607  	_1_nReuse = _pFd.XmmapSize & int64(^(_1_szSyspage - int32(1)))
118608  	_1_pReq = elem15(_pOrig, uintptr(_1_nReuse))
118609  	if _1_nReuse != _nOrig {
118610  		func() func(*crt.TLS, unsafe.Pointer, uint32) unsafe.Pointer {
118611  			v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(23)).XpCurrent
118612  			return *(*func(*crt.TLS, unsafe.Pointer, uint32) unsafe.Pointer)(unsafe.Pointer(&v))
118613  		}()(tls, unsafe.Pointer(_1_pReq), uint32(_nOrig-_1_nReuse))
118614  	}
118615  	_pNew = (*uint8)(func() func(*crt.TLS, unsafe.Pointer, uint32, int32, int32, int32, int64) unsafe.Pointer {
118616  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(22)).XpCurrent
118617  		return *(*func(*crt.TLS, unsafe.Pointer, uint32, int32, int32, int32, int64) unsafe.Pointer)(unsafe.Pointer(&v))
118618  	}()(tls, unsafe.Pointer(_1_pReq), uint32(_nNew-_1_nReuse), _flags, int32(1), _h, _1_nReuse))
118619  	if _pNew == (*uint8)(crt.U2P(uintptr(uint32(4294967295)))) {
118620  		goto _14
118621  	}
118622  	if _pNew != _1_pReq {
118623  		func() func(*crt.TLS, unsafe.Pointer, uint32) unsafe.Pointer {
118624  			v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(23)).XpCurrent
118625  			return *(*func(*crt.TLS, unsafe.Pointer, uint32) unsafe.Pointer)(unsafe.Pointer(&v))
118626  		}()(tls, unsafe.Pointer(_pNew), uint32(_nNew-_1_nReuse))
118627  		_pNew = nil
118628  		goto _16
118629  	}
118630  	_pNew = _pOrig
118631  _16:
118632  _14:
118633  	if (_pNew == (*uint8)(crt.U2P(uintptr(uint32(4294967295))))) || (_pNew == nil) {
118634  		func() func(*crt.TLS, unsafe.Pointer, uint32) unsafe.Pointer {
118635  			v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(23)).XpCurrent
118636  			return *(*func(*crt.TLS, unsafe.Pointer, uint32) unsafe.Pointer)(unsafe.Pointer(&v))
118637  		}()(tls, unsafe.Pointer(_pOrig), uint32(_1_nReuse))
118638  	}
118639  _12:
118640  	if _pNew == nil {
118641  		_pNew = (*uint8)(func() func(*crt.TLS, unsafe.Pointer, uint32, int32, int32, int32, int64) unsafe.Pointer {
118642  			v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(22)).XpCurrent
118643  			return *(*func(*crt.TLS, unsafe.Pointer, uint32, int32, int32, int32, int64) unsafe.Pointer)(unsafe.Pointer(&v))
118644  		}()(tls, nil, uint32(_nNew), _flags, int32(1), _h, 0))
118645  	}
118646  	if _pNew == (*uint8)(crt.U2P(uintptr(uint32(4294967295)))) {
118647  		_pNew = nil
118648  		_nNew = 0
118649  		_unixLogErrorAtLine(tls, int32(0), _zErr, _pFd.XzPath, int32(34685))
118650  		_pFd.XmmapSizeMax = 0
118651  	}
118652  	_pFd.XpMapRegion = unsafe.Pointer(_pNew)
118653  	_pFd.XmmapSize = store35(&_pFd.XmmapSizeActual, _nNew)
118654  }
118655  
118656  var _unixRemapfileØ00__func__Ø000 [14]int8
118657  
118658  func init() {
118659  	crt.Xstrncpy(nil, &_unixRemapfileØ00__func__Ø000[0], str(133292), 14)
118660  }
118661  
118662  // C comment
118663  //  /*
118664  //  ** If *pArg is initially negative then this is a query.  Set *pArg to
118665  //  ** 1 or 0 depending on whether or not bit mask of pFile->ctrlFlags is set.
118666  //  **
118667  //  ** If *pArg is 0 or 1, then clear or set the mask bit of pFile->ctrlFlags.
118668  //  */
118669  func _unixModeBit(tls *crt.TLS, _pFile *XunixFile, _mask uint8, _pArg *int32) {
118670  	if (*_pArg) < int32(0) {
118671  		*_pArg = bool2int((int32(_pFile.XctrlFlags) & int32(_mask)) != int32(0))
118672  		goto _3
118673  	}
118674  	if (*_pArg) == int32(0) {
118675  		{
118676  			p := &_pFile.XctrlFlags
118677  			*p = uint16(int32(*p) & (^int32(_mask)))
118678  		}
118679  		goto _3
118680  	}
118681  	{
118682  		p := &_pFile.XctrlFlags
118683  		*p = uint16(int32(*p) | int32(_mask))
118684  	}
118685  _3:
118686  }
118687  
118688  // C comment
118689  //  /*
118690  //  ** Create a temporary file name in zBuf.  zBuf must be allocated
118691  //  ** by the calling process and must be big enough to hold at least
118692  //  ** pVfs->mxPathname bytes.
118693  //  */
118694  func _unixGetTempname(tls *crt.TLS, _nBuf int32, _zBuf *int8) (r0 int32) {
118695  	var _iLimit int32
118696  	var _1_r uint64
118697  	var _zDir *int8
118698  	_iLimit = int32(0)
118699  	*elem1(_zBuf, 0) = 0
118700  	_zDir = _unixTempFileDir(tls)
118701  	if _zDir == nil {
118702  		return int32(6410)
118703  	}
118704  _0:
118705  	Xsqlite3_randomness(tls, int32(8), unsafe.Pointer(&_1_r))
118706  	func() {
118707  		if _nBuf <= int32(2) {
118708  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35347), unsafe.Pointer(&_unixGetTempnameØ00__func__Ø000), unsafe.Pointer(str(133306)))
118709  			crt.X__builtin_abort(tls)
118710  		}
118711  	}()
118712  	*elem1(_zBuf, uintptr(_nBuf-int32(2))) = 0
118713  	Xsqlite3_snprintf(tls, _nBuf, _zBuf, str(133313), unsafe.Pointer(_zDir), _1_r, int32(0))
118714  	if (int32(*elem1(_zBuf, uintptr(_nBuf-int32(2)))) != int32(0)) || (postInc2(&_iLimit, 1) > int32(10)) {
118715  		return int32(1)
118716  	}
118717  	if func() func(*crt.TLS, *int8, int32) int32 {
118718  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(2)).XpCurrent
118719  		return *(*func(*crt.TLS, *int8, int32) int32)(unsafe.Pointer(&v))
118720  	}()(tls, _zBuf, int32(0)) == int32(0) {
118721  		goto _0
118722  	}
118723  	return int32(0)
118724  
118725  	_ = _iLimit
118726  	panic(0)
118727  }
118728  
118729  // C comment
118730  //  /*
118731  //  ** Return the name of a directory in which to put temporary files.
118732  //  ** If no suitable temporary file directory can be found, return NULL.
118733  //  */
118734  func _unixTempFileDir(tls *crt.TLS) (r0 *int8) {
118735  	var _i uint32
118736  	var _zDir *int8
118737  	var _buf crt.Xstruct_stat64
118738  	_i = uint32(0)
118739  	_zDir = Xsqlite3_temp_directory
118740  	if (*elem0((**int8)(unsafe.Pointer(&_unixTempFileDirØ00azDirsØ001)), 0)) == nil {
118741  		*elem0((**int8)(unsafe.Pointer(&_unixTempFileDirØ00azDirsØ001)), 0) = crt.Xgetenv(tls, str(133330))
118742  	}
118743  	if (*elem0((**int8)(unsafe.Pointer(&_unixTempFileDirØ00azDirsØ001)), uintptr(1))) == nil {
118744  		*elem0((**int8)(unsafe.Pointer(&_unixTempFileDirØ00azDirsØ001)), uintptr(1)) = crt.Xgetenv(tls, str(133344))
118745  	}
118746  _1:
118747  	if (((_zDir != nil) && (func() func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32 {
118748  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(4)).XpCurrent
118749  		return *(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
118750  	}()(tls, _zDir, &_buf) == int32(0))) && ((_buf.Xst_mode & uint32(61440)) == uint32(16384))) && (func() func(*crt.TLS, *int8, int32) int32 {
118751  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(2)).XpCurrent
118752  		return *(*func(*crt.TLS, *int8, int32) int32)(unsafe.Pointer(&v))
118753  	}()(tls, _zDir, int32(3)) == int32(0)) {
118754  		return _zDir
118755  	}
118756  	if _i >= uint32(6) {
118757  		goto _3
118758  	}
118759  	_zDir = *elem0((**int8)(unsafe.Pointer(&_unixTempFileDirØ00azDirsØ001)), uintptr(postInc23(&_i, uint32(1))))
118760  	goto _1
118761  _3:
118762  	return nil
118763  }
118764  
118765  var _unixTempFileDirØ00azDirsØ001 [6]*int8
118766  
118767  func init() {
118768  	_unixTempFileDirØ00azDirsØ001 = [6]*int8{nil, nil, str(133351), str(133360), str(133369), str(330)}
118769  }
118770  
118771  var _unixGetTempnameØ00__func__Ø000 [16]int8
118772  
118773  func init() {
118774  	crt.Xstrncpy(nil, &_unixGetTempnameØ00__func__Ø000[0], str(133374), 16)
118775  }
118776  
118777  func _unixSectorSize(tls *crt.TLS, _NotUsed *Xsqlite3_file) (r0 int32) {
118778  	return int32(4096)
118779  }
118780  
118781  // C comment
118782  //  /*
118783  //  ** Return the device characteristics for the file.
118784  //  **
118785  //  ** This VFS is set up to return SQLITE_IOCAP_POWERSAFE_OVERWRITE by default.
118786  //  ** However, that choice is controversial since technically the underlying
118787  //  ** file system does not always provide powersafe overwrites.  (In other
118788  //  ** words, after a power-loss event, parts of the file that were never
118789  //  ** written might end up being altered.)  However, non-PSOW behavior is very,
118790  //  ** very rare.  And asserting PSOW makes a large reduction in the amount
118791  //  ** of required I/O for journaling, since a lot of padding is eliminated.
118792  //  **  Hence, while POWERSAFE_OVERWRITE is on by default, there is a file-control
118793  //  ** available to turn it off and URI query parameter available to turn it off.
118794  //  */
118795  func _unixDeviceCharacteristics(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) {
118796  	var _rc int32
118797  	var _p *XunixFile
118798  	_p = (*XunixFile)(unsafe.Pointer(_id))
118799  	_rc = int32(0)
118800  	if (int32(_p.XctrlFlags) & int32(16)) != 0 {
118801  		_rc |= int32(4096)
118802  	}
118803  	return _rc
118804  }
118805  
118806  // C comment
118807  //  /*
118808  //  ** This function is called to obtain a pointer to region iRegion of the
118809  //  ** shared-memory associated with the database file fd. Shared-memory regions
118810  //  ** are numbered starting from zero. Each shared-memory region is szRegion
118811  //  ** bytes in size.
118812  //  **
118813  //  ** If an error occurs, an error code is returned and *pp is set to NULL.
118814  //  **
118815  //  ** Otherwise, if the bExtend parameter is 0 and the requested shared-memory
118816  //  ** region has not been allocated (by any client, including one running in a
118817  //  ** separate process), then *pp is set to NULL and SQLITE_OK returned. If
118818  //  ** bExtend is non-zero and the requested shared-memory region has not yet
118819  //  ** been allocated, it is allocated by this function.
118820  //  **
118821  //  ** If the shared-memory region has already been allocated or is allocated by
118822  //  ** this call as described above, then it is mapped into this processes
118823  //  ** address space (if it is not already), *pp is set to point to the mapped
118824  //  ** memory and SQLITE_OK returned.
118825  //  */
118826  func _unixShmMap(tls *crt.TLS, _fd *Xsqlite3_file, _iRegion int32, _szRegion int32, _bExtend int32, _pp *unsafe.Pointer) (r0 int32) {
118827  	var _rc, _nShmPerMap, _nReqRegion, _2_nByte, _7_iPg, _8_x, _11_nMap, _11_i int32
118828  	var _9_zFile *int8
118829  	var _11_pMem unsafe.Pointer
118830  	var _2_sStat crt.Xstruct_stat64
118831  	var _2_apNew **int8
118832  	var _pDbFd *XunixFile
118833  	var _pShmNode *XunixShmNode
118834  	var _p *TunixShm
118835  	_pDbFd = (*XunixFile)(unsafe.Pointer(_fd))
118836  	_rc = int32(0)
118837  	_nShmPerMap = _unixShmRegionPerMap(tls)
118838  	if (*TunixShm)(_pDbFd.XpShm) != nil {
118839  		goto _0
118840  	}
118841  	_rc = _unixOpenSharedMemory(tls, _pDbFd)
118842  	if _rc != int32(0) {
118843  		return _rc
118844  	}
118845  _0:
118846  	_p = (*TunixShm)(_pDbFd.XpShm)
118847  	_pShmNode = (*XunixShmNode)(_p.XpShmNode)
118848  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pShmNode.Xmutex))
118849  	func() {
118850  		if _szRegion != _pShmNode.XszRegion && int32(_pShmNode.XnRegion) != int32(0) {
118851  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34296), unsafe.Pointer(&_unixShmMapØ00__func__Ø000), unsafe.Pointer(str(133390)))
118852  			crt.X__builtin_abort(tls)
118853  		}
118854  	}()
118855  	func() {
118856  		if (*XunixInodeInfo)(_pShmNode.XpInode) != (*XunixInodeInfo)(_pDbFd.XpInode) {
118857  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34297), unsafe.Pointer(&_unixShmMapØ00__func__Ø000), unsafe.Pointer(str(133443)))
118858  			crt.X__builtin_abort(tls)
118859  		}
118860  	}()
118861  	func() {
118862  		if _pShmNode.Xh < int32(0) && int32((*XunixInodeInfo)(_pDbFd.XpInode).XbProcessLock) != int32(1) {
118863  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34298), unsafe.Pointer(&_unixShmMapØ00__func__Ø000), unsafe.Pointer(str(133475)))
118864  			crt.X__builtin_abort(tls)
118865  		}
118866  	}()
118867  	func() {
118868  		if _pShmNode.Xh >= int32(0) && int32((*XunixInodeInfo)(_pDbFd.XpInode).XbProcessLock) != int32(0) {
118869  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34299), unsafe.Pointer(&_unixShmMapØ00__func__Ø000), unsafe.Pointer(str(133524)))
118870  			crt.X__builtin_abort(tls)
118871  		}
118872  	}()
118873  	_nReqRegion = ((_iRegion + _nShmPerMap) / _nShmPerMap) * _nShmPerMap
118874  	if int32(_pShmNode.XnRegion) >= _nReqRegion {
118875  		goto _shmpage_out
118876  	}
118877  	_2_nByte = _nReqRegion * _szRegion
118878  	_pShmNode.XszRegion = _szRegion
118879  	if _pShmNode.Xh < int32(0) {
118880  		goto _14
118881  	}
118882  	if func() func(*crt.TLS, int32, *crt.Xstruct_stat64) int32 {
118883  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(5)).XpCurrent
118884  		return *(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
118885  	}()(tls, _pShmNode.Xh, &_2_sStat) != 0 {
118886  		_rc = int32(4874)
118887  		goto _shmpage_out
118888  	}
118889  	if _2_sStat.Xst_size >= int64(_2_nByte) {
118890  		goto _16
118891  	}
118892  	if _bExtend == 0 {
118893  		goto _shmpage_out
118894  	}
118895  	func() {
118896  		if (_2_nByte % _unixShmMapØ00pgszØ001) != int32(0) {
118897  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34341), unsafe.Pointer(&_unixShmMapØ00__func__Ø000), unsafe.Pointer(str(133572)))
118898  			crt.X__builtin_abort(tls)
118899  		}
118900  	}()
118901  	_7_iPg = int32(_2_sStat.Xst_size / int64(_unixShmMapØ00pgszØ001))
118902  _21:
118903  	if _7_iPg >= (_2_nByte / _unixShmMapØ00pgszØ001) {
118904  		goto _24
118905  	}
118906  	_8_x = int32(0)
118907  	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) {
118908  		_9_zFile = _pShmNode.XzFilename
118909  		_rc = _unixLogErrorAtLine(tls, int32(4874), str(131581), _9_zFile, int32(34346))
118910  		goto _shmpage_out
118911  	}
118912  	_7_iPg += 1
118913  	goto _21
118914  _24:
118915  _16:
118916  _14:
118917  	_2_apNew = (**int8)(Xsqlite3_realloc(tls, unsafe.Pointer(_pShmNode.XapRegion), int32(uint32(_nReqRegion)*uint32(4))))
118918  	if _2_apNew == nil {
118919  		_rc = _sqlite3IoerrnomemError(tls, int32(34359))
118920  		goto _shmpage_out
118921  	}
118922  	_pShmNode.XapRegion = _2_apNew
118923  _27:
118924  	if int32(_pShmNode.XnRegion) >= _nReqRegion {
118925  		goto _28
118926  	}
118927  	_11_nMap = _szRegion * _nShmPerMap
118928  	if _pShmNode.Xh < int32(0) {
118929  		goto _29
118930  	}
118931  	_11_pMem = func() func(*crt.TLS, unsafe.Pointer, uint32, int32, int32, int32, int64) unsafe.Pointer {
118932  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(22)).XpCurrent
118933  		return *(*func(*crt.TLS, unsafe.Pointer, uint32, int32, int32, int32, int64) unsafe.Pointer)(unsafe.Pointer(&v))
118934  	}()(tls, nil, uint32(_11_nMap), func() int32 {
118935  		if _pShmNode.XisReadonly != 0 {
118936  			return int32(1)
118937  		}
118938  		return int32(3)
118939  	}(), int32(1), _pShmNode.Xh, int64(_szRegion)*int64(_pShmNode.XnRegion))
118940  	if _11_pMem == crt.U2P(uintptr(uint32(4294967295))) {
118941  		_rc = _unixLogErrorAtLine(tls, int32(5386), str(131668), _pShmNode.XzFilename, int32(34373))
118942  		goto _shmpage_out
118943  	}
118944  	goto _33
118945  _29:
118946  	_11_pMem = Xsqlite3_malloc64(tls, uint64(_szRegion))
118947  	if _11_pMem == nil {
118948  		_rc = _sqlite3NomemError(tls, int32(34379))
118949  		goto _shmpage_out
118950  	}
118951  	crt.Xmemset(tls, _11_pMem, int32(0), uint32(_szRegion))
118952  _33:
118953  	_11_i = int32(0)
118954  _35:
118955  	if _11_i >= _nShmPerMap {
118956  		goto _38
118957  	}
118958  	*elem0(_pShmNode.XapRegion, uintptr(int32(_pShmNode.XnRegion)+_11_i)) = elem1((*int8)(_11_pMem), uintptr(_szRegion*_11_i))
118959  	_11_i += 1
118960  	goto _35
118961  _38:
118962  	{
118963  		p := &_pShmNode.XnRegion
118964  		*p = uint16(int32(*p) + _nShmPerMap)
118965  	}
118966  	goto _27
118967  _28:
118968  _shmpage_out:
118969  	if int32(_pShmNode.XnRegion) > _iRegion {
118970  		*_pp = unsafe.Pointer(*elem0(_pShmNode.XapRegion, uintptr(_iRegion)))
118971  		goto _40
118972  	}
118973  	*_pp = nil
118974  _40:
118975  	if (_pShmNode.XisReadonly != 0) && (_rc == int32(0)) {
118976  		_rc = int32(8)
118977  	}
118978  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pShmNode.Xmutex))
118979  	return _rc
118980  }
118981  
118982  // C comment
118983  //  /*
118984  //  ** Return the minimum number of 32KB shm regions that should be mapped at
118985  //  ** a time, assuming that each mapping must be an integer multiple of the
118986  //  ** current system page-size.
118987  //  **
118988  //  ** Usually, this is 1. The exception seems to be systems that are configured
118989  //  ** to use 64KB pages - in this case each mapping must cover at least two
118990  //  ** shm regions.
118991  //  */
118992  func _unixShmRegionPerMap(tls *crt.TLS) (r0 int32) {
118993  	var _shmsz, _pgsz int32
118994  	_shmsz = int32(32768)
118995  	_pgsz = func() func(*crt.TLS) int32 {
118996  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(25)).XpCurrent
118997  		return *(*func(*crt.TLS) int32)(unsafe.Pointer(&v))
118998  	}()(tls)
118999  	func() {
119000  		if ((_pgsz - int32(1)) & _pgsz) != int32(0) {
119001  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34053), unsafe.Pointer(&_unixShmRegionPerMapØ00__func__Ø000), unsafe.Pointer(str(133590)))
119002  			crt.X__builtin_abort(tls)
119003  		}
119004  	}()
119005  	if _pgsz < _shmsz {
119006  		return int32(1)
119007  	}
119008  	return _pgsz / _shmsz
119009  }
119010  
119011  var _unixShmRegionPerMapØ00__func__Ø000 [20]int8
119012  
119013  func init() {
119014  	crt.Xstrncpy(nil, &_unixShmRegionPerMapØ00__func__Ø000[0], str(133609), 20)
119015  }
119016  
119017  // C comment
119018  //  /*
119019  //  ** Open a shared-memory area associated with open database file pDbFd.
119020  //  ** This particular implementation uses mmapped files.
119021  //  **
119022  //  ** The file used to implement shared-memory is in the same directory
119023  //  ** as the open database file and has the same name as the open database
119024  //  ** file with the "-shm" suffix added.  For example, if the database file
119025  //  ** is "/home/user1/config.db" then the file that is created and mmapped
119026  //  ** for shared memory will be called "/home/user1/config.db-shm".
119027  //  **
119028  //  ** Another approach to is to use files in /dev/shm or /dev/tmp or an
119029  //  ** some other tmpfs mount. But if a file in a different directory
119030  //  ** from the database file is used, then differing access permissions
119031  //  ** or a chroot() might cause two different processes on the same
119032  //  ** database to end up using different files for shared memory -
119033  //  ** meaning that their memory would not really be shared - resulting
119034  //  ** in database corruption.  Nevertheless, this tmpfs file usage
119035  //  ** can be enabled at compile-time using -DSQLITE_SHM_DIRECTORY="/dev/shm"
119036  //  ** or the equivalent.  The use of the SQLITE_SHM_DIRECTORY compile-time
119037  //  ** option results in an incompatible build of SQLite;  builds of SQLite
119038  //  ** that with differing SQLITE_SHM_DIRECTORY settings attempt to use the
119039  //  ** same database file at the same time, database corruption will likely
119040  //  ** result. The SQLITE_SHM_DIRECTORY compile-time option is considered
119041  //  ** "unsupported" and may go away in a future SQLite release.
119042  //  **
119043  //  ** When opening a new shared-memory file, if no other instances of that
119044  //  ** file are currently open, in this process or in other processes, then
119045  //  ** the file must be truncated to zero length or have its header cleared.
119046  //  **
119047  //  ** If the original database file (pDbFd) is using the "unix-excl" VFS
119048  //  ** that means that an exclusive lock is held on the database file and
119049  //  ** that no other processes are able to read or write the database.  In
119050  //  ** that case, we do not really need shared memory.  No shared memory
119051  //  ** file is created.  The shared memory will be simulated with heap memory.
119052  //  */
119053  func _unixOpenSharedMemory(tls *crt.TLS, _pDbFd *XunixFile) (r0 int32) {
119054  	var _rc, _nShmFilename, _6_openFlags int32
119055  	var _zShmFilename, _1_zBasePath *int8
119056  	var _1_sStat crt.Xstruct_stat64
119057  	var _pInode *XunixInodeInfo
119058  	var _pShmNode *XunixShmNode
119059  	var _p *TunixShm
119060  	_p = nil
119061  	_p = (*TunixShm)(Xsqlite3_malloc64(tls, uint64(16)))
119062  	if _p == nil {
119063  		return _sqlite3NomemError(tls, int32(34134))
119064  	}
119065  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint32(16))
119066  	func() {
119067  		if (*TunixShm)(_pDbFd.XpShm) != nil {
119068  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34136), unsafe.Pointer(&_unixOpenSharedMemoryØ00__func__Ø000), unsafe.Pointer(str(133629)))
119069  			crt.X__builtin_abort(tls)
119070  		}
119071  	}()
119072  	_unixEnterMutex(tls)
119073  	_pInode = (*XunixInodeInfo)(_pDbFd.XpInode)
119074  	_pShmNode = (*XunixShmNode)(_pInode.XpShmNode)
119075  	if _pShmNode != nil {
119076  		goto _3
119077  	}
119078  	_1_zBasePath = _pDbFd.XzPath
119079  	if func() func(*crt.TLS, int32, *crt.Xstruct_stat64) int32 {
119080  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(5)).XpCurrent
119081  		return *(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
119082  	}()(tls, _pDbFd.Xh, &_1_sStat) != 0 {
119083  		_rc = int32(1802)
119084  		goto _shm_open_err
119085  	}
119086  	_nShmFilename = int32(6) + int32(crt.Xstrlen(tls, _1_zBasePath))
119087  	_pShmNode = (*XunixShmNode)(Xsqlite3_malloc64(tls, uint64(uint32(40)+uint32(_nShmFilename))))
119088  	if _pShmNode == nil {
119089  		_rc = _sqlite3NomemError(tls, int32(34166))
119090  		goto _shm_open_err
119091  	}
119092  	crt.Xmemset(tls, unsafe.Pointer(_pShmNode), int32(0), uint32(40)+uint32(_nShmFilename))
119093  	_zShmFilename = store1(&_pShmNode.XzFilename, (*int8)(unsafe.Pointer(elem135(_pShmNode, uintptr(1)))))
119094  	Xsqlite3_snprintf(tls, _nShmFilename, _zShmFilename, str(133644), unsafe.Pointer(_1_zBasePath))
119095  	_pShmNode.Xh = int32(-1)
119096  	*(**XunixShmNode)(unsafe.Pointer(&((*XunixInodeInfo)(_pDbFd.XpInode).XpShmNode))) = _pShmNode
119097  	*(**XunixInodeInfo)(unsafe.Pointer(&_pShmNode.XpInode)) = (*XunixInodeInfo)(_pDbFd.XpInode)
119098  	if _sqlite3Config.XbCoreMutex == 0 {
119099  		goto _6
119100  	}
119101  	*(**Xsqlite3_mutex)(unsafe.Pointer(&_pShmNode.Xmutex)) = Xsqlite3_mutex_alloc(tls, int32(0))
119102  	if (*Xsqlite3_mutex)(_pShmNode.Xmutex) == nil {
119103  		_rc = _sqlite3NomemError(tls, int32(34185))
119104  		goto _shm_open_err
119105  	}
119106  _6:
119107  	if int32(_pInode.XbProcessLock) != int32(0) {
119108  		goto _8
119109  	}
119110  	_6_openFlags = int32(66)
119111  	if Xsqlite3_uri_boolean(tls, _pDbFd.XzPath, str(133651), int32(0)) != 0 {
119112  		_6_openFlags = int32(0)
119113  		_pShmNode.XisReadonly = uint8(1)
119114  	}
119115  	_pShmNode.Xh = _robust_open(tls, _zShmFilename, _6_openFlags, _1_sStat.Xst_mode&uint32(511))
119116  	if _pShmNode.Xh < int32(0) {
119117  		_rc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(34198)), str(131517), _zShmFilename, int32(34198))
119118  		goto _shm_open_err
119119  	}
119120  	_robustFchown(tls, _pShmNode.Xh, _1_sStat.Xst_uid, _1_sStat.Xst_gid)
119121  	_rc = int32(0)
119122  	if _unixShmSystemLock(tls, _pDbFd, int32(1), int32(128), int32(1)) != int32(0) {
119123  		goto _11
119124  	}
119125  	if _robust_ftruncate(tls, _pShmNode.Xh, 0) != 0 {
119126  		_rc = _unixLogErrorAtLine(tls, int32(4618), str(131546), _zShmFilename, int32(34214))
119127  	}
119128  _11:
119129  	if _rc == int32(0) {
119130  		_rc = _unixShmSystemLock(tls, _pDbFd, int32(0), int32(128), int32(1))
119131  	}
119132  	if _rc != 0 {
119133  		goto _shm_open_err
119134  	}
119135  _8:
119136  _3:
119137  	*(**XunixShmNode)(unsafe.Pointer(&_p.XpShmNode)) = _pShmNode
119138  	_p.Xid = postInc3(&_pShmNode.XnextShmId, byte(1))
119139  	_pShmNode.XnRef += 1
119140  	*(**TunixShm)(unsafe.Pointer(&_pDbFd.XpShm)) = _p
119141  	_unixLeaveMutex(tls)
119142  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pShmNode.Xmutex))
119143  	*(**TunixShm)(unsafe.Pointer(&_p.XpNext)) = (*TunixShm)(_pShmNode.XpFirst)
119144  	*(**TunixShm)(unsafe.Pointer(&_pShmNode.XpFirst)) = _p
119145  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pShmNode.Xmutex))
119146  	return int32(0)
119147  
119148  _shm_open_err:
119149  	_unixShmPurge(tls, _pDbFd)
119150  	Xsqlite3_free(tls, unsafe.Pointer(_p))
119151  	_unixLeaveMutex(tls)
119152  	return _rc
119153  }
119154  
119155  var _unixOpenSharedMemoryØ00__func__Ø000 [21]int8
119156  
119157  func init() {
119158  	crt.Xstrncpy(nil, &_unixOpenSharedMemoryØ00__func__Ø000[0], str(133664), 21)
119159  }
119160  
119161  // C comment
119162  //  /*
119163  //  ** On some systems, calls to fchown() will trigger a message in a security
119164  //  ** log if they come from non-root processes.  So avoid calling fchown() if
119165  //  ** we are not running as root.
119166  //  */
119167  func _robustFchown(tls *crt.TLS, _fd int32, _uid uint32, _gid uint32) (r0 int32) {
119168  	return func() int32 {
119169  		if func() func(*crt.TLS) uint32 {
119170  			v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(21)).XpCurrent
119171  			return *(*func(*crt.TLS) uint32)(unsafe.Pointer(&v))
119172  		}()(tls) != 0 {
119173  			return int32(0)
119174  		}
119175  		return func() func(*crt.TLS, int32, uint32, uint32) int32 {
119176  			v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(20)).XpCurrent
119177  			return *(*func(*crt.TLS, int32, uint32, uint32) int32)(unsafe.Pointer(&v))
119178  		}()(tls, _fd, _uid, _gid)
119179  	}()
119180  }
119181  
119182  // C comment
119183  //  /*
119184  //  ** Apply posix advisory locks for all bytes from ofst through ofst+n-1.
119185  //  **
119186  //  ** Locks block if the mask is exactly UNIX_SHM_C and are non-blocking
119187  //  ** otherwise.
119188  //  */
119189  func _unixShmSystemLock(tls *crt.TLS, _pFile *XunixFile, _lockType int32, _ofst int32, _n int32) (r0 int32) {
119190  	var _rc int32
119191  	var _2_mask uint16
119192  	var _pShmNode *XunixShmNode
119193  	var _f Tflock
119194  	_rc = int32(0)
119195  	_pShmNode = (*XunixShmNode)((*XunixInodeInfo)(_pFile.XpInode).XpShmNode)
119196  	func() {
119197  		if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pShmNode.Xmutex)) == 0 && _pShmNode.XnRef != int32(0) {
119198  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33983), unsafe.Pointer(&_unixShmSystemLockØ00__func__Ø000), unsafe.Pointer(str(133685)))
119199  			crt.X__builtin_abort(tls)
119200  		}
119201  	}()
119202  	func() {
119203  		if _n != int32(1) && _lockType == int32(0) {
119204  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33986), unsafe.Pointer(&_unixShmSystemLockØ00__func__Ø000), unsafe.Pointer(str(133742)))
119205  			crt.X__builtin_abort(tls)
119206  		}
119207  	}()
119208  	func() {
119209  		if _n < int32(1) || _n > int32(8) {
119210  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(33989), unsafe.Pointer(&_unixShmSystemLockØ00__func__Ø000), unsafe.Pointer(str(133768)))
119211  			crt.X__builtin_abort(tls)
119212  		}
119213  	}()
119214  	if _pShmNode.Xh >= int32(0) {
119215  		crt.Xmemset(tls, unsafe.Pointer(&_f), int32(0), uint32(24))
119216  		_f.Xl_type = int16(_lockType)
119217  		_f.Xl_whence = 0
119218  		_f.Xl_start = int64(_ofst)
119219  		_f.Xl_len = int64(_n)
119220  		_rc = func() func(*crt.TLS, int32, int32, ...interface{}) int32 {
119221  			v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(7)).XpCurrent
119222  			return *(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&v))
119223  		}()(tls, _pShmNode.Xh, int32(13), unsafe.Pointer(&_f))
119224  		_rc = func() int32 {
119225  			if _rc != int32(-1) {
119226  				return int32(0)
119227  			}
119228  			return int32(5)
119229  		}()
119230  	}
119231  	_2_mask = uint16(func() int32 {
119232  		if _ofst > int32(31) {
119233  			return int32(65535)
119234  		}
119235  		return ((int32(1) << uint(_ofst+_n)) - (int32(1) << uint(_ofst)))
119236  	}())
119237  	if _rc != int32(0) {
119238  		goto _14
119239  	}
119240  	if _lockType == int32(2) {
119241  		{
119242  			p := &_pShmNode.XexclMask
119243  			*p = uint8(int32(*p) & (^int32(_2_mask)))
119244  		}
119245  		{
119246  			p := &_pShmNode.XsharedMask
119247  			*p = uint8(int32(*p) & (^int32(_2_mask)))
119248  		}
119249  		goto _18
119250  	}
119251  	if _lockType == int32(0) {
119252  		{
119253  			p := &_pShmNode.XexclMask
119254  			*p = uint8(int32(*p) & (^int32(_2_mask)))
119255  		}
119256  		{
119257  			p := &_pShmNode.XsharedMask
119258  			*p = uint8(int32(*p) | int32(_2_mask))
119259  		}
119260  		goto _18
119261  	}
119262  	func() {
119263  		if _lockType != int32(1) {
119264  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34018), unsafe.Pointer(&_unixShmSystemLockØ00__func__Ø000), unsafe.Pointer(str(133796)))
119265  			crt.X__builtin_abort(tls)
119266  		}
119267  	}()
119268  	{
119269  		p := &_pShmNode.XexclMask
119270  		*p = uint8(int32(*p) | int32(_2_mask))
119271  	}
119272  	{
119273  		p := &_pShmNode.XsharedMask
119274  		*p = uint8(int32(*p) & (^int32(_2_mask)))
119275  	}
119276  _18:
119277  	goto _21
119278  _14:
119279  	if _lockType == int32(2) {
119280  		goto _25
119281  	}
119282  	if _lockType == int32(0) {
119283  		goto _25
119284  	}
119285  	func() {
119286  		if _lockType != int32(1) {
119287  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34029), unsafe.Pointer(&_unixShmSystemLockØ00__func__Ø000), unsafe.Pointer(str(133796)))
119288  			crt.X__builtin_abort(tls)
119289  		}
119290  	}()
119291  _25:
119292  _21:
119293  	return _rc
119294  }
119295  
119296  var _unixShmSystemLockØ00__func__Ø000 [18]int8
119297  
119298  func init() {
119299  	crt.Xstrncpy(nil, &_unixShmSystemLockØ00__func__Ø000[0], str(133814), 18)
119300  }
119301  
119302  // C comment
119303  //  /*
119304  //  ** Purge the unixShmNodeList list of all entries with unixShmNode.nRef==0.
119305  //  **
119306  //  ** This is not a VFS shared-memory method; it is a utility function called
119307  //  ** by VFS shared-memory methods.
119308  //  */
119309  func _unixShmPurge(tls *crt.TLS, _pFd *XunixFile) {
119310  	var _1_nShmPerMap, _1_i int32
119311  	var _p *XunixShmNode
119312  	_p = (*XunixShmNode)((*XunixInodeInfo)(_pFd.XpInode).XpShmNode)
119313  	func() {
119314  		if _unixMutexHeld(tls) == 0 {
119315  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34066), unsafe.Pointer(&_unixShmPurgeØ00__func__Ø000), unsafe.Pointer(str(132022)))
119316  			crt.X__builtin_abort(tls)
119317  		}
119318  	}()
119319  	if _p == nil || func() int32 {
119320  		if _p.XnRef == int32(0) {
119321  			return int32(1)
119322  		}
119323  		return func() int32 {
119324  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34067), unsafe.Pointer(&_unixShmPurgeØ00__func__Ø000), unsafe.Pointer(str(4809)))
119325  			crt.X__builtin_abort(tls)
119326  			return int32(0)
119327  		}()
119328  	}() == 0 {
119329  		goto _5
119330  	}
119331  	_1_nShmPerMap = _unixShmRegionPerMap(tls)
119332  	func() {
119333  		if (*XunixInodeInfo)(_p.XpInode) != (*XunixInodeInfo)(_pFd.XpInode) {
119334  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34070), unsafe.Pointer(&_unixShmPurgeØ00__func__Ø000), unsafe.Pointer(str(133832)))
119335  			crt.X__builtin_abort(tls)
119336  		}
119337  	}()
119338  	Xsqlite3_mutex_free(tls, (*Xsqlite3_mutex)(_p.Xmutex))
119339  	_1_i = int32(0)
119340  _8:
119341  	if _1_i >= int32(_p.XnRegion) {
119342  		goto _11
119343  	}
119344  	if _p.Xh >= int32(0) {
119345  		func() func(*crt.TLS, unsafe.Pointer, uint32) unsafe.Pointer {
119346  			v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(23)).XpCurrent
119347  			return *(*func(*crt.TLS, unsafe.Pointer, uint32) unsafe.Pointer)(unsafe.Pointer(&v))
119348  		}()(tls, unsafe.Pointer(*elem0(_p.XapRegion, uintptr(_1_i))), uint32(_p.XszRegion))
119349  		goto _13
119350  	}
119351  	Xsqlite3_free(tls, unsafe.Pointer(*elem0(_p.XapRegion, uintptr(_1_i))))
119352  _13:
119353  	_1_i += _1_nShmPerMap
119354  	goto _8
119355  _11:
119356  	Xsqlite3_free(tls, unsafe.Pointer(_p.XapRegion))
119357  	if _p.Xh >= int32(0) {
119358  		_robust_close(tls, _pFd, _p.Xh, int32(34081))
119359  		_p.Xh = int32(-1)
119360  	}
119361  	*(**XunixShmNode)(unsafe.Pointer(&((*XunixInodeInfo)(_p.XpInode).XpShmNode))) = nil
119362  	Xsqlite3_free(tls, unsafe.Pointer(_p))
119363  _5:
119364  }
119365  
119366  var _unixShmPurgeØ00__func__Ø000 [13]int8
119367  
119368  func init() {
119369  	crt.Xstrncpy(nil, &_unixShmPurgeØ00__func__Ø000[0], str(133855), 13)
119370  }
119371  
119372  var _unixShmMapØ00__func__Ø000 [11]int8
119373  
119374  func init() {
119375  	crt.Xstrncpy(nil, &_unixShmMapØ00__func__Ø000[0], str(133868), 11)
119376  }
119377  
119378  var _unixShmMapØ00pgszØ001 int32
119379  
119380  func init() {
119381  	_unixShmMapØ00pgszØ001 = int32(4096)
119382  }
119383  
119384  // C comment
119385  //  /*
119386  //  ** Change the lock state for a shared-memory segment.
119387  //  **
119388  //  ** Note that the relationship between SHAREd and EXCLUSIVE locks is a little
119389  //  ** different here than in posix.  In xShmLock(), one can go from unlocked
119390  //  ** to shared and back or from unlocked to exclusive and back.  But one may
119391  //  ** not go from shared to exclusive or from exclusive to shared.
119392  //  */
119393  func _unixShmLock(tls *crt.TLS, _fd *Xsqlite3_file, _ofst int32, _n int32, _flags int32) (r0 int32) {
119394  	var _rc int32
119395  	var _mask, _1_allMask, _6_allShared uint16
119396  	var _pDbFd *XunixFile
119397  	var _pShmNode *XunixShmNode
119398  	var _p, _pX *TunixShm
119399  	_pDbFd = (*XunixFile)(unsafe.Pointer(_fd))
119400  	_p = (*TunixShm)(_pDbFd.XpShm)
119401  	_pShmNode = (*XunixShmNode)(_p.XpShmNode)
119402  	_rc = int32(0)
119403  	func() {
119404  		if _pShmNode != (*XunixShmNode)((*XunixInodeInfo)(_pDbFd.XpInode).XpShmNode) {
119405  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34424), unsafe.Pointer(&_unixShmLockØ00__func__Ø000), unsafe.Pointer(str(133879)))
119406  			crt.X__builtin_abort(tls)
119407  		}
119408  	}()
119409  	func() {
119410  		if (*XunixInodeInfo)(_pShmNode.XpInode) != (*XunixInodeInfo)(_pDbFd.XpInode) {
119411  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34425), unsafe.Pointer(&_unixShmLockØ00__func__Ø000), unsafe.Pointer(str(133443)))
119412  			crt.X__builtin_abort(tls)
119413  		}
119414  	}()
119415  	func() {
119416  		if _ofst < int32(0) || (_ofst+_n) > int32(8) {
119417  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34426), unsafe.Pointer(&_unixShmLockØ00__func__Ø000), unsafe.Pointer(str(133913)))
119418  			crt.X__builtin_abort(tls)
119419  		}
119420  	}()
119421  	func() {
119422  		if _n < int32(1) {
119423  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34427), unsafe.Pointer(&_unixShmLockØ00__func__Ø000), unsafe.Pointer(str(133949)))
119424  			crt.X__builtin_abort(tls)
119425  		}
119426  	}()
119427  	func() {
119428  		if _flags != int32(6) && _flags != int32(10) && _flags != int32(5) && _flags != int32(9) {
119429  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34428), unsafe.Pointer(&_unixShmLockØ00__func__Ø000), unsafe.Pointer(str(133954)))
119430  			crt.X__builtin_abort(tls)
119431  		}
119432  	}()
119433  	func() {
119434  		if _n != int32(1) && (_flags&int32(8)) == int32(0) {
119435  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34432), unsafe.Pointer(&_unixShmLockØ00__func__Ø000), unsafe.Pointer(str(134153)))
119436  			crt.X__builtin_abort(tls)
119437  		}
119438  	}()
119439  	func() {
119440  		if _pShmNode.Xh < int32(0) && int32((*XunixInodeInfo)(_pDbFd.XpInode).XbProcessLock) != int32(1) {
119441  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34433), unsafe.Pointer(&_unixShmLockØ00__func__Ø000), unsafe.Pointer(str(133475)))
119442  			crt.X__builtin_abort(tls)
119443  		}
119444  	}()
119445  	func() {
119446  		if _pShmNode.Xh >= int32(0) && int32((*XunixInodeInfo)(_pDbFd.XpInode).XbProcessLock) != int32(0) {
119447  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34434), unsafe.Pointer(&_unixShmLockØ00__func__Ø000), unsafe.Pointer(str(133524)))
119448  			crt.X__builtin_abort(tls)
119449  		}
119450  	}()
119451  	_mask = uint16((int32(1) << uint(_ofst+_n)) - (int32(1) << uint(_ofst)))
119452  	func() {
119453  		if _n <= int32(1) && int32(_mask) != (int32(1)<<uint(_ofst)) {
119454  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34437), unsafe.Pointer(&_unixShmLockØ00__func__Ø000), unsafe.Pointer(str(134195)))
119455  			crt.X__builtin_abort(tls)
119456  		}
119457  	}()
119458  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pShmNode.Xmutex))
119459  	if (_flags & int32(1)) == 0 {
119460  		goto _26
119461  	}
119462  	_1_allMask = uint16(0)
119463  	_pX = (*TunixShm)(_pShmNode.XpFirst)
119464  _27:
119465  	if _pX == nil {
119466  		goto _30
119467  	}
119468  	if _pX == _p {
119469  		goto _28
119470  	}
119471  	func() {
119472  		if (int32(_pX.XexclMask) & (int32(_p.XexclMask) | int32(_p.XsharedMask))) != int32(0) {
119473  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34445), unsafe.Pointer(&_unixShmLockØ00__func__Ø000), unsafe.Pointer(str(134218)))
119474  			crt.X__builtin_abort(tls)
119475  		}
119476  	}()
119477  	{
119478  		p := &_1_allMask
119479  		*p = uint16(int32(*p) | int32(_pX.XsharedMask))
119480  	}
119481  _28:
119482  	_pX = (*TunixShm)(_pX.XpNext)
119483  	goto _27
119484  _30:
119485  	if (int32(_mask) & int32(_1_allMask)) == int32(0) {
119486  		_rc = _unixShmSystemLock(tls, _pDbFd, int32(2), _ofst+int32(120), _n)
119487  		goto _35
119488  	}
119489  	_rc = int32(0)
119490  _35:
119491  	if _rc == int32(0) {
119492  		{
119493  			p := &_p.XexclMask
119494  			*p = uint16(int32(*p) & (^int32(_mask)))
119495  		}
119496  		{
119497  			p := &_p.XsharedMask
119498  			*p = uint16(int32(*p) & (^int32(_mask)))
119499  		}
119500  	}
119501  	goto _48
119502  _26:
119503  	if (_flags & int32(4)) == 0 {
119504  		goto _38
119505  	}
119506  	_6_allShared = uint16(0)
119507  	_pX = (*TunixShm)(_pShmNode.XpFirst)
119508  _39:
119509  	if _pX == nil {
119510  		goto _42
119511  	}
119512  	if (int32(_pX.XexclMask) & int32(_mask)) != int32(0) {
119513  		_rc = int32(5)
119514  		goto _42
119515  	}
119516  	{
119517  		p := &_6_allShared
119518  		*p = uint16(int32(*p) | int32(_pX.XsharedMask))
119519  	}
119520  	_pX = (*TunixShm)(_pX.XpNext)
119521  	goto _39
119522  _42:
119523  	if _rc != int32(0) {
119524  		goto _44
119525  	}
119526  	if (int32(_6_allShared) & int32(_mask)) == int32(0) {
119527  		_rc = _unixShmSystemLock(tls, _pDbFd, int32(0), _ofst+int32(120), _n)
119528  		goto _46
119529  	}
119530  	_rc = int32(0)
119531  _46:
119532  _44:
119533  	if _rc == int32(0) {
119534  		{
119535  			p := &_p.XsharedMask
119536  			*p = uint16(int32(*p) | int32(_mask))
119537  		}
119538  	}
119539  	goto _48
119540  _38:
119541  	_pX = (*TunixShm)(_pShmNode.XpFirst)
119542  _49:
119543  	if _pX == nil {
119544  		goto _52
119545  	}
119546  	if ((int32(_pX.XexclMask) & int32(_mask)) != int32(0)) || ((int32(_pX.XsharedMask) & int32(_mask)) != int32(0)) {
119547  		_rc = int32(5)
119548  		goto _52
119549  	}
119550  	_pX = (*TunixShm)(_pX.XpNext)
119551  	goto _49
119552  _52:
119553  	if _rc != int32(0) {
119554  		goto _55
119555  	}
119556  	_rc = _unixShmSystemLock(tls, _pDbFd, int32(1), _ofst+int32(120), _n)
119557  	if _rc == int32(0) {
119558  		func() {
119559  			if (int32(_p.XsharedMask) & int32(_mask)) != int32(0) {
119560  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34506), unsafe.Pointer(&_unixShmLockØ00__func__Ø000), unsafe.Pointer(str(134266)))
119561  				crt.X__builtin_abort(tls)
119562  			}
119563  		}()
119564  		{
119565  			p := &_p.XexclMask
119566  			*p = uint16(int32(*p) | int32(_mask))
119567  		}
119568  	}
119569  _55:
119570  _48:
119571  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pShmNode.Xmutex))
119572  	return _rc
119573  }
119574  
119575  var _unixShmLockØ00__func__Ø000 [12]int8
119576  
119577  func init() {
119578  	crt.Xstrncpy(nil, &_unixShmLockØ00__func__Ø000[0], str(134292), 12)
119579  }
119580  
119581  // C comment
119582  //  /*
119583  //  ** Implement a memory barrier or memory fence on shared memory.
119584  //  **
119585  //  ** All loads and stores begun before the barrier must complete before
119586  //  ** any load or store begun after the barrier.
119587  //  */
119588  func _unixShmBarrier(tls *crt.TLS, _fd *Xsqlite3_file) {
119589  	_sqlite3MemoryBarrier(tls)
119590  	_unixEnterMutex(tls)
119591  	_unixLeaveMutex(tls)
119592  }
119593  
119594  // C comment
119595  //  /*
119596  //  ** Close a connection to shared-memory.  Delete the underlying
119597  //  ** storage if deleteFlag is true.
119598  //  **
119599  //  ** If there is no shared memory associated with the connection then this
119600  //  ** routine is a harmless no-op.
119601  //  */
119602  func _unixShmUnmap(tls *crt.TLS, _fd *Xsqlite3_file, _deleteFlag int32) (r0 int32) {
119603  	var _pDbFd *XunixFile
119604  	var _pShmNode *XunixShmNode
119605  	var _p *TunixShm
119606  	var _pp **TunixShm
119607  	_pDbFd = (*XunixFile)(unsafe.Pointer(_fd))
119608  	_p = (*TunixShm)(_pDbFd.XpShm)
119609  	if _p == nil {
119610  		return int32(0)
119611  	}
119612  	_pShmNode = (*XunixShmNode)(_p.XpShmNode)
119613  	func() {
119614  		if _pShmNode != (*XunixShmNode)((*XunixInodeInfo)(_pDbFd.XpInode).XpShmNode) {
119615  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34553), unsafe.Pointer(&_unixShmUnmapØ00__func__Ø000), unsafe.Pointer(str(133879)))
119616  			crt.X__builtin_abort(tls)
119617  		}
119618  	}()
119619  	func() {
119620  		if (*XunixInodeInfo)(_pShmNode.XpInode) != (*XunixInodeInfo)(_pDbFd.XpInode) {
119621  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34554), unsafe.Pointer(&_unixShmUnmapØ00__func__Ø000), unsafe.Pointer(str(133443)))
119622  			crt.X__builtin_abort(tls)
119623  		}
119624  	}()
119625  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pShmNode.Xmutex))
119626  	_pp = (**TunixShm)(unsafe.Pointer(&_pShmNode.XpFirst))
119627  _5:
119628  	if (*_pp) == _p {
119629  		goto _8
119630  	}
119631  	_pp = (**TunixShm)(unsafe.Pointer(&((*_pp).XpNext)))
119632  	goto _5
119633  _8:
119634  	*_pp = (*TunixShm)(_p.XpNext)
119635  	Xsqlite3_free(tls, unsafe.Pointer(_p))
119636  	*(**TunixShm)(unsafe.Pointer(&_pDbFd.XpShm)) = nil
119637  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pShmNode.Xmutex))
119638  	_unixEnterMutex(tls)
119639  	func() {
119640  		if _pShmNode.XnRef <= int32(0) {
119641  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34570), unsafe.Pointer(&_unixShmUnmapØ00__func__Ø000), unsafe.Pointer(str(134304)))
119642  			crt.X__builtin_abort(tls)
119643  		}
119644  	}()
119645  	_pShmNode.XnRef -= 1
119646  	if _pShmNode.XnRef != int32(0) {
119647  		goto _11
119648  	}
119649  	if _deleteFlag != 0 && (_pShmNode.Xh >= int32(0)) {
119650  		func() func(*crt.TLS, *int8) int32 {
119651  			v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(16)).XpCurrent
119652  			return *(*func(*crt.TLS, *int8) int32)(unsafe.Pointer(&v))
119653  		}()(tls, _pShmNode.XzFilename)
119654  	}
119655  	_unixShmPurge(tls, _pDbFd)
119656  _11:
119657  	_unixLeaveMutex(tls)
119658  	return int32(0)
119659  }
119660  
119661  var _unixShmUnmapØ00__func__Ø000 [13]int8
119662  
119663  func init() {
119664  	crt.Xstrncpy(nil, &_unixShmUnmapØ00__func__Ø000[0], str(134321), 13)
119665  }
119666  
119667  // C comment
119668  //  /*
119669  //  ** If possible, return a pointer to a mapping of file fd starting at offset
119670  //  ** iOff. The mapping must be valid for at least nAmt bytes.
119671  //  **
119672  //  ** If such a pointer can be obtained, store it in *pp and return SQLITE_OK.
119673  //  ** Or, if one cannot but no error occurs, set *pp to 0 and return SQLITE_OK.
119674  //  ** Finally, if an error does occur, return an SQLite error code. The final
119675  //  ** value of *pp is undefined in this case.
119676  //  **
119677  //  ** If this function does return a pointer, the caller must eventually
119678  //  ** release the reference by calling unixUnfetch().
119679  //  */
119680  func _unixFetch(tls *crt.TLS, _fd *Xsqlite3_file, _iOff int64, _nAmt int32, _pp *unsafe.Pointer) (r0 int32) {
119681  	var _2_rc int32
119682  	var _pFd *XunixFile
119683  	_pFd = (*XunixFile)(unsafe.Pointer(_fd))
119684  	*_pp = nil
119685  	if _pFd.XmmapSizeMax <= (0) {
119686  		goto _0
119687  	}
119688  	if _pFd.XpMapRegion != nil {
119689  		goto _1
119690  	}
119691  	_2_rc = _unixMapfile(tls, _pFd, int64(-1))
119692  	if _2_rc != int32(0) {
119693  		return _2_rc
119694  	}
119695  _1:
119696  	if _pFd.XmmapSize >= (_iOff + int64(_nAmt)) {
119697  		*_pp = unsafe.Pointer(elem15((*uint8)(_pFd.XpMapRegion), uintptr(_iOff)))
119698  		_pFd.XnFetchOut += 1
119699  	}
119700  _0:
119701  	return int32(0)
119702  }
119703  
119704  // C comment
119705  //  /*
119706  //  ** If the third argument is non-NULL, then this function releases a
119707  //  ** reference obtained by an earlier call to unixFetch(). The second
119708  //  ** argument passed to this function must be the same as the corresponding
119709  //  ** argument that was passed to the unixFetch() invocation.
119710  //  **
119711  //  ** Or, if the third argument is NULL, then this function is being called
119712  //  ** to inform the VFS layer that, according to POSIX, any existing mapping
119713  //  ** may now be invalid and should be unmapped.
119714  //  */
119715  func _unixUnfetch(tls *crt.TLS, _fd *Xsqlite3_file, _iOff int64, _p unsafe.Pointer) (r0 int32) {
119716  	var _pFd *XunixFile
119717  	_pFd = (*XunixFile)(unsafe.Pointer(_fd))
119718  
119719  	func() {
119720  		if (_p == nil) != (_pFd.XnFetchOut == int32(0)) {
119721  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34788), unsafe.Pointer(&_unixUnfetchØ00__func__Ø000), unsafe.Pointer(str(134334)))
119722  			crt.X__builtin_abort(tls)
119723  		}
119724  	}()
119725  	func() {
119726  		if _p != nil && _p != unsafe.Pointer(elem15((*uint8)(_pFd.XpMapRegion), uintptr(_iOff))) {
119727  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34791), unsafe.Pointer(&_unixUnfetchØ00__func__Ø000), unsafe.Pointer(str(134362)))
119728  			crt.X__builtin_abort(tls)
119729  		}
119730  	}()
119731  	if _p != nil {
119732  		_pFd.XnFetchOut -= 1
119733  		goto _6
119734  	}
119735  	_unixUnmapfile(tls, _pFd)
119736  _6:
119737  	func() {
119738  		if _pFd.XnFetchOut < int32(0) {
119739  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(34799), unsafe.Pointer(&_unixUnfetchØ00__func__Ø000), unsafe.Pointer(str(134404)))
119740  			crt.X__builtin_abort(tls)
119741  		}
119742  	}()
119743  	return int32(0)
119744  }
119745  
119746  var _unixUnfetchØ00__func__Ø000 [12]int8
119747  
119748  func init() {
119749  	crt.Xstrncpy(nil, &_unixUnfetchØ00__func__Ø000[0], str(134422), 12)
119750  }
119751  
119752  // C comment
119753  //  /*
119754  //  ** Open the file zPath.
119755  //  **
119756  //  ** Previously, the SQLite OS layer used three functions in place of this
119757  //  ** one:
119758  //  **
119759  //  **     sqlite3OsOpenReadWrite();
119760  //  **     sqlite3OsOpenReadOnly();
119761  //  **     sqlite3OsOpenExclusive();
119762  //  **
119763  //  ** These calls correspond to the following combinations of flags:
119764  //  **
119765  //  **     ReadWrite() ->     (READWRITE | CREATE)
119766  //  **     ReadOnly()  ->     (READONLY)
119767  //  **     OpenExclusive() -> (READWRITE | CREATE | EXCLUSIVE)
119768  //  **
119769  //  ** The old OpenExclusive() accepted a boolean argument - "delFlag". If
119770  //  ** true, the file was configured to be automatically deleted when the
119771  //  ** file handle closed. To achieve the same effect using this new
119772  //  ** interface, add the DELETEONCLOSE flag to those specified above for
119773  //  ** OpenExclusive().
119774  //  */
119775  func _unixOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _pFile *Xsqlite3_file, _flags int32, _pOutFlags *int32) (r0 int32) {
119776  	var _fd, _openFlags, _eType, _noLock, _rc, _ctrlFlags, _isExclusive, _isDelete, _isCreate, _isReadonly, _isReadWrite, _syncDir int32
119777  	var _8_openMode, _8_uid, _8_gid uint32
119778  	var _zName *int8
119779  	var _p *XunixFile
119780  	var _2_pUnused *XUnixUnusedFd
119781  	var _zTmpname [514]int8
119782  	_p = (*XunixFile)(unsafe.Pointer(_pFile))
119783  	_fd = int32(-1)
119784  	_openFlags = int32(0)
119785  	_eType = int32(uint32(_flags) & uint32(4294967040))
119786  	_rc = int32(0)
119787  	_ctrlFlags = int32(0)
119788  	_isExclusive = _flags & int32(16)
119789  	_isDelete = _flags & int32(8)
119790  	_isCreate = _flags & int32(4)
119791  	_isReadonly = _flags & int32(1)
119792  	_isReadWrite = _flags & int32(2)
119793  	_syncDir = bool2int(_isCreate != 0 && (((_eType == int32(16384)) || (_eType == int32(2048))) || (_eType == int32(524288))))
119794  	_zName = _zPath
119795  	func() {
119796  		if _isReadonly != int32(0) && _isReadWrite != int32(0) || _isReadWrite == 0 && _isReadonly == 0 {
119797  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35597), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(134434)))
119798  			crt.X__builtin_abort(tls)
119799  		}
119800  	}()
119801  	func() {
119802  		if _isCreate != int32(0) && _isReadWrite == 0 {
119803  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35598), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(134499)))
119804  			crt.X__builtin_abort(tls)
119805  		}
119806  	}()
119807  	func() {
119808  		if _isExclusive != int32(0) && _isCreate == 0 {
119809  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35599), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(134526)))
119810  			crt.X__builtin_abort(tls)
119811  		}
119812  	}()
119813  	func() {
119814  		if _isDelete != int32(0) && _isCreate == 0 {
119815  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35600), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(134553)))
119816  			crt.X__builtin_abort(tls)
119817  		}
119818  	}()
119819  	func() {
119820  		if (_isDelete != 0 || _zName == nil) && _eType == int32(256) {
119821  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35604), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(134577)))
119822  			crt.X__builtin_abort(tls)
119823  		}
119824  	}()
119825  	func() {
119826  		if (_isDelete != 0 || _zName == nil) && _eType == int32(2048) {
119827  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35605), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(134628)))
119828  			crt.X__builtin_abort(tls)
119829  		}
119830  	}()
119831  	func() {
119832  		if (_isDelete != 0 || _zName == nil) && _eType == int32(16384) {
119833  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35606), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(134684)))
119834  			crt.X__builtin_abort(tls)
119835  		}
119836  	}()
119837  	func() {
119838  		if (_isDelete != 0 || _zName == nil) && _eType == int32(524288) {
119839  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35607), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(134742)))
119840  			crt.X__builtin_abort(tls)
119841  		}
119842  	}()
119843  	func() {
119844  		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) {
119845  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35610), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(134789)))
119846  			crt.X__builtin_abort(tls)
119847  		}
119848  	}()
119849  	if _randomnessPid != crt.Xgetpid(tls) {
119850  		_randomnessPid = crt.Xgetpid(tls)
119851  		bug20530(_randomnessPid)
119852  		Xsqlite3_randomness(tls, int32(0), nil)
119853  	}
119854  	crt.Xmemset(tls, unsafe.Pointer(_p), int32(0), uint32(80))
119855  	if _eType != int32(256) {
119856  		goto _43
119857  	}
119858  	_2_pUnused = _findReusableFd(tls, _zName, _flags)
119859  	if _2_pUnused != nil {
119860  		_fd = _2_pUnused.Xfd
119861  		goto _45
119862  	}
119863  	_2_pUnused = (*XUnixUnusedFd)(Xsqlite3_malloc64(tls, uint64(12)))
119864  	if _2_pUnused == nil {
119865  		return _sqlite3NomemError(tls, int32(35636))
119866  	}
119867  _45:
119868  	*(**XUnixUnusedFd)(unsafe.Pointer(&_p.XpUnused)) = _2_pUnused
119869  	func() {
119870  		if (_flags&int32(64)) == 0 && int32(*elem1(_zName, uintptr(crt.Xstrlen(tls, _zName)+uint32(1)))) != int32(0) {
119871  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35644), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(135047)))
119872  			crt.X__builtin_abort(tls)
119873  		}
119874  	}()
119875  	goto _51
119876  _43:
119877  	if _zName != nil {
119878  		goto _51
119879  	}
119880  	func() {
119881  		if _isDelete == 0 || _syncDir != 0 {
119882  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35648), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(135102)))
119883  			crt.X__builtin_abort(tls)
119884  		}
119885  	}()
119886  	_rc = _unixGetTempname(tls, _pVfs.XmxPathname, (*int8)(unsafe.Pointer(&_zTmpname)))
119887  	if _rc != int32(0) {
119888  		return _rc
119889  	}
119890  	_zName = (*int8)(unsafe.Pointer(&_zTmpname))
119891  	func() {
119892  		if int32(*elem1(_zName, uintptr(crt.Xstrlen(tls, _zName)+uint32(1)))) != int32(0) {
119893  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35657), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(135123)))
119894  			crt.X__builtin_abort(tls)
119895  		}
119896  	}()
119897  _51:
119898  	if _isReadonly != 0 {
119899  		_openFlags |= int32(0)
119900  	}
119901  	if _isReadWrite != 0 {
119902  		_openFlags |= int32(2)
119903  	}
119904  	if _isCreate != 0 {
119905  		_openFlags |= int32(64)
119906  	}
119907  	if _isExclusive != 0 {
119908  		_openFlags |= int32(128)
119909  	}
119910  	_openFlags |= int32(32768)
119911  	if _fd >= int32(0) {
119912  		goto _62
119913  	}
119914  	_rc = _findCreateFileMode(tls, _zName, _flags, &_8_openMode, &_8_uid, &_8_gid)
119915  	if _rc != int32(0) {
119916  		func() {
119917  			if _p.XpUnused != nil {
119918  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35676), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(135149)))
119919  				crt.X__builtin_abort(tls)
119920  			}
119921  		}()
119922  		func() {
119923  			if _eType != int32(524288) && _eType != int32(2048) {
119924  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35677), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(135161)))
119925  				crt.X__builtin_abort(tls)
119926  			}
119927  		}()
119928  		return _rc
119929  	}
119930  	_fd = _robust_open(tls, _zName, _openFlags, _8_openMode)
119931  	func() {
119932  		if _isExclusive != 0 && (_openFlags&int32(64)) == int32(0) {
119933  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35682), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(135219)))
119934  			crt.X__builtin_abort(tls)
119935  		}
119936  	}()
119937  	if ((_fd < int32(0)) && ((*crt.X__errno_location(tls)) != int32(21))) && _isReadWrite != 0 {
119938  		_flags &= int32(-7)
119939  		_openFlags &= int32(-67)
119940  		_flags |= int32(1)
119941  		_openFlags |= int32(0)
119942  		_isReadonly = int32(1)
119943  		_fd = _robust_open(tls, _zName, _openFlags, _8_openMode)
119944  	}
119945  	if _fd < int32(0) {
119946  		_rc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(35693)), str(131517), _zName, int32(35693))
119947  		goto _open_finished
119948  	}
119949  	if (_flags & int32(526336)) != 0 {
119950  		_robustFchown(tls, _fd, _8_uid, _8_gid)
119951  	}
119952  _62:
119953  	func() {
119954  		if _fd < int32(0) {
119955  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35705), unsafe.Pointer(&_unixOpenØ00__func__Ø000), unsafe.Pointer(str(135260)))
119956  			crt.X__builtin_abort(tls)
119957  		}
119958  	}()
119959  	if _pOutFlags != nil {
119960  		*_pOutFlags = _flags
119961  	}
119962  	if _p.XpUnused != nil {
119963  		(*XUnixUnusedFd)(_p.XpUnused).Xfd = _fd
119964  		(*XUnixUnusedFd)(_p.XpUnused).Xflags = _flags
119965  	}
119966  	if _isDelete != 0 {
119967  		func() func(*crt.TLS, *int8) int32 {
119968  			v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(16)).XpCurrent
119969  			return *(*func(*crt.TLS, *int8) int32)(unsafe.Pointer(&v))
119970  		}()(tls, _zName)
119971  	}
119972  	if _isDelete != 0 {
119973  		_ctrlFlags |= int32(32)
119974  	}
119975  	if _isReadonly != 0 {
119976  		_ctrlFlags |= int32(2)
119977  	}
119978  	_noLock = bool2int(_eType != int32(256))
119979  	if _noLock != 0 {
119980  		_ctrlFlags |= int32(128)
119981  	}
119982  	if _syncDir != 0 {
119983  		_ctrlFlags |= int32(8)
119984  	}
119985  	if (_flags & int32(64)) != 0 {
119986  		_ctrlFlags |= int32(64)
119987  	}
119988  	_rc = _fillInUnixFile(tls, _pVfs, _fd, _pFile, _zPath, _ctrlFlags)
119989  _open_finished:
119990  	if _rc != int32(0) {
119991  		Xsqlite3_free(tls, _p.XpUnused)
119992  	}
119993  	return _rc
119994  
119995  	_ = _zTmpname
119996  	panic(0)
119997  }
119998  
119999  var _unixOpenØ00__func__Ø000 [9]int8
120000  
120001  func init() {
120002  	crt.Xstrncpy(nil, &_unixOpenØ00__func__Ø000[0], str(135266), 9)
120003  }
120004  
120005  // C comment
120006  //  /* This variable holds the process id (pid) from when the xRandomness()
120007  //  ** method was called.  If xOpen() is called from a different process id,
120008  //  ** indicating that a fork() has occurred, the PRNG will be reset.
120009  //  */
120010  var _randomnessPid int32
120011  
120012  // C comment
120013  //  /*
120014  //  ** Search for an unused file descriptor that was opened on the database
120015  //  ** file (not a journal or master-journal file) identified by pathname
120016  //  ** zPath with SQLITE_OPEN_XXX flags matching those passed as the second
120017  //  ** argument to this function.
120018  //  **
120019  //  ** Such a file descriptor may exist if a database connection was closed
120020  //  ** but the associated file descriptor could not be closed because some
120021  //  ** other file descriptor open on the same file is holding a file-lock.
120022  //  ** Refer to comments in the unixClose() function and the lengthy comment
120023  //  ** describing "Posix Advisory Locking" at the start of this file for
120024  //  ** further details. Also, ticket #4018.
120025  //  **
120026  //  ** If a suitable file descriptor is found, then it is returned. If no
120027  //  ** such file descriptor is located, -1 is returned.
120028  //  */
120029  func _findReusableFd(tls *crt.TLS, _zPath *int8, _flags int32) (r0 *XUnixUnusedFd) {
120030  	var _sStat crt.Xstruct_stat64
120031  	var _1_pInode *XunixInodeInfo
120032  	var _pUnused *XUnixUnusedFd
120033  	var _3_pp **XUnixUnusedFd
120034  	_pUnused = nil
120035  	if int32(0) != func() func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32 {
120036  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(4)).XpCurrent
120037  		return *(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
120038  	}()(tls, _zPath, &_sStat) {
120039  		goto _0
120040  	}
120041  	_unixEnterMutex(tls)
120042  	_1_pInode = _inodeList
120043  _1:
120044  	if (_1_pInode != nil) && (((_1_pInode.XfileId.Xdev) != _sStat.Xst_dev) || ((_1_pInode.XfileId.Xino) != _sStat.Xst_ino)) {
120045  		_1_pInode = (*XunixInodeInfo)(_1_pInode.XpNext)
120046  		goto _1
120047  	}
120048  	if _1_pInode == nil {
120049  		goto _5
120050  	}
120051  	_3_pp = (**XUnixUnusedFd)(unsafe.Pointer(&_1_pInode.XpUnused))
120052  _6:
120053  	if (*_3_pp) == nil || ((*_3_pp).Xflags) == _flags {
120054  		goto _10
120055  	}
120056  	_3_pp = (**XUnixUnusedFd)(unsafe.Pointer(&((*_3_pp).XpNext)))
120057  	goto _6
120058  _10:
120059  	_pUnused = *_3_pp
120060  	if _pUnused != nil {
120061  		*_3_pp = (*XUnixUnusedFd)(_pUnused.XpNext)
120062  	}
120063  _5:
120064  	_unixLeaveMutex(tls)
120065  _0:
120066  	return _pUnused
120067  }
120068  
120069  // C comment
120070  //  /*
120071  //  ** This function is called by unixOpen() to determine the unix permissions
120072  //  ** to create new files with. If no error occurs, then SQLITE_OK is returned
120073  //  ** and a value suitable for passing as the third argument to open(2) is
120074  //  ** written to *pMode. If an IO error occurs, an SQLite error code is
120075  //  ** returned and the value of *pMode is not modified.
120076  //  **
120077  //  ** In most cases, this routine sets *pMode to 0, which will become
120078  //  ** an indication to robust_open() to create the file using
120079  //  ** SQLITE_DEFAULT_FILE_PERMISSIONS adjusted by the umask.
120080  //  ** But if the file being opened is a WAL or regular journal file, then
120081  //  ** this function queries the file-system for the permissions on the
120082  //  ** corresponding database file and sets *pMode to this value. Whenever
120083  //  ** possible, WAL and journal files are created using the same permissions
120084  //  ** as the associated database file.
120085  //  **
120086  //  ** If the SQLITE_ENABLE_8_3_NAMES option is enabled, then the
120087  //  ** original filename is unavailable.  But 8_3_NAMES is only used for
120088  //  ** FAT filesystems and permissions do not matter there, so just use
120089  //  ** the default permissions.
120090  //  */
120091  func _findCreateFileMode(tls *crt.TLS, _zPath *int8, _flags int32, _pMode *uint32, _pUid *uint32, _pGid *uint32) (r0 int32) {
120092  	var _rc, _1_nDb int32
120093  	var _4_z *int8
120094  	var _1_zDb [513]int8
120095  	_rc = int32(0)
120096  	*_pMode = 0
120097  	*_pUid = 0
120098  	*_pGid = 0
120099  	if (_flags & int32(526336)) == 0 {
120100  		goto _0
120101  	}
120102  	_1_nDb = _sqlite3Strlen30(tls, _zPath) - int32(1)
120103  _1:
120104  	if int32(*elem1(_zPath, uintptr(_1_nDb))) != int32(45) {
120105  		func() {
120106  			if _1_nDb <= int32(0) {
120107  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35497), unsafe.Pointer(&_findCreateFileModeØ00__func__Ø000), unsafe.Pointer(str(135275)))
120108  				crt.X__builtin_abort(tls)
120109  			}
120110  		}()
120111  		func() {
120112  			if (int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(uint8(*elem1(_zPath, uintptr(_1_nDb)))))) & int32(6)) == 0 {
120113  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35498), unsafe.Pointer(&_findCreateFileModeØ00__func__Ø000), unsafe.Pointer(str(135281)))
120114  				crt.X__builtin_abort(tls)
120115  			}
120116  		}()
120117  		_1_nDb -= 1
120118  		goto _1
120119  	}
120120  	crt.Xmemcpy(tls, unsafe.Pointer(&_1_zDb), unsafe.Pointer(_zPath), uint32(_1_nDb))
120121  	*elem1((*int8)(unsafe.Pointer(&_1_zDb)), uintptr(_1_nDb)) = 0
120122  	_rc = _getFileMode(tls, (*int8)(unsafe.Pointer(&_1_zDb)), _pMode, _pUid, _pGid)
120123  	goto _10
120124  _0:
120125  	if (_flags & int32(8)) != 0 {
120126  		*_pMode = uint32(384)
120127  		goto _10
120128  	}
120129  	if (_flags & int32(64)) == 0 {
120130  		goto _10
120131  	}
120132  	_4_z = Xsqlite3_uri_parameter(tls, _zPath, str(135308))
120133  	if _4_z != nil {
120134  		_rc = _getFileMode(tls, _4_z, _pMode, _pUid, _pGid)
120135  	}
120136  _10:
120137  	return _rc
120138  
120139  	_ = _1_zDb
120140  	panic(0)
120141  }
120142  
120143  var _findCreateFileModeØ00__func__Ø000 [19]int8
120144  
120145  func init() {
120146  	crt.Xstrncpy(nil, &_findCreateFileModeØ00__func__Ø000[0], str(135315), 19)
120147  }
120148  
120149  // C comment
120150  //  /*
120151  //  ** Find the mode, uid and gid of file zFile.
120152  //  */
120153  func _getFileMode(tls *crt.TLS, _zFile *int8, _pMode *uint32, _pUid *uint32, _pGid *uint32) (r0 int32) {
120154  	var _rc int32
120155  	var _sStat crt.Xstruct_stat64
120156  	_rc = int32(0)
120157  	if int32(0) == func() func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32 {
120158  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(4)).XpCurrent
120159  		return *(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
120160  	}()(tls, _zFile, &_sStat) {
120161  		*_pMode = _sStat.Xst_mode & uint32(511)
120162  		*_pUid = _sStat.Xst_uid
120163  		*_pGid = _sStat.Xst_gid
120164  		goto _1
120165  	}
120166  	_rc = int32(1802)
120167  _1:
120168  	return _rc
120169  }
120170  
120171  // C comment
120172  //  /*
120173  //  ** Initialize the contents of the unixFile structure pointed to by pId.
120174  //  */
120175  func _fillInUnixFile(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _h int32, _pId *Xsqlite3_file, _zFilename *int8, _ctrlFlags int32) (r0 int32) {
120176  	var _rc, _7_nFilename int32
120177  	var _7_zLockFile *int8
120178  	var _pLockingStyle *Xsqlite3_io_methods
120179  	var _pNew *XunixFile
120180  	_pNew = (*XunixFile)(unsafe.Pointer(_pId))
120181  	_rc = int32(0)
120182  	func() {
120183  		if (*XunixInodeInfo)(_pNew.XpInode) != nil {
120184  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35121), unsafe.Pointer(&_fillInUnixFileØ00__func__Ø000), unsafe.Pointer(str(135334)))
120185  			crt.X__builtin_abort(tls)
120186  		}
120187  	}()
120188  	func() {
120189  		if _zFilename != nil && int32(*elem1(_zFilename, 0)) != int32(47) {
120190  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35131), unsafe.Pointer(&_fillInUnixFileØ00__func__Ø000), unsafe.Pointer(str(135353)))
120191  			crt.X__builtin_abort(tls)
120192  		}
120193  	}()
120194  	func() {
120195  		if _zFilename == nil && (_ctrlFlags&int32(128)) == int32(0) {
120196  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35135), unsafe.Pointer(&_fillInUnixFileØ00__func__Ø000), unsafe.Pointer(str(135387)))
120197  			crt.X__builtin_abort(tls)
120198  		}
120199  	}()
120200  	_pNew.Xh = _h
120201  	*(**Xsqlite3_vfs)(unsafe.Pointer(&_pNew.XpVfs)) = _pVfs
120202  	_pNew.XzPath = _zFilename
120203  	_pNew.XctrlFlags = uint16(uint8(_ctrlFlags))
120204  	_pNew.XmmapSizeMax = _sqlite3Config.XszMmap
120205  	if Xsqlite3_uri_boolean(tls, func() *int8 {
120206  		if (_ctrlFlags & int32(64)) != 0 {
120207  			return _zFilename
120208  		}
120209  		return nil
120210  	}(), str(135436), int32(1)) != 0 {
120211  		{
120212  			p := &_pNew.XctrlFlags
120213  			*p = uint16(int32(*p) | int32(16))
120214  		}
120215  	}
120216  	if crt.Xstrcmp(tls, _pVfs.XzName, str(131342)) == int32(0) {
120217  		{
120218  			p := &_pNew.XctrlFlags
120219  			*p = uint16(int32(*p) | int32(1))
120220  		}
120221  	}
120222  	if (_ctrlFlags & int32(128)) != 0 {
120223  		_pLockingStyle = &_nolockIoMethods
120224  		goto _13
120225  	}
120226  	_pLockingStyle = (*(*func(*crt.TLS, *int8, *XunixFile) *Xsqlite3_io_methods)(_pVfs.XpAppData))(tls, _zFilename, _pNew)
120227  _13:
120228  	if _pLockingStyle != &_posixIoMethods {
120229  		goto _14
120230  	}
120231  	_unixEnterMutex(tls)
120232  	_rc = _findInodeInfo(tls, _pNew, (**XunixInodeInfo)(unsafe.Pointer(&_pNew.XpInode)))
120233  	if _rc != int32(0) {
120234  		_robust_close(tls, _pNew, _h, int32(35199))
120235  		_h = int32(-1)
120236  	}
120237  	_unixLeaveMutex(tls)
120238  	goto _17
120239  _14:
120240  	if _pLockingStyle != &_dotlockIoMethods {
120241  		goto _17
120242  	}
120243  	func() {
120244  		if _zFilename == nil {
120245  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35239), unsafe.Pointer(&_fillInUnixFileØ00__func__Ø000), unsafe.Pointer(str(135441)))
120246  			crt.X__builtin_abort(tls)
120247  		}
120248  	}()
120249  	_7_nFilename = int32(crt.Xstrlen(tls, _zFilename)) + int32(6)
120250  	_7_zLockFile = (*int8)(Xsqlite3_malloc64(tls, uint64(_7_nFilename)))
120251  	if _7_zLockFile == nil {
120252  		_rc = _sqlite3NomemError(tls, int32(35243))
120253  		goto _21
120254  	}
120255  	Xsqlite3_snprintf(tls, _7_nFilename, _7_zLockFile, str(135454), unsafe.Pointer(_zFilename))
120256  _21:
120257  	_pNew.XlockingContext = unsafe.Pointer(_7_zLockFile)
120258  _17:
120259  	_storeLastErrno(tls, _pNew, int32(0))
120260  	if _rc == int32(0) {
120261  		goto _22
120262  	}
120263  	if _h >= int32(0) {
120264  		_robust_close(tls, _pNew, _h, int32(35284))
120265  	}
120266  	goto _24
120267  _22:
120268  	*(**Xsqlite3_io_methods)(unsafe.Pointer(&_pNew.XpMethod)) = _pLockingStyle
120269  	_verifyDbFile(tls, _pNew)
120270  _24:
120271  	return _rc
120272  }
120273  
120274  var _fillInUnixFileØ00__func__Ø000 [15]int8
120275  
120276  func init() {
120277  	crt.Xstrncpy(nil, &_fillInUnixFileØ00__func__Ø000[0], str(135462), 15)
120278  }
120279  
120280  var _nolockIoMethods Xsqlite3_io_methods
120281  
120282  func init() {
120283  	_nolockIoMethods = Xsqlite3_io_methods{XiVersion: int32(3), XxClose: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
120284  		f func(*crt.TLS, *Xsqlite3_file) int32
120285  	}{_nolockClose})), XxRead: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
120286  		f func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32
120287  	}{_unixRead})), XxWrite: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
120288  		f func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32
120289  	}{_unixWrite})), XxTruncate: *(*func(*crt.TLS, unsafe.Pointer, int64) int32)(unsafe.Pointer(&struct {
120290  		f func(*crt.TLS, *Xsqlite3_file, int64) int32
120291  	}{_unixTruncate})), XxSync: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
120292  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
120293  	}{_unixSync})), XxFileSize: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
120294  		f func(*crt.TLS, *Xsqlite3_file, *int64) int32
120295  	}{_unixFileSize})), XxLock: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
120296  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
120297  	}{_nolockLock})), XxUnlock: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
120298  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
120299  	}{_nolockUnlock})), XxCheckReservedLock: *(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer(&struct {
120300  		f func(*crt.TLS, *Xsqlite3_file, *int32) int32
120301  	}{_nolockCheckReservedLock})), XxFileControl: *(*func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
120302  		f func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32
120303  	}{_unixFileControl})), XxSectorSize: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
120304  		f func(*crt.TLS, *Xsqlite3_file) int32
120305  	}{_unixSectorSize})), XxDeviceCharacteristics: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
120306  		f func(*crt.TLS, *Xsqlite3_file) int32
120307  	}{_unixDeviceCharacteristics})), XxShmLock: *(*func(*crt.TLS, unsafe.Pointer, int32, int32, int32) int32)(unsafe.Pointer(&struct {
120308  		f func(*crt.TLS, *Xsqlite3_file, int32, int32, int32) int32
120309  	}{_unixShmLock})), XxShmBarrier: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
120310  		f func(*crt.TLS, *Xsqlite3_file)
120311  	}{_unixShmBarrier})), XxShmUnmap: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
120312  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
120313  	}{_unixShmUnmap})), XxFetch: *(*func(*crt.TLS, unsafe.Pointer, int64, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
120314  		f func(*crt.TLS, *Xsqlite3_file, int64, int32, *unsafe.Pointer) int32
120315  	}{_unixFetch})), XxUnfetch: *(*func(*crt.TLS, unsafe.Pointer, int64, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
120316  		f func(*crt.TLS, *Xsqlite3_file, int64, unsafe.Pointer) int32
120317  	}{_unixUnfetch}))}
120318  }
120319  
120320  // C comment
120321  //  /*
120322  //  ** Close the file.
120323  //  */
120324  func _nolockClose(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) {
120325  	return _closeUnixFile(tls, _id)
120326  }
120327  
120328  func _nolockLock(tls *crt.TLS, _NotUsed *Xsqlite3_file, _NotUsed2 int32) (r0 int32) {
120329  	_ = _NotUsed2
120330  	return int32(0)
120331  }
120332  
120333  func _nolockUnlock(tls *crt.TLS, _NotUsed *Xsqlite3_file, _NotUsed2 int32) (r0 int32) {
120334  	_ = _NotUsed2
120335  	return int32(0)
120336  }
120337  
120338  func _nolockCheckReservedLock(tls *crt.TLS, _NotUsed *Xsqlite3_file, _pResOut *int32) (r0 int32) {
120339  	*_pResOut = int32(0)
120340  	return int32(0)
120341  }
120342  
120343  // C comment
120344  //  /*
120345  //  ** Given a file descriptor, locate the unixInodeInfo object that
120346  //  ** describes that file descriptor.  Create a new one if necessary.  The
120347  //  ** return value might be uninitialized if an error occurs.
120348  //  **
120349  //  ** The mutex entered using the unixEnterMutex() function must be held
120350  //  ** when this function is called.
120351  //  **
120352  //  ** Return an appropriate error code.
120353  //  */
120354  func _findInodeInfo(tls *crt.TLS, _pFile *XunixFile, _ppInode **XunixInodeInfo) (r0 int32) {
120355  	var _rc, _fd int32
120356  	var _statbuf crt.Xstruct_stat64
120357  	var _pInode *XunixInodeInfo
120358  	var _fileId TunixFileId
120359  	_pInode = nil
120360  	func() {
120361  		if _unixMutexHeld(tls) == 0 {
120362  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31154), unsafe.Pointer(&_findInodeInfoØ00__func__Ø000), unsafe.Pointer(str(132022)))
120363  			crt.X__builtin_abort(tls)
120364  		}
120365  	}()
120366  	_fd = _pFile.Xh
120367  	_rc = func() func(*crt.TLS, int32, *crt.Xstruct_stat64) int32 {
120368  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(5)).XpCurrent
120369  		return *(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
120370  	}()(tls, _fd, &_statbuf)
120371  	if _rc != int32(0) {
120372  		_storeLastErrno(tls, _pFile, *crt.X__errno_location(tls))
120373  		return int32(10)
120374  	}
120375  	crt.Xmemset(tls, unsafe.Pointer(&_fileId), int32(0), uint32(16))
120376  	_fileId.Xdev = _statbuf.Xst_dev
120377  	_fileId.Xino = _statbuf.Xst_ino
120378  	_pInode = _inodeList
120379  _3:
120380  	if (_pInode != nil) && crt.Xmemcmp(tls, unsafe.Pointer(&_fileId), unsafe.Pointer(&_pInode.XfileId), uint32(16)) != 0 {
120381  		_pInode = (*XunixInodeInfo)(_pInode.XpNext)
120382  		goto _3
120383  	}
120384  	if _pInode != nil {
120385  		goto _6
120386  	}
120387  	_pInode = (*XunixInodeInfo)(Xsqlite3_malloc64(tls, uint64(48)))
120388  	if _pInode == nil {
120389  		return _sqlite3NomemError(tls, int32(31208))
120390  	}
120391  	crt.Xmemset(tls, unsafe.Pointer(_pInode), int32(0), uint32(48))
120392  	crt.Xmemcpy(tls, unsafe.Pointer(&_pInode.XfileId), unsafe.Pointer(&_fileId), uint32(16))
120393  	_pInode.XnRef = int32(1)
120394  	*(**XunixInodeInfo)(unsafe.Pointer(&_pInode.XpNext)) = _inodeList
120395  	*(**XunixInodeInfo)(unsafe.Pointer(&_pInode.XpPrev)) = nil
120396  	if _inodeList != nil {
120397  		*(**XunixInodeInfo)(unsafe.Pointer(&_inodeList.XpPrev)) = _pInode
120398  	}
120399  	_inodeList = _pInode
120400  	bug20530(_inodeList)
120401  	goto _9
120402  _6:
120403  	_pInode.XnRef += 1
120404  _9:
120405  	*_ppInode = _pInode
120406  	return int32(0)
120407  }
120408  
120409  var _findInodeInfoØ00__func__Ø000 [14]int8
120410  
120411  func init() {
120412  	crt.Xstrncpy(nil, &_findInodeInfoØ00__func__Ø000[0], str(135477), 14)
120413  }
120414  
120415  var _dotlockIoMethods Xsqlite3_io_methods
120416  
120417  func init() {
120418  	_dotlockIoMethods = Xsqlite3_io_methods{XiVersion: int32(1), XxClose: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
120419  		f func(*crt.TLS, *Xsqlite3_file) int32
120420  	}{_dotlockClose})), XxRead: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
120421  		f func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32
120422  	}{_unixRead})), XxWrite: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
120423  		f func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32
120424  	}{_unixWrite})), XxTruncate: *(*func(*crt.TLS, unsafe.Pointer, int64) int32)(unsafe.Pointer(&struct {
120425  		f func(*crt.TLS, *Xsqlite3_file, int64) int32
120426  	}{_unixTruncate})), XxSync: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
120427  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
120428  	}{_unixSync})), XxFileSize: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
120429  		f func(*crt.TLS, *Xsqlite3_file, *int64) int32
120430  	}{_unixFileSize})), XxLock: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
120431  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
120432  	}{_dotlockLock})), XxUnlock: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
120433  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
120434  	}{_dotlockUnlock})), XxCheckReservedLock: *(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer(&struct {
120435  		f func(*crt.TLS, *Xsqlite3_file, *int32) int32
120436  	}{_dotlockCheckReservedLock})), XxFileControl: *(*func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
120437  		f func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32
120438  	}{_unixFileControl})), XxSectorSize: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
120439  		f func(*crt.TLS, *Xsqlite3_file) int32
120440  	}{_unixSectorSize})), XxDeviceCharacteristics: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
120441  		f func(*crt.TLS, *Xsqlite3_file) int32
120442  	}{_unixDeviceCharacteristics})), XxShmLock: *(*func(*crt.TLS, unsafe.Pointer, int32, int32, int32) int32)(unsafe.Pointer(&struct {
120443  		f func(*crt.TLS, *Xsqlite3_file, int32, int32, int32) int32
120444  	}{_unixShmLock})), XxShmBarrier: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
120445  		f func(*crt.TLS, *Xsqlite3_file)
120446  	}{_unixShmBarrier})), XxShmUnmap: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
120447  		f func(*crt.TLS, *Xsqlite3_file, int32) int32
120448  	}{_unixShmUnmap})), XxFetch: *(*func(*crt.TLS, unsafe.Pointer, int64, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
120449  		f func(*crt.TLS, *Xsqlite3_file, int64, int32, *unsafe.Pointer) int32
120450  	}{_unixFetch})), XxUnfetch: *(*func(*crt.TLS, unsafe.Pointer, int64, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
120451  		f func(*crt.TLS, *Xsqlite3_file, int64, unsafe.Pointer) int32
120452  	}{_unixUnfetch}))}
120453  }
120454  
120455  // C comment
120456  //  /*
120457  //  ** Close a file.  Make sure the lock has been released before closing.
120458  //  */
120459  func _dotlockClose(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) {
120460  	var _pFile *XunixFile
120461  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
120462  	func() {
120463  		if _id == nil {
120464  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(32100), unsafe.Pointer(&_dotlockCloseØ00__func__Ø000), unsafe.Pointer(str(135491)))
120465  			crt.X__builtin_abort(tls)
120466  		}
120467  	}()
120468  	_dotlockUnlock(tls, _id, int32(0))
120469  	Xsqlite3_free(tls, _pFile.XlockingContext)
120470  	return _closeUnixFile(tls, _id)
120471  }
120472  
120473  var _dotlockCloseØ00__func__Ø000 [13]int8
120474  
120475  func init() {
120476  	crt.Xstrncpy(nil, &_dotlockCloseØ00__func__Ø000[0], str(135497), 13)
120477  }
120478  
120479  // C comment
120480  //  /*
120481  //  ** Lower the locking level on file descriptor pFile to eFileLock.  eFileLock
120482  //  ** must be either NO_LOCK or SHARED_LOCK.
120483  //  **
120484  //  ** If the locking level of the file descriptor is already at or below
120485  //  ** the requested locking level, this routine is a no-op.
120486  //  **
120487  //  ** When the locking level reaches NO_LOCK, delete the lock file.
120488  //  */
120489  func _dotlockUnlock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32) (r0 int32) {
120490  	var _rc, _3_tErrno int32
120491  	var _zLockFile *int8
120492  	var _pFile *XunixFile
120493  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
120494  	_zLockFile = (*int8)(_pFile.XlockingContext)
120495  	func() {
120496  		if _pFile == nil {
120497  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(32060), unsafe.Pointer(&_dotlockUnlockØ00__func__Ø000), unsafe.Pointer(str(58022)))
120498  			crt.X__builtin_abort(tls)
120499  		}
120500  	}()
120501  	func() {
120502  		if _eFileLock > int32(1) {
120503  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(32063), unsafe.Pointer(&_dotlockUnlockØ00__func__Ø000), unsafe.Pointer(str(131866)))
120504  			crt.X__builtin_abort(tls)
120505  		}
120506  	}()
120507  	if int32(_pFile.XeFileLock) == _eFileLock {
120508  		return int32(0)
120509  	}
120510  	if _eFileLock == int32(1) {
120511  		_pFile.XeFileLock = uint8(1)
120512  		return int32(0)
120513  	}
120514  	func() {
120515  		if _eFileLock != int32(0) {
120516  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(32079), unsafe.Pointer(&_dotlockUnlockØ00__func__Ø000), unsafe.Pointer(str(135510)))
120517  			crt.X__builtin_abort(tls)
120518  		}
120519  	}()
120520  	_rc = func() func(*crt.TLS, *int8) int32 {
120521  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(19)).XpCurrent
120522  		return *(*func(*crt.TLS, *int8) int32)(unsafe.Pointer(&v))
120523  	}()(tls, _zLockFile)
120524  	if _rc >= int32(0) {
120525  		goto _8
120526  	}
120527  	_3_tErrno = *crt.X__errno_location(tls)
120528  	if _3_tErrno == int32(2) {
120529  		_rc = int32(0)
120530  		goto _10
120531  	}
120532  	_rc = int32(2058)
120533  	_storeLastErrno(tls, _pFile, _3_tErrno)
120534  _10:
120535  	return _rc
120536  
120537  _8:
120538  	_pFile.XeFileLock = 0
120539  	return int32(0)
120540  }
120541  
120542  var _dotlockUnlockØ00__func__Ø000 [14]int8
120543  
120544  func init() {
120545  	crt.Xstrncpy(nil, &_dotlockUnlockØ00__func__Ø000[0], str(135529), 14)
120546  }
120547  
120548  // C comment
120549  //  /*
120550  //  ** Lock the file with the lock specified by parameter eFileLock - one
120551  //  ** of the following:
120552  //  **
120553  //  **     (1) SHARED_LOCK
120554  //  **     (2) RESERVED_LOCK
120555  //  **     (3) PENDING_LOCK
120556  //  **     (4) EXCLUSIVE_LOCK
120557  //  **
120558  //  ** Sometimes when requesting one lock state, additional lock states
120559  //  ** are inserted in between.  The locking might fail on one of the later
120560  //  ** transitions leaving the lock state different from what it started but
120561  //  ** still short of its goal.  The following chart shows the allowed
120562  //  ** transitions and the inserted intermediate states:
120563  //  **
120564  //  **    UNLOCKED -> SHARED
120565  //  **    SHARED -> RESERVED
120566  //  **    SHARED -> (PENDING) -> EXCLUSIVE
120567  //  **    RESERVED -> (PENDING) -> EXCLUSIVE
120568  //  **    PENDING -> EXCLUSIVE
120569  //  **
120570  //  ** This routine will only increase a lock.  Use the sqlite3OsUnlock()
120571  //  ** routine to lower a locking level.
120572  //  **
120573  //  ** With dotfile locking, we really only support state (4): EXCLUSIVE.
120574  //  ** But we track the other locking levels internally.
120575  //  */
120576  func _dotlockLock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32) (r0 int32) {
120577  	var _rc, _2_tErrno int32
120578  	var _zLockFile *int8
120579  	var _pFile *XunixFile
120580  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
120581  	_zLockFile = (*int8)(_pFile.XlockingContext)
120582  	_rc = int32(0)
120583  	if int32(_pFile.XeFileLock) > int32(0) {
120584  		_pFile.XeFileLock = uint8(_eFileLock)
120585  		crt.Xutimes(tls, _zLockFile, nil)
120586  		return int32(0)
120587  	}
120588  	_rc = func() func(*crt.TLS, *int8, uint32) int32 {
120589  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(18)).XpCurrent
120590  		return *(*func(*crt.TLS, *int8, uint32) int32)(unsafe.Pointer(&v))
120591  	}()(tls, _zLockFile, uint32(511))
120592  	if _rc >= int32(0) {
120593  		goto _1
120594  	}
120595  	_2_tErrno = *crt.X__errno_location(tls)
120596  	if int32(17) == _2_tErrno {
120597  		_rc = int32(5)
120598  		goto _3
120599  	}
120600  	_rc = _sqliteErrorFromPosixError(tls, _2_tErrno, int32(3850))
120601  	if _rc != int32(5) {
120602  		_storeLastErrno(tls, _pFile, _2_tErrno)
120603  	}
120604  _3:
120605  	return _rc
120606  
120607  _1:
120608  	_pFile.XeFileLock = uint8(_eFileLock)
120609  	return _rc
120610  }
120611  
120612  // C comment
120613  //  /*
120614  //  ** This routine checks if there is a RESERVED lock held on the specified
120615  //  ** file by this or any other process. If such a lock is held, set *pResOut
120616  //  ** to a non-zero value otherwise *pResOut is set to zero.  The return value
120617  //  ** is set to SQLITE_OK unless an I/O error occurs during lock checking.
120618  //  **
120619  //  ** In dotfile locking, either a lock exists or it does not.  So in this
120620  //  ** variation of CheckReservedLock(), *pResOut is set to true if any lock
120621  //  ** is held on the file and false if the file is unlocked.
120622  //  */
120623  func _dotlockCheckReservedLock(tls *crt.TLS, _id *Xsqlite3_file, _pResOut *int32) (r0 int32) {
120624  	var _rc, _reserved int32
120625  	var _pFile *XunixFile
120626  	_rc = int32(0)
120627  	_reserved = int32(0)
120628  	_pFile = (*XunixFile)(unsafe.Pointer(_id))
120629  	func() {
120630  		if _pFile == nil {
120631  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(31971), unsafe.Pointer(&_dotlockCheckReservedLockØ00__func__Ø000), unsafe.Pointer(str(58022)))
120632  			crt.X__builtin_abort(tls)
120633  		}
120634  	}()
120635  	_reserved = bool2int(func() func(*crt.TLS, *int8, int32) int32 {
120636  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(2)).XpCurrent
120637  		return *(*func(*crt.TLS, *int8, int32) int32)(unsafe.Pointer(&v))
120638  	}()(tls, (*int8)(_pFile.XlockingContext), int32(0)) == int32(0))
120639  	*_pResOut = _reserved
120640  	return _rc
120641  }
120642  
120643  var _dotlockCheckReservedLockØ00__func__Ø000 [25]int8
120644  
120645  func init() {
120646  	crt.Xstrncpy(nil, &_dotlockCheckReservedLockØ00__func__Ø000[0], str(135543), 25)
120647  }
120648  
120649  // C comment
120650  //  /*
120651  //  ** Delete the file at zPath. If the dirSync argument is true, fsync()
120652  //  ** the directory after deleting the file.
120653  //  */
120654  func _unixDelete(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _zPath *int8, _dirSync int32) (r0 int32) {
120655  	var _rc, _4_fd int32
120656  	_rc = int32(0)
120657  
120658  	if func() func(*crt.TLS, *int8) int32 {
120659  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(16)).XpCurrent
120660  		return *(*func(*crt.TLS, *int8) int32)(unsafe.Pointer(&v))
120661  	}()(tls, _zPath) != int32(-1) {
120662  		goto _0
120663  	}
120664  	if (*crt.X__errno_location(tls)) == int32(2) {
120665  		_rc = int32(5898)
120666  		goto _2
120667  	}
120668  	_rc = _unixLogErrorAtLine(tls, int32(2570), str(131620), _zPath, int32(35819))
120669  _2:
120670  	return _rc
120671  
120672  _0:
120673  	if (_dirSync & int32(1)) == int32(0) {
120674  		goto _3
120675  	}
120676  	_rc = func() func(*crt.TLS, *int8, *int32) int32 {
120677  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(17)).XpCurrent
120678  		return *(*func(*crt.TLS, *int8, *int32) int32)(unsafe.Pointer(&v))
120679  	}()(tls, _zPath, &_4_fd)
120680  	if _rc != int32(0) {
120681  		goto _4
120682  	}
120683  	if _full_fsync(tls, _4_fd, int32(0), int32(0)) != 0 {
120684  		_rc = _unixLogErrorAtLine(tls, int32(1290), str(135568), _zPath, int32(35829))
120685  	}
120686  	_robust_close(tls, nil, _4_fd, int32(35831))
120687  	goto _6
120688  _4:
120689  	func() {
120690  		if _rc != int32(14) {
120691  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35833), unsafe.Pointer(&_unixDeleteØ00__func__Ø000), unsafe.Pointer(str(132450)))
120692  			crt.X__builtin_abort(tls)
120693  		}
120694  	}()
120695  	_rc = int32(0)
120696  _6:
120697  _3:
120698  	return _rc
120699  }
120700  
120701  var _unixDeleteØ00__func__Ø000 [11]int8
120702  
120703  func init() {
120704  	crt.Xstrncpy(nil, &_unixDeleteØ00__func__Ø000[0], str(135574), 11)
120705  }
120706  
120707  // C comment
120708  //  /*
120709  //  ** Test the existence of or access permissions of file zPath. The
120710  //  ** test performed depends on the value of flags:
120711  //  **
120712  //  **     SQLITE_ACCESS_EXISTS: Return 1 if the file exists
120713  //  **     SQLITE_ACCESS_READWRITE: Return 1 if the file is read and writable.
120714  //  **     SQLITE_ACCESS_READONLY: Return 1 if the file is readable.
120715  //  **
120716  //  ** Otherwise return 0.
120717  //  */
120718  func _unixAccess(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _zPath *int8, _flags int32, _pResOut *int32) (r0 int32) {
120719  	var _1_buf crt.Xstruct_stat64
120720  
120721  	func() {
120722  		if _pResOut == nil {
120723  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35859), unsafe.Pointer(&_unixAccessØ00__func__Ø000), unsafe.Pointer(str(135585)))
120724  			crt.X__builtin_abort(tls)
120725  		}
120726  	}()
120727  	func() {
120728  		if _flags != int32(0) && _flags != int32(1) {
120729  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35863), unsafe.Pointer(&_unixAccessØ00__func__Ø000), unsafe.Pointer(str(135596)))
120730  			crt.X__builtin_abort(tls)
120731  		}
120732  	}()
120733  	if _flags == int32(0) {
120734  		*_pResOut = bool2int((int32(0) == func() func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32 {
120735  			v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(4)).XpCurrent
120736  			return *(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
120737  		}()(tls, _zPath, &_1_buf)) && (_1_buf.Xst_size > (0)))
120738  		goto _7
120739  	}
120740  	*_pResOut = bool2int(func() func(*crt.TLS, *int8, int32) int32 {
120741  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(2)).XpCurrent
120742  		return *(*func(*crt.TLS, *int8, int32) int32)(unsafe.Pointer(&v))
120743  	}()(tls, _zPath, int32(6)) == int32(0))
120744  _7:
120745  	return int32(0)
120746  }
120747  
120748  var _unixAccessØ00__func__Ø000 [11]int8
120749  
120750  func init() {
120751  	crt.Xstrncpy(nil, &_unixAccessØ00__func__Ø000[0], str(135658), 11)
120752  }
120753  
120754  // C comment
120755  //  /*
120756  //  ** Turn a relative pathname into a full pathname. The relative path
120757  //  ** is stored as a nul-terminated string in the buffer pointed to by
120758  //  ** zPath.
120759  //  **
120760  //  ** zOut points to a buffer of at least sqlite3_vfs.mxPathname bytes
120761  //  ** (in this case, MAX_PATHNAME bytes). The full-path is written to
120762  //  ** this buffer before returning.
120763  //  */
120764  func _unixFullPathname(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _nOut int32, _zOut *int8) (r0 int32) {
120765  	var _rc, _nByte, _nLink, _1_bLink, _11_n int32
120766  	var _zIn, _zDel *int8
120767  	var _1_buf crt.Xstruct_stat64
120768  	_rc = int32(0)
120769  	_nLink = int32(1)
120770  	_zIn = _zPath
120771  	_zDel = nil
120772  	func() {
120773  		if _pVfs.XmxPathname != int32(512) {
120774  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35925), unsafe.Pointer(&_unixFullPathnameØ00__func__Ø000), unsafe.Pointer(str(135669)))
120775  			crt.X__builtin_abort(tls)
120776  		}
120777  	}()
120778  
120779  _2:
120780  	_1_bLink = int32(0)
120781  	if func() func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32 {
120782  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(27)).XpCurrent
120783  		return *(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v))
120784  	}()(tls, _zIn, &_1_buf) == int32(0) {
120785  		goto _3
120786  	}
120787  	if (*crt.X__errno_location(tls)) != int32(2) {
120788  		_rc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(35943)), str(131708), _zIn, int32(35943))
120789  	}
120790  	goto _5
120791  _3:
120792  	_1_bLink = bool2int((_1_buf.Xst_mode & uint32(61440)) == uint32(40960))
120793  _5:
120794  	if _1_bLink == 0 {
120795  		goto _6
120796  	}
120797  	if _zDel != nil {
120798  		goto _7
120799  	}
120800  	_zDel = (*int8)(Xsqlite3_malloc(tls, _nOut))
120801  	if _zDel == nil {
120802  		_rc = _sqlite3NomemError(tls, int32(35952))
120803  	}
120804  	goto _10
120805  _7:
120806  	if preInc2(&_nLink, 1) > int32(100) {
120807  		_rc = _sqlite3CantopenError(tls, int32(35954))
120808  	}
120809  _10:
120810  	if _rc != int32(0) {
120811  		goto _11
120812  	}
120813  	_nByte = func() func(*crt.TLS, *int8, *int8, uint32) int32 {
120814  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(26)).XpCurrent
120815  		return *(*func(*crt.TLS, *int8, *int8, uint32) int32)(unsafe.Pointer(&v))
120816  	}()(tls, _zIn, _zDel, uint32(_nOut-int32(1)))
120817  	if _nByte < int32(0) {
120818  		_rc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(35960)), str(131699), _zIn, int32(35960))
120819  		goto _13
120820  	}
120821  	if int32(*elem1(_zDel, 0)) == int32(47) {
120822  		goto _14
120823  	}
120824  	_11_n = _sqlite3Strlen30(tls, _zIn)
120825  _15:
120826  	if _11_n <= int32(0) || int32(*elem1(_zIn, uintptr(_11_n-int32(1)))) == int32(47) {
120827  		goto _19
120828  	}
120829  	_11_n -= 1
120830  	goto _15
120831  _19:
120832  	if ((_nByte + _11_n) + int32(1)) > _nOut {
120833  		_rc = _sqlite3CantopenError(tls, int32(35966))
120834  		goto _21
120835  	}
120836  	crt.Xmemmove(tls, unsafe.Pointer(elem1(_zDel, uintptr(_11_n))), unsafe.Pointer(_zDel), uint32(_nByte+int32(1)))
120837  	crt.Xmemcpy(tls, unsafe.Pointer(_zDel), unsafe.Pointer(_zIn), uint32(_11_n))
120838  	_nByte += _11_n
120839  _21:
120840  _14:
120841  	*elem1(_zDel, uintptr(_nByte)) = 0
120842  _13:
120843  _11:
120844  	_zIn = _zDel
120845  _6:
120846  	func() {
120847  		if _rc == int32(0) && _zIn == _zOut && int32(*elem1(_zIn, 0)) != int32(47) {
120848  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(35980), unsafe.Pointer(&_unixFullPathnameØ00__func__Ø000), unsafe.Pointer(str(135700)))
120849  			crt.X__builtin_abort(tls)
120850  		}
120851  	}()
120852  	if (_rc == int32(0)) && (_zIn != _zOut) {
120853  		_rc = _mkFullPathname(tls, _zIn, _zOut, _nOut)
120854  	}
120855  	if _1_bLink == int32(0) {
120856  		goto _29
120857  	}
120858  	_zIn = _zOut
120859  	if _rc == int32(0) {
120860  		goto _2
120861  	}
120862  _29:
120863  	Xsqlite3_free(tls, unsafe.Pointer(_zDel))
120864  	return _rc
120865  
120866  	_ = _nLink
120867  	panic(0)
120868  }
120869  
120870  var _unixFullPathnameØ00__func__Ø000 [17]int8
120871  
120872  func init() {
120873  	crt.Xstrncpy(nil, &_unixFullPathnameØ00__func__Ø000[0], str(135742), 17)
120874  }
120875  
120876  // C comment
120877  //  /*
120878  //  **
120879  //  */
120880  func _mkFullPathname(tls *crt.TLS, _zPath *int8, _zOut *int8, _nOut int32) (r0 int32) {
120881  	var _nPath, _iOff int32
120882  	_nPath = _sqlite3Strlen30(tls, _zPath)
120883  	_iOff = int32(0)
120884  	if int32(*elem1(_zPath, 0)) == int32(47) {
120885  		goto _0
120886  	}
120887  	if func() func(*crt.TLS, *int8, uint32) *int8 {
120888  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(3)).XpCurrent
120889  		return *(*func(*crt.TLS, *int8, uint32) *int8)(unsafe.Pointer(&v))
120890  	}()(tls, _zOut, uint32(_nOut-int32(2))) == nil {
120891  		return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(35886)), str(131528), _zPath, int32(35886))
120892  	}
120893  	_iOff = _sqlite3Strlen30(tls, _zOut)
120894  	*elem1(_zOut, uintptr(postInc2(&_iOff, 1))) = int8(47)
120895  _0:
120896  	if ((_iOff + _nPath) + int32(1)) > _nOut {
120897  		*elem1(_zOut, uintptr(_iOff)) = 0
120898  		return _sqlite3CantopenError(tls, int32(35895))
120899  	}
120900  	Xsqlite3_snprintf(tls, _nOut-_iOff, elem1(_zOut, uintptr(_iOff)), str(24531), unsafe.Pointer(_zPath))
120901  	return int32(0)
120902  }
120903  
120904  func _unixDlOpen(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _zFilename *int8) (r0 unsafe.Pointer) {
120905  	return crt.Xdlopen(tls, _zFilename, int32(258))
120906  }
120907  
120908  // C comment
120909  //  /*
120910  //  ** SQLite calls this function immediately after a call to unixDlSym() or
120911  //  ** unixDlOpen() fails (returns a null pointer). If a more detailed error
120912  //  ** message is available, it is written to zBufOut. If no error message
120913  //  ** is available, zBufOut is left unmodified and SQLite uses a default
120914  //  ** error message.
120915  //  */
120916  func _unixDlError(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _nBuf int32, _zBufOut *int8) {
120917  	var _zErr *int8
120918  
120919  	_unixEnterMutex(tls)
120920  	_zErr = crt.Xdlerror(tls)
120921  	if _zErr != nil {
120922  		Xsqlite3_snprintf(tls, _nBuf, _zBufOut, str(24531), unsafe.Pointer(_zErr))
120923  	}
120924  	_unixLeaveMutex(tls)
120925  }
120926  
120927  func _unixDlSym(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _p unsafe.Pointer, _zSym *int8) (r0 func(*crt.TLS)) {
120928  	var _x func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS)
120929  
120930  	_x = func() func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS) {
120931  		v := crt.Xdlsym
120932  		return *(*func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&v))
120933  	}()
120934  	return _x(tls, _p, _zSym)
120935  }
120936  
120937  func _unixDlClose(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _pHandle unsafe.Pointer) {
120938  	crt.Xdlclose(tls, _pHandle)
120939  }
120940  
120941  // C comment
120942  //  /*
120943  //  ** Write nBuf bytes of random data to the supplied buffer zBuf.
120944  //  */
120945  func _unixRandomness(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _nBuf int32, _zBuf *int8) (r0 int32) {
120946  	var _1_fd, _1_got, _2_t int32
120947  
120948  	func() {
120949  		if uint32(_nBuf) < uint32(8) {
120950  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(36061), unsafe.Pointer(&_unixRandomnessØ00__func__Ø000), unsafe.Pointer(str(135759)))
120951  			crt.X__builtin_abort(tls)
120952  		}
120953  	}()
120954  	crt.Xmemset(tls, unsafe.Pointer(_zBuf), int32(0), uint32(_nBuf))
120955  	_randomnessPid = crt.Xgetpid(tls)
120956  	bug20530(_randomnessPid)
120957  	_1_fd = _robust_open(tls, str(135802), int32(0), 0)
120958  	if _1_fd < int32(0) {
120959  		crt.Xtime(tls, &_2_t)
120960  		crt.Xmemcpy(tls, unsafe.Pointer(_zBuf), unsafe.Pointer(&_2_t), uint32(4))
120961  		crt.Xmemcpy(tls, unsafe.Pointer(elem1(_zBuf, uintptr(4))), unsafe.Pointer(&_randomnessPid), uint32(4))
120962  		func() {
120963  			if uint32(8) > uint32(_nBuf) {
120964  				crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(36086), unsafe.Pointer(&_unixRandomnessØ00__func__Ø000), unsafe.Pointer(str(135815)))
120965  				crt.X__builtin_abort(tls)
120966  			}
120967  		}()
120968  		_nBuf = int32(8)
120969  		goto _5
120970  	}
120971  _6:
120972  	_1_got = func() func(*crt.TLS, int32, unsafe.Pointer, uint32) int32 {
120973  		v := elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(8)).XpCurrent
120974  		return *(*func(*crt.TLS, int32, unsafe.Pointer, uint32) int32)(unsafe.Pointer(&v))
120975  	}()(tls, _1_fd, unsafe.Pointer(_zBuf), uint32(_nBuf))
120976  	if (_1_got < int32(0)) && ((*crt.X__errno_location(tls)) == int32(4)) {
120977  		goto _6
120978  	}
120979  	_robust_close(tls, nil, _1_fd, int32(36090))
120980  _5:
120981  	return _nBuf
120982  }
120983  
120984  var _unixRandomnessØ00__func__Ø000 [15]int8
120985  
120986  func init() {
120987  	crt.Xstrncpy(nil, &_unixRandomnessØ00__func__Ø000[0], str(135861), 15)
120988  }
120989  
120990  // C comment
120991  //  /*
120992  //  ** Sleep for a little while.  Return the amount of time slept.
120993  //  ** The argument is the number of microseconds we want to sleep.
120994  //  ** The return value is the number of microseconds of sleep actually
120995  //  ** requested from the underlying operating system, a number which
120996  //  ** might be greater than or equal to the argument, but not less
120997  //  ** than the argument.
120998  //  */
120999  func _unixSleep(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _microseconds int32) (r0 int32) {
121000  	crt.Xusleep(tls, uint32(_microseconds))
121001  	return _microseconds
121002  }
121003  
121004  // C comment
121005  //  /*
121006  //  ** Find the current time (in Universal Coordinated Time).  Write the
121007  //  ** current time and date as a Julian Day number into *prNow and
121008  //  ** return 0.  Return 1 if the time and date cannot be found.
121009  //  */
121010  func _unixCurrentTime(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _prNow *float64) (r0 int32) {
121011  	var _rc int32
121012  	var _i int64
121013  	_i = int64(0)
121014  
121015  	_rc = _unixCurrentTimeInt64(tls, nil, &_i)
121016  	*_prNow = float64(_i) / (8.64e+07)
121017  	return _rc
121018  }
121019  
121020  // C comment
121021  //  /*
121022  //  ** Find the current time (in Universal Coordinated Time).  Write into *piNow
121023  //  ** the current time and date as a Julian Day number times 86_400_000.  In
121024  //  ** other words, write into *piNow the number of milliseconds since the Julian
121025  //  ** epoch of noon in Greenwich on November 24, 4714 B.C according to the
121026  //  ** proleptic Gregorian calendar.
121027  //  **
121028  //  ** On success, return SQLITE_OK.  Return SQLITE_ERROR if the time and date
121029  //  ** cannot be found.
121030  //  */
121031  func _unixCurrentTimeInt64(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _piNow *int64) (r0 int32) {
121032  	var _rc int32
121033  	var _sNow crt.Xstruct_timeval
121034  	_rc = int32(0)
121035  	crt.Xgettimeofday(tls, &_sNow, nil)
121036  	*_piNow = (_unixCurrentTimeInt64Ø00unixEpochØ001 + (int64(1000) * int64(_sNow.Xtv_sec))) + int64(_sNow.Xtv_usec/int32(1000))
121037  	return _rc
121038  }
121039  
121040  var _unixCurrentTimeInt64Ø00unixEpochØ001 int64
121041  
121042  func init() {
121043  	_unixCurrentTimeInt64Ø00unixEpochØ001 = int64(210866760000000)
121044  }
121045  
121046  // C comment
121047  //  /*
121048  //  ** The xGetLastError() method is designed to return a better
121049  //  ** low-level error message when operating-system problems come up
121050  //  ** during SQLite operation.  Only the integer return code is currently
121051  //  ** used.
121052  //  */
121053  func _unixGetLastError(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _NotUsed2 int32, _NotUsed3 *int8) (r0 int32) {
121054  	return *crt.X__errno_location(tls)
121055  }
121056  
121057  // C comment
121058  //  /*
121059  //  ** This is the xSetSystemCall() method of sqlite3_vfs for all of the
121060  //  ** "unix" VFSes.  Return SQLITE_OK opon successfully updating the
121061  //  ** system call pointer, or SQLITE_NOTFOUND if there is no configurable
121062  //  ** system call named zName.
121063  //  */
121064  func _unixSetSystemCall(tls *crt.TLS, _pNotUsed *Xsqlite3_vfs, _zName *int8, _pNewFunc func(*crt.TLS)) (r0 int32) {
121065  	var _rc int32
121066  	var _i uint32
121067  	_rc = int32(12)
121068  
121069  	if _zName != nil {
121070  		goto _0
121071  	}
121072  	_rc = int32(0)
121073  	_i = 0
121074  _1:
121075  	if _i >= uint32(28) {
121076  		goto _4
121077  	}
121078  	if (elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XpDefault) != nil {
121079  		elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XpCurrent = elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XpDefault
121080  	}
121081  	_i += 1
121082  	goto _1
121083  _4:
121084  	goto _6
121085  _0:
121086  	_i = 0
121087  _7:
121088  	if _i >= uint32(28) {
121089  		goto _10
121090  	}
121091  	if crt.Xstrcmp(tls, _zName, elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XzName) != int32(0) {
121092  		goto _11
121093  	}
121094  	if (elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XpDefault) == nil {
121095  		elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XpDefault = elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XpCurrent
121096  	}
121097  	_rc = int32(0)
121098  	if _pNewFunc == nil {
121099  		_pNewFunc = elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XpDefault
121100  	}
121101  	elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XpCurrent = _pNewFunc
121102  	goto _10
121103  _11:
121104  	_i += 1
121105  	goto _7
121106  _10:
121107  _6:
121108  	return _rc
121109  }
121110  
121111  // C comment
121112  //  /*
121113  //  ** Return the value of a system call.  Return NULL if zName is not a
121114  //  ** recognized system call name.  NULL is also returned if the system call
121115  //  ** is currently undefined.
121116  //  */
121117  func _unixGetSystemCall(tls *crt.TLS, _pNotUsed *Xsqlite3_vfs, _zName *int8) (r0 func(*crt.TLS)) {
121118  	var _i uint32
121119  
121120  	_i = 0
121121  _0:
121122  	if _i >= uint32(28) {
121123  		goto _3
121124  	}
121125  	if crt.Xstrcmp(tls, _zName, elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XzName) == int32(0) {
121126  		return elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XpCurrent
121127  	}
121128  	_i += 1
121129  	goto _0
121130  _3:
121131  	return nil
121132  }
121133  
121134  // C comment
121135  //  /*
121136  //  ** Return the name of the first system call after zName.  If zName==NULL
121137  //  ** then return the name of the first system call.  Return NULL if zName
121138  //  ** is the last system call or if zName is not the name of a valid
121139  //  ** system call.
121140  //  */
121141  func _unixNextSystemCall(tls *crt.TLS, _p *Xsqlite3_vfs, _zName *int8) (r0 *int8) {
121142  	var _i int32
121143  	_i = int32(-1)
121144  
121145  	if _zName == nil {
121146  		goto _0
121147  	}
121148  	_i = int32(0)
121149  _1:
121150  	if _i >= int32(27) {
121151  		goto _4
121152  	}
121153  	if crt.Xstrcmp(tls, _zName, elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XzName) == int32(0) {
121154  		goto _4
121155  	}
121156  	_i += 1
121157  	goto _1
121158  _4:
121159  _0:
121160  	_i += 1
121161  _6:
121162  	if _i >= int32(28) {
121163  		goto _9
121164  	}
121165  	if (elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XpCurrent) != nil {
121166  		return elem134((*Tunix_syscall)(unsafe.Pointer(&_aSyscall)), uintptr(_i)).XzName
121167  	}
121168  	_i += 1
121169  	goto _6
121170  _9:
121171  	return nil
121172  }
121173  
121174  var _nolockIoFinder func(*crt.TLS, *int8, *XunixFile) *Xsqlite3_io_methods
121175  
121176  func init() {
121177  	_nolockIoFinder = _nolockIoFinderImpl
121178  }
121179  
121180  func _nolockIoFinderImpl(tls *crt.TLS, _z *int8, _p *XunixFile) (r0 *Xsqlite3_io_methods) {
121181  	return &_nolockIoMethods
121182  }
121183  
121184  var _dotlockIoFinder func(*crt.TLS, *int8, *XunixFile) *Xsqlite3_io_methods
121185  
121186  func init() {
121187  	_dotlockIoFinder = _dotlockIoFinderImpl
121188  }
121189  
121190  func _dotlockIoFinderImpl(tls *crt.TLS, _z *int8, _p *XunixFile) (r0 *Xsqlite3_io_methods) {
121191  	return &_dotlockIoMethods
121192  }
121193  
121194  // C comment
121195  //  /*
121196  //  ** This function is called during initialization if a static buffer is
121197  //  ** supplied to use for the page-cache by passing the SQLITE_CONFIG_PAGECACHE
121198  //  ** verb to sqlite3_config(). Parameter pBuf points to an allocation large
121199  //  ** enough to contain 'n' buffers of 'sz' bytes each.
121200  //  **
121201  //  ** This routine is called from sqlite3_initialize() and so it is guaranteed
121202  //  ** to be serialized already.  There is no need for further mutexing.
121203  //  */
121204  func _sqlite3PCacheBufferSetup(tls *crt.TLS, _pBuf unsafe.Pointer, _sz int32, _n int32) {
121205  	var _1_p *XScratchFreeslot
121206  	if _pcache1_g.XisInit == 0 {
121207  		goto _0
121208  	}
121209  	if _pBuf == nil {
121210  		_sz = store2(&_n, int32(0))
121211  	}
121212  	_sz = _sz & int32(-8)
121213  	_pcache1_g.XszSlot = _sz
121214  	_pcache1_g.XnSlot = store2(&_pcache1_g.XnFreeSlot, _n)
121215  	_pcache1_g.XnReserve = func() int32 {
121216  		if _n > int32(90) {
121217  			return int32(10)
121218  		}
121219  		return ((_n / int32(10)) + int32(1))
121220  	}()
121221  	_pcache1_g.XpStart = _pBuf
121222  	*(**XScratchFreeslot)(unsafe.Pointer(&_pcache1_g.XpFree)) = nil
121223  	_pcache1_g.XbUnderPressure = int32(0)
121224  _4:
121225  	if postInc2(&_n, -1) != 0 {
121226  		_1_p = (*XScratchFreeslot)(_pBuf)
121227  		*(**XScratchFreeslot)(unsafe.Pointer(&_1_p.XpNext)) = (*XScratchFreeslot)(_pcache1_g.XpFree)
121228  		*(**XScratchFreeslot)(unsafe.Pointer(&_pcache1_g.XpFree)) = _1_p
121229  		_pBuf = unsafe.Pointer(elem1((*int8)(_pBuf), uintptr(_sz)))
121230  		goto _4
121231  	}
121232  	_pcache1_g.XpEnd = _pBuf
121233  _0:
121234  }
121235  
121236  var _sqlite3_initializeØ00__func__Ø000 [19]int8
121237  
121238  func init() {
121239  	crt.Xstrncpy(nil, &_sqlite3_initializeØ00__func__Ø000[0], str(135876), 19)
121240  }
121241  
121242  var _enlargeAndAppendØ00__func__Ø000 [17]int8
121243  
121244  func init() {
121245  	crt.Xstrncpy(nil, &_enlargeAndAppendØ00__func__Ø000[0], str(135895), 17)
121246  }
121247  
121248  // C comment
121249  //  /*
121250  //  ** Extra argument values from a PrintfArguments object
121251  //  */
121252  func _getIntArg(tls *crt.TLS, _p *XPrintfArguments) (r0 int64) {
121253  	if _p.XnArg <= _p.XnUsed {
121254  		return 0
121255  	}
121256  	return Xsqlite3_value_int64(tls, *elem19((**XMem)(unsafe.Pointer(_p.XapArg)), uintptr(postInc2(&_p.XnUsed, 1))))
121257  }
121258  
121259  var _sqlite3VXPrintfØ00__func__Ø000 [16]int8
121260  
121261  func init() {
121262  	crt.Xstrncpy(nil, &_sqlite3VXPrintfØ00__func__Ø000[0], str(135912), 16)
121263  }
121264  
121265  var _fmtinfo [23]Xet_info
121266  
121267  func init() {
121268  	_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)}}
121269  }
121270  
121271  var _sqlite3VXPrintfØ00zOrdØ001 [9]int8
121272  
121273  func init() {
121274  	crt.Xstrncpy(nil, &_sqlite3VXPrintfØ00zOrdØ001[0], str(135928), 9)
121275  }
121276  
121277  // C comment
121278  //  /*
121279  //  ** The following table is searched linearly, so it is good to put the
121280  //  ** most frequently used conversion types first.
121281  //  */
121282  var _aDigits [33]int8
121283  
121284  func init() {
121285  	crt.Xstrncpy(nil, &_aDigits[0], str(135937), 33)
121286  }
121287  
121288  var _aPrefix [7]int8
121289  
121290  func init() {
121291  	crt.Xstrncpy(nil, &_aPrefix[0], str(135970), 7)
121292  }
121293  
121294  func _getDoubleArg(tls *crt.TLS, _p *XPrintfArguments) (r0 float64) {
121295  	if _p.XnArg <= _p.XnUsed {
121296  		return float64(0)
121297  	}
121298  	return Xsqlite3_value_double(tls, *elem19((**XMem)(unsafe.Pointer(_p.XapArg)), uintptr(postInc2(&_p.XnUsed, 1))))
121299  }
121300  
121301  // C comment
121302  //  /*
121303  //  ** "*val" is a double such that 0.1 <= *val < 10.0
121304  //  ** Return the ascii code for the leading digit of *val, then
121305  //  ** multiply "*val" by 10.0 to renormalize.
121306  //  **
121307  //  ** Example:
121308  //  **     input:     *val = 3.14159
121309  //  **     output:    *val = 1.4159    function return = '3'
121310  //  **
121311  //  ** The counter *cnt is incremented each time.  After counter exceeds
121312  //  ** 16 (the number of significant digits in a 64-bit float) '0' is
121313  //  ** always returned.
121314  //  */
121315  func _et_getdigit(tls *crt.TLS, _val *float64, _cnt *int32) (r0 int8) {
121316  	var _digit int32
121317  	var _d float64
121318  	if (*_cnt) <= int32(0) {
121319  		return int8(48)
121320  	}
121321  	*_cnt -= 1
121322  	_digit = int32(*_val)
121323  	_d = float64(_digit)
121324  	_digit += int32(48)
121325  	*_val = ((*_val) - _d) * float64(10)
121326  	return int8(_digit)
121327  }
121328  
121329  func _getTextArg(tls *crt.TLS, _p *XPrintfArguments) (r0 *int8) {
121330  	if _p.XnArg <= _p.XnUsed {
121331  		return nil
121332  	}
121333  	return (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *elem19((**XMem)(unsafe.Pointer(_p.XapArg)), uintptr(postInc2(&_p.XnUsed, 1))))))
121334  }
121335  
121336  // C comment
121337  //  /*
121338  //  ** Append N copies of character c to the given string buffer.
121339  //  */
121340  func _sqlite3AppendChar(tls *crt.TLS, _p *XStrAccum, _N int32, _c int8) {
121341  	if ((int64(_p.XnChar) + int64(_N)) >= int64(_p.XnAlloc)) && (store2(&_N, _sqlite3StrAccumEnlarge(tls, _p, _N)) <= int32(0)) {
121342  		return
121343  	}
121344  	func() {
121345  		if (_p.XzText == _p.XzBase) != ((int32(_p.XprintfFlags) & int32(4)) == int32(0)) {
121346  			crt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(25886), unsafe.Pointer(&_sqlite3AppendCharØ00__func__Ø000), unsafe.Pointer(str(6455)))
121347  			crt.X__builtin_abort(tls)
121348  		}
121349  	}()
121350  _4:
121351  	if postInc2(&_N, -1) > int32(0) {
121352  		*elem1(_p.XzText, uintptr(postInc23(&_p.XnChar, uint32(1)))) = _c
121353  		goto _4
121354  	}
121355  }
121356  
121357  var _sqlite3AppendCharØ00__func__Ø000 [18]int8
121358  
121359  func init() {
121360  	crt.Xstrncpy(nil, &_sqlite3AppendCharØ00__func__Ø000[0], str(135977), 18)
121361  }
121362  
121363  func _sqlite3IsIdChar(tls *crt.TLS, _c uint8) (r0 int32) {
121364  	return bool2int((int32(*elem15((*uint8)(unsafe.Pointer(&_sqlite3CtypeMap)), uintptr(_c))) & int32(70)) != int32(0))
121365  }
121366  
121367  // C comment
121368  //  /*
121369  //  ** Undo the effects of sqlite3_initialize().  Must not be called while
121370  //  ** there are outstanding database connections or memory allocations or
121371  //  ** while any part of SQLite is otherwise in use in any thread.  This
121372  //  ** routine is not threadsafe.  But it is safe to invoke this routine
121373  //  ** on when SQLite is already shut down.  If SQLite is already shut down
121374  //  ** when this routine is invoked, then this routine is a harmless no-op.
121375  //  */
121376  func Xsqlite3_shutdown(tls *crt.TLS) (r0 int32) {
121377  	if _sqlite3Config.XisInit != 0 {
121378  		Xsqlite3_os_end(tls)
121379  		Xsqlite3_reset_auto_extension(tls)
121380  		_sqlite3Config.XisInit = int32(0)
121381  	}
121382  	if _sqlite3Config.XisPCacheInit != 0 {
121383  		_sqlite3PcacheShutdown(tls)
121384  		_sqlite3Config.XisPCacheInit = int32(0)
121385  	}
121386  	if _sqlite3Config.XisMallocInit != 0 {
121387  		_sqlite3MallocEnd(tls)
121388  		_sqlite3Config.XisMallocInit = int32(0)
121389  		Xsqlite3_data_directory = nil
121390  		bug20530(Xsqlite3_data_directory)
121391  		Xsqlite3_temp_directory = nil
121392  		bug20530(Xsqlite3_temp_directory)
121393  	}
121394  	if _sqlite3Config.XisMutexInit != 0 {
121395  		_sqlite3MutexEnd(tls)
121396  		_sqlite3Config.XisMutexInit = int32(0)
121397  	}
121398  	return int32(0)
121399  }
121400  
121401  // C comment
121402  //  /*
121403  //  ** Shutdown the operating system interface.
121404  //  **
121405  //  ** Some operating systems might need to do some cleanup in this routine,
121406  //  ** to release dynamically allocated objects.  But not on unix.
121407  //  ** This routine is a no-op for unix.
121408  //  */
121409  func Xsqlite3_os_end(tls *crt.TLS) (r0 int32) {
121410  	return int32(0)
121411  }
121412  
121413  func _sqlite3PcacheShutdown(tls *crt.TLS) {
121414  	if (_sqlite3Config.Xpcache2.XxShutdown) != nil {
121415  		(_sqlite3Config.Xpcache2.XxShutdown)(tls, _sqlite3Config.Xpcache2.XpArg)
121416  	}
121417  }
121418  
121419  // C comment
121420  //  /*
121421  //  ** Deinitialize the memory allocation subsystem.
121422  //  */
121423  func _sqlite3MallocEnd(tls *crt.TLS) {
121424  	if (_sqlite3Config.Xm.XxShutdown) != nil {
121425  		(_sqlite3Config.Xm.XxShutdown)(tls, _sqlite3Config.Xm.XpAppData)
121426  	}
121427  	crt.Xmemset(tls, unsafe.Pointer(&_mem0), int32(0), uint32(28))
121428  }
121429  
121430  // C comment
121431  //  /*
121432  //  ** CAPI3REF: Name Of The Folder Holding Database Files
121433  //  **
121434  //  ** ^(If this global variable is made to point to a string which is
121435  //  ** the name of a folder (a.k.a. directory), then all database files
121436  //  ** specified with a relative pathname and created or accessed by
121437  //  ** SQLite when using a built-in windows [sqlite3_vfs | VFS] will be assumed
121438  //  ** to be relative to that directory.)^ ^If this variable is a NULL
121439  //  ** pointer, then SQLite assumes that all database files specified
121440  //  ** with a relative pathname are relative to the current directory
121441  //  ** for the process.  Only the windows VFS makes use of this global
121442  //  ** variable; it is ignored by the unix VFS.
121443  //  **
121444  //  ** Changing the value of this variable while a database connection is
121445  //  ** open can result in a corrupt database.
121446  //  **
121447  //  ** It is not safe to read or modify this variable in more than one
121448  //  ** thread at a time.  It is not safe to read or modify this variable
121449  //  ** if a [database connection] is being used at the same time in a separate
121450  //  ** thread.
121451  //  ** It is intended that this variable be set once
121452  //  ** as part of process initialization and before any SQLite interface
121453  //  ** routines have been called and that this variable remain unchanged
121454  //  ** thereafter.
121455  //  **
121456  //  ** ^The [data_store_directory pragma] may modify this variable and cause
121457  //  ** it to point to memory obtained from [sqlite3_malloc].  ^Furthermore,
121458  //  ** the [data_store_directory pragma] always assumes that any string
121459  //  ** that this variable points to is held in memory obtained from
121460  //  ** [sqlite3_malloc] and the pragma may attempt to free that memory
121461  //  ** using [sqlite3_free].
121462  //  ** Hence, if this variable is modified directly, either it should be
121463  //  ** made NULL or made to point to memory obtained from [sqlite3_malloc]
121464  //  ** or else the use of the [data_store_directory pragma] should be avoided.
121465  //  */
121466  var Xsqlite3_data_directory *int8
121467  
121468  // C comment
121469  //  /*
121470  //  ** Shutdown the mutex system. This call frees resources allocated by
121471  //  ** sqlite3MutexInit().
121472  //  */
121473  func _sqlite3MutexEnd(tls *crt.TLS) (r0 int32) {
121474  	var _rc int32
121475  	_rc = int32(0)
121476  	if (_sqlite3Config.Xmutex.XxMutexEnd) != nil {
121477  		_rc = (_sqlite3Config.Xmutex.XxMutexEnd)(tls)
121478  	}
121479  	_mutexIsInit = int32(0)
121480  	bug20530(_mutexIsInit)
121481  	return _rc
121482  }
121483  
121484  // C comment
121485  //  /*
121486  //  ** This function is now an anachronism. It used to be used to recover from a
121487  //  ** malloc() failure, but SQLite now does this automatically.
121488  //  */
121489  func Xsqlite3_global_recover(tls *crt.TLS) (r0 int32) {
121490  	return int32(0)
121491  }
121492  
121493  // C comment
121494  //  /*
121495  //  ** Deprecated external interface.  It used to set an alarm callback
121496  //  ** that was invoked when memory usage grew too large.  Now it is a
121497  //  ** no-op.
121498  //  */
121499  func Xsqlite3_memory_alarm(tls *crt.TLS, _xCallback func(*crt.TLS, unsafe.Pointer, int64, int32), _pArg unsafe.Pointer, _iThreshold int64) (r0 int32) {
121500  	return int32(0)
121501  }
121502  
121503  // C comment
121504  //  /*
121505  //  ** Enable or disable extension loading.  Extension loading is disabled by
121506  //  ** default so as not to open security holes in older applications.
121507  //  */
121508  func Xsqlite3_enable_load_extension(tls *crt.TLS, _db *Xsqlite3, _onoff int32) (r0 int32) {
121509  	Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.Xmutex))
121510  	if _onoff != 0 {
121511  		_db.Xflags |= int32(12582912)
121512  		goto _1
121513  	}
121514  	_db.Xflags &= int32(-12582913)
121515  _1:
121516  	Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.Xmutex))
121517  	return int32(0)
121518  }
121519  
121520  var Xsqlite3WhereTrace int32
121521  
121522  func bool2int(b bool) int32 {
121523  	if b {
121524  		return 1
121525  	}
121526  	return 0
121527  }
121528  func bug20530(interface{}) {} //TODO remove when https://github.com/golang/go/issues/20530 is fixed.
121529  func init()                { nzf32 *= -1; nzf64 *= -1 }
121530  
121531  var inf = math.Inf(1)
121532  var nzf32 float32 // -0.0
121533  var nzf64 float64 // -0.0
121534  func elem130(a *func(*crt.TLS), index uintptr) *func(*crt.TLS) {
121535  	return (*func(*crt.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121536  }
121537  func elem0(a **int8, index uintptr) **int8 {
121538  	return (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121539  }
121540  func elem63(a **XSubProgram, index uintptr) **XSubProgram {
121541  	return (**XSubProgram)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121542  }
121543  func elem28(a **XVTable, index uintptr) **XVTable {
121544  	return (**XVTable)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121545  }
121546  func elem77(a **XVdbeCursor, index uintptr) **XVdbeCursor {
121547  	return (**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121548  }
121549  func elem32(a **XBitvec, index uintptr) **XBitvec {
121550  	return (**XBitvec)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121551  }
121552  func elem30(a **XMemPage, index uintptr) **XMemPage {
121553  	return (**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121554  }
121555  func elem18(a **XFuncDef, index uintptr) **XFuncDef {
121556  	return (**XFuncDef)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121557  }
121558  func elem90(a **XSorterRecord, index uintptr) **XSorterRecord {
121559  	return (**XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121560  }
121561  func elem104(a **XWhereTerm, index uintptr) **XWhereTerm {
121562  	return (**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121563  }
121564  func elem37(a **XPgHdr, index uintptr) **XPgHdr {
121565  	return (**XPgHdr)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121566  }
121567  func elem14(a **XPgHdr1, index uintptr) **XPgHdr1 {
121568  	return (**XPgHdr1)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121569  }
121570  func elem112(a **XWhereLoop, index uintptr) **XWhereLoop {
121571  	return (**XWhereLoop)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121572  }
121573  func elem19(a **XMem, index uintptr) **XMem {
121574  	return (**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121575  }
121576  func elem94(a **TRowSetEntry, index uintptr) **TRowSetEntry {
121577  	return (**TRowSetEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121578  }
121579  func elem122(a **XToken, index uintptr) **XToken {
121580  	return (**XToken)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121581  }
121582  func elem59(a **XTable, index uintptr) **XTable {
121583  	return (**XTable)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121584  }
121585  func elem62(a **XCollSeq, index uintptr) **XCollSeq {
121586  	return (**XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121587  }
121588  func elem40(a **XTrigger, index uintptr) **XTrigger {
121589  	return (**XTrigger)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121590  }
121591  func elem24(a *unsafe.Pointer, index uintptr) *unsafe.Pointer {
121592  	return (*unsafe.Pointer)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121593  }
121594  func elem36(a **uint32, index uintptr) **uint32 {
121595  	return (**uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121596  }
121597  func elem88(a **uint8, index uintptr) **uint8 {
121598  	return (**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121599  }
121600  func elem47(a *[8]uint8, index uintptr) *[8]uint8 {
121601  	return (*[8]uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121602  }
121603  func elem50(a *int16, index uintptr) *int16 {
121604  	return (*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 2*index))
121605  }
121606  func elem8(a *int32, index uintptr) *int32 {
121607  	return (*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121608  }
121609  func elem1(a *int8, index uintptr) *int8 {
121610  	return (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 1*index))
121611  }
121612  func elem96(a *Tsqlite3_index_constraint_usage, index uintptr) *Tsqlite3_index_constraint_usage {
121613  	return (*Tsqlite3_index_constraint_usage)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121614  }
121615  func elem39(a *T_ht, index uintptr) *T_ht {
121616  	return (*T_ht)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121617  }
121618  func elem21(a *t22, index uintptr) *t22 {
121619  	return (*t22)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 24*index))
121620  }
121621  func elem4(a *Xet_info, index uintptr) *Xet_info {
121622  	return (*Xet_info)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 6*index))
121623  }
121624  func elem123(a *t124, index uintptr) *t124 {
121625  	return (*t124)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 3*index))
121626  }
121627  func elem108(a *Tsqlite3_index_orderby, index uintptr) *Tsqlite3_index_orderby {
121628  	return (*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121629  }
121630  func elem106(a *Tsqlite3_index_constraint, index uintptr) *Tsqlite3_index_constraint {
121631  	return (*Tsqlite3_index_constraint)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 12*index))
121632  }
121633  func elem115(a *TInLoop, index uintptr) *TInLoop {
121634  	return (*TInLoop)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 12*index))
121635  }
121636  func elem64(a *XTableLock, index uintptr) *XTableLock {
121637  	return (*XTableLock)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 16*index))
121638  }
121639  func elem116(a *t117, index uintptr) *t117 {
121640  	return (*t117)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121641  }
121642  func elem99(a *XWhereLevel, index uintptr) *XWhereLevel {
121643  	return (*XWhereLevel)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 76*index))
121644  }
121645  func elem45(a *TWalSegment, index uintptr) *TWalSegment {
121646  	return (*TWalSegment)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 20*index))
121647  }
121648  func elem31(a *XPagerSavepoint, index uintptr) *XPagerSavepoint {
121649  	return (*XPagerSavepoint)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 44*index))
121650  }
121651  func elem80(a *XPmaReader, index uintptr) *XPmaReader {
121652  	return (*XPmaReader)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 52*index))
121653  }
121654  func elem69(a *TyColCache, index uintptr) *TyColCache {
121655  	return (*TyColCache)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 20*index))
121656  }
121657  func elem133(a *Xsqlite3_vfs, index uintptr) *Xsqlite3_vfs {
121658  	return (*Xsqlite3_vfs)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 88*index))
121659  }
121660  func elem44(a *XWalIndexHdr, index uintptr) *XWalIndexHdr {
121661  	return (*XWalIndexHdr)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 48*index))
121662  }
121663  func elem11(a *Xsqlite3_debug_mutex, index uintptr) *Xsqlite3_debug_mutex {
121664  	return (*Xsqlite3_debug_mutex)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121665  }
121666  func elem52(a *t53, index uintptr) *t53 {
121667  	return (*t53)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 2*index))
121668  }
121669  func elem111(a *XWherePath, index uintptr) *XWherePath {
121670  	return (*XWherePath)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 28*index))
121671  }
121672  func elem10(a *Xsqlite3_mutex, index uintptr) *Xsqlite3_mutex {
121673  	return (*Xsqlite3_mutex)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 40*index))
121674  }
121675  func elem17(a *XFuncDef, index uintptr) *XFuncDef {
121676  	return (*XFuncDef)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 28*index))
121677  }
121678  func elem107(a *Xsqlite3_index_info, index uintptr) *Xsqlite3_index_info {
121679  	return (*Xsqlite3_index_info)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 64*index))
121680  }
121681  func elem46(a *TSublist, index uintptr) *TSublist {
121682  	return (*TSublist)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121683  }
121684  func elem65(a *XKeyInfo, index uintptr) *XKeyInfo {
121685  	return (*XKeyInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 24*index))
121686  }
121687  func elem129(a *XStat4Accum, index uintptr) *XStat4Accum {
121688  	return (*XStat4Accum)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 60*index))
121689  }
121690  func elem92(a *XMergeEngine, index uintptr) *XMergeEngine {
121691  	return (*XMergeEngine)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 16*index))
121692  }
121693  func elem131(a *t132, index uintptr) *t132 {
121694  	return (*t132)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121695  }
121696  func elem58(a *XExpr, index uintptr) *XExpr {
121697  	return (*XExpr)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 48*index))
121698  }
121699  func elem120(a *XTriggerStep, index uintptr) *XTriggerStep {
121700  	return (*XTriggerStep)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 36*index))
121701  }
121702  func elem61(a *XVdbeOp, index uintptr) *XVdbeOp {
121703  	return (*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 24*index))
121704  }
121705  func elem67(a *TAggInfo_func, index uintptr) *TAggInfo_func {
121706  	return (*TAggInfo_func)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 16*index))
121707  }
121708  func elem100(a *XWhereTerm, index uintptr) *XWhereTerm {
121709  	return (*XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 48*index))
121710  }
121711  func elem57(a *TExprList_item, index uintptr) *TExprList_item {
121712  	return (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 20*index))
121713  }
121714  func elem79(a *XSorterFile, index uintptr) *XSorterFile {
121715  	return (*XSorterFile)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 12*index))
121716  }
121717  func elem12(a *XPCache1, index uintptr) *XPCache1 {
121718  	return (*XPCache1)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 60*index))
121719  }
121720  func elem135(a *XunixShmNode, index uintptr) *XunixShmNode {
121721  	return (*XunixShmNode)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 40*index))
121722  }
121723  func elem48(a *XModule, index uintptr) *XModule {
121724  	return (*XModule)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 20*index))
121725  }
121726  func elem9(a *XScratchFreeslot, index uintptr) *XScratchFreeslot {
121727  	return (*XScratchFreeslot)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121728  }
121729  func elem34(a *XPgHdr, index uintptr) *XPgHdr {
121730  	return (*XPgHdr)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 40*index))
121731  }
121732  func elem6(a *TSrcList_item, index uintptr) *TSrcList_item {
121733  	return (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 68*index))
121734  }
121735  func elem66(a *TAggInfo_col, index uintptr) *TAggInfo_col {
121736  	return (*TAggInfo_col)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 24*index))
121737  }
121738  func elem78(a *XSortSubtask, index uintptr) *XSortSubtask {
121739  	return (*XSortSubtask)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 60*index))
121740  }
121741  func elem74(a *XWal, index uintptr) *XWal {
121742  	return (*XWal)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 120*index))
121743  }
121744  func elem13(a *XPgHdr1, index uintptr) *XPgHdr1 {
121745  	return (*XPgHdr1)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 32*index))
121746  }
121747  func elem110(a *XWhereOrCost, index uintptr) *XWhereOrCost {
121748  	return (*XWhereOrCost)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 12*index))
121749  }
121750  func elem49(a *XyyStackEntry, index uintptr) *XyyStackEntry {
121751  	return (*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 16*index))
121752  }
121753  func elem25(a *XMem, index uintptr) *XMem {
121754  	return (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 48*index))
121755  }
121756  func elem126(a *TOpenMode, index uintptr) *TOpenMode {
121757  	return (*TOpenMode)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121758  }
121759  func elem56(a *XToken, index uintptr) *XToken {
121760  	return (*XToken)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121761  }
121762  func elem27(a *XDb, index uintptr) *XDb {
121763  	return (*XDb)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 16*index))
121764  }
121765  func elem95(a *XPragmaName, index uintptr) *XPragmaName {
121766  	return (*XPragmaName)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 12*index))
121767  }
121768  func elem29(a *XCollSeq, index uintptr) *XCollSeq {
121769  	return (*XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 20*index))
121770  }
121771  func elem125(a *TEncName, index uintptr) *TEncName {
121772  	return (*TEncName)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121773  }
121774  func elem42(a *TIdList_item, index uintptr) *TIdList_item {
121775  	return (*TIdList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121776  }
121777  func elem82(a *XSavepoint, index uintptr) *XSavepoint {
121778  	return (*XSavepoint)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 24*index))
121779  }
121780  func elem43(a *TCte, index uintptr) *TCte {
121781  	return (*TCte)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 16*index))
121782  }
121783  func elem134(a *Tunix_syscall, index uintptr) *Tunix_syscall {
121784  	return (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 12*index))
121785  }
121786  func elem41(a *XColumn, index uintptr) *XColumn {
121787  	return (*XColumn)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 16*index))
121788  }
121789  func elem121(a *XTrigger, index uintptr) *XTrigger {
121790  	return (*XTrigger)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 36*index))
121791  }
121792  func elem127(a *t128, index uintptr) *t128 {
121793  	return (*t128)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121794  }
121795  func elem103(a *TOp2, index uintptr) *TOp2 {
121796  	return (*TOp2)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 8*index))
121797  }
121798  func elem20(a *uint16, index uintptr) *uint16 {
121799  	return (*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 2*index))
121800  }
121801  func elem7(a *uint32, index uintptr) *uint32 {
121802  	return (*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 4*index))
121803  }
121804  func elem15(a *uint8, index uintptr) *uint8 {
121805  	return (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(a)) + 1*index))
121806  }
121807  func postInc50(p **int16, d int) *int16 {
121808  	q := (*uintptr)(unsafe.Pointer(p))
121809  	v := *q
121810  	*q += uintptr(d)
121811  	return (*int16)(unsafe.Pointer(v))
121812  }
121813  func postInc1(p **int8, d int) *int8 {
121814  	q := (*uintptr)(unsafe.Pointer(p))
121815  	v := *q
121816  	*q += uintptr(d)
121817  	return (*int8)(unsafe.Pointer(v))
121818  }
121819  func postInc49(p **XyyStackEntry, d int) *XyyStackEntry {
121820  	q := (*uintptr)(unsafe.Pointer(p))
121821  	v := *q
121822  	*q += uintptr(d)
121823  	return (*XyyStackEntry)(unsafe.Pointer(v))
121824  }
121825  func postInc25(p **XMem, d int) *XMem {
121826  	q := (*uintptr)(unsafe.Pointer(p))
121827  	v := *q
121828  	*q += uintptr(d)
121829  	return (*XMem)(unsafe.Pointer(v))
121830  }
121831  func postInc93(p **TRowSetEntry, d int) *TRowSetEntry {
121832  	q := (*uintptr)(unsafe.Pointer(p))
121833  	v := *q
121834  	*q += uintptr(d)
121835  	return (*TRowSetEntry)(unsafe.Pointer(v))
121836  }
121837  func postInc7(p **uint32, d int) *uint32 {
121838  	q := (*uintptr)(unsafe.Pointer(p))
121839  	v := *q
121840  	*q += uintptr(d)
121841  	return (*uint32)(unsafe.Pointer(v))
121842  }
121843  func postInc15(p **uint8, d int) *uint8 {
121844  	q := (*uintptr)(unsafe.Pointer(p))
121845  	v := *q
121846  	*q += uintptr(d)
121847  	return (*uint8)(unsafe.Pointer(v))
121848  }
121849  func postInc2(p *int32, d int32) int32     { v := *p; *p += d; return v }
121850  func postInc35(p *int64, d int64) int64    { v := *p; *p += d; return v }
121851  func postInc5(p *int8, d int8) int8        { v := *p; *p += d; return v }
121852  func postInc76(p *uint16, d uint16) uint16 { v := *p; *p += d; return v }
121853  func postInc23(p *uint32, d uint32) uint32 { v := *p; *p += d; return v }
121854  func postInc3(p *uint8, d uint8) uint8     { v := *p; *p += d; return v }
121855  func preInc1(p **int8, d int) *int8 {
121856  	q := (*uintptr)(unsafe.Pointer(p))
121857  	v := *q + uintptr(d)
121858  	*q = v
121859  	return (*int8)(unsafe.Pointer(v))
121860  }
121861  func preInc25(p **XMem, d int) *XMem {
121862  	q := (*uintptr)(unsafe.Pointer(p))
121863  	v := *q + uintptr(d)
121864  	*q = v
121865  	return (*XMem)(unsafe.Pointer(v))
121866  }
121867  func preInc15(p **uint8, d int) *uint8 {
121868  	q := (*uintptr)(unsafe.Pointer(p))
121869  	v := *q + uintptr(d)
121870  	*q = v
121871  	return (*uint8)(unsafe.Pointer(v))
121872  }
121873  func preInc26(p *int16, d int16) int16    { v := *p + d; *p = v; return v }
121874  func preInc2(p *int32, d int32) int32     { v := *p + d; *p = v; return v }
121875  func preInc76(p *uint16, d uint16) uint16 { v := *p + d; *p = v; return v }
121876  func preInc23(p *uint32, d uint32) uint32 { v := *p + d; *p = v; return v }
121877  func preInc3(p *uint8, d uint8) uint8     { v := *p + d; *p = v; return v }
121878  func storebits26(p *int16, v int16, m uint64, o uint) int16 {
121879  	*p = *p&^int16(m) | (v << o & int16(m))
121880  	return v
121881  }
121882  func storebits5(p *int8, v int8, m uint64, o uint) int8 {
121883  	*p = *p&^int8(m) | (v << o & int8(m))
121884  	return v
121885  }
121886  func store81(p *func(*crt.TLS, *Xsqlite3_vtab) int32, v func(*crt.TLS, *Xsqlite3_vtab) int32) func(*crt.TLS, *Xsqlite3_vtab) int32 {
121887  	*p = v
121888  	return v
121889  }
121890  func store1(p **int8, v *int8) *int8                                     { *p = v; return v }
121891  func store119(p **XSubProgram, v *XSubProgram) *XSubProgram              { *p = v; return v }
121892  func store87(p **XBtree, v *XBtree) *XBtree                              { *p = v; return v }
121893  func store60(p **TVdbe, v *TVdbe) *TVdbe                                 { *p = v; return v }
121894  func store86(p **XVdbeCursor, v *XVdbeCursor) *XVdbeCursor               { *p = v; return v }
121895  func store84(p **XMemPage, v *XMemPage) *XMemPage                        { *p = v; return v }
121896  func store17(p **XFuncDef, v *XFuncDef) *XFuncDef                        { *p = v; return v }
121897  func store70(p **XExprList, v *XExprList) *XExprList                     { *p = v; return v }
121898  func store65(p **XKeyInfo, v *XKeyInfo) *XKeyInfo                        { *p = v; return v }
121899  func store98(p **XSrcList, v *XSrcList) *XSrcList                        { *p = v; return v }
121900  func store92(p **XMergeEngine, v *XMergeEngine) *XMergeEngine            { *p = v; return v }
121901  func store58(p **XExpr, v *XExpr) *XExpr                                 { *p = v; return v }
121902  func store120(p **XTriggerStep, v *XTriggerStep) *XTriggerStep           { *p = v; return v }
121903  func store61(p **XVdbeOp, v *XVdbeOp) *XVdbeOp                           { *p = v; return v }
121904  func store38(p **Xsqlite3_backup, v *Xsqlite3_backup) *Xsqlite3_backup   { *p = v; return v }
121905  func store97(p **XSelect, v *XSelect) *XSelect                           { *p = v; return v }
121906  func store100(p **XWhereTerm, v *XWhereTerm) *XWhereTerm                 { *p = v; return v }
121907  func store118(p **XFKey, v *XFKey) *XFKey                                { *p = v; return v }
121908  func store83(p **XUnpackedRecord, v *XUnpackedRecord) *XUnpackedRecord   { *p = v; return v }
121909  func store33(p **XFileChunk, v *XFileChunk) *XFileChunk                  { *p = v; return v }
121910  func store9(p **XScratchFreeslot, v *XScratchFreeslot) *XScratchFreeslot { *p = v; return v }
121911  func store34(p **XPgHdr, v *XPgHdr) *XPgHdr                              { *p = v; return v }
121912  func store91(p **XIncrMerger, v *XIncrMerger) *XIncrMerger               { *p = v; return v }
121913  func store13(p **XPgHdr1, v *XPgHdr1) *XPgHdr1                           { *p = v; return v }
121914  func store109(p **XWhereLoop, v *XWhereLoop) *XWhereLoop                 { *p = v; return v }
121915  func store25(p **XMem, v *XMem) *XMem                                    { *p = v; return v }
121916  func store93(p **TRowSetEntry, v *TRowSetEntry) *TRowSetEntry            { *p = v; return v }
121917  func store102(p **XWhereOrInfo, v *XWhereOrInfo) *XWhereOrInfo           { *p = v; return v }
121918  func store72(p **XTable, v *XTable) *XTable                              { *p = v; return v }
121919  func store113(p **XIndex, v *XIndex) *XIndex                             { *p = v; return v }
121920  func store41(p **XColumn, v *XColumn) *XColumn                           { *p = v; return v }
121921  func store16(p *unsafe.Pointer, v unsafe.Pointer) unsafe.Pointer         { *p = v; return v }
121922  func store15(p **uint8, v *uint8) *uint8                                 { *p = v; return v }
121923  func store2(p *int32, v int32) int32                                     { *p = v; return v }
121924  func store35(p *int64, v int64) int64                                    { *p = v; return v }
121925  func store5(p *int8, v int8) int8                                        { *p = v; return v }
121926  func store76(p *uint16, v uint16) uint16                                 { *p = v; return v }
121927  func store23(p *uint32, v uint32) uint32                                 { *p = v; return v }
121928  func store85(p *uint64, v uint64) uint64                                 { *p = v; return v }
121929  func store3(p *uint8, v uint8) uint8                                     { *p = v; return v }
121930  
121931  type Xva_list struct{ X_ t136 } // t137 struct{_ struct{}}
121932  
121933  type TSqlite3Config struct {
121934  	XbMemstat            int32
121935  	XbCoreMutex          int32
121936  	XbFullMutex          int32
121937  	XbOpenUri            int32
121938  	XbUseCis             int32
121939  	XmxStrlen            int32
121940  	XneverCorrupt        int32
121941  	XszLookaside         int32
121942  	XnLookaside          int32
121943  	XnStmtSpill          int32
121944  	Xm                   Xsqlite3_mem_methods
121945  	Xmutex               Xsqlite3_mutex_methods
121946  	Xpcache2             Xsqlite3_pcache_methods2
121947  	XpHeap               unsafe.Pointer
121948  	XnHeap               int32
121949  	XmnReq               int32
121950  	XmxReq               int32
121951  	XszMmap              int64
121952  	XmxMmap              int64
121953  	XpScratch            unsafe.Pointer
121954  	XszScratch           int32
121955  	XnScratch            int32
121956  	XpPage               unsafe.Pointer
121957  	XszPage              int32
121958  	XnPage               int32
121959  	XmxParserStack       int32
121960  	XsharedCacheEnabled  int32
121961  	XszPma               uint32
121962  	XisInit              int32
121963  	XinProgress          int32
121964  	XisMutexInit         int32
121965  	XisMallocInit        int32
121966  	XisPCacheInit        int32
121967  	XnRefInitMutex       int32
121968  	XpInitMutex          unsafe.Pointer
121969  	XxLog                func(*crt.TLS, unsafe.Pointer, int32, *int8)
121970  	XpLogArg             unsafe.Pointer
121971  	XxTestCallback       func(*crt.TLS, int32) int32
121972  	XbLocaltimeFault     int32
121973  	XiOnceResetThreshold int32
121974  } // t138 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}
121975  
121976  type Xsqlite3_mem_methods struct {
121977  	XxMalloc   func(*crt.TLS, int32) unsafe.Pointer
121978  	XxFree     func(*crt.TLS, unsafe.Pointer)
121979  	XxRealloc  func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
121980  	XxSize     func(*crt.TLS, unsafe.Pointer) int32
121981  	XxRoundup  func(*crt.TLS, int32) int32
121982  	XxInit     func(*crt.TLS, unsafe.Pointer) int32
121983  	XxShutdown func(*crt.TLS, unsafe.Pointer)
121984  	XpAppData  unsafe.Pointer
121985  } // t139 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{}}
121986  
121987  type Xsqlite3_mutex_methods struct {
121988  	XxMutexInit    func(*crt.TLS) int32
121989  	XxMutexEnd     func(*crt.TLS) int32
121990  	XxMutexAlloc   func(*crt.TLS, int32) unsafe.Pointer
121991  	XxMutexFree    func(*crt.TLS, unsafe.Pointer)
121992  	XxMutexEnter   func(*crt.TLS, unsafe.Pointer)
121993  	XxMutexTry     func(*crt.TLS, unsafe.Pointer) int32
121994  	XxMutexLeave   func(*crt.TLS, unsafe.Pointer)
121995  	XxMutexHeld    func(*crt.TLS, unsafe.Pointer) int32
121996  	XxMutexNotheld func(*crt.TLS, unsafe.Pointer) int32
121997  } // t140 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}
121998  
121999  type Xsqlite3_pcache_methods2 struct {
122000  	XiVersion   int32
122001  	XpArg       unsafe.Pointer
122002  	XxInit      func(*crt.TLS, unsafe.Pointer) int32
122003  	XxShutdown  func(*crt.TLS, unsafe.Pointer)
122004  	XxCreate    func(*crt.TLS, int32, int32, int32) unsafe.Pointer
122005  	XxCachesize func(*crt.TLS, unsafe.Pointer, int32)
122006  	XxPagecount func(*crt.TLS, unsafe.Pointer) int32
122007  	XxFetch     func(*crt.TLS, unsafe.Pointer, uint32, int32) unsafe.Pointer
122008  	XxUnpin     func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32)
122009  	XxRekey     func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, uint32, uint32)
122010  	XxTruncate  func(*crt.TLS, unsafe.Pointer, uint32)
122011  	XxDestroy   func(*crt.TLS, unsafe.Pointer)
122012  	XxShrink    func(*crt.TLS, unsafe.Pointer)
122013  } // t141 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{})}
122014  
122015  type XFuncDefHash struct{ Xa [23]unsafe.Pointer } // t142 struct{a [23]*struct{}}
122016  
122017  type XToken struct {
122018  	Xz *int8
122019  	Xn uint32
122020  } // t143 struct{z *int8,n uint32}
122021  
122022  type Tsqlite3StatType struct {
122023  	XnowValue [10]uint32
122024  	XmxValue  [10]uint32
122025  } // t144 struct{nowValue [10]uint32,mxValue [10]uint32}
122026  
122027  type Xsqlite3_mutex struct {
122028  	Xmutex crt.Xpthread_mutex_t
122029  	Xid    int32
122030  	XnRef  int32
122031  	Xowner uint32
122032  	Xtrace int32
122033  } // t145 struct{mutex union{__data struct{__lock int32,__count uint32,__owner int32,__kind int32,__nusers uint32, union{__elision_data struct{__espins int16,__elision int16},__list struct{__next *struct{}}}},__size [24]int8,__align int32},id int32,nRef int32,owner uint32,trace int32}
122034  
122035  type XHash struct {
122036  	Xhtsize uint32
122037  	Xcount  uint32
122038  	Xfirst  unsafe.Pointer
122039  	Xht     unsafe.Pointer
122040  } // t146 struct{htsize uint32,count uint32,first *struct{},ht *struct{}}
122041  
122042  type XDb struct {
122043  	XzDbSName     *int8
122044  	XpBt          unsafe.Pointer
122045  	Xsafety_level uint8
122046  	XbSyncSet     uint8
122047  	XpSchema      unsafe.Pointer
122048  } // t147 struct{zDbSName *int8,pBt *struct{},safety_level uint8,bSyncSet uint8,pSchema *struct{}}
122049  
122050  type Xsqlite3 struct {
122051  	XpVfs                   unsafe.Pointer
122052  	XpVdbe                  unsafe.Pointer
122053  	XpDfltColl              unsafe.Pointer
122054  	Xmutex                  unsafe.Pointer
122055  	XaDb                    unsafe.Pointer
122056  	XnDb                    int32
122057  	Xflags                  int32
122058  	XlastRowid              int64
122059  	XszMmap                 int64
122060  	XopenFlags              uint32
122061  	XerrCode                int32
122062  	XerrMask                int32
122063  	XiSysErrno              int32
122064  	XdbOptFlags             uint16
122065  	Xenc                    uint8
122066  	XautoCommit             uint8
122067  	Xtemp_store             uint8
122068  	XmallocFailed           uint8
122069  	XbBenignMalloc          uint8
122070  	XdfltLockMode           uint8
122071  	XnextAutovac            int8
122072  	XsuppressErr            uint8
122073  	XvtabOnConflict         uint8
122074  	XisTransactionSavepoint uint8
122075  	XmTrace                 uint8
122076  	XskipBtreeMutex         uint8
122077  	XnSqlExec               uint8
122078  	XnextPagesize           int32
122079  	Xmagic                  uint32
122080  	XnChange                int32
122081  	XnTotalChange           int32
122082  	XaLimit                 [12]int32
122083  	XnMaxSorterMmap         int32
122084  	Xinit                   t148
122085  	XnVdbeActive            int32
122086  	XnVdbeRead              int32
122087  	XnVdbeWrite             int32
122088  	XnVdbeExec              int32
122089  	XnVDestroy              int32
122090  	XnExtension             int32
122091  	XaExtension             *unsafe.Pointer
122092  	XxTrace                 func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32
122093  	XpTraceArg              unsafe.Pointer
122094  	XxProfile               func(*crt.TLS, unsafe.Pointer, *int8, uint64)
122095  	XpProfileArg            unsafe.Pointer
122096  	XpCommitArg             unsafe.Pointer
122097  	XxCommitCallback        func(*crt.TLS, unsafe.Pointer) int32
122098  	XpRollbackArg           unsafe.Pointer
122099  	XxRollbackCallback      func(*crt.TLS, unsafe.Pointer)
122100  	XpUpdateArg             unsafe.Pointer
122101  	XxUpdateCallback        func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, int64)
122102  	XxWalCallback           func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8, int32) int32
122103  	XpWalArg                unsafe.Pointer
122104  	XxCollNeeded            func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *int8)
122105  	XxCollNeeded16          func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, unsafe.Pointer)
122106  	XpCollNeededArg         unsafe.Pointer
122107  	XpErr                   unsafe.Pointer
122108  	Xu1                     t149
122109  	Xlookaside              t150
122110  	XxAuth                  func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32
122111  	XpAuthArg               unsafe.Pointer
122112  	XxProgress              func(*crt.TLS, unsafe.Pointer) int32
122113  	XpProgressArg           unsafe.Pointer
122114  	XnProgressOps           uint32
122115  	XnVTrans                int32
122116  	XaModule                XHash
122117  	XpVtabCtx               unsafe.Pointer
122118  	XaVTrans                *unsafe.Pointer
122119  	XpDisconnect            unsafe.Pointer
122120  	XaFunc                  XHash
122121  	XaCollSeq               XHash
122122  	XbusyHandler            t75
122123  	XaDbStatic              [2]XDb
122124  	XpSavepoint             unsafe.Pointer
122125  	XbusyTimeout            int32
122126  	XnSavepoint             int32
122127  	XnStatement             int32
122128  	XnDeferredCons          int64
122129  	XnDeferredImmCons       int64
122130  	XpnBytesFreed           *int32
122131  } // t151 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}
122132  
122133  type XBtLock struct {
122134  	XpBtree unsafe.Pointer
122135  	XiTable uint32
122136  	XeLock  uint8
122137  	XpNext  unsafe.Pointer
122138  } // t152 struct{pBtree *struct{},iTable uint32,eLock uint8,pNext *struct{}}
122139  
122140  type XBtree struct {
122141  	Xdb             unsafe.Pointer
122142  	XpBt            unsafe.Pointer
122143  	XinTrans        uint8
122144  	Xsharable       uint8
122145  	Xlocked         uint8
122146  	XhasIncrblobCur uint8
122147  	XwantToLock     int32
122148  	XnBackup        int32
122149  	XiDataVersion   uint32
122150  	XpNext          unsafe.Pointer
122151  	XpPrev          unsafe.Pointer
122152  	Xlock           XBtLock
122153  } // t153 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{}}}
122154  
122155  type XPager struct {
122156  	XpVfs              unsafe.Pointer
122157  	XexclusiveMode     uint8
122158  	XjournalMode       uint8
122159  	XuseJournal        uint8
122160  	XnoSync            uint8
122161  	XfullSync          uint8
122162  	XextraSync         uint8
122163  	XckptSyncFlags     uint8
122164  	XwalSyncFlags      uint8
122165  	XsyncFlags         uint8
122166  	XtempFile          uint8
122167  	XnoLock            uint8
122168  	XreadOnly          uint8
122169  	XmemDb             uint8
122170  	XeState            uint8
122171  	XeLock             uint8
122172  	XchangeCountDone   uint8
122173  	XsetMaster         uint8
122174  	XdoNotSpill        uint8
122175  	XsubjInMemory      uint8
122176  	XbUseFetch         uint8
122177  	XhasHeldSharedLock uint8
122178  	XdbSize            uint32
122179  	XdbOrigSize        uint32
122180  	XdbFileSize        uint32
122181  	XdbHintSize        uint32
122182  	XerrCode           int32
122183  	XnRec              int32
122184  	XcksumInit         uint32
122185  	XnSubRec           uint32
122186  	XpInJournal        unsafe.Pointer
122187  	Xfd                unsafe.Pointer
122188  	Xjfd               unsafe.Pointer
122189  	Xsjfd              unsafe.Pointer
122190  	XjournalOff        int64
122191  	XjournalHdr        int64
122192  	XpBackup           unsafe.Pointer
122193  	XaSavepoint        unsafe.Pointer
122194  	XnSavepoint        int32
122195  	XiDataVersion      uint32
122196  	XdbFileVers        [16]int8
122197  	XnMmapOut          int32
122198  	XszMmap            int64
122199  	XpMmapFreelist     unsafe.Pointer
122200  	XnExtra            uint16
122201  	XnReserve          int16
122202  	XvfsFlags          uint32
122203  	XsectorSize        uint32
122204  	XpageSize          int32
122205  	XmxPgno            uint32
122206  	XjournalSizeLimit  int64
122207  	XzFilename         *int8
122208  	XzJournal          *int8
122209  	XxBusyHandler      func(*crt.TLS, unsafe.Pointer) int32
122210  	XpBusyHandlerArg   unsafe.Pointer
122211  	XaStat             [3]int32
122212  	XxReiniter         func(*crt.TLS, unsafe.Pointer)
122213  	XxGet              func(*crt.TLS, unsafe.Pointer, uint32, *unsafe.Pointer, int32) int32
122214  	XpTmpSpace         *int8
122215  	XpPCache           unsafe.Pointer
122216  	XpWal              unsafe.Pointer
122217  	XzWal              *int8
122218  } // t154 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}
122219  
122220  type XSchema struct {
122221  	Xschema_cookie int32
122222  	XiGeneration   int32
122223  	XtblHash       XHash
122224  	XidxHash       XHash
122225  	XtrigHash      XHash
122226  	XfkeyHash      XHash
122227  	XpSeqTab       unsafe.Pointer
122228  	Xfile_format   uint8
122229  	Xenc           uint8
122230  	XschemaFlags   uint16
122231  	Xcache_size    int32
122232  } // t155 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}
122233  
122234  type XHashElem struct {
122235  	Xnext unsafe.Pointer
122236  	Xprev unsafe.Pointer
122237  	Xdata unsafe.Pointer
122238  	XpKey *int8
122239  } // t156 struct{next *struct{},prev *struct{},data *struct{},pKey *int8}
122240  
122241  type T_ht struct {
122242  	Xcount int32
122243  	Xchain unsafe.Pointer
122244  } // t157 struct{count int32,chain *struct{}}
122245  
122246  type XTrigger struct {
122247  	XzName      *int8
122248  	Xtable      *int8
122249  	Xop         uint8
122250  	Xtr_tm      uint8
122251  	XpWhen      unsafe.Pointer
122252  	XpColumns   unsafe.Pointer
122253  	XpSchema    unsafe.Pointer
122254  	XpTabSchema unsafe.Pointer
122255  	Xstep_list  unsafe.Pointer
122256  	XpNext      unsafe.Pointer
122257  } // t158 struct{zName *int8,table *int8,op uint8,tr_tm uint8,pWhen *struct{},pColumns *struct{},pSchema *struct{},pTabSchema *struct{},step_list *struct{},pNext *struct{}}
122258  
122259  type XTable struct {
122260  	XzName        *int8
122261  	XaCol         unsafe.Pointer
122262  	XpIndex       unsafe.Pointer
122263  	XpSelect      unsafe.Pointer
122264  	XpFKey        unsafe.Pointer
122265  	XzColAff      *int8
122266  	XpCheck       unsafe.Pointer
122267  	Xtnum         int32
122268  	XnTabRef      uint32
122269  	XtabFlags     uint32
122270  	XiPKey        int16
122271  	XnCol         int16
122272  	XnRowLogEst   int16
122273  	XszTabRow     int16
122274  	XkeyConf      uint8
122275  	XaddColOffset int32
122276  	XnModuleArg   int32
122277  	XazModuleArg  **int8
122278  	XpVTable      unsafe.Pointer
122279  	XpTrigger     unsafe.Pointer
122280  	XpSchema      unsafe.Pointer
122281  	XpNextZombie  unsafe.Pointer
122282  } // t159 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{}}
122283  
122284  type TVdbe struct {
122285  	Xdb                 unsafe.Pointer
122286  	XpPrev              unsafe.Pointer
122287  	XpNext              unsafe.Pointer
122288  	XpParse             unsafe.Pointer
122289  	XnVar               int16
122290  	Xmagic              uint32
122291  	XnMem               int32
122292  	XnCursor            int32
122293  	XcacheCtr           uint32
122294  	Xpc                 int32
122295  	Xrc                 int32
122296  	XnChange            int32
122297  	XiStatement         int32
122298  	XiCurrentTime       int64
122299  	XnFkConstraint      int64
122300  	XnStmtDefCons       int64
122301  	XnStmtDefImmCons    int64
122302  	XaOp                unsafe.Pointer
122303  	XaMem               unsafe.Pointer
122304  	XapArg              *unsafe.Pointer
122305  	XaColName           unsafe.Pointer
122306  	XpResultSet         unsafe.Pointer
122307  	XzErrMsg            *int8
122308  	XapCsr              *unsafe.Pointer
122309  	XaVar               unsafe.Pointer
122310  	XpVList             *int32
122311  	XstartTime          int64
122312  	XnOp                int32
122313  	XrcApp              int32
122314  	XnResColumn         uint16
122315  	XerrorAction        uint8
122316  	XminWriteFileFormat uint8
122317  	Xexpired            int16
122318  	XbtreeMask          uint32
122319  	XlockMask           uint32
122320  	XaCounter           [5]uint32
122321  	XzSql               *int8
122322  	XpFree              unsafe.Pointer
122323  	XpFrame             unsafe.Pointer
122324  	XpDelFrame          unsafe.Pointer
122325  	XnFrame             int32
122326  	Xexpmask            uint32
122327  	XpProgram           unsafe.Pointer
122328  	XpAuxData           unsafe.Pointer
122329  } // t160 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{}}
122330  
122331  type XDateTime struct {
122332  	XiJD      int64
122333  	XY        int32
122334  	XM        int32
122335  	XD        int32
122336  	Xh        int32
122337  	Xm        int32
122338  	Xtz       int32
122339  	Xs        float64
122340  	XvalidJD  int8
122341  	XrawS     int8
122342  	XvalidYMD int8
122343  	XvalidHMS int8
122344  	XvalidTZ  int8
122345  	XtzSet    int8
122346  	XisError  int8
122347  } // t161 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}
122348  
122349  type Xsqlite3_context struct {
122350  	XpOut        unsafe.Pointer
122351  	XpFunc       unsafe.Pointer
122352  	XpMem        unsafe.Pointer
122353  	XpVdbe       unsafe.Pointer
122354  	XiOp         int32
122355  	XisError     int32
122356  	XskipFlag    uint8
122357  	XfErrorOrAux uint8
122358  	Xargc        uint8
122359  	Xargv        [1]unsafe.Pointer
122360  } // t162 struct{pOut *struct{},pFunc *struct{},pMem *struct{},pVdbe *struct{},iOp int32,isError int32,skipFlag uint8,fErrorOrAux uint8,argc uint8,argv [1]*struct{}}
122361  
122362  type XMem struct {
122363  	Xu          t163
122364  	Xflags      uint16
122365  	Xenc        uint8
122366  	XeSubtype   uint8
122367  	Xn          int32
122368  	Xz          *int8
122369  	XzMalloc    *int8
122370  	XszMalloc   int32
122371  	XuTemp      uint32
122372  	Xdb         unsafe.Pointer
122373  	XxDel       func(*crt.TLS, unsafe.Pointer)
122374  	XpScopyFrom unsafe.Pointer
122375  	XpFiller    unsafe.Pointer
122376  } // t164 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{}}
122377  
122378  type XFuncDef struct {
122379  	XnArg      int8
122380  	XfuncFlags uint16
122381  	XpUserData unsafe.Pointer
122382  	XpNext     unsafe.Pointer
122383  	XxSFunc    func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer)
122384  	XxFinalize func(*crt.TLS, unsafe.Pointer)
122385  	XzName     *int8
122386  	Xu         t165
122387  } // t166 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{}}}
122388  
122389  type Xsqlite3_file struct{ XpMethods unsafe.Pointer } // t167 struct{pMethods *struct{}}
122390  
122391  type Xsqlite3_io_methods struct {
122392  	XiVersion               int32
122393  	XxClose                 func(*crt.TLS, unsafe.Pointer) int32
122394  	XxRead                  func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32
122395  	XxWrite                 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32
122396  	XxTruncate              func(*crt.TLS, unsafe.Pointer, int64) int32
122397  	XxSync                  func(*crt.TLS, unsafe.Pointer, int32) int32
122398  	XxFileSize              func(*crt.TLS, unsafe.Pointer, *int64) int32
122399  	XxLock                  func(*crt.TLS, unsafe.Pointer, int32) int32
122400  	XxUnlock                func(*crt.TLS, unsafe.Pointer, int32) int32
122401  	XxCheckReservedLock     func(*crt.TLS, unsafe.Pointer, *int32) int32
122402  	XxFileControl           func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer) int32
122403  	XxSectorSize            func(*crt.TLS, unsafe.Pointer) int32
122404  	XxDeviceCharacteristics func(*crt.TLS, unsafe.Pointer) int32
122405  	XxShmMap                func(*crt.TLS, unsafe.Pointer, int32, int32, int32, *unsafe.Pointer) int32
122406  	XxShmLock               func(*crt.TLS, unsafe.Pointer, int32, int32, int32) int32
122407  	XxShmBarrier            func(*crt.TLS, unsafe.Pointer)
122408  	XxShmUnmap              func(*crt.TLS, unsafe.Pointer, int32) int32
122409  	XxFetch                 func(*crt.TLS, unsafe.Pointer, int64, int32, *unsafe.Pointer) int32
122410  	XxUnfetch               func(*crt.TLS, unsafe.Pointer, int64, unsafe.Pointer) int32
122411  } // t168 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}
122412  
122413  type Xsqlite3_vfs struct {
122414  	XiVersion          int32
122415  	XszOsFile          int32
122416  	XmxPathname        int32
122417  	XpNext             unsafe.Pointer
122418  	XzName             *int8
122419  	XpAppData          unsafe.Pointer
122420  	XxOpen             func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, int32, *int32) int32
122421  	XxDelete           func(*crt.TLS, unsafe.Pointer, *int8, int32) int32
122422  	XxAccess           func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32
122423  	XxFullPathname     func(*crt.TLS, unsafe.Pointer, *int8, int32, *int8) int32
122424  	XxDlOpen           func(*crt.TLS, unsafe.Pointer, *int8) unsafe.Pointer
122425  	XxDlError          func(*crt.TLS, unsafe.Pointer, int32, *int8)
122426  	XxDlSym            func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8) func(*crt.TLS)
122427  	XxDlClose          func(*crt.TLS, unsafe.Pointer, unsafe.Pointer)
122428  	XxRandomness       func(*crt.TLS, unsafe.Pointer, int32, *int8) int32
122429  	XxSleep            func(*crt.TLS, unsafe.Pointer, int32) int32
122430  	XxCurrentTime      func(*crt.TLS, unsafe.Pointer, *float64) int32
122431  	XxGetLastError     func(*crt.TLS, unsafe.Pointer, int32, *int8) int32
122432  	XxCurrentTimeInt64 func(*crt.TLS, unsafe.Pointer, *int64) int32
122433  	XxSetSystemCall    func(*crt.TLS, unsafe.Pointer, *int8, func(*crt.TLS)) int32
122434  	XxGetSystemCall    func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS)
122435  	XxNextSystemCall   func(*crt.TLS, unsafe.Pointer, *int8) *int8
122436  } // t169 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}
122437  
122438  type TBenignMallocHooks struct {
122439  	XxBenignBegin func(*crt.TLS)
122440  	XxBenignEnd   func(*crt.TLS)
122441  } // t170 struct{xBenignBegin *func(),xBenignEnd *func()}
122442  
122443  type Xsqlite3_debug_mutex struct {
122444  	Xid  int32
122445  	Xcnt int32
122446  } // t171 struct{id int32,cnt int32}
122447  
122448  type TMem0Global struct {
122449  	Xmutex          unsafe.Pointer
122450  	XalarmThreshold int64
122451  	XpScratchEnd    unsafe.Pointer
122452  	XpScratchFree   unsafe.Pointer
122453  	XnScratchFree   uint32
122454  	XnearlyFull     int32
122455  } // t172 struct{mutex *struct{},alarmThreshold int64,pScratchEnd *struct{},pScratchFree *struct{},nScratchFree uint32,nearlyFull int32}
122456  
122457  type XScratchFreeslot struct{ XpNext unsafe.Pointer } // t173 struct{pNext *struct{}}
122458  
122459  type Xet_info struct {
122460  	Xfmttype int8
122461  	Xbase    uint8
122462  	Xflags   uint8
122463  	Xtype    uint8
122464  	Xcharset uint8
122465  	Xprefix  uint8
122466  } // t174 struct{fmttype int8,base uint8,flags uint8,type uint8,charset uint8,prefix uint8}
122467  
122468  type XStrAccum struct {
122469  	Xdb          unsafe.Pointer
122470  	XzBase       *int8
122471  	XzText       *int8
122472  	XnChar       uint32
122473  	XnAlloc      uint32
122474  	XmxAlloc     uint32
122475  	XaccError    uint8
122476  	XprintfFlags uint8
122477  } // t175 struct{db *struct{},zBase *int8,zText *int8,nChar uint32,nAlloc uint32,mxAlloc uint32,accError uint8,printfFlags uint8}
122478  
122479  type XPrintfArguments struct {
122480  	XnArg  int32
122481  	XnUsed int32
122482  	XapArg *unsafe.Pointer
122483  } // t176 struct{nArg int32,nUsed int32,apArg **struct{}}
122484  
122485  type TSrcList_item struct {
122486  	XpSchema     unsafe.Pointer
122487  	XzDatabase   *int8
122488  	XzName       *int8
122489  	XzAlias      *int8
122490  	XpTab        unsafe.Pointer
122491  	XpSelect     unsafe.Pointer
122492  	XaddrFillSub int32
122493  	XregReturn   int32
122494  	XregResult   int32
122495  	Xfg          t177
122496  	XiSelectId   uint8
122497  	XiCursor     int32
122498  	XpOn         unsafe.Pointer
122499  	XpUsing      unsafe.Pointer
122500  	XcolUsed     uint64
122501  	Xu1          t178
122502  	XpIBIndex    unsafe.Pointer
122503  } // t179 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{}}
122504  
122505  type XSrcList struct {
122506  	XnSrc   int32
122507  	XnAlloc uint32
122508  	Xa      [1]TSrcList_item
122509  } // t180 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{}}}
122510  
122511  type TCte struct {
122512  	XzName   *int8
122513  	XpCols   unsafe.Pointer
122514  	XpSelect unsafe.Pointer
122515  	XzCteErr *int8
122516  } // t181 struct{zName *int8,pCols *struct{},pSelect *struct{},zCteErr *int8}
122517  
122518  type XWith struct {
122519  	XnCte   int32
122520  	XpOuter unsafe.Pointer
122521  	Xa      [1]TCte
122522  } // t182 struct{nCte int32,pOuter *struct{},a [1]struct{zName *int8,pCols *struct{},pSelect *struct{},zCteErr *int8}}
122523  
122524  type TExprList_item struct {
122525  	XpExpr     unsafe.Pointer
122526  	XzName     *int8
122527  	XzSpan     *int8
122528  	XsortOrder uint8
122529  	Xdone      int8
122530  	Xu         t183
122531  } // t184 struct{pExpr *struct{},zName *int8,zSpan *int8,sortOrder uint8,done int8,u union{x struct{iOrderByCol uint16,iAlias uint16},iConstExprReg int32}}
122532  
122533  type XExprList struct {
122534  	XnExpr  int32
122535  	XnAlloc int32
122536  	Xa      [1]TExprList_item
122537  } // t185 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}}}
122538  
122539  type XSelect struct {
122540  	XpEList       unsafe.Pointer
122541  	Xop           uint8
122542  	XnSelectRow   int16
122543  	XselFlags     uint32
122544  	XiLimit       int32
122545  	XiOffset      int32
122546  	XzSelName     [12]int8
122547  	XaddrOpenEphm [2]int32
122548  	XpSrc         unsafe.Pointer
122549  	XpWhere       unsafe.Pointer
122550  	XpGroupBy     unsafe.Pointer
122551  	XpHaving      unsafe.Pointer
122552  	XpOrderBy     unsafe.Pointer
122553  	XpPrior       unsafe.Pointer
122554  	XpNext        unsafe.Pointer
122555  	XpLimit       unsafe.Pointer
122556  	XpOffset      unsafe.Pointer
122557  	XpWith        unsafe.Pointer
122558  } // t186 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{}}
122559  
122560  type XExpr struct {
122561  	Xop              uint8
122562  	Xaffinity        int8
122563  	Xflags           uint32
122564  	Xu               t187
122565  	XpLeft           unsafe.Pointer
122566  	XpRight          unsafe.Pointer
122567  	Xx               t188
122568  	XnHeight         int32
122569  	XiTable          int32
122570  	XiColumn         int16
122571  	XiAgg            int16
122572  	XiRightJoinTable int16
122573  	Xop2             uint8
122574  	XpAggInfo        unsafe.Pointer
122575  	XpTab            unsafe.Pointer
122576  } // t189 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{}}
122577  
122578  type Tsqlite3PrngType struct {
122579  	XisInit uint8
122580  	Xi      uint8
122581  	Xj      uint8
122582  	Xs      [256]uint8
122583  } // t190 struct{isInit uint8,i uint8,j uint8,s [256]uint8}
122584  
122585  type XSQLiteThread struct {
122586  	Xtid   uint32
122587  	Xdone  int32
122588  	XpOut  unsafe.Pointer
122589  	XxTask func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
122590  	XpIn   unsafe.Pointer
122591  } // t191 struct{tid uint32,done int32,pOut *struct{},xTask *func(*struct{})*struct{},pIn *struct{}}
122592  
122593  type XColumn struct {
122594  	XzName    *int8
122595  	XpDflt    unsafe.Pointer
122596  	XzColl    *int8
122597  	XnotNull  uint8
122598  	Xaffinity int8
122599  	XszEst    uint8
122600  	XcolFlags uint8
122601  } // t192 struct{zName *int8,pDflt *struct{},zColl *int8,notNull uint8,affinity int8,szEst uint8,colFlags uint8}
122602  
122603  type TyColCache struct {
122604  	XiTable  int32
122605  	XiColumn int16
122606  	XtempReg uint8
122607  	XiLevel  int32
122608  	XiReg    int32
122609  	Xlru     int32
122610  } // t193 struct{iTable int32,iColumn int16,tempReg uint8,iLevel int32,iReg int32,lru int32}
122611  
122612  type XParse struct {
122613  	Xdb               unsafe.Pointer
122614  	XzErrMsg          *int8
122615  	XpVdbe            unsafe.Pointer
122616  	Xrc               int32
122617  	XcolNamesSet      uint8
122618  	XcheckSchema      uint8
122619  	Xnested           uint8
122620  	XnTempReg         uint8
122621  	XisMultiWrite     uint8
122622  	XmayAbort         uint8
122623  	XhasCompound      uint8
122624  	XokConstFactor    uint8
122625  	XdisableLookaside uint8
122626  	XnColCache        uint8
122627  	XnRangeReg        int32
122628  	XiRangeReg        int32
122629  	XnErr             int32
122630  	XnTab             int32
122631  	XnMem             int32
122632  	XnOpAlloc         int32
122633  	XszOpAlloc        int32
122634  	XckBase           int32
122635  	XiSelfTab         int32
122636  	XiCacheLevel      int32
122637  	XiCacheCnt        int32
122638  	XnLabel           int32
122639  	XaLabel           *int32
122640  	XpConstExpr       unsafe.Pointer
122641  	XconstraintName   XToken
122642  	XwriteMask        uint32
122643  	XcookieMask       uint32
122644  	XregRowid         int32
122645  	XregRoot          int32
122646  	XnMaxArg          int32
122647  	XnSelect          int32
122648  	XnSelectIndent    int32
122649  	XnTableLock       int32
122650  	XaTableLock       unsafe.Pointer
122651  	XpAinc            unsafe.Pointer
122652  	XpToplevel        unsafe.Pointer
122653  	XpTriggerTab      unsafe.Pointer
122654  	XaddrCrTab        int32
122655  	XnQueryLoop       uint32
122656  	Xoldmask          uint32
122657  	Xnewmask          uint32
122658  	XeTriggerOp       uint8
122659  	XeOrconf          uint8
122660  	XdisableTriggers  uint8
122661  	XaColCache        [10]TyColCache
122662  	XaTempReg         [8]int32
122663  	XsNameToken       XToken
122664  	XsLastToken       XToken
122665  	XnVar             int16
122666  	XiPkSortOrder     uint8
122667  	Xexplain          uint8
122668  	XdeclareVtab      uint8
122669  	XnVtabLock        int32
122670  	XnHeight          int32
122671  	XiSelectId        int32
122672  	XiNextSelectId    int32
122673  	XpVList           *int32
122674  	XpReprepare       unsafe.Pointer
122675  	XzTail            *int8
122676  	XpNewTable        unsafe.Pointer
122677  	XpNewTrigger      unsafe.Pointer
122678  	XzAuthContext     *int8
122679  	XsArg             XToken
122680  	XapVtabLock       *unsafe.Pointer
122681  	XpZombieTab       unsafe.Pointer
122682  	XpTriggerPrg      unsafe.Pointer
122683  	XpWith            unsafe.Pointer
122684  	XpWithToFree      unsafe.Pointer
122685  } // t194 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{}}
122686  
122687  type Tunix_syscall struct {
122688  	XzName    *int8
122689  	XpCurrent func(*crt.TLS)
122690  	XpDefault func(*crt.TLS)
122691  } // t195 struct{zName *int8,pCurrent *func(),pDefault *func()}
122692  
122693  type TunixFileId struct {
122694  	Xdev uint64
122695  	Xino uint64
122696  } // t196 struct{dev uint64,ino uint64}
122697  
122698  type XunixInodeInfo struct {
122699  	XfileId       TunixFileId
122700  	XnShared      int32
122701  	XeFileLock    uint8
122702  	XbProcessLock uint8
122703  	XnRef         int32
122704  	XpShmNode     unsafe.Pointer
122705  	XnLock        int32
122706  	XpUnused      unsafe.Pointer
122707  	XpNext        unsafe.Pointer
122708  	XpPrev        unsafe.Pointer
122709  } // t197 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{}}
122710  
122711  type XunixFile struct {
122712  	XpMethod        unsafe.Pointer
122713  	XpVfs           unsafe.Pointer
122714  	XpInode         unsafe.Pointer
122715  	Xh              int32
122716  	XeFileLock      uint8
122717  	XctrlFlags      uint16
122718  	XlastErrno      int32
122719  	XlockingContext unsafe.Pointer
122720  	XpUnused        unsafe.Pointer
122721  	XzPath          *int8
122722  	XpShm           unsafe.Pointer
122723  	XszChunk        int32
122724  	XnFetchOut      int32
122725  	XmmapSize       int64
122726  	XmmapSizeActual int64
122727  	XmmapSizeMax    int64
122728  	XpMapRegion     unsafe.Pointer
122729  	XtransCntrChng  uint8
122730  	XdbUpdate       uint8
122731  	XinNormalWrite  uint8
122732  } // t198 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}
122733  
122734  type XUnixUnusedFd struct {
122735  	Xfd    int32
122736  	Xflags int32
122737  	XpNext unsafe.Pointer
122738  } // t199 struct{fd int32,flags int32,pNext *struct{}}
122739  
122740  type XunixShmNode struct {
122741  	XpInode     unsafe.Pointer
122742  	Xmutex      unsafe.Pointer
122743  	XzFilename  *int8
122744  	Xh          int32
122745  	XszRegion   int32
122746  	XnRegion    uint16
122747  	XisReadonly uint8
122748  	XapRegion   **int8
122749  	XnRef       int32
122750  	XpFirst     unsafe.Pointer
122751  	XexclMask   uint8
122752  	XsharedMask uint8
122753  	XnextShmId  uint8
122754  } // t200 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}
122755  
122756  type Tflock struct {
122757  	Xl_type   int16
122758  	Xl_whence int16
122759  	Xl_start  int64
122760  	Xl_len    int64
122761  	Xl_pid    int32
122762  } // t201 struct{l_type int16,l_whence int16,l_start int64,l_len int64,l_pid int32}
122763  
122764  type TunixShm struct {
122765  	XpShmNode   unsafe.Pointer
122766  	XpNext      unsafe.Pointer
122767  	XhasMutex   uint8
122768  	Xid         uint8
122769  	XsharedMask uint16
122770  	XexclMask   uint16
122771  } // t202 struct{pShmNode *struct{},pNext *struct{},hasMutex uint8,id uint8,sharedMask uint16,exclMask uint16}
122772  
122773  type XBitvec struct {
122774  	XiSize    uint32
122775  	XnSet     uint32
122776  	XiDivisor uint32
122777  	Xu        t203
122778  } // t204 struct{iSize uint32,nSet uint32,iDivisor uint32,u union{aBitmap [500]uint8,aHash [125]uint32,apSub [125]*struct{}}}
122779  
122780  type XPgHdr struct {
122781  	XpPage      unsafe.Pointer
122782  	XpData      unsafe.Pointer
122783  	XpExtra     unsafe.Pointer
122784  	XpDirty     unsafe.Pointer
122785  	XpPager     unsafe.Pointer
122786  	Xpgno       uint32
122787  	Xflags      uint16
122788  	XnRef       int16
122789  	XpCache     unsafe.Pointer
122790  	XpDirtyNext unsafe.Pointer
122791  	XpDirtyPrev unsafe.Pointer
122792  } // t205 struct{pPage *struct{},pData *struct{},pExtra *struct{},pDirty *struct{},pPager *struct{},pgno uint32,flags uint16,nRef int16,pCache *struct{},pDirtyNext *struct{},pDirtyPrev *struct{}}
122793  
122794  type XPCache struct {
122795  	XpDirty     unsafe.Pointer
122796  	XpDirtyTail unsafe.Pointer
122797  	XpSynced    unsafe.Pointer
122798  	XnRefSum    int32
122799  	XszCache    int32
122800  	XszSpill    int32
122801  	XszPage     int32
122802  	XszExtra    int32
122803  	XbPurgeable uint8
122804  	XeCreate    uint8
122805  	XxStress    func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32
122806  	XpStress    unsafe.Pointer
122807  	XpCache     unsafe.Pointer
122808  } // t206 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{}}
122809  
122810  type Xsqlite3_pcache_page struct {
122811  	XpBuf   unsafe.Pointer
122812  	XpExtra unsafe.Pointer
122813  } // t207 struct{pBuf *struct{},pExtra *struct{}}
122814  
122815  type TPCacheGlobal struct {
122816  	Xgrp            XPGroup
122817  	XisInit         int32
122818  	XseparateCache  int32
122819  	XnInitPage      int32
122820  	XszSlot         int32
122821  	XnSlot          int32
122822  	XnReserve       int32
122823  	XpStart         unsafe.Pointer
122824  	XpEnd           unsafe.Pointer
122825  	Xmutex          unsafe.Pointer
122826  	XpFree          unsafe.Pointer
122827  	XnFreeSlot      int32
122828  	XbUnderPressure int32
122829  } // t208 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}
122830  
122831  type XPgHdr1 struct {
122832  	Xpage        Xsqlite3_pcache_page
122833  	XiKey        uint32
122834  	XisPinned    uint8
122835  	XisBulkLocal uint8
122836  	XisAnchor    uint8
122837  	XpNext       unsafe.Pointer
122838  	XpCache      unsafe.Pointer
122839  	XpLruNext    unsafe.Pointer
122840  	XpLruPrev    unsafe.Pointer
122841  } // t209 struct{page struct{pBuf *struct{},pExtra *struct{}},iKey uint32,isPinned uint8,isBulkLocal uint8,isAnchor uint8,pNext *struct{},pCache *struct{},pLruNext *struct{},pLruPrev *struct{}}
122842  
122843  type XPGroup struct {
122844  	Xmutex        unsafe.Pointer
122845  	XnMaxPage     uint32
122846  	XnMinPage     uint32
122847  	XmxPinned     uint32
122848  	XnCurrentPage uint32
122849  	Xlru          XPgHdr1
122850  } // t210 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{}}}
122851  
122852  type XPCache1 struct {
122853  	XpGroup      unsafe.Pointer
122854  	XszPage      int32
122855  	XszExtra     int32
122856  	XszAlloc     int32
122857  	XbPurgeable  int32
122858  	XnMin        uint32
122859  	XnMax        uint32
122860  	Xn90pct      uint32
122861  	XiMaxKey     uint32
122862  	XnRecyclable uint32
122863  	XnPage       uint32
122864  	XnHash       uint32
122865  	XapHash      *unsafe.Pointer
122866  	XpFree       unsafe.Pointer
122867  	XpBulk       unsafe.Pointer
122868  } // t211 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{}}
122869  
122870  type XRowSet struct {
122871  	XpChunk  unsafe.Pointer
122872  	Xdb      unsafe.Pointer
122873  	XpEntry  unsafe.Pointer
122874  	XpLast   unsafe.Pointer
122875  	XpFresh  unsafe.Pointer
122876  	XpForest unsafe.Pointer
122877  	XnFresh  uint16
122878  	XrsFlags uint16
122879  	XiBatch  int32
122880  } // t212 struct{pChunk *struct{},db *struct{},pEntry *struct{},pLast *struct{},pFresh *struct{},pForest *struct{},nFresh uint16,rsFlags uint16,iBatch int32}
122881  
122882  type TRowSetEntry struct {
122883  	Xv      int64
122884  	XpRight unsafe.Pointer
122885  	XpLeft  unsafe.Pointer
122886  } // t213 struct{v int64,pRight *struct{},pLeft *struct{}}
122887  
122888  type TRowSetChunk struct {
122889  	XpNextChunk unsafe.Pointer
122890  	XaEntry     [63]TRowSetEntry
122891  } // t214 struct{pNextChunk *struct{},aEntry [63]struct{v int64,pRight *struct{},pLeft *struct{}}}
122892  
122893  type XWalIndexHdr struct {
122894  	XiVersion    uint32
122895  	Xunused      uint32
122896  	XiChange     uint32
122897  	XisInit      uint8
122898  	XbigEndCksum uint8
122899  	XszPage      uint16
122900  	XmxFrame     uint32
122901  	XnPage       uint32
122902  	XaFrameCksum [2]uint32
122903  	XaSalt       [2]uint32
122904  	XaCksum      [2]uint32
122905  } // t215 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}
122906  
122907  type XWal struct {
122908  	XpVfs                unsafe.Pointer
122909  	XpDbFd               unsafe.Pointer
122910  	XpWalFd              unsafe.Pointer
122911  	XiCallback           uint32
122912  	XmxWalSize           int64
122913  	XnWiData             int32
122914  	XszFirstBlock        int32
122915  	XapWiData            **uint32
122916  	XszPage              uint32
122917  	XreadLock            int16
122918  	XsyncFlags           uint8
122919  	XexclusiveMode       uint8
122920  	XwriteLock           uint8
122921  	XckptLock            uint8
122922  	XreadOnly            uint8
122923  	XtruncateOnCommit    uint8
122924  	XsyncHeader          uint8
122925  	XpadToSectorBoundary uint8
122926  	Xhdr                 XWalIndexHdr
122927  	XminFrame            uint32
122928  	XiReCksum            uint32
122929  	XzWalName            *int8
122930  	XnCkpt               uint32
122931  	XlockError           uint8
122932  } // t216 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}
122933  
122934  type XPagerSavepoint struct {
122935  	XiOffset      int64
122936  	XiHdrOffset   int64
122937  	XpInSavepoint unsafe.Pointer
122938  	XnOrig        uint32
122939  	XiSubRec      uint32
122940  	XaWalData     [4]uint32
122941  } // t217 struct{iOffset int64,iHdrOffset int64,pInSavepoint *struct{},nOrig uint32,iSubRec uint32,aWalData [4]uint32}
122942  
122943  type Xsqlite3_backup struct {
122944  	XpDestDb     unsafe.Pointer
122945  	XpDest       unsafe.Pointer
122946  	XiDestSchema uint32
122947  	XbDestLocked int32
122948  	XiNext       uint32
122949  	XpSrcDb      unsafe.Pointer
122950  	XpSrc        unsafe.Pointer
122951  	Xrc          int32
122952  	XnRemaining  uint32
122953  	XnPagecount  uint32
122954  	XisAttached  int32
122955  	XpNext       unsafe.Pointer
122956  } // t218 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{}}
122957  
122958  type XWalCkptInfo struct {
122959  	XnBackfill          uint32
122960  	XaReadMark          [5]uint32
122961  	XaLock              [8]uint8
122962  	XnBackfillAttempted uint32
122963  	XnotUsed0           uint32
122964  } // t219 struct{nBackfill uint32,aReadMark [5]uint32,aLock [8]uint8,nBackfillAttempted uint32,notUsed0 uint32}
122965  
122966  type TWalSegment struct {
122967  	XiNext  int32
122968  	XaIndex *uint16
122969  	XaPgno  *uint32
122970  	XnEntry int32
122971  	XiZero  int32
122972  } // t220 struct{iNext int32,aIndex *uint16,aPgno *uint32,nEntry int32,iZero int32}
122973  
122974  type XWalIterator struct {
122975  	XiPrior   int32
122976  	XnSegment int32
122977  	XaSegment [1]TWalSegment
122978  } // t221 struct{iPrior int32,nSegment int32,aSegment [1]struct{iNext int32,aIndex *uint16,aPgno *uint32,nEntry int32,iZero int32}}
122979  
122980  type TSublist struct {
122981  	XnList int32
122982  	XaList *uint16
122983  } // t222 struct{nList int32,aList *uint16}
122984  
122985  type XWalWriter struct {
122986  	XpWal       unsafe.Pointer
122987  	XpFd        unsafe.Pointer
122988  	XiSyncPoint int64
122989  	XsyncFlags  int32
122990  	XszPage     int32
122991  } // t223 struct{pWal *struct{},pFd *struct{},iSyncPoint int64,syncFlags int32,szPage int32}
122992  
122993  type XBtShared struct {
122994  	XpPager          unsafe.Pointer
122995  	Xdb              unsafe.Pointer
122996  	XpCursor         unsafe.Pointer
122997  	XpPage1          unsafe.Pointer
122998  	XopenFlags       uint8
122999  	XautoVacuum      uint8
123000  	XincrVacuum      uint8
123001  	XbDoTruncate     uint8
123002  	XinTransaction   uint8
123003  	Xmax1bytePayload uint8
123004  	XbtsFlags        uint16
123005  	XmaxLocal        uint16
123006  	XminLocal        uint16
123007  	XmaxLeaf         uint16
123008  	XminLeaf         uint16
123009  	XpageSize        uint32
123010  	XusableSize      uint32
123011  	XnTransaction    int32
123012  	XnPage           uint32
123013  	XpSchema         unsafe.Pointer
123014  	XxFreeSchema     func(*crt.TLS, unsafe.Pointer)
123015  	Xmutex           unsafe.Pointer
123016  	XpHasContent     unsafe.Pointer
123017  	XnRef            int32
123018  	XpNext           unsafe.Pointer
123019  	XpLock           unsafe.Pointer
123020  	XpWriter         unsafe.Pointer
123021  	XpTmpSpace       *uint8
123022  } // t224 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}
123023  
123024  type XCellInfo struct {
123025  	XnKey     int64
123026  	XpPayload *uint8
123027  	XnPayload uint32
123028  	XnLocal   uint16
123029  	XnSize    uint16
123030  } // t225 struct{nKey int64,pPayload *uint8,nPayload uint32,nLocal uint16,nSize uint16}
123031  
123032  type XBtCursor struct {
123033  	XpBtree        unsafe.Pointer
123034  	XpBt           unsafe.Pointer
123035  	XpNext         unsafe.Pointer
123036  	XaOverflow     *uint32
123037  	Xinfo          XCellInfo
123038  	XnKey          int64
123039  	XpKey          unsafe.Pointer
123040  	XpgnoRoot      uint32
123041  	XnOvflAlloc    int32
123042  	XskipNext      int32
123043  	XcurFlags      uint8
123044  	XcurPagerFlags uint8
123045  	XeState        uint8
123046  	Xhints         uint8
123047  	XiPage         int8
123048  	XcurIntKey     uint8
123049  	Xix            uint16
123050  	XaiIdx         [19]uint16
123051  	XpKeyInfo      unsafe.Pointer
123052  	XapPage        [20]unsafe.Pointer
123053  } // t226 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{}}
123054  
123055  type XIndex struct {
123056  	XzName         *int8
123057  	XaiColumn      *int16
123058  	XaiRowLogEst   *int16
123059  	XpTable        unsafe.Pointer
123060  	XzColAff       *int8
123061  	XpNext         unsafe.Pointer
123062  	XpSchema       unsafe.Pointer
123063  	XaSortOrder    *uint8
123064  	XazColl        **int8
123065  	XpPartIdxWhere unsafe.Pointer
123066  	XaColExpr      unsafe.Pointer
123067  	Xtnum          int32
123068  	XszIdxRow      int16
123069  	XnKeyCol       uint16
123070  	XnColumn       uint16
123071  	XonError       uint8
123072  	XidxType       int8
123073  } // t227 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}
123074  
123075  type XMemPage struct {
123076  	XisInit          uint8
123077  	XbBusy           uint8
123078  	XintKey          uint8
123079  	XintKeyLeaf      uint8
123080  	Xpgno            uint32
123081  	Xleaf            uint8
123082  	XhdrOffset       uint8
123083  	XchildPtrSize    uint8
123084  	Xmax1bytePayload uint8
123085  	XnOverflow       uint8
123086  	XmaxLocal        uint16
123087  	XminLocal        uint16
123088  	XcellOffset      uint16
123089  	XnFree           uint16
123090  	XnCell           uint16
123091  	XmaskPage        uint16
123092  	XaiOvfl          [4]uint16
123093  	XapOvfl          [4]*uint8
123094  	XpBt             unsafe.Pointer
123095  	XaData           *uint8
123096  	XaDataEnd        *uint8
123097  	XaCellIdx        *uint8
123098  	XaDataOfst       *uint8
123099  	XpDbPage         unsafe.Pointer
123100  	XxCellSize       func(*crt.TLS, unsafe.Pointer, *uint8) uint16
123101  	XxParseCell      func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer)
123102  } // t228 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{})}
123103  
123104  type XUnpackedRecord struct {
123105  	XpKeyInfo   unsafe.Pointer
123106  	XaMem       unsafe.Pointer
123107  	XnField     uint16
123108  	Xdefault_rc int8
123109  	XerrCode    uint8
123110  	Xr1         int8
123111  	Xr2         int8
123112  	XeqSeen     uint8
123113  } // t229 struct{pKeyInfo *struct{},aMem *struct{},nField uint16,default_rc int8,errCode uint8,r1 int8,r2 int8,eqSeen uint8}
123114  
123115  type XKeyInfo struct {
123116  	XnRef       uint32
123117  	Xenc        uint8
123118  	XnField     uint16
123119  	XnXField    uint16
123120  	Xdb         unsafe.Pointer
123121  	XaSortOrder *uint8
123122  	XaColl      [1]unsafe.Pointer
123123  } // t230 struct{nRef uint32,enc uint8,nField uint16,nXField uint16,db *struct{},aSortOrder *uint8,aColl [1]*struct{}}
123124  
123125  type XBtreePayload struct {
123126  	XpKey  unsafe.Pointer
123127  	XnKey  int64
123128  	XpData unsafe.Pointer
123129  	XaMem  unsafe.Pointer
123130  	XnMem  uint16
123131  	XnData int32
123132  	XnZero int32
123133  } // t231 struct{pKey *struct{},nKey int64,pData *struct{},aMem *struct{},nMem uint16,nData int32,nZero int32}
123134  
123135  type XCellArray struct {
123136  	XnCell  int32
123137  	XpRef   unsafe.Pointer
123138  	XapCell **uint8
123139  	XszCell *uint16
123140  } // t232 struct{nCell int32,pRef *struct{},apCell **uint8,szCell *uint16}
123141  
123142  type XIntegrityCk struct {
123143  	XpBt          unsafe.Pointer
123144  	XpPager       unsafe.Pointer
123145  	XaPgRef       *uint8
123146  	XnPage        uint32
123147  	XmxErr        int32
123148  	XnErr         int32
123149  	XmallocFailed int32
123150  	XzPfx         *int8
123151  	Xv1           int32
123152  	Xv2           int32
123153  	XerrMsg       XStrAccum
123154  	Xheap         *uint32
123155  } // t233 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}
123156  
123157  type XVdbeFrame struct {
123158  	Xv         unsafe.Pointer
123159  	XpParent   unsafe.Pointer
123160  	XaOp       unsafe.Pointer
123161  	XanExec    *int64
123162  	XaMem      unsafe.Pointer
123163  	XapCsr     *unsafe.Pointer
123164  	XaOnce     *uint8
123165  	Xtoken     unsafe.Pointer
123166  	XlastRowid int64
123167  	XpAuxData  unsafe.Pointer
123168  	XnCursor   int32
123169  	Xpc        int32
123170  	XnOp       int32
123171  	XnMem      int32
123172  	XnChildMem int32
123173  	XnChildCsr int32
123174  	XnChange   int32
123175  	XnDbChange int32
123176  } // t234 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}
123177  
123178  type XVdbeOp struct {
123179  	Xopcode   uint8
123180  	Xp4type   int8
123181  	Xp5       uint16
123182  	Xp1       int32
123183  	Xp2       int32
123184  	Xp3       int32
123185  	Xp4       t235
123186  	XzComment *int8
123187  } // t236 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}
123188  
123189  type XVdbeOpIter struct {
123190  	Xv     unsafe.Pointer
123191  	XapSub *unsafe.Pointer
123192  	XnSub  int32
123193  	XiAddr int32
123194  	XiSub  int32
123195  } // t237 struct{v *struct{},apSub **struct{},nSub int32,iAddr int32,iSub int32}
123196  
123197  type XSubProgram struct {
123198  	XaOp   unsafe.Pointer
123199  	XnOp   int32
123200  	XnMem  int32
123201  	XnCsr  int32
123202  	XaOnce *uint8
123203  	Xtoken unsafe.Pointer
123204  	XpNext unsafe.Pointer
123205  } // t238 struct{aOp *struct{},nOp int32,nMem int32,nCsr int32,aOnce *uint8,token *struct{},pNext *struct{}}
123206  
123207  type XVdbeOpList struct {
123208  	Xopcode uint8
123209  	Xp1     int8
123210  	Xp2     int8
123211  	Xp3     int8
123212  } // t239 struct{opcode uint8,p1 int8,p2 int8,p3 int8}
123213  
123214  type XVTable struct {
123215  	Xdb          unsafe.Pointer
123216  	XpMod        unsafe.Pointer
123217  	XpVtab       unsafe.Pointer
123218  	XnRef        int32
123219  	XbConstraint uint8
123220  	XiSavepoint  int32
123221  	XpNext       unsafe.Pointer
123222  } // t240 struct{db *struct{},pMod *struct{},pVtab *struct{},nRef int32,bConstraint uint8,iSavepoint int32,pNext *struct{}}
123223  
123224  type XCollSeq struct {
123225  	XzName *int8
123226  	Xenc   uint8
123227  	XpUser unsafe.Pointer
123228  	XxCmp  func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32
123229  	XxDel  func(*crt.TLS, unsafe.Pointer)
123230  } // t241 struct{zName *int8,enc uint8,pUser *struct{},xCmp *func(*struct{},int32,*struct{},int32,*struct{})int32,xDel *func(*struct{})}
123231  
123232  type Xsqlite3_vtab struct {
123233  	XpModule unsafe.Pointer
123234  	XnRef    int32
123235  	XzErrMsg *int8
123236  } // t242 struct{pModule *struct{},nRef int32,zErrMsg *int8}
123237  
123238  type XVdbeCursor struct {
123239  	XeCurType       uint8
123240  	XiDb            int8
123241  	XnullRow        uint8
123242  	XdeferredMoveto uint8
123243  	XisTable        uint8
123244  	XseekOp         uint8
123245  	XwrFlag         uint8
123246  	XisEphemeral    int8
123247  	XpBtx           unsafe.Pointer
123248  	XseqCount       int64
123249  	XaAltMap        *int32
123250  	XcacheStatus    uint32
123251  	XseekResult     int32
123252  	XpAltCursor     unsafe.Pointer
123253  	Xuc             t243
123254  	XpKeyInfo       unsafe.Pointer
123255  	XiHdrOffset     uint32
123256  	XpgnoRoot       uint32
123257  	XnField         int16
123258  	XnHdrParsed     uint16
123259  	XmovetoTarget   int64
123260  	XaOffset        *uint32
123261  	XaRow           *uint8
123262  	XpayloadSize    uint32
123263  	XszRow          uint32
123264  	XaType          [1]uint32
123265  } // t244 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}
123266  
123267  type XAuxData struct {
123268  	XiAuxOp     int32
123269  	XiAuxArg    int32
123270  	XpAux       unsafe.Pointer
123271  	XxDeleteAux func(*crt.TLS, unsafe.Pointer)
123272  	XpNextAux   unsafe.Pointer
123273  } // t245 struct{iAuxOp int32,iAuxArg int32,pAux *struct{},xDeleteAux *func(*struct{}),pNextAux *struct{}}
123274  
123275  type TReusableSpace struct {
123276  	XpSpace  *uint8
123277  	XnFree   int32
123278  	XnNeeded int32
123279  } // t246 struct{pSpace *uint8,nFree int32,nNeeded int32}
123280  
123281  type Xsqlite3_vtab_cursor struct{ XpVtab unsafe.Pointer } // t247 struct{pVtab *struct{}}
123282  
123283  type Xsqlite3_module struct {
123284  	XiVersion      int32
123285  	XxCreate       func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, **int8, *unsafe.Pointer, **int8) int32
123286  	XxConnect      func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, **int8, *unsafe.Pointer, **int8) int32
123287  	XxBestIndex    func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32
123288  	XxDisconnect   func(*crt.TLS, unsafe.Pointer) int32
123289  	XxDestroy      func(*crt.TLS, unsafe.Pointer) int32
123290  	XxOpen         func(*crt.TLS, unsafe.Pointer, *unsafe.Pointer) int32
123291  	XxClose        func(*crt.TLS, unsafe.Pointer) int32
123292  	XxFilter       func(*crt.TLS, unsafe.Pointer, int32, *int8, int32, *unsafe.Pointer) int32
123293  	XxNext         func(*crt.TLS, unsafe.Pointer) int32
123294  	XxEof          func(*crt.TLS, unsafe.Pointer) int32
123295  	XxColumn       func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) int32
123296  	XxRowid        func(*crt.TLS, unsafe.Pointer, *int64) int32
123297  	XxUpdate       func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer, *int64) int32
123298  	XxBegin        func(*crt.TLS, unsafe.Pointer) int32
123299  	XxSync         func(*crt.TLS, unsafe.Pointer) int32
123300  	XxCommit       func(*crt.TLS, unsafe.Pointer) int32
123301  	XxRollback     func(*crt.TLS, unsafe.Pointer) int32
123302  	XxFindFunction func(*crt.TLS, unsafe.Pointer, int32, *int8, *func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), *unsafe.Pointer) int32
123303  	XxRename       func(*crt.TLS, unsafe.Pointer, *int8) int32
123304  	XxSavepoint    func(*crt.TLS, unsafe.Pointer, int32) int32
123305  	XxRelease      func(*crt.TLS, unsafe.Pointer, int32) int32
123306  	XxRollbackTo   func(*crt.TLS, unsafe.Pointer, int32) int32
123307  } // t248 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}
123308  
123309  type XSavepoint struct {
123310  	XzName            *int8
123311  	XnDeferredCons    int64
123312  	XnDeferredImmCons int64
123313  	XpNext            unsafe.Pointer
123314  } // t249 struct{zName *int8,nDeferredCons int64,nDeferredImmCons int64,pNext *struct{}}
123315  
123316  type XSorterFile struct {
123317  	XpFd  unsafe.Pointer
123318  	XiEof int64
123319  } // t250 struct{pFd *struct{},iEof int64}
123320  
123321  type XSortSubtask struct {
123322  	XpThread   unsafe.Pointer
123323  	XbDone     int32
123324  	XpSorter   unsafe.Pointer
123325  	XpUnpacked unsafe.Pointer
123326  	Xlist      t89
123327  	XnPMA      int32
123328  	XxCompare  func(*crt.TLS, unsafe.Pointer, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32
123329  	Xfile      XSorterFile
123330  	Xfile2     XSorterFile
123331  } // t251 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}}
123332  
123333  type XVdbeSorter struct {
123334  	XmnPmaSize   int32
123335  	XmxPmaSize   int32
123336  	XmxKeysize   int32
123337  	Xpgsz        int32
123338  	XpReader     unsafe.Pointer
123339  	XpMerger     unsafe.Pointer
123340  	Xdb          unsafe.Pointer
123341  	XpKeyInfo    unsafe.Pointer
123342  	XpUnpacked   unsafe.Pointer
123343  	Xlist        t89
123344  	XiMemory     int32
123345  	XnMemory     int32
123346  	XbUsePMA     uint8
123347  	XbUseThreads uint8
123348  	XiPrev       uint8
123349  	XnTask       uint8
123350  	XtypeMask    uint8
123351  	XaTask       [1]XSortSubtask
123352  } // t252 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}}}
123353  
123354  type XInitData struct {
123355  	Xdb       unsafe.Pointer
123356  	XpzErrMsg **int8
123357  	XiDb      int32
123358  	Xrc       int32
123359  } // t253 struct{db *struct{},pzErrMsg **int8,iDb int32,rc int32}
123360  
123361  type XIncrblob struct {
123362  	XnByte   int32
123363  	XiOffset int32
123364  	XiCol    uint16
123365  	XpCsr    unsafe.Pointer
123366  	XpStmt   unsafe.Pointer
123367  	Xdb      unsafe.Pointer
123368  	XzDb     *int8
123369  	XpTab    unsafe.Pointer
123370  } // t254 struct{nByte int32,iOffset int32,iCol uint16,pCsr *struct{},pStmt *struct{},db *struct{},zDb *int8,pTab *struct{}}
123371  
123372  type XFKey struct {
123373  	XpFrom      unsafe.Pointer
123374  	XpNextFrom  unsafe.Pointer
123375  	XzTo        *int8
123376  	XpNextTo    unsafe.Pointer
123377  	XpPrevTo    unsafe.Pointer
123378  	XnCol       int32
123379  	XisDeferred uint8
123380  	XaAction    [2]uint8
123381  	XapTrigger  [2]unsafe.Pointer
123382  	XaCol       [1]t117
123383  } // t255 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}}
123384  
123385  type XPmaReader struct {
123386  	XiReadOff int64
123387  	XiEof     int64
123388  	XnAlloc   int32
123389  	XnKey     int32
123390  	XpFd      unsafe.Pointer
123391  	XaAlloc   *uint8
123392  	XaKey     *uint8
123393  	XaBuffer  *uint8
123394  	XnBuffer  int32
123395  	XaMap     *uint8
123396  	XpIncr    unsafe.Pointer
123397  } // t256 struct{iReadOff int64,iEof int64,nAlloc int32,nKey int32,pFd *struct{},aAlloc *uint8,aKey *uint8,aBuffer *uint8,nBuffer int32,aMap *uint8,pIncr *struct{}}
123398  
123399  type XIncrMerger struct {
123400  	XpTask      unsafe.Pointer
123401  	XpMerger    unsafe.Pointer
123402  	XiStartOff  int64
123403  	XmxSz       int32
123404  	XbEof       int32
123405  	XbUseThread int32
123406  	XaFile      [2]XSorterFile
123407  } // t257 struct{pTask *struct{},pMerger *struct{},iStartOff int64,mxSz int32,bEof int32,bUseThread int32,aFile [2]struct{pFd *struct{},iEof int64}}
123408  
123409  type XSorterRecord struct {
123410  	XnVal int32
123411  	Xu    t258
123412  } // t259 struct{nVal int32,u union{pNext *struct{},iNext int32}}
123413  
123414  type XMergeEngine struct {
123415  	XnTree  int32
123416  	XpTask  unsafe.Pointer
123417  	XaTree  *int32
123418  	XaReadr unsafe.Pointer
123419  } // t260 struct{nTree int32,pTask *struct{},aTree *int32,aReadr *struct{}}
123420  
123421  type XPmaWriter struct {
123422  	XeFWErr    int32
123423  	XaBuffer   *uint8
123424  	XnBuffer   int32
123425  	XiBufStart int32
123426  	XiBufEnd   int32
123427  	XiWriteOff int64
123428  	XpFd       unsafe.Pointer
123429  } // t261 struct{eFWErr int32,aBuffer *uint8,nBuffer int32,iBufStart int32,iBufEnd int32,iWriteOff int64,pFd *struct{}}
123430  
123431  type XMemJournal struct {
123432  	XpMethod    unsafe.Pointer
123433  	XnChunkSize int32
123434  	XnSpill     int32
123435  	XnSize      int32
123436  	XpFirst     unsafe.Pointer
123437  	Xendpoint   t262
123438  	Xreadpoint  t262
123439  	Xflags      int32
123440  	XpVfs       unsafe.Pointer
123441  	XzJournal   *int8
123442  } // t263 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}
123443  
123444  type XFileChunk struct {
123445  	XpNext  unsafe.Pointer
123446  	XzChunk [8]uint8
123447  } // t264 struct{pNext *struct{},zChunk [8]uint8}
123448  
123449  type XWalker struct {
123450  	XpParse           unsafe.Pointer
123451  	XxExprCallback    func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32
123452  	XxSelectCallback  func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32
123453  	XxSelectCallback2 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer)
123454  	XwalkerDepth      int32
123455  	XeCode            uint8
123456  	Xu                t265
123457  } // t266 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{}}}
123458  
123459  type XIdList struct {
123460  	Xa   unsafe.Pointer
123461  	XnId int32
123462  } // t267 struct{a *struct{},nId int32}
123463  
123464  type TIdList_item struct {
123465  	XzName *int8
123466  	Xidx   int32
123467  } // t268 struct{zName *int8,idx int32}
123468  
123469  type XNameContext struct {
123470  	XpParse   unsafe.Pointer
123471  	XpSrcList unsafe.Pointer
123472  	XpEList   unsafe.Pointer
123473  	XpAggInfo unsafe.Pointer
123474  	XpNext    unsafe.Pointer
123475  	XnRef     int32
123476  	XnErr     int32
123477  	XncFlags  uint16
123478  } // t269 struct{pParse *struct{},pSrcList *struct{},pEList *struct{},pAggInfo *struct{},pNext *struct{},nRef int32,nErr int32,ncFlags uint16}
123479  
123480  type XExprSpan struct {
123481  	XpExpr  unsafe.Pointer
123482  	XzStart *int8
123483  	XzEnd   *int8
123484  } // t270 struct{pExpr *struct{},zStart *int8,zEnd *int8}
123485  
123486  type XSelectDest struct {
123487  	XeDest    uint8
123488  	XzAffSdst *int8
123489  	XiSDParm  int32
123490  	XiSdst    int32
123491  	XnSdst    int32
123492  	XpOrderBy unsafe.Pointer
123493  } // t271 struct{eDest uint8,zAffSdst *int8,iSDParm int32,iSdst int32,nSdst int32,pOrderBy *struct{}}
123494  
123495  type XAggInfo struct {
123496  	XdirectMode     uint8
123497  	XuseSortingIdx  uint8
123498  	XsortingIdx     int32
123499  	XsortingIdxPTab int32
123500  	XnSortingColumn int32
123501  	XmnReg          int32
123502  	XmxReg          int32
123503  	XpGroupBy       unsafe.Pointer
123504  	XaCol           unsafe.Pointer
123505  	XnColumn        int32
123506  	XnAccumulator   int32
123507  	XaFunc          unsafe.Pointer
123508  	XnFunc          int32
123509  } // t272 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}
123510  
123511  type TAggInfo_col struct {
123512  	XpTab          unsafe.Pointer
123513  	XiTable        int32
123514  	XiColumn       int32
123515  	XiSorterColumn int32
123516  	XiMem          int32
123517  	XpExpr         unsafe.Pointer
123518  } // t273 struct{pTab *struct{},iTable int32,iColumn int32,iSorterColumn int32,iMem int32,pExpr *struct{}}
123519  
123520  type TAggInfo_func struct {
123521  	XpExpr     unsafe.Pointer
123522  	XpFunc     unsafe.Pointer
123523  	XiMem      int32
123524  	XiDistinct int32
123525  } // t274 struct{pExpr *struct{},pFunc *struct{},iMem int32,iDistinct int32}
123526  
123527  type TIdxCover struct {
123528  	XpIdx unsafe.Pointer
123529  	XiCur int32
123530  } // t275 struct{pIdx *struct{},iCur int32}
123531  
123532  type TSrcCount struct {
123533  	XpSrc   unsafe.Pointer
123534  	XnThis  int32
123535  	XnOther int32
123536  } // t276 struct{pSrc *struct{},nThis int32,nOther int32}
123537  
123538  type XStat4Accum struct {
123539  	XnRow       uint32
123540  	XnPSample   uint32
123541  	XnCol       int32
123542  	XnKeyCol    int32
123543  	XmxSample   int32
123544  	Xcurrent    t277
123545  	XiPrn       uint32
123546  	XaBest      unsafe.Pointer
123547  	XiMin       int32
123548  	XnSample    int32
123549  	XnMaxEqZero int32
123550  	XiGet       int32
123551  	Xa          unsafe.Pointer
123552  	Xdb         unsafe.Pointer
123553  } // t278 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{}}
123554  
123555  type XanalysisInfo struct {
123556  	Xdb        unsafe.Pointer
123557  	XzDatabase *int8
123558  } // t279 struct{db *struct{},zDatabase *int8}
123559  
123560  type XDbFixer struct {
123561  	XpParse   unsafe.Pointer
123562  	XpSchema  unsafe.Pointer
123563  	XbVarOnly int32
123564  	XzDb      *int8
123565  	XzType    *int8
123566  	XpName    unsafe.Pointer
123567  } // t280 struct{pParse *struct{},pSchema *struct{},bVarOnly int32,zDb *int8,zType *int8,pName *struct{}}
123568  
123569  type XTriggerStep struct {
123570  	Xop        uint8
123571  	Xorconf    uint8
123572  	XpTrig     unsafe.Pointer
123573  	XpSelect   unsafe.Pointer
123574  	XzTarget   *int8
123575  	XpWhere    unsafe.Pointer
123576  	XpExprList unsafe.Pointer
123577  	XpIdList   unsafe.Pointer
123578  	XpNext     unsafe.Pointer
123579  	XpLast     unsafe.Pointer
123580  } // t281 struct{op uint8,orconf uint8,pTrig *struct{},pSelect *struct{},zTarget *int8,pWhere *struct{},pExprList *struct{},pIdList *struct{},pNext *struct{},pLast *struct{}}
123581  
123582  type XAuthContext struct {
123583  	XzAuthContext *int8
123584  	XpParse       unsafe.Pointer
123585  } // t282 struct{zAuthContext *int8,pParse *struct{}}
123586  
123587  type XTableLock struct {
123588  	XiDb         int32
123589  	XiTab        int32
123590  	XisWriteLock uint8
123591  	XzLockName   *int8
123592  } // t283 struct{iDb int32,iTab int32,isWriteLock uint8,zLockName *int8}
123593  
123594  type XAutoincInfo struct {
123595  	XpNext  unsafe.Pointer
123596  	XpTab   unsafe.Pointer
123597  	XiDb    int32
123598  	XregCtr int32
123599  } // t284 struct{pNext *struct{},pTab *struct{},iDb int32,regCtr int32}
123600  
123601  type XModule struct {
123602  	XpModule  unsafe.Pointer
123603  	XzName    *int8
123604  	XpAux     unsafe.Pointer
123605  	XxDestroy func(*crt.TLS, unsafe.Pointer)
123606  	XpEpoTab  unsafe.Pointer
123607  } // t285 struct{pModule *struct{},zName *int8,pAux *struct{},xDestroy *func(*struct{}),pEpoTab *struct{}}
123608  
123609  type XWhereTerm struct {
123610  	XpExpr       unsafe.Pointer
123611  	XpWC         unsafe.Pointer
123612  	XtruthProb   int16
123613  	XwtFlags     uint16
123614  	XeOperator   uint16
123615  	XnChild      uint8
123616  	XeMatchOp    uint8
123617  	XiParent     int32
123618  	XleftCursor  int32
123619  	XiField      int32
123620  	Xu           t286
123621  	XprereqRight uint64
123622  	XprereqAll   uint64
123623  } // t287 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}
123624  
123625  type XWhereClause struct {
123626  	XpWInfo  unsafe.Pointer
123627  	XpOuter  unsafe.Pointer
123628  	Xop      uint8
123629  	XnTerm   int32
123630  	XnSlot   int32
123631  	Xa       unsafe.Pointer
123632  	XaStatic [8]XWhereTerm
123633  } // t288 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}}
123634  
123635  type XWhereMaskSet struct {
123636  	Xn  int32
123637  	Xix [64]int32
123638  } // t289 struct{n int32,ix [64]int32}
123639  
123640  type XWhereLevel struct {
123641  	XiLeftJoin    int32
123642  	XiTabCur      int32
123643  	XiIdxCur      int32
123644  	XaddrBrk      int32
123645  	XaddrNxt      int32
123646  	XaddrSkip     int32
123647  	XaddrCont     int32
123648  	XaddrFirst    int32
123649  	XaddrBody     int32
123650  	XiLikeRepCntr uint32
123651  	XaddrLikeRep  int32
123652  	XiFrom        uint8
123653  	Xop           uint8
123654  	Xp3           uint8
123655  	Xp5           uint8
123656  	Xp1           int32
123657  	Xp2           int32
123658  	Xu            t290
123659  	XpWLoop       unsafe.Pointer
123660  	XnotReady     uint64
123661  } // t291 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}
123662  
123663  type XWhereInfo struct {
123664  	XpParse            unsafe.Pointer
123665  	XpTabList          unsafe.Pointer
123666  	XpOrderBy          unsafe.Pointer
123667  	XpResultSet        unsafe.Pointer
123668  	XpWhere            unsafe.Pointer
123669  	XiLimit            int16
123670  	XaiCurOnePass      [2]int32
123671  	XiContinue         int32
123672  	XiBreak            int32
123673  	XsavedNQueryLoop   int32
123674  	XwctrlFlags        uint16
123675  	XnLevel            uint8
123676  	XnOBSat            int8
123677  	Xsorted            uint8
123678  	XeOnePass          uint8
123679  	XuntestedTerms     uint8
123680  	XeDistinct         uint8
123681  	XbOrderedInnerLoop uint8
123682  	XiTop              int32
123683  	XpLoops            unsafe.Pointer
123684  	XrevMask           uint64
123685  	XnRowOut           int16
123686  	XsWC               XWhereClause
123687  	XsMaskSet          XWhereMaskSet
123688  	Xa                 [1]XWhereLevel
123689  } // t292 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}}
123690  
123691  type TcompareInfo struct {
123692  	XmatchAll uint8
123693  	XmatchOne uint8
123694  	XmatchSet uint8
123695  	XnoCase   uint8
123696  } // t293 struct{matchAll uint8,matchOne uint8,matchSet uint8,noCase uint8}
123697  
123698  type XSumCtx struct {
123699  	XrSum     float64
123700  	XiSum     int64
123701  	Xcnt      int64
123702  	Xoverflow uint8
123703  	Xapprox   uint8
123704  } // t294 struct{rSum float64,iSum int64,cnt int64,overflow uint8,approx uint8}
123705  
123706  type XCountCtx struct{ Xn int64 } // t295 struct{n int64}
123707  
123708  type XFuncDestructor struct {
123709  	XnRef      int32
123710  	XxDestroy  func(*crt.TLS, unsafe.Pointer)
123711  	XpUserData unsafe.Pointer
123712  } // t296 struct{nRef int32,xDestroy *func(*struct{}),pUserData *struct{}}
123713  
123714  type XTriggerPrg struct {
123715  	XpTrigger unsafe.Pointer
123716  	XpNext    unsafe.Pointer
123717  	XpProgram unsafe.Pointer
123718  	Xorconf   int32
123719  	XaColmask [2]uint32
123720  } // t297 struct{pTrigger *struct{},pNext *struct{},pProgram *struct{},orconf int32,aColmask [2]uint32}
123721  
123722  type Xsqlite3_api_routines struct {
123723  	Xaggregate_context      func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
123724  	Xaggregate_count        func(*crt.TLS, unsafe.Pointer) int32
123725  	Xbind_blob              func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer)) int32
123726  	Xbind_double            func(*crt.TLS, unsafe.Pointer, int32, float64) int32
123727  	Xbind_int               func(*crt.TLS, unsafe.Pointer, int32, int32) int32
123728  	Xbind_int64             func(*crt.TLS, unsafe.Pointer, int32, int64) int32
123729  	Xbind_null              func(*crt.TLS, unsafe.Pointer, int32) int32
123730  	Xbind_parameter_count   func(*crt.TLS, unsafe.Pointer) int32
123731  	Xbind_parameter_index   func(*crt.TLS, unsafe.Pointer, *int8) int32
123732  	Xbind_parameter_name    func(*crt.TLS, unsafe.Pointer, int32) *int8
123733  	Xbind_text              func(*crt.TLS, unsafe.Pointer, int32, *int8, int32, func(*crt.TLS, unsafe.Pointer)) int32
123734  	Xbind_text16            func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer)) int32
123735  	Xbind_value             func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer) int32
123736  	Xbusy_handler           func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32) int32, unsafe.Pointer) int32
123737  	Xbusy_timeout           func(*crt.TLS, unsafe.Pointer, int32) int32
123738  	Xchanges                func(*crt.TLS, unsafe.Pointer) int32
123739  	Xclose                  func(*crt.TLS, unsafe.Pointer) int32
123740  	Xcollation_needed       func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *int8)) int32
123741  	Xcollation_needed16     func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, unsafe.Pointer)) int32
123742  	Xcolumn_blob            func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
123743  	Xcolumn_bytes           func(*crt.TLS, unsafe.Pointer, int32) int32
123744  	Xcolumn_bytes16         func(*crt.TLS, unsafe.Pointer, int32) int32
123745  	Xcolumn_count           func(*crt.TLS, unsafe.Pointer) int32
123746  	Xcolumn_database_name   func(*crt.TLS, unsafe.Pointer, int32) *int8
123747  	Xcolumn_database_name16 func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
123748  	Xcolumn_decltype        func(*crt.TLS, unsafe.Pointer, int32) *int8
123749  	Xcolumn_decltype16      func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
123750  	Xcolumn_double          func(*crt.TLS, unsafe.Pointer, int32) float64
123751  	Xcolumn_int             func(*crt.TLS, unsafe.Pointer, int32) int32
123752  	Xcolumn_int64           func(*crt.TLS, unsafe.Pointer, int32) int64
123753  	Xcolumn_name            func(*crt.TLS, unsafe.Pointer, int32) *int8
123754  	Xcolumn_name16          func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
123755  	Xcolumn_origin_name     func(*crt.TLS, unsafe.Pointer, int32) *int8
123756  	Xcolumn_origin_name16   func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
123757  	Xcolumn_table_name      func(*crt.TLS, unsafe.Pointer, int32) *int8
123758  	Xcolumn_table_name16    func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
123759  	Xcolumn_text            func(*crt.TLS, unsafe.Pointer, int32) *uint8
123760  	Xcolumn_text16          func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
123761  	Xcolumn_type            func(*crt.TLS, unsafe.Pointer, int32) int32
123762  	Xcolumn_value           func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
123763  	Xcommit_hook            func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer) int32, unsafe.Pointer) unsafe.Pointer
123764  	Xcomplete               func(*crt.TLS, *int8) int32
123765  	Xcomplete16             func(*crt.TLS, unsafe.Pointer) int32
123766  	Xcreate_collation       func(*crt.TLS, unsafe.Pointer, *int8, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32) int32
123767  	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
123768  	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
123769  	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
123770  	Xcreate_module          func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, unsafe.Pointer) int32
123771  	Xdata_count             func(*crt.TLS, unsafe.Pointer) int32
123772  	Xdb_handle              func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
123773  	Xdeclare_vtab           func(*crt.TLS, unsafe.Pointer, *int8) int32
123774  	Xenable_shared_cache    func(*crt.TLS, int32) int32
123775  	Xerrcode                func(*crt.TLS, unsafe.Pointer) int32
123776  	Xerrmsg                 func(*crt.TLS, unsafe.Pointer) *int8
123777  	Xerrmsg16               func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
123778  	Xexec                   func(*crt.TLS, unsafe.Pointer, *int8, func(*crt.TLS, unsafe.Pointer, int32, **int8, **int8) int32, unsafe.Pointer, **int8) int32
123779  	Xexpired                func(*crt.TLS, unsafe.Pointer) int32
123780  	Xfinalize               func(*crt.TLS, unsafe.Pointer) int32
123781  	Xfree                   func(*crt.TLS, unsafe.Pointer)
123782  	Xfree_table             func(*crt.TLS, **int8)
123783  	Xget_autocommit         func(*crt.TLS, unsafe.Pointer) int32
123784  	Xget_auxdata            func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
123785  	Xget_table              func(*crt.TLS, unsafe.Pointer, *int8, ***int8, *int32, *int32, **int8) int32
123786  	Xglobal_recover         func(*crt.TLS) int32
123787  	Xinterruptx             func(*crt.TLS, unsafe.Pointer)
123788  	Xlast_insert_rowid      func(*crt.TLS, unsafe.Pointer) int64
123789  	Xlibversion             func(*crt.TLS) *int8
123790  	Xlibversion_number      func(*crt.TLS) int32
123791  	Xmalloc                 func(*crt.TLS, int32) unsafe.Pointer
123792  	Xmprintf                func(*crt.TLS, *int8, ...interface{}) *int8
123793  	Xopen64                 func(*crt.TLS, *int8, *unsafe.Pointer) int32
123794  	Xopen16                 func(*crt.TLS, unsafe.Pointer, *unsafe.Pointer) int32
123795  	Xprepare                func(*crt.TLS, unsafe.Pointer, *int8, int32, *unsafe.Pointer, **int8) int32
123796  	Xprepare16              func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *unsafe.Pointer, *unsafe.Pointer) int32
123797  	Xprofile                func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, *int8, uint64), unsafe.Pointer) unsafe.Pointer
123798  	Xprogress_handler       func(*crt.TLS, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer) int32, unsafe.Pointer)
123799  	Xrealloc                func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
123800  	Xreset                  func(*crt.TLS, unsafe.Pointer) int32
123801  	Xresult_blob            func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer))
123802  	Xresult_double          func(*crt.TLS, unsafe.Pointer, float64)
123803  	Xresult_error           func(*crt.TLS, unsafe.Pointer, *int8, int32)
123804  	Xresult_error16         func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32)
123805  	Xresult_int             func(*crt.TLS, unsafe.Pointer, int32)
123806  	Xresult_int64           func(*crt.TLS, unsafe.Pointer, int64)
123807  	Xresult_null            func(*crt.TLS, unsafe.Pointer)
123808  	Xresult_text            func(*crt.TLS, unsafe.Pointer, *int8, int32, func(*crt.TLS, unsafe.Pointer))
123809  	Xresult_text16          func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer))
123810  	Xresult_text16be        func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer))
123811  	Xresult_text16le        func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer))
123812  	Xresult_value           func(*crt.TLS, unsafe.Pointer, unsafe.Pointer)
123813  	Xrollback_hook          func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer), unsafe.Pointer) unsafe.Pointer
123814  	Xset_authorizer         func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32, unsafe.Pointer) int32
123815  	Xset_auxdata            func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer))
123816  	Xsnprintf               func(*crt.TLS, int32, *int8, *int8, ...interface{}) *int8
123817  	Xstep                   func(*crt.TLS, unsafe.Pointer) int32
123818  	Xtable_column_metadata  func(*crt.TLS, unsafe.Pointer, *int8, *int8, *int8, **int8, **int8, *int32, *int32, *int32) int32
123819  	Xthread_cleanup         func(*crt.TLS)
123820  	Xtotal_changes          func(*crt.TLS, unsafe.Pointer) int32
123821  	Xtrace                  func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, *int8), unsafe.Pointer) unsafe.Pointer
123822  	Xtransfer_bindings      func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32
123823  	Xupdate_hook            func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, int64), unsafe.Pointer) unsafe.Pointer
123824  	Xuser_data              func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
123825  	Xvalue_blob             func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
123826  	Xvalue_bytes            func(*crt.TLS, unsafe.Pointer) int32
123827  	Xvalue_bytes16          func(*crt.TLS, unsafe.Pointer) int32
123828  	Xvalue_double           func(*crt.TLS, unsafe.Pointer) float64
123829  	Xvalue_int              func(*crt.TLS, unsafe.Pointer) int32
123830  	Xvalue_int64            func(*crt.TLS, unsafe.Pointer) int64
123831  	Xvalue_numeric_type     func(*crt.TLS, unsafe.Pointer) int32
123832  	Xvalue_text             func(*crt.TLS, unsafe.Pointer) *uint8
123833  	Xvalue_text16           func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
123834  	Xvalue_text16be         func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
123835  	Xvalue_text16le         func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
123836  	Xvalue_type             func(*crt.TLS, unsafe.Pointer) int32
123837  	Xvmprintf               func(*crt.TLS, *int8, unsafe.Pointer) *int8
123838  	Xoverload_function      func(*crt.TLS, unsafe.Pointer, *int8, int32) int32
123839  	Xprepare_v2             func(*crt.TLS, unsafe.Pointer, *int8, int32, *unsafe.Pointer, **int8) int32
123840  	Xprepare16_v2           func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *unsafe.Pointer, *unsafe.Pointer) int32
123841  	Xclear_bindings         func(*crt.TLS, unsafe.Pointer) int32
123842  	Xcreate_module_v2       func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer)) int32
123843  	Xbind_zeroblob          func(*crt.TLS, unsafe.Pointer, int32, int32) int32
123844  	Xblob_bytes             func(*crt.TLS, unsafe.Pointer) int32
123845  	Xblob_close             func(*crt.TLS, unsafe.Pointer) int32
123846  	Xblob_open              func(*crt.TLS, unsafe.Pointer, *int8, *int8, *int8, int64, int32, *unsafe.Pointer) int32
123847  	Xblob_read              func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int32) int32
123848  	Xblob_write             func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int32) int32
123849  	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
123850  	Xfile_control           func(*crt.TLS, unsafe.Pointer, *int8, int32, unsafe.Pointer) int32
123851  	Xmemory_highwater       func(*crt.TLS, int32) int64
123852  	Xmemory_used            func(*crt.TLS) int64
123853  	Xmutex_alloc            func(*crt.TLS, int32) unsafe.Pointer
123854  	Xmutex_enter            func(*crt.TLS, unsafe.Pointer)
123855  	Xmutex_free             func(*crt.TLS, unsafe.Pointer)
123856  	Xmutex_leave            func(*crt.TLS, unsafe.Pointer)
123857  	Xmutex_try              func(*crt.TLS, unsafe.Pointer) int32
123858  	Xopen_v2                func(*crt.TLS, *int8, *unsafe.Pointer, int32, *int8) int32
123859  	Xrelease_memory         func(*crt.TLS, int32) int32
123860  	Xresult_error_nomem     func(*crt.TLS, unsafe.Pointer)
123861  	Xresult_error_toobig    func(*crt.TLS, unsafe.Pointer)
123862  	Xsleep                  func(*crt.TLS, int32) int32
123863  	Xsoft_heap_limit        func(*crt.TLS, int32)
123864  	Xvfs_find               func(*crt.TLS, *int8) unsafe.Pointer
123865  	Xvfs_register           func(*crt.TLS, unsafe.Pointer, int32) int32
123866  	Xvfs_unregister         func(*crt.TLS, unsafe.Pointer) int32
123867  	Xxthreadsafe            func(*crt.TLS) int32
123868  	Xresult_zeroblob        func(*crt.TLS, unsafe.Pointer, int32)
123869  	Xresult_error_code      func(*crt.TLS, unsafe.Pointer, int32)
123870  	Xtest_control           func(*crt.TLS, int32, ...interface{}) int32
123871  	Xrandomness             func(*crt.TLS, int32, unsafe.Pointer)
123872  	Xcontext_db_handle      func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
123873  	Xextended_result_codes  func(*crt.TLS, unsafe.Pointer, int32) int32
123874  	Xlimit                  func(*crt.TLS, unsafe.Pointer, int32, int32) int32
123875  	Xnext_stmt              func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) unsafe.Pointer
123876  	Xsql                    func(*crt.TLS, unsafe.Pointer) *int8
123877  	Xstatus                 func(*crt.TLS, int32, *int32, *int32, int32) int32
123878  	Xbackup_finish          func(*crt.TLS, unsafe.Pointer) int32
123879  	Xbackup_init            func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, *int8) unsafe.Pointer
123880  	Xbackup_pagecount       func(*crt.TLS, unsafe.Pointer) int32
123881  	Xbackup_remaining       func(*crt.TLS, unsafe.Pointer) int32
123882  	Xbackup_step            func(*crt.TLS, unsafe.Pointer, int32) int32
123883  	Xcompileoption_get      func(*crt.TLS, int32) *int8
123884  	Xcompileoption_used     func(*crt.TLS, *int8) int32
123885  	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
123886  	Xdb_config              func(*crt.TLS, unsafe.Pointer, int32, ...interface{}) int32
123887  	Xdb_mutex               func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
123888  	Xdb_status              func(*crt.TLS, unsafe.Pointer, int32, *int32, *int32, int32) int32
123889  	Xextended_errcode       func(*crt.TLS, unsafe.Pointer) int32
123890  	Xlog                    func(*crt.TLS, int32, *int8, ...interface{})
123891  	Xsoft_heap_limit64      func(*crt.TLS, int64) int64
123892  	Xsourceid               func(*crt.TLS) *int8
123893  	Xstmt_status            func(*crt.TLS, unsafe.Pointer, int32, int32) int32
123894  	Xstrnicmp               func(*crt.TLS, *int8, *int8, int32) int32
123895  	Xunlock_notify          func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, *unsafe.Pointer, int32), unsafe.Pointer) int32
123896  	Xwal_autocheckpoint     func(*crt.TLS, unsafe.Pointer, int32) int32
123897  	Xwal_checkpoint         func(*crt.TLS, unsafe.Pointer, *int8) int32
123898  	Xwal_hook               func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8, int32) int32, unsafe.Pointer) unsafe.Pointer
123899  	Xblob_reopen            func(*crt.TLS, unsafe.Pointer, int64) int32
123900  	Xvtab_config            func(*crt.TLS, unsafe.Pointer, int32, ...interface{}) int32
123901  	Xvtab_on_conflict       func(*crt.TLS, unsafe.Pointer) int32
123902  	Xclose_v2               func(*crt.TLS, unsafe.Pointer) int32
123903  	Xdb_filename            func(*crt.TLS, unsafe.Pointer, *int8) *int8
123904  	Xdb_readonly            func(*crt.TLS, unsafe.Pointer, *int8) int32
123905  	Xdb_release_memory      func(*crt.TLS, unsafe.Pointer) int32
123906  	Xerrstr                 func(*crt.TLS, int32) *int8
123907  	Xstmt_busy              func(*crt.TLS, unsafe.Pointer) int32
123908  	Xstmt_readonly          func(*crt.TLS, unsafe.Pointer) int32
123909  	Xstricmp                func(*crt.TLS, *int8, *int8) int32
123910  	Xuri_boolean            func(*crt.TLS, *int8, *int8, int32) int32
123911  	Xuri_int64              func(*crt.TLS, *int8, *int8, int64) int64
123912  	Xuri_parameter          func(*crt.TLS, *int8, *int8) *int8
123913  	Xvsnprintf              func(*crt.TLS, int32, *int8, *int8, unsafe.Pointer) *int8
123914  	Xwal_checkpoint_v2      func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32, *int32) int32
123915  	Xauto_extension         func(*crt.TLS, func(*crt.TLS)) int32
123916  	Xbind_blob64            func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, uint64, func(*crt.TLS, unsafe.Pointer)) int32
123917  	Xbind_text64            func(*crt.TLS, unsafe.Pointer, int32, *int8, uint64, func(*crt.TLS, unsafe.Pointer), uint8) int32
123918  	Xcancel_auto_extension  func(*crt.TLS, func(*crt.TLS)) int32
123919  	Xload_extension         func(*crt.TLS, unsafe.Pointer, *int8, *int8, **int8) int32
123920  	Xmalloc64               func(*crt.TLS, uint64) unsafe.Pointer
123921  	Xmsize                  func(*crt.TLS, unsafe.Pointer) uint64
123922  	Xrealloc64              func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer
123923  	Xreset_auto_extension   func(*crt.TLS)
123924  	Xresult_blob64          func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, uint64, func(*crt.TLS, unsafe.Pointer))
123925  	Xresult_text64          func(*crt.TLS, unsafe.Pointer, *int8, uint64, func(*crt.TLS, unsafe.Pointer), uint8)
123926  	Xstrglob                func(*crt.TLS, *int8, *int8) int32
123927  	Xvalue_dup              func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
123928  	Xvalue_free             func(*crt.TLS, unsafe.Pointer)
123929  	Xresult_zeroblob64      func(*crt.TLS, unsafe.Pointer, uint64) int32
123930  	Xbind_zeroblob64        func(*crt.TLS, unsafe.Pointer, int32, uint64) int32
123931  	Xvalue_subtype          func(*crt.TLS, unsafe.Pointer) uint32
123932  	Xresult_subtype         func(*crt.TLS, unsafe.Pointer, uint32)
123933  	Xstatus64               func(*crt.TLS, int32, *int64, *int64, int32) int32
123934  	Xstrlike                func(*crt.TLS, *int8, *int8, uint32) int32
123935  	Xdb_cacheflush          func(*crt.TLS, unsafe.Pointer) int32
123936  	Xsystem_errno           func(*crt.TLS, unsafe.Pointer) int32
123937  	Xtrace_v2               func(*crt.TLS, unsafe.Pointer, uint32, func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32, unsafe.Pointer) int32
123938  	Xexpanded_sql           func(*crt.TLS, unsafe.Pointer) *int8
123939  	Xset_last_insert_rowid  func(*crt.TLS, unsafe.Pointer, int64)
123940  } // t298 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)}
123941  
123942  type Tsqlite3AutoExtList struct {
123943  	XnExt uint32
123944  	XaExt *func(*crt.TLS)
123945  } // t299 struct{nExt uint32,aExt **func()}
123946  
123947  type XPragmaName struct {
123948  	XzName      *int8
123949  	XePragTyp   uint8
123950  	XmPragFlg   uint8
123951  	XiPragCName uint8
123952  	XnPragCName uint8
123953  	XiArg       uint32
123954  } // t300 struct{zName *int8,ePragTyp uint8,mPragFlg uint8,iPragCName uint8,nPragCName uint8,iArg uint32}
123955  
123956  type TEncName struct {
123957  	XzName *int8
123958  	Xenc   uint8
123959  } // t301 struct{zName *int8,enc uint8}
123960  
123961  type XPragmaVtab struct {
123962  	Xbase    Xsqlite3_vtab
123963  	Xdb      unsafe.Pointer
123964  	XpName   unsafe.Pointer
123965  	XnHidden uint8
123966  	XiHidden uint8
123967  } // t302 struct{base struct{pModule *struct{},nRef int32,zErrMsg *int8},db *struct{},pName *struct{},nHidden uint8,iHidden uint8}
123968  
123969  type Xsqlite3_index_info struct {
123970  	XnConstraint      int32
123971  	XaConstraint      unsafe.Pointer
123972  	XnOrderBy         int32
123973  	XaOrderBy         unsafe.Pointer
123974  	XaConstraintUsage unsafe.Pointer
123975  	XidxNum           int32
123976  	XidxStr           *int8
123977  	XneedToFreeIdxStr int32
123978  	XorderByConsumed  int32
123979  	XestimatedCost    float64
123980  	XestimatedRows    int64
123981  	XidxFlags         int32
123982  	XcolUsed          uint64
123983  } // t303 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}
123984  
123985  type Tsqlite3_index_constraint struct {
123986  	XiColumn     int32
123987  	Xop          uint8
123988  	Xusable      uint8
123989  	XiTermOffset int32
123990  } // t304 struct{iColumn int32,op uint8,usable uint8,iTermOffset int32}
123991  
123992  type Tsqlite3_index_constraint_usage struct {
123993  	XargvIndex int32
123994  	Xomit      uint8
123995  } // t305 struct{argvIndex int32,omit uint8}
123996  
123997  type XPragmaVtabCursor struct {
123998  	Xbase    Xsqlite3_vtab_cursor
123999  	XpPragma unsafe.Pointer
124000  	XiRowid  int64
124001  	XazArg   [2]*int8
124002  } // t306 struct{base struct{pVtab *struct{}},pPragma *struct{},iRowid int64,azArg [2]*int8}
124003  
124004  type XSortCtx struct {
124005  	XpOrderBy          unsafe.Pointer
124006  	XnOBSat            int32
124007  	XiECursor          int32
124008  	XregReturn         int32
124009  	XlabelBkOut        int32
124010  	XaddrSortIndex     int32
124011  	XlabelDone         int32
124012  	XsortFlags         uint8
124013  	XbOrderedInnerLoop uint8
124014  } // t307 struct{pOrderBy *struct{},nOBSat int32,iECursor int32,regReturn int32,labelBkOut int32,addrSortIndex int32,labelDone int32,sortFlags uint8,bOrderedInnerLoop uint8}
124015  
124016  type XDistinctCtx struct {
124017  	XisTnct    uint8
124018  	XeTnctType uint8
124019  	XtabTnct   int32
124020  	XaddrTnct  int32
124021  } // t308 struct{isTnct uint8,eTnctType uint8,tabTnct int32,addrTnct int32}
124022  
124023  type XSubstContext struct {
124024  	XpParse     unsafe.Pointer
124025  	XiTable     int32
124026  	XiNewTable  int32
124027  	XisLeftJoin int32
124028  	XpEList     unsafe.Pointer
124029  } // t309 struct{pParse *struct{},iTable int32,iNewTable int32,isLeftJoin int32,pEList *struct{}}
124030  
124031  type THavingToWhereCtx struct {
124032  	XppWhere  *unsafe.Pointer
124033  	XpGroupBy unsafe.Pointer
124034  } // t310 struct{ppWhere **struct{},pGroupBy *struct{}}
124035  
124036  type XTabResult struct {
124037  	XazResult **int8
124038  	XzErrMsg  *int8
124039  	XnAlloc   uint32
124040  	XnRow     uint32
124041  	XnColumn  uint32
124042  	XnData    uint32
124043  	Xrc       int32
124044  } // t311 struct{azResult **int8,zErrMsg *int8,nAlloc uint32,nRow uint32,nColumn uint32,nData uint32,rc int32}
124045  
124046  type XVtabCtx struct {
124047  	XpVTable   unsafe.Pointer
124048  	XpTab      unsafe.Pointer
124049  	XpPrior    unsafe.Pointer
124050  	XbDeclared int32
124051  } // t312 struct{pVTable *struct{},pTab *struct{},pPrior *struct{},bDeclared int32}
124052  
124053  type XWhereLoop struct {
124054  	Xprereq      uint64
124055  	XmaskSelf    uint64
124056  	XcId         int8
124057  	XiTab        uint8
124058  	XiSortIdx    uint8
124059  	XrSetup      int16
124060  	XrRun        int16
124061  	XnOut        int16
124062  	Xu           t313
124063  	XwsFlags     uint32
124064  	XnLTerm      uint16
124065  	XnSkip       uint16
124066  	XnLSlot      uint16
124067  	XaLTerm      *unsafe.Pointer
124068  	XpNextLoop   unsafe.Pointer
124069  	XaLTermSpace [3]unsafe.Pointer
124070  } // t314 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{}}
124071  
124072  type TInLoop struct {
124073  	XiCur       int32
124074  	XaddrInTop  int32
124075  	XeEndLoopOp uint8
124076  } // t315 struct{iCur int32,addrInTop int32,eEndLoopOp uint8}
124077  
124078  type XIdxExprTrans struct {
124079  	XpIdxExpr unsafe.Pointer
124080  	XiTabCur  int32
124081  	XiIdxCur  int32
124082  	XiIdxCol  int32
124083  } // t316 struct{pIdxExpr *struct{},iTabCur int32,iIdxCur int32,iIdxCol int32}
124084  
124085  type XWhereOrInfo struct {
124086  	Xwc        XWhereClause
124087  	Xindexable uint64
124088  } // t317 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}
124089  
124090  type XWhereAndInfo struct{ Xwc XWhereClause } // 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}}}
124091  
124092  type TOp2 struct {
124093  	XzOp  *int8
124094  	XeOp2 uint8
124095  } // t319 struct{zOp *int8,eOp2 uint8}
124096  
124097  type XWhereOrCost struct {
124098  	Xprereq uint64
124099  	XrRun   int16
124100  	XnOut   int16
124101  } // t320 struct{prereq uint64,rRun int16,nOut int16}
124102  
124103  type XWhereOrSet struct {
124104  	Xn uint16
124105  	Xa [3]XWhereOrCost
124106  } // t321 struct{n uint16,a [3]struct{prereq uint64,rRun int16,nOut int16}}
124107  
124108  type XWhereScan struct {
124109  	XpOrigWC   unsafe.Pointer
124110  	XpWC       unsafe.Pointer
124111  	XzCollName *int8
124112  	XpIdxExpr  unsafe.Pointer
124113  	Xidxaff    int8
124114  	XnEquiv    uint8
124115  	XiEquiv    uint8
124116  	XopMask    uint32
124117  	Xk         int32
124118  	XaiCur     [11]int32
124119  	XaiColumn  [11]int16
124120  } // t322 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}
124121  
124122  type Tsqlite3_index_orderby struct {
124123  	XiColumn int32
124124  	Xdesc    uint8
124125  } // t323 struct{iColumn int32,desc uint8}
124126  
124127  type XWhereLoopBuilder struct {
124128  	XpWInfo   unsafe.Pointer
124129  	XpWC      unsafe.Pointer
124130  	XpOrderBy unsafe.Pointer
124131  	XpNew     unsafe.Pointer
124132  	XpOrSet   unsafe.Pointer
124133  	XbldFlags uint32
124134  } // t324 struct{pWInfo *struct{},pWC *struct{},pOrderBy *struct{},pNew *struct{},pOrSet *struct{},bldFlags uint32}
124135  
124136  type XWherePath struct {
124137  	XmaskLoop  uint64
124138  	XrevLoop   uint64
124139  	XnRow      int16
124140  	XrCost     int16
124141  	XrUnsorted int16
124142  	XisOrdered int8
124143  	XaLoop     *unsafe.Pointer
124144  } // t325 struct{maskLoop uint64,revLoop uint64,nRow int16,rCost int16,rUnsorted int16,isOrdered int8,aLoop **struct{}}
124145  
124146  type XYYMINORTYPE struct {
124147  	X [0]struct {
124148  		Xyyinit int32
124149  		Xyy0    XToken
124150  		Xyy72   unsafe.Pointer
124151  		Xyy145  unsafe.Pointer
124152  		Xyy148  unsafe.Pointer
124153  		Xyy185  unsafe.Pointer
124154  		Xyy190  XExprSpan
124155  		Xyy194  int32
124156  		Xyy243  unsafe.Pointer
124157  		Xyy254  unsafe.Pointer
124158  		Xyy285  unsafe.Pointer
124159  		Xyy332  t51
124160  		Xyy354  t55
124161  		Xyy497  t54
124162  	}
124163  	U [12]byte
124164  } // t326 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}}
124165  
124166  type XyyStackEntry struct {
124167  	Xstateno uint16
124168  	Xmajor   uint8
124169  	Xminor   XYYMINORTYPE
124170  } // t327 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}}}
124171  
124172  type XyyParser struct {
124173  	Xyytos   unsafe.Pointer
124174  	XpParse  unsafe.Pointer
124175  	Xyystack [100]XyyStackEntry
124176  } // t328 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}}}}
124177  
124178  type TOpenMode struct {
124179  	Xz    *int8
124180  	Xmode int32
124181  } // t329 struct{z *int8,mode int32}
124182  
124183  type t136 struct{} // struct{}
124184  
124185  type t148 struct {
124186  	XnewTnum       int32
124187  	XiDb           uint8
124188  	Xbusy          uint8
124189  	XorphanTrigger uint8
124190  	XimposterTable uint8
124191  } // struct{newTnum int32,iDb uint8,busy uint8,orphanTrigger uint8,imposterTable uint8}
124192  
124193  type t149 struct {
124194  	X [0]struct {
124195  		XisInterrupted int32
124196  		XnotUsed1      float64
124197  	}
124198  	U [8]byte
124199  } // union{isInterrupted int32,notUsed1 float64}
124200  
124201  type t150 struct {
124202  	XbDisable  uint32
124203  	Xsz        uint16
124204  	XbMalloced uint8
124205  	XnOut      int32
124206  	XmxOut     int32
124207  	XanStat    [3]int32
124208  	XpFree     unsafe.Pointer
124209  	XpStart    unsafe.Pointer
124210  	XpEnd      unsafe.Pointer
124211  } // struct{bDisable uint32,sz uint16,bMalloced uint8,nOut int32,mxOut int32,anStat [3]int32,pFree *struct{},pStart *struct{},pEnd *struct{}}
124212  
124213  type t75 struct {
124214  	XxFunc func(*crt.TLS, unsafe.Pointer, int32) int32
124215  	XpArg  unsafe.Pointer
124216  	XnBusy int32
124217  } // struct{xFunc *func(*struct{},int32)int32,pArg *struct{},nBusy int32}
124218  
124219  type t22 struct {
124220  	XeType  uint8
124221  	XnName  uint8
124222  	XzName  *int8
124223  	XrLimit float64
124224  	XrXform float64
124225  } // struct{eType uint8,nName uint8,zName *int8,rLimit float64,rXform float64}
124226  
124227  type t163 struct {
124228  	X [0]struct {
124229  		Xr       float64
124230  		Xi       int64
124231  		XnZero   int32
124232  		XpDef    unsafe.Pointer
124233  		XpRowSet unsafe.Pointer
124234  		XpFrame  unsafe.Pointer
124235  	}
124236  	U [8]byte
124237  } // union{r float64,i int64,nZero int32,pDef *struct{},pRowSet *struct{},pFrame *struct{}}
124238  
124239  type t165 struct {
124240  	X [0]struct {
124241  		XpHash       unsafe.Pointer
124242  		XpDestructor unsafe.Pointer
124243  	}
124244  	U [4]byte
124245  } // union{pHash *struct{},pDestructor *struct{}}
124246  
124247  type t177 struct {
124248  	Xjointype   uint8
124249  	XnotIndexed int8
124250  } // struct{jointype uint8,notIndexed int8}
124251  
124252  type t178 struct {
124253  	X [0]struct {
124254  		XzIndexedBy *int8
124255  		XpFuncArg   unsafe.Pointer
124256  	}
124257  	U [4]byte
124258  } // union{zIndexedBy *int8,pFuncArg *struct{}}
124259  
124260  type t73 struct {
124261  	XiLevel int32
124262  	XbLine  [100]uint8
124263  } // struct{iLevel int32,bLine [100]uint8}
124264  
124265  type t71 struct {
124266  	XiOrderByCol uint16
124267  	XiAlias      uint16
124268  } // struct{iOrderByCol uint16,iAlias uint16}
124269  
124270  type t183 struct {
124271  	X [0]struct {
124272  		Xx             t71
124273  		XiConstExprReg int32
124274  	}
124275  	U [4]byte
124276  } // union{x struct{iOrderByCol uint16,iAlias uint16},iConstExprReg int32}
124277  
124278  type t187 struct {
124279  	X [0]struct {
124280  		XzToken *int8
124281  		XiValue int32
124282  	}
124283  	U [4]byte
124284  } // union{zToken *int8,iValue int32}
124285  
124286  type t188 struct {
124287  	X [0]struct {
124288  		XpList   unsafe.Pointer
124289  		XpSelect unsafe.Pointer
124290  	}
124291  	U [4]byte
124292  } // union{pList *struct{},pSelect *struct{}}
124293  
124294  type t203 struct {
124295  	X [0]struct {
124296  		XaBitmap [500]uint8
124297  		XaHash   [125]uint32
124298  		XapSub   [125]unsafe.Pointer
124299  	}
124300  	U [500]byte
124301  } // union{aBitmap [500]uint8,aHash [125]uint32,apSub [125]*struct{}}
124302  
124303  type t68 struct {
124304  	XpParse unsafe.Pointer
124305  	XpIdx   unsafe.Pointer
124306  	XppRec  *unsafe.Pointer
124307  	XiVal   int32
124308  } // struct{pParse *struct{},pIdx *struct{},ppRec **struct{},iVal int32}
124309  
124310  type t235 struct {
124311  	X [0]struct {
124312  		Xi        int32
124313  		Xp        unsafe.Pointer
124314  		Xz        *int8
124315  		XpI64     *int64
124316  		XpReal    *float64
124317  		XpFunc    unsafe.Pointer
124318  		XpCtx     unsafe.Pointer
124319  		XpColl    unsafe.Pointer
124320  		XpMem     unsafe.Pointer
124321  		XpVtab    unsafe.Pointer
124322  		XpKeyInfo unsafe.Pointer
124323  		Xai       *int32
124324  		XpProgram unsafe.Pointer
124325  		XpTab     unsafe.Pointer
124326  		XxAdvance func(*crt.TLS, unsafe.Pointer, *int32) int32
124327  	}
124328  	U [4]byte
124329  } // 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}
124330  
124331  type t243 struct {
124332  	X [0]struct {
124333  		XpCursor        unsafe.Pointer
124334  		XpVCur          unsafe.Pointer
124335  		XpseudoTableReg int32
124336  		XpSorter        unsafe.Pointer
124337  	}
124338  	U [4]byte
124339  } // union{pCursor *struct{},pVCur *struct{},pseudoTableReg int32,pSorter *struct{}}
124340  
124341  type t89 struct {
124342  	XpList   unsafe.Pointer
124343  	XaMemory *uint8
124344  	XszPMA   int32
124345  } // struct{pList *struct{},aMemory *uint8,szPMA int32}
124346  
124347  type t117 struct {
124348  	XiFrom int32
124349  	XzCol  *int8
124350  } // struct{iFrom int32,zCol *int8}
124351  
124352  type t258 struct {
124353  	X [0]struct {
124354  		XpNext unsafe.Pointer
124355  		XiNext int32
124356  	}
124357  	U [4]byte
124358  } // union{pNext *struct{},iNext int32}
124359  
124360  type t262 struct {
124361  	XiOffset int64
124362  	XpChunk  unsafe.Pointer
124363  } // struct{iOffset int64,pChunk *struct{}}
124364  
124365  type t265 struct {
124366  	X [0]struct {
124367  		XpNC        unsafe.Pointer
124368  		Xn          int32
124369  		XiCur       int32
124370  		XpSrcList   unsafe.Pointer
124371  		XpSrcCount  unsafe.Pointer
124372  		XpCCurHint  unsafe.Pointer
124373  		XaiCol      *int32
124374  		XpIdxCover  unsafe.Pointer
124375  		XpIdxTrans  unsafe.Pointer
124376  		XpGroupBy   unsafe.Pointer
124377  		XpHavingCtx unsafe.Pointer
124378  	}
124379  	U [4]byte
124380  } // union{pNC *struct{},n int32,iCur int32,pSrcList *struct{},pSrcCount *struct{},pCCurHint *struct{},aiCol *int32,pIdxCover *struct{},pIdxTrans *struct{},pGroupBy *struct{},pHavingCtx *struct{}}
124381  
124382  type t128 struct {
124383  	XzName *int8
124384  	XzCols *int8
124385  } // struct{zName *int8,zCols *int8}
124386  
124387  type t277 struct {
124388  	XanEq  *uint32
124389  	XanDLt *uint32
124390  } // struct{anEq *uint32,anDLt *uint32}
124391  
124392  type t286 struct {
124393  	X [0]struct {
124394  		XleftColumn int32
124395  		XpOrInfo    unsafe.Pointer
124396  		XpAndInfo   unsafe.Pointer
124397  	}
124398  	U [4]byte
124399  } // union{leftColumn int32,pOrInfo *struct{},pAndInfo *struct{}}
124400  
124401  type t114 struct {
124402  	XnIn     int32
124403  	XaInLoop unsafe.Pointer
124404  } // struct{nIn int32,aInLoop *struct{}}
124405  
124406  type t290 struct {
124407  	X [0]struct {
124408  		Xin      t114
124409  		XpCovidx unsafe.Pointer
124410  	}
124411  	U [8]byte
124412  } // union{in struct{nIn int32,aInLoop *struct{}},pCovidx *struct{}}
124413  
124414  type t124 struct {
124415  	Xi     uint8
124416  	XnChar uint8
124417  	Xcode  uint8
124418  } // struct{i uint8,nChar uint8,code uint8}
124419  
124420  type t101 struct {
124421  	XnEq     uint16
124422  	XnBtm    uint16
124423  	XnTop    uint16
124424  	XnIdxCol uint16
124425  	XpIndex  unsafe.Pointer
124426  } // struct{nEq uint16,nBtm uint16,nTop uint16,nIdxCol uint16,pIndex *struct{}}
124427  
124428  type t105 struct {
124429  	XidxNum    int32
124430  	XneedFree  uint8
124431  	XisOrdered int8
124432  	XomitMask  uint16
124433  	XidxStr    *int8
124434  } // struct{idxNum int32,needFree uint8,isOrdered int8,omitMask uint16,idxStr *int8}
124435  
124436  type t313 struct {
124437  	X [0]struct {
124438  		Xbtree t101
124439  		Xvtab  t105
124440  	}
124441  	U [12]byte
124442  } // 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}}
124443  
124444  type t51 struct {
124445  	Xa int32
124446  	Xb unsafe.Pointer
124447  } // struct{a int32,b *struct{}}
124448  
124449  type t55 struct {
124450  	XpLimit  unsafe.Pointer
124451  	XpOffset unsafe.Pointer
124452  } // struct{pLimit *struct{},pOffset *struct{}}
124453  
124454  type t54 struct {
124455  	Xvalue int32
124456  	Xmask  int32
124457  } // struct{value int32,mask int32}
124458  
124459  type t53 struct {
124460  	Xlhs  uint8
124461  	Xnrhs uint8
124462  } // struct{lhs uint8,nrhs uint8}
124463  
124464  type t132 struct {
124465  	Xop   int32
124466  	Xmask uint32
124467  }                       // struct{op int32,mask uint32}
124468  func str(n int) *int8   { return (*int8)(unsafe.Pointer(&strTab[n])) }
124469  func wstr(n int) *int32 { return (*int32)(unsafe.Pointer(&strTab[n])) }
124470  
124471  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")